X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=tinyboard.git;a=blobdiff_plain;f=projects%2Fstep-up%2Fmain.c;h=25d80df070bb4bf7269e89c6ee50792fdb245612;hp=c1ee381453a334bf43493ddb93e287f9fa2bea62;hb=HEAD;hpb=0c777e2b120ebdb407cc5cbbd29dda16353cd931 diff --git a/projects/step-up/main.c b/projects/step-up/main.c index c1ee381..25d80df 100644 --- a/projects/step-up/main.c +++ b/projects/step-up/main.c @@ -72,13 +72,15 @@ int main(void) #if 1 while (1) { cli(); - if (pwm_running) { + if (pwm_enabled) { set_sleep_mode(SLEEP_MODE_IDLE); - } else if (adc_running) { + } else if (adc_enabled) { set_sleep_mode(SLEEP_MODE_ADC); } else { set_sleep_mode(SLEEP_MODE_PWR_DOWN); } + + sleep_enable(); // keep BOD active, no sleep_bod_disable(); sei(); sleep_cpu();