summaryrefslogtreecommitdiff
path: root/src/displayapp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2021-07-21 14:41:29 +0300
committerRiku Isokoski <riksu9000@gmail.com>2021-07-21 14:41:29 +0300
commit93893511f1e0bb224f5002dd9738738f92e25eb6 (patch)
treeb17fde8210091a9804997625161126f9bfb05821 /src/displayapp
parent57b339707861c5688f5d432f1506a99df6bb0fce (diff)
Fit more tasks in SystemInfo
Diffstat (limited to 'src/displayapp')
-rw-r--r--src/displayapp/screens/SystemInfo.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp
index f5bf0cc9..69a0d1a0 100644
--- a/src/displayapp/screens/SystemInfo.cpp
+++ b/src/displayapp/screens/SystemInfo.cpp
@@ -210,11 +210,14 @@ bool SystemInfo::sortById(const TaskStatus_t& lhs, const TaskStatus_t& rhs) {
}
std::unique_ptr<Screen> SystemInfo::CreateScreen4() {
- TaskStatus_t tasksStatus[7];
+ static constexpr uint8_t maxTaskCount = 9;
+ TaskStatus_t tasksStatus[maxTaskCount];
+
lv_obj_t* infoTask = lv_table_create(lv_scr_act(), NULL);
lv_table_set_col_cnt(infoTask, 3);
- lv_table_set_row_cnt(infoTask, 8);
- lv_obj_set_pos(infoTask, 10, 10);
+ lv_table_set_row_cnt(infoTask, maxTaskCount + 1);
+ lv_obj_set_style_local_pad_all(infoTask, LV_TABLE_PART_CELL1, LV_STATE_DEFAULT, 0);
+ lv_obj_set_style_local_border_color(infoTask, LV_TABLE_PART_CELL1, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_table_set_cell_value(infoTask, 0, 0, "#");
lv_table_set_col_width(infoTask, 0, 50);
@@ -223,8 +226,9 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen4() {
lv_table_set_cell_value(infoTask, 0, 2, "Free");
lv_table_set_col_width(infoTask, 2, 90);
- auto nb = uxTaskGetSystemState(tasksStatus, 7, nullptr);
+ auto nb = uxTaskGetSystemState(tasksStatus, maxTaskCount, nullptr);
std::sort(tasksStatus, tasksStatus + nb, sortById);
+
for (uint8_t i = 0; i < nb; i++) {
lv_table_set_cell_value(infoTask, i + 1, 0, std::to_string(tasksStatus[i].xTaskNumber).c_str());