From ab9e6fc5502451febbd5d1692cfbfaa19df8f1f3 Mon Sep 17 00:00:00 2001 From: microbit-carlos Date: Fri, 31 Aug 2018 17:16:00 +0000 Subject: [PATCH] When updateGesture() creates a SHAKE event also register it as the last gesture detected Background info: https://github.com/lancaster-university/microbit-dal/issues/372#issuecomment-417731360 --- source/drivers/MicroBitAccelerometer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/drivers/MicroBitAccelerometer.cpp b/source/drivers/MicroBitAccelerometer.cpp index da71ccb..df56ae7 100644 --- a/source/drivers/MicroBitAccelerometer.cpp +++ b/source/drivers/MicroBitAccelerometer.cpp @@ -311,6 +311,7 @@ void MicroBitAccelerometer::updateGesture() if (g == MICROBIT_ACCELEROMETER_EVT_SHAKE) { + lastGesture = MICROBIT_ACCELEROMETER_EVT_SHAKE; MicroBitEvent e(MICROBIT_ID_GESTURE, MICROBIT_ACCELEROMETER_EVT_SHAKE); return; }