Skip to content

Commit

Permalink
log thread core in housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
oseiler2 committed Mar 16, 2023
1 parent 575de96 commit 04b1791
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/housekeeping.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _HOUSEKEEPING_H
#define _HOUSEKEEPING_H

#include "globals.h"
#include <globals.h>
#include <Ticker.h>

namespace housekeeping {
Expand Down
17 changes: 8 additions & 9 deletions src/housekeeping.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <housekeeping.h>
#include <mqtt.h>
#include <i2c.h>
#include <ota.h>

// Local logging tag
Expand All @@ -13,17 +12,17 @@ namespace housekeeping {
ESP_LOGD(TAG, "Heap: Free:%d, Min:%d, Size:%d, Alloc:%d, StackHWM:%d",
ESP.getFreeHeap(), ESP.getMinFreeHeap(), ESP.getHeapSize(),
ESP.getMaxAllocHeap(), uxTaskGetStackHighWaterMark(NULL));
ESP_LOGD(TAG, "Mqttloop %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(mqtt::mqttTask), eTaskGetState(mqtt::mqttTask));
ESP_LOGD(TAG, "Otaloop %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(OTA::otaTask), eTaskGetState(OTA::otaTask));
ESP_LOGD(TAG, "Mqttloop %d bytes left | Taskstate = %d | core = %u",
uxTaskGetStackHighWaterMark(mqtt::mqttTask), eTaskGetState(mqtt::mqttTask), xTaskGetAffinity(mqtt::mqttTask));
ESP_LOGD(TAG, "Otaloop %d bytes left | Taskstate = %d | core = %u",
uxTaskGetStackHighWaterMark(OTA::otaTask), eTaskGetState(OTA::otaTask), xTaskGetAffinity(OTA::otaTask));
if (sensorsTask) {
ESP_LOGD(TAG, "SensorsLoop %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(sensorsTask), eTaskGetState(sensorsTask));
ESP_LOGD(TAG, "SensorsLoop %d bytes left | Taskstate = %d | core = %u",
uxTaskGetStackHighWaterMark(sensorsTask), eTaskGetState(sensorsTask), xTaskGetAffinity(sensorsTask));
}
if (neopixelMatrixTask) {
ESP_LOGD(TAG, "NeopixelMatrixLoop %d bytes left | Taskstate = %d",
uxTaskGetStackHighWaterMark(neopixelMatrixTask), eTaskGetState(neopixelMatrixTask));
ESP_LOGD(TAG, "NeopixelMatrixLoop %d bytes left | Taskstate = %d | core = %u",
uxTaskGetStackHighWaterMark(neopixelMatrixTask), eTaskGetState(neopixelMatrixTask), xTaskGetAffinity(neopixelMatrixTask));
}
if (ESP.getMinFreeHeap() <= 2048) {
ESP_LOGW(TAG,
Expand Down

0 comments on commit 04b1791

Please sign in to comment.