mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 05:06:44 +00:00
Add cystom loops
This commit is contained in:
parent
b30c4ca589
commit
1e045499fb
@ -36,6 +36,10 @@
|
|||||||
|
|
||||||
#include "dev/device.h"
|
#include "dev/device.h"
|
||||||
|
|
||||||
|
#if HASP_USE_CUSTOM > 0
|
||||||
|
#include "custom/my_custom.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
bool isConnected;
|
bool isConnected;
|
||||||
bool isRunning = 1;
|
bool isRunning = 1;
|
||||||
|
|
||||||
@ -138,6 +142,10 @@ void setup()
|
|||||||
gpioSetup();
|
gpioSetup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HASP_USE_CUSTOM > 0
|
||||||
|
custom_setup();
|
||||||
|
#endif
|
||||||
|
|
||||||
mainLastLoopTime = millis(); // - 1000; // reset loop counter
|
mainLastLoopTime = millis(); // - 1000; // reset loop counter
|
||||||
printf("%s %d\n", __FILE__, __LINE__);
|
printf("%s %d\n", __FILE__, __LINE__);
|
||||||
// delay(250);
|
// delay(250);
|
||||||
@ -156,6 +164,10 @@ void loop()
|
|||||||
gpioLoop();
|
gpioLoop();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HASP_USE_CUSTOM > 0
|
||||||
|
custom_loop();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Timer Loop */
|
/* Timer Loop */
|
||||||
if(millis() - mainLastLoopTime >= 1000) {
|
if(millis() - mainLastLoopTime >= 1000) {
|
||||||
/* Runs Every Second */
|
/* Runs Every Second */
|
||||||
@ -166,11 +178,19 @@ void loop()
|
|||||||
otaEverySecond(); // progressbar
|
otaEverySecond(); // progressbar
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HASP_USE_CUSTOM > 0
|
||||||
|
custom_every_second();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Runs Every 5 Seconds */
|
/* Runs Every 5 Seconds */
|
||||||
if(mainLoopCounter == 0 || mainLoopCounter == 5) {
|
if(mainLoopCounter == 0 || mainLoopCounter == 5) {
|
||||||
|
|
||||||
haspDevice.loop_5s();
|
haspDevice.loop_5s();
|
||||||
gpioEvery5Seconds();
|
gpioEvery5Seconds();
|
||||||
|
|
||||||
|
#if HASP_USE_CUSTOM > 0
|
||||||
|
custom_every_5seconds();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset loop counter every 10 seconds */
|
/* Reset loop counter every 10 seconds */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user