]> www.fi.muni.cz Git - tinyboard.git/blobdiff - projects/step-up/main.c
step-up/README: detailed description of the project
[tinyboard.git] / projects / step-up / main.c
index 55e2ef75737cd58e437d7750954ccc7078b393d1..69657a8a70052d37b5b4cdd1545febfeba8ad456 100644 (file)
@@ -9,34 +9,31 @@
 
 static void hw_setup()
 {
+       power_all_disable();
+
        wdt_enable(WDTO_1S);
 
-       //init_battery();
+       init_battery();
        init_pwm();
        init_adc();
 
-       //init_tmr();
-       //init_buttons();
+       init_buttons();
 
        init_pwmled();
-       //init_gpio();
-       //init_ambient();
-       //init_pattern();
-       //init_control();
+       init_pattern();
+       init_control();
 
        set_sleep_mode(SLEEP_MODE_IDLE);
 }
 
-#if 0
 static void hw_suspend()
 {
        susp_pwm();
        susp_adc();
-       susp_tmr();
-       susp_gpio();
        susp_buttons();
 
        wdt_disable();
+       power_all_disable();
 }
 
 void power_down()
@@ -61,19 +58,15 @@ void power_down()
        // ok, so I will wake up
        hw_setup();
 }
-#endif
 
 int main(void)
 {
        init_log();
 
-       power_usi_disable(); // Once for lifetime
-       ACSR |= _BV(ACD);    // disable analog comparator
-
        log_set_state(3);
 
        hw_setup();
-       // power_down(); - not while still debugging
+       power_down();
 
        sei();
 #if 1