add idle mode sleep

This commit is contained in:
Olaf Rempel 2010-12-26 18:46:47 +01:00
parent 85cc18f063
commit cb19bb91ec

5
main.c
View File

@ -31,6 +31,7 @@
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include "main.h"
#include "blmc.h"
@ -156,6 +157,8 @@ int main(void)
if (read_parameters())
blmc.flags |= FLAG_INVALID_EEPROM;
set_sleep_mode(SLEEP_MODE_IDLE);
sei();
while (1) {
@ -204,6 +207,8 @@ int main(void)
/* do a spinup from main loop (blocking for > 200ms) */
if (blmc.flags & FLAG_COM_SPINUP)
spinup();
sleep_mode();
};
return 0;
}