summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2019-09-14 12:40:24 -0700
committerScott Shawcroft <scott@tannewt.org>2019-10-21 18:57:03 -0700
commitae30a1e5aa198bdeee7dce04194b027ff4e3d65a (patch)
treed760570174d554598113c9349c14e34d8f710246 /lib
parent84c0d6cdf8c0bff1b61ce2fa6edcd2b4a65b2556 (diff)
Refine _bleio
This PR refines the _bleio API. It was originally motivated by the addition of a new CircuitPython service that enables reading and modifying files on the device. Moving the BLE lifecycle outside of the VM motivated a number of changes to remove heap allocations in some APIs. It also motivated unifying connection initiation to the Adapter class rather than the Central and Peripheral classes which have been removed. Adapter now handles the GAP portion of BLE including advertising, which has moved but is largely unchanged, and scanning, which has been enhanced to return an iterator of filtered results. Once a connection is created (either by us (aka Central) or a remote device (aka Peripheral)) it is represented by a new Connection class. This class knows the current connection state and can discover and instantiate remote Services along with their Characteristics and Descriptors. Relates to #586
Diffstat (limited to 'lib')
-rw-r--r--lib/utils/interrupt_char.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/interrupt_char.c b/lib/utils/interrupt_char.c
index 91ee5c80e..da7f70254 100644
--- a/lib/utils/interrupt_char.c
+++ b/lib/utils/interrupt_char.c
@@ -49,7 +49,7 @@ void mp_keyboard_interrupt(void) {
// Check to see if we've been CTRL-C'ed by autoreload or the user.
bool mp_hal_is_interrupted(void) {
- return MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
+ return MP_STATE_VM(mp_pending_exception) != NULL;
}
#endif