Microbug / MicroBitDAL_SB2_TEST

Fork of MicroBitDALImageRewrite by Joe Finney

Revision:
0:47d8ba08580f
Child:
1:3e0360107f98
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MicroBit.cpp	Sun Apr 12 17:38:56 2015 +0000
@@ -0,0 +1,32 @@
+#include "inc/MicroBit.h"
+
+
+/**
+  * Device level Message Bus abstraction
+  */
+
+void (*MicroBit::messageBus)(MicroBitEvent *) = NULL;
+
+
+
+void MicroBit::init()
+{
+
+}
+
+
+
+/**
+  * Constructor. 
+  * Create a representation of a MicroBit device.
+  * @param messageBus callback function to receive MicroBitMessageBus events.
+  */
+MicroBit::MicroBit(void (*messageBus)(MicroBitEvent *)) :
+  userLED(MICROBIT_ID_USER_LED, MICROBIT_PIN_USER_LED),
+  display(MICROBIT_ID_DISPLAY, 5, 5)
+  
+{
+    // Just store this for later.
+    init();
+    MicroBit::messageBus = messageBus;
+}