Skip to content

Commit

Permalink
Reduce power consumption of LED matrix on power off mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-carlos committed Aug 10, 2023
1 parent 4f2aedc commit 4ff490b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/NRF52LedMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,14 @@ void NRF52LEDMatrix::disable()

// Disable the timer that drivers the display
timer.disable();
timer.disableIRQ();

// Disable GPIOTE control of the display pins
for (int column = 0; column < matrixMap.columns; column++)
NRF_GPIOTE->CONFIG[gpiote[column]] = 0;
// FIXME: When GPIOTE is disabled here "system off" consumes almost 1mA @ 3V
// It's unclear how changing this peripheral causes the additional power consumption
// https://github.com/lancaster-university/codal-microbit-v2/issues/30
// for (int column = 0; column < matrixMap.columns; column++)
// NRF_GPIOTE->CONFIG[gpiote[column]] = 0;


// Put all pins into high impedance mode.
for (int column = 0; column < matrixMap.columns; column++)
Expand Down

0 comments on commit 4ff490b

Please sign in to comment.