diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8ab3929c41..2c53498d02 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1220,6 +1220,15 @@ #endif #endif +/** + * Probe Enable / Disable + * The probe only provides a triggered signal when enabled. + */ +//#define PROBE_ENABLE_DISABLE +#if ENABLED(PROBE_ENABLE_DISABLE) + //#define PROBE_ENABLE_PIN -1 // Override the default pin here +#endif + /** * Multiple Probing * diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fc495a6ea6..fc9688edb7 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1280,7 +1280,7 @@ #endif // HAS_LCD_MENU -#if HAS_DISPLAY +#if EITHER(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED) // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 diff --git a/Marlin/Version.h b/Marlin/Version.h index e562730ae3..1643741f49 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2021-11-04" +//#define STRING_DISTRIBUTION_DATE "2021-11-12" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/HAL/shared/Delay.h b/Marlin/src/HAL/shared/Delay.h index 04df35d88d..df07881f01 100644 --- a/Marlin/src/HAL/shared/Delay.h +++ b/Marlin/src/HAL/shared/Delay.h @@ -92,6 +92,12 @@ void calibrate_delay_loop(); #define DELAY_CYCLES(X) do { SmartDelay _smrtdly_X(X); } while(0) + #if GCC_VERSION <= 70000 + #define DELAY_CYCLES_VAR(X) DelayCycleFnc(X) + #else + #define DELAY_CYCLES_VAR DELAY_CYCLES + #endif + // For delay in microseconds, no smart delay selection is required, directly call the delay function // Teensy compiler is too old and does not accept smart delay compile-time / run-time selection correctly #define DELAY_US(x) DelayCycleFnc((x) * ((F_CPU) / 1000000UL)) @@ -200,9 +206,12 @@ void calibrate_delay_loop(); #endif #if ENABLED(DELAY_NS_ROUND_DOWN) - #define DELAY_NS(x) DELAY_CYCLES((x) * ((F_CPU) / 1000000UL) / 1000UL) // floor + #define _NS_TO_CYCLES(x) ( (x) * ((F_CPU) / 1000000UL) / 1000UL) // floor #elif ENABLED(DELAY_NS_ROUND_CLOSEST) - #define DELAY_NS(x) DELAY_CYCLES(((x) * ((F_CPU) / 1000000UL) + 500) / 1000UL) // round + #define _NS_TO_CYCLES(x) (((x) * ((F_CPU) / 1000000UL) + 500) / 1000UL) // round #else - #define DELAY_NS(x) DELAY_CYCLES(((x) * ((F_CPU) / 1000000UL) + 999) / 1000UL) // "ceil" + #define _NS_TO_CYCLES(x) (((x) * ((F_CPU) / 1000000UL) + 999) / 1000UL) // "ceil" #endif + +#define DELAY_NS(x) DELAY_CYCLES(_NS_TO_CYCLES(x)) +#define DELAY_NS_VAR(x) DELAY_CYCLES_VAR(_NS_TO_CYCLES(x)) diff --git a/Marlin/src/HAL/shared/Marduino.h b/Marlin/src/HAL/shared/Marduino.h index 3b5a68a373..0e2a021a3c 100644 --- a/Marlin/src/HAL/shared/Marduino.h +++ b/Marlin/src/HAL/shared/Marduino.h @@ -39,7 +39,7 @@ #define DISABLED(V...) DO(DIS,&&,V) #undef _BV -#define _BV(b) (1UL << (b)) +#define _BV(b) (1 << (b)) #ifndef SBI #define SBI(A,B) (A |= _BV(B)) #endif diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 5e8881d1c6..f2031cdfb9 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1554,15 +1554,15 @@ void setup() { #endif #if HAS_DWIN_E3V2_BASIC + SETUP_LOG("E3V2 Init"); Encoder_Configuration(); HMI_Init(); HMI_SetLanguageCache(); HMI_StartFrame(true); - DWIN_StatusChanged(GET_TEXT_F(WELCOME_MSG)); #endif #if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC - ui.reset_status(true); // Show service messages or keep current status + SETUP_RUN(ui.reset_status(true)); // Show service messages or keep current status #endif #if ENABLED(MAX7219_DEBUG) @@ -1593,7 +1593,7 @@ void setup() { #endif #if BOTH(HAS_LCD_MENU, TOUCH_SCREEN_CALIBRATION) && EITHER(TFT_CLASSIC_UI, TFT_COLOR_UI) - ui.check_touch_calibration(); + SETUP_RUN(ui.check_touch_calibration()); #endif marlin_state = MF_RUNNING; diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index d97ac2a0ac..191c0e4b08 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -254,7 +254,6 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE))); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR))); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR))); wait_for_user = true; // A click or M108 breaks the purge_length loop for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); diff --git a/Marlin/src/feature/twibus.cpp b/Marlin/src/feature/twibus.cpp index 0e23b48a40..e33581676c 100644 --- a/Marlin/src/feature/twibus.cpp +++ b/Marlin/src/feature/twibus.cpp @@ -98,7 +98,7 @@ void TWIBus::echodata(uint8_t bytes, FSTR_P const pref, uint8_t adr, const uint8 union TwoBytesToInt16 { uint8_t bytes[2]; int16_t integervalue; }; TwoBytesToInt16 ConversionUnion; - echoprefix(bytes, pref, adr); + echoprefix(bytes, pref, adr); while (bytes-- && Wire.available()) { int value = Wire.read(); diff --git a/Marlin/src/gcode/config/M304.cpp b/Marlin/src/gcode/config/M304.cpp index 4bd415db1e..97dc4be25e 100644 --- a/Marlin/src/gcode/config/M304.cpp +++ b/Marlin/src/gcode/config/M304.cpp @@ -43,7 +43,7 @@ void GcodeSuite::M304() { void GcodeSuite::M304_report(const bool forReplay/*=true*/) { report_heading_etc(forReplay, F(STR_BED_PID)); - SERIAL_ECHO_MSG( + SERIAL_ECHOLNPGM( " M304 P", thermalManager.temp_bed.pid.Kp , " I", unscalePID_i(thermalManager.temp_bed.pid.Ki) , " D", unscalePID_d(thermalManager.temp_bed.pid.Kd) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index f695d0a1b2..badb7231e0 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2021-11-04" + #define STRING_DISTRIBUTION_DATE "2021-11-12" #endif /** diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp index 787cf717eb..d1a9ba7077 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp @@ -23,8 +23,8 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.6.3 - * Date: 2021/09/10 + * Version: 3.7.1 + * Date: 2021/11/09 */ #include "../../../inc/MarlinConfigPre.h" @@ -142,7 +142,7 @@ HMI_data_t HMI_data; millis_t dwin_heat_time = 0; -uint8_t checkkey = MainMenu, last_checkkey = MainMenu; +uint8_t checkkey = 255, last_checkkey = MainMenu; enum SelectItem : uint8_t { PAGE_PRINT = 0, @@ -170,6 +170,7 @@ select_t select_page{0}, select_file{0}, select_print{0}; uint8_t index_file = MROWS; bool dwin_abort_flag = false; // Flag to reset feedrate, return to Home +bool hash_changed = true; // Flag to know if message status was changed constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE; constexpr float default_max_acceleration[] = DEFAULT_MAX_ACCELERATION; @@ -386,15 +387,15 @@ void ICON_Stop() { ICON_Button(select_print.now == PRINT_STOP, ICON_Stop_0, ico, txt); } -void Draw_Menu_Cursor(const uint8_t line) { +void Draw_Menu_Cursor(const int8_t line) { DWIN_Draw_Rectangle(1, HMI_data.Cursor_color, 0, MBASE(line) - 18, 14, MBASE(line + 1) - 20); } -void Erase_Menu_Cursor(const uint8_t line) { +void Erase_Menu_Cursor(const int8_t line) { DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, MBASE(line) - 18, 14, MBASE(line + 1) - 20); } -void Move_Highlight(const int16_t from, const uint16_t newline) { +void Move_Highlight(const int8_t from, const int8_t newline) { Erase_Menu_Cursor(newline - from); Draw_Menu_Cursor(newline); } @@ -577,6 +578,7 @@ void Popup_window_PauseOrStop() { DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280); } Draw_Select_Highlight(true); + DWIN_UpdateLCD(); } #if HAS_HOTEND || HAS_HEATED_BED @@ -607,9 +609,88 @@ void Popup_window_PauseOrStop() { } } } - #endif +// Draw status line +void DWIN_DrawStatusLine(const uint16_t color, const uint16_t bgcolor, const char *text, const bool center = true) { + DWIN_Draw_Rectangle(1, bgcolor, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20); + if (text) { + if (center) DWINUI::Draw_CenteredString(color, STATUS_Y + 2, text); + else DWINUI::Draw_String(color, 0, STATUS_Y + 2, text); + } + DWIN_UpdateLCD(); +} +void DWIN_DrawStatusLine(const char *text, const bool center = true) { + DWIN_DrawStatusLine(HMI_data.StatusTxt_Color, HMI_data.StatusBg_Color, text, center); +} + +// Clear & reset status line +void DWIN_ResetStatusLine() { + ui.status_message[0] = 0; + DWIN_CheckStatusMessage(); +} + +// Djb2 hash algorithm +void DWIN_CheckStatusMessage() { + static uint32_t old_hash = 0; + char * str = &ui.status_message[0]; + uint32_t hash = 5381; + char c; + while ((c = *str++)) hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ + hash_changed = hash != old_hash; + old_hash = hash; +}; + +void DWIN_DrawStatusMessage() { + const uint8_t max_status_chars = DWIN_WIDTH / DWINUI::fontWidth(DWINUI::font); + + #if ENABLED(STATUS_MESSAGE_SCROLLING) + + // Get the UTF8 character count of the string + uint8_t slen = utf8_strlen(ui.status_message); + + // If the string fits the status line do not scroll it + if (slen <= max_status_chars) { + if (hash_changed) { + DWIN_DrawStatusLine(HMI_data.StatusTxt_Color, HMI_data.StatusBg_Color, ui.status_message); + hash_changed = false; + } + } + else { + // String is larger than the available line space + + // Get a pointer to the next valid UTF8 character + // and the string remaining length + uint8_t rlen; + const char *stat = MarlinUI::status_and_len(rlen); + DWIN_Draw_Rectangle(1, HMI_data.StatusBg_Color, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20); + DWINUI::MoveTo(0, STATUS_Y + 2); + DWINUI::Draw_String(stat, max_status_chars); + + // If the string doesn't completely fill the line... + if (rlen < max_status_chars) { + DWINUI::Draw_Char('.'); // Always at 1+ spaces left, draw a dot + uint8_t chars = max_status_chars - rlen; // Amount of space left in characters + if (--chars) { // Draw a second dot if there's space + DWINUI::Draw_Char('.'); + if (--chars) + DWINUI::Draw_String(ui.status_message, chars); // Print a second copy of the message + } + } + MarlinUI::advance_status_scroll(); + } + + #else + + if (hash_changed) { + ui.status_message[max_status_chars] = 0; + DWIN_DrawStatusLine(HMI_data.StatusTxt_Color, HMI_data.StatusBg_Color, ui.status_message); + hash_changed = false; + } + + #endif +} + void Draw_Print_Labels() { if (HMI_IsChinese()) { Title.FrameCopy(30, 1, 42, 14); // "Printing" @@ -671,6 +752,7 @@ void Draw_PrintProcess() { } void Goto_PrintProcess() { + if (checkkey == PrintProcess) return; checkkey = PrintProcess; Draw_PrintProcess(); } @@ -712,8 +794,9 @@ void Draw_Main_Menu() { } void Goto_Main_Menu() { + if (checkkey == MainMenu) return; checkkey = MainMenu; - DWIN_StatusChanged(); + ui.reset_status(true); Draw_Main_Menu(); } @@ -1077,6 +1160,7 @@ void Draw_Status_Area(const bool with_update) { void HMI_StartFrame(const bool with_update) { Goto_Main_Menu(); + DWIN_DrawStatusLine(nullptr); Draw_Status_Area(with_update); } @@ -1157,10 +1241,10 @@ void HMI_MainMenu() { case PAGE_INFO_LEVELING: #if HAS_ONESTEP_LEVELING - queue.inject(F("G28XYO\nG28Z\nG29")); // TODO: 'G29' should be homing when needed. Does it make sense for every LCD to do this differently? + queue.inject(F("G28Z\nG29")); // Force to get the current Z home position #else - checkkey = Info; - Draw_Info_Menu(); + last_checkkey = MainMenu; + Goto_InfoMenu(); #endif break; } @@ -1245,7 +1329,7 @@ void HMI_SelectFile() { } } else if (encoder_diffState == ENCODER_DIFF_ENTER) { - if (select_file.now == 0) { + if (select_file.now == 0) { // Back select_page.set(PAGE_PRINT); Goto_Main_Menu(); } @@ -1441,7 +1525,6 @@ void Draw_Main_Area() { void HMI_ReturnScreen() { checkkey = last_checkkey; Draw_Main_Area(); - DWIN_UpdateLCD(); return; } @@ -1474,7 +1557,7 @@ void DWIN_Update() { } void EachMomentUpdate() { - static millis_t next_var_update_ms = 0, next_rts_update_ms = 0; + static millis_t next_var_update_ms = 0, next_rts_update_ms = 0, next_status_update_ms = 0; const millis_t ms = millis(); if (ELAPSED(ms, next_var_update_ms)) { @@ -1482,6 +1565,11 @@ void EachMomentUpdate() { update_variable(); } + if (ELAPSED(ms, next_status_update_ms)) { + next_status_update_ms = ms + 500; + DWIN_DrawStatusMessage(); + } + if (PENDING(ms, next_rts_update_ms)) return; next_rts_update_ms = ms + DWIN_SCROLL_UPDATE_INTERVAL; @@ -1745,7 +1833,7 @@ void Draw_Title(TitleClass* title) { void Draw_Menu(MenuClass* menu) { DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color); DWIN_Draw_Rectangle(1, DWINUI::backcolor, 0, TITLE_HEIGHT, DWIN_WIDTH - 1, STATUS_Y - 1); - ui.set_status(""); + DWIN_ResetStatusLine(); } // Startup routines @@ -1758,23 +1846,6 @@ void DWIN_Startup() { HMI_SetLanguage(); } -void DWIN_DrawStatusLine(const uint16_t color, const uint16_t bgcolor, const char * const text/*=nullptr*/) { - DWIN_Draw_Rectangle(1, bgcolor, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20); - if (text) DWINUI::Draw_CenteredString(color, STATUS_Y + 2, text); - DWIN_UpdateLCD(); -} - -// Update Status line -void DWIN_StatusChanged(const char * const cstr/*=nullptr*/) { - DWIN_DrawStatusLine(HMI_data.StatusTxt_Color, HMI_data.StatusBg_Color, cstr); -} - -void DWIN_StatusChanged(FSTR_P const fstr) { - char str[strlen_P(FTOP(fstr)) + 1]; - strcpy_P(str, FTOP(fstr)); - DWIN_StatusChanged(str); -} - // Started a Print Job void DWIN_Print_Started(const bool sd) { sdprint = card.isPrinting() || sd; @@ -1866,7 +1937,6 @@ void DWIN_RebootScreen() { void DWIN_Redraw_screen() { Draw_Main_Area(); - DWIN_StatusChanged(ui.status_message); Draw_Status_Area(false); } @@ -2161,7 +2231,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS void SetMoveZto0() { char cmd[48] = ""; char str_1[5] = "", str_2[5] = ""; - sprintf_P(cmd, PSTR("G28OXY\nG28Z\nG0X%sY%sF5000\nG0Z0F300"), + sprintf_P(cmd, PSTR("G28Z\nG0X%sY%sF5000\nM420S0\nG0Z0F300"), #if ENABLED(MESH_BED_LEVELING) dtostrf(0, 1, 1, str_1), dtostrf(0, 1, 1, str_2) @@ -2344,7 +2414,7 @@ void LevBed(uint8_t point) { float xpos = 0, ypos = 0, zval = 0; float margin = PROBING_MARGIN; #else - #define fmt "M420 S0\nG28O\nG90\nG0 Z5 F300\nG0 X%i Y%i F5000\nG0 Z0 F300" + #define fmt "M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300" int16_t xpos = 0, ypos = 0; int16_t margin = 30; #endif @@ -2400,7 +2470,7 @@ void LevBedC () { LevBed(4); } void ManualMeshStart(){ LCD_MESSAGE(MSG_UBL_BUILD_MESH_MENU); - gcode.process_subcommands_now(F("G28 XYO\nG28 Z\nM211 S0\nG29S1")); + gcode.process_subcommands_now(F("G28Z\nM211S0\nG29S1")); planner.synchronize(); #ifdef MANUAL_PROBE_START_Z const uint8_t line = CurrentMenu->line(MMeshMoveZItem->pos); @@ -2425,7 +2495,7 @@ void LevBedC () { LevBed(4); } void ManualMeshSave(){ LCD_MESSAGE(MSG_UBL_STORAGE_MESH_MENU); - queue.inject(F("M211 S1\nM500")); + queue.inject(F("M211S1\nM500")); } #endif // MESH_BED_LEVELING @@ -2741,7 +2811,7 @@ void onDrawSteps(MenuItemClass* menuitem, int8_t line) { #if ENABLED(MESH_BED_LEVELING) void onDrawMMeshMoveZ(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) menuitem->SetFrame(1, 160, 118, 209, 132); - onDrawPFloatMenu(menuitem, line); + onDrawPFloat2Menu(menuitem, line); } #endif @@ -3027,11 +3097,11 @@ void HMI_SetIntNoDraw() { // Set an integer pointer variable using the encoder void HMI_SetPInt() { int8_t val = HMI_GetInt(HMI_value.MinValue, HMI_value.MaxValue); - if (!val) return; - else if (val == 2) { // Apply - *HMI_value.P_Int = HMI_value.Value; - if (HMI_value.Apply != nullptr) HMI_value.Apply(); - } else if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); + switch (val) { + case 0: return; + case 1: if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); break; + case 2: *HMI_value.P_Int = HMI_value.Value; if (HMI_value.Apply != nullptr) HMI_value.Apply(); break; + } } // Get a scaled float value using the encoder @@ -3071,17 +3141,16 @@ void HMI_SetFloat() { // Set a scaled float pointer variable using the encoder void HMI_SetPFloat() { const int8_t val = HMI_GetFloat(HMI_value.dp, HMI_value.MinValue, HMI_value.MaxValue); - if (!val) return; - if (val == 2) { // Apply - *HMI_value.P_Float = HMI_value.Value / POW(10, HMI_value.dp); - if (HMI_value.Apply != nullptr) HMI_value.Apply(); + switch (val) { + case 0: return; + case 1: if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); break; + case 2: *HMI_value.P_Float = HMI_value.Value / POW(10, HMI_value.dp); if (HMI_value.Apply != nullptr) HMI_value.Apply(); break; } - else if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); } // Menu Creation and Drawing functions ====================================================== -void SetMenuTitle(frame_rect_t cn, frame_rect_t en, const __FlashStringHelper* fstr) { +void SetMenuTitle(frame_rect_t cn, const __FlashStringHelper* fstr) { if (HMI_IsChinese() && (cn.w != 0)) CurrentMenu->MenuTitle.SetFrame(cn.x, cn.y, cn.w, cn.h); else @@ -3093,7 +3162,7 @@ void Draw_Prepare_Menu() { if (PrepareMenu == nullptr) PrepareMenu = new MenuClass(); if (CurrentMenu != PrepareMenu) { CurrentMenu = PrepareMenu; - SetMenuTitle({133, 1, 28, 13}, {179, 0, 48, 14}, GET_TEXT_F(MSG_PREPARE)); + SetMenuTitle({133, 1, 28, 13}, GET_TEXT_F(MSG_PREPARE)); DWINUI::MenuItemsPrepare(13); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); #if ENABLED(ADVANCED_PAUSE_FEATURE) @@ -3134,7 +3203,7 @@ void Draw_LevBedCorners_Menu() { if (LevBedMenu == nullptr) LevBedMenu = new MenuClass(); if (CurrentMenu != LevBedMenu) { CurrentMenu = LevBedMenu; - SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_BED_TRAMMING)); // TODO: Chinese, English "Bed Tramming" JPG + SetMenuTitle({0}, GET_TEXT_F(MSG_BED_TRAMMING)); // TODO: Chinese, English "Bed Tramming" JPG DWINUI::MenuItemsPrepare(6); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, LevBedFL); @@ -3151,7 +3220,7 @@ void Draw_Control_Menu() { if (ControlMenu == nullptr) ControlMenu = new MenuClass(); if (CurrentMenu != ControlMenu) { CurrentMenu = ControlMenu; - SetMenuTitle({103, 1, 28, 14}, {128, 2, 49, 11}, GET_TEXT_F(MSG_CONTROL)); + SetMenuTitle({103, 1, 28, 14}, GET_TEXT_F(MSG_CONTROL)); DWINUI::MenuItemsPrepare(9); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); ADDMENUITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawTempSubMenu, Draw_Temperature_Menu); @@ -3173,8 +3242,8 @@ void Draw_AdvancedSettings_Menu() { if (AdvancedSettings == nullptr) AdvancedSettings = new MenuClass(); if (CurrentMenu != AdvancedSettings) { CurrentMenu = AdvancedSettings; - SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG - DWINUI::MenuItemsPrepare(11); + SetMenuTitle({0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG + DWINUI::MenuItemsPrepare(12); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); #if HAS_HOME_OFFSET ADDMENUITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu); @@ -3214,7 +3283,7 @@ void Draw_Move_Menu() { if (MoveMenu == nullptr) MoveMenu = new MenuClass(); if (CurrentMenu != MoveMenu) { CurrentMenu = MoveMenu; - SetMenuTitle({192, 1, 42, 14}, {231, 2, 35, 11}, GET_TEXT_F(MSG_MOVE_AXIS)); + SetMenuTitle({192, 1, 42, 14}, GET_TEXT_F(MSG_MOVE_AXIS)); DWINUI::MenuItemsPrepare(5); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); ADDMENUITEM_P(ICON_MoveX, GET_TEXT_F(MSG_MOVE_X), onDrawMoveX, SetMoveX, ¤t_position.x); @@ -3234,7 +3303,7 @@ void Draw_Move_Menu() { if (HomeOffMenu == nullptr) HomeOffMenu = new MenuClass(); if (CurrentMenu != HomeOffMenu) { CurrentMenu = HomeOffMenu; - SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_SET_HOME_OFFSETS)); // TODO: Chinese, English "Set Home Offsets" JPG + SetMenuTitle({0}, GET_TEXT_F(MSG_SET_HOME_OFFSETS)); // TODO: Chinese, English "Set Home Offsets" JPG DWINUI::MenuItemsPrepare(4); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); ADDMENUITEM_P(ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X), onDrawPFloatMenu, SetHomeOffsetX, &home_offset[X_AXIS]); @@ -3251,7 +3320,7 @@ void Draw_Move_Menu() { if (ProbeSetMenu == nullptr) ProbeSetMenu = new MenuClass(); if (CurrentMenu != ProbeSetMenu) { CurrentMenu = ProbeSetMenu; - SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_ZPROBE_SETTINGS)); // TODO: Chinese, English "Probe Settings" JPG + SetMenuTitle({0}, GET_TEXT_F(MSG_ZPROBE_SETTINGS)); // TODO: Chinese, English "Probe Settings" JPG DWINUI::MenuItemsPrepare(5); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); ADDMENUITEM_P(ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET), onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x); @@ -3295,7 +3364,7 @@ void Draw_SelectColors_Menu() { if (SelectColorMenu == nullptr) SelectColorMenu = new MenuClass(); if (CurrentMenu != SelectColorMenu) { CurrentMenu = SelectColorMenu; - SetMenuTitle({0}, {0}, F("Select Colors")); // TODO: Chinese, English "Select Color" JPG + SetMenuTitle({0}, F("Select Colors")); // TODO: Chinese, English "Select Color" JPG DWINUI::MenuItemsPrepare(20); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); ADDMENUITEM(ICON_StockConfiguration, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawMenuItem, RestoreDefaultsColors); @@ -3326,7 +3395,7 @@ void Draw_GetColor_Menu() { if (GetColorMenu == nullptr) GetColorMenu = new MenuClass(); if (CurrentMenu != GetColorMenu) { CurrentMenu = GetColorMenu; - SetMenuTitle({0}, {0}, F("Get Color")); // TODO: Chinese, English "Get Color" JPG + SetMenuTitle({0}, F("Get Color")); // TODO: Chinese, English "Get Color" JPG DWINUI::MenuItemsPrepare(5); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, DWIN_ApplyColor); ADDMENUITEM(ICON_Cancel, GET_TEXT_F(MSG_BUTTON_CANCEL), onDrawMenuItem, Draw_SelectColors_Menu); @@ -3343,7 +3412,7 @@ void Draw_Tune_Menu() { if (TuneMenu == nullptr) TuneMenu = new MenuClass(); if (CurrentMenu != TuneMenu) { CurrentMenu = TuneMenu; - SetMenuTitle({73, 2, 28, 12}, {94, 2, 33, 11}, GET_TEXT_F(MSG_TUNE)); // TODO: Chinese, English "Tune" JPG + SetMenuTitle({73, 2, 28, 12}, GET_TEXT_F(MSG_TUNE)); // TODO: Chinese, English "Tune" JPG DWINUI::MenuItemsPrepare(10); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_PrintProcess); ADDMENUITEM_P(ICON_Speed, GET_TEXT_F(MSG_SPEED), onDrawSpeedItem, SetSpeed, &feedrate_percentage); @@ -3376,7 +3445,7 @@ void Draw_Motion_Menu() { if (MotionMenu == nullptr) MotionMenu = new MenuClass(); if (CurrentMenu != MotionMenu) { CurrentMenu = MotionMenu; - SetMenuTitle({1, 16, 28, 13}, {144, 16, 46, 11}, GET_TEXT_F(MSG_MOTION)); // TODO: Chinese, English "Motion" JPG + SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MOTION)); // TODO: Chinese, English "Motion" JPG DWINUI::MenuItemsPrepare(6); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); ADDMENUITEM(ICON_MaxSpeed, GET_TEXT_F(MSG_SPEED), onDrawSpeed, Draw_MaxSpeed_Menu); @@ -3396,7 +3465,7 @@ void Draw_Motion_Menu() { if (FilamentMenu == nullptr) FilamentMenu = new MenuClass(); if (CurrentMenu != FilamentMenu) { CurrentMenu = FilamentMenu; - SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_FILAMENT_MAN)); // TODO: Chinese, English "Filament Management" JPG + SetMenuTitle({0}, GET_TEXT_F(MSG_FILAMENT_MAN)); // TODO: Chinese, English "Filament Management" JPG DWINUI::MenuItemsPrepare(5); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); ADDMENUITEM(ICON_Park, GET_TEXT_F(MSG_FILAMENT_PARK_ENABLED), onDrawMenuItem, ParkHead); @@ -3416,8 +3485,8 @@ void Draw_Motion_Menu() { if (ManualMesh == nullptr) ManualMesh = new MenuClass(); if (CurrentMenu != ManualMesh) { CurrentMenu = ManualMesh; - SetMenuTitle({0}, {0}, GET_TEXT_F(MSG_MANUAL_MESH)); // TODO: Chinese, English "Manual Mesh Leveling" JPG - DWINUI::MenuItemsPrepare(5); + SetMenuTitle({0}, GET_TEXT_F(MSG_MANUAL_MESH)); // TODO: Chinese, English "Manual Mesh Leveling" JPG + DWINUI::MenuItemsPrepare(6); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); ADDMENUITEM(ICON_ManualMesh, GET_TEXT_F(MSG_LEVEL_BED), onDrawMenuItem, ManualMeshStart); MMeshMoveZItem = ADDMENUITEM_P(ICON_Zoffset, GET_TEXT_F(MSG_MOVE_Z), onDrawMMeshMoveZ, SetMMeshMoveZ, ¤t_position.z); @@ -3431,11 +3500,11 @@ void Draw_Motion_Menu() { #if HAS_PREHEAT - void Draw_Preheat_Menu(frame_rect_t cn, frame_rect_t en, const __FlashStringHelper* fstr) { + void Draw_Preheat_Menu(frame_rect_t cn, const __FlashStringHelper* fstr) { checkkey = Menu; if (CurrentMenu != PreheatMenu) { CurrentMenu = PreheatMenu; - SetMenuTitle(cn, en, fstr); + SetMenuTitle(cn, fstr); DWINUI::MenuItemsPrepare(5); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Temperature_Menu); #if HAS_HOTEND @@ -3457,13 +3526,13 @@ void Draw_Motion_Menu() { void Draw_Preheat1_Menu() { HMI_value.Preheat = 0; if (PreheatMenu == nullptr) PreheatMenu = new MenuClass(); - Draw_Preheat_Menu({59, 16, 81, 14}, {56, 15, 85, 14}, F(PREHEAT_1_LABEL " Preheat Settings")); // TODO: English "PLA Settings" JPG + Draw_Preheat_Menu({59, 16, 81, 14}, F(PREHEAT_1_LABEL " Preheat Settings")); // TODO: English "PLA Settings" JPG } void Draw_Preheat2_Menu() { HMI_value.Preheat = 1; if (PreheatMenu == nullptr) PreheatMenu = new MenuClass(); - Draw_Preheat_Menu({142, 16, 82, 14}, {56, 15, 85, 14}, F(PREHEAT_2_LABEL " Preheat Settings")); // TODO: English "ABS Settings" JPG + Draw_Preheat_Menu({142, 16, 82, 14}, F(PREHEAT_2_LABEL " Preheat Settings")); // TODO: English "ABS Settings" JPG } #ifdef PREHEAT_3_LABEL @@ -3471,7 +3540,7 @@ void Draw_Motion_Menu() { HMI_value.Preheat = 2; if (PreheatMenu == nullptr) PreheatMenu = new MenuClass(); #define PREHEAT_3_TITLE PREHEAT_3_LABEL " Preheat Set." - Draw_Preheat_Menu({0}, {0}, F(PREHEAT_3_TITLE)); // TODO: Chinese, English "Custom Preheat Settings" JPG + Draw_Preheat_Menu({0}, F(PREHEAT_3_TITLE)); // TODO: Chinese, English "Custom Preheat Settings" JPG } #endif @@ -3482,7 +3551,7 @@ void Draw_Temperature_Menu() { if (TemperatureMenu == nullptr) TemperatureMenu = new MenuClass(); if (CurrentMenu != TemperatureMenu) { CurrentMenu = TemperatureMenu; - SetMenuTitle({236, 2, 28, 12}, {56, 15, 85, 14}, GET_TEXT_F(MSG_TEMPERATURE)); + SetMenuTitle({236, 2, 28, 12}, GET_TEXT_F(MSG_TEMPERATURE)); DWINUI::MenuItemsPrepare(7); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); #if HAS_HOTEND @@ -3510,7 +3579,7 @@ void Draw_MaxSpeed_Menu() { if (MaxSpeedMenu == nullptr) MaxSpeedMenu = new MenuClass(); if (CurrentMenu != MaxSpeedMenu) { CurrentMenu = MaxSpeedMenu; - SetMenuTitle({1, 16, 28, 13}, {144, 16, 46, 11}, GET_TEXT_F(MSG_MAXSPEED)); + SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MAXSPEED)); DWINUI::MenuItemsPrepare(5); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); ADDMENUITEM_P(ICON_MaxSpeedX, GET_TEXT_F(MSG_MAXSPEED_X), onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); @@ -3528,7 +3597,7 @@ void Draw_MaxAccel_Menu() { if (MaxAccelMenu == nullptr) MaxAccelMenu = new MenuClass(); if (CurrentMenu != MaxAccelMenu) { CurrentMenu = MaxAccelMenu; - SetMenuTitle({1, 16, 28, 13}, {144, 16, 46, 11}, GET_TEXT_F(MSG_ACCELERATION)); + SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_ACCELERATION)); DWINUI::MenuItemsPrepare(5); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); ADDMENUITEM_P(ICON_MaxAccX, GET_TEXT_F(MSG_AMAX_A), onDrawMaxAccelX, SetMaxAccelX, &planner.settings.max_acceleration_mm_per_s2[X_AXIS]); @@ -3547,7 +3616,7 @@ void Draw_MaxAccel_Menu() { if (MaxJerkMenu == nullptr) MaxJerkMenu = new MenuClass(); if (CurrentMenu != MaxJerkMenu) { CurrentMenu = MaxJerkMenu; - SetMenuTitle({1, 16, 28, 13}, {144, 16, 46, 11}, GET_TEXT_F(MSG_JERK)); + SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_JERK)); DWINUI::MenuItemsPrepare(5); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); ADDMENUITEM_P(ICON_MaxSpeedJerkX, GET_TEXT_F(MSG_VA_JERK), onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk[X_AXIS]); @@ -3566,7 +3635,7 @@ void Draw_Steps_Menu() { if (StepsMenu == nullptr) StepsMenu = new MenuClass(); if (CurrentMenu != StepsMenu) { CurrentMenu = StepsMenu; - SetMenuTitle({1, 16, 28, 13}, {144, 16, 46, 11}, GET_TEXT_F(MSG_STEPS_PER_MM)); + SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_STEPS_PER_MM)); DWINUI::MenuItemsPrepare(5); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); ADDMENUITEM_P(ICON_StepX, GET_TEXT_F(MSG_A_STEPS), onDrawStepsX, SetStepsX, &planner.settings.axis_steps_per_mm[X_AXIS]); diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.h b/Marlin/src/lcd/e3v2/enhanced/dwin.h index c2220c68a8..05b81c1019 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.h @@ -24,8 +24,8 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.6.3 - * Date: 2021/09/08 + * Version: 3.7.1 + * Date: 2021/11/09 */ #include "../../../inc/MarlinConfigPre.h" @@ -154,6 +154,7 @@ void HMI_SDCardUpdate(); // Other void Goto_PrintProcess(); void Goto_Main_Menu(); +void Goto_InfoMenu(); void Draw_Select_Highlight(const bool sel); void Draw_Status_Area(const bool with_update); // Status Area void Draw_Main_Area(); // Redraw main area; @@ -174,9 +175,7 @@ void EachMomentUpdate(); void update_variable(); void DWIN_HandleScreen(); void DWIN_Update(); -void DWIN_DrawStatusLine(const uint16_t color, const uint16_t bgcolor, const char *text=nullptr); -void DWIN_StatusChanged(const char * const cstr=nullptr); -void DWIN_StatusChanged(FSTR_P const fstr); +void DWIN_CheckStatusMessage(); void DWIN_StartHoming(); void DWIN_CompletedHoming(); #if HAS_MESH diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp index 93477be0b8..681b318a15 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp @@ -23,8 +23,8 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.6.3 - * Date: 2021/09/08 + * Version: 3.7.1 + * Date: 2021/11/09 */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h b/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h index c49f23af45..43cb098b91 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h @@ -24,8 +24,8 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.6.3 - * Date: 2021/09/08 + * Version: 3.7.1 + * Date: 2021/11/09 */ #include "../common/dwin_api.h" @@ -48,13 +48,6 @@ inline void DWIN_Draw_QR(uint8_t QR_Pixel, uint16_t x, uint16_t y, FSTR_P title) // x/y: Screen paste point void DWIN_Frame_AreaCopy(uint8_t cacheID, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd, uint16_t x, uint16_t y); -// Copy area from virtual display area to current screen -// cacheID: virtual area number -// xStart/yStart: Upper-left of virtual area -// xEnd/yEnd: Lower-right of virtual area -// x/y: Screen paste point -void DWIN_Frame_AreaCopy(uint8_t cacheID, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd, uint16_t x, uint16_t y); - // Copy area from current virtual display area to current screen // xStart/yStart: Upper-left of virtual area // xEnd/yEnd: Lower-right of virtual area diff --git a/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp b/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp index 6c46eb31f1..824aca07f8 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp @@ -23,8 +23,8 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.6.3 - * Date: 2021/09/08 + * Version: 3.7.1 + * Date: 2021/11/09 */ #include "../../../inc/MarlinConfigPre.h" @@ -38,8 +38,8 @@ //#define DEBUG_OUT 1 #include "../../../core/debug_out.h" -uint8_t MenuItemTotal = 0; -uint8_t MenuItemCount = 0; +int8_t MenuItemTotal = 0; +int8_t MenuItemCount = 0; MenuItemClass** MenuItems = nullptr; MenuClass *CurrentMenu = nullptr; MenuClass *PreviousMenu = nullptr; @@ -50,8 +50,8 @@ uint16_t DWINUI::textcolor = Def_Text_Color; uint16_t DWINUI::backcolor = Def_Background_Color; uint8_t DWINUI::font = font8x16; -void (*DWINUI::onCursorErase)(uint8_t line)=nullptr; -void (*DWINUI::onCursorDraw)(uint8_t line)=nullptr; +void (*DWINUI::onCursorErase)(const int8_t line)=nullptr; +void (*DWINUI::onCursorDraw)(const int8_t line)=nullptr; void (*DWINUI::onTitleDraw)(TitleClass* title)=nullptr; void (*DWINUI::onMenuDraw)(MenuClass* menu)=nullptr; @@ -304,14 +304,14 @@ void DWINUI::ClearMenuArea() { void DWINUI::MenuItemsClear() { if (MenuItems == nullptr) return; - for (uint8_t i = 0; i < MenuItemCount; i++) delete MenuItems[i]; + for (int8_t i = 0; i < MenuItemCount; i++) delete MenuItems[i]; delete[] MenuItems; MenuItems = nullptr; MenuItemCount = 0; MenuItemTotal = 0; } -void DWINUI::MenuItemsPrepare(uint8_t totalitems) { +void DWINUI::MenuItemsPrepare(int8_t totalitems) { MenuItemsClear(); MenuItemTotal = totalitems; MenuItems = new MenuItemClass*[totalitems]; @@ -379,7 +379,7 @@ MenuClass::MenuClass() { void MenuClass::draw() { MenuTitle.draw(); if (DWINUI::onMenuDraw != nullptr) (*DWINUI::onMenuDraw)(this); - for (uint8_t i = 0; i < MenuItemCount; i++) + for (int8_t i = 0; i < MenuItemCount; i++) MenuItems[i]->draw(i - topline); if (DWINUI::onCursorDraw != nullptr) DWINUI::onCursorDraw(line()); DWIN_UpdateLCD(); diff --git a/Marlin/src/lcd/e3v2/enhanced/dwinui.h b/Marlin/src/lcd/e3v2/enhanced/dwinui.h index 8cbb66fdf0..078b3cc58b 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwinui.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwinui.h @@ -24,11 +24,10 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.6.3 - * Date: 2021/09/08 + * Version: 3.7.1 + * Date: 2021/11/09 */ -#include "../../../core/types.h" #include "dwin_lcd.h" #include "../common/dwin_set.h" #include "../common/dwin_font.h" @@ -138,7 +137,7 @@ extern TitleClass Title; class MenuItemClass { protected: public: - uint8_t pos = 0; + int8_t pos = 0; uint8_t icon = 0; char caption[32] = ""; uint8_t frameid = 0; @@ -185,8 +184,8 @@ namespace DWINUI { extern uint16_t backcolor; extern uint8_t font; - extern void (*onCursorErase)(uint8_t line); - extern void (*onCursorDraw)(uint8_t line); + extern void (*onCursorErase)(const int8_t line); + extern void (*onCursorDraw)(const int8_t line); extern void (*onTitleDraw)(TitleClass* title); extern void (*onMenuDraw)(MenuClass* menu); @@ -342,6 +341,12 @@ namespace DWINUI { // rlimit: For draw less chars than string length use rlimit void Draw_String(const char * const string, uint16_t rlimit = 0xFFFF); void Draw_String(uint16_t color, const char * const string, uint16_t rlimit = 0xFFFF); + inline void Draw_String(FSTR_P string, uint16_t rlimit = 0xFFFF) { + Draw_String(FTOP(string), rlimit); + } + inline void Draw_String(uint16_t color, FSTR_P string, uint16_t rlimit = 0xFFFF) { + Draw_String(color, FTOP(string), rlimit); + } // Draw a string // size: Font size @@ -353,25 +358,25 @@ namespace DWINUI { DWIN_Draw_String(false, font, textcolor, backcolor, x, y, string); } inline void Draw_String(uint16_t x, uint16_t y, FSTR_P title) { - DWIN_Draw_String(false, font, textcolor, backcolor, x, y, (char *)title); + DWIN_Draw_String(false, font, textcolor, backcolor, x, y, FTOP(title)); } inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, const char * const string) { DWIN_Draw_String(false, font, color, backcolor, x, y, string); } inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, FSTR_P title) { - DWIN_Draw_String(false, font, color, backcolor, x, y, (char *)title); + DWIN_Draw_String(false, font, color, backcolor, x, y, title); } inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) { DWIN_Draw_String(true, font, color, bgcolor, x, y, string); } inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) { - DWIN_Draw_String(true, font, color, bgcolor, x, y, (char *)title); + DWIN_Draw_String(true, font, color, bgcolor, x, y, title); } inline void Draw_String(uint8_t size, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) { DWIN_Draw_String(true, size, color, bgcolor, x, y, string); } inline void Draw_String(uint8_t size, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) { - DWIN_Draw_String(true, size, color, bgcolor, x, y, (char *)title); + DWIN_Draw_String(true, size, color, bgcolor, x, y, title); } // Draw a centered string using DWIN_WIDTH @@ -382,8 +387,8 @@ namespace DWINUI { // y: Upper coordinate of the string // *string: The string void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, const char * const string); - inline void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, FSTR_P title) { - Draw_CenteredString(bShow, size, color, bColor, y, (char *)title); + inline void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, FSTR_P string) { + Draw_CenteredString(bShow, size, color, bColor, y, FTOP(string)); } inline void Draw_CenteredString(uint16_t color, uint16_t bcolor, uint16_t y, const char * const string) { Draw_CenteredString(true, font, color, bcolor, y, string); @@ -392,19 +397,19 @@ namespace DWINUI { Draw_CenteredString(false, size, color, backcolor, y, string); } inline void Draw_CenteredString(uint8_t size, uint16_t color, uint16_t y, FSTR_P title) { - Draw_CenteredString(false, size, color, backcolor, y, (char *)title); + Draw_CenteredString(false, size, color, backcolor, y, title); } inline void Draw_CenteredString(uint16_t color, uint16_t y, const char * const string) { Draw_CenteredString(false, font, color, backcolor, y, string); } inline void Draw_CenteredString(uint16_t color, uint16_t y, FSTR_P title) { - Draw_CenteredString(false, font, color, backcolor, y, (char *)title); + Draw_CenteredString(false, font, color, backcolor, y, title); } inline void Draw_CenteredString(uint16_t y, const char * const string) { Draw_CenteredString(false, font, textcolor, backcolor, y, string); } inline void Draw_CenteredString(uint16_t y, FSTR_P title) { - Draw_CenteredString(false, font, textcolor, backcolor, y, (char *)title); + Draw_CenteredString(false, font, textcolor, backcolor, y, title); } // Draw a circle @@ -477,7 +482,7 @@ namespace DWINUI { void MenuItemsClear(); // Prepare MenuItems array - void MenuItemsPrepare(uint8_t totalitems); + void MenuItemsPrepare(int8_t totalitems); // Add elements to the MenuItems array MenuItemClass* MenuItemsAdd(MenuItemClass* menuitem); diff --git a/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp b/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp index 8d6b5fa2c0..3824d63b2b 100644 --- a/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp @@ -1,8 +1,8 @@ /** * DWIN Mesh Viewer * Author: Miguel A. Risco-Castillo - * version: 2.5 - * Date: 2021/09/27 + * version: 3.8.1 + * Date: 2021/11/06 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -35,13 +35,15 @@ MeshViewerClass MeshViewer; void MeshViewerClass::Draw() { - const int8_t mx = 30, my = 30; // Margins + const int8_t mx = 25, my = 25; // Margins const int16_t stx = (DWIN_WIDTH - 2 * mx) / (GRID_MAX_POINTS_X - 1), // Steps sty = (DWIN_WIDTH - 2 * my) / (GRID_MAX_POINTS_Y - 1); - int8_t zmesh[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], maxz =-127, minz = 127; + const int8_t rmax = _MIN(mx - 2, stx / 2); + const int8_t rmin = 7; + int16_t zmesh[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], maxz =-32000, minz = 32000; #define px(xp) (mx + (xp) * stx) #define py(yp) (30 + DWIN_WIDTH - my - (yp) * sty) - #define rm(z) ((((z) - minz) * 10 / _MAX(1, (maxz - minz))) + 10) + #define rm(z) ((z - minz) * (rmax - rmin) / _MAX(1, (maxz - minz)) + rmin) #define DrawMeshValue(xp, yp, zv) DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(xp) - 12, py(yp) - 6, zv) #define DrawMeshHLine(yp) DWIN_Draw_HLine(HMI_data.SplitLine_Color, px(0), py(yp), DWIN_WIDTH - 2 * mx) #define DrawMeshVLine(xp) DWIN_Draw_VLine(HMI_data.SplitLine_Color, px(xp), py(GRID_MAX_POINTS_Y - 1), DWIN_WIDTH - 2 * my) @@ -61,8 +63,33 @@ void MeshViewerClass::Draw() { watchdog_refresh(); LOOP_L_N(x, GRID_MAX_POINTS_X) { uint16_t color = DWINUI::RainbowInt(zmesh[x][y], _MIN(-5, minz), _MAX(5, maxz)); - DWINUI::Draw_FillCircle(color, px(x), py(y), rm(zmesh[x][y])); - DrawMeshValue(x, y, Z_VALUES(x,y)); + uint8_t radius = rm(zmesh[x][y]); + DWINUI::Draw_FillCircle(color, px(x), py(y), radius); + if (GRID_MAX_POINTS_X < 9) + DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(x) - 12, py(y) - 6, Z_VALUES(x,y)); + else { + char str_1[9]; + str_1[0] = 0; + switch (zmesh[x][y]) { + case -999 ... -100: + DWINUI::Draw_Signed_Float(font6x12, 1, 1, px(x) - 12, py(y) - 6, Z_VALUES(x,y)); + break; + case -99 ... -1: + sprintf_P(str_1, PSTR("-.%02i"), -zmesh[x][y]); + break; + case 0: + DWIN_Draw_String(false, font6x12, DWINUI::textcolor, DWINUI::backcolor, px(x) - 4, py(y) - 6, "0");; + break; + case 1 ... 99: + sprintf_P(str_1, PSTR(".%02i"), zmesh[x][y]); + break; + case 100 ... 999: + DWINUI::Draw_Signed_Float(font6x12, 1, 1, px(x) - 12, py(y) - 6, Z_VALUES(x,y)); + break; + } + if (str_1[0]) + DWIN_Draw_String(false, font6x12, DWINUI::textcolor, DWINUI::backcolor, px(x) - 12, py(y) - 6, str_1); + } } } char str_1[6], str_2[6] = ""; diff --git a/Marlin/src/lcd/e3v2/enhanced/meshviewer.h b/Marlin/src/lcd/e3v2/enhanced/meshviewer.h index 4f7a6ae1d2..0ba6ae2d7d 100644 --- a/Marlin/src/lcd/e3v2/enhanced/meshviewer.h +++ b/Marlin/src/lcd/e3v2/enhanced/meshviewer.h @@ -1,8 +1,8 @@ /** * DWIN Mesh Viewer * Author: Miguel A. Risco-Castillo - * version: 2.5 - * Date: 2021/09/27 + * Version: 3.8.1 + * Date: 2021/11/06 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 80ef88d0b2..4c838a2e21 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -678,31 +678,31 @@ void CrealityDWINClass::Draw_Print_Filename(const bool reset/*=false*/) { static uint8_t namescrl = 0; if (reset) namescrl = 0; if (process == Print) { - size_t len = strlen(filename); - int8_t pos = len; - if (pos > 30) { - pos -= namescrl; - len = _MIN(pos, 30); - char dispname[len + 1]; + constexpr int8_t maxlen = 30; + char *outstr = filename; + size_t slen = strlen(filename); + int8_t outlen = slen; + if (slen > maxlen) { + char dispname[maxlen + 1]; + int8_t pos = slen - namescrl, len = maxlen; if (pos >= 0) { + NOMORE(len, pos); LOOP_L_N(i, len) dispname[i] = filename[i + namescrl]; } else { - LOOP_L_N(i, 30 + pos) dispname[i] = ' '; - LOOP_S_L_N(i, 30 + pos, 30) dispname[i] = filename[i - (30 + pos)]; + const int8_t mp = maxlen + pos; + LOOP_L_N(i, mp) dispname[i] = ' '; + LOOP_S_L_N(i, mp, maxlen) dispname[i] = filename[i - mp]; + if (mp <= 0) namescrl = 0; } dispname[len] = '\0'; - DWIN_Draw_Rectangle(1, Color_Bg_Black, 8, 50, DWIN_WIDTH - 8, 80); - const int8_t npos = (DWIN_WIDTH - 30 * MENU_CHR_W) / 2; - DWIN_Draw_String(false, DWIN_FONT_MENU, Color_White, Color_Bg_Black, npos, 60, dispname); - if (-pos >= 30) namescrl = 0; + outstr = dispname; + outlen = maxlen; namescrl++; } - else { - DWIN_Draw_Rectangle(1, Color_Bg_Black, 8, 50, DWIN_WIDTH - 8, 80); - const int8_t npos = (DWIN_WIDTH - strlen(filename) * MENU_CHR_W) / 2; - DWIN_Draw_String(false, DWIN_FONT_MENU, Color_White, Color_Bg_Black, npos, 60, filename); - } + DWIN_Draw_Rectangle(1, Color_Bg_Black, 8, 50, DWIN_WIDTH - 8, 80); + const int8_t npos = (DWIN_WIDTH - outlen * MENU_CHR_W) / 2; + DWIN_Draw_String(false, DWIN_FONT_MENU, Color_White, Color_Bg_Black, npos, 60, outstr); } } @@ -4702,7 +4702,7 @@ void CrealityDWINClass::Update_Status(const char * const text) { char header[4]; LOOP_L_N(i, 3) header[i] = text[i]; header[3] = '\0'; - if (strcmp_P(header,"") == 0) { + if (strcmp_P(header, PSTR("")) == 0) { LOOP_L_N(i, _MIN((size_t)LONG_FILENAME_LENGTH, strlen(text))) filename[i] = text[i + 3]; filename[_MIN((size_t)LONG_FILENAME_LENGTH - 1, strlen(text))] = '\0'; Draw_Print_Filename(true); @@ -4798,22 +4798,23 @@ void CrealityDWINClass::State_Update() { } void CrealityDWINClass::Screen_Update() { + const millis_t ms = millis(); static millis_t scrltime = 0; - if (ELAPSED(millis(), scrltime)) { - scrltime = millis() + 200; + if (ELAPSED(ms, scrltime)) { + scrltime = ms + 200; Update_Status_Bar(); if (process == Print) Draw_Print_Filename(); } static millis_t statustime = 0; - if (ELAPSED(millis(), statustime)) { - statustime = millis() + 500; + if (ELAPSED(ms, statustime)) { + statustime = ms + 500; Draw_Status_Area(); } static millis_t printtime = 0; - if (ELAPSED(millis(), printtime)) { - printtime = millis() + 1000; + if (ELAPSED(ms, printtime)) { + printtime = ms + 1000; if (process == Print) { Draw_Print_ProgressBar(); Draw_Print_ProgressElapsed(); @@ -5000,6 +5001,7 @@ void MarlinUI::init() { void MarlinUI::pause_show_message(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) { switch (message) { case PAUSE_MESSAGE_INSERT: CrealityDWIN.Confirm_Handler(FilInsert); break; + case PAUSE_MESSAGE_PURGE: case PAUSE_MESSAGE_OPTION: CrealityDWIN.Popup_Handler(PurgeMore); break; case PAUSE_MESSAGE_HEAT: CrealityDWIN.Confirm_Handler(HeaterTime); break; case PAUSE_MESSAGE_WAITING: CrealityDWIN.Draw_Print_Screen(); break; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 9bae2b95d3..17e7a38445 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -409,7 +409,7 @@ void DGUSScreenHandler::SetStatusMessage(const char* msg, const millis_t duratio } void DGUSScreenHandler::SetStatusMessage(FSTR_P const fmsg, const millis_t duration) { - dgus_display.WriteStringPGM((uint16_t)DGUS_Addr::MESSAGE_Status, FTOP(msg), DGUS_STATUS_LEN, false, true); + dgus_display.WriteStringPGM((uint16_t)DGUS_Addr::MESSAGE_Status, FTOP(fmsg), DGUS_STATUS_LEN, false, true); status_expire = (duration > 0 ? ExtUI::safe_millis() + duration : 0); } diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 9a92a7e268..ecd5ef5660 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -531,6 +531,7 @@ namespace Language_en { LSTR MSG_ERR_MINTEMP = _UxGT("Err: MINTEMP"); LSTR MSG_HALTED = _UxGT("PRINTER HALTED"); LSTR MSG_PLEASE_RESET = _UxGT("Please Reset"); + LSTR MSG_PREHEATING = _UxGT("Preheating..."); LSTR MSG_HEATING = _UxGT("Heating..."); LSTR MSG_COOLING = _UxGT("Cooling..."); LSTR MSG_BED_HEATING = _UxGT("Bed Heating..."); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 925e1c1618..57157d2c00 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -49,6 +49,7 @@ MarlinUI ui; #if ENABLED(DWIN_CREALITY_LCD) #include "e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #include "fontutils.h" #include "e3v2/enhanced/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "e3v2/jyersui/dwin.h" @@ -69,7 +70,7 @@ MarlinUI ui; constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #if HAS_STATUS_MESSAGE - #if BOTH(HAS_WIRED_LCD, STATUS_MESSAGE_SCROLLING) + #if ENABLED(STATUS_MESSAGE_SCROLLING) && EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_ENHANCED) uint8_t MarlinUI::status_scroll_offset; // = 0 #endif char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1]; @@ -1481,11 +1482,9 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; void MarlinUI::finish_status(const bool persist) { - #if HAS_WIRED_LCD + UNUSED(persist); - #if !(BASIC_PROGRESS_BAR && (PROGRESS_MSG_EXPIRE) > 0) - UNUSED(persist); - #endif + #if HAS_WIRED_LCD #if BASIC_PROGRESS_BAR || BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) const millis_t ms = millis(); @@ -1502,13 +1501,15 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; next_filament_display = ms + 5000UL; // Show status message for 5s #endif - TERN_(STATUS_MESSAGE_SCROLLING, status_scroll_offset = 0); - #else // HAS_WIRED_LCD - UNUSED(persist); + #endif + + #if ENABLED(STATUS_MESSAGE_SCROLLING) && EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_ENHANCED) + status_scroll_offset = 0; #endif TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message)); - TERN_(HAS_DWIN_E3V2_BASIC, DWIN_StatusChanged(status_message)); + TERN_(DWIN_CREALITY_LCD, DWIN_StatusChanged(status_message)); + TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_CheckStatusMessage()); TERN_(DWIN_CREALITY_LCD_JYERSUI, CrealityDWIN.Update_Status(status_message)); } diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 4f797d899d..ed5b539eaf 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -356,6 +356,9 @@ public: #if EITHER(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED) static void kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component); + #if DISABLED(LIGHTWEIGHT_UI) + static void draw_status_message(const bool blink); + #endif #else static inline void kill_screen(FSTR_P const, FSTR_P const) {} #endif @@ -444,10 +447,6 @@ public: static inline void completion_feedback(const bool=true) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); } #endif - #if DISABLED(LIGHTWEIGHT_UI) - static void draw_status_message(const bool blink); - #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) static void draw_hotend_status(const uint8_t row, const uint8_t extruder); #endif diff --git a/Marlin/src/libs/MAX31865.cpp b/Marlin/src/libs/MAX31865.cpp index df0702b9fb..94048af208 100644 --- a/Marlin/src/libs/MAX31865.cpp +++ b/Marlin/src/libs/MAX31865.cpp @@ -48,20 +48,17 @@ #if HAS_MAX31865 && !USE_ADAFRUIT_MAX31865 -//#include // TODO: switch to SPIclass/SoftSPI #include "MAX31865.h" +#ifdef TARGET_LPC1768 + #include +#endif + // The maximum speed the MAX31865 can do is 5 MHz SPISettings MAX31865::spiConfig = SPISettings( - #if defined(TARGET_LPC1768) - SPI_QUARTER_SPEED - #elif defined(ARDUINO_ARCH_STM32) - SPI_CLOCK_DIV4 - #else - 500000 - #endif - , MSBFIRST - , SPI_MODE_1 // CPOL0 CPHA1 + TERN(TARGET_LPC1768, SPI_QUARTER_SPEED, TERN(ARDUINO_ARCH_STM32, SPI_CLOCK_DIV4, 500000)), + MSBFIRST, + SPI_MODE1 // CPOL0 CPHA1 ); #ifndef LARGE_PINMAP @@ -93,7 +90,7 @@ SPISettings MAX31865::spiConfig = SPISettings( _sclk = _miso = _mosi = -1; } -#else +#else // LARGE_PINMAP /** * Create the interface object using software (bitbang) SPI for PIN values @@ -106,9 +103,7 @@ SPISettings MAX31865::spiConfig = SPISettings( * @param spi_clk the SPI clock pin to use * @param pin_mapping set to 1 for positive pin values */ - MAX31865::MAX31865(uint32_t spi_cs, uint32_t spi_mosi, - uint32_t spi_miso, uint32_t spi_clk, - uint8_t pin_mapping) { + MAX31865::MAX31865(uint32_t spi_cs, uint32_t spi_mosi, uint32_t spi_miso, uint32_t spi_clk, uint8_t pin_mapping) { _cs = spi_cs; _mosi = spi_mosi; _miso = spi_miso; @@ -130,14 +125,12 @@ SPISettings MAX31865::spiConfig = SPISettings( #endif // LARGE_PINMAP - /** * * Instance & Class methods * */ - /** * Initialize the SPI interface and set the number of RTD wires used * @@ -152,22 +145,13 @@ void MAX31865::begin(max31865_numwires_t wires, float zero, float ref) { OUT_WRITE(_cs, HIGH); if (_sclk != TERN(LARGE_PINMAP, -1UL, -1)) { - // Define pin modes for Software SPI - #ifdef MAX31865_DEBUG - SERIAL_ECHOLN("Initializing MAX31865 Software SPI"); - #endif - - OUT_WRITE(_sclk, LOW); - SET_OUTPUT(_mosi); - SET_INPUT(_miso); + softSpiBegin(SPI_QUARTER_SPEED); // Define pin modes for Software SPI } else { - // Start and configure hardware SPI #ifdef MAX31865_DEBUG - SERIAL_ECHOLN("Initializing MAX31865 Hardware SPI"); + SERIAL_ECHOLNPGM("Initializing MAX31865 Hardware SPI"); #endif - - SPI.begin(); + SPI.begin(); // Start and configure hardware SPI } setWires(wires); @@ -176,25 +160,15 @@ void MAX31865::begin(max31865_numwires_t wires, float zero, float ref) { clearFault(); #ifdef MAX31865_DEBUG_SPI - #ifndef LARGE_PINMAP - SERIAL_ECHOLNPGM( - "Regular begin call with _cs: ", _cs, - " _miso: ", _miso, - " _sclk: ", _sclk, - " _mosi: ", _mosi - ); - #else - SERIAL_ECHOLNPGM( - "LARGE_PINMAP begin call with _cs: ", _cs, - " _miso: ", _miso, - " _sclk: ", _sclk, - " _mosi: ", _mosi - ); - #endif // LARGE_PINMAP - - SERIAL_ECHOLNPGM("config: ", readRegister8(MAX31856_CONFIG_REG)); - SERIAL_EOL(); - #endif // MAX31865_DEBUG_SPI + SERIAL_ECHOLNPGM( + TERN(LARGE_PINMAP, "LARGE_PINMAP", "Regular") + " begin call with _cs: ", _cs, + " _miso: ", _miso, + " _sclk: ", _sclk, + " _mosi: ", _mosi, + " config: ", readRegister8(MAX31856_CONFIG_REG) + ); + #endif } /** @@ -371,7 +345,6 @@ float MAX31865::temperature(float Rrtd) { // private: // - /** * Set a value in the configuration register. * @@ -432,10 +405,15 @@ void MAX31865::readRegisterN(uint8_t addr, uint8_t buffer[], uint8_t n) { WRITE(_sclk, LOW); WRITE(_cs, LOW); - spixfer(addr); + + #ifdef TARGET_LPC1768 + DELAY_CYCLES(_spi_speed); + #endif + + spiTransfer(addr); while (n--) { - buffer[0] = spixfer(0xFF); + buffer[0] = spiTransfer(0xFF); #ifdef MAX31865_DEBUG_SPI SERIAL_ECHOLNPGM("buffer read ", n, " data: ", buffer[0]); #endif @@ -462,8 +440,12 @@ void MAX31865::writeRegister8(uint8_t addr, uint8_t data) { WRITE(_cs, LOW); - spixfer(addr | 0x80); // make sure top bit is set - spixfer(data); + #ifdef TARGET_LPC1768 + DELAY_CYCLES(_spi_speed); + #endif + + spiTransfer(addr | 0x80); // make sure top bit is set + spiTransfer(data); if (_sclk == TERN(LARGE_PINMAP, -1UL, -1)) SPI.endTransaction(); @@ -480,21 +462,38 @@ void MAX31865::writeRegister8(uint8_t addr, uint8_t data) { * @param x an 8-bit chunk of data to write * @return the 8-bit response */ -uint8_t MAX31865::spixfer(uint8_t x) { +uint8_t MAX31865::spiTransfer(uint8_t x) { if (_sclk == TERN(LARGE_PINMAP, -1UL, -1)) return SPI.transfer(x); - uint8_t reply = 0; - for (int i = 7; i >= 0; i--) { - reply <<= 1; - WRITE(_sclk, HIGH); - WRITE(_mosi, x & (1 << i)); - WRITE(_sclk, LOW); - if (READ(_miso)) - reply |= 1; - } + #ifdef TARGET_LPC1768 + return swSpiTransfer(x, _spi_speed, _sclk, _miso, _mosi); + #else + uint8_t reply = 0; + for (int i = 7; i >= 0; i--) { + WRITE(_sclk, HIGH); DELAY_NS_VAR(_spi_delay); + reply <<= 1; + WRITE(_mosi, x & _BV(i)); DELAY_NS_VAR(_spi_delay); + if (READ(_miso)) reply |= 1; + WRITE(_sclk, LOW); DELAY_NS_VAR(_spi_delay); + } + return reply; + #endif +} - return reply; +void MAX31865::softSpiBegin(const uint8_t spi_speed) { + #ifdef MAX31865_DEBUG + SERIAL_ECHOLNPGM("Initializing MAX31865 Software SPI"); + #endif + #ifdef TARGET_LPC1768 + swSpiBegin(_sclk, _miso, _mosi); + _spi_speed = swSpiInit(spi_speed, _sclk, _mosi); + #else + _spi_delay = (100UL << spi_speed) / 3; // Calculate delay in ns. Top speed is ~10MHz, or 100ns delay between bits. + OUT_WRITE(_sclk, LOW); + SET_OUTPUT(_mosi); + SET_INPUT(_miso); + #endif } #endif // HAS_MAX31865 && !USE_ADAFRUIT_MAX31865 diff --git a/Marlin/src/libs/MAX31865.h b/Marlin/src/libs/MAX31865.h index 5d50e870ec..7610924c23 100644 --- a/Marlin/src/libs/MAX31865.h +++ b/Marlin/src/libs/MAX31865.h @@ -90,6 +90,13 @@ private: static SPISettings spiConfig; TERN(LARGE_PINMAP, uint32_t, uint8_t) _sclk, _miso, _mosi, _cs; + + #ifdef TARGET_LPC1768 + uint8_t _spi_speed; + #else + uint16_t _spi_delay; + #endif + float Rzero, Rref; void setConfig(uint8_t config, bool enable); @@ -99,7 +106,9 @@ private: uint16_t readRegister16(uint8_t addr); void writeRegister8(uint8_t addr, uint8_t reg); - uint8_t spixfer(uint8_t addr); + uint8_t spiTransfer(uint8_t addr); + + void softSpiBegin(const uint8_t spi_speed); public: #ifdef LARGE_PINMAP diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 04f20ca3a4..aa5907477e 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -392,6 +392,9 @@ void Endstops::not_homing() { #if HAS_BED_PROBE void Endstops::enable_z_probe(const bool onoff) { z_probe_enabled = onoff; + #if PIN_EXISTS(PROBE_ENABLE) + WRITE(PROBE_ENABLE_PIN, onoff); + #endif resync(); } #endif diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index d9e52a9b43..984a3aabb5 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -362,6 +362,8 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { #define WAIT_FOR_BED_HEAT #endif + LCD_MESSAGE(MSG_PREHEATING); + DEBUG_ECHOPGM("Preheating "); #if ENABLED(WAIT_FOR_NOZZLE_HEAT) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 01a5c47fd5..0cb29f29e0 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -3044,8 +3044,6 @@ void MarlinSettings::reset() { postprocess(); DEBUG_ECHO_MSG("Hardcoded Default Settings Loaded"); - - TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset()); } #if DISABLED(DISABLE_M503) @@ -3068,9 +3066,9 @@ void MarlinSettings::reset() { // CONFIG_ECHO_HEADING("Linear Units"); #if ENABLED(INCH_MODE_SUPPORT) - SERIAL_ECHOPGM(" G2", AS_DIGIT(parser.linear_unit_factor == 1.0), " ;"); + SERIAL_ECHO_MSG(" G2", AS_DIGIT(parser.linear_unit_factor == 1.0), " ;"); #else - SERIAL_ECHOPGM(" G21 ;"); + SERIAL_ECHO_MSG(" G21 ;"); #endif gcode.say_units(); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index cef348c5f9..48941532c8 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -3731,8 +3731,9 @@ void Temperature::isr() { HMI_flag.heat_flag = 0; duration_t elapsed = print_job_timer.duration(); // print timer dwin_heat_time = elapsed.value; + #else + ui.reset_status(); #endif - ui.reset_status(); TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onHeatingDone()); return true; } diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 369a78be7a..57648b3e16 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -616,7 +616,7 @@ #elif MB(BTT_GTR_V1_0) #include "stm32f4/pins_BTT_GTR_V1_0.h" // STM32F4 env:BIGTREE_GTR_V1_0 env:BIGTREE_GTR_V1_0_usb_flash_drive #elif MB(BTT_BTT002_V1_0) - #include "stm32f4/pins_BTT_BTT002_V1_0.h" // STM32F4 env:BIGTREE_BTT002 + #include "stm32f4/pins_BTT_BTT002_V1_0.h" // STM32F4 env:BIGTREE_BTT002 env:BIGTREE_BTT002_VET6 #elif MB(BTT_E3_RRF) #include "stm32f4/pins_BTT_E3_RRF.h" // STM32F4 env:BIGTREE_E3_RRF #elif MB(BTT_SKR_V2_0_REV_A) diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index 05756d6004..dc0d5225db 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -1439,6 +1439,15 @@ #if PIN_EXISTS(Z_MIN_PROBE) REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PROBE_PIN) #endif +#if PIN_EXISTS(PROBE_ACTIVATION_SWITCH) + REPORT_NAME_DIGITAL(__LINE__, PROBE_ACTIVATION_SWITCH_PIN) +#endif +#if PIN_EXISTS(PROBE_ENABLE) + REPORT_NAME_DIGITAL(__LINE__, PROBE_ENABLE_PIN) +#endif +#if PIN_EXISTS(PROBE_TARE) + REPORT_NAME_DIGITAL(__LINE__, PROBE_TARE_PIN) +#endif #if PIN_EXISTS(I_ATT) REPORT_NAME_DIGITAL(__LINE__, I_ATT_PIN) #endif diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h index 8bae916a46..8368fd03cd 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h @@ -71,7 +71,9 @@ // Probe // #define PROBE_TARE_PIN PA1 -#define PROBE_ACTIVATION_SWITCH_PIN PC2 // Optoswitch to Enable Z Probe +#if ENABLED(PROBE_ACTIVATION_SWITCH) + #define PROBE_ACTIVATION_SWITCH_PIN PC2 // Optoswitch to Enable Z Probe +#endif // // Steppers diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h index a2add81c8b..7d3140056a 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h @@ -34,6 +34,9 @@ #define HEATER_0_PIN PA1 // HEATER1 #define HEATER_BED_PIN PA2 // HOT BED #define FAN_PIN PA0 // FAN -#define PROBE_ACTIVATION_SWITCH_PIN PC6 // Optoswitch to Enable Z Probe + +#if ENABLED(PROBE_ACTIVATION_SWITCH) + #define PROBE_ACTIVATION_SWITCH_PIN PC6 // Optoswitch to Enable Z Probe +#endif #include "pins_CREALITY_V45x.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h index 7b8c3280d2..b669887d1e 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h @@ -34,6 +34,9 @@ #define HEATER_0_PIN PB14 // HEATER1 #define HEATER_BED_PIN PB13 // HOT BED #define FAN_PIN PB15 // FAN -#define PROBE_ACTIVATION_SWITCH_PIN PB2 // Optoswitch to Enable Z Probe + +#if ENABLED(PROBE_ACTIVATION_SWITCH) + #define PROBE_ACTIVATION_SWITCH_PIN PB2 // Optoswitch to Enable Z Probe +#endif #include "pins_CREALITY_V45x.h" diff --git a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h index 7ce21a20af..fea5b00b50 100644 --- a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h @@ -54,7 +54,7 @@ // // Limit Switches -// +// #define X_STOP_PIN PD8 #define Y_STOP_PIN PD15 #define Z_MIN_PIN PA11 @@ -173,7 +173,7 @@ #define LCD_PINS_D5 PE7 #define LCD_PINS_D6 PB2 #define LCD_PINS_D7 PB1 - + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder #endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h index b7ffcce4a8..7b99352ef4 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -29,6 +29,8 @@ #define BOARD_INFO_NAME "BTT BTT002 V1.0" +//#define MK3_FAN_PINS + #define USES_DIAG_PINS // Ignore temp readings during development. @@ -169,8 +171,22 @@ // #define HEATER_0_PIN PE6 // Heater0 #define HEATER_BED_PIN PE5 // Hotbed -#define FAN_PIN PB8 // Fan1 -#define FAN1_PIN PB9 // Fan0 + +#ifndef FAN_PIN + #ifdef MK3_FAN_PINS + #define FAN_PIN PB8 // Fan1 + #else + #define FAN_PIN PB9 // Fan0 + #endif +#endif + +#ifndef FAN1_PIN + #ifdef MK3_FAN_PINS + #define FAN1_PIN PB9 // Fan0 + #else + #define FAN1_PIN PB8 // Fan1 + #endif +#endif /** * -----------------------------------BTT002 V1.0---------------------------------------- diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h index 9a280eac16..762e355626 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h @@ -132,6 +132,13 @@ #define Z_MIN_PROBE_PIN PE4 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h index a604a71c4b..054da62754 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h @@ -38,9 +38,9 @@ #define FLASH_EEPROM_EMULATION #define FLASH_EEPROM_LEVELING - #define FLASH_SECTOR 2 + #define FLASH_SECTOR 1 #define FLASH_UNIT_SIZE 0x4000 // 16k - #define FLASH_ADDRESS_START 0x8008000 + #define FLASH_ADDRESS_START 0x8004000 #endif // @@ -57,7 +57,7 @@ // Limit Switches // #define X_STOP_PIN PB4 -#define Y_STOP_PIN PB3 +#define Y_STOP_PIN PC8 #define Z_STOP_PIN PB1 // @@ -111,9 +111,10 @@ #define HEATER_0_PIN PC6 #define HEATER_BED_PIN PC7 #ifndef FAN_PIN - #define FAN_PIN PA1 + #define FAN_PIN PA14 #endif -#define FAN1_PIN PC8 +#define FAN1_PIN PA13 +#define FAN2_PIN PA1 // // Temperature Sensors diff --git a/buildroot/share/PlatformIO/boards/marlin_BigTree_BTT002_VET6.json b/buildroot/share/PlatformIO/boards/marlin_BigTree_BTT002_VET6.json new file mode 100644 index 0000000000..77d3af0112 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/marlin_BigTree_BTT002_VET6.json @@ -0,0 +1,46 @@ +{ + "build": { + "core": "stm32", + "cpu": "cortex-m4", + "extra_flags": "-DSTM32F4 -DSTM32F407xx -DSTM32F40_41xxx", + "f_cpu": "168000000L", + "hwids": [ + [ + "0x1EAF", + "0x0003" + ], + [ + "0x0483", + "0x3748" + ] + ], + "mcu": "stm32f407vet6", + "variant": "MARLIN_BIGTREE_BTT002" + }, + "debug": { + "jlink_device": "STM32F407VE", + "openocd_target": "stm32f4x", + "svd_path": "STM32F40x.svd" + }, + "frameworks": [ + "arduino" + ], + "name": "STM32F407VE (192k RAM. 512k Flash)", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 131072, + "maximum_size": 524288, + "protocol": "stlink", + "protocols": [ + "stlink", + "dfu", + "jlink" + ], + "offset_address": "0x8008000", + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f407ve.html", + "vendor": "ST" +} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.cpp index c8ed0d1e52..7979f3f804 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.cpp +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.cpp @@ -190,12 +190,12 @@ WEAK void SystemClock_Config(void) /* Enable Power Control clock */ __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value regarding system frequency refer to product datasheet. */ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - + /* Enable HSE Oscillator and activate PLL with HSE as source */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; @@ -209,19 +209,19 @@ WEAK void SystemClock_Config(void) { /* Initialization Error */ } - + if(HAL_PWREx_EnableOverDrive() != HAL_OK) { /* Initialization Error */ } - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; if(HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { /* Initialization Error */ diff --git a/buildroot/tests/LPC1769 b/buildroot/tests/LPC1769 index f0dab630e5..3fe99734ca 100755 --- a/buildroot/tests/LPC1769 +++ b/buildroot/tests/LPC1769 @@ -14,11 +14,12 @@ exec_test $1 $2 "Azteeg X5GT Example Configuration" "$3" restore_configs opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD \ - EXTRUDERS 2 TEMP_SENSOR_1 -1 TEMP_SENSOR_BED 5 \ + EXTRUDERS 2 TEMP_SENSOR_0 -5 TEMP_SENSOR_1 -1 TEMP_SENSOR_BED 5 TEMP_0_CS_PIN P1_29 \ GRID_MAX_POINTS_X 16 \ NOZZLE_CLEAN_START_POINT "{ { 10, 10, 3 }, { 10, 10, 3 } }" \ NOZZLE_CLEAN_END_POINT "{ { 10, 20, 3 }, { 10, 20, 3 } }" opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ + MAX31865_SENSOR_OHMS_0 MAX31865_CALIBRATION_OHMS_0 \ FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET LEVEL_CORNERS_USE_PROBE LEVEL_CORNERS_VERIFY_RAISED \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ diff --git a/buildroot/tests/teensy41 b/buildroot/tests/teensy41 index fd89512ea5..1affd7c89e 100755 --- a/buildroot/tests/teensy41 +++ b/buildroot/tests/teensy41 @@ -15,12 +15,13 @@ exec_test $1 $2 "Teensy4.1 with default config" "$3" # restore_configs opt_set MOTHERBOARD BOARD_TEENSY41 \ - EXTRUDERS 2 TEMP_SENSOR_0 1 TEMP_SENSOR_1 5 TEMP_SENSOR_BED 1 \ + EXTRUDERS 2 TEMP_SENSOR_0 -5 TEMP_SENSOR_1 5 TEMP_SENSOR_BED 1 TEMP_0_CS_PIN 23 \ I2C_SLAVE_ADDRESS 63 \ GRID_MAX_POINTS_X 16 \ NOZZLE_CLEAN_START_POINT "{ { 10, 10, 3 }, { 10, 10, 3 } }" \ NOZZLE_CLEAN_END_POINT "{ { 10, 20, 3 }, { 10, 20, 3 } }" -opt_enable EXTENSIBLE_UI LCD_INFO_MENU SDSUPPORT SDCARD_SORT_ALPHA \ +opt_enable MAX31865_SENSOR_OHMS_0 MAX31865_CALIBRATION_OHMS_0 \ + EXTENSIBLE_UI LCD_INFO_MENU SDSUPPORT SDCARD_SORT_ALPHA \ FILAMENT_LCD_DISPLAY CALIBRATION_GCODE BAUD_RATE_GCODE \ FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET \ diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 0e9b507c8b..6fec1d46fc 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -204,6 +204,14 @@ build_flags = ${stm32_variant.build_flags} -DPIN_SERIAL2_RX=PD_6 -DPIN_SERIAL2_TX=PD_5 +# +# BigTreeTech BTT002 V1.x with 512k of flash (STM32F407VET6 ARM Cortex-M4) +# +[env:BIGTREE_BTT002_VET6] +platform = ${env:BIGTREE_BTT002.platform} +extends = env:BIGTREE_BTT002 +board = marlin_BigTree_BTT002_VET6 + # # BigTreeTech SKR V2.0 (STM32F407VGT6 ARM Cortex-M4) with USB Flash Drive Support #