#include "grbl.h"
Go to the source code of this file.
Macros | |
#define | SLEEP_SEC_PER_OVERFLOW (65535.0*64.0/F_CPU) |
With 16-bit timer size and prescaler. More... | |
#define | SLEEP_COUNT_MAX (SLEEP_DURATION/SLEEP_SEC_PER_OVERFLOW) |
Functions | |
void | sleep_init () |
Initialization routine for sleep timer. More... | |
ISR (TIMER3_OVF_vect) | |
Increment sleep counter with each timer overflow. More... | |
void | sleep_check () |
Checks running conditions for sleep. If satisfied, enables sleep countdown and executes. More... | |
Variables | |
volatile uint8_t | sleep_counter |
#define SLEEP_COUNT_MAX (SLEEP_DURATION/SLEEP_SEC_PER_OVERFLOW) |
#define SLEEP_SEC_PER_OVERFLOW (65535.0*64.0/F_CPU) |
ISR | ( | TIMER3_OVF_vect | ) |
void sleep_check | ( | ) |
Checks running conditions for sleep. If satisfied, enables sleep countdown and executes.
NOTE: Sleep procedures can be blocking, since Grbl isn't receiving any commands, nor moving.
NOTE: With overrides or in laser mode, modal spindle and coolant state are not guaranteed. Need
void sleep_init | ( | ) |
Initialization routine for sleep timer.
Initialize sleep timer.
NOTE: By using an overflow interrupt, the timer is automatically reloaded upon overflow.
< Normal operation. Overflow.
< Stop timer
< Enable timer with 1/64 prescaler. ~66.8sec max with uint8 and 0.262sec/tick