Skip to content

nrf: Use common implementation of machine disable/enable IRQ. #17213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dpgeorge
Copy link
Member

Summary

This is a breaking change due to the signature change of enable_irq(). Previously the signature was:

machine.enable_irq()

Now the signature matches other ports, and the docs, and is:

machine.enable_irq(state)

Where state is the return value from machine.disable_irq().

Testing

Tested on ARDUINO_NANO_33_BLE_SENSE. That board now passes the tests/extmod/machine_disable_irq.py test.

Copy link
Contributor

@andrewleech andrewleech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, were these already no-operation when the nrf Bluetooth stack is enabled? That's a surprising trap.

@dpgeorge
Copy link
Member Author

dpgeorge commented May 9, 2025

were these already no-operation when the nrf Bluetooth stack is enabled?

Yes. I don't think there's any way around that?

@andrewleech
Copy link
Contributor

were these already no-operation when the nrf Bluetooth stack is enabled?

Yes. I don't think there's any way around that?

Yeah probably not, although there is a way to debug / step through application code on these chips without interrupting the stuff device called "monitor mode debugging". I bring this up because it presumably uses some form of interrupt masking which might work here to effectively mask out "application" interrupts without interrupting the soft device.
On the other hand, migrating to nimble probably removes these restrictions anyway.

@andrewleech
Copy link
Contributor

Regardless, the changes look good, consolidating functionality and signatures to match other ports is a worthy direction to follow certainly.

This is a breaking change due to the signature change of `enable_irq()`.
Previously the signature was:

    machine.enable_irq()

Now the signature matches other ports, and the docs, and is:

    machine.enable_irq(state)

Where `state` is the return value from `machine.disable_irq()`.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the nrf-use-common-machine-irq-function branch from 9ac710a to a1ee42c Compare May 21, 2025 03:31
@dpgeorge dpgeorge merged commit a1ee42c into micropython:master May 21, 2025
7 checks passed
@dpgeorge dpgeorge deleted the nrf-use-common-machine-irq-function branch May 21, 2025 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants