diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 70ceb11b17c0..b2c6b804cf5c 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -560,7 +560,7 @@ #define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion #endif -#endif // SDSUPPORT +#endif // HAS_MEDIA /** * Power Supply diff --git a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp index 3ae893f0c213..da79cb617495 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp @@ -128,9 +128,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { if (dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM) list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM; - #if HAS_MEDIA - file_count = search_file(); - #endif + TERN_(HAS_MEDIA, file_count = search_file()); if (file_count != 0) { dir_offset[curDirLever].curPage--; lv_clear_print_file(); @@ -142,9 +140,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { if (dir_offset[curDirLever].cur_page_last_offset > 0) { list_file.Sd_file_cnt = 0; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1; - #if HAS_MEDIA - file_count = search_file(); - #endif + TERN_(HAS_MEDIA, file_count = search_file()); if (file_count != 0) { dir_offset[curDirLever].curPage++; lv_clear_print_file(); @@ -159,17 +155,13 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { int8_t *ch = (int8_t *)strrchr(list_file.curDirPath, '/'); if (ch) { *ch = 0; - #if HAS_MEDIA - card.cdup(); - #endif + TERN_(HAS_MEDIA, card.cdup()); dir_offset[curDirLever].curPage = 0; dir_offset[curDirLever].cur_page_first_offset = 0; dir_offset[curDirLever].cur_page_last_offset = 0; curDirLever--; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if HAS_MEDIA - file_count = search_file(); - #endif + TERN_(HAS_MEDIA, file_count = search_file()); lv_clear_print_file(); disp_gcode_icon(file_count); } @@ -187,9 +179,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { strcpy(list_file.curDirPath, list_file.file_name[i]); curDirLever++; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if HAS_MEDIA - file_count = search_file(); - #endif + TERN_(HAS_MEDIA, file_count = search_file()); lv_clear_print_file(); disp_gcode_icon(file_count); } @@ -394,8 +384,7 @@ int ascii2dec_test(char *ascii) { void lv_gcode_file_read(uint8_t *data_buf) { #if HAS_MEDIA - uint16_t i = 0, j = 0, k = 0; - uint16_t row_1 = 0; + uint16_t i = 0, j = 0, k = 0, row_1 = 0; bool ignore_start = true; char temp_test[200]; volatile uint16_t *p_index;