From 141a3443b4b9df261271f71a07cefd465ee03583 Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Thu, 10 Aug 2023 19:41:52 +0100 Subject: [PATCH] Reduce power consumption of LED matrix on power off mode. As described in: - https://github.com/lancaster-university/codal-microbit-v2/issues/30#issuecomment-1673717030 --- source/NRF52LedMatrix.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/NRF52LedMatrix.cpp b/source/NRF52LedMatrix.cpp index 5acccb7c..89244dcd 100644 --- a/source/NRF52LedMatrix.cpp +++ b/source/NRF52LedMatrix.cpp @@ -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++)