Add Thinknode M4 variant_shutdown() (#9449)

This commit is contained in:
Jonathan Bennett
2026-01-27 09:56:56 -06:00
committed by GitHub
parent c8079d4115
commit 91ad861b26

View File

@@ -49,3 +49,21 @@ void initVariant()
pinMode(Battery_LED_4, OUTPUT);
ledOff(Battery_LED_4);
}
/// called from main-nrf52.cpp during the cpuDeepSleep() function
void variant_shutdown()
{
for (int pin = 0; pin < 48; pin++) {
if (pin == PIN_GPS_EN || pin == PIN_BUTTON1) {
continue;
}
pinMode(pin, OUTPUT);
digitalWrite(pin, LOW);
if (pin >= 32) {
NRF_P1->DIRCLR = (1 << (pin - 32));
} else {
NRF_GPIO->DIRCLR = (1 << pin);
}
}
digitalWrite(PIN_GPS_EN, HIGH);
}