MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / addRtosTask

Function addRtosTask

Tactility/Source/app/systeminfo/SystemInfo.cpp:215–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215static void addRtosTask(lv_obj_t* parent, const TaskStatus_t& task, uint32_t totalRuntime) {
216 auto* label = lv_label_create(parent);
217 const char* name = (task.pcTaskName == nullptr || task.pcTaskName[0] == 0) ? "(unnamed)" : task.pcTaskName;
218
219 // If totalRuntime provided, show CPU percentage; otherwise just show state
220 if (totalRuntime > 0) {
221 float cpu_percent = (task.ulRunTimeCounter * 100.0f) / totalRuntime;
222 lv_label_set_text_fmt(label, "%s: %.1f%%", name, cpu_percent);
223 } else {
224 lv_label_set_text_fmt(label, "%s (%s)", name, getTaskState(task));
225 }
226}
227
228static void updateRtosTasks(lv_obj_t* parent, bool showCpuPercent) {
229 clearContainer(parent);

Callers 1

updateRtosTasksFunction · 0.85

Calls 1

getTaskStateFunction · 0.85

Tested by

no test coverage detected