@@ -206,11 +206,14 @@ bool SystemInfo::sortById(const TaskStatus_t& lhs, const TaskStatus_t& rhs) {
206206}
207207
208208std::unique_ptr<Screen> SystemInfo::CreateScreen4 () {
209- TaskStatus_t tasksStatus[10 ];
209+ static constexpr uint8_t maxTaskCount = 9 ;
210+ TaskStatus_t tasksStatus[maxTaskCount];
211+
210212 lv_obj_t * infoTask = lv_table_create (lv_scr_act (), NULL );
211213 lv_table_set_col_cnt (infoTask, 4 );
212- lv_table_set_row_cnt (infoTask, 8 );
213- lv_obj_set_pos (infoTask, 0 , 10 );
214+ lv_table_set_row_cnt (infoTask, maxTaskCount + 1 );
215+ lv_obj_set_style_local_pad_all (infoTask, LV_TABLE_PART_CELL1, LV_STATE_DEFAULT, 0 );
216+ lv_obj_set_style_local_border_color (infoTask, LV_TABLE_PART_CELL1, LV_STATE_DEFAULT, LV_COLOR_GRAY);
214217
215218 lv_table_set_cell_value (infoTask, 0 , 0 , " #" );
216219 lv_table_set_col_width (infoTask, 0 , 30 );
@@ -221,9 +224,9 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen4() {
221224 lv_table_set_cell_value (infoTask, 0 , 3 , " Free" );
222225 lv_table_set_col_width (infoTask, 3 , 90 );
223226
224- auto nb = uxTaskGetSystemState (tasksStatus, sizeof (tasksStatus) / sizeof (tasksStatus[ 0 ]) , nullptr );
227+ auto nb = uxTaskGetSystemState (tasksStatus, maxTaskCount , nullptr );
225228 std::sort (tasksStatus, tasksStatus + nb, sortById);
226- for (uint8_t i = 0 ; i < nb && i < 7 ; i++) {
229+ for (uint8_t i = 0 ; i < nb && i < maxTaskCount ; i++) {
227230
228231 lv_table_set_cell_value (infoTask, i + 1 , 0 , std::to_string (tasksStatus[i].xTaskNumber ).c_str ());
229232 char state[2 ] = {0 };
0 commit comments