mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 02:02:23 +00:00
add a Lock, LockGuard and printThreadInfo
* `Lock`: trivial wrapper for FreeRTOS binary semaphores * `LockGuard`: RAII wrapper for using `Lock` * `printThreadInfo`: helper for showing which core/FreeRTOS task we are running under
This commit is contained in:
20
src/debug.cpp
Normal file
20
src/debug.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "debug.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
|
||||
#include "configuration.h"
|
||||
|
||||
namespace meshtastic
|
||||
{
|
||||
|
||||
void printThreadInfo(const char *extra)
|
||||
{
|
||||
uint32_t taskHandle = reinterpret_cast<uint32_t>(xTaskGetCurrentTaskHandle());
|
||||
DEBUG_MSG("printThreadInfo(%s) task: %" PRIx32 " core id: %u min free stack: %u\n", extra, taskHandle, xPortGetCoreID(),
|
||||
uxTaskGetStackHighWaterMark(nullptr));
|
||||
}
|
||||
|
||||
} // namespace meshtastic
|
||||
Reference in New Issue
Block a user