diff options
| author | JF002 <JF002@users.noreply.github.com> | 2020-10-04 10:21:22 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-04 10:21:22 (GMT) |
| commit | 39954bbd3afb592a0c3109e3479594183e8d0778 (patch) | |
| tree | 58efd04aa38b8dc7989c51fe3c9cdb9a3fb46a54 /src/SystemTask/SystemMonitor.h | |
| parent | 5adc97702c326d0252df6da75ce4ac244a4b3553 (diff) | |
| parent | 6c86d1d9d706706fcb6f214aba8259e61ed68755 (diff) | |
Merge pull request #68 from Avamander/patch-1
Rename folders to follow a consistent style
Diffstat (limited to 'src/SystemTask/SystemMonitor.h')
| -rw-r--r-- | src/SystemTask/SystemMonitor.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/SystemTask/SystemMonitor.h b/src/SystemTask/SystemMonitor.h deleted file mode 100644 index ec1fd81..0000000 --- a/src/SystemTask/SystemMonitor.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once -#include <FreeRTOS.h> -#include <task.h> -#include <nrf_log.h> - - -namespace Pinetime { - namespace System { - struct DummyMonitor {}; - struct FreeRtosMonitor {}; - - template<class T> - class SystemMonitor { - public: - SystemMonitor() = delete; - }; - - template<> - class SystemMonitor<DummyMonitor> { - public: - void Process() const {} - }; - - template<> - class SystemMonitor<FreeRtosMonitor> { - public: - void Process() const { - if(xTaskGetTickCount() - lastTick > 10000) { - NRF_LOG_INFO("---------------------------------------\nFree heap : %d", xPortGetFreeHeapSize()); - auto nb = uxTaskGetSystemState(tasksStatus, 10, NULL); - for (uint32_t i = 0; i < nb; i++) { - NRF_LOG_INFO("Task [%s] - %d", tasksStatus[i].pcTaskName, tasksStatus[i].usStackHighWaterMark); - if (tasksStatus[i].usStackHighWaterMark < 20) - NRF_LOG_INFO("WARNING!!! Task %s task is nearly full, only %dB available", tasksStatus[i].pcTaskName, - tasksStatus[i].usStackHighWaterMark * 4); - } - lastTick = xTaskGetTickCount(); - } - } - - private: - mutable TickType_t lastTick = 0; - mutable TaskStatus_t tasksStatus[10]; - }; - } -}
\ No newline at end of file |
