From 4bf3d3646f6c632a3db979298d011a9d76ee5896 Mon Sep 17 00:00:00 2001 From: fabianhugo Date: Wed, 4 Dec 2024 16:21:53 +0100 Subject: [PATCH] turnsoff RGB before deepsleep and off --- source/MicroBitPowerManager.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/MicroBitPowerManager.cpp b/source/MicroBitPowerManager.cpp index a4194cb2..bdcbd7bc 100644 --- a/source/MicroBitPowerManager.cpp +++ b/source/MicroBitPowerManager.cpp @@ -314,7 +314,11 @@ ManagedBuffer MicroBitPowerManager::readProperty(int property) void MicroBitPowerManager::off() { setPowerLED( true /*doSleep*/); - + + // Calliope: turn RGB LEDs off + uint8_t rgbBuffer[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; + neopixel_send_buffer(io.RGB, rgbBuffer, sizeof(rgbBuffer)); + // Update peripheral drivers CodalComponent::deepSleepAll( deepSleepCallbackBegin, NULL); @@ -795,6 +799,10 @@ int MicroBitPowerManager::simpleDeepSleep( bool wakeOnTime, CODAL_TIMESTAMP wake // Configure for sleep mode setPowerLED( true /*doSleep*/); + // Calliope: turn RGB LEDs off + uint8_t rgbBuffer[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; + neopixel_send_buffer(io.RGB, rgbBuffer, sizeof(rgbBuffer)); + // Update peripheral drivers CodalComponent::deepSleepAll( wakeUpSources ? deepSleepCallbackBeginWithWakeUps : deepSleepCallbackBegin, NULL);