From 67cf90734190ec15748fe96b7375292f4c14c522 Mon Sep 17 00:00:00 2001 From: Martin Woolley Date: Fri, 28 Oct 2016 13:50:55 +0100 Subject: [PATCH] Made event type more specific for listening to buttons --- source/examples/bluetooth-eddystone-uid/main.cpp | 4 ++-- source/examples/bluetooth-eddystone-url/main.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/examples/bluetooth-eddystone-uid/main.cpp b/source/examples/bluetooth-eddystone-uid/main.cpp index 2102304..d68d67e 100755 --- a/source/examples/bluetooth-eddystone-uid/main.cpp +++ b/source/examples/bluetooth-eddystone-uid/main.cpp @@ -43,8 +43,8 @@ int main() // Initialise the micro:bit runtime. uBit.init(); - uBit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_EVT_ANY, onButtonA); - uBit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_EVT_ANY, onButtonB); + uBit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_BUTTON_EVT_CLICK, onButtonA); + uBit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_BUTTON_EVT_CLICK, onButtonB); startAdvertising(); diff --git a/source/examples/bluetooth-eddystone-url/main.cpp b/source/examples/bluetooth-eddystone-url/main.cpp index 39b0b03..dae29e9 100755 --- a/source/examples/bluetooth-eddystone-url/main.cpp +++ b/source/examples/bluetooth-eddystone-url/main.cpp @@ -42,8 +42,8 @@ int main() // Initialise the micro:bit runtime. uBit.init(); - uBit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_EVT_ANY, onButtonA); - uBit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_EVT_ANY, onButtonB); + uBit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_BUTTON_EVT_CLICK, onButtonA); + uBit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_BUTTON_EVT_CLICK, onButtonB); startAdvertising();