Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MicroBitDALImageRewrite by
Diff: MicroBit.cpp
- Revision:
- 1:3e0360107f98
- Parent:
- 0:47d8ba08580f
- Child:
- 4:f998ee705a20
--- a/MicroBit.cpp Sun Apr 12 17:38:56 2015 +0000 +++ b/MicroBit.cpp Thu Apr 16 13:50:24 2015 +0000 @@ -5,9 +5,7 @@ * Device level Message Bus abstraction */ -void (*MicroBit::messageBus)(MicroBitEvent *) = NULL; - - +MicroBitMessageBus MicroBit::MessageBus; void MicroBit::init() { @@ -21,12 +19,11 @@ * Create a representation of a MicroBit device. * @param messageBus callback function to receive MicroBitMessageBus events. */ -MicroBit::MicroBit(void (*messageBus)(MicroBitEvent *)) : +MicroBit::MicroBit() : userLED(MICROBIT_ID_USER_LED, MICROBIT_PIN_USER_LED), - display(MICROBIT_ID_DISPLAY, 5, 5) + display(MICROBIT_ID_DISPLAY, 5, 5), + leftButton(MICROBIT_ID_LEFT_BUTTON,MICROBIT_PIN_LEFT_BUTTON) { - // Just store this for later. init(); - MicroBit::messageBus = messageBus; }