cyclic.cpp: task errorhandling added

This commit is contained in:
cyberman54 2022-02-06 20:23:08 +01:00
parent 02c29afca6
commit ef15fa2d2a

View File

@ -22,41 +22,52 @@ void doHousekeeping() {
if ((RTC_runmode == RUNMODE_UPDATE) || (RTC_runmode == RUNMODE_MAINTENANCE)) if ((RTC_runmode == RUNMODE_UPDATE) || (RTC_runmode == RUNMODE_MAINTENANCE))
do_reset(true); // warmstart do_reset(true); // warmstart
// heap and task storage debugging // print heap and task storage information
ESP_LOGD(TAG, "Heap: Free:%d, Min:%d, Size:%d, Alloc:%d, StackHWM:%d", ESP_LOGD(TAG, "Heap: Free:%d, Min:%d, Size:%d, Alloc:%d, StackHWM:%d",
ESP.getFreeHeap(), ESP.getMinFreeHeap(), ESP.getHeapSize(), ESP.getFreeHeap(), ESP.getMinFreeHeap(), ESP.getHeapSize(),
ESP.getMaxAllocHeap(), uxTaskGetStackHighWaterMark(NULL)); ESP.getMaxAllocHeap(), uxTaskGetStackHighWaterMark(NULL));
if (irqHandlerTask != NULL)
ESP_LOGD(TAG, "IRQhandler %d bytes left | Taskstate = %d", ESP_LOGD(TAG, "IRQhandler %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(irqHandlerTask), uxTaskGetStackHighWaterMark(irqHandlerTask),
eTaskGetState(irqHandlerTask)); eTaskGetState(irqHandlerTask));
if (rcmdTask != NULL)
ESP_LOGD(TAG, "Rcommand interpreter %d bytes left | Taskstate = %d", ESP_LOGD(TAG, "Rcommand interpreter %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(rcmdTask), eTaskGetState(rcmdTask)); uxTaskGetStackHighWaterMark(rcmdTask), eTaskGetState(rcmdTask));
#if (HAS_LORA) #if (HAS_LORA)
if (lmicTask != NULL)
ESP_LOGD(TAG, "LMiCtask %d bytes left | Taskstate = %d", ESP_LOGD(TAG, "LMiCtask %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(lmicTask), eTaskGetState(lmicTask)); uxTaskGetStackHighWaterMark(lmicTask), eTaskGetState(lmicTask));
if (lorasendTask != NULL)
ESP_LOGD(TAG, "Lorasendtask %d bytes left | Taskstate = %d", ESP_LOGD(TAG, "Lorasendtask %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(lorasendTask), uxTaskGetStackHighWaterMark(lorasendTask),
eTaskGetState(lorasendTask)); eTaskGetState(lorasendTask));
#endif #endif
#if (HAS_GPS) #if (HAS_GPS)
if (GpsTask != NULL)
ESP_LOGD(TAG, "Gpsloop %d bytes left | Taskstate = %d", ESP_LOGD(TAG, "Gpsloop %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(GpsTask), eTaskGetState(GpsTask)); uxTaskGetStackHighWaterMark(GpsTask), eTaskGetState(GpsTask));
#endif #endif
#ifdef HAS_SPI #ifdef HAS_SPI
if (spiTask != NULL)
ESP_LOGD(TAG, "spiloop %d bytes left | Taskstate = %d", ESP_LOGD(TAG, "spiloop %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(spiTask), eTaskGetState(spiTask)); uxTaskGetStackHighWaterMark(spiTask), eTaskGetState(spiTask));
#endif #endif
#ifdef HAS_MQTT #ifdef HAS_MQTT
if (mqttTask != NULL)
ESP_LOGD(TAG, "MQTTloop %d bytes left | Taskstate = %d", ESP_LOGD(TAG, "MQTTloop %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(mqttTask), eTaskGetState(mqttTask)); uxTaskGetStackHighWaterMark(mqttTask), eTaskGetState(mqttTask));
#endif #endif
#if (defined HAS_DCF77 || defined HAS_IF482) #if (defined HAS_DCF77 || defined HAS_IF482)
if (ClockTask != NULL)
ESP_LOGD(TAG, "Clockloop %d bytes left | Taskstate = %d", ESP_LOGD(TAG, "Clockloop %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(ClockTask), eTaskGetState(ClockTask)); uxTaskGetStackHighWaterMark(ClockTask), eTaskGetState(ClockTask));
#endif #endif
#if (HAS_LED != NOT_A_PIN) || defined(HAS_RGB_LED) #if (HAS_LED != NOT_A_PIN) || defined(HAS_RGB_LED)
if (ledLoopTask != NULL)
ESP_LOGD(TAG, "LEDloop %d bytes left | Taskstate = %d", ESP_LOGD(TAG, "LEDloop %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(ledLoopTask), uxTaskGetStackHighWaterMark(ledLoopTask),
eTaskGetState(ledLoopTask)); eTaskGetState(ledLoopTask));