Skip to content

Commit

Permalink
turnsoff RGB before deepsleep and off
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianhugo committed Dec 4, 2024
1 parent bee9610 commit 4bf3d36
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/MicroBitPowerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 4bf3d36

Please sign in to comment.