PCB lives now in its own git repo https://git.la10cy.net/DeltaLima/CanGrow-12V-PCB
61 lines
1 KiB
C
61 lines
1 KiB
C
/*
|
|
*
|
|
* include/CanGrow_Timer.h - timer header file
|
|
*
|
|
*
|
|
*
|
|
*/
|
|
|
|
|
|
/*
|
|
* Timer stuff
|
|
*/
|
|
|
|
void Timer_Sensor() {
|
|
Sensor_Update();
|
|
}
|
|
|
|
void Timer_Output() {
|
|
/* Update the outputs (switching GPIOs, sending webcall, etc) */
|
|
Output_Update();
|
|
}
|
|
|
|
|
|
|
|
void Timer_Control() {
|
|
const static char LogLoc[] PROGMEM = "[Core:Timer_1s]";
|
|
#ifdef DEBUG2
|
|
Log.verbose(F("%s - trigger [Sensor:Update]" CR), LogLoc);
|
|
#endif
|
|
|
|
/* Updating Light output states in memory */
|
|
Control_Light();
|
|
|
|
/* Updating Air output states in memory */
|
|
Control_Air();
|
|
|
|
/* Updating Water output sates in memory */
|
|
Control_Water();
|
|
}
|
|
|
|
void Timer_3s() {
|
|
const static char LogLoc[] PROGMEM = "[Core:Timer_3s]";
|
|
#ifdef DEBUG2
|
|
Log.verbose(F("%s" CR), LogLoc);
|
|
#endif
|
|
|
|
}
|
|
|
|
void Timer_5s() {
|
|
const static char LogLoc[] PROGMEM = "[Core:Timer_5s]";
|
|
#ifdef DEBUG2
|
|
Log.verbose(F("%s" CR), LogLoc);
|
|
#endif
|
|
}
|
|
|
|
void TimeR_Init() {
|
|
timer.setInterval(1000, Timer_Output);
|
|
timer.setInterval(1000, Timer_Sensor);
|
|
timer.setInterval(100, Timer_Control);
|
|
|
|
}
|