This commit is contained in:
2026-08-31 23:12:28 -04:00
parent 2152b8f727
commit 089be9564b
13 changed files with 147 additions and 39 deletions
+12 -2
View File
@@ -1,15 +1,25 @@
// One-shot clock gating for every peripheral this firmware never uses (and
// the ADC, which adc_Enable()/adc_Disable() power up only around a reading).
// In use and left alone: SPI1 (radio + EEPROM), TWI0 (RTC + NFC tag), and
// USART0 when serial logging is compiled in.
#include "power_mgmt.h"
void shutdown_all_peripherals(void)
{
power_adc_disable();
power_timer0_disable();
power_timer1_disable();
power_timer2_disable();
power_timer3_disable();
power_usart1_disable();
#ifdef power_spi0_disable
power_spi0_disable();
#endif
#ifdef power_twi1_disable
power_twi1_disable();
#endif
#if !DO_UART
power_usart0_disable();
power_usart1_disable();
#endif
}