X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=firmware%2Fmain.c;h=02e75d9adfdc868d53aceede6cc9c0cd00f82f1d;hb=47e678a90062fa2dbc6cb8f9e5efc81072f5dcc5;hp=d10a322bd34c721aca16d3bfbc63e12c2e4bb570;hpb=a444b197e7f5d489227ea6952b78201f26aa82a0;p=bike-lights.git diff --git a/firmware/main.c b/firmware/main.c index d10a322..02e75d9 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -7,9 +7,10 @@ #include "lights.h" -void hw_setup() +static void hw_setup() { wdt_enable(WDTO_1S); + init_battery(); init_pwm(); init_adc(); init_tmr(); @@ -23,7 +24,7 @@ void hw_setup() set_sleep_mode(SLEEP_MODE_IDLE); } -void hw_suspend() +static void hw_suspend() { susp_pwm(); susp_adc(); @@ -38,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); @@ -91,7 +93,6 @@ int main(void) log_set_state(3); hw_setup(); - hw_suspend(); power_down(); sei();