From 44c57ab05a8f909b85f51e08c90316b41e50c455 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Jan 2021 21:02:35 -0600 Subject: [PATCH] MKS UI prelim. cleanup (#20763) --- .../lcd/extui/lib/mks_ui/SPIFlashStorage.cpp | 2 - Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp | 2 - .../src/lcd/extui/lib/mks_ui/draw_about.cpp | 9 +- Marlin/src/lcd/extui/lib/mks_ui/draw_about.h | 1 - .../extui/lib/mks_ui/draw_baby_stepping.cpp | 3 +- .../lcd/extui/lib/mks_ui/draw_baby_stepping.h | 1 - .../extui/lib/mks_ui/draw_change_speed.cpp | 16 +- .../lcd/extui/lib/mks_ui/draw_change_speed.h | 1 - .../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 32 +--- Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h | 3 +- .../extui/lib/mks_ui/draw_error_message.cpp | 23 --- .../lcd/extui/lib/mks_ui/draw_error_message.h | 1 - .../lcd/extui/lib/mks_ui/draw_extrusion.cpp | 4 - .../src/lcd/extui/lib/mks_ui/draw_extrusion.h | 1 - Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp | 27 ++-- Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h | 1 - .../extui/lib/mks_ui/draw_filament_change.cpp | 6 +- .../extui/lib/mks_ui/draw_filament_change.h | 1 - Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp | 4 - Marlin/src/lcd/extui/lib/mks_ui/draw_home.h | 1 - .../lcd/extui/lib/mks_ui/draw_keyboard.cpp | 19 +-- .../lcd/extui/lib/mks_ui/draw_language.cpp | 4 - .../src/lcd/extui/lib/mks_ui/draw_language.h | 1 - .../extui/lib/mks_ui/draw_level_settings.cpp | 5 +- .../lcd/extui/lib/mks_ui/draw_manuaLevel.cpp | 4 - .../lcd/extui/lib/mks_ui/draw_manuaLevel.h | 1 - .../mks_ui/draw_manual_level_pos_settings.cpp | 28 +--- .../lib/mks_ui/draw_max_feedrate_settings.cpp | 22 +-- .../extui/lib/mks_ui/draw_motor_settings.cpp | 6 +- .../lcd/extui/lib/mks_ui/draw_move_motor.cpp | 6 +- .../lcd/extui/lib/mks_ui/draw_move_motor.h | 1 - .../lcd/extui/lib/mks_ui/draw_number_key.cpp | 4 - .../lcd/extui/lib/mks_ui/draw_operation.cpp | 7 - .../src/lcd/extui/lib/mks_ui/draw_operation.h | 1 - .../extui/lib/mks_ui/draw_pause_message.cpp | 4 - .../lcd/extui/lib/mks_ui/draw_pause_message.h | 1 - .../extui/lib/mks_ui/draw_pause_position.cpp | 11 +- .../src/lcd/extui/lib/mks_ui/draw_preHeat.cpp | 4 - .../src/lcd/extui/lib/mks_ui/draw_preHeat.h | 1 - .../lcd/extui/lib/mks_ui/draw_print_file.cpp | 2 +- .../lcd/extui/lib/mks_ui/draw_print_file.h | 10 +- .../lcd/extui/lib/mks_ui/draw_printing.cpp | 25 --- .../src/lcd/extui/lib/mks_ui/draw_printing.h | 1 - .../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 46 +----- .../lcd/extui/lib/mks_ui/draw_ready_print.h | 1 - Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp | 36 +---- Marlin/src/lcd/extui/lib/mks_ui/draw_set.h | 1 - .../extui/lib/mks_ui/draw_step_settings.cpp | 21 +-- .../lib/mks_ui/draw_tmc_current_settings.cpp | 23 +-- .../mks_ui/draw_tmc_step_mode_settings.cpp | 4 +- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp | 19 +-- Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h | 1 - .../extui/lib/mks_ui/draw_touch_calibration.h | 1 - Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp | 153 ++++++------------ Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 2 +- Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp | 5 +- .../lcd/extui/lib/mks_ui/draw_wifi_list.cpp | 3 + .../lcd/extui/lib/mks_ui/gb2312_puhui16.cpp | 10 -- .../extui/lib/mks_ui/mks_hardware_test.cpp | 20 +-- .../src/lcd/extui/lib/mks_ui/pic_manager.cpp | 16 +- Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h | 2 - .../extui/lib/mks_ui/printer_operation.cpp | 3 - .../lcd/extui/lib/mks_ui/tft_Language_en.h | 45 +----- .../lcd/extui/lib/mks_ui/tft_Language_fr.h | 30 +--- .../lcd/extui/lib/mks_ui/tft_Language_it.h | 20 --- .../lcd/extui/lib/mks_ui/tft_Language_ru.h | 23 +-- .../lcd/extui/lib/mks_ui/tft_Language_s_cn.h | 104 ++++++------ .../lcd/extui/lib/mks_ui/tft_Language_sp.h | 49 ++---- .../lcd/extui/lib/mks_ui/tft_Language_t_cn.h | 16 +- .../lib/mks_ui/tft_lvgl_configuration.cpp | 27 +--- .../extui/lib/mks_ui/tft_lvgl_configuration.h | 3 + .../extui/lib/mks_ui/tft_multi_language.cpp | 111 ++++--------- .../lcd/extui/lib/mks_ui/tft_multi_language.h | 23 +-- Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h | 2 +- .../src/lcd/extui/lib/mks_ui/wifi_module.cpp | 60 ++++--- Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h | 16 +- .../src/lcd/extui/lib/mks_ui/wifi_upload.cpp | 29 +--- Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.h | 1 - 78 files changed, 296 insertions(+), 937 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp index 11c5f816b..e1c46811f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp @@ -169,7 +169,6 @@ void SPIFlashStorage::endWrite() { void SPIFlashStorage::savePage(uint8_t* buffer) { W25QXX.SPI_FLASH_BufferWrite(buffer, m_startAddress + (SPI_FLASH_PageSize * m_currentPage), SPI_FLASH_PageSize); - // Test env // char fname[256]; // snprintf(fname, sizeof(fname), "./pages/page-%03d.data", m_currentPage); @@ -180,7 +179,6 @@ void SPIFlashStorage::savePage(uint8_t* buffer) { void SPIFlashStorage::loadPage(uint8_t* buffer) { W25QXX.SPI_FLASH_BufferRead(buffer, m_startAddress + (SPI_FLASH_PageSize * m_currentPage), SPI_FLASH_PageSize); - // Test env // char fname[256]; // snprintf(fname, sizeof(fname), "./pages/page-%03d.data", m_currentPage); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp index 394ce4807..76a4de356 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp @@ -73,8 +73,6 @@ void TFT::LCD_clear(uint16_t color) { tftio.WriteMultiple(color, (uint32_t)(TFT_WIDTH) * (TFT_HEIGHT)); } -extern unsigned char bmp_public_buf[17 * 1024]; - void TFT::LCD_Draw_Logo() { #if HAS_LOGO_IN_FLASH setWindow(0, 0, TFT_WIDTH, TFT_HEIGHT); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp index 01f64e8fc..1f0915314 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -25,16 +25,12 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../inc/MarlinConfig.h" extern lv_group_t *g; static lv_obj_t *scr; -static lv_obj_t *fw_type, *board; //*fw_version; +static lv_obj_t *fw_type, *board; enum { ID_A_RETURN = 1 }; @@ -52,9 +48,6 @@ void lv_draw_about(void) { scr = lv_screen_create(ABOUT_UI); lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_A_RETURN); - //fw_version = lv_label_create(scr, SHORT_BUILD_VERSION); - //lv_obj_align(fw_version, nullptr, LV_ALIGN_CENTER, 0, -60); - fw_type = lv_label_create(scr, "Firmware: Marlin " SHORT_BUILD_VERSION); lv_obj_align(fw_type, nullptr, LV_ALIGN_CENTER, 0, -20); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h index 2ee7ec04c..9eae2b06c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h @@ -28,7 +28,6 @@ extern void lv_draw_about(void); extern void lv_clear_about(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp index 5f489162b..dce83bad2 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.cpp @@ -87,7 +87,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { has_adjust_z = 1; break; case ID_BABY_STEP_Z_N: - sprintf_P(baby_buf, PSTR("M290 Z%.3f"), babystep_dist); + sprintf_P(baby_buf, PSTR("M290 Z%.3f"), -babystep_dist); gcode.process_subcommands_now_P(PSTR(baby_buf)); has_adjust_z = 1; break; @@ -136,7 +136,6 @@ void lv_draw_baby_stepping(void) { } void disp_baby_step_dist() { - // char buf[30] = {0}; if ((int)(100 * babystep_dist) == 1) lv_imgbtn_set_src_both(buttonV, "F:/bmp_baby_move0_01.bin"); else if ((int)(100 * babystep_dist) == 5) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.h index 333ba2d59..5886a2058 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_baby_stepping.h @@ -30,7 +30,6 @@ extern void lv_clear_baby_stepping(); extern void disp_baby_step_dist(); extern void disp_z_offset_value(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp index a5100776a..afb0245e2 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../module/planner.h" #include "../../../../inc/MarlinConfig.h" @@ -65,9 +61,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { planner.flow_percentage[0] += uiCfg.stepPrintSpeed; else planner.flow_percentage[0] = MAX_EXT_SPEED_PERCENT; - //planner.e_factor[0]= planner.flow_percentage[0]*0.01; - //planner.flow_percentage[1] = planner.flow_percentage[0]; - //planner.e_factor[1]= planner.flow_percentage[1]*0.01; planner.refresh_e_factor(0); #if HAS_MULTI_EXTRUDER planner.flow_percentage[1] = planner.flow_percentage[0]; @@ -88,9 +81,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { planner.flow_percentage[0] -= uiCfg.stepPrintSpeed; else planner.flow_percentage[0] = MIN_EXT_SPEED_PERCENT; - //planner.e_factor[0]= planner.flow_percentage[0] * 0.01; - //planner.flow_percentage[1] = planner.flow_percentage[0]; - //planner.e_factor[1]= planner.flow_percentage[1] * 0.01; planner.refresh_e_factor(0); #if HAS_MULTI_EXTRUDER planner.flow_percentage[1] = planner.flow_percentage[0]; @@ -143,9 +133,9 @@ void lv_draw_change_speed(void) { lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_C_RETURN); // Create labels on the image buttons - labelMov = lv_label_create_empty(buttonMov); - labelExt = lv_label_create_empty(buttonExt); - labelStep = lv_label_create_empty(buttonStep); + labelMov = lv_label_create_empty(buttonMov); + labelExt = lv_label_create_empty(buttonExt); + labelStep = lv_label_create_empty(buttonStep); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h index c4996a3ef..8fa4c803a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h @@ -34,7 +34,6 @@ extern void disp_speed_step(); extern void disp_print_speed(); extern void disp_speed_type(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 5c0f42629..55a0e695f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -31,11 +31,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" - #include "../../../../sd/cardreader.h" #include "../../../../gcode/queue.h" #include "../../../../module/temperature.h" @@ -100,7 +95,6 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { card.openFileRead(cur_name); if (card.isFileOpen()) { feedrate_percentage = 100; - //saved_feedrate_percentage = feedrate_percentage; planner.flow_percentage[0] = 100; planner.e_factor[0] = planner.flow_percentage[0] * 0.01f; #if HAS_MULTI_EXTRUDER @@ -123,20 +117,8 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { lv_draw_ready_print(); #if ENABLED(SDSUPPORT) - //card.endFilePrint(); - //wait_for_heatup = false; uiCfg.print_state = IDLE; card.flag.abort_sd_printing = true; - //queue.clear(); - //quickstop_stepper(); - //print_job_timer.stop(); - //thermalManager.disable_all_heaters(); - - //#if ENABLED(POWER_LOSS_RECOVERY) - // recovery.purge(); - //#endif - //queue.enqueue_now_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0")); - //queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107")); #endif } else if (DIALOG_IS(TYPE_FINISH_PRINT)) { @@ -244,19 +226,19 @@ void lv_draw_dialog(uint8_t type) { else if (DIALOG_IS(WIFI_ENABLE_TIPS)) { btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); - lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); } else if (DIALOG_IS(TRANSFER_NO_DEVICE)) { btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); - lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); } #if ENABLED(MKS_WIFI_MODULE) else if (DIALOG_IS(TYPE_UPLOAD_FILE)) { if (upload_result == 2) { btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); - lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); } else if (upload_result == 3) { btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); @@ -268,7 +250,7 @@ void lv_draw_dialog(uint8_t type) { else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT, TYPE_FILAMENT_UNLOAD_HEAT)) { btnCancel = lv_button_btn_create(scr, BTN_OK_X+90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); - lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); tempText1 = lv_label_create_empty(scr); filament_sprayer_temp(); @@ -281,7 +263,7 @@ void lv_draw_dialog(uint8_t type) { else if (DIALOG_IS(TYPE_FILAMENT_LOADING, TYPE_FILAMENT_UNLOADING)) { btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); - lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); filament_bar = lv_bar_create(scr, nullptr); lv_obj_set_pos(filament_bar, (TFT_WIDTH-400)/2, ((TFT_HEIGHT - titleHeight)-40)/2); @@ -303,7 +285,7 @@ void lv_draw_dialog(uint8_t type) { } else { lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text - lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); + lv_label_set_text(labelCancel, print_file_dialog_menu.cancel); } } if (DIALOG_IS(TYPE_PRINT_FILE)) { @@ -314,7 +296,7 @@ void lv_draw_dialog(uint8_t type) { lv_obj_align(labelFile, nullptr, LV_ALIGN_CENTER, 0, -60); } else if (DIALOG_IS(TYPE_STOP)) { - lv_label_set_text(labelDialog, print_file_dialog_menu.cancle_print); + lv_label_set_text(labelDialog, print_file_dialog_menu.cancel_print); lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); } else if (DIALOG_IS(TYPE_FINISH_PRINT)) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h index c6f42d90b..c43a79a14 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h @@ -33,7 +33,7 @@ enum { DIALOG_TYPE_M80_FAIL, DIALOG_TYPE_MESSAGE_ERR1, - DIALOG_TYPE_UPDATE_ESP_FIRMARE, + DIALOG_TYPE_UPDATE_ESP_FIRMWARE, DIALOG_TYPE_UPDATE_ESP_DATA, DIALOG_TYPE_UPLOAD_FILE, DIALOG_TYPE_UNBIND, @@ -85,7 +85,6 @@ extern void filament_sprayer_temp(); extern void filament_dialog_handle(); extern void lv_filament_setbar(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp index a484f1408..bdae725cb 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp @@ -27,10 +27,6 @@ #include #include "tft_lvgl_configuration.h" -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "SPI_TFT.h" #include "mks_hardware_test.h" @@ -39,25 +35,6 @@ static lv_obj_t *scr; void lv_draw_error_message(PGM_P const msg) { - #if 0 - static lv_obj_t *message = nullptr, *kill_message = nullptr, *reset_tips = nullptr; - - scr = lv_screen_create(ERROR_MESSAGE_UI, ""); - - if (msg) { - message = lv_label_create(scr, msg); - lv_obj_align(message, nullptr, LV_ALIGN_CENTER, 0, -50); - } - - kill_message = lv_label_create(scr, "PRINTER HALTED"); - lv_obj_align(kill_message, nullptr, LV_ALIGN_CENTER, 0, -10); - - reset_tips = lv_label_create(scr, "Please Reset"); - lv_obj_align(reset_tips, nullptr, LV_ALIGN_CENTER, 0, 30); - - lv_task_handler(); - #endif - SPI_TFT.LCD_clear(0x0000); if (msg) disp_string((TFT_WIDTH - strlen(msg) * 16) / 2, 100, msg, 0xFFFF, 0x0000); disp_string((TFT_WIDTH - strlen("PRINTER HALTED") * 16) / 2, 140, "PRINTER HALTED", 0xFFFF, 0x0000); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h index 8f64d67f9..35e3bd6cf 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h @@ -32,7 +32,6 @@ extern void lv_draw_error_message(PGM_P const msg); extern void lv_clear_error_message(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp index 6a1c0c4fb..394c70213 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../module/temperature.h" #include "../../../../gcode/queue.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h index 576cc6c66..6178a8e19 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h @@ -33,7 +33,6 @@ extern void disp_ext_speed(); extern void disp_hotend_temp(); extern void disp_extru_amount(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp index 5453bbf86..cd74a55e6 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../module/temperature.h" #include "../../../../gcode/queue.h" @@ -52,35 +48,30 @@ static uint8_t fanSpeed; static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + switch (obj->mks_obj_id) { case ID_F_ADD: - if (fanSpeed + 1 <= 255) { - fanSpeed++; - sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); - gcode.process_subcommands_now(public_buf_l); - } + if (fanSpeed < 254) fanSpeed++; break; case ID_F_DEC: - if (fanSpeed > 0) { - fanSpeed--; - sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); - gcode.process_subcommands_now(public_buf_l); - } + if (fanSpeed > 0) fanSpeed--; break; case ID_F_HIGH: - gcode.process_subcommands_now_P(PSTR("M106 S255")); + fanSpeed = 255; break; case ID_F_MID: - gcode.process_subcommands_now_P(PSTR("M106 S127")); + fanSpeed = 127; break; case ID_F_OFF: gcode.process_subcommands_now_P(PSTR("M107")); - break; + return; case ID_F_RETURN: clear_cur_ui(); draw_return_ui(); - break; + return; } + sprintf_P(public_buf_l, PSTR("M106 S%d"), fanSpeed); + gcode.process_subcommands_now(public_buf_l); } void lv_draw_fan(void) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h index 602d02c6c..5a3323e2f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h @@ -29,7 +29,6 @@ extern void lv_draw_fan(void); extern void lv_clear_fan(); extern void disp_fan_value(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp index 4ab60321b..39d32fa74 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp @@ -85,10 +85,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { break; case ID_FILAMNT_TYPE: #if HAS_MULTI_EXTRUDER - if (uiCfg.curSprayerChoose == 0) - uiCfg.curSprayerChoose = 1; - else if (uiCfg.curSprayerChoose == 1) - uiCfg.curSprayerChoose = 0; + uiCfg.curSprayerChoose = !uiCfg.curSprayerChoose; #endif disp_filament_type(); break; @@ -100,7 +97,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { feedrate_mm_s = (float)uiCfg.moveSpeed_bak; if (uiCfg.print_state == PAUSED) planner.set_e_position_mm((destination.e = current_position.e = uiCfg.current_e_position_bak)); - //current_position.e = destination.e = uiCfg.current_e_position_bak; thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = uiCfg.desireSprayerTempBak; clear_cur_ui(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.h index b0068f7f0..18efe5839 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.h @@ -30,7 +30,6 @@ extern void lv_clear_filament_change(); extern void disp_filament_type(); extern void disp_filament_temp(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp index 646091bd8..e0ef10a72 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp @@ -27,10 +27,6 @@ #include "draw_set.h" #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h index c5060127a..a8f11d923 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h @@ -28,7 +28,6 @@ extern void lv_draw_home(void); extern void lv_clear_home(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp index 9f7c936fb..749738f6e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp @@ -73,8 +73,6 @@ static const lv_btnm_ctrl_t kb_ctrl_num_map[] = { 1, 1, 1, 1, 1}; static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { - //LV_ASSERT_OBJ(kb, LV_OBJX_NAME); - if (event != LV_EVENT_VALUE_CHANGED) return; lv_kb_ext_t * ext = (lv_kb_ext_t * )lv_obj_get_ext_attr(kb); @@ -104,22 +102,18 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { } else if (strcmp(txt, LV_SYMBOL_CLOSE) == 0) { if (kb->event_cb != lv_kb_def_event_cb) { - //lv_res_t res = lv_event_send(kb, LV_EVENT_CANCEL, nullptr); - //if (res != LV_RES_OK) return; lv_clear_keyboard(); draw_return_ui(); } else { - lv_kb_set_ta(kb, nullptr); // De-assign the text area to hide it cursor if needed + lv_kb_set_ta(kb, nullptr); // De-assign the text area to hide its cursor if needed lv_obj_del(kb); return; } - return; + return; } else if (strcmp(txt, LV_SYMBOL_OK) == 0) { if (kb->event_cb != lv_kb_def_event_cb) { - //lv_res_t res = lv_event_send(kb, LV_EVENT_APPLY, nullptr); - //if (res != LV_RES_OK) return; const char * ret_ta_txt = lv_ta_get_text(ext->ta); switch (keyboard_value) { #if ENABLED(MKS_WIFI_MODULE) @@ -142,7 +136,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { gCfgItems.wifi_mode_sel = STA_MODEL; - package_to_wifi(WIFI_PARA_SET, (char *)0, 0); + package_to_wifi(WIFI_PARA_SET, (uint8_t *)0, 0); public_buf_l[0] = 0xA5; public_buf_l[1] = 0x09; @@ -151,7 +145,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) { public_buf_l[4] = 0x01; public_buf_l[5] = 0xFC; public_buf_l[6] = 0x00; - raw_send_to_wifi(public_buf_l, 6); + raw_send_to_wifi((uint8_t*)public_buf_l, 6); last_disp_state = KEY_BOARD_UI; lv_clear_keyboard(); @@ -238,8 +232,6 @@ void lv_draw_keyboard() { lv_kb_set_style(kb, LV_KB_STYLE_BTN_PR, &pr_style); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { - //lv_group_add_obj(g, kb); - //lv_group_set_editing(g, true); } #endif @@ -260,9 +252,6 @@ void lv_draw_keyboard() { } void lv_clear_keyboard() { - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) { /* lv_group_remove_all_objs(g); */ } - #endif lv_obj_del(scr); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp index befed7a64..7edb73b71 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../inc/MarlinConfig.h" #include diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h index ca6d40bfc..d4ee14f30 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h @@ -28,7 +28,6 @@ extern void lv_draw_language(void); extern void lv_clear_language(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp index b1ce90f26..6d495494b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp @@ -40,23 +40,20 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_level_settings(); switch (obj->mks_obj_id) { case ID_LEVEL_RETURN: - lv_clear_level_settings(); draw_return_ui(); break; case ID_LEVEL_POSITION: - lv_clear_level_settings(); lv_draw_manual_level_pos_settings(); break; case ID_LEVEL_COMMAND: keyboard_value = gcodeCommand; - lv_clear_level_settings(); lv_draw_keyboard(); break; #if HAS_BED_PROBE case ID_LEVEL_ZOFFSET: - lv_clear_level_settings(); lv_draw_auto_level_offset_settings(); break; #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp index 3c8d56291..338cb1fec 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h index cfa10370e..60de0b4fe 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h @@ -28,7 +28,6 @@ extern void lv_draw_manualLevel(void); extern void lv_clear_manualLevel(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp index 6f64badf8..135838a08 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_manual_level_pos_settings.cpp @@ -55,68 +55,50 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { uiCfg.para_ui_page = 0; lv_clear_manual_level_pos_settings(); draw_return_ui(); - break; + return; case ID_MANUAL_POS_X1: value = level_pos_x1; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_Y1: value = level_pos_y1; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_X2: value = level_pos_x2; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_Y2: value = level_pos_y2; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_X3: value = level_pos_x3; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_Y3: value = level_pos_y3; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_X4: value = level_pos_x4; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_Y4: value = level_pos_y4; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_X5: value = level_pos_y5; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_Y5: value = level_pos_y5; - lv_clear_manual_level_pos_settings(); - lv_draw_number_key(); break; case ID_MANUAL_POS_UP: uiCfg.para_ui_page = 0; lv_clear_manual_level_pos_settings(); lv_draw_manual_level_pos_settings(); - break; + return; case ID_MANUAL_POS_DOWN: uiCfg.para_ui_page = 1; lv_clear_manual_level_pos_settings(); lv_draw_manual_level_pos_settings(); - break; + return; } + lv_clear_manual_level_pos_settings(); + lv_draw_number_key(); } void lv_draw_manual_level_pos_settings(void) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp index 60efda8b2..dc66bea9c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp @@ -45,48 +45,38 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + + lv_clear_max_feedrate_settings(); switch (obj->mks_obj_id) { case ID_FEED_RETURN: uiCfg.para_ui_page = 0; - lv_clear_max_feedrate_settings(); draw_return_ui(); - break; + return; case ID_FEED_X: value = XMaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); break; case ID_FEED_Y: value = YMaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); break; case ID_FEED_Z: value = ZMaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); break; case ID_FEED_E0: value = E0MaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); break; case ID_FEED_E1: value = E1MaxFeedRate; - lv_clear_max_feedrate_settings(); - lv_draw_number_key(); break; case ID_FEED_UP: uiCfg.para_ui_page = 0; - lv_clear_max_feedrate_settings(); lv_draw_max_feedrate_settings(); - break; + return; case ID_FEED_DOWN: uiCfg.para_ui_page = 1; - lv_clear_max_feedrate_settings(); lv_draw_max_feedrate_settings(); - break; + return; } + lv_draw_number_key(); } void lv_draw_max_feedrate_settings(void) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp index 61cefd761..860db5d89 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp @@ -41,30 +41,26 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_motor_settings(); switch (obj->mks_obj_id) { case ID_MOTOR_RETURN: - lv_clear_motor_settings(); draw_return_ui(); break; case ID_MOTOR_STEPS: - lv_clear_motor_settings(); lv_draw_step_settings(); break; #if USE_SENSORLESS case ID_HOME_SENSE: - lv_clear_motor_settings(); lv_draw_homing_sensitivity_settings(); break; #endif #if HAS_TRINAMIC_CONFIG case ID_MOTOR_TMC_CURRENT: - lv_clear_motor_settings(); lv_draw_tmc_current_settings(); break; #if HAS_STEALTHCHOP case ID_MOTOR_STEP_MODE: - lv_clear_motor_settings(); lv_draw_tmc_step_mode_settings(); break; #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp index 30f2a0042..6c0198d9c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../gcode/queue.h" #include "../../../../inc/MarlinConfig.h" @@ -124,7 +120,7 @@ void lv_draw_move_motor(void) { lv_big_button_create(scr, "F:/bmp_zAdd.bin", move_menu.z_add, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_M_Z_P); lv_big_button_create(scr, "F:/bmp_zDec.bin", move_menu.z_dec, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_Z_N); - // button with image and label changed dinamycally by disp_move_dist + // button with image and label changed dynamically by disp_move_dist buttonV = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_M_STEP); labelV = lv_label_create_empty(buttonV); #if HAS_ROTARY_ENCODER diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h index fdbb61f6f..4e41c5ff9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h @@ -29,7 +29,6 @@ extern void lv_draw_move_motor(void); extern void lv_clear_move_motor(); extern void disp_move_dist(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp index 54ae27d96..1c339bde7 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../../lvgl/src/lv_objx/lv_img.h" -//#include "../../lvgl/src/lv_core/lv_disp.h" -//#include "../../lvgl/src/lv_core/lv_refr.h" #include "../../../../gcode/gcode.h" #include "../../../../gcode/queue.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp index ec68c2721..50aa85e33 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../module/temperature.h" #include "../../../../module/motion.h" @@ -178,7 +174,6 @@ void lv_draw_operation(void) { label_PowerOff = lv_label_create_empty(buttonPowerOff); if (uiCfg.print_state != WORKING) { - //label_Filament = lv_label_create_empty(buttonFilament); labelExtrusion = lv_label_create_empty(buttonExtrusion); label_Move = lv_label_create_empty(buttonMove); } @@ -205,8 +200,6 @@ void lv_draw_operation(void) { lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); if (uiCfg.print_state != WORKING) { - //lv_label_set_text(label_Filament, operation_menu.filament); - //lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET); lv_label_set_text(labelExtrusion, operation_menu.extr); lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h index cca1f6a2a..0257812ec 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h @@ -28,7 +28,6 @@ extern void lv_draw_operation(void); extern void lv_clear_operation(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp index ec6129446..3eb717b71 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../feature/pause.h" #include "../../../../inc/MarlinConfig.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h index 7d55d8375..88222f0e1 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h @@ -27,7 +27,6 @@ extern void lv_draw_pause_message(const PauseMessage msg); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp index a324aef79..59c30bdb9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp @@ -41,27 +41,22 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_pause_position(); switch (obj->mks_obj_id) { case ID_PAUSE_RETURN: - lv_clear_pause_position(); draw_return_ui(); - break; + return; case ID_PAUSE_X: value = pause_pos_x; - lv_clear_pause_position(); - lv_draw_number_key(); break; case ID_PAUSE_Y: value = pause_pos_y; - lv_clear_pause_position(); - lv_draw_number_key(); break; case ID_PAUSE_Z: value = pause_pos_z; - lv_clear_pause_position(); - lv_draw_number_key(); break; } + lv_draw_number_key(); } void lv_draw_pause_position(void) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp index 0e869e67c..e1d2aecbe 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../module/temperature.h" #include "../../../../inc/MarlinConfig.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h index c8de942f3..602f5e906 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h @@ -31,7 +31,6 @@ extern void disp_temp_type(); extern void disp_step_heat(); extern void disp_desire_temp(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index 38b62db3b..96a6bc117 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -49,7 +49,7 @@ int8_t curDirLever = 0; LIST_FILE list_file; DIR_OFFSET dir_offset[10]; -extern uint8_t public_buf[512]; +extern uint8_t public_buf[513]; extern char public_buf_m[100]; uint8_t sel_id = 0; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h index 94786ab07..ac3539e71 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h @@ -33,16 +33,15 @@ typedef struct { extern DIR_OFFSET dir_offset[10]; #define FILE_NUM 6 -#define SHORT_NEME_LEN 13 +#define SHORT_NAME_LEN 13 #define NAME_CUT_LEN 23 #define MAX_DIR_LEVEL 10 typedef struct { - //char longName[FILE_NUM][LONG_FILENAME_LENGTH]; - char file_name[FILE_NUM][SHORT_NEME_LEN * MAX_DIR_LEVEL + 1]; - char curDirPath[SHORT_NEME_LEN * MAX_DIR_LEVEL + 1]; - char long_name[FILE_NUM][SHORT_NEME_LEN * 2 + 1]; + char file_name[FILE_NUM][SHORT_NAME_LEN * MAX_DIR_LEVEL + 1]; + char curDirPath[SHORT_NAME_LEN * MAX_DIR_LEVEL + 1]; + char long_name[FILE_NUM][SHORT_NAME_LEN * 2 + 1]; bool IsFolder[FILE_NUM]; char Sd_file_cnt; char sd_file_index; @@ -60,7 +59,6 @@ extern int ascii2dec_test(char *ascii); extern void lv_clear_print_file(); extern void lv_gcode_file_seek(uint32_t pos); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index 7614f1e99..13fad747f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../MarlinCore.h" // for marlin_state #include "../../../../module/temperature.h" @@ -75,10 +71,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { switch (obj->mks_obj_id) { case ID_PAUSE: if (uiCfg.print_state == WORKING) { - // #if ENABLED(PARK_HEAD_ON_PAUSE) - // queue.inject_P(PSTR("M25 P\nM24")); #if ENABLED(SDSUPPORT) - // queue.inject_P(PSTR("M25\nG91\nG1 Z10\nG90")); card.pauseSDPrint(); stop_print_time(); uiCfg.print_state = PAUSING; @@ -99,7 +92,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { lv_imgbtn_set_src_both(obj, "F:/bmp_pause.bin"); lv_label_set_text(labelPause, printing_menu.pause); lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 30, 0); - // recovery.resume(); print_time.minutes = recovery.info.print_job_elapsed / 60; print_time.seconds = recovery.info.print_job_elapsed % 60; print_time.hours = print_time.minutes / 60; @@ -164,20 +156,6 @@ void lv_draw_printing(void) { } #endif - // Create labels on the image buttons - //lv_btn_set_layout(buttonExt1, LV_LAYOUT_OFF); - //#if HAS_MULTI_EXTRUDER - // lv_btn_set_layout(buttonExt2, LV_LAYOUT_OFF); - //#endif - - //#if HAS_HEATED_BED - // lv_btn_set_layout(buttonBedstate, LV_LAYOUT_OFF); - //#endif - - //lv_btn_set_layout(buttonFanstate, LV_LAYOUT_OFF); - //lv_btn_set_layout(buttonTime, LV_LAYOUT_OFF); - //lv_btn_set_layout(buttonZpos, LV_LAYOUT_OFF); - labelExt1 = lv_label_create(scr, 250, 146, nullptr); #if HAS_MULTI_EXTRUDER @@ -262,12 +240,10 @@ void disp_fan_Zpos() { } void reset_print_time() { - // print_time.days = 0; print_time.hours = 0; print_time.minutes = 0; print_time.seconds = 0; print_time.ms_10 = 0; - // print_time.start = 1; } void start_print_time() { print_time.start = 1; } @@ -290,7 +266,6 @@ void setProBarRate() { #endif rate = (rate_tmp_r - (PREVIEW_SIZE + To_pre_view)) * 100 / (gCfgItems.curFilesize - (PREVIEW_SIZE + To_pre_view)); } - // gCurFileState.totalSend = rate; if (rate <= 0) return; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h index 466efe01c..d6da1a100 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h @@ -48,7 +48,6 @@ extern void start_print_time(); extern void stop_print_time(); extern void setProBarRate(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp index 3cf0c2bec..b16019e8d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp @@ -26,10 +26,6 @@ #include "draw_ready_print.h" #include "draw_tool.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "tft_lvgl_configuration.h" #include "mks_hardware_test.h" #include "draw_ui.h" @@ -46,7 +42,6 @@ #include -//static lv_obj_t *buttonPrint, *buttonTool, *buttonSet; extern lv_group_t* g; static lv_obj_t *scr; #if ENABLED(MKS_TEST) @@ -61,17 +56,16 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_ready_print(); + switch (obj->mks_obj_id) { case ID_TOOL: - lv_clear_ready_print(); lv_draw_tool(); break; case ID_SET: - lv_clear_ready_print(); lv_draw_set(); break; case ID_PRINT: - lv_clear_ready_print(); lv_draw_print_file(); break; } @@ -104,17 +98,12 @@ void disp_det_error() { lv_obj_t *e1, *e2, *e3, *bed; void mks_disp_test() { char buf[30] = {0}; - //lv_obj_t *label_tool2 = lv_label_create_empty(scr); - //lv_obj_set_pos(label_tool, 20, 50); sprintf_P(buf, PSTR("e1:%d"), (int)thermalManager.temp_hotend[0].celsius); lv_label_set_text(e1, buf); #if HAS_MULTI_HOTEND sprintf_P(buf, PSTR("e2:%d"), (int)thermalManager.temp_hotend[1].celsius); lv_label_set_text(e2, buf); #endif - - //sprintf_P(buf, PSTR("e3:%d"), (int)thermalManager.temp_hotend[2].celsius); - //lv_label_set_text(e3, buf); #if HAS_HEATED_BED sprintf_P(buf, PSTR("bed:%d"), (int)thermalManager.temp_bed.celsius); lv_label_set_text(bed, buf); @@ -128,41 +117,15 @@ void lv_draw_ready_print(void) { disp_state_stack._disp_index = 0; ZERO(disp_state_stack._disp_state); scr = lv_screen_create(PRINT_READY_UI, ""); - //lv_obj_set_hidden(scr, true); if (mks_test_flag == 0x1E) { - //(void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); - // Create image buttons - //buttonPrint = lv_imgbtn_create(scr, nullptr); buttonTool = lv_imgbtn_create(scr, "F:/bmp_tool.bin", event_handler, ID_TOOL); lv_obj_set_pos(buttonTool, 360, 180); - //buttonSet = lv_imgbtn_create(scr, nullptr); - //lv_obj_set_pos(buttonSet, 180, 90); - //lv_obj_set_pos(buttonPrint, 340, 90); - - //lv_obj_set_pos(buttonTool, SIMPLE_FIRST_PAGE_GRAP+1, (TFT_HEIGHT-BTN_Y_PIXEL)/2+2); - //lv_obj_set_pos(buttonSet, BTN_X_PIXEL+SIMPLE_FIRST_PAGE_GRAP*2+1, (TFT_HEIGHT-BTN_Y_PIXEL)/2+2); - //lv_obj_set_pos(buttonPrint, BTN_X_PIXEL*2+SIMPLE_FIRST_PAGE_GRAP*3+1, (TFT_HEIGHT-BTN_Y_PIXEL)/2+2); - - // Create labels on the image buttons - //lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF); - //lv_btn_set_layout(buttonSet, LV_LAYOUT_OFF); - - //lv_obj_t *label_print = lv_label_create_empty(buttonPrint); - //lv_obj_t *label_set = lv_label_create_empty(buttonSet); lv_obj_t *label_tool = lv_label_create_empty(buttonTool); if (gCfgItems.multiple_language) { - //lv_label_set_text(label_print, main_menu.print); - //lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - //lv_label_set_text(label_set, main_menu.set); - //lv_obj_align(label_set, buttonSet, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - - //lv_label_set_style(label_tool, LV_BTN_STATE_PR, &tft_style_label_pre); - //lv_label_set_style(label_tool, LV_BTN_STATE_REL, &tft_style_label_rel); lv_label_set_text(label_tool, main_menu.tool); lv_obj_align(label_tool, buttonTool, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); } @@ -179,11 +142,6 @@ void lv_draw_ready_print(void) { lv_label_set_text(e2, buf); #endif - //e3 = lv_label_create_empty(scr); - //lv_obj_set_pos(e3, 20, 70); - //sprintf_P(buf, PSTR("e1: %d"), (int)thermalManager.temp_hotend[2].celsius); - //lv_label_set_text(e3, buf); - #if HAS_HEATED_BED bed = lv_label_create_empty(scr); lv_obj_set_pos(bed, 20, 95); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h index 5cefe8b59..7a803f80a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h @@ -33,7 +33,6 @@ extern void disp_det_error(); extern void disp_det_ok(); extern void lv_clear_ready_print(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp index 0ccb27415..fa8622e69 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp @@ -27,10 +27,6 @@ #include "draw_set.h" #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "pic_manager.h" @@ -58,36 +54,29 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; - #if ENABLED(MKS_WIFI_MODULE) - char buf[6] = { 0 }; - #endif + if (obj->mks_obj_id == ID_S_CONTINUE) return; + if (obj->mks_obj_id == ID_S_MOTOR_OFF) { + TERN(HAS_SUICIDE, suicide(), queue.enqueue_now_P(PSTR("M84"))); + return; + } + lv_clear_set(); switch (obj->mks_obj_id) { case ID_S_FAN: - lv_clear_set(); lv_draw_fan(); break; case ID_S_ABOUT: - lv_clear_set(); lv_draw_about(); break; - case ID_S_CONTINUE: break; - case ID_S_MOTOR_OFF: - TERN(HAS_SUICIDE, suicide(), queue.enqueue_now_P(PSTR("M84"))); - break; case ID_S_LANGUAGE: - lv_clear_set(); lv_draw_language(); break; case ID_S_MACHINE_PARA: - lv_clear_set(); lv_draw_machine_para(); break; case ID_S_EEPROM_SET: - lv_clear_set(); lv_draw_eeprom_settings(); break; case ID_S_RETURN: - lv_clear_set(); lv_draw_ready_print(); break; @@ -96,32 +85,23 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { if (gCfgItems.wifi_mode_sel == STA_MODEL) { if (wifi_link_state == WIFI_CONNECTED) { last_disp_state = SET_UI; - lv_clear_set(); lv_draw_wifi(); } else { if (uiCfg.command_send == 1) { - buf[0] = 0xA5; - buf[1] = 0x07; - buf[2] = 0x00; - buf[3] = 0x00; - buf[4] = 0xFC; - raw_send_to_wifi(buf, 5); - + uint8_t cmd_wifi_list[] = { 0xA5, 0x07, 0x00, 0x00, 0xFC }; + raw_send_to_wifi(cmd_wifi_list, COUNT(cmd_wifi_list)); last_disp_state = SET_UI; - lv_clear_set(); lv_draw_wifi_list(); } else { last_disp_state = SET_UI; - lv_clear_set(); lv_draw_dialog(DIALOG_WIFI_ENABLE_TIPS); } } } else { last_disp_state = SET_UI; - lv_clear_set(); lv_draw_wifi(); } break; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h index b243bca29..eed0c6c95 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h @@ -28,7 +28,6 @@ extern void lv_draw_set(void); extern void lv_clear_set(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp index 022c4d30f..88cebc421 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp @@ -45,48 +45,37 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_step_settings(); switch (obj->mks_obj_id) { case ID_STEP_RETURN: uiCfg.para_ui_page = 0; - lv_clear_step_settings(); draw_return_ui(); - break; + return; case ID_STEP_X: value = Xstep; - lv_clear_step_settings(); - lv_draw_number_key(); break; case ID_STEP_Y: value = Ystep; - lv_clear_step_settings(); - lv_draw_number_key(); break; case ID_STEP_Z: value = Zstep; - lv_clear_step_settings(); - lv_draw_number_key(); break; case ID_STEP_E0: value = E0step; - lv_clear_step_settings(); - lv_draw_number_key(); break; case ID_STEP_E1: value = E1step; - lv_clear_step_settings(); - lv_draw_number_key(); break; case ID_STEP_UP: uiCfg.para_ui_page = 0; - lv_clear_step_settings(); lv_draw_step_settings(); - break; + return; case ID_STEP_DOWN: uiCfg.para_ui_page = 1; - lv_clear_step_settings(); lv_draw_step_settings(); - break; + return; } + lv_draw_number_key(); } void lv_draw_step_settings(void) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp index aaf3073e3..028c58ab4 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp @@ -46,60 +46,49 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + lv_clear_tmc_current_settings(); switch (obj->mks_obj_id) { case ID_TMC_CURRENT_RETURN: uiCfg.para_ui_page = 0; - lv_clear_tmc_current_settings(); draw_return_ui(); - break; - + return; #if AXIS_IS_TMC(X) case ID_TMC_CURRENT_X: value = Xcurrent; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); break; #endif #if AXIS_IS_TMC(Y) case ID_TMC_CURRENT_Y: value = Ycurrent; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); break; #endif #if AXIS_IS_TMC(Z) case ID_TMC_CURRENT_Z: value = Zcurrent; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); break; #endif #if AXIS_IS_TMC(E0) case ID_TMC_CURRENT_E0: value = E0current; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); break; #endif #if AXIS_IS_TMC(E1) case ID_TMC_CURRENT_E1: value = E1current; - lv_clear_tmc_current_settings(); - lv_draw_number_key(); break; #endif case ID_TMC_CURRENT_UP: uiCfg.para_ui_page = 0; - lv_clear_tmc_current_settings(); lv_draw_tmc_current_settings(); - break; + return; case ID_TMC_CURRENT_DOWN: uiCfg.para_ui_page = 1; - lv_clear_tmc_current_settings(); lv_draw_tmc_current_settings(); - break; + return; } + lv_draw_number_key(); + } void lv_draw_tmc_current_settings(void) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp index 53d7e3538..691e46f01 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp @@ -50,9 +50,7 @@ enum { static lv_obj_t *buttonXState = nullptr, *buttonYState = nullptr, *buttonZState = nullptr, *buttonE0State = nullptr; -//#if AXIS_HAS_STEALTHCHOP(E1) - static lv_obj_t *buttonE1State = nullptr; -//#endif +static lv_obj_t *buttonE1State = nullptr; static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp index 3a9d78741..c48d275e0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp @@ -25,10 +25,6 @@ #include "draw_ui.h" #include -//#include "../lvgl/src/lv_objx/lv_imgbtn.h" -//#include "../lvgl/src/lv_objx/lv_img.h" -//#include "../lvgl/src/lv_core/lv_disp.h" -//#include "../lvgl/src/lv_core/lv_refr.h" #include "../../../../gcode/queue.h" #include "../../../../module/temperature.h" @@ -54,45 +50,42 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + bool clear = (obj->mks_obj_id != ID_T_LEVELING); + #else + constexpr bool clear = true; + #endif + if (clear) lv_clear_tool(); switch (obj->mks_obj_id) { case ID_T_PRE_HEAT: - lv_clear_tool(); lv_draw_preHeat(); break; case ID_T_EXTRUCT: - lv_clear_tool(); lv_draw_extrusion(); break; case ID_T_MOV: - lv_clear_tool(); lv_draw_move_motor(); break; case ID_T_HOME: - lv_clear_tool(); lv_draw_home(); break; case ID_T_LEVELING: #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - //queue.enqueue_one_P(PSTR("G28")); - //queue.enqueue_one_P(PSTR("G29")); get_gcode_command(AUTO_LEVELING_COMMAND_ADDR,(uint8_t *)public_buf_m); public_buf_m[sizeof(public_buf_m)-1] = 0; queue.inject_P(PSTR(public_buf_m)); #else uiCfg.leveling_first_time = 1; - lv_clear_tool(); lv_draw_manualLevel(); #endif break; case ID_T_FILAMENT: uiCfg.desireSprayerTempBak = thermalManager.temp_hotend[uiCfg.curSprayerChoose].target; - lv_clear_tool(); lv_draw_filament_change(); break; case ID_T_MORE: break; case ID_T_RETURN: TERN_(MKS_TEST, curent_disp_ui = 1); - lv_clear_tool(); lv_draw_ready_print(); break; } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h index 8a033e2c4..2191adccb 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h @@ -28,7 +28,6 @@ extern void lv_draw_tool(void); extern void lv_clear_tool(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h index b14700dcf..63749a2b3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_touch_calibration.h @@ -29,7 +29,6 @@ extern void lv_draw_touch_calibration_screen(); extern void lv_clear_touch_calibration_screen(); extern void lv_update_touch_calibration_screen(); -//extern void disp_temp_ready_print(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 46c1ab827..ffbaba4ea 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -70,10 +70,11 @@ uint8_t printing_rate_update_flag; extern bool once_flag; extern uint8_t sel_id; -extern uint8_t public_buf[512]; -extern uint8_t bmp_public_buf[17 * 1024]; extern lv_group_t *g; +extern uint8_t bmp_public_buf[14 * 1024]; +extern uint8_t public_buf[513]; + extern void LCD_IO_WriteData(uint16_t RegValue); static const char custom_gcode_command[][100] = { @@ -568,11 +569,7 @@ char *creat_title_text() { ZERO(tmpCurFileStr); - #if _LFN_UNICODE - //cutFileName((TCHAR *)curFileName, 16, 16, (TCHAR *)tmpCurFileStr); - #else - cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr); - #endif + cutFileName(list_file.long_name[sel_id], 16, 16, tmpCurFileStr); ZERO(public_buf_m); @@ -589,10 +586,7 @@ char *creat_title_text() { index++; } - if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI - /*|| disp_state_stack._disp_state[disp_state_stack._disp_index] == OPERATE_UI - || disp_state_stack._disp_state[disp_state_stack._disp_index] == PAUSE_UI*/ - ) { + if (disp_state_stack._disp_state[disp_state_stack._disp_index] == PRINTING_UI) { titleText_cat(public_buf_m, sizeof(public_buf_m), (char *)":"); titleText_cat(public_buf_m, sizeof(public_buf_m), tmpCurFileStr); } @@ -617,8 +611,6 @@ char *creat_title_text() { void preview_gcode_prehandle(char *path) { #if ENABLED(SDSUPPORT) - //uint8_t re; - //uint32_t read; uint32_t pre_read_cnt = 0; uint32_t *p1; char *cur_name; @@ -957,7 +949,6 @@ void GUI_RefreshPage() { switch (disp_state) { case MAIN_UI: - //lv_draw_ready_print(); break; case EXTRUSION_UI: if (temps_update_flag) { @@ -972,14 +963,6 @@ void GUI_RefreshPage() { } break; case PRINT_READY_UI: - /* - if (gCfgItems.display_style == 2) { - if (temps_update_flag) { - temps_update_flag = false; - disp_restro_state(); - } - } - */ break; case PRINT_FILE_UI: break; @@ -1000,23 +983,9 @@ void GUI_RefreshPage() { break; case OPERATE_UI: - /* - if (temps_update_flag) { - temps_update_flag = false; - disp_temp_operate(); - } - - setProBarRateOpera(); - */ break; case PAUSE_UI: - /* - if (temps_update_flag) { - temps_update_flag = false; - disp_temp_pause(); - } - */ break; case FAN_UI: @@ -1027,17 +996,6 @@ void GUI_RefreshPage() { break; case MOVE_MOTOR_UI: - /* - if (mksReprint.mks_printer_state == MKS_IDLE) { - if (z_high_count == 1 && temper_error_flg != 1) { - z_high_count = 0; - memset((char *)gCfgItems.move_z_coordinate, ' ', sizeof(gCfgItems.move_z_coordinate)); - GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate, 380, TITLE_YPOS); - sprintf_P((char *)gCfgItems.move_z_coordinate, PSTR("Z: %.3f"), current_position[Z_AXIS]); - GUI_DispStringAt((const char *)gCfgItems.move_z_coordinate, 380, TITLE_YPOS); - } - } - */ break; #if ENABLED(MKS_WIFI_MODULE) @@ -1064,7 +1022,6 @@ void GUI_RefreshPage() { TERN_(MKS_WIFI_MODULE, wifi_scan_handle()); break; case MESHLEVELING_UI: - /*disp_zpos();*/ break; case HARDWARE_TEST_UI: break; @@ -1077,8 +1034,6 @@ void GUI_RefreshPage() { #endif break; case KEY_BOARD_UI: - /*update_password_disp(); - update_join_state_disp();*/ break; #if ENABLED(MKS_WIFI_MODULE) case WIFI_TIPS_UI: @@ -1142,33 +1097,33 @@ void clear_cur_ui() { last_disp_state = disp_state_stack._disp_state[disp_state_stack._disp_index]; switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) { - case PRINT_READY_UI: //Get_Temperature_Flg = 0; + case PRINT_READY_UI: lv_clear_ready_print(); break; case PRINT_FILE_UI: lv_clear_print_file(); break; case PRINTING_UI: lv_clear_printing(); break; case MOVE_MOTOR_UI: lv_clear_move_motor(); break; case OPERATE_UI: lv_clear_operation(); break; - case PAUSE_UI: /* Clear_pause(); */ break; + case PAUSE_UI: break; case EXTRUSION_UI: lv_clear_extrusion(); break; case PRE_HEAT_UI: lv_clear_preHeat(); break; case CHANGE_SPEED_UI: lv_clear_change_speed(); break; case FAN_UI: lv_clear_fan(); break; case SET_UI: lv_clear_set(); break; case ZERO_UI: lv_clear_home(); break; - case SPRAYER_UI: /* Clear_Sprayer(); */ break; - case MACHINE_UI: /* Clear_Machine(); */ break; + case SPRAYER_UI: break; + case MACHINE_UI: break; case LANGUAGE_UI: lv_clear_language(); break; case ABOUT_UI: lv_clear_about(); break; - case LOG_UI: /* Clear_Connect(); */ break; - case DISK_UI: /* Clear_Disk(); */ break; + case LOG_UI: break; + case DISK_UI: break; #if ENABLED(MKS_WIFI_MODULE) case WIFI_UI: lv_clear_wifi(); break; #endif case MORE_UI: /* Clear_more(); */ break; - case FILETRANSFER_UI: /* Clear_fileTransfer(); */ break; + case FILETRANSFER_UI: break; case DIALOG_UI: lv_clear_dialog(); break; - case FILETRANSFERSTATE_UI: /* Clear_WifiFileTransferdialog(); */ break; - case PRINT_MORE_UI: /* Clear_Printmore(); */ break; + case FILETRANSFERSTATE_UI: break; + case PRINT_MORE_UI: break; case FILAMENTCHANGE_UI: lv_clear_filament_change(); break; case LEVELING_UI: lv_clear_manualLevel(); break; case BIND_UI: /* Clear_Bind(); */ break; @@ -1176,8 +1131,8 @@ void clear_cur_ui() { case NOZZLE_PROBE_OFFSET_UI: lv_clear_auto_level_offset_settings(); break; #endif case TOOL_UI: lv_clear_tool(); break; - case MESHLEVELING_UI: /* Clear_MeshLeveling(); */ break; - case HARDWARE_TEST_UI: /* Clear_Hardwaretest(); */ break; + case MESHLEVELING_UI: break; + case HARDWARE_TEST_UI: break; #if ENABLED(MKS_WIFI_MODULE) case WIFI_LIST_UI: lv_clear_wifi_list(); break; #endif @@ -1187,28 +1142,28 @@ void clear_cur_ui() { #endif case MACHINE_PARA_UI: lv_clear_machine_para(); break; case MACHINE_SETTINGS_UI: lv_clear_machine_settings(); break; - case TEMPERATURE_SETTINGS_UI: /* Clear_TemperatureSettings(); */ break; + case TEMPERATURE_SETTINGS_UI: break; case MOTOR_SETTINGS_UI: lv_clear_motor_settings(); break; - case MACHINETYPE_UI: /* Clear_MachineType(); */ break; - case STROKE_UI: /* Clear_Stroke(); */ break; - case HOME_DIR_UI: /* Clear_HomeDir(); */ break; - case ENDSTOP_TYPE_UI: /* Clear_EndstopType(); */ break; - case FILAMENT_SETTINGS_UI: lv_clear_filament_settings(); break; - case LEVELING_SETTIGNS_UI: /* Clear_LevelingSettings(); */ break; + case MACHINETYPE_UI: break; + case STROKE_UI: break; + case HOME_DIR_UI: break; + case ENDSTOP_TYPE_UI: break; + case FILAMENT_SETTINGS_UI: break; + case LEVELING_SETTIGNS_UI: break; case LEVELING_PARA_UI: lv_clear_level_settings(); break; - case DELTA_LEVELING_PARA_UI: /* Clear_DeltaLevelPara(); */ break; + case DELTA_LEVELING_PARA_UI: break; case MANUAL_LEVELING_POSIGION_UI: lv_clear_manual_level_pos_settings(); break; case MAXFEEDRATE_UI: lv_clear_max_feedrate_settings(); break; case STEPS_UI: lv_clear_step_settings(); break; case ACCELERATION_UI: lv_clear_acceleration_settings(); break; case JERK_UI: TERN_(HAS_CLASSIC_JERK, lv_clear_jerk_settings()); break; - case MOTORDIR_UI: /* Clear_MotorDir(); */ break; - case HOMESPEED_UI: /* Clear_HomeSpeed(); */ break; - case NOZZLE_CONFIG_UI: /* Clear_NozzleConfig(); */ break; - case HOTBED_CONFIG_UI: /* Clear_HotbedConfig(); */ break; + case MOTORDIR_UI: break; + case HOMESPEED_UI: break; + case NOZZLE_CONFIG_UI: break; + case HOTBED_CONFIG_UI: break; case ADVANCED_UI: lv_clear_advance_settings(); break; - case DOUBLE_Z_UI: /* Clear_DoubleZ(); */ break; - case ENABLE_INVERT_UI: /* Clear_EnableInvert(); */ break; + case DOUBLE_Z_UI: break; + case ENABLE_INVERT_UI: break; case NUMBER_KEY_UI: lv_clear_number_key(); break; case BABY_STEP_UI: lv_clear_baby_stepping(); break; case PAUSE_POS_UI: lv_clear_pause_position(); break; @@ -1233,7 +1188,6 @@ void clear_cur_ui() { #endif default: break; } - //GUI_Clear(); } void draw_return_ui() { @@ -1253,25 +1207,25 @@ void draw_return_ui() { case MOVE_MOTOR_UI: lv_draw_move_motor(); break; case OPERATE_UI: lv_draw_operation(); break; - case PAUSE_UI: /* draw_pause(); */ break; + case PAUSE_UI: break; case EXTRUSION_UI: lv_draw_extrusion(); break; case PRE_HEAT_UI: lv_draw_preHeat(); break; case CHANGE_SPEED_UI: lv_draw_change_speed(); break; case FAN_UI: lv_draw_fan(); break; case SET_UI: lv_draw_set(); break; case ZERO_UI: lv_draw_home(); break; - case SPRAYER_UI: /* draw_Sprayer(); */ break; - case MACHINE_UI: /* draw_Machine(); */ break; + case SPRAYER_UI: break; + case MACHINE_UI: break; case LANGUAGE_UI: lv_draw_language(); break; case ABOUT_UI: lv_draw_about(); break; - case CALIBRATE_UI: /* draw_calibrate(); */ break; - case DISK_UI: /* draw_Disk(); */ break; + case CALIBRATE_UI: break; + case DISK_UI: break; #if ENABLED(MKS_WIFI_MODULE) case WIFI_UI: lv_draw_wifi(); break; #endif - case MORE_UI: /* draw_More(); */ break; case PRINT_MORE_UI: /* draw_printmore(); */ break; + case MORE_UI: break; case FILAMENTCHANGE_UI: lv_draw_filament_change(); break; case LEVELING_UI: lv_draw_manualLevel(); break; case BIND_UI: /* draw_bind(); */ break; @@ -1279,8 +1233,8 @@ void draw_return_ui() { case NOZZLE_PROBE_OFFSET_UI: lv_draw_auto_level_offset_settings(); break; #endif case TOOL_UI: lv_draw_tool(); break; - case MESHLEVELING_UI: /* draw_meshleveling(); */ break; - case HARDWARE_TEST_UI: /* draw_Hardwaretest(); */ break; + case MESHLEVELING_UI: break; + case HARDWARE_TEST_UI: break; #if ENABLED(MKS_WIFI_MODULE) case WIFI_LIST_UI: lv_draw_wifi_list(); break; #endif @@ -1290,16 +1244,16 @@ void draw_return_ui() { #endif case MACHINE_PARA_UI: lv_draw_machine_para(); break; case MACHINE_SETTINGS_UI: lv_draw_machine_settings(); break; - case TEMPERATURE_SETTINGS_UI: /* draw_TemperatureSettings(); */ break; + case TEMPERATURE_SETTINGS_UI: break; case MOTOR_SETTINGS_UI: lv_draw_motor_settings(); break; - case MACHINETYPE_UI: /* draw_MachineType(); */ break; - case STROKE_UI: /* draw_Stroke(); */ break; - case HOME_DIR_UI: /* draw_HomeDir(); */ break; - case ENDSTOP_TYPE_UI: /* draw_EndstopType(); */ break; + case MACHINETYPE_UI: break; + case STROKE_UI: break; + case HOME_DIR_UI: break; + case ENDSTOP_TYPE_UI: break; case FILAMENT_SETTINGS_UI: lv_draw_filament_settings(); break; - case LEVELING_SETTIGNS_UI: /* draw_LevelingSettings(); */ break; + case LEVELING_SETTIGNS_UI: break; case LEVELING_PARA_UI: lv_draw_level_settings(); break; - case DELTA_LEVELING_PARA_UI: /* draw_DeltaLevelPara(); */ break; + case DELTA_LEVELING_PARA_UI: break; case MANUAL_LEVELING_POSIGION_UI: lv_draw_manual_level_pos_settings(); break; case MAXFEEDRATE_UI: lv_draw_max_feedrate_settings(); break; case STEPS_UI: lv_draw_step_settings(); break; @@ -1307,15 +1261,15 @@ void draw_return_ui() { #if HAS_CLASSIC_JERK case JERK_UI: lv_draw_jerk_settings(); break; #endif - case MOTORDIR_UI: /* draw_MotorDir(); */ break; - case HOMESPEED_UI: /* draw_HomeSpeed(); */ break; - case NOZZLE_CONFIG_UI: /* draw_NozzleConfig(); */ break; - case HOTBED_CONFIG_UI: /* draw_HotbedConfig(); */ break; + case MOTORDIR_UI: break; + case HOMESPEED_UI: break; + case NOZZLE_CONFIG_UI: break; + case HOTBED_CONFIG_UI: break; case ADVANCED_UI: lv_draw_advance_settings(); break; - case DOUBLE_Z_UI: /* draw_DoubleZ(); */ break; - case ENABLE_INVERT_UI: /* draw_EnableInvert(); */ break; + case DOUBLE_Z_UI: break; + case ENABLE_INVERT_UI: break; case NUMBER_KEY_UI: lv_draw_number_key(); break; - case DIALOG_UI: /* draw_dialog(uiCfg.dialogType); */ break; + case DIALOG_UI: break; case BABY_STEP_UI: lv_draw_baby_stepping(); break; case PAUSE_POS_UI: lv_draw_pause_position(); break; #if HAS_TRINAMIC_CONFIG @@ -1612,7 +1566,6 @@ void print_time_count() { } void LV_TASK_HANDLER() { - //lv_tick_inc(1); lv_task_handler(); if (mks_test_flag == 0x1E) mks_hardware_test(); @@ -1622,8 +1575,6 @@ void LV_TASK_HANDLER() { TERN_(MKS_WIFI_MODULE, get_wifi_commands()); - //sd_detection(); - #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) lv_update_encoder(); #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index a888217b9..c911e9a6f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -28,7 +28,7 @@ // the colors of the last MKS Ui #undef LV_COLOR_BACKGROUND -#define LV_COLOR_BACKGROUND LV_COLOR_MAKE(0x1A, 0x1A, 0x1A) // LV_COLOR_MAKE(0x00, 0x00, 0x00) +#define LV_COLOR_BACKGROUND LV_COLOR_MAKE(0x1A, 0x1A, 0x1A) #define TFT_LV_PARA_BACK_BODY_COLOR LV_COLOR_MAKE(0x4A, 0x52, 0xFF) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp index 47a5dff04..8dc6beb13 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp @@ -153,9 +153,8 @@ void disp_wifi_state() { } void lv_clear_wifi() { - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g); - #endif + if (TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable)) + lv_group_remove_all_objs(g); lv_obj_del(scr); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp index f902edce7..699b3fdae 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp @@ -122,6 +122,9 @@ void lv_draw_wifi_list(void) { lv_group_add_obj(g, buttonDown); lv_group_add_obj(g, buttonBack); } + #else + UNUSED(buttonDown); + UNUSED(buttonBack); #endif disp_wifi_list(); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp index fbc8192ff..f3585cc6c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp @@ -50,10 +50,8 @@ static x_header_t __g_xbf_hd = { .min = 0, .max = 0, .bpp = 0 }; static uint8_t __g_font_buf[63]; static uint8_t *__user_font_getdata(int offset, int size) { - //ZERO(__g_font_buf); get_spi_flash_data((char *)__g_font_buf, offset, size); return __g_font_buf; - //return &buf_test[offset]; } static const uint8_t * __user_font_get_bitmap(const lv_font_t * font, uint32_t unicode_letter) { @@ -67,9 +65,7 @@ static const uint8_t * __user_font_get_bitmap(const lv_font_t * font, uint32_t u uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); if (p_pos[0] != 0) { uint32_t pos = p_pos[0]; - //glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(pos, 2); __user_font_getdata(pos, 2); - //return __user_font_getdata(pos+2, gdsc->box_w*__g_xbf_hd.bpp/8); return __user_font_getdata(pos + 2, sizeof(__g_font_buf)); } return nullptr; @@ -97,12 +93,6 @@ static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_ return false; } -/*lv_font_t gb2312_puhui32 = { -.get_glyph_bitmap = __user_font_get_bitmap, -.get_glyph_dsc = __user_font_get_glyph_dsc, -.line_height = 25, -.base_line = 0, -};*/ lv_font_t gb2312_puhui32; void init_gb2312_font() { gb2312_puhui32.get_glyph_bitmap = __user_font_get_bitmap; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp index 06d6ca6b7..d2d1c1906 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp @@ -53,11 +53,8 @@ void test_gpio_readlevel_L() { #if PIN_EXISTS(MT_DET_2) mt_det2_sta = (READ(MT_DET_2_PIN) == 0); #endif - //mt_det3_sta = (READ(FIL_RUNOUT_3_PIN) == 0); endstopx1_sta = (READ(X_MIN_PIN) == 0); - //endstopx2_sta = (READ(X_MAX_PIN) == 0); endstopy1_sta = (READ(Y_MIN_PIN) == 0); - //endstopy2_sta = (READ(Y_MAX_PIN) == 0); endstopz1_sta = (READ(Z_MIN_PIN) == 0); endstopz2_sta = (READ(Z_MAX_PIN) == 0); #endif @@ -75,11 +72,8 @@ void test_gpio_readlevel_H() { #if PIN_EXISTS(MT_DET_2) mt_det2_sta = (READ(MT_DET_2_PIN) == 1); #endif - //mt_det3_sta = (READ(MT_DET_3_PIN) == 1); endstopx1_sta = (READ(X_MIN_PIN) == 1); - //endstopx2_sta = (READ(X_MAX_PIN) == 1); endstopy1_sta = (READ(Y_MIN_PIN) == 1); - //endstopy2_sta = (READ(Y_MAX_PIN) == 1); endstopz1_sta = (READ(Z_MIN_PIN) == 1); endstopz2_sta = (READ(Z_MAX_PIN) == 1); #endif @@ -88,9 +82,7 @@ void test_gpio_readlevel_H() { void init_test_gpio() { #ifdef MKS_TEST SET_INPUT_PULLUP(X_MIN_PIN); - //SET_INPUT_PULLUP(X_MAX_PIN); SET_INPUT_PULLUP(Y_MIN_PIN); - //SET_INPUT_PULLUP(Y_MAX_PIN); SET_INPUT_PULLUP(Z_MIN_PIN); SET_INPUT_PULLUP(Z_MAX_PIN); @@ -100,7 +92,6 @@ void init_test_gpio() { #if PIN_EXISTS(MT_DET_2) SET_INPUT_PULLUP(MT_DET_2_PIN); #endif - //SET_INPUT_PULLUP(MT_DET_3_PIN); SET_INPUT_PULLUP(MKS_TEST_POWER_LOSS_PIN); SET_INPUT_PULLUP(MKS_TEST_PS_ON_PIN); @@ -122,7 +113,6 @@ void init_test_gpio() { #if !MB(MKS_ROBIN_E3P) WRITE(E1_ENABLE_PIN, LOW); #endif - //WRITE(E2_ENABLE_PIN, LOW); #if MB(MKS_ROBIN_E3P) SET_INPUT_PULLUP(PA1); @@ -167,15 +157,13 @@ void mks_gpio_test() { && (READ(PE6) == 0) && (READ(PE7) == 0) #endif - ) // &&(mt_det3_sta == 1)) + ) disp_det_ok(); else disp_det_error(); if ( (endstopx1_sta == 1) - //&& (endstopx2_sta == 1) && (endstopy1_sta == 1) - //&& (endstopy2_sta == 1) && (endstopz1_sta == 1) && (endstopz2_sta == 1) ) @@ -195,9 +183,7 @@ void mks_hardware_test() { #if !MB(MKS_ROBIN_E3P) WRITE(E1_DIR_PIN, LOW); #endif - //WRITE(E2_DIR_PIN, LOW); thermalManager.fan_speed[0] = 255; - //WRITE(HEATER_2_PIN, HIGH); // HE2 #if !MB(MKS_ROBIN_E3P) WRITE(HEATER_1_PIN, HIGH); // HE1 #endif @@ -212,9 +198,7 @@ void mks_hardware_test() { #if !MB(MKS_ROBIN_E3P) WRITE(E1_DIR_PIN, HIGH); #endif - //WRITE(E2_DIR_PIN, HIGH); thermalManager.fan_speed[0] = 0; - //WRITE(HEATER_2_PIN, LOW); // HE2 #if !MB(MKS_ROBIN_E3P) WRITE(HEATER_1_PIN, LOW); // HE1 #endif @@ -229,7 +213,6 @@ void mks_hardware_test() { // nothing here } else { - //mks_test_beeper(); } if (disp_state == PRINT_READY_UI) @@ -637,7 +620,6 @@ void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor } } -//static lv_obj_t *scr_test; void disp_assets_update() { SPI_TFT.LCD_clear(0x0000); disp_string(100, 140, "Assets Updating...", 0xFFFF, 0x0000); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp index 4dd84d021..c908b9af3 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp @@ -36,7 +36,6 @@ #include "../../../../MarlinCore.h" extern uint16_t DeviceCode; -extern unsigned char bmp_public_buf[17 * 1024]; #if ENABLED(SDSUPPORT) extern char *createFilename(char * const buffer, const dir_t &p); @@ -55,7 +54,6 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_preHeat.bin", "bmp_extruct.bin", "bmp_mov.bin", - // "bmp_Zero.bin", "bmp_leveling.bin", "bmp_filamentchange.bin", @@ -65,13 +63,8 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_speed255.bin", "bmp_speed127.bin", "bmp_speed0.bin", - - //preheat screen - // "bmp_Add.bin", - // "bmp_Dec.bin", "bmp_speed0.bin", - // "bmp_Extru2.bin", - // "bmp_Extru1.bin", + "bmp_bed.bin", "bmp_step1_degree.bin", "bmp_step5_degree.bin", @@ -113,7 +106,6 @@ static const char assets[][LONG_FILENAME_LENGTH] = { //operation screen "bmp_auto_off.bin", "bmp_speed.bin", - //"bmp_Mamual.bin", //TODO: didn't find it.. changed to bmp_manual_off.bin "bmp_fan.bin", "bmp_temp.bin", "bmp_extrude_opr.bin", @@ -125,7 +117,6 @@ static const char assets[][LONG_FILENAME_LENGTH] = { "bmp_step10_percent.bin", "bmp_extruct_sel.bin", "bmp_mov_changespeed.bin", - // "bmp_extrude_opr.bin", equal to "bmp_Extruct.bin" "bmp_mov_sel.bin", "bmp_speed_extruct.bin", @@ -182,9 +173,6 @@ static const char assets[][LONG_FILENAME_LENGTH] = { // settings screen "bmp_about.bin", - //"bmp_Language.bin", - //"bmp_Fan.bin", - //"bmp_manual_off.bin", //start screen "bmp_printing.bin", @@ -373,8 +361,6 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { return Pic_SaveAddr; } -uint8_t public_buf[512]; - #if ENABLED(SDSUPPORT) static void dosName2LongName(const char dosName[11], char* longName) { diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h index ea75915df..b856916b9 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h @@ -95,9 +95,7 @@ #define PIC_NAME_ADDR 0x003000 // Pic information addr #define PIC_SIZE_ADDR 0x007000 // Pic size information addr #define PIC_COUNTER_ADDR 0x008000 // Pic total number - //#define PER_PIC_SAVE_ADDR 0x009000 // Storage address of each picture #define PIC_LOGO_ADDR 0x009000 // Logo addr - //#define PIC_DATA_ADDR 0x02F000 // // TFT35 #define DEFAULT_VIEW_ADDR_TFT35 0xC5800 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp index 1b611aba6..3c3e7c267 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp @@ -69,9 +69,6 @@ void printer_state_polling() { uiCfg.print_state = PAUSED; uiCfg.current_e_position_bak = current_position.e; - // #if ENABLED(POWER_LOSS_RECOVERY) - // if (recovery.enabled) recovery.save(true); - // #endif gCfgItems.pause_reprint = true; update_spi_flash(); } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h index 41bf82e80..07f4474dd 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h @@ -381,28 +381,12 @@ #define FILAMENT_EXT1_TEXT_EN "Extrusion2" #define FILAMENT_HEAT_TEXT_EN "Preheat" #define FILAMENT_STOP_TEXT_EN "Stop" -//#define FILAMENT_CHANGE_TEXT_EN "Filament replace" #define FILAMENT_TIPS2_TEXT_EN "T:" #define FILAMENT_TIPS3_TEXT_EN "Loading..." #define FILAMENT_TIPS4_TEXT_EN "Unloading..." #define FILAMENT_TIPS5_TEXT_EN "Temp is too low to go,please heat" #define FILAMENT_TIPS6_TEXT_EN "Completed" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_EN "Please click or \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_EN "Please click or ,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_EN "Heat completed,please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please click for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_EN "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_EN "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_EN "Load filament completed,click for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,click for return!" -#endif - - #define FILAMENT_CHANGE_TEXT_EN "Please click \nor ,After \npinter pause." #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_EN "Heating up the nozzle,\nplease wait..." @@ -419,11 +403,7 @@ #define PRE_HEAT_BED_TEXT_EN "Bed" #define FILE_LOADING_EN "Loading......" -#if 0 - #define NO_FILE_AND_CHECK_EN "No files found!Please insert SD card or U disk!" -#else - #define NO_FILE_AND_CHECK_EN " No files found!\n Check the file system configuration!" -#endif +#define NO_FILE_AND_CHECK_EN " No files found!\n Check the file system configuration!" #define NO_FILE_EN "No files found!" @@ -491,7 +471,6 @@ #define DIALOG_RETRY_EN "Retry" #define DIALOG_STOP_EN "Stop" #define DIALOG_REPRINT_FROM_BREAKPOINT_EN "Reprint from breakpoint?" -//#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?" #define DIALOG_ERROR_TIPS1_EN "Error:no file,please check it again." #define DIALOG_ERROR_TIPS2_EN "Error:transaction failed.please check display baudrate \nwhether as the same as mainboard!" #define DIALOG_ERROR_TIPS3_EN "Error:file name or path is too long!" @@ -691,34 +670,16 @@ //manual ip #define MANUAL_IP_TITLE_EN "Manual IP" -#define MANUAL_IP_CANCEL_EN "< Cancel" +#define MANUAL_IP_CANCEL_EN "< Cancel" #define MANUAL_IP_APPLY_EN "Join >" #define MANUAL_IP_ADDRESS_EN "IP Address" #define MANUAL_IP_MASK_EN "Subnet Mask" #define MANUAL_IP_GATEWAY_EN "Default Gateway" #define MANUAL_IP_SERVER_EN "Name Server" #define MANUAL_IP_INIT_DATA_EN "0.0.0.0" -#define MANUAL_TEXT_POINT_EN "." +#define MANUAL_TEXT_POINT_EN "." #define MANUAL_TEXT_ENTER_EN "enter" -//Wifi name -//#define TEXT_WIFI_MENU_TITLE_EN "WI-FI" -//#define TEXT_WIFI_SAPCE_EN "space" -//#define TEXT_WIFI_LETTER_EN "abc" -//#define TEXT_WIFI_DIGITAL_EN "123" -//#define TEXT_WIFI_SYMBOL_EN "#+=" -//#define TEXT_WIFI_PASSWORD_EN "Password" - -//#define TEXT_WIFI_POINT_BOLD_EN "`" - -//#define TEXT_WIFI_JOINING_EN "Joining\nNetwork..." -//#define TEXT_WIFI_FAILED_JOIN_EN "Failed to\nJoin Wi-Fi" -//#define TEXT_WIFI_WIFI_CONECTED_EN "Wi-Fi\nConnected" - -//#define TEXT_BUTTON_DISCONECTED_EN "Disconnect" -//#define TEXT_WIFI_FORGET_EN "Forget Network" -//#define TEXT_DISCONECTED_EN "Wi-Fi Connected" - #define TEXT_FORGET_TIPS_TITLE_EN "Forget Network" #define TEXT_FORGET_NETWORK_TIPS1_EN "Are you sure you want to\nforget this network?" #define TEXT_FORGET_NETWORK_TIPS2_EN "This machine will no longer\njoin this Wi-Fi Network." diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h index 6944d6b23..8b090285b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h @@ -135,26 +135,12 @@ #define FILAMENT_EXT1_TEXT_FR "Extr2" #define FILAMENT_HEAT_TEXT_FR "Preheat" #define FILAMENT_STOP_TEXT_FR "Arrêter" -//#define FILAMENT_CHANGE_TEXT_FR "Filament remplacer" #define FILAMENT_TIPS2_TEXT_FR "T:" #define FILAMENT_TIPS3_TEXT_FR "Insérer le filament..." #define FILAMENT_TIPS4_TEXT_FR "éjecter le filament..." #define FILAMENT_TIPS5_TEXT_FR "Température trop basse pour démarrer, chauffez svp" #define FILAMENT_TIPS6_TEXT_FR "Terminé" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_FR "Please click or <éjecter> \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_FR "Please click or <éjecter>,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR "Heat completed,please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please click for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_FR "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_FR "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Load filament completed,click for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,click for return!" -#endif #define FILAMENT_CHANGE_TEXT_FR "Please click \nor ,After \npinter pause." #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR "Heating up the nozzle,\nplease wait..." @@ -171,16 +157,9 @@ #define PRE_HEAT_BED_TEXT_FR "Bed" #define FILE_LOADING_FR "Chargement......" -#if 0 - #define NO_FILE_AND_CHECK_FR "Aucun fichier trouvé! Insérez une carte SD ou un disque U!" -#else - #define NO_FILE_AND_CHECK_FR "Aucun fichier,vérifiez à nouveau!" -#endif - +#define NO_FILE_AND_CHECK_FR "Aucun fichier, vérifiez à nouveau!" #define NO_FILE_FR "Pas de fichier!" - - #define EXTRUDER_TEMP_TEXT_FR "Temper" #define EXTRUDER_E_LENGTH1_TEXT_FR "Extruder1" #define EXTRUDER_E_LENGTH2_TEXT_FR "Extruder2" @@ -222,7 +201,7 @@ #define TITLE_ADJUST_FR "Réglage" #define TITLE_WIRELESS_FR "Sans fil" #define TITLE_FILAMENT_FR "Remplacer" -#define TITLE_ABOUT_FR "A propos" +#define TITLE_ABOUT_FR "À propos" #define TITLE_FAN_FR "Ventilateur" #define TITLE_LANGUAGE_FR "Langue" #define TITLE_PAUSE_FR "Pause" @@ -247,7 +226,6 @@ #define DIALOG_STOP_FR "Arrêter" #define DIALOG_REPRINT_FROM_BREAKPOINT_FR "Continuer?" -//#define DIALOG_UNBIND_PRINTER_FR "Non lié?" #define DIALOG_ERROR_TIPS1_FR "Erreur:error:Aucun fichier, \nvérifiez à nouveau." #define DIALOG_ERROR_TIPS2_FR "Erreur:La opération a échoué. \nVerifiez que le baudrate de l'écran et de \nla carte mère soient identique!" #define DIALOG_ERROR_TIPS3_FR "Erreur: le nom du fichier ou le \nchemin d'accès est trop long." @@ -261,10 +239,10 @@ #define MESSAGE_PAUSING_FR "Parking..." #define MESSAGE_CHANGING_FR "Attente filament pour démarrer" #define MESSAGE_UNLOAD_FR "Attente retrait du filament" -#define MESSAGE_WAITING_FR "Presser bouton,pour reprendre" +#define MESSAGE_WAITING_FR "Presser bouton, pour reprendre" #define MESSAGE_INSERT_FR "Insérer filament et app. bouton pour continuer..." #define MESSAGE_LOAD_FR "Attente chargement filament" -#define MESSAGE_PURGE_FR "Attente Purge filament" +#define MESSAGE_PURGE_FR "Attente purge filament" #define MESSAGE_RESUME_FR "Attente reprise impression" #define MESSAGE_HEAT_FR "Presser le bouton pour chauffer..." #define MESSAGE_HEATING_FR "Buse en chauffe Patienter SVP..." diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h index f64ca4df7..9f53b1b32 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h @@ -135,26 +135,12 @@ #define FILAMENT_EXT1_TEXT_IT "Estrude2" #define FILAMENT_HEAT_TEXT_IT "Preriscaldamento" #define FILAMENT_STOP_TEXT_IT "Stop" -//#define FILAMENT_CHANGE_TEXT_IT "Filamento" #define FILAMENT_TIPS2_TEXT_IT "T:" #define FILAMENT_TIPS3_TEXT_IT "Inserimento del filamento..." #define FILAMENT_TIPS4_TEXT_IT "Estrazione del filamento..." #define FILAMENT_TIPS5_TEXT_IT "Temp is too low to go,please heat" #define FILAMENT_TIPS6_TEXT_IT "Completato" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_IT "Please click or \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_IT "Please click or ,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_IT "Heat completed,please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_IT "Please load filament to extruder,and click for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT "Heat completed,please click for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_IT "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_IT "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,click for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,click for return!" -#endif #define FILAMENT_CHANGE_TEXT_IT "Please click \nor ,After \npinter pause." #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_IT "Heating up the nozzle,please wait..." @@ -166,16 +152,11 @@ #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_IT "Load filament completed,\nclick for return!" #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,\nclick for return!" - #define PRE_HEAT_EXT_TEXT_IT "E" #define PRE_HEAT_BED_TEXT_IT "Piano" #define FILE_LOADING_IT "Caricamento......" -#if 0 - #define NO_FILE_AND_CHECK_IT "Nessun file trovato! Inserisci la scheda SD o il disco U!" -#endif #define NO_FILE_AND_CHECK_IT "Nessun file,\n per favore controllare di nuovo!" - #define NO_FILE_IT "Nessun file!" #define EXTRUDER_TEMP_TEXT_IT "Temper" @@ -241,7 +222,6 @@ #define DIALOG_CANCEL_PRINT_IT "Stop stampa?" #define DIALOG_STOP_IT "Stop" #define DIALOG_REPRINT_FROM_BREAKPOINT_IT "Continua a stampare dal \npunto di interruzione?" -//#define DIALOG_UNBIND_PRINTER_IT "Libero?" #define DIALOG_ERROR_TIPS1_IT "Errore: nessun file, \nper favore controllare di nuovo." #define DIALOG_ERROR_TIPS2_IT "Errore: operazione non riuscita, \nsi prega di controllare se il baudrate del \ndisplay è lo stesso scheda madre" #define DIALOG_ERROR_TIPS3_IT "Errore: il nome del file o il \npercorso è troppo lungo!" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h index 9f695b376..a284b2bad 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h @@ -135,26 +135,12 @@ #define FILAMENT_EXT1_TEXT_RU "экструдер2" #define FILAMENT_HEAT_TEXT_RU "нагрев" #define FILAMENT_STOP_TEXT_RU "стоп" -//#define FILAMENT_CHANGE_TEXT_RU "замена" #define FILAMENT_TIPS2_TEXT_RU "T:" #define FILAMENT_TIPS3_TEXT_RU "втянуть..." #define FILAMENT_TIPS4_TEXT_RU "вядавить..." #define FILAMENT_TIPS5_TEXT_RU "Низкая температура, \nнеобходим нагрев" #define FILAMENT_TIPS6_TEXT_RU "завершено" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_RU "Please click <втянуть> or <выдавить> \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_RU "Please click <втянуть> or <выдавить>,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,please wait..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_RU "Heat completed,please load filament to extruder,and click <да> for start loading." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_RU "Please load filament to extruder,and click <да> for start loading." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_RU "Heat completed,please click <да> for start unloading.!" - #define FILAMENT_DIALOG_LOADING_TIPS_RU "Is loading ,please wait!" - #define FILAMENT_DIALOG_UNLOADING_TIPS_RU "Is unloading,please wait!" - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,click <да> for return!" - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,click <да> for return!" -#endif #define FILAMENT_CHANGE_TEXT_RU "Please click \nor ,After \npinter pause." #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_RU "Heating up the nozzle,\nplease wait..." @@ -166,14 +152,10 @@ #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_RU "Load filament completed,\nclick for return!" #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,\nclick for return!" - #define PRE_HEAT_EXT_TEXT_RU "E" #define PRE_HEAT_BED_TEXT_RU "стол" #define FILE_LOADING_RU "загрузка......" -#if 0 - #define NO_FILE_AND_CHECK_RU "Файлы не найдены! Вставьте SD-карту или диск U!" -#endif #define NO_FILE_AND_CHECK_RU "нет файла,попробуйте ещё раз!" #define NO_FILE_RU "нет файла!" @@ -242,7 +224,6 @@ #define DIALOG_CANCEL_PRINT_RU "стоп?" #define DIALOG_STOP_RU "стоп" #define DIALOG_REPRINT_FROM_BREAKPOINT_RU "продолжить?" -//#define DIALOG_UNBIND_PRINTER_RU "разрыв?" #define DIALOG_ERROR_TIPS1_RU "ошибка:нет файла, попробуйте ещё раз." #define DIALOG_ERROR_TIPS2_RU "ошибка:сбой передачи. установите скорость \nпередачи данных как на плате управления!" #define DIALOG_ERROR_TIPS3_RU "ошибка: имя файла слишком длинное!" @@ -268,9 +249,9 @@ #define MESSAGE_PURGE_MORE_RU "чистка" #define MESSAGE_CONTINUE_PRINT_RU "Распечатать" #define EEPROM_SETTINGS_TITLE_RU "Настройки EEPROM" -#define EEPROM_SETTINGS_STORE_RU "Сохранение настроек в EEPROM" +#define EEPROM_SETTINGS_STORE_RU "Cохранение настроек в EEPROM" #define EEPROM_SETTINGS_READ_RU "Чтение настроек из EEPROM" -#define EEPROM_SETTINGS_REVERT_RU "Восстановить заводские настройки по умолчанию" +#define EEPROM_SETTINGS_REVERT_RU "Bосстановить заводские настройки по умолчанию" #define EEPROM_STORE_TIPS_RU "Сохранить настройки в EEPROM?" #define EEPROM_READ_TIPS_RU "Читать настройки из EEPROM?" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h index 118992777..45eeb0f99 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h @@ -177,42 +177,42 @@ #define E0_STEPS_CN "E0轴脉冲" #define E1_STEPS_CN "E1轴脉冲" -#define TMC_CURRENT_CONF_TITLE_CN "机器参数>TMC电流设置" -#define X_TMC_CURRENT_CN "X轴电流(毫安)" -#define Y_TMC_CURRENT_CN "Y轴电流(毫安)" -#define Z_TMC_CURRENT_CN "Z轴电流(毫安)" -#define E0_TMC_CURRENT_CN "E0轴电流(毫安)" -#define E1_TMC_CURRENT_CN "E1轴电流(毫安)" +#define TMC_CURRENT_CONF_TITLE_CN "机器参数>TMC电流设置" +#define X_TMC_CURRENT_CN "X轴电流(毫安)" +#define Y_TMC_CURRENT_CN "Y轴电流(毫安)" +#define Z_TMC_CURRENT_CN "Z轴电流(毫安)" +#define E0_TMC_CURRENT_CN "E0轴电流(毫安)" +#define E1_TMC_CURRENT_CN "E1轴电流(毫安)" -#define TMC_MODE_CONF_TITLE_CN "机器参数>TMC模式设置" -#define X_TMC_MODE_CN "X轴是否使能静音模式" -#define Y_TMC_MODE_CN "Y轴是否使能静音模式" -#define Z_TMC_MODE_CN "Z轴是否使能静音模式" -#define E0_TMC_MODE_CN "E0轴是否使能静音模式" -#define E1_TMC_MODE_CN "E1轴是否使能静音模式" +#define TMC_MODE_CONF_TITLE_CN "机器参数>TMC模式设置" +#define X_TMC_MODE_CN "X轴是否使能静音模式" +#define Y_TMC_MODE_CN "Y轴是否使能静音模式" +#define Z_TMC_MODE_CN "Z轴是否使能静音模式" +#define E0_TMC_MODE_CN "E0轴是否使能静音模式" +#define E1_TMC_MODE_CN "E1轴是否使能静音模式" -#define MOTORDIR_CONF_TITLE_CN "机器参数>电机方向" -#define X_MOTORDIR_CN "X轴电机方向" -#define Y_MOTORDIR_CN "Y轴电机方向" -#define Z_MOTORDIR_CN "Z轴电机方向" -#define E0_MOTORDIR_CN "E0轴电机方向" -#define E1_MOTORDIR_CN "E1轴电机方向" -#define INVERT_P_CN "正向" -#define INVERT_N_CN "反向" +#define MOTORDIR_CONF_TITLE_CN "机器参数>电机方向" +#define X_MOTORDIR_CN "X轴电机方向" +#define Y_MOTORDIR_CN "Y轴电机方向" +#define Z_MOTORDIR_CN "Z轴电机方向" +#define E0_MOTORDIR_CN "E0轴电机方向" +#define E1_MOTORDIR_CN "E1轴电机方向" +#define INVERT_P_CN "正向" +#define INVERT_N_CN "反向" -#define HOMEFEEDRATE_CONF_TITLE_CN "机器参数>归零速度" -#define X_HOMESPEED_CN "XY轴归零速度" -#define Y_HOMESPEED_CN "Y轴归零速度" -#define Z_HOMESPEED_CN "Z轴归零速度" +#define HOMEFEEDRATE_CONF_TITLE_CN "机器参数>归零速度" +#define X_HOMESPEED_CN "XY轴归零速度" +#define Y_HOMESPEED_CN "Y轴归零速度" +#define Z_HOMESPEED_CN "Z轴归零速度" -#define ADVANCED_CONF_TITLE_CN "机器参数>高级设置" -#define PWROFF_DECTION_CN "断电检测模块" -#define PWROFF_AFTER_PRINT_CN "启动打完关机功能" -#define HAVE_UPS_CN "机器配备UPS电源" -#define Z2_AND_Z2ENDSTOP_CONF_CN "双Z轴双限位功能设置" -#define ENABLE_PINS_CONF_CN "电机使能脚电平设置" -#define WIFI_SETTINGS_CN "Wi-Fi参数设置" -#define ENCODER_SETTINGS_CN "旋钮设置" +#define ADVANCED_CONF_TITLE_CN "机器参数>高级设置" +#define PWROFF_DECTION_CN "断电检测模块" +#define PWROFF_AFTER_PRINT_CN "启动打完关机功能" +#define HAVE_UPS_CN "机器配备UPS电源" +#define Z2_AND_Z2ENDSTOP_CONF_CN "双Z轴双限位功能设置" +#define ENABLE_PINS_CONF_CN "电机使能脚电平设置" +#define WIFI_SETTINGS_CN "Wi-Fi参数设置" +#define ENCODER_SETTINGS_CN "旋钮设置" #define Z2_AND_Z2ENDSTOP_CONF_TITLE_CN "双z双限位设置" #define Z2_ENABLE_CN "启用Z2轴" @@ -225,23 +225,23 @@ #define Z_ENABLE_PINS_INVERT_CN "Z轴电机使能电平" #define E_ENABLE_PINS_INVERT_CN "E轴电机使能电平" -#define PAUSE_POSITION_CN "打印暂停位置设置" -#define PAUSE_POSITION_X_CN "X轴暂停位置(绝对位置,-1无效)" -#define PAUSE_POSITION_Y_CN "Y轴暂停位置(绝对位置,-1无效)" -#define PAUSE_POSITION_Z_CN "Z轴暂停位置(相对位置,-1无效)" -#define WIFI_SETTINGS_TITLE_CN "机器参数>Wi-Fi设置" -#define WIFI_SETTINGS_MODE_CN "Wi-Fi 模式" -#define WIFI_SETTINGS_NAME_CN "Wi-Fi 名称: " -#define WIFI_SETTINGS_PASSWORD_CN "Wi-Fi 密码: " -#define WIFI_SETTINGS_CLOUD_CN "是否使用云服务?" -#define WIFI_SETTINGS_CONFIG_CN "配置" -#define WIFI_SETTINGS_EDIT_CN "编辑" -#define WIFI_CONFIG_TIPS_CN "进行Wi-Fi配置?" +#define PAUSE_POSITION_CN "打印暂停位置设置" +#define PAUSE_POSITION_X_CN "X轴暂停位置(绝对位置,-1无效)" +#define PAUSE_POSITION_Y_CN "Y轴暂停位置(绝对位置,-1无效)" +#define PAUSE_POSITION_Z_CN "Z轴暂停位置(相对位置,-1无效)" +#define WIFI_SETTINGS_TITLE_CN "机器参数>Wi-Fi设置" +#define WIFI_SETTINGS_MODE_CN "Wi-Fi 模式" +#define WIFI_SETTINGS_NAME_CN "Wi-Fi 名称: " +#define WIFI_SETTINGS_PASSWORD_CN "Wi-Fi 密码: " +#define WIFI_SETTINGS_CLOUD_CN "是否使用云服务?" +#define WIFI_SETTINGS_CONFIG_CN "配置" +#define WIFI_SETTINGS_EDIT_CN "编辑" +#define WIFI_CONFIG_TIPS_CN "进行Wi-Fi配置?" -#define OFFSET_TITLE_CN "机器参数>偏移设置" -#define OFFSET_X_CN "X轴与调平开关偏移" -#define OFFSET_Y_CN "Y轴与调平开关偏移" -#define OFFSET_Z_CN "Z轴与调平开关偏移" +#define OFFSET_TITLE_CN "机器参数>偏移设置" +#define OFFSET_X_CN "X轴与调平开关偏移" +#define OFFSET_Y_CN "Y轴与调平开关偏移" +#define OFFSET_Z_CN "Z轴与调平开关偏移" #define HOMING_SENSITIVITY_CONF_TITLE_CN "机器参数>灵敏度调节" #define X_SENSITIVITY_CN "X轴灵敏度" @@ -364,12 +364,7 @@ #define FILAMENT_EXT1_TEXT_CN "喷头2" #define FILAMENT_HEAT_TEXT_CN "预热" #define FILAMENT_STOP_TEXT_CN "停止" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_CN "请按<进料>或<退料>进行换料!" - #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,请按<进料>或<退料>进行换料!" -#else - #define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,\n请按<进料>或<退料>" -#endif +#define FILAMENT_CHANGE_TEXT_CN "待打印机暂停后,\n请按<进料>或<退料>" #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_CN "准备进料,正在加热,请稍等!" #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_CN "准备退料,正在加热,请稍等!" @@ -456,7 +451,6 @@ #define DIALOG_RETRY_CN "重试" #define DIALOG_STOP_CN "停止" #define DIALOG_REPRINT_FROM_BREAKPOINT_CN "从断点续打?" -//#define DIALOG_UNBIND_PRINTER_CN "解除绑定 ?" #define DIALOG_ERROR_TIPS1_CN "错误:找不到文件,请插入sd卡/u盘!" #define DIALOG_ERROR_TIPS2_CN "错误:通信失败,请检查波特率或主板硬件!" #define DIALOG_ERROR_TIPS3_CN "错误:文件名或文件路径太长 !" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h index 2babbaba9..6366527d8 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h @@ -23,13 +23,13 @@ //****************西班牙语*************************** #define TOOL_TEXT_SP "Ajustes" -#define PREHEAT_TEXT_SP "Precalentar"//"precalent\nar" +#define PREHEAT_TEXT_SP "Precalentar" #define MOVE_TEXT_SP "Mover" #define HOME_TEXT_SP "Origen" #define PRINT_TEXT_SP "Imprimir" #define EXTRUDE_TEXT_SP "Extrusor" -#define LEVELING_TEXT_SP "Leveling"//"nivelac\nión" -#define AUTO_LEVELING_TEXT_SP "Autolevel"//"auto\nnivelación" +#define LEVELING_TEXT_SP "Leveling" +#define AUTO_LEVELING_TEXT_SP "Autolevel" #define SET_TEXT_SP "Config" #define MORE_TEXT_SP "Más" @@ -135,50 +135,30 @@ #define FILAMENT_EXT1_TEXT_SP "Extrusor2" #define FILAMENT_HEAT_TEXT_SP "Precalentar" #define FILAMENT_STOP_TEXT_SP "Parar" -//#define FILAMENT_CHANGE_TEXT_SP "Filamento" #define FILAMENT_TIPS2_TEXT_SP "T:" #define FILAMENT_TIPS3_TEXT_SP "Dentro..." #define FILAMENT_TIPS4_TEXT_SP "Fuera..." #define FILAMENT_TIPS5_TEXT_SP "Temperatura demasiado baja, por favor calentar" #define FILAMENT_TIPS6_TEXT_SP "Completado" -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_SP "Please click or \nto replace filament!" - #define FILAMENT_CHANGE_TEXT_SP "Please click or ,\nAfter pinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor, por favor espere..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y luego presione\"Confirmar\"para comenzar la carga." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.Presione\"Confirmar\"para retirar el filamento." - #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,por favor espere." - #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,por favor espere." - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,presione\"Confirmar\"." - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,presione\"Confirmar\"." -#else - #define FILAMENT_CHANGE_TEXT_SP "Please click \nor ,After \npinter pause." - #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." - #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." - #define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el \nfilamento y luego presione\"Confirmar\"\npara comenzar la carga." - #define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y \nluego presione\"Confirmar\"para \ncomenzar la carga." - #define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.\nPresione\"Confirmar\"para retirar \nel filamento." - #define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,\npor favor espere." - #define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,\npor favor espere." - #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,\npresione\"Confirmar\"." - #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,\npresione\"Confirmar\"." -#endif + +#define FILAMENT_CHANGE_TEXT_SP "Please click \nor ,After \npinter pause." +#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." +#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_SP "Calentando el extrusor,\npor favor espere..." +#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_SP "Temperatura alcanzada.Inserte el \nfilamento y luego presione\"Confirmar\"\npara comenzar la carga." +#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_SP "Inserte el filamento y \nluego presione\"Confirmar\"para \ncomenzar la carga." +#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_SP "Temperatura alcanzada.\nPresione\"Confirmar\"para retirar \nel filamento." +#define FILAMENT_DIALOG_LOADING_TIPS_SP "Cargando filamento,\npor favor espere." +#define FILAMENT_DIALOG_UNLOADING_TIPS_SP "Retirando filamento,\npor favor espere." +#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_SP "Filamento cargado,\npresione\"Confirmar\"." +#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_SP "Filamento retirado,\npresione\"Confirmar\"." #define PRE_HEAT_EXT_TEXT_SP "Extrusor" #define PRE_HEAT_BED_TEXT_SP "cama" #define FILE_LOADING_SP "Cargando......" -#if 0 - #define NO_FILE_AND_CHECK_SP "No se encontraron archivos! Por favor, inserte la tarjeta SD o el disco U!" -#endif #define NO_FILE_AND_CHECK_SP "Archivo no encontrado,\n por favor insertar SD o disco USB!" - #define NO_FILE_SP "Sin archivo!" - - #define EXTRUDER_TEMP_TEXT_SP "Temper" #define EXTRUDER_E_LENGTH1_TEXT_SP "Extrusor1" #define EXTRUDER_E_LENGTH2_TEXT_SP "Extrusor2" @@ -245,7 +225,6 @@ #define DIALOG_RETRY_SP "Reintentar" #define DIALOG_STOP_SP "Stop" #define DIALOG_REPRINT_FROM_BREAKPOINT_SP "Reprint from breakpoint?" -//#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?" #define DIALOG_ERROR_TIPS1_SP "Error:archivo no encontrado, \npor favor insertar SD o disco USB." #define DIALOG_ERROR_TIPS2_SP "error:transacción fallida, \nconfigurar baudrate del \ndisplay para la placa base!" #define DIALOG_ERROR_TIPS3_SP "Error : nombre de archivo o \nruta demasiado largo!" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h index d956e14aa..3288d5b8f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h @@ -254,7 +254,7 @@ #define TOOL_TEXT_T_CN "工具" #define PREHEAT_TEXT_T_CN "預熱" -#define MOVE_TEXT_T_CN "移動" +#define MOVE_TEXT_T_CN "移動" #define HOME_TEXT_T_CN "回零" #define PRINT_TEXT_T_CN "打印" #define EXTRUDE_TEXT_T_CN "擠出" @@ -364,19 +364,12 @@ #define FILAMENT_EXT1_TEXT_T_CN "噴頭2" #define FILAMENT_HEAT_TEXT_T_CN "預熱" #define FILAMENT_STOP_TEXT_T_CN "停止" -//#define FILAMENT_CHANGE_TEXT_T_CN "準備換料" #define FILAMENT_TIPS2_TEXT_T_CN "T:" #define FILAMENT_TIPS3_TEXT_T_CN "正在進料" #define FILAMENT_TIPS4_TEXT_T_CN "正在退料" #define FILAMENT_TIPS5_TEXT_T_CN "溫度太低,請先預熱" #define FILAMENT_TIPS6_TEXT_T_CN "換料完成" - -#if 0 - #define FILAMENT_REPLAYS_IDLE_TEXT_T_CN "請按<進料>或<退料>進行換料!" - #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,請按<進料>或<退料>進行換料!" -#endif - - #define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,\n請按<進料>或<退料>" +#define FILAMENT_CHANGE_TEXT_T_CN "待打印機暫停后,\n請按<進料>或<退料>" #define FILAMENT_DIALOG_LOAD_HEAT_TIPS_T_CN "準備進料,正在加熱,請稍等" #define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_T_CN "準備退料,正在加熱,請稍等" @@ -434,8 +427,8 @@ #define TITLE_PRINTING_T_CN "正在打印" #define TITLE_OPERATION_T_CN "操作" #define TITLE_ADJUST_T_CN "調整" -#define TITLE_WIRELESS_T_CN "無線網絡" -#define TITLE_FILAMENT_T_CN "換料" +#define TITLE_WIRELESS_T_CN "無線網絡" +#define TITLE_FILAMENT_T_CN "換料" #define TITLE_ABOUT_T_CN "關於" #define TITLE_FAN_T_CN "風扇" #define TITLE_LANGUAGE_T_CN "語言" @@ -459,7 +452,6 @@ #define DIALOG_RETRY_T_CN "重試" #define DIALOG_STOP_T_CN "停止" #define DIALOG_REPRINT_FROM_BREAKPOINT_T_CN "從斷點續打?" -//#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?" #define DIALOG_ERROR_TIPS1_T_CN "錯誤:找不到文件,請插入sd卡/u盤!" #define DIALOG_ERROR_TIPS2_T_CN "錯誤:通信失敗,請檢查波特率或主板硬件!" #define DIALOG_ERROR_TIPS3_T_CN "錯誤:文件名或文件路徑太長!" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 097c1aead..5350ddb37 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -77,9 +77,10 @@ lv_group_t* g; uint16_t DeviceCode = 0x9488; extern uint8_t sel_id; -extern bool flash_preview_begin, default_preview_flg, gcode_preview_over; +uint8_t bmp_public_buf[14 * 1024]; +uint8_t public_buf[513]; -uint8_t bmp_public_buf[17 * 1024]; +extern bool flash_preview_begin, default_preview_flg, gcode_preview_over; void SysTick_Callback() { lv_tick_inc(1); @@ -109,13 +110,9 @@ void SysTick_Callback() { } } -extern uint8_t bmp_public_buf[17 * 1024]; - void tft_lvgl_init() { - //uint16_t test_id=0; W25QXX.init(SPI_QUARTER_SPEED); - //test_id=W25QXX.W25QXX_ReadID(); gCfgItems_init(); ui_cfg_init(); @@ -129,7 +126,6 @@ void tft_lvgl_init() { watchdog_refresh(); // LVGL init takes time - //spi_flash_read_test(); #if ENABLED(SDSUPPORT) UpdateAssets(); watchdog_refresh(); // LVGL init takes time @@ -141,7 +137,7 @@ void tft_lvgl_init() { lv_init(); - lv_disp_buf_init(&disp_buf, bmp_public_buf, nullptr, LV_HOR_RES_MAX * 18); /*Initialize the display buffer*/ + lv_disp_buf_init(&disp_buf, bmp_public_buf, nullptr, LV_HOR_RES_MAX * 14); /*Initialize the display buffer*/ lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ lv_disp_drv_init(&disp_drv); /*Basic initialization*/ @@ -273,11 +269,6 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { tmpTime = millis(); diffTime = getTickDiff(tmpTime, touch_time1); - /*Save the state and save the pressed coordinate*/ - //data->state = TOUCH_PressValid(last_x, last_y) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; - //if (data->state == LV_INDEV_STATE_PR) ADS7843_Rd_Addata((u16 *)&last_x, (u16 *)&last_y); - //touchpad_get_xy(&last_x, &last_y); - /*Save the pressed coordinates and the state*/ if (diffTime > 20) { if (get_point(&last_x, &last_y)) { @@ -285,7 +276,6 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { data->state = LV_INDEV_STATE_PR; // Set the coordinates (if released use the last-pressed coordinates) - data->point.x = last_x; data->point.y = last_y; @@ -369,11 +359,9 @@ lv_fs_res_t spi_flash_tell_cb(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p } //sd -extern uint8_t public_buf[512]; char *cur_namefff; uint32_t sd_read_base_addr = 0, sd_read_addr_offset = 0, small_image_size = 409; lv_fs_res_t sd_open_cb (lv_fs_drv_t * drv, void * file_p, const char * path, lv_fs_mode_t mode) { - //cur_namefff = strrchr(path, '/'); char name_buf[100]; *name_buf = '/'; strcpy(name_buf + 1, path); @@ -405,7 +393,6 @@ lv_fs_res_t sd_read_cb (lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t b else if (btr == 4) { uint8_t header_pic[4] = { 0x04, 0x90, 0x81, 0x0C }; memcpy(buf, header_pic, 4); - //pic_read_addr_offset += 4; *br = 4; } return LV_FS_RES_OK; @@ -453,9 +440,6 @@ void lv_encoder_pin_init() { } #if 1 // HAS_ENCODER_ACTION - - //static const int8_t encoderDirection = 1; - //static int16_t enc_Direction; void lv_update_encoder() { static uint32_t encoder_time1; uint32_t tmpTime, diffTime = 0; @@ -487,9 +471,6 @@ void lv_encoder_pin_init() { #define encrot1 1 #define encrot2 2 - // Manage encoder rotation - //#define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: enc_Direction += encoderDirection; break; case _E2: enc_Direction -= encoderDirection; } - uint8_t enc = 0; if (buttons & EN_A) enc |= B01; if (buttons & EN_B) enc |= B10; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h index df28893f4..20fa3242e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h @@ -35,6 +35,9 @@ //#define TFT_ROTATION TFT_ROTATE_180 #define MKS_WIFI_MODULE 0 +extern uint8_t bmp_public_buf[14 * 1024]; +extern uint8_t public_buf[513]; + extern void tft_lvgl_init(); extern void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p); extern bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp index c3c0f3736..3cbbe538b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp @@ -149,10 +149,6 @@ void machine_setting_disp() { machine_menu.CalibrationRadius = CALIBRATION_RADIUS_CN; machine_menu.LevelingSubXYZConfTitle = XYZ_LEVEL_CONF_TITLE_CN; - // machine_menu.ProbeMaxLeft=PROBE_REACH_MAX_LEFT_CN; - // machine_menu.ProbeMaxRigh=PROBE_REACH_MAX_RIGHT_CN; - // machine_menu.ProbeMaxfront=PROBE_REACH_MAX_FRONT_CN; - // machine_menu.ProbeMaxback=PROBE_REACH_MAX_BACK_CN; machine_menu.TemperatureConfTitle = TEMPERATURE_CONF_TITLE_CN; machine_menu.NozzleConf = NOZZLE_CONF_CN; @@ -167,7 +163,6 @@ void machine_setting_disp() { machine_menu.NozzleMaxTemperature = NOZZLE_MAX_TEMPERATURE_CN; machine_menu.Extrude_Min_Temper = EXTRUD_MIN_TEMPER_CN; - // machine_menu.HotbedEnable=HOTBED_ENABLE_CN; machine_menu.HotbedConfTitle = HOTBED_CONF_TITLE_CN; machine_menu.HotbedAjustType = HOTBED_ADJUST_CN; machine_menu.HotbedMinTemperature = HOTBED_MIN_TEMPERATURE_CN; @@ -242,7 +237,6 @@ void machine_setting_disp() { machine_menu.HomeFeedRateConfTitle = HOMEFEEDRATE_CONF_TITLE_CN; machine_menu.XY_HomeFeedRate = X_HOMESPEED_CN; - // machine_menu.Y_HomeFeedRate=Y_HOMESPEED_CN; machine_menu.Z_HomeFeedRate = Z_HOMESPEED_CN; machine_menu.AdvancedConfTitle = ADVANCED_CONF_TITLE_CN; @@ -382,10 +376,6 @@ void machine_setting_disp() { machine_menu.CalibrationRadius = CALIBRATION_RADIUS_T_CN; machine_menu.LevelingSubXYZConfTitle = XYZ_LEVEL_CONF_TITLE_T_CN; - // machine_menu.ProbeMaxLeft=PROBE_REACH_MAX_LEFT_T_CN; - // machine_menu.ProbeMaxRigh=PROBE_REACH_MAX_RIGHT_T_CN; - // machine_menu.ProbeMaxfront=PROBE_REACH_MAX_FRONT_T_CN; - // machine_menu.ProbeMaxback=PROBE_REACH_MAX_BACK_T_CN; machine_menu.TemperatureConfTitle = TEMPERATURE_CONF_TITLE_T_CN; machine_menu.NozzleConf = NOZZLE_CONF_T_CN; @@ -400,7 +390,6 @@ void machine_setting_disp() { machine_menu.NozzleMaxTemperature = NOZZLE_MAX_TEMPERATURE_T_CN; machine_menu.Extrude_Min_Temper = EXTRUD_MIN_TEMPER_T_CN; - // machine_menu.HotbedEnable=HOTBED_ENABLE_T_CN; machine_menu.HotbedConfTitle = HOTBED_CONF_TITLE_T_CN; machine_menu.HotbedAjustType = HOTBED_ADJUST_T_CN; machine_menu.HotbedMinTemperature = HOTBED_MIN_TEMPERATURE_T_CN; @@ -475,7 +464,6 @@ void machine_setting_disp() { machine_menu.HomeFeedRateConfTitle = HOMEFEEDRATE_CONF_TITLE_T_CN; machine_menu.XY_HomeFeedRate = X_HOMESPEED_T_CN; - // machine_menu.Y_HomeFeedRate=Y_HOMESPEED_T_CN; machine_menu.Z_HomeFeedRate = Z_HOMESPEED_T_CN; machine_menu.AdvancedConfTitle = ADVANCED_CONF_TITLE_T_CN; @@ -499,8 +487,6 @@ void machine_setting_disp() { machine_menu.key_back = KEY_BACK_T_CN; machine_menu.key_reset = KEY_REST_T_CN; machine_menu.key_confirm = KEY_CONFIRM_T_CN; - // machine_menu.high_level = MOTOR_EN_HIGH_LEVEL_T_CN; - // machine_menu.low_level = MOTOR_EN_LOW_LEVEL_T_CN; machine_menu.PausePosText = PAUSE_POSITION_T_CN; machine_menu.xPos = PAUSE_POSITION_X_T_CN; @@ -618,10 +604,6 @@ void machine_setting_disp() { machine_menu.CalibrationRadius = CALIBRATION_RADIUS_EN; machine_menu.LevelingSubXYZConfTitle = XYZ_LEVEL_CONF_TITLE_EN; - // machine_menu.Level_positon=PROBE_REACH_MAX_LEFT_EN; - // machine_menu.ProbeMaxRigh=PROBE_REACH_MAX_RIGHT_EN; - // machine_menu.ProbeMaxfront=PROBE_REACH_MAX_FRONT_EN; - // machine_menu.ProbeMaxback=PROBE_REACH_MAX_BACK_EN; machine_menu.TemperatureConfTitle = TEMPERATURE_CONF_TITLE_EN; machine_menu.NozzleConf = NOZZLE_CONF_EN; @@ -711,7 +693,6 @@ void machine_setting_disp() { machine_menu.HomeFeedRateConfTitle = HOMEFEEDRATE_CONF_TITLE_EN; machine_menu.XY_HomeFeedRate = X_HOMESPEED_EN; - // machine_menu.Y_HomeFeedRate=Y_HOMESPEED_EN; machine_menu.Z_HomeFeedRate = Z_HOMESPEED_EN; machine_menu.AdvancedConfTitle = ADVANCED_CONF_TITLE_EN; @@ -823,7 +804,6 @@ void disp_language_init() { about_menu.type_name = ABOUT_TYPE_TEXT; about_menu.firmware_v = ABOUT_VERSION_TEXT; - // about_menu.wifi = ABOUT_WIFI_TEXT; wifi_menu.ip = WIFI_IP_TEXT; wifi_menu.wifi = WIFI_NAME_TEXT; @@ -861,7 +841,7 @@ void disp_language_init() { tips_menu.joining = TEXT_WIFI_JOINING_EN; tips_menu.failedJoin = TEXT_WIFI_FAILED_JOIN_EN; tips_menu.wifiConected = TEXT_WIFI_WIFI_CONECTED_EN; - #endif //MKS_WIFI_MODULE + #endif machine_setting_disp(); operation_menu.babystep = TEXT_BABY_STEP_EN; @@ -923,7 +903,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_CN; file_menu.file_loading = FILE_LOADING_CN; file_menu.no_file = NO_FILE_CN; - file_menu.no_file_and_check = NO_FILE_CN;// NO_FILE_AND_CHECK_CN; + file_menu.no_file_and_check = NO_FILE_CN; // extrude_menu.title = TITLE_EXTRUDE_CN; extrude_menu.in = EXTRUDER_IN_TEXT_CN; @@ -961,12 +941,9 @@ void disp_language_init() { filesys_menu.sd_sys = SD_CARD_TEXT_CN; filesys_menu.usb_sys = U_DISK_TEXT_CN; // - more_menu.title = TITLE_MORE_CN; + more_menu.title = TITLE_MORE_CN; // WIFI wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_CN; - // wifi_menu.ip = WIFI_IP_TEXT_CN; - // wifi_menu.state = WIFI_STA_TEXT_CN; wifi_menu.cloud = CLOUD_TEXT_CN; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_CN; // CLOUD @@ -1055,11 +1032,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_CN; printing_more_menu.temp = PRINTING_TEMP_CN; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; print_file_dialog_menu.confirm = DIALOG_CONFIRM_CN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_CN; + print_file_dialog_menu.cancel = DIALOG_CANCLE_CN; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_CN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_CN; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_CN; print_file_dialog_menu.retry = DIALOG_RETRY_CN; print_file_dialog_menu.stop = DIALOG_STOP_CN; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_CN; @@ -1153,7 +1129,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_T_CN; file_menu.file_loading = FILE_LOADING_T_CN; file_menu.no_file = NO_FILE_T_CN; - file_menu.no_file_and_check = NO_FILE_T_CN;// NO_FILE_AND_CHECK_T_CN; + file_menu.no_file_and_check = NO_FILE_T_CN; // extrude_menu.title = TITLE_EXTRUDE_T_CN; extrude_menu.in = EXTRUDER_IN_TEXT_T_CN; @@ -1190,12 +1166,9 @@ void disp_language_init() { filesys_menu.sd_sys = SD_CARD_TEXT_T_CN; filesys_menu.usb_sys = U_DISK_TEXT_T_CN; // - more_menu.title = TITLE_MORE_T_CN; + more_menu.title = TITLE_MORE_T_CN; // WIFI wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_CN; - // wifi_menu.ip = WIFI_IP_TEXT_CN; - // wifi_menu.state= WIFI_STA_TEXT_CN; wifi_menu.cloud = CLOUD_TEXT_T_CN; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_T_CN; // CLOUD @@ -1233,7 +1206,6 @@ void disp_language_init() { filament_menu.filament_dialog_unloading = FILAMENT_DIALOG_UNLOADING_TIPS_T_CN; filament_menu.filament_dialog_unload_completed = FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_T_CN; - // language_menu.title = TITLE_LANGUAGE_T_CN; language_menu.next = PAGE_DOWN_TEXT_T_CN; @@ -1284,11 +1256,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_T_CN; printing_more_menu.temp = PRINTING_TEMP_T_CN; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_CN; print_file_dialog_menu.confirm = DIALOG_CONFIRM_T_CN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_T_CN; + print_file_dialog_menu.cancel = DIALOG_CANCLE_T_CN; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_T_CN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_T_CN; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_T_CN; print_file_dialog_menu.retry = DIALOG_RETRY_T_CN; print_file_dialog_menu.stop = DIALOG_STOP_T_CN; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_T_CN; @@ -1373,7 +1344,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_EN; file_menu.file_loading = FILE_LOADING_EN; file_menu.no_file = NO_FILE_EN; - file_menu.no_file_and_check = NO_FILE_EN;// NO_FILE_AND_CHECK_EN; + file_menu.no_file_and_check = NO_FILE_EN; // extrude_menu.title = TITLE_EXTRUDE_EN; extrude_menu.in = EXTRUDER_IN_TEXT_EN; @@ -1412,9 +1383,6 @@ void disp_language_init() { filesys_menu.usb_sys = U_DISK_TEXT_EN; // WIFI wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_EN; - // wifi_menu.ip = WIFI_IP_TEXT_EN; - // wifi_menu.state = WIFI_STA_TEXT_EN; wifi_menu.cloud = CLOUD_TEXT_EN; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; @@ -1500,11 +1468,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_EN; printing_more_menu.temp = PRINTING_TEMP_EN; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.cancel = DIALOG_CANCLE_EN; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_EN; print_file_dialog_menu.retry = DIALOG_RETRY_EN; print_file_dialog_menu.stop = DIALOG_STOP_EN; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; @@ -1588,7 +1555,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_RU; file_menu.file_loading = FILE_LOADING_RU; file_menu.no_file = NO_FILE_RU; - file_menu.no_file_and_check = NO_FILE_RU;// NO_FILE_AND_CHECK_RU; + file_menu.no_file_and_check = NO_FILE_RU; // extrude_menu.title = TITLE_EXTRUDE_RU; extrude_menu.in = EXTRUDER_IN_TEXT_RU; @@ -1627,13 +1594,9 @@ void disp_language_init() { filesys_menu.usb_sys = U_DISK_TEXT_RU; // WIFI wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_RU; - // wifi_menu.ip = WIFI_IP_TEXT_RU; - // wifi_menu.state = WIFI_STA_TEXT_RU; wifi_menu.cloud = CLOUD_TEXT_RU; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_RU; - cloud_menu.title = TITLE_CLOUD_TEXT_RU; cloud_menu.bind = CLOUD_BINDED_RU; cloud_menu.binded = CLOUD_BINDED_RU; @@ -1715,11 +1678,10 @@ void disp_language_init() { printing_more_menu.manual = MANUAL_SHUTDOWN_RU; printing_more_menu.speed = PRINTING_CHANGESPEED_RU; printing_more_menu.temp = PRINTING_TEMP_RU; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_RU; print_file_dialog_menu.confirm = DIALOG_CONFIRM_RU; - print_file_dialog_menu.cancle = DIALOG_CANCLE_RU; + print_file_dialog_menu.cancel = DIALOG_CANCLE_RU; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_RU; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_RU; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_RU; print_file_dialog_menu.retry = DIALOG_RETRY_RU; print_file_dialog_menu.stop = DIALOG_STOP_RU; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_RU; @@ -1807,7 +1769,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_SP; file_menu.file_loading = FILE_LOADING_SP; file_menu.no_file = NO_FILE_SP; - file_menu.no_file_and_check = NO_FILE_SP;// NO_FILE_AND_CHECK_SP; + file_menu.no_file_and_check = NO_FILE_SP; // extrude_menu.title = TITLE_EXTRUDE_SP; extrude_menu.in = EXTRUDER_IN_TEXT_SP; @@ -1847,9 +1809,6 @@ void disp_language_init() { // WIFI wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_SP; - // wifi_menu.ip = WIFI_IP_TEXT_SP; - // wifi_menu.state = WIFI_STA_TEXT_SP; wifi_menu.cloud = CLOUD_TEXT_SP; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_SP; @@ -1935,11 +1894,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_SP; printing_more_menu.temp = PRINTING_TEMP_SP; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; print_file_dialog_menu.confirm = DIALOG_CONFIRM_SP; - print_file_dialog_menu.cancle = DIALOG_CANCLE_SP; + print_file_dialog_menu.cancel = DIALOG_CANCLE_SP; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_SP; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_SP; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_SP; print_file_dialog_menu.retry = DIALOG_RETRY_SP; print_file_dialog_menu.stop = DIALOG_STOP_SP; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_SP; @@ -2063,13 +2021,9 @@ void disp_language_init() { filesys_menu.usb_sys = U_DISK_TEXT_FR; file_menu.file_loading = FILE_LOADING_FR; file_menu.no_file = NO_FILE_FR; - file_menu.no_file_and_check = NO_FILE_FR;// NO_FILE_AND_CHECK_FR; + file_menu.no_file_and_check = NO_FILE_FR; // WIFI wifi_menu.title = WIFI_NAME_TEXT_FR; - // wifi_menu.key = WIFI_KEY_TEXT_FR; - // wifi_menu.ip = WIFI_IP_TEXT_FR; - // wifi_menu.state = WIFI_STA_TEXT_FR; - // wifi_menu.cloud = CLOSE_TEXT_FR; wifi_menu.cloud = CLOUD_TEXT_FR; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_FR; @@ -2153,11 +2107,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_FR; printing_more_menu.temp = PRINTING_TEMP_FR; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; print_file_dialog_menu.confirm = DIALOG_CONFIRM_FR; - print_file_dialog_menu.cancle = DIALOG_CANCLE_FR; + print_file_dialog_menu.cancel = DIALOG_CANCLE_FR; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_FR; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_FR; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_FR; print_file_dialog_menu.retry = DIALOG_RETRY_FR; print_file_dialog_menu.stop = DIALOG_STOP_FR; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_FR; @@ -2243,7 +2196,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_IT; file_menu.file_loading = FILE_LOADING_IT; file_menu.no_file = NO_FILE_IT; - file_menu.no_file_and_check = NO_FILE_IT;// NO_FILE_AND_CHECK_IT; + file_menu.no_file_and_check = NO_FILE_IT; // extrude_menu.title = TITLE_EXTRUDE_IT; extrude_menu.in = EXTRUDER_IN_TEXT_IT; @@ -2283,9 +2236,6 @@ void disp_language_init() { // WIFI wifi_menu.title = WIFI_NAME_TEXT_IT; - // wifi_menu.key = WIFI_KEY_TEXT_IT; - // wifi_menu.ip = WIFI_IP_TEXT_IT; - // wifi_menu.state = WIFI_STA_TEXT_IT; wifi_menu.cloud = CLOSE_TEXT_IT; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_IT; @@ -2369,11 +2319,10 @@ void disp_language_init() { printing_more_menu.temp = PRINTING_TEMP_IT; printing_more_menu.speed = PRINTING_CHANGESPEED_IT; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_SP; print_file_dialog_menu.confirm = DIALOG_CONFIRM_IT; - print_file_dialog_menu.cancle = DIALOG_CANCLE_IT; + print_file_dialog_menu.cancel = DIALOG_CANCLE_IT; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_IT; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_IT; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_IT; print_file_dialog_menu.retry = DIALOG_RETRY_IT; print_file_dialog_menu.stop = DIALOG_STOP_IT; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_IT; @@ -2460,7 +2409,7 @@ void disp_language_init() { file_menu.page_down = PAGE_DOWN_TEXT_EN; file_menu.file_loading = FILE_LOADING_EN; file_menu.no_file = NO_FILE_EN; - file_menu.no_file_and_check = NO_FILE_EN;// NO_FILE_AND_CHECK_EN; + file_menu.no_file_and_check = NO_FILE_EN; // extrude_menu.title = TITLE_EXTRUDE_EN; extrude_menu.in = EXTRUDER_IN_TEXT_EN; @@ -2493,16 +2442,13 @@ void disp_language_init() { set_menu.machine_para = MACHINE_PARA_EN; set_menu.eepromSet = EEPROM_SETTINGS_EN; // - more_menu.title = TITLE_MORE_EN; + more_menu.title = TITLE_MORE_EN; // filesys_menu.title = TITLE_FILESYS_EN; filesys_menu.sd_sys = SD_CARD_TEXT_EN; filesys_menu.usb_sys = U_DISK_TEXT_EN; // WIFI wifi_menu.title = WIFI_TEXT; - // wifi_menu.key = WIFI_KEY_TEXT_EN; - // wifi_menu.ip = WIFI_IP_TEXT_EN; - // wifi_menu.state = WIFI_STA_TEXT_EN; wifi_menu.cloud = CLOUD_TEXT_EN; wifi_menu.reconnect = WIFI_RECONNECT_TEXT_EN; @@ -2588,11 +2534,10 @@ void disp_language_init() { printing_more_menu.speed = PRINTING_CHANGESPEED_EN; printing_more_menu.temp = PRINTING_TEMP_EN; - // print_file_dialog_menu.title = TITLE_DIALOG_CONFIRM_EN; print_file_dialog_menu.confirm = DIALOG_CONFIRM_EN; - print_file_dialog_menu.cancle = DIALOG_CANCLE_EN; + print_file_dialog_menu.cancel = DIALOG_CANCLE_EN; print_file_dialog_menu.print_file = DIALOG_PRINT_MODEL_EN; - print_file_dialog_menu.cancle_print = DIALOG_CANCEL_PRINT_EN; + print_file_dialog_menu.cancel_print = DIALOG_CANCEL_PRINT_EN; print_file_dialog_menu.retry = DIALOG_RETRY_EN; print_file_dialog_menu.stop = DIALOG_STOP_EN; print_file_dialog_menu.no_file_print_tips = DIALOG_ERROR_TIPS1_EN; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h index 675fd41f1..519388992 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h @@ -131,10 +131,6 @@ typedef struct machine_common_disp{ const char *CalibrationRadius; const char *LevelingSubXYZConfTitle; - //const char *Level_positon1; - //const char *Level_positon2; - //const char *Level_positon3; - //const char *Level_positon4; const char *TemperatureConfTitle; const char *NozzleConf; @@ -667,9 +663,9 @@ extern dialog_menu_def dialog_menu; typedef struct print_file_dialog_disp { const char *title; const char *confirm; - const char *cancle; + const char *cancel; const char *print_file; - const char *cancle_print; + const char *cancel_print; const char *retry; const char *stop; const char *no_file_print_tips; @@ -740,12 +736,8 @@ typedef struct eeprom_disp{ extern eeprom_def eeprom_menu; /*****************************************/ -//********************************************// -//#if defined(TFT70) // -//#elif defined(TFT35) #define TEXT_VALUE "%d/%d" -//#endif #define TEXT_VALUE_T ": %d℃" #define TEXT_VALUE_mm ": %dmm" @@ -796,19 +788,14 @@ extern eeprom_def eeprom_menu; #define HOME_Y_TEXT "Y" #define HOME_Z_TEXT "Z" #define HOME_ALL_TEXT "All" -//#if defined(MKS_ROBIN_NANO) + #define ABOUT_TYPE_TEXT "MKS Robin Pro" -//#elif defined(MKS_ROBIN_MINI) -//#define ABOUT_TYPE_TEXT "MKS Robin Mini" -//#endif + #define ABOUT_VERSION_TEXT "1.0.0" -//#define ABOUT_WIFI_TEXT "WiFi:" #define FAN_OPEN_TEXT "100%" #define FAN_HALF_TEXT "50%" #define FAN_CLOSE_TEXT "0%" -//#define FAN_TIPS1_TEXT "FAN" -//#define FAN_TIPS2_TEXT "FAN\nClose" #define WIFI_TEXT "WIFI" #define WIFI_IP_TEXT "IP: " @@ -830,7 +817,7 @@ extern eeprom_def eeprom_menu; #define DIALOG_UPLOAD_SPEED_EN "Speed" #define DIALOG_UPDATE_WIFI_FIRMWARE_EN "Updating wifi model firmware" #define DIALOG_UPDATE_WIFI_WEB_EN "Updating wifi model web data" -#define DIALOG_UPDATE_NO_DEVICE_EN "please check \nwether memory device insert!" +#define DIALOG_UPDATE_NO_DEVICE_EN "Please check whether\nmemory device inserted!" #define ZOFFSET_STEP001 "0.01mm" #define ZOFFSET_STEP01 "0.1mm" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h index 3206666be..e2b560e6f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h @@ -26,7 +26,7 @@ #if ENABLED(MKS_WIFI_MODULE) #ifdef SERIAL_PORT_2 - #error "SERIAL_PORT_2 must be disabled with HAS_TFT_LVGL_UI and MKS_WIFI_MODULE." + #error "SERIAL_PORT_2 must be disabled with TFT_LVGL_UI* and MKS_WIFI_MODULE." #endif #define WIFI_BAUDRATE 115200 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp index f38145aa8..a8537dd3d 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp @@ -110,8 +110,6 @@ extern CLOUD_PARA cloud_para; extern bool once_flag, flash_preview_begin, default_preview_flg, gcode_preview_over; -extern uint8_t bmp_public_buf[17 * 1024]; - uint32_t getWifiTick() { return millis(); } @@ -126,8 +124,10 @@ uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick) { void wifi_delay(int n) { uint32_t begin = getWifiTick(); uint32_t end = begin; - while (getWifiTickDiff(begin, end) < (uint32_t)n) + while (getWifiTickDiff(begin, end) < (uint32_t)n) { + watchdog_refresh(); end = getWifiTick(); + } } void wifi_reset() { @@ -304,7 +304,7 @@ void esp_port_begin(uint8_t interrupt) { #if ENABLED(MKS_WIFI_MODULE) - int raw_send_to_wifi(char *buf, int len) { + int raw_send_to_wifi(uint8_t *buf, int len) { if (buf == 0 || len <= 0) return 0; for (int i = 0; i < len; i++) WIFISERIAL.write(*(buf + i)); @@ -315,11 +315,11 @@ void esp_port_begin(uint8_t interrupt) { void wifi_ret_ack() {} -char buf_to_wifi[256]; +uint8_t buf_to_wifi[256]; int index_to_wifi = 0; -int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { - char wifi_ret_head = 0xA5; - char wifi_ret_tail = 0xFC; +int package_to_wifi(WIFI_RET_TYPE type, uint8_t *buf, int len) { + uint8_t wifi_ret_head = 0xA5; + uint8_t wifi_ret_tail = 0xFC; if (type == WIFI_PARA_SET) { int data_offset = 4; @@ -331,9 +331,9 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { buf_to_wifi[data_offset] = gCfgItems.wifi_mode_sel; buf_to_wifi[data_offset + 1] = apLen; - strncpy(&buf_to_wifi[data_offset + 2], (const char *)uiCfg.wifi_name, apLen); + memcpy(&buf_to_wifi[data_offset + 2], (const char *)uiCfg.wifi_name, apLen); buf_to_wifi[data_offset + apLen + 2] = keyLen; - strncpy(&buf_to_wifi[data_offset + apLen + 3], (const char *)uiCfg.wifi_key, keyLen); + memcpy(&buf_to_wifi[data_offset + apLen + 3], (const char *)uiCfg.wifi_key, keyLen); buf_to_wifi[data_offset + apLen + keyLen + 3] = wifi_ret_tail; index_to_wifi = apLen + keyLen + 3; @@ -410,7 +410,7 @@ int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len) { buf_to_wifi[data_offset] = gCfgItems.cloud_enable ? 0x0A : 0x05; buf_to_wifi[data_offset + 1] = urlLen; - strncpy(&buf_to_wifi[data_offset + 2], (const char *)uiCfg.cloud_hostUrl, urlLen); + memcpy(&buf_to_wifi[data_offset + 2], (const char *)uiCfg.cloud_hostUrl, urlLen); buf_to_wifi[data_offset + urlLen + 2] = uiCfg.cloud_port & 0xFF; buf_to_wifi[data_offset + urlLen + 3] = (uiCfg.cloud_port >> 8) & 0xFF; buf_to_wifi[data_offset + urlLen + 4] = wifi_ret_tail; @@ -555,7 +555,7 @@ uint8_t Explore_Disk(char* path , uint8_t recu_level) { strcat(Fstream, ".DIR"); strcat(Fstream, "\r\n"); - send_to_wifi(Fstream, strlen(Fstream)); + send_to_wifi((uint8_t*)Fstream, strlen(Fstream)); } return fileCnt; @@ -589,7 +589,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { if (tmpStr == 0) { gCfgItems.fileSysType = FILE_SYS_SD; - send_to_wifi((char *)"Begin file list\r\n", strlen("Begin file list\r\n")); + send_to_wifi((uint8_t *)"Begin file list\r\n", strlen("Begin file list\r\n")); get_file_list((char *)"0:/"); send_to_wifi((char *)"End file list\r\n", strlen("End file list\r\n")); send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); @@ -602,7 +602,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { char *path = (char *)tempBuf; if (strlen((char *)&tmpStr[index]) < 80) { - send_to_wifi((char *)"Begin file list\r\n", strlen("Begin file list\r\n")); + send_to_wifi((uint8_t *)"Begin file list\r\n", strlen("Begin file list\r\n")); if (strncmp((char *)&tmpStr[index], "1:", 2) == 0) gCfgItems.fileSysType = FILE_SYS_SD; @@ -611,7 +611,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { strcpy((char *)path, (char *)&tmpStr[index]); get_file_list(path); - send_to_wifi((char *)"End file list\r\n", strlen("End file list\r\n")); + send_to_wifi((uint8_t *)"End file list\r\n", strlen("End file list\r\n")); } send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); } @@ -651,9 +651,9 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { card.openFileRead(cur_name); if (card.isFileOpen()) - send_to_wifi((char *)"File selected\r\n", strlen("File selected\r\n")); + send_to_wifi((uint8_t *)"File selected\r\n", strlen("File selected\r\n")); else { - send_to_wifi((char *)"file.open failed\r\n", strlen("file.open failed\r\n")); + send_to_wifi((uint8_t *)"file.open failed\r\n", strlen("file.open failed\r\n")); strcpy(list_file.file_name[sel_id], "notValid"); } send_to_wifi((char *)"ok\r\n", strlen("ok\r\n")); @@ -772,7 +772,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { print_rate = uiCfg.totalSend; ZERO(tempBuf); sprintf((char *)tempBuf, "M27 %d\r\n", print_rate); - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); + send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf)); } break; @@ -857,7 +857,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { ); } - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); + send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf)); queue.enqueue_one_P(PSTR("M105")); break; @@ -866,7 +866,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { ZERO(tempBuf); sprintf((char *)tempBuf, "M992 %d%d:%d%d:%d%d\r\n", print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10); wifi_ret_ack(); - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); + send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf)); } break; @@ -876,18 +876,18 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { if (strlen((char *)list_file.file_name[sel_id]) > (100 - 1)) return; sprintf((char *)tempBuf, "M994 %s;%d\n", list_file.file_name[sel_id],(int)gCfgItems.curFilesize); wifi_ret_ack(); - send_to_wifi((char *)tempBuf, strlen((char *)tempBuf)); + send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf)); } break; case 997: if (uiCfg.print_state == IDLE) { wifi_ret_ack(); - send_to_wifi((char *)"M997 IDLE\r\n", strlen("M997 IDLE\r\n")); + send_to_wifi((uint8_t *)"M997 IDLE\r\n", strlen("M997 IDLE\r\n")); } else if (uiCfg.print_state == WORKING) { wifi_ret_ack(); - send_to_wifi((char *)"M997 PRINTING\r\n", strlen("M997 PRINTING\r\n")); + send_to_wifi((uint8_t *)"M997 PRINTING\r\n", strlen("M997 PRINTING\r\n")); } else if (uiCfg.print_state == PAUSED) { wifi_ret_ack(); @@ -895,7 +895,7 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { } else if (uiCfg.print_state == REPRINTING) { wifi_ret_ack(); - send_to_wifi((char *)"M997 PAUSE\r\n", strlen("M997 PAUSE\r\n")); + send_to_wifi((uint8_t *)"M997 PAUSE\r\n", strlen("M997 PAUSE\r\n")); } if (uiCfg.command_send == 0) get_wifi_list_command_send(); break; @@ -977,8 +977,8 @@ static int32_t charAtArray(const uint8_t *_array, uint32_t _arrayLen, uint8_t _c } void get_wifi_list_command_send() { - char buf[] = { 0xA5, 0x07, 0x00, 0x00, 0xFC }; - raw_send_to_wifi(buf, 5); + uint8_t cmd_wifi_list[] = { 0xA5, 0x07, 0x00, 0x00, 0xFC }; + raw_send_to_wifi(cmd_wifi_list, COUNT(cmd_wifi_list)); } static void net_msg_handle(uint8_t * msg, uint16_t msgLen) { @@ -1043,7 +1043,7 @@ static void net_msg_handle(uint8_t * msg, uint16_t msgLen) { if ((wifiPara.mode != gCfgItems.wifi_mode_sel) || (strncmp(wifiPara.ap_name, (const char *)uiCfg.wifi_name, 32) != 0) || (strncmp(wifiPara.keyCode, (const char *)uiCfg.wifi_key, 64) != 0)) { - package_to_wifi(WIFI_PARA_SET, (char *)0, 0); + package_to_wifi(WIFI_PARA_SET, (uint8_t *)0, 0); } else uiCfg.configWifi = 0; } @@ -1051,7 +1051,7 @@ static void net_msg_handle(uint8_t * msg, uint16_t msgLen) { if (((cloud_para.state >> 4) != (char)gCfgItems.cloud_enable) || (strncmp(cloud_para.hostUrl, (const char *)uiCfg.cloud_hostUrl, 96) != 0) || (cloud_para.port != uiCfg.cloud_port)) { - package_to_wifi(WIFI_CLOUD_CFG, (char *)0, 0); + package_to_wifi(WIFI_CLOUD_CFG, (uint8_t *)0, 0); } else cfg_cloud_flag = 0; } @@ -1091,17 +1091,13 @@ static void wifi_list_msg_handle(uint8_t * msg, uint16_t msgLen) { } } if (wifi_name_is_same != 1) { - //for (j=0;j 0x80) { wifi_name_is_same = 1; - //break; } - //} } if (wifi_name_is_same == 1) { wifi_name_is_same = 0; wifiMsgIdex += wifiNameLen; - //wifi_list.RSSI[i] = msg[wifiMsgIdex]; wifiMsgIdex += 1; wifi_name_num--; //i--; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h index 656e440bc..30da25bbe 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h @@ -170,10 +170,10 @@ typedef struct { #define WIFI_GCODE_BUFFER_LEAST_SIZE 96 #define WIFI_GCODE_BUFFER_SIZE (WIFI_GCODE_BUFFER_LEAST_SIZE * 3) typedef struct { - uint8_t wait_tick; - uint8_t Buffer[WIFI_GCODE_BUFFER_SIZE]; - uint32_t r; - uint32_t w; + uint8_t wait_tick; + uint8_t Buffer[WIFI_GCODE_BUFFER_SIZE]; + uint32_t r; + uint32_t w; } WIFI_GCODE_BUFFER; extern volatile WIFI_STATE wifi_link_state; @@ -184,14 +184,14 @@ extern CLOUD_PARA cloud_para; extern WIFI_GCODE_BUFFER espGcodeFifo; extern uint32_t getWifiTick(); -extern uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick); +extern uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick); extern void mks_esp_wifi_init(); extern int cfg_cloud_flag; -extern int send_to_wifi(char *buf, int len); +extern int send_to_wifi(uint8_t *buf, int len); extern void wifi_looping(); -extern int raw_send_to_wifi(char *buf, int len); -extern int package_to_wifi(WIFI_RET_TYPE type,char *buf, int len); +extern int raw_send_to_wifi(uint8_t *buf, int len); +extern int package_to_wifi(WIFI_RET_TYPE type, uint8_t *buf, int len); extern void get_wifi_list_command_send(); extern void get_wifi_commands(); extern int readWifiBuf(int8_t *buf, int32_t len); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp index 1de557127..8b3c4edfc 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.cpp @@ -75,7 +75,6 @@ const uint32_t ESP_UNKNOWN_ADDR = 0x40001121; // not used const uint32_t ESP_USER_DATA_RAM_ADDR = 0x3FFE8000; // &user data ram const uint32_t ESP_IRAM_ADDR = 0x40100000; // instruction RAM const uint32_t ESP_FLASH_ADDR = 0x40200000; // address of start of Flash -//const uint32_t ESP_FLASH_READ_STUB_BEGIN = IRAM_ADDR + 0x18; UPLOAD_STRUCT esp_upload; @@ -316,15 +315,11 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t } state = header; needBytes = 2; - break; case end: // expecting frame end c = uploadPort_read(); - if (c != (uint8_t)0xC0) { - return slipFrame; - } + if (c != (uint8_t)0xC0) return slipFrame; state = done; - break; case header: // reading an 8-byte header @@ -373,8 +368,7 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t } break; - default: // this shouldn't happen - return slipState; + default: return slipState; // this shouldn't happen } } @@ -383,7 +377,6 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t opRet = (uint8_t)getData(1, hdr, 1); // Sync packets often provoke a response with a zero opcode instead of ESP_SYNC if (resp != 0x01 || opRet != op) { - //printf("resp %02x %02x\n", resp, opRet); //debug return respHeader; } @@ -405,7 +398,6 @@ void _writePacket(const uint8_t *data, size_t len) { } else { outBuf[outIndex++] = *data; - } data++; --len; @@ -444,7 +436,6 @@ void sendCommand(uint8_t op, uint32_t checkVal, const uint8_t *data, size_t data putData(checkVal, 4, hdr, 4); // send the packet - //flushInput(); if (op == ESP_SYNC) writePacketRaw(hdr, sizeof(hdr), data, dataLen); else @@ -492,9 +483,7 @@ EspUploadResult Sync(uint16_t timeout) { for (;;) { size_t bodyLen; EspUploadResult rc = readPacket(ESP_SYNC, 0, &bodyLen, defaultTimeout); - if (rc != success || bodyLen != 2) { - break; - } + if (rc != success || bodyLen != 2) break; } } //DEBUG @@ -580,14 +569,9 @@ EspUploadResult flashWriteBlock(uint16_t flashParmVal, uint16_t flashParmMask) { // Calculate the block checksum cksum = checksum(blkBuf + dataOfst, blkSize, ESP_CHECKSUM_MAGIC); - for (i = 0; i < 3; i++) { - if ((stat = doCommand(ESP_FLASH_DATA, blkBuf, blkBufSize, cksum, 0, blockWriteTimeout)) == success) { + for (i = 0; i < 3; i++) + if ((stat = doCommand(ESP_FLASH_DATA, blkBuf, blkBufSize, cksum, 0, blockWriteTimeout)) == success) break; - } - } - - //printf("Upload %d\%\n", ftell(&esp_upload.uploadFile) * 100 / esp_upload.fileSize); - return stat; #else return success; @@ -720,8 +704,7 @@ void upload_spin() { esp_upload.state = upload_idle;//idle; break; - default: - break; + default: break; } #endif } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.h b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.h index d942a2c84..246cc10be 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_upload.h @@ -52,7 +52,6 @@ typedef enum { } EspUploadResult; typedef struct { - //FIL uploadFile; uint32_t fileSize; uint32_t uploadAddress;