X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=blobdiff_plain;f=firmware%2Fmain.c;h=02e75d9adfdc868d53aceede6cc9c0cd00f82f1d;hp=25ea829511781e3e365c282a9bc0ae0e4357b8c3;hb=47e678a90062fa2dbc6cb8f9e5efc81072f5dcc5;hpb=ed608010c0a708b9be0d3577d7f4d3313eb2e851 diff --git a/firmware/main.c b/firmware/main.c index 25ea829..02e75d9 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -7,7 +7,7 @@ #include "lights.h" -void hw_setup() +static void hw_setup() { wdt_enable(WDTO_1S); init_battery(); @@ -24,7 +24,7 @@ void hw_setup() set_sleep_mode(SLEEP_MODE_IDLE); } -void hw_suspend() +static void hw_suspend() { susp_pwm(); susp_adc(); @@ -39,6 +39,7 @@ void power_down() uint16_t wake_count = 0; unsigned char btn; + hw_suspend(); sleep_again: // enable PCINT14, so that user can wake up later GIMSK |= _BV(PCIE1); @@ -92,7 +93,6 @@ int main(void) log_set_state(3); hw_setup(); - hw_suspend(); power_down(); sei();