MCPcopy Create free account
hub / github.com/bdring/FluidNC / heapCheckTask

Function heapCheckTask

FluidNC/src/Serial.cpp:61–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59std::mutex AllChannels::_mutex_pollLine;
60
61void heapCheckTask(void* pvParameters) {
62 static uint32_t heapSize = 0;
63 while (true) {
64 std::atomic_thread_fence(std::memory_order_seq_cst); // read fence for settings and whatnot
65 uint32_t newHeapSize = xPortGetFreeHeapSize();
66 if (newHeapSize != heapSize) {
67 heapSize = newHeapSize;
68 log_info("heap " << heapSize);
69 }
70 vTaskDelay(3000 / portTICK_PERIOD_MS); // Yield to other tasks
71
72#ifdef DEBUG_TASK_STACK
73 static UBaseType_t uxHighWaterMark = 0;
74 reportTaskStackSize(uxHighWaterMark);
75#endif
76 }
77}
78
79void AllChannels::init() {
80 registration(&startupLog); // Early startup messages for $SS

Callers

nothing calls this directly

Calls 3

xPortGetFreeHeapSizeFunction · 0.85
vTaskDelayFunction · 0.85
reportTaskStackSizeFunction · 0.85

Tested by

no test coverage detected