forking microbit

Dependencies:   microbit-dal-acc

Dependents:   microbit-accelerometer-led

Fork of microbit by Martin Woolley

Files at this revision

API Documentation at this revision

Comitter:
LancasterUniversity
Date:
Fri Apr 08 16:36:37 2016 +0100
Parent:
1:af427e419320
Child:
6:9cbea9993ef1
Commit message:
Synchronized with git rev c5889e4c
Author: Joe Finney
microbit: BUGFIX Wake accelerometer on listen for GESTURE events

Previously, the accelerometer was only lazily initialised when it was
acccessed directly or an event handler was registered for
MICROBIT_ID_ACCELEROMETER. This patch also wakes the accelerometer on event
handlers registering for MICROBIT_ID_GESTURE.

Changed in this revision

source/MicroBit.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/source/MicroBit.cpp	Thu Apr 07 01:30:13 2016 +0100
+++ b/source/MicroBit.cpp	Fri Apr 08 16:36:37 2016 +0100
@@ -208,6 +208,7 @@
             break;
 
         case MICROBIT_ID_ACCELEROMETER:
+        case MICROBIT_ID_GESTURE:
             // A listener has been registered for the accelerometer.
             // The accelerometer uses lazy instantiation, we just need to read the data once to start it running.
             accelerometer.updateSample();
@@ -219,4 +220,4 @@
             thermometer.updateSample();
             break;
     }
-}
+}
\ No newline at end of file