Damien George f2ad152e7e extmod/modbluetooth: Run BLE IRQ callback in protected NLR context.
The call to invoke_irq_handler_run() always needs to run in a protected NLR
context, to catch exceptions from the Python handler, and the m_new's (and
also mp_local_alloc when PYSTACK is enabled).  With
MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS_WITH_INTERLOCK enabled there was
already an explicit nlr_push, and that is now used in all cases.

Without this change, on stm32 (for example), the callbacks from the BLE
stack to invoke_irq_handler() were made via static scheduled nodes which do
not have any NLR protection, and hence would lead to a hard fault (uncaught
NLR) if an exception was raised in the Python BLE IRQ handler.  This was a
regression introduced by 8045ac07f599c0ccc447c88a0b778f704b497559, which is
fixed by this commit.

Signed-off-by: Damien George <damien@micropython.org>
2022-09-23 15:21:54 +10:00
..
2017-07-18 11:57:39 +10:00
2019-10-29 14:17:29 +11:00
2017-07-18 11:57:39 +10:00