MKS WiFi preliminary changes

This commit is contained in:
Scott Lahteine 2020-11-19 15:51:53 -06:00 committed by Scott Lahteine
parent 5ef1d053eb
commit f1b32b808f
33 changed files with 132 additions and 156 deletions

View file

@ -111,7 +111,9 @@ constexpr bool serial_handles_emergency(int port) {
// Instantiate all UARTs even if they are not needed
// This avoids a bunch of logic to figure out every serial
// port which may be in use on the system.
#if DISABLED(MKS_WIFI_MODULE)
DEFINE_HWSERIAL_MARLIN(MSerial1, 1);
#endif
DEFINE_HWSERIAL_MARLIN(MSerial2, 2);
DEFINE_HWSERIAL_MARLIN(MSerial3, 3);
#if EITHER(STM32_HIGH_DENSITY, STM32_XL_DENSITY)

View file

@ -979,7 +979,7 @@ void setup() {
#endif
SERIAL_ECHO_MSG("start");
#if BOTH(HAS_TFT_LVGL_UI, USE_WIFI_FUNCTION)
#if BOTH(HAS_TFT_LVGL_UI, MKS_WIFI_MODULE)
mks_esp_wifi_init();
WIFISERIAL.begin(WIFI_BAUDRATE);
serial_connect_timeout = millis() + 1000UL;

View file

@ -308,8 +308,8 @@ void GcodeSuite::M917() {
L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold);
}
DEBUG_ECHOLNPGM(".");
gcode.reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered
watchdog_refresh();; // beat the dog
gcode.reset_stepper_timeout(); // keep steppers powered
watchdog_refresh();
safe_delay(5000);
status_composite_temp = 0;
for (j = 0; j < driver_count; j++) {

View file

@ -29,15 +29,12 @@
*
* The DLCache can be used like so:
*
* void some_function() {
* DLCache dlcache(UNIQUE_ID);
*
* if (dlcache.hasData()) {
* if (dlcache.hasData())
* dlcache.append();
* } else {
* // Add stuff to the DL
* dlcache.store();
* }
* else
* dlcache.store(); // Add stuff to the DL
*/
class DLCache {
private:

View file

@ -32,11 +32,7 @@ bool tiny_timer_t::elapsed(tiny_time_t duration) {
#endif
);
uint8_t elapsed = now - _start;
if (elapsed >= duration._duration) {
return true;
} else {
return false;
}
return elapsed >= duration._duration;
}
void tiny_timer_t::start() {

View file

@ -78,9 +78,9 @@ void BedMeshScreen::drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI::
}
}
}
if (val_cnt) {
if (val_cnt)
val_mean /= val_cnt;
} else {
else {
val_mean = 0;
val_min = 0;
val_max = 0;
@ -327,11 +327,10 @@ void BedMeshScreen::onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::pr
screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_NONE;
break;
case ExtUI::MESH_FINISH:
if (screen_data.BedMeshScreen.count == GRID_MAX_POINTS && isMeshComplete(ExtUI::getMeshArray())) {
if (screen_data.BedMeshScreen.count == GRID_MAX_POINTS && isMeshComplete(ExtUI::getMeshArray()))
screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_MESH_COMPLETE;
} else {
else
screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_MESH_INCOMPLETE;
}
screen_data.BedMeshScreen.count = GRID_MAX_POINTS;
break;
case ExtUI::PROBE_START:

View file

@ -72,7 +72,8 @@ void BootScreen::onIdle() {
GOTO_SCREEN(TouchCalibrationScreen);
current_screen.forget();
PUSH_SCREEN(StatusScreen);
} else {
}
else {
if (!UIFlashStorage::is_valid()) {
StatusScreen::loadBitmaps();
SpinnerDialogBox::show(GET_TEXT_F(MSG_PLEASE_WAIT));

View file

@ -170,12 +170,12 @@ void FilesScreen::drawFooter() {
.tag(back_tag).button( BTN_POS(4,y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BACK))
.enabled(has_selection)
.colors(has_selection ? action_btn : normal_btn);
if (screen_data.FilesScreen.flags.is_dir) {
if (screen_data.FilesScreen.flags.is_dir)
cmd.tag(244).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_OPEN));
} else {
else
cmd.tag(243).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_PRINT));
}
}
void FilesScreen::onRedraw(draw_mode_t what) {
if (what & FOREGROUND) {

View file

@ -122,16 +122,14 @@ char &LockScreen::message_style() {
}
void LockScreen::onPasscodeEntered() {
if (passcode == 0) {
// We are defining a passcode
if (passcode == 0) { // We are defining a passcode
message_style() = 0;
onRefresh();
sound.play(twinkle, PLAY_SYNCHRONOUS);
passcode = compute_checksum();
GOTO_PREVIOUS();
} else {
// We are verifying a passcode
if (passcode == compute_checksum()) {
}
else if (passcode == compute_checksum()) { // We are verifying a passcode
message_style() = 'g';
onRefresh();
sound.play(twinkle, PLAY_SYNCHRONOUS);
@ -145,7 +143,6 @@ void LockScreen::onPasscodeEntered() {
GOTO_PREVIOUS();
}
}
}
bool LockScreen::onTouchEnd(uint8_t tag) {
char *c = strchr(screen_data.LockScreen.passcode,'_');

View file

@ -56,10 +56,9 @@ void SaveSettingsDialogBox::promptToSaveSettings() {
// so SaveSettingsDialogBox doesn't return here.
GOTO_SCREEN(SaveSettingsDialogBox);
current_screen.forget();
} else {
// No save needed.
GOTO_PREVIOUS();
}
else
GOTO_PREVIOUS(); // No save needed.
}
#endif // TOUCH_UI_FTDI_EVE

View file

@ -54,7 +54,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
lv_clear_advance_settings();
lv_draw_filament_settings();
break;
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
case ID_WIFI_PARA:
lv_clear_advance_settings();
lv_draw_wifi_settings();
@ -75,7 +75,7 @@ void lv_draw_advance_settings(void) {
int index = 0;
lv_screen_menu_item(scr, machine_menu.PausePosition, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_POS, index++);
lv_screen_menu_item(scr, machine_menu.FilamentConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FILAMENT_SETTINGS, index++);
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
lv_screen_menu_item(scr, machine_menu.WifiSettings, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_WIFI_PARA, index++);
#endif
#if HAS_ROTARY_ENCODER

View file

@ -239,7 +239,7 @@ void lv_draw_dialog(uint8_t type) {
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel);
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle);
}
#if ENABLED(USE_WIFI_FUNCTION)
#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);
@ -377,7 +377,7 @@ void lv_draw_dialog(uint8_t type) {
lv_label_set_text(labelDialog, DIALOG_UPDATE_NO_DEVICE_EN);
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20);
}
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
else if (DIALOG_IS(TYPE_UPLOAD_FILE)) {
if (upload_result == 1) {
lv_label_set_text(labelDialog, DIALOG_UPLOAD_ING_EN);
@ -418,7 +418,7 @@ void lv_draw_dialog(uint8_t type) {
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20);
}
}
#endif // USE_WIFI_FUNCTION
#endif // MKS_WIFI_MODULE
else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT)) {
lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_heat);
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20);

View file

@ -122,7 +122,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
//if (res != LV_RES_OK) return;
const char * ret_ta_txt = lv_ta_get_text(ext->ta);
switch (keyboard_value) {
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
case wifiName:
memcpy(uiCfg.wifi_name,ret_ta_txt,sizeof(uiCfg.wifi_name));
lv_clear_keyboard();
@ -158,7 +158,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
wifi_tips_type = TIPS_TYPE_JOINING;
lv_draw_wifi_tips();
break;
#endif // USE_WIFI_FUNCTION
#endif // MKS_WIFI_MODULE
case gcodeCommand:
uint8_t buf[100];
strncpy((char *)buf,ret_ta_txt,sizeof(buf));

View file

@ -180,10 +180,7 @@ void lv_draw_operation(void) {
label_PowerOff = lv_label_create_empty(buttonPowerOff);
if (uiCfg.print_state != WORKING) {
/*
label_Filament = lv_label_create_empty(buttonFilament);
} else {
*/
//label_Filament = lv_label_create_empty(buttonFilament);
labelExtrusion = lv_label_create_empty(buttonExtrusion);
label_Move = lv_label_create_empty(buttonMove);
}
@ -210,11 +207,8 @@ 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);
} else {
*/
//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

@ -219,7 +219,7 @@ void lv_draw_ready_print(void) {
void lv_clear_ready_print() {
#if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable == true) lv_group_remove_all_objs(g);
if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);
#endif
lv_obj_del(scr);
}

View file

@ -54,7 +54,7 @@ enum {
static void event_handler(lv_obj_t *obj, lv_event_t event) {
if (event != LV_EVENT_RELEASED) return;
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
char buf[6] = { 0 };
#endif
switch (obj->mks_obj_id) {
@ -87,7 +87,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
lv_draw_ready_print();
break;
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
case ID_S_WIFI:
if (gCfgItems.wifi_mode_sel == STA_MODEL) {
if (wifi_link_state == WIFI_CONNECTED) {
@ -135,7 +135,7 @@ void lv_draw_set(void) {
#if HAS_LANG_SELECT_SCREEN
lv_big_button_create(scr, "F:/bmp_language.bin", set_menu.language, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_LANGUAGE);
#endif
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
lv_big_button_create(scr, "F:/bmp_wifi.bin", set_menu.wifi, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_WIFI);
#endif
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_S_RETURN);

View file

@ -138,7 +138,7 @@ void gCfgItems_init() {
gCfgItems.levelingPos[4][0] = X_BED_SIZE / 2;
gCfgItems.levelingPos[4][1] = Y_BED_SIZE / 2;
gCfgItems.cloud_enable = true;
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
gCfgItems.wifi_mode_sel = STA_MODEL;
gCfgItems.fileSysType = FILE_SYS_SD;
gCfgItems.wifi_type = ESP_WIFI;
@ -203,7 +203,7 @@ void ui_cfg_init() {
uiCfg.filament_unloading_time_flg = 0;
uiCfg.filament_unloading_time_cnt = 0;
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
memset(&wifiPara, 0, sizeof(wifiPara));
memset(&ipPara, 0, sizeof(ipPara));
strcpy(wifiPara.ap_name, WIFI_AP_NAME);
@ -542,7 +542,7 @@ char *getDispText(int index) {
strcpy(public_buf_l, tool_menu.title);
break;
case WIFI_LIST_UI:
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
strcpy(public_buf_l, list_menu.title);
break;
#endif
@ -1040,7 +1040,7 @@ void GUI_RefreshPage() {
*/
break;
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
case WIFI_UI:
if (temps_update_flag) {
disp_wifi_state();
@ -1061,7 +1061,7 @@ void GUI_RefreshPage() {
break;
case DIALOG_UI:
filament_dialog_handle();
TERN_(USE_WIFI_FUNCTION, wifi_scan_handle());
TERN_(MKS_WIFI_MODULE, wifi_scan_handle());
break;
case MESHLEVELING_UI:
/*disp_zpos();*/
@ -1069,7 +1069,7 @@ void GUI_RefreshPage() {
case HARDWARE_TEST_UI:
break;
case WIFI_LIST_UI:
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
if (printing_rate_update_flag) {
disp_wifi_list();
printing_rate_update_flag = false;
@ -1080,7 +1080,7 @@ void GUI_RefreshPage() {
/*update_password_disp();
update_join_state_disp();*/
break;
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
case WIFI_TIPS_UI:
switch (wifi_tips_type) {
case TIPS_TYPE_JOINING:
@ -1516,10 +1516,8 @@ lv_obj_t* lv_big_button_create(lv_obj_t *par, const char *img, const char *text,
else
lv_obj_align(label, btn, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
}
#if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable == true)
if (TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable))
lv_group_add_obj(g, btn);
#endif
return btn;
}
@ -1535,11 +1533,8 @@ lv_obj_t* lv_screen_menu_item(lv_obj_t *par, const char *text, lv_coord_t x, lv_
lv_label_set_text(label, text);
lv_obj_align(label, btn, LV_ALIGN_IN_LEFT_MID, 0, 0);
}
#if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable == true) {
if (TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable))
lv_group_add_obj(g, btn);
}
#endif
if (drawArrow) (void)lv_imgbtn_create(par, "F:/bmp_arrow.bin", x + PARA_UI_SIZE_X, y + PARA_UI_ARROW_V, cb, id);

View file

@ -76,7 +76,7 @@
#include "draw_keyboard.h"
#include "draw_encoder_settings.h"
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
#include "wifiSerial.h"
#include "wifi_module.h"
#include "wifi_upload.h"
@ -378,14 +378,12 @@ typedef enum {
level_pos_x4,
level_pos_y4,
level_pos_x5,
level_pos_y5
level_pos_y5,
#if HAS_BED_PROBE
,
x_offset,
y_offset,
z_offset
z_offset,
#endif
,
load_length,
load_speed,
unload_length,

View file

@ -26,7 +26,7 @@
#include <lv_conf.h>
#include "tft_lvgl_configuration.h"
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
#include "draw_ui.h"
@ -159,5 +159,5 @@ void lv_clear_wifi() {
lv_obj_del(scr);
}
#endif // USE_WIFI_FUNCTION
#endif // MKS_WIFI_MODULE
#endif // HAS_TFT_LVGL_UI

View file

@ -26,7 +26,7 @@
#include <lv_conf.h>
#include "tft_lvgl_configuration.h"
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
#include "draw_ui.h"
@ -170,6 +170,5 @@ void lv_clear_wifi_list() {
lv_obj_del(scr);
}
#endif // USE_WIFI_FUNCTION
#endif // MKS_WIFI_MODULE
#endif // HAS_TFT_LVGL_UI

View file

@ -26,7 +26,7 @@
#include <lv_conf.h>
#include "tft_lvgl_configuration.h"
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
#include "draw_ui.h"
@ -96,7 +96,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
void lv_draw_wifi_settings(void) {
scr = lv_screen_create(WIFI_SETTINGS_UI, machine_menu.WifiConfTitle);
lv_obj_t *labelModelText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.wifiMode);
lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.wifiMode);
lv_obj_t *buttonModelValue = lv_imgbtn_create(scr, "F:/bmp_blank_sel.bin", PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, event_handler, ID_WIFI_MODEL);
lv_btn_set_style_both(buttonModelValue, &style_para_value_pre);
@ -119,7 +119,7 @@ void lv_draw_wifi_settings(void) {
lv_obj_t *line3 = lv_line_create(scr, nullptr);
lv_ex_line(line3, line_points[2]);
lv_obj_t *labelCloudText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.wifiCloud);
lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.wifiCloud);
lv_obj_t *buttonCloudValue = lv_imgbtn_create(scr, gCfgItems.cloud_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_STATE_V, event_handler, ID_WIFI_CLOUD);
labelCloudValue = lv_label_create_empty(buttonCloudValue);
@ -141,14 +141,14 @@ void lv_draw_wifi_settings(void) {
lv_label_set_text(labelModelValue, WIFI_STA_TEXT);
lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0);
}
strcat(public_buf_m, machine_menu.wifiName);
strcpy(public_buf_m, machine_menu.wifiName);
strcat(public_buf_m, (const char *)uiCfg.wifi_name);
lv_label_set_text(labelNameText, public_buf_m);
lv_label_set_text(labelNameValue, machine_menu.wifiEdit);
lv_obj_align(labelNameValue, buttonNameValue, LV_ALIGN_CENTER, 0, 0);
strcat(public_buf_m, machine_menu.wifiPassWord);
strcpy(public_buf_m, machine_menu.wifiPassWord);
strcat(public_buf_m, (const char *)uiCfg.wifi_key);
lv_label_set_text(labelPassWordText, public_buf_m);
@ -184,5 +184,5 @@ void lv_clear_wifi_settings() {
lv_obj_del(scr);
}
#endif // USE_WIFI_FUNCTION
#endif // MKS_WIFI_MODULE
#endif // HAS_TFT_LVGL_UI

View file

@ -26,7 +26,7 @@
#include <lv_conf.h>
#include "tft_lvgl_configuration.h"
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
#include "draw_ui.h"
@ -64,5 +64,5 @@ void lv_draw_wifi_tips(void) {
void lv_clear_wifi_tips() { lv_obj_del(scr); }
#endif // USE_WIFI_FUNCTION
#endif // MKS_WIFI_MODULE
#endif // HAS_TFT_LVGL_UI

View file

@ -25,7 +25,7 @@
#include "tft_lvgl_configuration.h"
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
#include "draw_ui.h"
#include "wifiSerial.h"
@ -66,5 +66,5 @@ void __irq_usart1(void) {
} /* C-declarations for C++ */
#endif
#endif // USE_WIFI_FUNCTION
#endif // MKS_WIFI_MODULE
#endif // HAS_TFT_LVGL_UI

View file

@ -205,7 +205,7 @@ static const char assets[][LONG_FILENAME_LENGTH] = {
"bmp_enable.bin",
"bmp_return.bin",
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
// wifi screen
"bmp_wifi.bin",
#endif

View file

@ -148,7 +148,7 @@ void printer_state_polling() {
if (uiCfg.print_state == WORKING)
filament_check();
TERN_(USE_WIFI_FUNCTION, wifi_looping());
TERN_(MKS_WIFI_MODULE, wifi_looping());
}
void filament_pin_setup() {

View file

@ -48,7 +48,7 @@
#define MACHINE_TYPE_CNOFIG_EN "Machine settings"
#define MOTOR_CONFIG_EN "Motor settings"
#define MACHINE_LEVELING_CONFIG_EN "Leveling settings"
#define ADVANCE_CONFIG_EN "Adavance settings"
#define ADVANCE_CONFIG_EN "Advanced settings"
#define MACHINE_CONFIG_TITLE_EN "Machine Settings"
#define MACHINE_TYPE_EN "Machine type"
@ -82,9 +82,9 @@
#define MIN_ENDSTOP_X_EN "X-axis minimum Endstop"
#define MIN_ENDSTOP_Y_EN "Y-axis minimum Endstop"
#define MIN_ENDSTOP_Z_EN "Z-axis minimum Endstop"
#define MAX_ENDSTOP_X_EN "X axis maximum Endstop"
#define MAX_ENDSTOP_Y_EN "Y axis maximum Endstop"
#define MAX_ENDSTOP_Z_EN "Z axis maximum Endstop"
#define MAX_ENDSTOP_X_EN "X-axis maximum Endstop"
#define MAX_ENDSTOP_Y_EN "Y-axis maximum Endstop"
#define MAX_ENDSTOP_Z_EN "Z-axis maximum Endstop"
#define ENDSTOP_FIL_EN "Filament sensor"
#define ENDSTOP_LEVEL_EN "Leveling sensor"
#define ENDSTOP_OPENED_EN "Open"
@ -107,11 +107,11 @@
#define AUTO_LEVELING_ENABLE_EN "Enable auto leveling"
#define BLTOUCH_LEVELING_ENABLE_EN "Enable BLtouch"
#define PROBE_PORT_EN "Probe connector"
#define PROBE_X_OFFSET_EN "Probe x axis offset"
#define PROBE_Y_OFFSET_EN "Probe y axis offset"
#define PROBE_Z_OFFSET_EN "Probe z axis offset"
#define PROBE_XY_SPEED_EN "Probe xy axis speed"
#define PROBE_Z_SPEED_EN "Probe z axis speed"
#define PROBE_X_OFFSET_EN "Probe X-axis offset"
#define PROBE_Y_OFFSET_EN "Probe Y-axis offset"
#define PROBE_Z_OFFSET_EN "Probe Z-axis offset"
#define PROBE_XY_SPEED_EN "Probe XY-axis speed"
#define PROBE_Z_SPEED_EN "Probe Z-axis speed"
#define ENABLE_EN "YES"
#define DISABLE_EN "NO"
#define Z_MIN_EN "ZMin"
@ -162,11 +162,11 @@
#define HOMEFEEDRATECONF_EN "Home speed setting"
#define MAXFEEDRATE_CONF_TITLE_EN "Machine Settings>Maximum speed"
#define X_MAXFEEDRATE_EN "X axis maximum speed"
#define Y_MAXFEEDRATE_EN "Y axis maximum speed"
#define Z_MAXFEEDRATE_EN "Z axis maximum speed"
#define E0_MAXFEEDRATE_EN "E0 axis maximum speed"
#define E1_MAXFEEDRATE_EN "E1 axis maximum speed"
#define X_MAXFEEDRATE_EN "X-axis maximum speed"
#define Y_MAXFEEDRATE_EN "Y-axis maximum speed"
#define Z_MAXFEEDRATE_EN "Z-axis maximum speed"
#define E0_MAXFEEDRATE_EN "E0-axis maximum speed"
#define E1_MAXFEEDRATE_EN "E1-axis maximum speed"
#define ACCELERATION_CONF_TITLE_EN "Machine Settings>Acceleration"
#define PRINT_ACCELERATION_EN "Print acceleration"
@ -192,18 +192,18 @@
#define E1_STEPS_EN "E1-axis steps"
#define TMC_CURRENT_CONF_TITLE_EN "Machine Settings>TMC current settings"
#define X_TMC_CURRENT_EN "X axis current (mA)"
#define Y_TMC_CURRENT_EN "Y axis current (mA)"
#define Z_TMC_CURRENT_EN "Z axis current (mA)"
#define E0_TMC_CURRENT_EN "E0 axis current (mA)"
#define E1_TMC_CURRENT_EN "E1 axis current (mA)"
#define X_TMC_CURRENT_EN "X-axis current (mA)"
#define Y_TMC_CURRENT_EN "Y-axis current (mA)"
#define Z_TMC_CURRENT_EN "Z-axis current (mA)"
#define E0_TMC_CURRENT_EN "E0-axis current (mA)"
#define E1_TMC_CURRENT_EN "E1-axis current (mA)"
#define TMC_MODE_CONF_TITLE_EN "Machine Settings>TMC step mode settings"
#define X_TMC_MODE_EN "Whether X axis enable stealthChop modes"
#define Y_TMC_MODE_EN "Whether Y axis enable stealthChop modes"
#define Z_TMC_MODE_EN "Whether Z axis enable stealthChop modes"
#define E0_TMC_MODE_EN "Whether E0 axis enable stealthChop modes"
#define E1_TMC_MODE_EN "Whether E1 axis enable stealthChop modes"
#define X_TMC_MODE_EN "Whether X-axis enable stealthChop modes"
#define Y_TMC_MODE_EN "Whether Y-axis enable stealthChop modes"
#define Z_TMC_MODE_EN "Whether Z-axis enable stealthChop modes"
#define E0_TMC_MODE_EN "Whether E0-axis enable stealthChop modes"
#define E1_TMC_MODE_EN "Whether E1-axis enable stealthChop modes"
#define MOTORDIR_CONF_TITLE_EN "Machine Settings>Motor direction"
#define X_MOTORDIR_EN "X-axis motor direction invert"
@ -241,9 +241,9 @@
#define E_ENABLE_PINS_INVERT_EN "E_ENABLE_PIN_INVERT"
#define PAUSE_POSITION_EN "Printing pause position settings"
#define PAUSE_POSITION_X_EN "X axis position (Absolute position,-1 invalid)"
#define PAUSE_POSITION_Y_EN "Y axis position (Absolute position,-1 invalid)"
#define PAUSE_POSITION_Z_EN "Z axis position (Relative position,-1 invalid)"
#define PAUSE_POSITION_X_EN "X-axis position (Absolute position,-1 invalid)"
#define PAUSE_POSITION_Y_EN "Y-axis position (Absolute position,-1 invalid)"
#define PAUSE_POSITION_Z_EN "Z-axis position (Relative position,-1 invalid)"
#define WIFI_SETTINGS_TITLE_EN "Machine Settings>Wi-Fi Parameter"
#define WIFI_SETTINGS_MODE_EN "Wi-Fi Mode"

View file

@ -84,7 +84,7 @@ uint8_t bmp_public_buf[17 * 1024];
void SysTick_Callback() {
lv_tick_inc(1);
print_time_count();
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
if (tips_disp.timer == TIPS_TIMER_START)
tips_disp.timer_count++;
#endif
@ -523,7 +523,6 @@ void lv_encoder_pin_init() {
const uint8_t enc_c = (buttons & EN_C) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL;
if (enc_c != last_button_state) {
state = enc_c ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL;
last_button_state = enc_c;
}

View file

@ -33,7 +33,7 @@
#include <lvgl.h>
//#define TFT_ROTATION TFT_ROTATE_180
#define USE_WIFI_FUNCTION 0
#define MKS_WIFI_MODULE 0
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);

View file

@ -853,7 +853,7 @@ void disp_language_init() {
machine_menu.key_point = KEYBOARD_KEY_POINT_EN;
machine_menu.negative = KEYBOARD_KEY_NEGATIVE_EN;
// wifi-list
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
list_menu.title = TEXT_WIFI_MENU_TITLE_EN;
list_menu.file_pages = FILE_PAGES_EN;
@ -861,7 +861,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 //USE_WIFI_FUNCTION
#endif //MKS_WIFI_MODULE
machine_setting_disp();
operation_menu.babystep = TEXT_BABY_STEP_EN;

View file

@ -25,7 +25,7 @@
#include "tft_lvgl_configuration.h"
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
#include "draw_ui.h"
#include "wifiSerial.h"
@ -118,5 +118,5 @@ int WifiSerial::wifi_rb_is_full(void) {
return rb_is_full(this->usart_device->rb);
}
#endif // USE_WIFI_FUNCTION
#endif // MKS_WIFI_MODULE
#endif // HAS_TFT_LVGL_UI

View file

@ -23,10 +23,10 @@
#include "tft_lvgl_configuration.h"
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
#if SERIAL_PORT_2 != -1
#error "SERIAL_PORT_2 must be set to -1 with HAS_TFT_LVGL_UI and USE_WIFI_FUNCTION."
#ifdef SERIAL_PORT_2
#error "SERIAL_PORT_2 must be disabled with HAS_TFT_LVGL_UI and MKS_WIFI_MODULE."
#endif
#define WIFI_BAUDRATE 115200
@ -99,4 +99,4 @@ extern WifiSerial WifiSerial1;
#define WIFISERIAL WifiSerial1
#endif // USE_WIFI_FUNCTION
#endif // MKS_WIFI_MODULE

View file

@ -27,7 +27,7 @@
#include "wifi_module.h"
#include "wifi_upload.h"
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
#include "../../../../MarlinCore.h"
#include "../../../../module/temperature.h"
@ -283,7 +283,7 @@ void esp_port_begin(uint8_t interrupt) {
}
#endif
if (interrupt) {
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
WIFISERIAL.end();
for (uint16_t i = 0; i < 65535; i++);
WIFISERIAL.begin(WIFI_BAUDRATE);
@ -293,7 +293,7 @@ void esp_port_begin(uint8_t interrupt) {
#endif
}
else {
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
WIFISERIAL.end();
for (uint16_t i = 0; i < 65535; i++);
WIFISERIAL.begin(WIFI_UPLOAD_BAUDRATE);
@ -305,7 +305,7 @@ void esp_port_begin(uint8_t interrupt) {
}
}
#if ENABLED(USE_WIFI_FUNCTION)
#if ENABLED(MKS_WIFI_MODULE)
int raw_send_to_wifi(char *buf, int len) {
if (buf == 0 || len <= 0) return 0;
@ -1811,5 +1811,5 @@ int readWifiBuf(int8_t *buf, int32_t len) {
return i;
}
#endif // USE_WIFI_FUNCTION
#endif // MKS_WIFI_MODULE
#endif // HAS_TFT_LVGL_UI