Browse Source

add idle mode sleep

master
Olaf Rempel 11 years ago
parent
commit
cb19bb91ec
  1. 5
      main.c

5
main.c

@ -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;
}
Loading…
Cancel
Save