add idle mode sleep
This commit is contained in:
parent
85cc18f063
commit
cb19bb91ec
5
main.c
5
main.c
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
|
#include <avr/sleep.h>
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "blmc.h"
|
#include "blmc.h"
|
||||||
@ -156,6 +157,8 @@ int main(void)
|
|||||||
if (read_parameters())
|
if (read_parameters())
|
||||||
blmc.flags |= FLAG_INVALID_EEPROM;
|
blmc.flags |= FLAG_INVALID_EEPROM;
|
||||||
|
|
||||||
|
set_sleep_mode(SLEEP_MODE_IDLE);
|
||||||
|
|
||||||
sei();
|
sei();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -204,6 +207,8 @@ int main(void)
|
|||||||
/* do a spinup from main loop (blocking for > 200ms) */
|
/* do a spinup from main loop (blocking for > 200ms) */
|
||||||
if (blmc.flags & FLAG_COM_SPINUP)
|
if (blmc.flags & FLAG_COM_SPINUP)
|
||||||
spinup();
|
spinup();
|
||||||
|
|
||||||
|
sleep_mode();
|
||||||
};
|
};
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user