Add HASP_USE_CUSTOM

This commit is contained in:
fvanroie 2021-07-12 02:31:43 +02:00
parent 4ab180be26
commit a2ab8cfc2c
3 changed files with 27 additions and 2 deletions

View File

@ -313,6 +313,10 @@ void debug_get_tag(uint8_t tag, char* buffer)
memcpy_P(buffer, PSTR("FONT"), 5); memcpy_P(buffer, PSTR("FONT"), 5);
break; break;
case TAG_CUSTOM:
memcpy_P(buffer, PSTR("CUST"), 5);
break;
default: default:
memcpy_P(buffer, PSTR("----"), 5); memcpy_P(buffer, PSTR("----"), 5);
break; break;

View File

@ -191,7 +191,9 @@ enum {
TAG_LVGL = 90, TAG_LVGL = 90,
TAG_LVFS = 91, TAG_LVFS = 91,
TAG_FONT = 92 TAG_FONT = 92,
TAG_CUSTOM = 99
}; };
//#define TERM_COLOR_Black "\u001b[30m" //#define TERM_COLOR_Black "\u001b[30m"

View File

@ -20,6 +20,10 @@
#include "hasp_gui.h" #include "hasp_gui.h"
#endif #endif
#if HASP_USE_CUSTOM > 0
#include "custom/my_custom.h"
#endif
bool isConnected; bool isConnected;
uint8_t mainLoopCounter = 0; uint8_t mainLoopCounter = 0;
unsigned long mainLastLoopTime = 0; unsigned long mainLastLoopTime = 0;
@ -106,6 +110,10 @@ void setup()
slaveSetup(); slaveSetup();
#endif #endif
#if HASP_USE_CUSTOM > 0
custom_setup();
#endif
mainLastLoopTime = -1000; // reset loop counter mainLastLoopTime = -1000; // reset loop counter
delay(20); delay(20);
// guiStart(); // guiStart();
@ -137,6 +145,10 @@ IRAM_ATTR void loop()
consoleLoop(); consoleLoop();
#endif #endif
#if HASP_USE_CUSTOM > 0
custom_loop();
#endif
#ifdef HASP_USE_STAT_COUNTER #ifdef HASP_USE_STAT_COUNTER
statLoopCounter++; // measures the average looptime statLoopCounter++; // measures the average looptime
#endif #endif
@ -152,6 +164,9 @@ IRAM_ATTR void loop()
telnetEverySecond(); telnetEverySecond();
#endif #endif
#if HASP_USE_CUSTOM > 0
custom_every_second();
#endif
// debugEverySecond(); // debugEverySecond();
switch(++mainLoopCounter) { switch(++mainLoopCounter) {
@ -161,7 +176,7 @@ IRAM_ATTR void loop()
case 2: case 2:
#if HASP_USE_HTTP_ASYNC > 0 #if HASP_USE_HTTP_ASYNC > 0
httpEvery5Seconds(); httpEvery5Seconds();
#endif #endif
break; break;
@ -169,6 +184,10 @@ IRAM_ATTR void loop()
#if HASP_USE_GPIO > 0 #if HASP_USE_GPIO > 0
// gpioEvery5Seconds(); // gpioEvery5Seconds();
#endif #endif
#if HASP_USE_CUSTOM > 0
custom_every_5seconds();
#endif
break; break;
case 4: case 4: