some stuff
This commit is contained in:
parent
403314ed83
commit
e51e91ce04
|
@ -8,7 +8,7 @@ FUSES = lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0x01:m
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
SRC=$(wildcard lib/*.c *.c apps/*.c)
|
SRC=$(wildcard lib/*.c apps/*.c *.c)
|
||||||
OBJECTS= $(SRC:.c=.o)
|
OBJECTS= $(SRC:.c=.o)
|
||||||
LSTFILES= $(SRC:.c=.lst)
|
LSTFILES= $(SRC:.c=.lst)
|
||||||
HEADERS=$(wildcard lib/*.h *.h)
|
HEADERS=$(wildcard lib/*.h *.h)
|
||||||
|
|
|
@ -54,6 +54,7 @@ void do_powerDown(void)
|
||||||
static timer_t mytimer;
|
static timer_t mytimer;
|
||||||
static uint8_t pwdn_state;
|
static uint8_t pwdn_state;
|
||||||
static bool ledRon;
|
static bool ledRon;
|
||||||
|
uint8_t oldreg;
|
||||||
if (mode_uninitialized) {
|
if (mode_uninitialized) {
|
||||||
mode_uninitialized = false;
|
mode_uninitialized = false;
|
||||||
pwdn_state = 0;
|
pwdn_state = 0;
|
||||||
|
@ -104,12 +105,14 @@ void do_powerDown(void)
|
||||||
break;
|
break;
|
||||||
case 5: //now we can really power down
|
case 5: //now we can really power down
|
||||||
// lets switch everything off
|
// lets switch everything off
|
||||||
|
oldreg = PCMSK2;
|
||||||
|
PCMSK2 |= 3; //PCINT16 PCINT17
|
||||||
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
|
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
|
||||||
sleep_enable();
|
sleep_enable();
|
||||||
sei();
|
sei();
|
||||||
sleep_cpu();
|
sleep_cpu();
|
||||||
sleep_disable();
|
sleep_disable();
|
||||||
|
PCMSK2 = oldreg;
|
||||||
NextMode = 0;
|
NextMode = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -120,6 +123,10 @@ void do_powerDown(void)
|
||||||
} //end timer expired
|
} //end timer expired
|
||||||
} // end do_powerDown
|
} // end do_powerDown
|
||||||
|
|
||||||
|
|
||||||
|
ISR(PCINT2_vect){ ; }
|
||||||
|
|
||||||
|
|
||||||
void __attribute__ ((noreturn)) main(void)
|
void __attribute__ ((noreturn)) main(void)
|
||||||
{
|
{
|
||||||
/* hardware initialisation: */
|
/* hardware initialisation: */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user