@@ -405,7 +405,7 @@ void setupMainScreen(bool darkMode) {
405405 // Draw divider lines
406406 // Create horizontal line between top and middle sections
407407 lv_obj_t * h_line1 = lv_line_create (main_screen);
408- static lv_point_t h_line1_points[] = {{0 , 37 }, {SCREEN_WIDTH, 37 }};
408+ static lv_point_precise_t h_line1_points[] = {{0 , 37 }, {SCREEN_WIDTH, 37 }};
409409 lv_line_set_points (h_line1, h_line1_points, 2 );
410410 lv_obj_set_style_line_color (h_line1,
411411 LVGL_GRAY,
@@ -414,7 +414,7 @@ void setupMainScreen(bool darkMode) {
414414
415415 // Create horizontal line between middle and bottom sections (stop at new section boundary)
416416 lv_obj_t * h_line2 = lv_line_create (main_screen);
417- static lv_point_t h_line2_points[] = {{0 , 70 }, {148 , 70 }};
417+ static lv_point_precise_t h_line2_points[] = {{0 , 70 }, {148 , 70 }};
418418 lv_line_set_points (h_line2, h_line2_points, 2 );
419419 lv_obj_set_style_line_color (h_line2,
420420 LVGL_GRAY,
@@ -423,7 +423,7 @@ void setupMainScreen(bool darkMode) {
423423
424424 // Create vertical line in middle section (shifted left by 6 pixels)
425425 lv_obj_t * v_line1 = lv_line_create (main_screen);
426- static lv_point_t v_line1_points[] = {{102 , 37 }, {102 , 70 }};
426+ static lv_point_precise_t v_line1_points[] = {{102 , 37 }, {102 , 70 }};
427427 lv_line_set_points (v_line1, v_line1_points, 2 );
428428 lv_obj_set_style_line_color (v_line1,
429429 LVGL_GRAY,
@@ -432,7 +432,7 @@ void setupMainScreen(bool darkMode) {
432432
433433 // Create vertical line in bottom section (moved left 3px)
434434 lv_obj_t * v_line2 = lv_line_create (main_screen);
435- static lv_point_t v_line2_points[] = {{117 , 70 }, {117 , 128 }};
435+ static lv_point_precise_t v_line2_points[] = {{117 , 70 }, {117 , 128 }};
436436 lv_line_set_points (v_line2, v_line2_points, 2 );
437437 lv_obj_set_style_line_color (v_line2,
438438 LVGL_GRAY,
@@ -441,7 +441,7 @@ void setupMainScreen(bool darkMode) {
441441
442442 // Create vertical line for new far-right section (12px from right edge)
443443 lv_obj_t * v_line3 = lv_line_create (main_screen);
444- static lv_point_t v_line3_points[] = {{148 , 37 }, {148 , 128 }};
444+ static lv_point_precise_t v_line3_points[] = {{148 , 37 }, {148 , 128 }};
445445 lv_line_set_points (v_line3, v_line3_points, 2 );
446446 lv_obj_set_style_line_color (v_line3,
447447 LVGL_GRAY,
@@ -451,7 +451,7 @@ void setupMainScreen(bool darkMode) {
451451 // Create horizontal dividers for temperature section
452452 // Line between B and E at Y=89 (start from moved vertical line)
453453 lv_obj_t * h_line3 = lv_line_create (main_screen);
454- static lv_point_t h_line3_points[] = {{117 , 89 }, {148 , 89 }};
454+ static lv_point_precise_t h_line3_points[] = {{117 , 89 }, {148 , 89 }};
455455 lv_line_set_points (h_line3, h_line3_points, 2 );
456456 lv_obj_set_style_line_color (h_line3,
457457 LVGL_GRAY,
@@ -460,7 +460,7 @@ void setupMainScreen(bool darkMode) {
460460
461461 // Line between E and M at Y=109 (start from moved vertical line)
462462 lv_obj_t * h_line4 = lv_line_create (main_screen);
463- static lv_point_t h_line4_points[] = {{117 , 109 }, {148 , 109 }};
463+ static lv_point_precise_t h_line4_points[] = {{117 , 109 }, {148 , 109 }};
464464 lv_line_set_points (h_line4, h_line4_points, 2 );
465465 lv_obj_set_style_line_color (h_line4,
466466 LVGL_GRAY,
@@ -478,8 +478,8 @@ void setupMainScreen(bool darkMode) {
478478 lv_obj_add_flag (arm_indicator, LV_OBJ_FLAG_HIDDEN);
479479
480480 // Create cruise control icon (initially hidden)
481- cruise_icon_img = lv_img_create (main_screen);
482- lv_img_set_src (cruise_icon_img, &cruise_control_340255_30); // Use the new 30x30 image descriptor
481+ cruise_icon_img = lv_image_create (main_screen);
482+ lv_image_set_src (cruise_icon_img, &cruise_control_340255_30); // Use the new 30x30 image descriptor
483483
484484 // Set icon color using recoloring based on theme
485485 lv_color_t icon_color;
@@ -496,8 +496,8 @@ void setupMainScreen(bool darkMode) {
496496 lv_obj_add_flag (cruise_icon_img, LV_OBJ_FLAG_HIDDEN); // Hide initially
497497
498498 // Create charging icon (initially hidden)
499- charging_icon_img = lv_img_create (main_screen);
500- lv_img_set_src (charging_icon_img, &energy_539741_26);
499+ charging_icon_img = lv_image_create (main_screen);
500+ lv_image_set_src (charging_icon_img, &energy_539741_26);
501501 lv_obj_align_to (charging_icon_img, battery_label, LV_ALIGN_OUT_RIGHT_MID, 3 , 0 ); // Align to right of battery label
502502
503503 // Set charging icon color based on theme
@@ -508,8 +508,8 @@ void setupMainScreen(bool darkMode) {
508508 lv_obj_add_flag (charging_icon_img, LV_OBJ_FLAG_HIDDEN); // Hide initially
509509
510510 // Create arm fail warning icon (initially hidden)
511- arm_fail_warning_icon_img = lv_img_create (main_screen);
512- lv_img_set_src (arm_fail_warning_icon_img, &warning_2135850_30);
511+ arm_fail_warning_icon_img = lv_image_create (main_screen);
512+ lv_image_set_src (arm_fail_warning_icon_img, &warning_2135850_30);
513513 // Align in the same position as the cruise icon
514514 lv_obj_align (arm_fail_warning_icon_img, LV_ALIGN_CENTER, 12 , -9 );
515515
@@ -529,7 +529,7 @@ void setupMainScreen(bool darkMode) {
529529 lv_obj_set_style_border_width (spinner_overlay, 0 , LV_PART_MAIN);
530530
531531 // Create spinning animation at the top center - now place on top of overlay
532- spinner = lv_spinner_create (spinner_overlay, 1000 , 60 ); // 1000ms period, 60 arcade width
532+ spinner = lv_spinner_create (spinner_overlay); // LVGL v9 simplified API
533533 lv_obj_set_size (spinner, 80 , 80 ); // Even larger spinner for visibility
534534 lv_obj_align (spinner, LV_ALIGN_CENTER, 0 , 0 ); // Position at center of screen
535535
@@ -559,7 +559,7 @@ void setupMainScreen(bool darkMode) {
559559
560560 // Create horizontal divider line running from section start to screen edge
561561 climb_rate_divider_lines[i] = lv_line_create (main_screen);
562- static lv_point_t line_points[13 ][2 ]; // Static array for all line points
562+ static lv_point_precise_t line_points[13 ][2 ]; // Static array for all line points
563563 line_points[i][0 ].x = 148 ; // Start at section boundary
564564 line_points[i][0 ].y = y_pos;
565565 line_points[i][1 ].x = 160 ; // End at screen edge
@@ -615,5 +615,5 @@ void setupMainScreen(bool darkMode) {
615615 setupAlertCounterUI (darkMode);
616616
617617 // Load the screen
618- lv_scr_load (main_screen);
618+ lv_screen_load (main_screen);
619619}
0 commit comments