MKS UI prelim. cleanup (#20763)

This commit is contained in:
Scott Lahteine 2021-01-12 21:02:35 -06:00 committed by GitHub
parent 4a89731025
commit 44c57ab05a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
78 changed files with 296 additions and 937 deletions

View File

@ -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);

View File

@ -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);

View File

@ -25,16 +25,12 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../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);

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../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];

View File

@ -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

View File

@ -31,11 +31,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../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)) {

View File

@ -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

View File

@ -27,10 +27,6 @@
#include <lv_conf.h>
#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);

View File

@ -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

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../module/temperature.h"
#include "../../../../gcode/queue.h"

View File

@ -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

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../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) {

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -27,10 +27,6 @@
#include "draw_set.h"
#include "draw_ui.h"
#include <lv_conf.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 "../../../../gcode/queue.h"
#include "../../../../inc/MarlinConfig.h"

View File

@ -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

View File

@ -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,13 +102,11 @@ 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;
}
@ -118,8 +114,6 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
}
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);
}

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../inc/MarlinConfig.h"
#include <string.h>

View File

@ -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

View File

@ -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

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../gcode/queue.h"
#include "../../../../inc/MarlinConfig.h"

View File

@ -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

View File

@ -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) {

View File

@ -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) {

View File

@ -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

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../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

View File

@ -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

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../gcode/gcode.h"
#include "../../../../gcode/queue.h"

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../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);

View File

@ -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

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../feature/pause.h"
#include "../../../../inc/MarlinConfig.h"

View File

@ -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

View File

@ -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) {

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../module/temperature.h"
#include "../../../../inc/MarlinConfig.h"

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../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;

View File

@ -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

View File

@ -26,10 +26,6 @@
#include "draw_ready_print.h"
#include "draw_tool.h"
#include <lv_conf.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 "tft_lvgl_configuration.h"
#include "mks_hardware_test.h"
#include "draw_ui.h"
@ -46,7 +42,6 @@
#include <stdio.h>
//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);

View File

@ -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

View File

@ -27,10 +27,6 @@
#include "draw_set.h"
#include "draw_ui.h"
#include <lv_conf.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 "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;

View File

@ -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

View File

@ -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) {

View File

@ -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) {

View File

@ -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 void event_handler(lv_obj_t *obj, lv_event_t event) {
if (event != LV_EVENT_RELEASED) return;

View File

@ -25,10 +25,6 @@
#include "draw_ui.h"
#include <lv_conf.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 "../../../../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;
}

View File

@ -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

View File

@ -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

View File

@ -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
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

View File

@ -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)

View File

@ -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);
}

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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) {

View File

@ -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

View File

@ -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();
}

View File

@ -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 <Load> or <unload> \nto replace filament!"
#define FILAMENT_CHANGE_TEXT_EN "Please click <Load> or <unload>,\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 <confirm> for start loading."
#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_EN "Please load filament to extruder,and click <confirm> for start loading."
#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_EN "Heat completed,please click <confirm> 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 <confirm> for return!"
#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_EN "Unload filament completed,click <confirm> for return!"
#endif
#define FILAMENT_CHANGE_TEXT_EN "Please click <Load> \nor <unload>,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_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!"
@ -701,24 +680,6 @@
#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."

View File

@ -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 <Insérer> or <éjecter> \nto replace filament!"
#define FILAMENT_CHANGE_TEXT_FR "Please click <Insérer> 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 <Confirmer> for start loading."
#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR "Please load filament to extruder,and click <Confirmer> for start loading."
#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR "Heat completed,please click <Confirmer> 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 <Confirmer> for return!"
#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Unload filament completed,click <Confirmer> for return!"
#endif
#define FILAMENT_CHANGE_TEXT_FR "Please click <Load> \nor <unload>,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_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."
@ -264,7 +242,7 @@
#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..."

View File

@ -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 <Estru> or <Ritra> \nto replace filament!"
#define FILAMENT_CHANGE_TEXT_IT "Please click <Estru> or <Ritra>,\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 <Conferma> for start loading."
#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_IT "Please load filament to extruder,and click <Conferma> for start loading."
#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_IT "Heat completed,please click <Conferma> 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 <Conferma> for return!"
#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,click <Conferma> for return!"
#endif
#define FILAMENT_CHANGE_TEXT_IT "Please click <Load> \nor <unload>,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 <confirm> for return!"
#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_IT "Unload filament completed,\nclick <confirm> 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!"

View File

@ -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 <Load> \nor <unload>,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 <confirm> for return!"
#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_RU "Unload filament completed,\nclick <confirm> 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?"

View File

@ -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_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 "错误:文件名或文件路径太长 !"

View File

@ -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,25 +135,12 @@
#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 <Dentro> or <Fuera> \nto replace filament!"
#define FILAMENT_CHANGE_TEXT_SP "Please click <Dentro> or <Fuera>,\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 <Load> \nor <unload>,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..."
@ -164,21 +151,14 @@
#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 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!"

View File

@ -364,18 +364,11 @@
#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_DIALOG_LOAD_HEAT_TIPS_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 "錯誤:文件名或文件路徑太長!"

View File

@ -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;

View File

@ -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);

View File

@ -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;
@ -964,9 +944,6 @@ void disp_language_init() {
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;
@ -1193,9 +1169,6 @@ void disp_language_init() {
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;
@ -2500,9 +2449,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;
@ -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;

View File

@ -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"

View File

@ -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

View File

@ -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,9 +124,11 @@ 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() {
uint32_t start, now;
@ -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<wifiNameLen;j++) {
if (str[0] > 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--;

View File

@ -188,10 +188,10 @@ 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);

View File

@ -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
}

View File

@ -52,7 +52,6 @@ typedef enum {
} EspUploadResult;
typedef struct {
//FIL uploadFile;
uint32_t fileSize;
uint32_t uploadAddress;