start_next_adc();
}
-#if 0
void susp_adc()
{
ADCSRA = 0;
DIDR0 = 0;
}
-static void adc1_gain20_adc(uint16_t adcsum)
-{
- // running average
- adc1_gain20_offset += adcsum
- - (adc1_gain20_offset >> ADC1_GAIN20_OFFSET_SHIFT);
-}
-#endif
-
static void inline adc_based_timer()
{
static unsigned char count;
void long_press()
{
- e.shutdown_in_progress = 0;
- pattern_reload();
+ power_down();
}
pattern_t *pwmled_pattern_select()
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()
// ok, so I will wake up
hw_setup();
}
-#endif
int main(void)
{
log_set_state(3);
hw_setup();
- // power_down(); - not while still debugging
+ power_down();
sei();
#if 1
PORTB &= ~_BV(PB4); // set to zero
}
-#if 0
void susp_pwm()
{
- unsigned char i;
-
- for (i = 0; i < N_PWMLEDS; i++)
- pwm[i] = 0;
-
- DDRB &= ~(_BV( PB1 ) | _BV( PB3 ) | _BV( PB5 ));
- TCCR1D = TCCR1C = TCCR1B = TCCR1A = 0;
+ DDRB &= ~(_BV( PB4 ));
+ PORTB &= ~(_BV( PB4 ));
+ TCCR1 = 0;
TIMSK = 0;
TIFR = 0;
PLLCSR &= ~(_BV(PLLE) | _BV(PCKE));
}
-#endif
void pwm_off()
{