diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2020-05-11 21:20:07 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-06-05 14:04:20 +1000 |
commit | e6881f08292d03f089185718c131f543d095089b (patch) | |
tree | 1819a0b92c14bdeb3289e49c799454ba3d6cf43c /examples/bluetooth/ble_temperature.py | |
parent | 02cc4462b70729a42cb127c840fee891dd08a0d4 (diff) |
extmod/modbluetooth: Make modbluetooth event not a bitfield.
There doesn't appear to be any use for only triggering on specific events,
so it's just easier to number them sequentially. This makes them smaller
values so they take up only 1 byte in the ringbuf, only 1 byte for the
opcode in the bytecode, and makes room for more events.
Also add a couple of new event types that need to be implemented (to avoid
re-numbering later).
And rename _COMPLETE and _STATUS to _DONE for consistency.
In the future the "trigger" keyword argument can be reinstated by requiring
the user to compute the bitmask, eg:
ble.irq(handler, 1 << _IRQ_SCAN_RESULT | 1 << _IRQ_SCAN_DONE)
Diffstat (limited to 'examples/bluetooth/ble_temperature.py')
-rw-r--r-- | examples/bluetooth/ble_temperature.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/bluetooth/ble_temperature.py b/examples/bluetooth/ble_temperature.py index 01d2f7441..fd24e74d7 100644 --- a/examples/bluetooth/ble_temperature.py +++ b/examples/bluetooth/ble_temperature.py @@ -11,8 +11,8 @@ from ble_advertising import advertising_payload from micropython import const -_IRQ_CENTRAL_CONNECT = const(1 << 0) -_IRQ_CENTRAL_DISCONNECT = const(1 << 1) +_IRQ_CENTRAL_CONNECT = const(1) +_IRQ_CENTRAL_DISCONNECT = const(2) # org.bluetooth.service.environmental_sensing _ENV_SENSE_UUID = bluetooth.UUID(0x181A) |