From 51209667a5dae1206ed38b8966c1783f7a41e466 Mon Sep 17 00:00:00 2001 From: Timothy Hoogland Date: Sun, 30 Jan 2022 05:26:37 -0600 Subject: [PATCH 001/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20EZBoard=20V2=20tim?= =?UTF-8?q?er=20conflict=20(#23648)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h index ec6e498b2179..2fee15ba3b64 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h @@ -104,7 +104,7 @@ extern "C" { // Timer Definitions // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin #define TIMER_TONE TIM5 -#define TIMER_SERVO TIM7 +#define TIMER_SERVO TIM4 // UART Definitions // Define here Serial instance number to map on Serial generic name From 9847470b387c43b16713f5854b2dfd7b334bd31e Mon Sep 17 00:00:00 2001 From: Timothy Hoogland Date: Mon, 31 Jan 2022 14:02:07 -0600 Subject: [PATCH 002/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20EZBoard=20V2=20Env?= =?UTF-8?q?ironment=20for=20OpenBLT=20(#23659)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/stm32f4.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index f721f3075d79..1ac533f4d312 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -531,11 +531,14 @@ build_unflags = -DUSBD_USE_CDC extends = stm32_variant board = genericSTM32F405RG board_build.variant = MARLIN_TH3D_EZBOARD_V2 +board_build.encrypt = firmware.bin board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 build_flags = ${stm32_variant.build_flags} -DHSE_VALUE=12000000U -O0 debug_tool = stlink upload_protocol = stlink +extra_scripts = ${stm32_variant.extra_scripts} + buildroot/share/PlatformIO/scripts/openblt.py # # BOARD_MKS_ROBIN_NANO_V1_3_F4 From e028a3c44194518aa9fab1148a102f12407bf0f9 Mon Sep 17 00:00:00 2001 From: Maeyanie Date: Tue, 1 Feb 2022 18:27:14 -0500 Subject: [PATCH 003/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20M852=20report=20(#?= =?UTF-8?q?23660)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/calibrate/M852.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/calibrate/M852.cpp b/Marlin/src/gcode/calibrate/M852.cpp index b24a449652a3..6c661dcd61d9 100644 --- a/Marlin/src/gcode/calibrate/M852.cpp +++ b/Marlin/src/gcode/calibrate/M852.cpp @@ -93,7 +93,7 @@ void GcodeSuite::M852() { void GcodeSuite::M852_report(const bool forReplay/*=true*/) { report_heading_etc(forReplay, F(STR_SKEW_FACTOR)); - SERIAL_ECHOPAIR_F(" M851 I", planner.skew_factor.xy, 6); + SERIAL_ECHOPAIR_F(" M852 I", planner.skew_factor.xy, 6); #if ENABLED(SKEW_CORRECTION_FOR_Z) SERIAL_ECHOPAIR_F(" J", planner.skew_factor.xz, 6); SERIAL_ECHOPAIR_F(" K", planner.skew_factor.yz, 6); From bf067738f2faea96717b3810efb001348dba9bfa Mon Sep 17 00:00:00 2001 From: Mads Ynddal <5528170+Baekalfen@users.noreply.github.com> Date: Thu, 10 Feb 2022 18:58:36 +0100 Subject: [PATCH 004/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20XYZEval::set(XY,?= =?UTF-8?q?=20Z)=20and=20(XY,=20Z,=20E)=20(#23704)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix regression in #21953 Co-authored-by: Scott Lahteine --- Marlin/src/core/types.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index aee25a0dfff4..b95b59565920 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -536,19 +536,9 @@ struct XYZEval { // Reset all to 0 FI void reset() { LOGICAL_AXIS_GANG(e =, x =, y =, z =, i =, j =, k =) 0; } - // Setters taking struct types and arrays - FI void set(const T px) { x = px; } - FI void set(const T px, const T py) { x = px; y = py; } - FI void set(const XYval pxy) { x = pxy.x; y = pxy.y; } - FI void set(const XYZval pxyz) { set(LINEAR_AXIS_ELEM(pxyz)); } - #if HAS_Z_AXIS - FI void set(LINEAR_AXIS_ARGS(const T)) { LINEAR_AXIS_CODE(a = x, b = y, c = z, u = i, v = j, w = k); } - #endif - #if LOGICAL_AXES > LINEAR_AXES - FI void set(const XYval pxy, const T pe) { set(pxy); e = pe; } - FI void set(const XYZval pxyz, const T pe) { set(pxyz); e = pe; } - FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, u = i, v = j, w = k); } - #endif + // Setters for some number of linear axes, not all + FI void set(const T px) { x = px; } + FI void set(const T px, const T py) { x = px; y = py; } #if HAS_I_AXIS FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } #endif @@ -558,6 +548,18 @@ struct XYZEval { #if HAS_K_AXIS FI void set(const T px, const T py, const T pz, const T pi, const T pj) { x = px; y = py; z = pz; i = pi; j = pj; } #endif + // Setters taking struct types and arrays + FI void set(const XYval pxy) { x = pxy.x; y = pxy.y; } + FI void set(const XYZval pxyz) { set(LINEAR_AXIS_ELEM(pxyz)); } + #if HAS_Z_AXIS + FI void set(LINEAR_AXIS_ARGS(const T)) { LINEAR_AXIS_CODE(a = x, b = y, c = z, u = i, v = j, w = k); } + #endif + FI void set(const XYval pxy, const T pz) { set(pxy); TERN_(HAS_Z_AXIS, z = pz); } + #if LOGICAL_AXES > LINEAR_AXES + FI void set(const XYval pxy, const T pz, const T pe) { set(pxy, pz); e = pe; } + FI void set(const XYZval pxyz, const T pe) { set(pxyz); e = pe; } + FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, u = i, v = j, w = k); } + #endif // Length reduced to one dimension FI T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k)); } From bfdb7c71358bb787a6b8d2a9e4948ad19fac93db Mon Sep 17 00:00:00 2001 From: Giuseppe499 Date: Tue, 15 Feb 2022 20:21:05 +0100 Subject: [PATCH 005/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20XATC=20divide-by-z?= =?UTF-8?q?ero=20(#23743)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/abl/x_twist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/feature/bedlevel/abl/x_twist.cpp b/Marlin/src/feature/bedlevel/abl/x_twist.cpp index c4a62c35953f..000c1e229418 100644 --- a/Marlin/src/feature/bedlevel/abl/x_twist.cpp +++ b/Marlin/src/feature/bedlevel/abl/x_twist.cpp @@ -49,6 +49,7 @@ void XATC::print_points() { float lerp(const_float_t t, const_float_t a, const_float_t b) { return a + t * (b - a); } float XATC::compensation(const xy_pos_t &raw) { + if (NEAR_ZERO(spacing)) return 0; float t = (raw.x - start) / spacing; int i = FLOOR(t); LIMIT(i, 0, XATC_MAX_POINTS - 2); From 4dfd398d7ddc32e61457989d4156418c57c6e5d7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 17 Feb 2022 14:41:56 -0600 Subject: [PATCH 006/502] =?UTF-8?q?=F0=9F=90=9B=20Patch=20Creality=20RAMPS?= =?UTF-8?q?=20FET=20/=20FAN=20pins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improvement for multi-hotend setup by TH3D. --- Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h index def71fefc13e..21dadd60eeb6 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h @@ -30,9 +30,8 @@ // // Heaters / Fans // - -// Power outputs EFBF or EFBE -#define MOSFET_D_PIN 7 +#define MOSFET_B_PIN 7 // For HEATER_1_PIN ("EEF" or "EEB") +#define FAN_PIN 9 #define FIL_RUNOUT_PIN 2 #if NUM_RUNOUT_SENSORS >= 2 From 186d2ba6b4420b41ae977cad4028a37b57030ceb Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 18 Feb 2022 13:37:22 +1300 Subject: [PATCH 007/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20HAS=5FTMC26X=20fea?= =?UTF-8?q?ture=20path=20(#23757)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/features.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ini/features.ini b/ini/features.ini index eb3be400b109..0f2c27b23b48 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -24,7 +24,7 @@ SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub HAS_MOTOR_CURRENT_I2C = SlowSoftI2CMaster src_filter=+ HAS_TMC26X = TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip - src_filter=+ + src_filter=+ HAS_L64XX = Arduino-L6470@0.8.0 src_filter=+ + + + LIB_INTERNAL_MAX31865 = src_filter=+ From b9cef2e2e3ec4131d785c084e658e669f59b28ce Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 4 Mar 2022 15:18:27 -0600 Subject: [PATCH 008/502] =?UTF-8?q?=F0=9F=9A=B8=2012345.6=20num-to-string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 6 +++--- Marlin/src/lcd/menu/menu_item.h | 2 +- Marlin/src/libs/numtostr.cpp | 6 +++--- Marlin/src/libs/numtostr.h | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 52554e5df8bd..45f69e2886a5 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -664,7 +664,7 @@ void MarlinUI::draw_status_screen() { #if CUTTER_UNIT_IS(PERCENT) lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower)); #elif CUTTER_UNIT_IS(RPM) - lcd_put_u8str(STATUS_CUTTER_TEXT_X - 2, STATUS_CUTTER_TEXT_Y, ftostr51rj(float(cutter.unitPower) / 1000)); + lcd_put_u8str(STATUS_CUTTER_TEXT_X - 2, STATUS_CUTTER_TEXT_Y, ftostr61rj(float(cutter.unitPower) / 1000)); lcd_put_wchar('K'); #else lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower)); diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 5a1cedfbac95..079d9b80b018 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -523,7 +523,7 @@ void menu_advanced_steps_per_mm() { START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_QSTEPS(Q) EDIT_ITEM_FAST(float51, MSG_##Q##_STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, []{ planner.refresh_positioning(); }) + #define EDIT_QSTEPS(Q) EDIT_ITEM_FAST(float61, MSG_##Q##_STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, []{ planner.refresh_positioning(); }) LINEAR_AXIS_CODE( EDIT_QSTEPS(A), EDIT_QSTEPS(B), EDIT_QSTEPS(C), EDIT_QSTEPS(I), EDIT_QSTEPS(J), EDIT_QSTEPS(K) @@ -531,7 +531,7 @@ void menu_advanced_steps_per_mm() { #if ENABLED(DISTINCT_E_FACTORS) LOOP_L_N(n, E_STEPPERS) - EDIT_ITEM_FAST_N(float51, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{ + EDIT_ITEM_FAST_N(float61, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{ const uint8_t e = MenuItemBase::itemIndex; if (e == active_extruder) planner.refresh_positioning(); @@ -539,7 +539,7 @@ void menu_advanced_steps_per_mm() { planner.mm_per_step[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)]; }); #elif E_STEPPERS - EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); }); + EDIT_ITEM_FAST(float61, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); }); #endif END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 1834b56a8875..fcde9f580193 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -150,7 +150,7 @@ DEFINE_MENU_EDIT_ITEM_TYPE(float43 ,float ,ftostr43sign ,1000 ); DEFINE_MENU_EDIT_ITEM_TYPE(float4 ,float ,ftostr4sign , 1 ); // 1234 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float5 ,float ,ftostr5rj , 1 ); // 12345 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float5_25 ,float ,ftostr5rj , 0.04f ); // 12345 right-justified (25 increment) -DEFINE_MENU_EDIT_ITEM_TYPE(float51 ,float ,ftostr51rj , 10 ); // 1234.5 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float61 ,float ,ftostr61rj , 10 ); // 12345.6 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float31sign ,float ,ftostr31sign , 10 ); // +12.3 DEFINE_MENU_EDIT_ITEM_TYPE(float41sign ,float ,ftostr41sign , 10 ); // +123.4 DEFINE_MENU_EDIT_ITEM_TYPE(float51sign ,float ,ftostr51sign , 10 ); // +1234.5 diff --git a/Marlin/src/libs/numtostr.cpp b/Marlin/src/libs/numtostr.cpp index 1e1ac0571012..f4d47983d225 100644 --- a/Marlin/src/libs/numtostr.cpp +++ b/Marlin/src/libs/numtostr.cpp @@ -377,10 +377,10 @@ const char* ftostr53sign(const_float_t f) { return conv; } -// Convert unsigned float to string with ____4.5, __34.5, _234.5, 1234.5 format -const char* ftostr51rj(const_float_t f) { +// Convert unsigned float to string with ____5.6, ___45.6, __345.6, _2345.6, 12345.6 format +const char* ftostr61rj(const_float_t f) { const long i = UINTFLOAT(f, 1); - conv[0] = ' '; + conv[0] = RJDIGIT(i, 100000); conv[1] = RJDIGIT(i, 10000); conv[2] = RJDIGIT(i, 1000); conv[3] = RJDIGIT(i, 100); diff --git a/Marlin/src/libs/numtostr.h b/Marlin/src/libs/numtostr.h index b058f3cdf6c6..1704d35e889d 100644 --- a/Marlin/src/libs/numtostr.h +++ b/Marlin/src/libs/numtostr.h @@ -113,8 +113,8 @@ const char* ftostr52sign(const_float_t x); // Convert signed float to string with +12.345 format const char* ftostr53sign(const_float_t f); -// Convert unsigned float to string with 1234.5 format omitting trailing zeros -const char* ftostr51rj(const_float_t x); +// Convert unsigned float to string with 12345.6 format omitting trailing zeros +const char* ftostr61rj(const_float_t x); // Convert float to rj string with 123 or -12 format FORCE_INLINE const char* ftostr3(const_float_t x) { return i16tostr3rj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } From 19e193410ec2b218c382dbddf6a540c1ad328df6 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sat, 12 Mar 2022 16:27:18 -0800 Subject: [PATCH 009/502] =?UTF-8?q?=F0=9F=94=A8=20Include=20"More=20Data"?= =?UTF-8?q?=20issues=20in=20stale=20check=20(#23863)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/close-stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close-stale.yml b/.github/workflows/close-stale.yml index f017907d2934..f90c079f6605 100644 --- a/.github/workflows/close-stale.yml +++ b/.github/workflows/close-stale.yml @@ -25,4 +25,4 @@ jobs: days-before-close: 10 stale-issue-label: 'stale-closing-soon' exempt-all-assignees: true - exempt-issue-labels: 'Bug: Confirmed !,T: Feature Request,Needs: Discussion,Needs: Documentation,Needs: More Data,Needs: Patch,Needs: Work,Needs: Testing,help wanted,no-locking' + exempt-issue-labels: 'Bug: Confirmed !,T: Feature Request,Needs: Discussion,Needs: Documentation,Needs: Patch,Needs: Work,Needs: Testing,help wanted,no-locking' From ba2f6c66d3b11d12c84b30d322a293d210016682 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Thu, 17 Mar 2022 20:19:00 -0700 Subject: [PATCH 010/502] =?UTF-8?q?=F0=9F=94=A8=20Remove=20StaleBot=20age?= =?UTF-8?q?=20limit=20(#23907)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lock-closed.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lock-closed.yml b/.github/workflows/lock-closed.yml index 81145688288b..8cdcd7a8369e 100644 --- a/.github/workflows/lock-closed.yml +++ b/.github/workflows/lock-closed.yml @@ -22,7 +22,7 @@ jobs: github-token: ${{ github.token }} process-only: 'issues' issue-lock-inactive-days: '60' - issue-exclude-created-before: '2017-07-01T00:00:00Z' + issue-exclude-created-before: '' issue-exclude-labels: 'no-locking' issue-lock-labels: '' issue-lock-comment: > From 52a92ca24e2037b51e5d5e2fb8975d6de8590f33 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 25 Mar 2022 20:34:15 -0500 Subject: [PATCH 011/502] =?UTF-8?q?=F0=9F=94=A8=20Use=20some=20v3=20action?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-builds.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index f5ce466d9051..d68c92fb2916 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -113,10 +113,10 @@ jobs: steps: - name: Check out the PR - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Cache pip - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} @@ -124,13 +124,13 @@ jobs: ${{ runner.os }}-pip- - name: Cache PlatformIO - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: Select Python 3.7 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax. architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified From ad945017d6bf06e6a039fb5d23cb241421fefc50 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 26 Mar 2022 21:58:19 -0500 Subject: [PATCH 012/502] =?UTF-8?q?=F0=9F=94=A8=20Update=20TMC26XStepper?= =?UTF-8?q?=20link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/features.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ini/features.ini b/ini/features.ini index 0f2c27b23b48..142b42c63876 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -23,7 +23,7 @@ HAS_STEALTHCHOP = src_filter=+ -HAS_TMC26X = TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip +HAS_TMC26X = TMC26XStepper=https://github.com/MarlinFirmware/TMC26XStepper/archive/master.zip src_filter=+ HAS_L64XX = Arduino-L6470@0.8.0 src_filter=+ + + + From 2893060302b7251cb6d5cd258f264b1a87eedee4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 29 Mar 2022 03:24:15 -0500 Subject: [PATCH 013/502] =?UTF-8?q?=F0=9F=92=9A=20Lock=20CI=20testing=20to?= =?UTF-8?q?=20PlatformIO=205.2.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index d68c92fb2916..c50a15399de6 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -137,7 +137,7 @@ jobs: - name: Install PlatformIO run: | - pip install -U https://github.com/platformio/platformio-core/archive/develop.zip + pip install -U https://github.com/platformio/platformio-core/archive/v5.2.5.zip platformio update - name: Run ${{ matrix.test-platform }} Tests From d418f3bfbaaa6100b1bb790365ad2666bf35b5c4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Apr 2022 19:30:08 -0500 Subject: [PATCH 014/502] =?UTF-8?q?=F0=9F=94=A8=20Skip=20cron=20with=20exi?= =?UTF-8?q?t=20code=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/bump-date.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bump-date.yml b/.github/workflows/bump-date.yml index 5539941ed179..2366da725806 100644 --- a/.github/workflows/bump-date.yml +++ b/.github/workflows/bump-date.yml @@ -36,3 +36,4 @@ jobs: git commit -m "[cron] Bump distribution date ($DIST)" && \ git push fi + exit 0 From 9df0dbc981ae528b30874d47cc187eb7cc42a55d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 20 Apr 2022 04:30:15 -0500 Subject: [PATCH 015/502] =?UTF-8?q?=F0=9F=92=9A=20Use=20PIO-develop=20for?= =?UTF-8?q?=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index c50a15399de6..d68c92fb2916 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -137,7 +137,7 @@ jobs: - name: Install PlatformIO run: | - pip install -U https://github.com/platformio/platformio-core/archive/v5.2.5.zip + pip install -U https://github.com/platformio/platformio-core/archive/develop.zip platformio update - name: Run ${{ matrix.test-platform }} Tests From c1d3e4634cf3dd9c922b7a3c2a2f981b557d356a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 29 Mar 2022 03:24:15 -0500 Subject: [PATCH 016/502] =?UTF-8?q?=F0=9F=92=9A=20Lock=20CI=20testing=20to?= =?UTF-8?q?=20PlatformIO=205.2.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-builds.yml | 2 +- docker/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index d68c92fb2916..c50a15399de6 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -137,7 +137,7 @@ jobs: - name: Install PlatformIO run: | - pip install -U https://github.com/platformio/platformio-core/archive/develop.zip + pip install -U https://github.com/platformio/platformio-core/archive/v5.2.5.zip platformio update - name: Run ${{ matrix.test-platform }} Tests diff --git a/docker/Dockerfile b/docker/Dockerfile index 903b8b71fd32..ad3e15d5de6f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.9.0-buster -RUN pip install -U https://github.com/platformio/platformio-core/archive/develop.zip +RUN pip install -U https://github.com/platformio/platformio-core/archive/v5.2.5.zip RUN platformio update # To get the test platforms RUN pip install PyYaml From b6c37960e8840c5d777cfc683d34bd1e206ae03a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 10 Jan 2022 19:49:03 -0600 Subject: [PATCH 017/502] =?UTF-8?q?=F0=9F=93=9D=20KHz=20=3D>=20kHz=20(#235?= =?UTF-8?q?12)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 4 ++-- Marlin/src/HAL/AVR/fastio.cpp | 4 ++-- Marlin/src/HAL/DUE/fastio/G2_PWM.cpp | 2 +- Marlin/src/HAL/DUE/pinsDebug.h | 2 +- Marlin/src/HAL/SAMD51/timers.cpp | 2 +- Marlin/src/HAL/STM32/sdio.cpp | 2 +- Marlin/src/gcode/config/M672.cpp | 2 +- Marlin/src/gcode/control/M3-M5.cpp | 2 +- Marlin/src/module/endstops.cpp | 4 ++-- Marlin/src/module/temperature.cpp | 6 +++--- .../variants/MARLIN_F103VE_LONGER/hal_conf_custom.h | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 7f5db89241cc..59e0d6829386 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -567,8 +567,8 @@ * * USE_OCR2A_AS_TOP [undefined by default] * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: - * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] - * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * 16MHz MCUs: [62.5kHz, 31.4kHz (default), 7.8kHz, 3.92kHz, 1.95kHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1kHz, 39.2kHz (default), 9.77kHz, 4.9kHz, 2.44kHz, 1.22kHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. diff --git a/Marlin/src/HAL/AVR/fastio.cpp b/Marlin/src/HAL/AVR/fastio.cpp index 8af3ef805efa..5083893ae3fd 100644 --- a/Marlin/src/HAL/AVR/fastio.cpp +++ b/Marlin/src/HAL/AVR/fastio.cpp @@ -245,7 +245,7 @@ uint16_t set_pwm_frequency_hz(const_float_t hz, const float dca, const float dcb float count = 0; if (hz > 0 && (dca || dcb || dcc)) { count = float(F_CPU) / hz; // 1x prescaler, TOP for 16MHz base freq. - uint16_t prescaler; // Range of 30.5Hz (65535) 64.5KHz (>31) + uint16_t prescaler; // Range of 30.5Hz (65535) 64.5kHz (>31) if (count >= 255. * 256.) { prescaler = 1024; SET_CS(5, PRESCALER_1024); } else if (count >= 255. * 64.) { prescaler = 256; SET_CS(5, PRESCALER_256); } @@ -277,7 +277,7 @@ uint16_t set_pwm_frequency_hz(const_float_t hz, const float dca, const float dcb // Restore the default for Timer 5 SET_WGM(5, PWM_PC_8); // PWM 8-bit (Phase Correct) SET_COMS(5, NORMAL, NORMAL, NORMAL); // Do nothing - SET_CS(5, PRESCALER_64); // 16MHz / 64 = 250KHz + SET_CS(5, PRESCALER_64); // 16MHz / 64 = 250kHz OCR5A = OCR5B = OCR5C = 0; } return round(count); diff --git a/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp b/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp index d9fbabce2148..800915ff692b 100644 --- a/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp +++ b/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp @@ -25,7 +25,7 @@ * is NOT used to directly toggle pins. The ISR writes to the pin assigned to * that interrupt. * - * All PWMs use the same repetition rate. The G2 needs about 10KHz min in order to + * All PWMs use the same repetition rate. The G2 needs about 10kHz min in order to * not have obvious ripple on the Vref signals. * * The data structures are setup to minimize the computation done by the ISR which diff --git a/Marlin/src/HAL/DUE/pinsDebug.h b/Marlin/src/HAL/DUE/pinsDebug.h index f01c53c8ce06..6c08585974fd 100644 --- a/Marlin/src/HAL/DUE/pinsDebug.h +++ b/Marlin/src/HAL/DUE/pinsDebug.h @@ -53,7 +53,7 @@ * The net result is that both the g_pinStatus[pin] array and the PIO_OSR register * needs to be looked at when determining if a pin is an input or an output. * - * b) Due has only pins 6, 7, 8 & 9 enabled for PWMs. FYI - they run at 1KHz + * b) Due has only pins 6, 7, 8 & 9 enabled for PWMs. FYI - they run at 1kHz * * c) NUM_DIGITAL_PINS does not include the analog pins * diff --git a/Marlin/src/HAL/SAMD51/timers.cpp b/Marlin/src/HAL/SAMD51/timers.cpp index ce13dd231ecd..1ad0e360736a 100644 --- a/Marlin/src/HAL/SAMD51/timers.cpp +++ b/Marlin/src/HAL/SAMD51/timers.cpp @@ -79,7 +79,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { rtc->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; // RTC clock setup - OSC32KCTRL->RTCCTRL.reg = OSC32KCTRL_RTCCTRL_RTCSEL_XOSC32K; // External 32.768KHz oscillator + OSC32KCTRL->RTCCTRL.reg = OSC32KCTRL_RTCCTRL_RTCSEL_XOSC32K; // External 32.768kHz oscillator // Stop timer, just in case, to be able to reconfigure it rtc->MODE0.CTRLA.bit.ENABLE = false; diff --git a/Marlin/src/HAL/STM32/sdio.cpp b/Marlin/src/HAL/STM32/sdio.cpp index 18b4434dfa73..0af5f9040e54 100644 --- a/Marlin/src/HAL/STM32/sdio.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -59,7 +59,7 @@ DMA_HandleTypeDef hdma_sdio; /* SDIO_INIT_CLK_DIV is 118 SDIO clock frequency is 48MHz / (TRANSFER_CLOCK_DIV + 2) - SDIO init clock frequency should not exceed 400KHz = 48MHz / (118 + 2) + SDIO init clock frequency should not exceed 400kHz = 48MHz / (118 + 2) Default TRANSFER_CLOCK_DIV is 2 (118 / 40) Default SDIO clock frequency is 48MHz / (2 + 2) = 12 MHz diff --git a/Marlin/src/gcode/config/M672.cpp b/Marlin/src/gcode/config/M672.cpp index af74230516e1..257b49471f61 100644 --- a/Marlin/src/gcode/config/M672.cpp +++ b/Marlin/src/gcode/config/M672.cpp @@ -53,7 +53,7 @@ // b7 b6 b5 b4 ~b4 ... hi bits, NOT last bit // b3 b2 b1 b0 ~b0 ... lo bits, NOT last bit // -void M672_send(uint8_t b) { // bit rate requirement: 1KHz +/- 30% +void M672_send(uint8_t b) { // bit rate requirement: 1kHz +/- 30% LOOP_L_N(bits, 14) { switch (bits) { default: { OUT_WRITE(SMART_EFFECTOR_MOD_PIN, !!(b & 0x80)); b <<= 1; break; } // send bit, shift next into place diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index ddbbc4ab6835..2cf22e81ce0c 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -43,7 +43,7 @@ * * If no PWM pin is defined then M3/M4 just turns it on. * - * At least 12.8KHz (50Hz * 256) is needed for Spindle PWM. + * At least 12.8kHz (50Hz * 256) is needed for Spindle PWM. * Hardware PWM is required on AVR. ISRs are too slow. * * NOTE: WGM for timers 3, 4, and 5 must be either Mode 1 or Mode 5. diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 50ee33b3c06a..98fd524f9e3a 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -352,7 +352,7 @@ void Endstops::init() { } // Endstops::init -// Called at ~1KHz from Temperature ISR: Poll endstop state if required +// Called at ~1kHz from Temperature ISR: Poll endstop state if required void Endstops::poll() { TERN_(PINS_DEBUGGING, run_monitor()); // Report changes in endstop status @@ -403,7 +403,7 @@ void Endstops::not_homing() { void Endstops::resync() { if (!abort_enabled()) return; // If endstops/probes are disabled the loop below can hang - // Wait for Temperature ISR to run at least once (runs at 1KHz) + // Wait for Temperature ISR to run at least once (runs at 1kHz) TERN(ENDSTOP_INTERRUPTS_FEATURE, update(), safe_delay(2)); while (TERN0(ENDSTOP_NOISE_THRESHOLD, endstop_poll_count)) safe_delay(1); } diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 9d4455a7df4e..eff5a25a1dec 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -3007,8 +3007,8 @@ class SoftPWM { }; /** - * Handle various ~1KHz tasks associated with temperature - * - Heater PWM (~1KHz with scaler) + * Handle various ~1kHz tasks associated with temperature + * - Heater PWM (~1kHz with scaler) * - LCD Button polling (~500Hz) * - Start / Read one ADC sensor * - Advance Babysteps @@ -3510,7 +3510,7 @@ void Temperature::isr() { adc_sensor_state = next_sensor_state; // - // Additional ~1KHz Tasks + // Additional ~1kHz Tasks // #if ENABLED(BABYSTEPPING) && DISABLED(INTEGRATED_BABYSTEPPING) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h index 3a6b7037adf0..3440343ffa1e 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h @@ -118,7 +118,7 @@ extern "C" { #endif #ifndef LSE_STARTUP_TIMEOUT - #define LSE_STARTUP_TIMEOUT 50U // No 32.7KHz LSE on this board, reduced to avoid delays + #define LSE_STARTUP_TIMEOUT 50U // No 32.7kHz LSE on this board, reduced to avoid delays #endif /* Tip: To avoid modifying this file each time you need to use different HSE, From 2690bb1bc29df31a297976be29922147b76d69d3 Mon Sep 17 00:00:00 2001 From: John Lagonikas <39417467+zeleps@users.noreply.github.com> Date: Mon, 3 Jan 2022 18:11:39 +0200 Subject: [PATCH 018/502] =?UTF-8?q?=E2=9C=A8=20M81=20D=20/=20S=20-=20Power?= =?UTF-8?q?-off=20Delay=20(#23396,=20#23455)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 11 +++-- Marlin/src/MarlinCore.cpp | 4 ++ Marlin/src/feature/power.cpp | 71 +++++++++++++++++++++------ Marlin/src/feature/power.h | 40 ++++++++++----- Marlin/src/gcode/control/M80_M81.cpp | 33 ++++++++++--- Marlin/src/inc/SanityCheck.h | 2 + Marlin/src/lcd/e3v2/enhanced/dwin.cpp | 4 +- Marlin/src/module/temperature.h | 7 ++- buildroot/tests/rambo | 4 +- 9 files changed, 134 insertions(+), 42 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f0fc4dd7d608..ea89cb2f59c2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -374,6 +374,9 @@ //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power + //#define POWER_OFF_TIMER // Enable M81 D to power off after a delay + //#define POWER_OFF_WAIT_FOR_COOLDOWN // Enable M81 S to power off only after cooldown + //#define PSU_POWERUP_GCODE "M355 S1" // G-code to run after power-on (e.g., case light on) //#define PSU_POWEROFF_GCODE "M355 S0" // G-code to run before power-off (e.g., case light off) @@ -384,12 +387,14 @@ #define AUTO_POWER_CONTROLLERFAN #define AUTO_POWER_CHAMBER_FAN #define AUTO_POWER_COOLER_FAN - //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU if any extruder is over this temperature - //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU if the chamber is over this temperature - //#define AUTO_POWER_COOLER_TEMP 26 // (°C) Turn on PSU if the cooler is over this temperature #define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration //#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time. #endif + #if EITHER(AUTO_POWER_CONTROL, POWER_OFF_WAIT_FOR_COOLDOWN) + //#define AUTO_POWER_E_TEMP 50 // (°C) PSU on if any extruder is over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) PSU on if the chamber is over this temperature + //#define AUTO_POWER_COOLER_TEMP 26 // (°C) PSU on if the cooler is over this temperature + #endif #endif //=========================================================================== diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 5132d07e8711..7e3151c44652 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1648,6 +1648,10 @@ void loop() { queue.advance(); + #if EITHER(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) + powerManager.checkAutoPowerOff(); + #endif + endstops.event_handler(); TERN_(HAS_TFT_LVGL_UI, printer_state_polling()); diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index fabe35b989c7..0e4d5452e486 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -27,7 +27,9 @@ #include "../inc/MarlinConfig.h" #include "power.h" +#include "../module/planner.h" #include "../module/stepper.h" +#include "../module/temperature.h" #include "../MarlinCore.h" #if ENABLED(PS_OFF_SOUND) @@ -75,6 +77,10 @@ void Power::power_on() { if (psu_on) return; + #if EITHER(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) + cancelAutoPowerOff(); + #endif + OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_STATE); psu_on = true; safe_delay(PSU_POWERUP_DELAY); @@ -89,7 +95,6 @@ void Power::power_on() { /** * Power off if the power is currently on. * Processes any PSU_POWEROFF_GCODE and makes a PS_OFF_SOUND if enabled. - * */ void Power::power_off() { if (!psu_on) return; @@ -104,8 +109,57 @@ void Power::power_off() { OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_STATE); psu_on = false; + + #if EITHER(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) + cancelAutoPowerOff(); + #endif } +#if EITHER(AUTO_POWER_CONTROL, POWER_OFF_WAIT_FOR_COOLDOWN) + + bool Power::is_cooling_needed() { + #if HAS_HOTEND && AUTO_POWER_E_TEMP + HOTEND_LOOP() if (thermalManager.degHotend(e) >= (AUTO_POWER_E_TEMP)) return true; + #endif + + #if HAS_HEATED_CHAMBER && AUTO_POWER_CHAMBER_TEMP + if (thermalManager.degChamber() >= (AUTO_POWER_CHAMBER_TEMP)) return true; + #endif + + #if HAS_COOLER && AUTO_POWER_COOLER_TEMP + if (thermalManager.degCooler() >= (AUTO_POWER_COOLER_TEMP)) return true; + #endif + + return false; + } + +#endif + +#if EITHER(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) + + #if ENABLED(POWER_OFF_TIMER) + millis_t Power::power_off_time = 0; + void Power::setPowerOffTimer(const millis_t delay_ms) { power_off_time = millis() + delay_ms; } + #endif + + #if ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) + bool Power::power_off_on_cooldown = false; + void Power::setPowerOffOnCooldown(const bool ena) { power_off_on_cooldown = ena; } + #endif + + void Power::cancelAutoPowerOff() { + TERN_(POWER_OFF_TIMER, power_off_time = 0); + TERN_(POWER_OFF_WAIT_FOR_COOLDOWN, power_off_on_cooldown = false); + } + + void Power::checkAutoPowerOff() { + if (TERN1(POWER_OFF_TIMER, !power_off_time) && TERN1(POWER_OFF_WAIT_FOR_COOLDOWN, !power_off_on_cooldown)) return; + if (TERN0(POWER_OFF_WAIT_FOR_COOLDOWN, power_off_on_cooldown && is_cooling_needed())) return; + if (TERN0(POWER_OFF_TIMER, power_off_time && PENDING(millis(), power_off_time))) return; + power_off(); + } + +#endif // POWER_OFF_TIMER || POWER_OFF_WAIT_FOR_COOLDOWN #if ENABLED(AUTO_POWER_CONTROL) @@ -149,19 +203,7 @@ void Power::power_off() { if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0 || thermalManager.temp_bed.soft_pwm_amount > 0)) return true; - #if HAS_HOTEND && AUTO_POWER_E_TEMP - HOTEND_LOOP() if (thermalManager.degHotend(e) >= (AUTO_POWER_E_TEMP)) return true; - #endif - - #if HAS_HEATED_CHAMBER && AUTO_POWER_CHAMBER_TEMP - if (thermalManager.degChamber() >= (AUTO_POWER_CHAMBER_TEMP)) return true; - #endif - - #if HAS_COOLER && AUTO_POWER_COOLER_TEMP - if (thermalManager.degCooler() >= (AUTO_POWER_COOLER_TEMP)) return true; - #endif - - return false; + return is_cooling_needed(); } /** @@ -193,7 +235,6 @@ void Power::power_off() { /** * Power off with a delay. Power off is triggered by check() after the delay. - * */ void Power::power_off_soon() { lastPowerOn = millis() - SEC_TO_MS(POWER_TIMEOUT) + SEC_TO_MS(POWER_OFF_DELAY); diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 42c2c8494288..38f7ed6ce7c7 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -36,21 +36,37 @@ class Power { static void init(); static void power_on(); static void power_off(); + + #if EITHER(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) + #if ENABLED(POWER_OFF_TIMER) + static millis_t power_off_time; + static void setPowerOffTimer(const millis_t delay_ms); + #endif + #if ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) + static bool power_off_on_cooldown; + static void setPowerOffOnCooldown(const bool ena); + #endif + static void cancelAutoPowerOff(); + static void checkAutoPowerOff(); + #endif - #if ENABLED(AUTO_POWER_CONTROL) && POWER_OFF_DELAY > 0 - static void power_off_soon(); - #else - static void power_off_soon() { power_off(); } - #endif + #if ENABLED(AUTO_POWER_CONTROL) && POWER_OFF_DELAY > 0 + static void power_off_soon(); + #else + static void power_off_soon() { power_off(); } + #endif - #if ENABLED(AUTO_POWER_CONTROL) - static void check(const bool pause); + #if ENABLED(AUTO_POWER_CONTROL) + static void check(const bool pause); - private: - static millis_t lastPowerOn; - static bool is_power_needed(); - - #endif + private: + static millis_t lastPowerOn; + static bool is_power_needed(); + static bool is_cooling_needed(); + #elif ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) + private: + static bool is_cooling_needed(); + #endif }; extern Power powerManager; diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index b8be9daa4015..cbb3c85f40ca 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -79,20 +79,39 @@ void GcodeSuite::M81() { print_job_timer.stop(); - #if HAS_FAN - #if ENABLED(PROBING_FANS_OFF) - thermalManager.fans_paused = false; - ZERO(thermalManager.saved_fan_speed); - #endif + #if BOTH(HAS_FAN, PROBING_FANS_OFF) + thermalManager.fans_paused = false; + ZERO(thermalManager.saved_fan_speed); #endif safe_delay(1000); // Wait 1 second before switching off + LCD_MESSAGE_F(MACHINE_NAME " " STR_OFF "."); + + bool delayed_power_off = false; + + #if ENABLED(POWER_OFF_TIMER) + if (parser.seenval('D')) { + uint16_t delay = parser.value_ushort(); + if (delay > 1) { // skip already observed 1s delay + delayed_power_off = true; + powerManager.setPowerOffTimer(SEC_TO_MS(delay - 1)); + } + } + #endif + + #if ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) + if (parser.boolval('S')) { + delayed_power_off = true; + powerManager.setPowerOffOnCooldown(true); + } + #endif + + if (delayed_power_off) return; + #if HAS_SUICIDE suicide(); #elif ENABLED(PSU_CONTROL) powerManager.power_off_soon(); #endif - - LCD_MESSAGE_F(MACHINE_NAME " " STR_OFF "."); } diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index a7e8517d804a..dcffacb5b06b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3564,6 +3564,8 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "PSU_CONTROL requires PS_ON_PIN." #elif POWER_OFF_DELAY < 0 #error "POWER_OFF_DELAY must be a positive value." + #elif ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) && !(defined(AUTO_POWER_E_TEMP) || defined(AUTO_POWER_CHAMBER_TEMP) || defined(AUTO_POWER_COOLER_TEMP)) + #error "POWER_OFF_WAIT_FOR_COOLDOWN requires AUTO_POWER_E_TEMP, AUTO_POWER_CHAMBER_TEMP, and/or AUTO_POWER_COOLER_TEMP." #endif #endif diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp index 20c6c73bc4f7..f12f981b7289 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp @@ -485,7 +485,7 @@ void Popup_window_PauseOrStop() { Draw_Select_Highlight(true); DWIN_UpdateLCD(); } - else + else DWIN_Popup_ConfirmCancel(ICON_BLTouch, select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT_F(MSG_PAUSE_PRINT) : GET_TEXT_F(MSG_STOP_PRINT)); } @@ -2019,7 +2019,7 @@ void HMI_LockScreen() { #endif //============================================================================= -// NEW MENU SUBSYSTEM +// NEW MENU SUBSYSTEM //============================================================================= // On click functions diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index e63e414bb2ab..be21bf0dec42 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -994,7 +994,12 @@ class Temperature { static int16_t read_max_tc(TERN_(HAS_MULTI_MAX_TC, const uint8_t hindex=0)); #endif - static void update_autofans(); + #if HAS_AUTO_FAN + #if ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) + static bool autofans_on; + #endif + static void update_autofans(); + #endif #if HAS_HOTEND static float get_pid_output_hotend(const uint8_t e); diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo index a54c04eeb21c..92e8bc2b5f45 100755 --- a/buildroot/tests/rambo +++ b/buildroot/tests/rambo @@ -14,7 +14,7 @@ opt_set MOTHERBOARD BOARD_RAMBO \ EXTRUDERS 2 TEMP_SENSOR_0 -2 TEMP_SENSOR_1 1 TEMP_SENSOR_BED 2 \ TEMP_SENSOR_PROBE 1 TEMP_PROBE_PIN 12 \ TEMP_SENSOR_CHAMBER 3 TEMP_CHAMBER_PIN 3 HEATER_CHAMBER_PIN 45 \ - GRID_MAX_POINTS_X 16 \ + GRID_MAX_POINTS_X 16 AUTO_POWER_E_TEMP 80 \ FANMUX0_PIN 53 opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN USE_WATCHDOG opt_enable USE_ZMAX_PLUG REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \ @@ -32,7 +32,7 @@ opt_enable USE_ZMAX_PLUG REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_P SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \ BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \ FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ - PSU_CONTROL PS_OFF_CONFIRM PS_OFF_SOUND AUTO_POWER_CONTROL \ + PSU_CONTROL PS_OFF_CONFIRM PS_OFF_SOUND POWER_OFF_WAIT_FOR_COOLDOWN \ POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE POWER_LOSS_RECOVER_ZHOME POWER_LOSS_ZHOME_POS \ SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE EXTRA_LIN_ADVANCE_K \ HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL From d7b7b570c77d2725877124661167224dcf72be5d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 6 Jan 2022 05:07:47 -0600 Subject: [PATCH 019/502] =?UTF-8?q?=F0=9F=8E=A8=20Misc.=20cleanup,=20comme?= =?UTF-8?q?nts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- Marlin/src/feature/easythreed_ui.cpp | 10 +++--- Marlin/src/feature/power.h | 2 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 6 ++++ Marlin/src/lcd/e3v2/creality/dwin.cpp | 5 ++- Marlin/src/lcd/touch/touch_buttons.cpp | 2 +- Marlin/src/module/endstops.cpp | 15 +++++---- Marlin/src/module/stepper.cpp | 10 ++---- Marlin/src/sd/cardreader.cpp | 43 +++++++++----------------- Marlin/src/sd/cardreader.h | 3 +- 10 files changed, 45 insertions(+), 53 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ea89cb2f59c2..768654f97aee 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -390,7 +390,7 @@ #define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration //#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time. #endif - #if EITHER(AUTO_POWER_CONTROL, POWER_OFF_WAIT_FOR_COOLDOWN) + #if EITHER(AUTO_POWER_CONTROL, POWER_OFF_WAIT_FOR_COOLDOWN) //#define AUTO_POWER_E_TEMP 50 // (°C) PSU on if any extruder is over this temperature //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) PSU on if the chamber is over this temperature //#define AUTO_POWER_COOLER_TEMP 26 // (°C) PSU on if the cooler is over this temperature diff --git a/Marlin/src/feature/easythreed_ui.cpp b/Marlin/src/feature/easythreed_ui.cpp index 9f8af039478c..b15daffc09be 100644 --- a/Marlin/src/feature/easythreed_ui.cpp +++ b/Marlin/src/feature/easythreed_ui.cpp @@ -194,11 +194,11 @@ void EasythreedUI::printButton() { print_key_flag = PF_START; return; // Bail out } - card.ls(); // List all files to serial output - const uint16_t filecnt = card.countFilesInWorkDir(); // Count printable files in cwd - if (filecnt == 0) return; // None are printable? - card.selectFileByIndex(filecnt); // Select the last file according to current sort options - card.openAndPrintFile(card.filename); // Start printing it + card.ls(); // List all files to serial output + const uint16_t filecnt = card.countFilesInWorkDir(); // Count printable files in cwd + if (filecnt == 0) return; // None are printable? + card.selectFileByIndex(filecnt); // Select the last file according to current sort options + card.openAndPrintFile(card.filename); // Start printing it break; } case PF_PAUSE: { // Pause printing (not currently firing) diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 38f7ed6ce7c7..9ecd832afce6 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -36,7 +36,7 @@ class Power { static void init(); static void power_on(); static void power_off(); - + #if EITHER(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) #if ENABLED(POWER_OFF_TIMER) static millis_t power_off_time; diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 6765ec86a6ec..eea5d4a7f251 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -290,6 +290,9 @@ G29_TYPE GcodeSuite::G29() { ry = RAW_Y_POSITION(parser.linearval('Y', NAN)); int8_t i = parser.byteval('I', -1), j = parser.byteval('J', -1); + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" + if (!isnan(rx) && !isnan(ry)) { // Get nearest i / j from rx / ry i = (rx - bilinear_start.x + 0.5 * abl.gridSpacing.x) / abl.gridSpacing.x; @@ -297,6 +300,9 @@ G29_TYPE GcodeSuite::G29() { LIMIT(i, 0, (GRID_MAX_POINTS_X) - 1); LIMIT(j, 0, (GRID_MAX_POINTS_Y) - 1); } + + #pragma GCC diagnostic pop + if (WITHIN(i, 0, (GRID_MAX_POINTS_X) - 1) && WITHIN(j, 0, (GRID_MAX_POINTS_Y) - 1)) { set_bed_leveling_enabled(false); z_values[i][j] = rz; diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index f312976ddc68..03f08ac18435 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -2762,7 +2762,10 @@ void HMI_Prepare() { #endif #if HAS_HOTEND || HAS_HEATED_BED - case PREPARE_CASE_COOL: thermalManager.cooldown(); break; + case PREPARE_CASE_COOL: + thermalManager.cooldown(); + ui.reset_status(); + break; #endif case PREPARE_CASE_LANG: diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index c15bb08281f2..dcdc7def8667 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -79,7 +79,7 @@ uint8_t TouchButtons::read_buttons() { #if ENABLED(TOUCH_SCREEN_CALIBRATION) const calibrationState state = touch_calibration.get_calibration_state(); - if (state >= CALIBRATION_TOP_LEFT && state <= CALIBRATION_BOTTOM_RIGHT) { + if (WITHIN(state, CALIBRATION_TOP_LEFT, CALIBRATION_BOTTOM_RIGHT)) { if (touch_calibration.handleTouch(x, y)) ui.refresh(); return 0; } diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 98fd524f9e3a..939dd6d53760 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -593,9 +593,6 @@ void _O2 Endstops::report_states() { } // Endstops::report_states -// The following routines are called from an ISR context. It could be the temperature ISR, the -// endstop ISR or the Stepper ISR. - #if HAS_DELTA_SENSORLESS_PROBING #define __ENDSTOP(AXIS, ...) AXIS ##_MAX #define _ENDSTOP_PIN(AXIS, ...) AXIS ##_MAX_PIN @@ -607,13 +604,18 @@ void _O2 Endstops::report_states() { #endif #define _ENDSTOP(AXIS, MINMAX) __ENDSTOP(AXIS, MINMAX) -// Check endstops - Could be called from Temperature ISR! +/** + * Called from interrupt context by the Endstop ISR or Stepper ISR! + * Read endstops to get their current states, register hits for all + * axes moving in the direction of their endstops, and abort moves. + */ void Endstops::update() { - #if !ENDSTOP_NOISE_THRESHOLD - if (!abort_enabled()) return; + #if !ENDSTOP_NOISE_THRESHOLD // If not debouncing... + if (!abort_enabled()) return; // ...and not enabled, exit. #endif + // Macros to update / copy the live_state #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX))) #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT)) @@ -1107,6 +1109,7 @@ void Endstops::update() { #if ENABLED(SPI_ENDSTOPS) + // Called from idle() to read Trinamic stall states bool Endstops::tmc_spi_homing_check() { bool hit = false; #if X_SPI_SENSORLESS diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index b61f36bbb45d..9a1c8278ba2d 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2346,13 +2346,9 @@ uint32_t Stepper::block_phase_isr() { #endif #endif // LASER_POWER_INLINE - // At this point, we must ensure the movement about to execute isn't - // trying to force the head against a limit switch. If using interrupt- - // driven change detection, and already against a limit then no call to - // the endstop_triggered method will be done and the movement will be - // done against the endstop. So, check the limits here: If the movement - // is against the limits, the block will be marked as to be killed, and - // on the next call to this ISR, will be discarded. + // If the endstop is already pressed, endstop interrupts won't invoke + // endstop_triggered and the move will grind. So check here for a + // triggered endstop, which marks the block for discard on the next ISR. endstops.update(); #if ENABLED(Z_LATE_ENABLE) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index da6e84c75942..66c08b6455cf 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -271,9 +271,8 @@ void CardReader::selectByName(SdFile dir, const char * const match) { * good addition. */ void CardReader::printListing( - SdFile parent + SdFile parent, const char * const prepend OPTARG(LONG_FILENAME_HOST_SUPPORT, const bool includeLongNames/*=false*/) - , const char * const prepend/*=nullptr*/ OPTARG(LONG_FILENAME_HOST_SUPPORT, const char * const prependLong/*=nullptr*/) ) { dir_t p; @@ -283,61 +282,47 @@ void CardReader::printListing( size_t lenPrepend = prepend ? strlen(prepend) + 1 : 0; // Allocate enough stack space for the full path including / separator char path[lenPrepend + FILENAME_LENGTH]; - if (prepend) { - strcpy(path, prepend); - path[lenPrepend - 1] = '/'; - } + if (prepend) { strcpy(path, prepend); path[lenPrepend - 1] = '/'; } char* dosFilename = path + lenPrepend; createFilename(dosFilename, p); // Get a new directory object using the full path // and dive recursively into it. SdFile child; // child.close() in destructor - if (child.open(&parent, dosFilename, O_READ)) + if (child.open(&parent, dosFilename, O_READ)) { #if ENABLED(LONG_FILENAME_HOST_SUPPORT) if (includeLongNames) { size_t lenPrependLong = prependLong ? strlen(prependLong) + 1 : 0; // Allocate enough stack space for the full long path including / separator char pathLong[lenPrependLong + strlen(longFilename) + 1]; - if (prependLong) { - strcpy(pathLong, prependLong); - pathLong[lenPrependLong - 1] = '/'; - } + if (prependLong) { strcpy(pathLong, prependLong); pathLong[lenPrependLong - 1] = '/'; } strcpy(pathLong + lenPrependLong, longFilename); - printListing(child, true, path, pathLong); + printListing(child, path, true, pathLong); } else - printListing(child, false, path); + printListing(child, path); #else printListing(child, path); #endif + } else { SERIAL_ECHO_MSG(STR_SD_CANT_OPEN_SUBDIR, dosFilename); return; } } else if (is_dir_or_gcode(p)) { - if (prepend) { - SERIAL_ECHO(prepend); - SERIAL_CHAR('/'); - } + if (prepend) { SERIAL_ECHO(prepend); SERIAL_CHAR('/'); } SERIAL_ECHO(createFilename(filename, p)); SERIAL_CHAR(' '); + SERIAL_ECHO(p.fileSize); #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - if (!includeLongNames) - #endif - SERIAL_ECHOLN(p.fileSize); - #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - else { - SERIAL_ECHO(p.fileSize); + if (includeLongNames) { SERIAL_CHAR(' '); - if (prependLong) { - SERIAL_ECHO(prependLong); - SERIAL_CHAR('/'); - } - SERIAL_ECHOLN(longFilename[0] ? longFilename : "???"); + if (prependLong) { SERIAL_ECHO(prependLong); SERIAL_CHAR('/'); } + SERIAL_ECHO(longFilename[0] ? longFilename : "???"); } #endif + SERIAL_EOL(); } } } @@ -348,7 +333,7 @@ void CardReader::printListing( void CardReader::ls(TERN_(LONG_FILENAME_HOST_SUPPORT, bool includeLongNames/*=false*/)) { if (flag.mounted) { root.rewind(); - printListing(root OPTARG(LONG_FILENAME_HOST_SUPPORT, includeLongNames)); + printListing(root, nullptr OPTARG(LONG_FILENAME_HOST_SUPPORT, includeLongNames)); } } diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 97e9bba86757..8761f57de53c 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -336,9 +336,8 @@ class CardReader { static void selectByIndex(SdFile dir, const uint8_t index); static void selectByName(SdFile dir, const char * const match); static void printListing( - SdFile parent + SdFile parent, const char * const prepend OPTARG(LONG_FILENAME_HOST_SUPPORT, const bool includeLongNames=false) - , const char * const prepend=nullptr OPTARG(LONG_FILENAME_HOST_SUPPORT, const char * const prependLong=nullptr) ); From b435487da7656e8fecf7add9f88f6be779389b04 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sat, 8 Jan 2022 10:51:21 +0100 Subject: [PATCH 020/502] =?UTF-8?q?=F0=9F=9A=B8=20Wait=20for=20cooldown=20?= =?UTF-8?q?in=20MarlinUI=20power-off=20(#23476)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/marlinui.cpp | 8 +++++--- Marlin/src/lcd/marlinui.h | 2 +- Marlin/src/lcd/menu/menu_main.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index ab132216c888..d22b11f9bd80 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1553,11 +1553,13 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; TERN_(HAS_LCD_MENU, return_to_status()); } - #if BOTH(PSU_CONTROL, PS_OFF_CONFIRM) + #if BOTH(HAS_LCD_MENU, PSU_CONTROL) + void MarlinUI::poweroff() { - queue.inject(F("M81")); - goto_previous_screen(); + queue.inject(F("M81" TERN_(POWER_OFF_WAIT_FOR_COOLDOWN, "S"))); + return_to_status(); } + #endif void MarlinUI::flow_fault() { diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 9933841f0284..c2b26b6f4723 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -373,7 +373,7 @@ class MarlinUI { static void resume_print(); static void flow_fault(); - #if BOTH(PSU_CONTROL, PS_OFF_CONFIRM) + #if BOTH(HAS_LCD_MENU, PSU_CONTROL) static void poweroff(); #endif diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 6e66188c02ce..f7e974a8649b 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -380,7 +380,7 @@ void menu_main() { GET_TEXT(MSG_SWITCH_PS_OFF), (const char *)nullptr, PSTR("?") ); #else - GCODES_ITEM(MSG_SWITCH_PS_OFF, PSTR("M81")); + ACTION_ITEM(MSG_SWITCH_PS_OFF, ui.poweroff); #endif else GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80")); From 2ca1d844d7d6b7309216b87eea740bd05d75c9ef Mon Sep 17 00:00:00 2001 From: John Lagonikas <39417467+zeleps@users.noreply.github.com> Date: Sun, 2 Jan 2022 02:18:07 +0200 Subject: [PATCH 021/502] =?UTF-8?q?=E2=9C=A8=20Temperature=20variance=20mo?= =?UTF-8?q?nitor=20(#23373)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 4 ++ Marlin/src/core/language.h | 1 + Marlin/src/inc/Conditionals_post.h | 3 ++ Marlin/src/lcd/language/language_el.h | 1 + Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/module/temperature.cpp | 55 +++++++++++++++++++++++---- Marlin/src/module/temperature.h | 8 +++- 7 files changed, 64 insertions(+), 9 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 59e0d6829386..9c5e1c1cd413 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -349,6 +349,10 @@ #define WATCH_COOLER_TEMP_INCREASE 3 // Degrees Celsius #endif +#if ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_COOLER) + #define THERMAL_PROTECTION_VARIANCE_MONITOR // Detect a sensor malfunction preventing temperature updates +#endif + #if ENABLED(PIDTEMP) // Add an experimental additional term to the heater power, proportional to the extrusion speed. // A well-chosen Kc value should add just enough power to melt the increased material volume. diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 8919154674b9..a540c9c77125 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -240,6 +240,7 @@ #define STR_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !" #define STR_T_HEATING_FAILED "Heating failed" #define STR_T_THERMAL_RUNAWAY "Thermal Runaway" +#define STR_T_MALFUNCTION "Thermal Malfunction" #define STR_T_MAXTEMP "MAXTEMP triggered" #define STR_T_MINTEMP "MINTEMP triggered" #define STR_ERR_PROBING_FAILED "Probing Failed" diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index a3cb84adb10d..08130d31b7a1 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2564,6 +2564,9 @@ #if BOTH(HAS_COOLER, THERMAL_PROTECTION_COOLER) && WATCH_COOLER_TEMP_PERIOD > 0 #define WATCH_COOLER 1 #endif +#if NONE(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_COOLER) + #undef THERMAL_PROTECTION_VARIANCE_MONITOR +#endif #if (ENABLED(THERMAL_PROTECTION_HOTENDS) || !EXTRUDERS) \ && (ENABLED(THERMAL_PROTECTION_BED) || !HAS_HEATED_BED) \ && (ENABLED(THERMAL_PROTECTION_CHAMBER) || !HAS_HEATED_CHAMBER) \ diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 8db2425d116a..f3cd7ef27898 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -202,6 +202,7 @@ namespace Language_el { LSTR MSG_HEATING_FAILED_LCD = _UxGT("Αποτυχία θέρμανσης"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ"); LSTR MSG_THERMAL_RUNAWAY = _UxGT("ΘΕΡΜΙΚΗ ΔΙΑΦΥΓΗ"); + LSTR MSG_TEMP_MALFUNCTION = _UxGT("ΘΕΡΜΙΚΗ ΔΥΣΛΕΙΤΟΥΡΓΙΑ"); LSTR MSG_ERR_MAXTEMP = _UxGT("ΠΕΡΙΤΤΗ ΘΕΡΜΟΚΡΑΣΙΑ"); LSTR MSG_ERR_MINTEMP = _UxGT("ΑΝΕΠΑΡΚΗΣ ΘΕΡΜΟΚΡΑΣΙΑ"); LSTR MSG_HALTED = _UxGT("Εκτυπωτής διεκόπη"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 8287b60d4cf2..12430ed4c0af 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -538,6 +538,7 @@ namespace Language_en { LSTR MSG_HEATING_FAILED_LCD = _UxGT("Heating Failed"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: REDUNDANT TEMP"); LSTR MSG_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); + LSTR MSG_TEMP_MALFUNCTION = _UxGT("TEMP MALFUNCTION"); LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("BED THERMAL RUNAWAY"); LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("CHAMBER T. RUNAWAY"); LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("Cooler Runaway"); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index eff5a25a1dec..bb1768054ee8 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -196,6 +196,7 @@ Temperature thermalManager; PGMSTR(str_t_thermal_runaway, STR_T_THERMAL_RUNAWAY); +PGMSTR(str_t_temp_malfunction, STR_T_MALFUNCTION); PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); /** @@ -2570,14 +2571,30 @@ void Temperature::init() { ); */ - // If the heater idle timeout expires, restart - if (TERN0(HEATER_IDLE_HANDLER, heater_idle[idle_index].timed_out)) { - state = TRInactive; - running_temp = 0; - } - else if (running_temp != target) { // If the target temperature changes, restart - running_temp = target; - state = target > 0 ? TRFirstHeating : TRInactive; + #if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR) + if (state == TRMalfunction) { // temperature invariance may continue, regardless of heater state + variance += ABS(current - last_temp); // no need for detection window now, a single change in variance is enough + last_temp = current; + if (!NEAR_ZERO(variance)) { + variance_timer = millis() + SEC_TO_MS(period_seconds); + variance = 0.0; + state = TRStable; // resume from where we detected the problem + } + } + #endif + + if (TERN1(THERMAL_PROTECTION_VARIANCE_MONITOR, state != TRMalfunction)) { + // If the heater idle timeout expires, restart + if (TERN0(HEATER_IDLE_HANDLER, heater_idle[idle_index].timed_out)) { + state = TRInactive; + running_temp = 0; + TERN_(THERMAL_PROTECTION_VARIANCE_MONITOR, variance_timer = 0); + } + else if (running_temp != target) { // If the target temperature changes, restart + running_temp = target; + state = target > 0 ? TRFirstHeating : TRInactive; + TERN_(THERMAL_PROTECTION_VARIANCE_MONITOR, variance_timer = 0); + } } switch (state) { @@ -2610,6 +2627,22 @@ void Temperature::init() { const millis_t now = millis(); + #if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR) + if (PENDING(now, variance_timer)) { + variance += ABS(current - last_temp); + last_temp = current; + } + else { + if (NEAR_ZERO(variance) && variance_timer) { // valid variance monitoring window + state = TRMalfunction; + break; + } + variance_timer = now + SEC_TO_MS(period_seconds); + variance = 0.0; + last_temp = current; + } + #endif + if (current >= running_temp - hysteresis_degc) { timer = now + SEC_TO_MS(period_seconds); break; @@ -2622,6 +2655,12 @@ void Temperature::init() { case TRRunaway: TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0)); _temp_error(heater_id, FPSTR(str_t_thermal_runaway), GET_TEXT_F(MSG_THERMAL_RUNAWAY)); + + #if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR) + case TRMalfunction: + TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0)); + _temp_error(heater_id, FPSTR(str_t_temp_malfunction), GET_TEXT_F(MSG_TEMP_MALFUNCTION)); + #endif } } diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index be21bf0dec42..5affcf740d75 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -1041,12 +1041,18 @@ class Temperature { return (RunawayIndex)_MAX(heater_id, 0); } - enum TRState : char { TRInactive, TRFirstHeating, TRStable, TRRunaway }; + enum TRState : char { TRInactive, TRFirstHeating, TRStable, TRRunaway + OPTARG(THERMAL_PROTECTION_VARIANCE_MONITOR, TRMalfunction) + }; typedef struct { millis_t timer = 0; TRState state = TRInactive; float running_temp; + #if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR) + millis_t variance_timer = 0; + celsius_float_t last_temp = 0.0, variance = 0.0; + #endif void run(const_celsius_float_t current, const_celsius_float_t target, const heater_id_t heater_id, const uint16_t period_seconds, const celsius_t hysteresis_degc); } tr_state_machine_t; From 67e5298a340d927115f983ce10aa16624302d91c Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Sun, 9 Jan 2022 08:14:03 +0100 Subject: [PATCH 022/502] =?UTF-8?q?=E2=9C=A8=20Firmware=20Upload=20via=20B?= =?UTF-8?q?inary=20Transfer=20(#23462)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 5 + Marlin/src/gcode/sd/M20.cpp | 8 +- Marlin/src/pins/pins.h | 16 +- Marlin/src/sd/cardreader.cpp | 39 +- Marlin/src/sd/cardreader.h | 11 +- .../share/scripts/MarlinBinaryProtocol.py | 434 ++++++++++++++++++ buildroot/share/scripts/upload.py | 274 +++++++++++ ini/stm32f1.ini | 7 +- 8 files changed, 770 insertions(+), 24 deletions(-) create mode 100644 buildroot/share/scripts/MarlinBinaryProtocol.py create mode 100644 buildroot/share/scripts/upload.py diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 9c5e1c1cd413..cf54cff991cd 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1621,6 +1621,11 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER + #if ENABLED(BINARY_FILE_TRANSFER) + // Include extra facilities (e.g., 'M20 F') supporting firmware upload via BINARY_FILE_TRANSFER + //#define CUSTOM_FIRMWARE_UPLOAD + #endif + /** * Set this option to one of the following (or the board's defaults apply): * diff --git a/Marlin/src/gcode/sd/M20.cpp b/Marlin/src/gcode/sd/M20.cpp index 573183833854..c640309be8c8 100644 --- a/Marlin/src/gcode/sd/M20.cpp +++ b/Marlin/src/gcode/sd/M20.cpp @@ -33,7 +33,13 @@ void GcodeSuite::M20() { if (card.flag.mounted) { SERIAL_ECHOLNPGM(STR_BEGIN_FILE_LIST); - card.ls(TERN_(LONG_FILENAME_HOST_SUPPORT, parser.boolval('L'))); + card.ls( + TERN_(CUSTOM_FIRMWARE_UPLOAD, parser.boolval('F')) + #if BOTH(CUSTOM_FIRMWARE_UPLOAD, LONG_FILENAME_HOST_SUPPORT) + , + #endif + TERN_(LONG_FILENAME_HOST_SUPPORT, parser.boolval('L')) + ); SERIAL_ECHOLNPGM(STR_END_FILE_LIST); } else diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 0d24ee6696bd..7ca78677e9ff 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -558,21 +558,21 @@ #elif MB(CHITU3D_V9) #include "stm32f1/pins_CHITU3D_V9.h" // STM32F1 env:chitu_f103 env:chitu_f103_maple #elif MB(CREALITY_V4) - #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple #elif MB(CREALITY_V4210) - #include "stm32f1/pins_CREALITY_V4210.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V4210.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple #elif MB(CREALITY_V423) - #include "stm32f1/pins_CREALITY_V423.h" // STM32F1 env:STM32F103RET6_creality + #include "stm32f1/pins_CREALITY_V423.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer #elif MB(CREALITY_V427) - #include "stm32f1/pins_CREALITY_V427.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V427.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple #elif MB(CREALITY_V431, CREALITY_V431_A, CREALITY_V431_B, CREALITY_V431_C, CREALITY_V431_D) - #include "stm32f1/pins_CREALITY_V431.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V431.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple #elif MB(CREALITY_V452) - #include "stm32f1/pins_CREALITY_V452.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V452.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple #elif MB(CREALITY_V453) - #include "stm32f1/pins_CREALITY_V453.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V453.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple #elif MB(CREALITY_V24S1) - #include "stm32f1/pins_CREALITY_V24S1.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V24S1.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple #elif MB(TRIGORILLA_PRO) #include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro env:trigorilla_pro_maple #elif MB(FLY_MINI) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 66c08b6455cf..25f9d7d802f9 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -195,11 +195,15 @@ char *createFilename(char * const buffer, const dir_t &p) { } // -// Return 'true' if the item is a folder or G-code file +// Return 'true' if the item is something Marlin can read // -bool CardReader::is_dir_or_gcode(const dir_t &p) { +bool CardReader::is_visible_entity(const dir_t &p OPTARG(CUSTOM_FIRMWARE_UPLOAD, bool onlyBin/*=false*/)) { //uint8_t pn0 = p.name[0]; + #if DISABLED(CUSTOM_FIRMWARE_UPLOAD) + constexpr bool onlyBin = false; + #endif + if ( (p.attributes & DIR_ATT_HIDDEN) // Hidden by attribute // When readDir() > 0 these must be false: //|| pn0 == DIR_NAME_FREE || pn0 == DIR_NAME_DELETED // Clear or Deleted entry @@ -211,7 +215,11 @@ bool CardReader::is_dir_or_gcode(const dir_t &p) { return ( flag.filenameIsDir // All Directories are ok - || (p.name[8] == 'G' && p.name[9] != '~') // Non-backup *.G* files are accepted + || (!onlyBin && p.name[8] == 'G' + && p.name[9] != '~') // Non-backup *.G* files are accepted + || ( onlyBin && p.name[8] == 'B' + && p.name[9] == 'I' + && p.name[10] == 'N') // BIN files are accepted ); } @@ -222,7 +230,7 @@ int CardReader::countItems(SdFile dir) { dir_t p; int c = 0; while (dir.readDir(&p, longFilename) > 0) - c += is_dir_or_gcode(p); + c += is_visible_entity(p); #if ALL(SDCARD_SORT_ALPHA, SDSORT_USES_RAM, SDSORT_CACHE_NAMES) nrFiles = c; @@ -237,7 +245,7 @@ int CardReader::countItems(SdFile dir) { void CardReader::selectByIndex(SdFile dir, const uint8_t index) { dir_t p; for (uint8_t cnt = 0; dir.readDir(&p, longFilename) > 0;) { - if (is_dir_or_gcode(p)) { + if (is_visible_entity(p)) { if (cnt == index) { createFilename(filename, p); return; // 0 based index @@ -253,7 +261,7 @@ void CardReader::selectByIndex(SdFile dir, const uint8_t index) { void CardReader::selectByName(SdFile dir, const char * const match) { dir_t p; for (uint8_t cnt = 0; dir.readDir(&p, longFilename) > 0; cnt++) { - if (is_dir_or_gcode(p)) { + if (is_visible_entity(p)) { createFilename(filename, p); if (strcasecmp(match, filename) == 0) return; } @@ -272,6 +280,7 @@ void CardReader::selectByName(SdFile dir, const char * const match) { */ void CardReader::printListing( SdFile parent, const char * const prepend + OPTARG(CUSTOM_FIRMWARE_UPLOAD, bool onlyBin/*=false*/) OPTARG(LONG_FILENAME_HOST_SUPPORT, const bool includeLongNames/*=false*/) OPTARG(LONG_FILENAME_HOST_SUPPORT, const char * const prependLong/*=nullptr*/) ) { @@ -297,12 +306,12 @@ void CardReader::printListing( char pathLong[lenPrependLong + strlen(longFilename) + 1]; if (prependLong) { strcpy(pathLong, prependLong); pathLong[lenPrependLong - 1] = '/'; } strcpy(pathLong + lenPrependLong, longFilename); - printListing(child, path, true, pathLong); + printListing(child, path OPTARG(CUSTOM_FIRMWARE_UPLOAD, onlyBin), true, pathLong); } else - printListing(child, path); + printListing(child, path OPTARG(CUSTOM_FIRMWARE_UPLOAD, onlyBin)); #else - printListing(child, path); + printListing(child, path OPTARG(CUSTOM_FIRMWARE_UPLOAD, onlyBin)); #endif } else { @@ -310,7 +319,7 @@ void CardReader::printListing( return; } } - else if (is_dir_or_gcode(p)) { + else if (is_visible_entity(p OPTARG(CUSTOM_FIRMWARE_UPLOAD, onlyBin))) { if (prepend) { SERIAL_ECHO(prepend); SERIAL_CHAR('/'); } SERIAL_ECHO(createFilename(filename, p)); SERIAL_CHAR(' '); @@ -330,10 +339,16 @@ void CardReader::printListing( // // List all files on the SD card // -void CardReader::ls(TERN_(LONG_FILENAME_HOST_SUPPORT, bool includeLongNames/*=false*/)) { +void CardReader::ls( + TERN_(CUSTOM_FIRMWARE_UPLOAD, const bool onlyBin/*=false*/) + #if BOTH(CUSTOM_FIRMWARE_UPLOAD, LONG_FILENAME_HOST_SUPPORT) + , + #endif + TERN_(LONG_FILENAME_HOST_SUPPORT, const bool includeLongNames/*=false*/) +) { if (flag.mounted) { root.rewind(); - printListing(root, nullptr OPTARG(LONG_FILENAME_HOST_SUPPORT, includeLongNames)); + printListing(root, nullptr OPTARG(CUSTOM_FIRMWARE_UPLOAD, onlyBin) OPTARG(LONG_FILENAME_HOST_SUPPORT, includeLongNames)); } } diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 8761f57de53c..2b3dcd00fbfb 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -204,7 +204,13 @@ class CardReader { FORCE_INLINE static void getfilename_sorted(const uint16_t nr) { selectFileByIndex(nr); } #endif - static void ls(TERN_(LONG_FILENAME_HOST_SUPPORT, bool includeLongNames=false)); + static void ls( + TERN_(CUSTOM_FIRMWARE_UPLOAD, const bool onlyBin=false) + #if BOTH(CUSTOM_FIRMWARE_UPLOAD, LONG_FILENAME_HOST_SUPPORT) + , + #endif + TERN_(LONG_FILENAME_HOST_SUPPORT, const bool includeLongNames=false) + ); #if ENABLED(POWER_LOSS_RECOVERY) static bool jobRecoverFileExists(); @@ -331,12 +337,13 @@ class CardReader { // // Directory items // - static bool is_dir_or_gcode(const dir_t &p); + static bool is_visible_entity(const dir_t &p OPTARG(CUSTOM_FIRMWARE_UPLOAD, const bool onlyBin=false)); static int countItems(SdFile dir); static void selectByIndex(SdFile dir, const uint8_t index); static void selectByName(SdFile dir, const char * const match); static void printListing( SdFile parent, const char * const prepend + OPTARG(CUSTOM_FIRMWARE_UPLOAD, const bool onlyBin=false) OPTARG(LONG_FILENAME_HOST_SUPPORT, const bool includeLongNames=false) OPTARG(LONG_FILENAME_HOST_SUPPORT, const char * const prependLong=nullptr) ); diff --git a/buildroot/share/scripts/MarlinBinaryProtocol.py b/buildroot/share/scripts/MarlinBinaryProtocol.py new file mode 100644 index 000000000000..4887ad991978 --- /dev/null +++ b/buildroot/share/scripts/MarlinBinaryProtocol.py @@ -0,0 +1,434 @@ +# +# MarlinBinaryProtocol.py +# Supporting Firmware upload via USB/Serial, saving to the attached media. +# +import serial +import math +import time +from collections import deque +import threading +import sys +import datetime +import random +try: + import heatshrink + heatshrink_exists = True +except ImportError: + heatshrink_exists = False + + +def millis(): + return time.perf_counter() * 1000 + +class TimeOut(object): + def __init__(self, milliseconds): + self.duration = milliseconds + self.reset() + + def reset(self): + self.endtime = millis() + self.duration + + def timedout(self): + return millis() > self.endtime + +class ReadTimeout(Exception): + pass +class FatalError(Exception): + pass +class SycronisationError(Exception): + pass +class PayloadOverflow(Exception): + pass +class ConnectionLost(Exception): + pass + +class Protocol(object): + device = None + baud = None + max_block_size = 0 + port = None + block_size = 0 + + packet_transit = None + packet_status = None + packet_ping = None + + errors = 0 + packet_buffer = None + simulate_errors = 0 + sync = 0 + connected = False + syncronised = False + worker_thread = None + + response_timeout = 1000 + + applications = [] + responses = deque() + + def __init__(self, device, baud, bsize, simerr, timeout): + print("pySerial Version:", serial.VERSION) + self.port = serial.Serial(device, baudrate = baud, write_timeout = 0, timeout = 1) + self.device = device + self.baud = baud + self.block_size = int(bsize) + self.simulate_errors = max(min(simerr, 1.0), 0.0); + self.connected = True + self.response_timeout = timeout + + self.register(['ok', 'rs', 'ss', 'fe'], self.process_input) + + self.worker_thread = threading.Thread(target=Protocol.receive_worker, args=(self,)) + self.worker_thread.start() + + def receive_worker(self): + while self.port.in_waiting: + self.port.reset_input_buffer() + + def dispatch(data): + for tokens, callback in self.applications: + for token in tokens: + if token == data[:len(token)]: + callback((token, data[len(token):])) + return + + def reconnect(): + print("Reconnecting..") + self.port.close() + for x in range(10): + try: + if self.connected: + self.port = serial.Serial(self.device, baudrate = self.baud, write_timeout = 0, timeout = 1) + return + else: + print("Connection closed") + return + except: + time.sleep(1) + raise ConnectionLost() + + while self.connected: + try: + data = self.port.readline().decode('utf8').rstrip() + if len(data): + #print(data) + dispatch(data) + except OSError: + reconnect() + except UnicodeDecodeError: + # dodgy client output or datastream corruption + self.port.reset_input_buffer() + + def shutdown(self): + self.connected = False + self.worker_thread.join() + self.port.close() + + def process_input(self, data): + #print(data) + self.responses.append(data) + + def register(self, tokens, callback): + self.applications.append((tokens, callback)) + + def send(self, protocol, packet_type, data = bytearray()): + self.packet_transit = self.build_packet(protocol, packet_type, data) + self.packet_status = 0 + self.transmit_attempt = 0 + + timeout = TimeOut(self.response_timeout * 20) + while self.packet_status == 0: + try: + if timeout.timedout(): + raise ConnectionLost() + self.transmit_packet(self.packet_transit) + self.await_response() + except ReadTimeout: + self.errors += 1 + #print("Packetloss detected..") + self.packet_transit = None + + def await_response(self): + timeout = TimeOut(self.response_timeout) + while not len(self.responses): + time.sleep(0.00001) + if timeout.timedout(): + raise ReadTimeout() + + while len(self.responses): + token, data = self.responses.popleft() + switch = {'ok' : self.response_ok, 'rs': self.response_resend, 'ss' : self.response_stream_sync, 'fe' : self.response_fatal_error} + switch[token](data) + + def send_ascii(self, data, send_and_forget = False): + self.packet_transit = bytearray(data, "utf8") + b'\n' + self.packet_status = 0 + self.transmit_attempt = 0 + + timeout = TimeOut(self.response_timeout * 20) + while self.packet_status == 0: + try: + if timeout.timedout(): + return + self.port.write(self.packet_transit) + if send_and_forget: + self.packet_status = 1 + else: + self.await_response_ascii() + except ReadTimeout: + self.errors += 1 + #print("Packetloss detected..") + except serial.serialutil.SerialException: + return + self.packet_transit = None + + def await_response_ascii(self): + timeout = TimeOut(self.response_timeout) + while not len(self.responses): + time.sleep(0.00001) + if timeout.timedout(): + raise ReadTimeout() + token, data = self.responses.popleft() + self.packet_status = 1 + + def corrupt_array(self, data): + rid = random.randint(0, len(data) - 1) + data[rid] ^= 0xAA + return data + + def transmit_packet(self, packet): + packet = bytearray(packet) + if(self.simulate_errors > 0 and random.random() > (1.0 - self.simulate_errors)): + if random.random() > 0.9: + #random data drop + start = random.randint(0, len(packet)) + end = start + random.randint(1, 10) + packet = packet[:start] + packet[end:] + #print("Dropping {0} bytes".format(end - start)) + else: + #random corruption + packet = self.corrupt_array(packet) + #print("Single byte corruption") + self.port.write(packet) + self.transmit_attempt += 1 + + def build_packet(self, protocol, packet_type, data = bytearray()): + PACKET_TOKEN = 0xB5AD + + if len(data) > self.max_block_size: + raise PayloadOverflow() + + packet_buffer = bytearray() + + packet_buffer += self.pack_int8(self.sync) # 8bit sync id + packet_buffer += self.pack_int4_2(protocol, packet_type) # 4 bit protocol id, 4 bit packet type + packet_buffer += self.pack_int16(len(data)) # 16bit packet length + packet_buffer += self.pack_int16(self.build_checksum(packet_buffer)) # 16bit header checksum + + if len(data): + packet_buffer += data + packet_buffer += self.pack_int16(self.build_checksum(packet_buffer)) + + packet_buffer = self.pack_int16(PACKET_TOKEN) + packet_buffer # 16bit start token, not included in checksum + return packet_buffer + + # checksum 16 fletchers + def checksum(self, cs, value): + cs_low = (((cs & 0xFF) + value) % 255); + return ((((cs >> 8) + cs_low) % 255) << 8) | cs_low; + + def build_checksum(self, buffer): + cs = 0 + for b in buffer: + cs = self.checksum(cs, b) + return cs + + def pack_int32(self, value): + return value.to_bytes(4, byteorder='little') + + def pack_int16(self, value): + return value.to_bytes(2, byteorder='little') + + def pack_int8(self, value): + return value.to_bytes(1, byteorder='little') + + def pack_int4_2(self, vh, vl): + value = ((vh & 0xF) << 4) | (vl & 0xF) + return value.to_bytes(1, byteorder='little') + + def connect(self): + print("Connecting: Switching Marlin to Binary Protocol...") + self.send_ascii("M28B1") + self.send(0, 1) + + def disconnect(self): + self.send(0, 2) + self.syncronised = False + + def response_ok(self, data): + try: + packet_id = int(data); + except ValueError: + return + if packet_id != self.sync: + raise SycronisationError() + self.sync = (self.sync + 1) % 256 + self.packet_status = 1 + + def response_resend(self, data): + packet_id = int(data); + self.errors += 1 + if not self.syncronised: + print("Retrying syncronisation") + elif packet_id != self.sync: + raise SycronisationError() + + def response_stream_sync(self, data): + sync, max_block_size, protocol_version = data.split(',') + self.sync = int(sync) + self.max_block_size = int(max_block_size) + self.block_size = self.max_block_size if self.max_block_size < self.block_size else self.block_size + self.protocol_version = protocol_version + self.packet_status = 1 + self.syncronised = True + print("Connection synced [{0}], binary protocol version {1}, {2} byte payload buffer".format(self.sync, self.protocol_version, self.max_block_size)) + + def response_fatal_error(self, data): + raise FatalError() + + +class FileTransferProtocol(object): + protocol_id = 1 + + class Packet(object): + QUERY = 0 + OPEN = 1 + CLOSE = 2 + WRITE = 3 + ABORT = 4 + + responses = deque() + def __init__(self, protocol, timeout = None): + protocol.register(['PFT:success', 'PFT:version:', 'PFT:fail', 'PFT:busy', 'PFT:ioerror', 'PTF:invalid'], self.process_input) + self.protocol = protocol + self.response_timeout = timeout or protocol.response_timeout + + def process_input(self, data): + #print(data) + self.responses.append(data) + + def await_response(self, timeout = None): + timeout = TimeOut(timeout or self.response_timeout) + while not len(self.responses): + time.sleep(0.0001) + if timeout.timedout(): + raise ReadTimeout() + + return self.responses.popleft() + + def connect(self): + self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.QUERY); + + token, data = self.await_response() + if token != 'PFT:version:': + return False + + self.version, _, compression = data.split(':') + if compression != 'none': + algorithm, window, lookahead = compression.split(',') + self.compression = {'algorithm': algorithm, 'window': int(window), 'lookahead': int(lookahead)} + else: + self.compression = {'algorithm': 'none'} + + print("File Transfer version: {0}, compression: {1}".format(self.version, self.compression['algorithm'])) + + def open(self, filename, compression, dummy): + payload = b'\1' if dummy else b'\0' # dummy transfer + payload += b'\1' if compression else b'\0' # payload compression + payload += bytearray(filename, 'utf8') + b'\0'# target filename + null terminator + + timeout = TimeOut(5000) + token = None + self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.OPEN, payload); + while token != 'PFT:success' and not timeout.timedout(): + try: + token, data = self.await_response(1000) + if token == 'PFT:success': + print(filename,"opened") + return + elif token == 'PFT:busy': + print("Broken transfer detected, purging") + self.abort() + time.sleep(0.1) + self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.OPEN, payload); + timeout.reset() + elif token == 'PFT:fail': + raise Exception("Can not open file on client") + except ReadTimeout: + pass + raise ReadTimeout() + + def write(self, data): + self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.WRITE, data); + + def close(self): + self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.CLOSE); + token, data = self.await_response(1000) + if token == 'PFT:success': + print("File closed") + return + elif token == 'PFT:ioerror': + print("Client storage device IO error") + elif token == 'PFT:invalid': + print("No open file") + + def abort(self): + self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.ABORT); + token, data = self.await_response() + if token == 'PFT:success': + print("Transfer Aborted") + + def copy(self, filename, dest_filename, compression, dummy): + self.connect() + + compression_support = heatshrink_exists and self.compression['algorithm'] == 'heatshrink' and compression + if compression and (not heatshrink_exists or not self.compression['algorithm'] == 'heatshrink'): + print("Compression not supported by client") + #compression_support = False + + data = open(filename, "rb").read() + filesize = len(data) + + self.open(dest_filename, compression_support, dummy) + + block_size = self.protocol.block_size + if compression_support: + data = heatshrink.encode(data, window_sz2=self.compression['window'], lookahead_sz2=self.compression['lookahead']) + + cratio = filesize / len(data) + + blocks = math.floor((len(data) + block_size - 1) / block_size) + kibs = 0 + dump_pctg = 0 + start_time = millis() + for i in range(blocks): + start = block_size * i + end = start + block_size + self.write(data[start:end]) + kibs = (( (i+1) * block_size) / 1024) / (millis() + 1 - start_time) * 1000 + if (i / blocks) >= dump_pctg: + print("\r{0:2.2f}% {1:4.2f}KiB/s {2} Errors: {3}".format((i / blocks) * 100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression_support else "", self.protocol.errors), end='') + dump_pctg += 0.1 + print("\r{0:2.2f}% {1:4.2f}KiB/s {2} Errors: {3}".format(100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression_support else "", self.protocol.errors)) # no one likes transfers finishing at 99.8% + + self.close() + print("Transfer complete") + + +class EchoProtocol(object): + def __init__(self, protocol): + protocol.register(['echo:'], self.process_input) + self.protocol = protocol + + def process_input(self, data): + print(data) diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py new file mode 100644 index 000000000000..bfce4ea49dfd --- /dev/null +++ b/buildroot/share/scripts/upload.py @@ -0,0 +1,274 @@ +import argparse +import sys +import os +import time +import random +import serial + +Import("env") + +# Needed (only) for compression, but there are problems with pip install heatshrink +#try: +# import heatshrink +#except ImportError: +# # Install heatshrink +# print("Installing 'heatshrink' python module...") +# env.Execute(env.subst("$PYTHONEXE -m pip install heatshrink")) +# +# Not tested: If it's safe to install python libraries in PIO python try: +# env.Execute(env.subst("$PYTHONEXE -m pip install https://github.com/p3p/pyheatshrink/releases/download/0.3.3/pyheatshrink-pip.zip")) + +import MarlinBinaryProtocol + +# Internal debug flag +Debug = False + +#-----------------# +# Upload Callback # +#-----------------# +def Upload(source, target, env): + + #------------------# + # Marlin functions # + #------------------# + def _GetMarlinEnv(marlinEnv, feature): + if not marlinEnv: return None + return marlinEnv[feature] if feature in marlinEnv else None + + #----------------# + # Port functions # + #----------------# + def _GetUploadPort(env): + if Debug: print('Autodetecting upload port...') + env.AutodetectUploadPort(env) + port = env.subst('$UPLOAD_PORT') + if not port: + raise Exception('Error detecting the upload port.') + if Debug: print('OK') + return port + + #-------------------------# + # Simple serial functions # + #-------------------------# + def _Send(data): + if Debug: print(f'>> {data}') + strdata = bytearray(data, 'utf8') + b'\n' + port.write(strdata) + time.sleep(0.010) + + def _Recv(): + clean_responses = [] + responses = port.readlines() + for Resp in responses: + # Test: suppress invaid chars (coming from debug info) + try: + clean_response = Resp.decode('utf8').rstrip().lstrip() + clean_responses.append(clean_response) + except: + pass + if Debug: print(f'<< {clean_response}') + return clean_responses + + #------------------# + # SDCard functions # + #------------------# + def _CheckSDCard(): + if Debug: print('Checking SD card...') + _Send('M21') + Responses = _Recv() + if len(Responses) < 1 or not any('SD card ok' in r for r in Responses): + raise Exception('Error accessing SD card') + if Debug: print('SD Card OK') + return True + + #----------------# + # File functions # + #----------------# + def _GetFirmwareFiles(): + if Debug: print('Get firmware files...') + _Send('M20 F') + Responses = _Recv() + if len(Responses) < 3 or not any('file list' in r for r in Responses): + raise Exception('Error getting firmware files') + if Debug: print('OK') + return Responses + + def _FilterFirmwareFiles(FirmwareList): + Firmwares = [] + for FWFile in FirmwareList: + if not '/' in FWFile and '.BIN' in FWFile: + idx = FWFile.index('.BIN') + Firmwares.append(FWFile[:idx+4]) + return Firmwares + + def _RemoveFirmwareFile(FirmwareFile): + _Send(f'M30 /{FirmwareFile}') + Responses = _Recv() + Removed = len(Responses) >= 1 and any('File deleted' in r for r in Responses) + if not Removed: + raise Exception(f"Firmware file '{FirmwareFile}' not removed") + return Removed + + + #---------------------# + # Callback Entrypoint # + #---------------------# + port = None + protocol = None + filetransfer = None + + # Get Marlin evironment vars + MarlinEnv = env['MARLIN_FEATURES'] + marlin_pioenv = _GetMarlinEnv(MarlinEnv, 'PIOENV') + marlin_motherboard = _GetMarlinEnv(MarlinEnv, 'MOTHERBOARD') + marlin_board_info_name = _GetMarlinEnv(MarlinEnv, 'BOARD_INFO_NAME') + marlin_board_custom_build_flags = _GetMarlinEnv(MarlinEnv, 'BOARD_CUSTOM_BUILD_FLAGS') + marlin_firmware_bin = _GetMarlinEnv(MarlinEnv, 'FIRMWARE_BIN') + marlin_custom_firmware_upload = _GetMarlinEnv(MarlinEnv, 'CUSTOM_FIRMWARE_UPLOAD') is not None + marlin_short_build_version = _GetMarlinEnv(MarlinEnv, 'SHORT_BUILD_VERSION') + marlin_string_config_h_author = _GetMarlinEnv(MarlinEnv, 'STRING_CONFIG_H_AUTHOR') + + # Get firmware upload params + upload_firmware_source_name = str(source[0]) # Source firmware filename + upload_speed = env['UPLOAD_SPEED'] if 'UPLOAD_SPEED' in env else 115200 + # baud rate of serial connection + upload_port = _GetUploadPort(env) # Serial port to use + + # Set local upload params + upload_firmware_target_name = os.path.basename(upload_firmware_source_name) # WARNING! Need rework on "binary_stream" to allow filename > 8.3 + # Target firmware filename + upload_timeout = 1000 # Communication timout, lossy/slow connections need higher values + upload_blocksize = 512 # Transfer block size. 512 = Autodetect + upload_compression = True # Enable compression + upload_error_ratio = 0 # Simulated corruption ratio + upload_test = False # Benchmark the serial link without storing the file + upload_reset = True # Trigger a soft reset for firmware update after the upload + + # Set local upload params based on board type to change script behavior + # "upload_delete_old_bins": delete all *.bin files in the root of SD Card + upload_delete_old_bins = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V423', 'BOARD_CREALITY_V427', + 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', 'BOARD_CREALITY_V24S1'] + try: + + # Start upload job + print(f"Uploading firmware '{os.path.basename(upload_firmware_target_name)}' to '{marlin_motherboard}' via '{upload_port}'") + + # Dump some debug info + if Debug: + print('Upload using:') + print('---- Marlin --------------------') + print(f' PIOENV : {marlin_pioenv}') + print(f' SHORT_BUILD_VERSION : {marlin_short_build_version}') + print(f' STRING_CONFIG_H_AUTHOR : {marlin_string_config_h_author}') + print(f' MOTHERBOARD : {marlin_motherboard}') + print(f' BOARD_INFO_NAME : {marlin_board_info_name}') + print(f' CUSTOM_BUILD_FLAGS : {marlin_board_custom_build_flags}') + print(f' FIRMWARE_BIN : {marlin_firmware_bin}') + print(f' CUSTOM_FIRMWARE_UPLOAD : {marlin_custom_firmware_upload}') + print('---- Upload parameters ---------') + print(f' Source : {upload_firmware_source_name}') + print(f' Target : {upload_firmware_target_name}') + print(f' Port : {upload_port} @ {upload_speed} baudrate') + print(f' Timeout : {upload_timeout}') + print(f' Block size : {upload_blocksize}') + print(f' Compression : {upload_compression}') + print(f' Error ratio : {upload_error_ratio}') + print(f' Test : {upload_test}') + print(f' Reset : {upload_reset}') + print('--------------------------------') + + # Custom implementations based on board parameters + + # Delete all *.bin files on the root of SD Card (if flagged) + if upload_delete_old_bins: + # CUSTOM_FIRMWARE_UPLOAD is needed for this feature + if not marlin_custom_firmware_upload: + raise Exception(f"CUSTOM_FIRMWARE_UPLOAD must be enabled in 'Configuration_adv.h' for '{marlin_motherboard}'") + + # Generate a new 8.3 random filename + # This board remember the last firmware filename and doesn't allow to flash from that filename + upload_firmware_target_name = f"fw-{''.join(random.choices('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', k=5))}.BIN" + print(f"Board {marlin_motherboard}: Overriding firmware filename to '{upload_firmware_target_name}'") + + # Init serial port + port = serial.Serial(upload_port, baudrate = upload_speed, write_timeout = 0, timeout = 0.1) + port.reset_input_buffer() + + # Check SD card status + _CheckSDCard() + + # Get firmware files + FirmwareFiles = _GetFirmwareFiles() + if Debug: + for FirmwareFile in FirmwareFiles: + print(f'Found: {FirmwareFile}') + + # Get all 1st level firmware files (to remove) + OldFirmwareFiles = _FilterFirmwareFiles(FirmwareFiles[1:len(FirmwareFiles)-2]) # Skip header and footers of list + if len(OldFirmwareFiles) == 0: + print('No old firmware files to delete') + else: + print(f"Remove {len(OldFirmwareFiles)} old firmware file{'s' if len(OldFirmwareFiles) != 1 else ''}:") + for OldFirmwareFile in OldFirmwareFiles: + print(f" -Removing- '{OldFirmwareFile}'...") + print(' OK' if _RemoveFirmwareFile(OldFirmwareFile) else ' Error!') + + # Close serial + port.close() + + # Cleanup completed + if Debug: print('Cleanup completed') + + # WARNING! The serial port must be closed here because the serial transfer that follow needs it! + + # Upload firmware file + if Debug: print(f"Copy '{upload_firmware_source_name}' --> '{upload_firmware_target_name}'") + protocol = MarlinBinaryProtocol.Protocol(upload_port, upload_speed, upload_blocksize, float(upload_error_ratio), int(upload_timeout)) + #echologger = MarlinBinaryProtocol.EchoProtocol(protocol) + protocol.connect() + filetransfer = MarlinBinaryProtocol.FileTransferProtocol(protocol) + filetransfer.copy(upload_firmware_source_name, upload_firmware_target_name, upload_compression, upload_test) + protocol.disconnect() + + # Notify upload completed + protocol.send_ascii('M117 Firmware uploaded') + + # Remount SD card + print('Wait for SD card release...') + time.sleep(1) + print('Remount SD card') + protocol.send_ascii('M21') + + # Trigger firmware update + if upload_reset: + print('Trigger firmware update...') + protocol.send_ascii('M997', True) + + protocol: protocol.shutdown() + print('Firmware update completed') + + except KeyboardInterrupt: + if port: port.close() + if filetransfer: filetransfer.abort() + if protocol: protocol.shutdown() + raise + + except serial.SerialException as se: + if port: port.close() + print(f'Serial excepion: {se}') + raise Exception(se) + + except MarlinBinaryProtocol.FatalError: + if port: port.close() + if protocol: protocol.shutdown() + print('Too many retries, Abort') + raise + + except: + if port: port.close() + if protocol: protocol.shutdown() + print('Firmware not updated') + raise + +# Attach custom upload callback +env.Replace(UPLOADCMD=Upload) diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 939f51ffbf69..a0957dbaece3 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -100,7 +100,6 @@ build_flags = ${common_STM32F103RC_variant.build_flags} -DTIMER_SERVO=TIM5 -DDEFAULT_SPI=3 build_unflags = ${common_STM32F103RC_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -monitor_speed = 115200 debug_tool = stlink # @@ -124,6 +123,12 @@ monitor_speed = 115200 debug_tool = jlink upload_protocol = jlink +[env:STM32F103RET6_creality_xfer] +extends = env:STM32F103RET6_creality +extra_scripts = ${env:STM32F103RET6_creality.extra_scripts} + pre:buildroot/share/scripts/upload.py +upload_protocol = custom + # # BigTree SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3) # From c478ed08c886475735b7fc11769e4c504306dbb2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 10 Jan 2022 19:49:54 -0600 Subject: [PATCH 023/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Adj?= =?UTF-8?q?ust=20FastIO=20AVR=20timer=20enums,=20macros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/HAL.h | 2 +- Marlin/src/HAL/AVR/fast_pwm.cpp | 148 ++++++++++++++++------------ Marlin/src/HAL/AVR/fastio.h | 43 +++----- Marlin/src/HAL/LPC1768/HAL.h | 2 +- Marlin/src/HAL/LPC1768/fast_pwm.cpp | 2 +- Marlin/src/HAL/STM32/HAL.h | 2 +- Marlin/src/HAL/STM32/fast_pwm.cpp | 2 +- Marlin/src/HAL/STM32F1/HAL.h | 2 +- Marlin/src/HAL/STM32F1/fast_pwm.cpp | 2 +- 9 files changed, 105 insertions(+), 100 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index 2217f239d64e..451ed1ee9f3b 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -217,7 +217,7 @@ inline void HAL_adc_init() { * NOTE that the frequency is applied to all pins on the timer (Ex OC3A, OC3B and OC3B) * NOTE that there are limitations, particularly if using TIMER2. (see Configuration_adv.h -> FAST FAN PWM Settings) */ -void set_pwm_frequency(const pin_t pin, int f_desired); +void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); /** * set_pwm_duty diff --git a/Marlin/src/HAL/AVR/fast_pwm.cpp b/Marlin/src/HAL/AVR/fast_pwm.cpp index 804e5fad3070..9c6d6f55143c 100644 --- a/Marlin/src/HAL/AVR/fast_pwm.cpp +++ b/Marlin/src/HAL/AVR/fast_pwm.cpp @@ -34,6 +34,24 @@ struct Timer { uint8_t q; // the timer output [0->2] (A->C) }; +// Macros for the Timer structure +#define _SET_WGMnQ(TCCRnQ, V) do{ \ + *(TCCRnQ)[0] = (*(TCCRnQ)[0] & ~(0x3 << 0)) | (( int(V) & 0x3) << 0); \ + *(TCCRnQ)[1] = (*(TCCRnQ)[1] & ~(0x3 << 3)) | (((int(V) >> 2) & 0x3) << 3); \ + }while(0) + +// Set TCCR CS bits +#define _SET_CSn(TCCRnQ, V) (*(TCCRnQ)[1] = (*(TCCRnQ[1]) & ~(0x7 << 0)) | ((int(V) & 0x7) << 0)) + +// Set TCCR COM bits +#define _SET_COMnQ(TCCRnQ, Q, V) (*(TCCRnQ)[0] = (*(TCCRnQ)[0] & ~(0x3 << (6-2*(Q)))) | (int(V) << (6-2*(Q)))) + +// Set OCRnQ register +#define _SET_OCRnQ(OCRnQ, Q, V) (*(OCRnQ)[Q] = int(V) & 0xFFFF) + +// Set ICRn register (one per timer) +#define _SET_ICRn(ICRn, V) (*(ICRn) = int(V) & 0xFFFF) + /** * get_pwm_timer * Get the timer information and register of the provided pin. @@ -42,115 +60,119 @@ struct Timer { */ Timer get_pwm_timer(const pin_t pin) { uint8_t q = 0; + switch (digitalPinToTimer(pin)) { // Protect reserved timers (TIMER0 & TIMER1) #ifdef TCCR0A - #if !AVR_AT90USB1286_FAMILY - case TIMER0A: - #endif + IF_DISABLED(AVR_AT90USB1286_FAMILY, case TIMER0A:) case TIMER0B: #endif #ifdef TCCR1A case TIMER1A: case TIMER1B: #endif - break; - #if HAS_TCCR2 || defined(TCCR2A) - #if HAS_TCCR2 - case TIMER2: { + + break; + + #if HAS_TCCR2 + case TIMER2: { + Timer timer = { + { &TCCR2, nullptr, nullptr }, + { (uint16_t*)&OCR2, nullptr, nullptr }, + nullptr, + 2, 0 + }; + return timer; + } + #elif defined(TCCR2A) + #if ENABLED(USE_OCR2A_AS_TOP) + case TIMER2A: break; // protect TIMER2A + case TIMER2B: { Timer timer = { - /*TCCRnQ*/ { &TCCR2, nullptr, nullptr }, - /*OCRnQ*/ { (uint16_t*)&OCR2, nullptr, nullptr }, - /*ICRn*/ nullptr, - /*n, q*/ 2, 0 + { &TCCR2A, &TCCR2B, nullptr }, + { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, + nullptr, + 2, 1 }; + return timer; + } + #else + case TIMER2B: ++q; + case TIMER2A: { + Timer timer = { + { &TCCR2A, &TCCR2B, nullptr }, + { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, + nullptr, + 2, q + }; + return timer; } - #elif defined(TCCR2A) - #if ENABLED(USE_OCR2A_AS_TOP) - case TIMER2A: break; // protect TIMER2A - case TIMER2B: { - Timer timer = { - /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr }, - /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, - /*ICRn*/ nullptr, - /*n, q*/ 2, 1 - }; - return timer; - } - #else - case TIMER2B: ++q; - case TIMER2A: { - Timer timer = { - /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr }, - /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, - /*ICRn*/ nullptr, - 2, q - }; - return timer; - } - #endif #endif #endif + #ifdef OCR3C - case TIMER3C: ++q; - case TIMER3B: ++q; + case TIMER3C: ++q; + case TIMER3B: ++q; case TIMER3A: { Timer timer = { - /*TCCRnQ*/ { &TCCR3A, &TCCR3B, &TCCR3C }, - /*OCRnQ*/ { &OCR3A, &OCR3B, &OCR3C }, - /*ICRn*/ &ICR3, - /*n, q*/ 3, q + { &TCCR3A, &TCCR3B, &TCCR3C }, + { &OCR3A, &OCR3B, &OCR3C }, + &ICR3, + 3, q }; return timer; } #elif defined(OCR3B) - case TIMER3B: ++q; + case TIMER3B: ++q; case TIMER3A: { Timer timer = { - /*TCCRnQ*/ { &TCCR3A, &TCCR3B, nullptr }, - /*OCRnQ*/ { &OCR3A, &OCR3B, nullptr }, - /*ICRn*/ &ICR3, - /*n, q*/ 3, q + { &TCCR3A, &TCCR3B, nullptr }, + { &OCR3A, &OCR3B, nullptr }, + &ICR3, + 3, q }; return timer; } #endif + #ifdef TCCR4A - case TIMER4C: ++q; - case TIMER4B: ++q; + case TIMER4C: ++q; + case TIMER4B: ++q; case TIMER4A: { Timer timer = { - /*TCCRnQ*/ { &TCCR4A, &TCCR4B, &TCCR4C }, - /*OCRnQ*/ { &OCR4A, &OCR4B, &OCR4C }, - /*ICRn*/ &ICR4, - /*n, q*/ 4, q + { &TCCR4A, &TCCR4B, &TCCR4C }, + { &OCR4A, &OCR4B, &OCR4C }, + &ICR4, + 4, q }; return timer; } #endif + #ifdef TCCR5A - case TIMER5C: ++q; - case TIMER5B: ++q; + case TIMER5C: ++q; + case TIMER5B: ++q; case TIMER5A: { Timer timer = { - /*TCCRnQ*/ { &TCCR5A, &TCCR5B, &TCCR5C }, - /*OCRnQ*/ { &OCR5A, &OCR5B, &OCR5C }, - /*ICRn*/ &ICR5, - /*n, q*/ 5, q + { &TCCR5A, &TCCR5B, &TCCR5C }, + { &OCR5A, &OCR5B, &OCR5C }, + &ICR5, + 5, q }; return timer; } #endif } + Timer timer = { - /*TCCRnQ*/ { nullptr, nullptr, nullptr }, - /*OCRnQ*/ { nullptr, nullptr, nullptr }, - /*ICRn*/ nullptr, - 0, 0 + { nullptr, nullptr, nullptr }, + { nullptr, nullptr, nullptr }, + nullptr, + 0, 0 }; return timer; } -void set_pwm_frequency(const pin_t pin, int f_desired) { +void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { Timer timer = get_pwm_timer(pin); if (timer.n == 0) return; // Don't proceed if protected timer or not recognized uint16_t size; diff --git a/Marlin/src/HAL/AVR/fastio.h b/Marlin/src/HAL/AVR/fastio.h index db6e598b8670..51d3b311ee9d 100644 --- a/Marlin/src/HAL/AVR/fastio.h +++ b/Marlin/src/HAL/AVR/fastio.h @@ -118,7 +118,7 @@ */ // Waveform Generation Modes -enum WaveGenMode : char { +enum WaveGenMode : uint8_t { WGM_NORMAL, // 0 WGM_PWM_PC_8, // 1 WGM_PWM_PC_9, // 2 @@ -138,19 +138,19 @@ enum WaveGenMode : char { }; // Wavefore Generation Modes (Timer 2 only) -enum WaveGenMode2 : char { - WGM2_NORMAL, // 0 - WGM2_PWM_PC, // 1 - WGM2_CTC_OCR2A, // 2 - WGM2_FAST_PWM, // 3 - WGM2_reserved_1, // 4 - WGM2_PWM_PC_OCR2A, // 5 - WGM2_reserved_2, // 6 - WGM2_FAST_PWM_OCR2A, // 7 +enum WaveGenMode2 : uint8_t { + WGM2_NORMAL, // 0 + WGM2_PWM_PC, // 1 + WGM2_CTC_OCR2A, // 2 + WGM2_FAST_PWM, // 3 + WGM2_reserved_1, // 4 + WGM2_PWM_PC_OCR2A, // 5 + WGM2_reserved_2, // 6 + WGM2_FAST_PWM_OCR2A, // 7 }; // Compare Modes -enum CompareMode : char { +enum CompareMode : uint8_t { COM_NORMAL, // 0 COM_TOGGLE, // 1 Non-PWM: OCnx ... Both PWM (WGM 9,11,14,15): OCnA only ... else NORMAL COM_CLEAR_SET, // 2 Non-PWM: OCnx ... Fast PWM: OCnx/Bottom ... PF-FC: OCnx Up/Down @@ -158,7 +158,7 @@ enum CompareMode : char { }; // Clock Sources -enum ClockSource : char { +enum ClockSource : uint8_t { CS_NONE, // 0 CS_PRESCALER_1, // 1 CS_PRESCALER_8, // 2 @@ -170,7 +170,7 @@ enum ClockSource : char { }; // Clock Sources (Timer 2 only) -enum ClockSource2 : char { +enum ClockSource2 : uint8_t { CS2_NONE, // 0 CS2_PRESCALER_1, // 1 CS2_PRESCALER_8, // 2 @@ -203,11 +203,6 @@ enum ClockSource2 : char { TCCR##T##B = (TCCR##T##B & ~(0x3 << WGM##T##2)) | (((int(V) >> 2) & 0x3) << WGM##T##2); \ }while(0) #define SET_WGM(T,V) _SET_WGM(T,WGM_##V) -// Runtime (see set_pwm_frequency): -#define _SET_WGMnQ(TCCRnQ, V) do{ \ - *(TCCRnQ)[0] = (*(TCCRnQ)[0] & ~(0x3 << 0)) | (( int(V) & 0x3) << 0); \ - *(TCCRnQ)[1] = (*(TCCRnQ)[1] & ~(0x3 << 3)) | (((int(V) >> 2) & 0x3) << 3); \ - }while(0) // Set Clock Select bits // Ex: SET_CS3(PRESCALER_64); @@ -235,8 +230,6 @@ enum ClockSource2 : char { #define SET_CS4(V) _SET_CS4(CS_##V) #define SET_CS5(V) _SET_CS5(CS_##V) #define SET_CS(T,V) SET_CS##T(V) -// Runtime (see set_pwm_frequency) -#define _SET_CSn(TCCRnQ, V) (*(TCCRnQ)[1] = (*(TCCRnQ[1]) & ~(0x7 << 0)) | ((int(V) & 0x7) << 0)) // Set Compare Mode bits // Ex: SET_COMS(4,CLEAR_SET,CLEAR_SET,CLEAR_SET); @@ -246,16 +239,6 @@ enum ClockSource2 : char { #define SET_COMB(T,V) SET_COM(T,B,V) #define SET_COMC(T,V) SET_COM(T,C,V) #define SET_COMS(T,V1,V2,V3) do{ SET_COMA(T,V1); SET_COMB(T,V2); SET_COMC(T,V3); }while(0) -// Runtime (see set_pwm_duty) -#define _SET_COMnQ(TCCRnQ, Q, V) (*(TCCRnQ)[0] = (*(TCCRnQ)[0] & ~(0x3 << (6-2*(Q)))) | (int(V) << (6-2*(Q)))) - -// Set OCRnQ register -// Runtime (see set_pwm_duty): -#define _SET_OCRnQ(OCRnQ, Q, V) (*(OCRnQ)[Q] = int(V) & 0xFFFF) - -// Set ICRn register (one per timer) -// Runtime (see set_pwm_frequency) -#define _SET_ICRn(ICRn, V) (*(ICRn) = int(V) & 0xFFFF) // Set Noise Canceler bit // Ex: SET_ICNC(2,1) diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index 348ea6b21a04..f5e432698317 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -206,7 +206,7 @@ void flashFirmware(const int16_t); * All Hardware PWM pins run at the same frequency and all * Software PWM pins run at the same frequency */ -void set_pwm_frequency(const pin_t pin, int f_desired); +void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); /** * set_pwm_duty diff --git a/Marlin/src/HAL/LPC1768/fast_pwm.cpp b/Marlin/src/HAL/LPC1768/fast_pwm.cpp index eae0e36b0b0e..d760cd0fd020 100644 --- a/Marlin/src/HAL/LPC1768/fast_pwm.cpp +++ b/Marlin/src/HAL/LPC1768/fast_pwm.cpp @@ -32,7 +32,7 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 #if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM - void set_pwm_frequency(const pin_t pin, int f_desired) { + void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { LPC176x::pwm_set_frequency(pin, f_desired); } diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index adaf14223f32..9429bb7e7ca7 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -231,7 +231,7 @@ extern volatile uint32_t systick_uptime_millis; * Set the frequency of the timer corresponding to the provided pin * All Timer PWM pins run at the same frequency */ -void set_pwm_frequency(const pin_t pin, int f_desired); +void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); /** * set_pwm_duty diff --git a/Marlin/src/HAL/STM32/fast_pwm.cpp b/Marlin/src/HAL/STM32/fast_pwm.cpp index b1bea5ce20eb..f661e11350ef 100644 --- a/Marlin/src/HAL/STM32/fast_pwm.cpp +++ b/Marlin/src/HAL/STM32/fast_pwm.cpp @@ -56,7 +56,7 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) HT->resume(); } -void set_pwm_frequency(const pin_t pin, int f_desired) { +void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer const PinName pin_name = digitalPinToPinName(pin); TIM_TypeDef * const Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index 153cfe8ac89e..a766babe155b 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -274,7 +274,7 @@ void flashFirmware(const int16_t); * Set the frequency of the timer corresponding to the provided pin * All Timer PWM pins run at the same frequency */ -void set_pwm_frequency(const pin_t pin, int f_desired); +void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); /** * set_pwm_duty diff --git a/Marlin/src/HAL/STM32F1/fast_pwm.cpp b/Marlin/src/HAL/STM32F1/fast_pwm.cpp index 98d56bc5e931..c783dda60683 100644 --- a/Marlin/src/HAL/STM32F1/fast_pwm.cpp +++ b/Marlin/src/HAL/STM32F1/fast_pwm.cpp @@ -51,7 +51,7 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 timer_set_mode(timer, channel, TIMER_PWM); // PWM Output Mode } -void set_pwm_frequency(const pin_t pin, int f_desired) { +void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer timer_dev *timer; UNUSED(timer); From 7b79d53de0c416d6a4b8817dd35d6b945dbd1ab7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 10 Jan 2022 20:29:09 -0600 Subject: [PATCH 024/502] =?UTF-8?q?=F0=9F=8E=A8=20Misc.=20spindle/laser=20?= =?UTF-8?q?adjustments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/inc/SanityCheck.h | 2 +- Marlin/src/HAL/LPC1768/fast_pwm.cpp | 10 +++------- Marlin/src/feature/spindle_laser.cpp | 8 +++----- Marlin/src/lcd/menu/menu_spindle_laser.cpp | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Marlin/src/HAL/AVR/inc/SanityCheck.h b/Marlin/src/HAL/AVR/inc/SanityCheck.h index 2f80d1fee165..331d0b04648b 100644 --- a/Marlin/src/HAL/AVR/inc/SanityCheck.h +++ b/Marlin/src/HAL/AVR/inc/SanityCheck.h @@ -42,7 +42,7 @@ #elif NUM_SERVOS > 0 && defined(_useTimer3) && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5) #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system." #endif -#elif defined(SPINDLE_LASER_FREQUENCY) +#elif SPINDLE_LASER_FREQUENCY #error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_USE_PWM." #endif diff --git a/Marlin/src/HAL/LPC1768/fast_pwm.cpp b/Marlin/src/HAL/LPC1768/fast_pwm.cpp index d760cd0fd020..ece115aa01ae 100644 --- a/Marlin/src/HAL/LPC1768/fast_pwm.cpp +++ b/Marlin/src/HAL/LPC1768/fast_pwm.cpp @@ -30,12 +30,8 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 LPC176x::pwm_write_ratio(pin, invert ? 1.0f - (float)v / v_size : (float)v / v_size); // map 1-254 onto PWM range } -#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM - - void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { - LPC176x::pwm_set_frequency(pin, f_desired); - } - -#endif +void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { + LPC176x::pwm_set_frequency(pin, f_desired); +} #endif // TARGET_LPC1768 diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index cde2b47d90aa..9ca7cb948e69 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -68,7 +68,7 @@ void SpindleLaser::init() { SET_PWM(SPINDLE_LASER_PWM_PIN); set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Set to lowest speed #endif - #if ENABLED(HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY) + #if ENABLED(HAL_CAN_SET_PWM_FREQ) && SPINDLE_LASER_FREQUENCY set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_FREQUENCY); TERN_(MARLIN_DEV_MODE, frequency = SPINDLE_LASER_FREQUENCY); #endif @@ -78,9 +78,7 @@ void SpindleLaser::init() { #if ENABLED(AIR_ASSIST) OUT_WRITE(AIR_ASSIST_PIN, !AIR_ASSIST_ACTIVE); // Init Air Assist OFF #endif - #if ENABLED(I2C_AMMETER) - ammeter.init(); // Init I2C Ammeter - #endif + TERN_(I2C_AMMETER, ammeter.init()); // Init I2C Ammeter } #if ENABLED(SPINDLE_LASER_USE_PWM) @@ -90,7 +88,7 @@ void SpindleLaser::init() { * @param ocr Power value */ void SpindleLaser::_set_ocr(const uint8_t ocr) { - #if NEEDS_HARDWARE_PWM && SPINDLE_LASER_FREQUENCY + #if ENABLED(HAL_CAN_SET_PWM_FREQ) && SPINDLE_LASER_FREQUENCY set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), TERN(MARLIN_DEV_MODE, frequency, SPINDLE_LASER_FREQUENCY)); #endif set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp index 26f555ad620d..ca3d6f66a6d4 100644 --- a/Marlin/src/lcd/menu/menu_spindle_laser.cpp +++ b/Marlin/src/lcd/menu/menu_spindle_laser.cpp @@ -74,7 +74,7 @@ ACTION_ITEM(MSG_LASER_FIRE_PULSE, cutter.test_fire_pulse); #endif - #if BOTH(MARLIN_DEV_MODE, HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY) + #if BOTH(MARLIN_DEV_MODE, HAL_CAN_SET_PWM_FREQ) && SPINDLE_LASER_FREQUENCY EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 80000, cutter.refresh_frequency); #endif From 0204547c090767beb6eaa470c8f98e7b0a5aede8 Mon Sep 17 00:00:00 2001 From: Lefteris Garyfalakis <46350667+lefterisgar@users.noreply.github.com> Date: Wed, 12 Jan 2022 18:22:00 +0200 Subject: [PATCH 025/502] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20E3V2=20Enhanced=20?= =?UTF-8?q?UI=20time=20labels=20(#23502)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_en.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 12430ed4c0af..bb69aad432cb 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -456,6 +456,7 @@ namespace Language_en { LSTR MSG_PRINT_PAUSED = _UxGT("Print Paused"); LSTR MSG_PRINTING = _UxGT("Printing..."); LSTR MSG_STOPPING = _UxGT("Stopping..."); + LSTR MSG_REMAINING_TIME = _UxGT("Remaining"); LSTR MSG_PRINT_ABORTED = _UxGT("Print Aborted"); LSTR MSG_PRINT_DONE = _UxGT("Print Done"); LSTR MSG_NO_MOVE = _UxGT("No Move."); @@ -595,12 +596,11 @@ namespace Language_en { #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No media inserted."); - LSTR MSG_REMAINING_TIME = _UxGT("Remaining time"); LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Please wait until reboot. "); LSTR MSG_PLEASE_PREHEAT = _UxGT("Please preheat the hot end."); LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Reset Print Count"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Print Count"); - LSTR MSG_INFO_PRINT_TIME = _UxGT("Total Print Time"); + LSTR MSG_INFO_PRINT_TIME = _UxGT("Print Time"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Longest Job Time"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded Total"); LSTR MSG_COLORS_GET = _UxGT("Get Color"); @@ -616,7 +616,6 @@ namespace Language_en { LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No Media"); LSTR MSG_PLEASE_PREHEAT = _UxGT("Please Preheat"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Prints"); - LSTR MSG_REMAINING_TIME = _UxGT("Remaining"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Total"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Longest"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded"); From 39e4310c7bc108444fbcbaa09386b63c9910ab30 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Wed, 12 Jan 2022 17:28:53 -0600 Subject: [PATCH 026/502] =?UTF-8?q?=F0=9F=90=9B=20Fix,=20improve=20PWM=20o?= =?UTF-8?q?n=20AVR=20(#23463)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/HAL.cpp | 2 + Marlin/src/HAL/AVR/HAL.h | 7 + Marlin/src/HAL/AVR/fast_pwm.cpp | 261 +++++++++++------------------- Marlin/src/HAL/AVR/fastio.cpp | 2 +- Marlin/src/inc/Conditionals_adv.h | 5 - Marlin/src/module/stepper.cpp | 41 ++--- Marlin/src/module/stepper.h | 4 + 7 files changed, 132 insertions(+), 190 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL.cpp b/Marlin/src/HAL/AVR/HAL.cpp index d7bf2a6f6fbb..666802725bc0 100644 --- a/Marlin/src/HAL/AVR/HAL.cpp +++ b/Marlin/src/HAL/AVR/HAL.cpp @@ -75,6 +75,8 @@ void HAL_init() { #if HAS_SERVO_3 INIT_SERVO(3); #endif + + init_pwm_timers(); // Init user timers to default frequency - 1000HZ } void HAL_reboot() { diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index 451ed1ee9f3b..f5cbcc9d51e1 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -207,6 +207,7 @@ inline void HAL_adc_init() { #define strtof strtod #define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment +#define PWM_FREQUENCY 1000 // Default PWM frequency when set_pwm_duty() is called without set_pwm_frequency() /** * set_pwm_frequency @@ -226,3 +227,9 @@ void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255] */ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); + +/* + * init_pwm_timers + * sets the default frequency for timers 2-5 to 1000HZ + */ +void init_pwm_timers(); diff --git a/Marlin/src/HAL/AVR/fast_pwm.cpp b/Marlin/src/HAL/AVR/fast_pwm.cpp index 9c6d6f55143c..071f008e8974 100644 --- a/Marlin/src/HAL/AVR/fast_pwm.cpp +++ b/Marlin/src/HAL/AVR/fast_pwm.cpp @@ -21,10 +21,7 @@ */ #ifdef __AVR__ -#include "../../inc/MarlinConfigPre.h" -#include "HAL.h" - -#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM +#include "../../inc/MarlinConfig.h" struct Timer { volatile uint8_t* TCCRnQ[3]; // max 3 TCCR registers per timer @@ -32,6 +29,8 @@ struct Timer { volatile uint16_t* ICRn; // max 1 ICR register per timer uint8_t n; // the timer number [0->5] uint8_t q; // the timer output [0->2] (A->C) + bool isPWM; // True if pin is a "hardware timer" + bool isProtected; // True if timer is protected }; // Macros for the Timer structure @@ -53,16 +52,13 @@ struct Timer { #define _SET_ICRn(ICRn, V) (*(ICRn) = int(V) & 0xFFFF) /** - * get_pwm_timer - * Get the timer information and register of the provided pin. - * Return a Timer struct containing this information. - * Used by set_pwm_frequency, set_pwm_duty + * Return a Timer struct describing a pin's timer. */ Timer get_pwm_timer(const pin_t pin) { + uint8_t q = 0; switch (digitalPinToTimer(pin)) { - // Protect reserved timers (TIMER0 & TIMER1) #ifdef TCCR0A IF_DISABLED(AVR_AT90USB1286_FAMILY, case TIMER0A:) case TIMER0B: @@ -71,212 +67,147 @@ Timer get_pwm_timer(const pin_t pin) { case TIMER1A: case TIMER1B: #endif - break; + break; // Protect reserved timers (TIMER0 & TIMER1) #if HAS_TCCR2 - case TIMER2: { - Timer timer = { - { &TCCR2, nullptr, nullptr }, - { (uint16_t*)&OCR2, nullptr, nullptr }, - nullptr, - 2, 0 - }; - return timer; - } + case TIMER2: + return Timer({ { &TCCR2, nullptr, nullptr }, { (uint16_t*)&OCR2, nullptr, nullptr }, nullptr, 2, 0, true, false }); + #elif ENABLED(USE_OCR2A_AS_TOP) + case TIMER2A: break; // protect TIMER2A since its OCR is used by TIMER2B + case TIMER2B: + return Timer({ { &TCCR2A, &TCCR2B, nullptr }, { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, nullptr, 2, 1, true, false }); #elif defined(TCCR2A) - #if ENABLED(USE_OCR2A_AS_TOP) - case TIMER2A: break; // protect TIMER2A - case TIMER2B: { - Timer timer = { - { &TCCR2A, &TCCR2B, nullptr }, - { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, - nullptr, - 2, 1 - }; - return timer; - } - #else - case TIMER2B: ++q; - case TIMER2A: { - Timer timer = { - { &TCCR2A, &TCCR2B, nullptr }, - { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, - nullptr, - 2, q - }; - return timer; - } - #endif + case TIMER2B: ++q; case TIMER2A: + return Timer({ { &TCCR2A, &TCCR2B, nullptr }, { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, nullptr, 2, q, true, false }); #endif #ifdef OCR3C - case TIMER3C: ++q; - case TIMER3B: ++q; - case TIMER3A: { - Timer timer = { - { &TCCR3A, &TCCR3B, &TCCR3C }, - { &OCR3A, &OCR3B, &OCR3C }, - &ICR3, - 3, q - }; - return timer; - } + case TIMER3C: ++q; case TIMER3B: ++q; case TIMER3A: + return Timer({ { &TCCR3A, &TCCR3B, &TCCR3C }, { &OCR3A, &OCR3B, &OCR3C }, &ICR3, 3, q, true, false }); #elif defined(OCR3B) - case TIMER3B: ++q; - case TIMER3A: { - Timer timer = { - { &TCCR3A, &TCCR3B, nullptr }, - { &OCR3A, &OCR3B, nullptr }, - &ICR3, - 3, q - }; - return timer; - } + case TIMER3B: ++q; case TIMER3A: + return Timer({ { &TCCR3A, &TCCR3B, nullptr }, { &OCR3A, &OCR3B, nullptr }, &ICR3, 3, q, true, false }); #endif #ifdef TCCR4A - case TIMER4C: ++q; - case TIMER4B: ++q; - case TIMER4A: { - Timer timer = { - { &TCCR4A, &TCCR4B, &TCCR4C }, - { &OCR4A, &OCR4B, &OCR4C }, - &ICR4, - 4, q - }; - return timer; - } + case TIMER4C: ++q; case TIMER4B: ++q; case TIMER4A: + return Timer({ { &TCCR4A, &TCCR4B, &TCCR4C }, { &OCR4A, &OCR4B, &OCR4C }, &ICR4, 4, q, true, false }); #endif #ifdef TCCR5A - case TIMER5C: ++q; - case TIMER5B: ++q; - case TIMER5A: { - Timer timer = { - { &TCCR5A, &TCCR5B, &TCCR5C }, - { &OCR5A, &OCR5B, &OCR5C }, - &ICR5, - 5, q - }; - return timer; - } + case TIMER5C: ++q; case TIMER5B: ++q; case TIMER5A: + return Timer({ { &TCCR5A, &TCCR5B, &TCCR5C }, { &OCR5A, &OCR5B, &OCR5C }, &ICR5, 5, q, true, false }); #endif } - Timer timer = { - { nullptr, nullptr, nullptr }, - { nullptr, nullptr, nullptr }, - nullptr, - 0, 0 - }; - return timer; + return Timer(); } void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { Timer timer = get_pwm_timer(pin); - if (timer.n == 0) return; // Don't proceed if protected timer or not recognized - uint16_t size; - if (timer.n == 2) size = 255; else size = 65535; + if (timer.isProtected || !timer.isPWM) return; // Don't proceed if protected timer or not recognized + + const bool is_timer2 = timer.n == 2; + const uint16_t maxtop = is_timer2 ? 0xFF : 0xFFFF; - uint16_t res = 255; // resolution (TOP value) - uint8_t j = 0; // prescaler index - uint8_t wgm = 1; // waveform generation mode + uint16_t res = 0xFF; // resolution (TOP value) + uint8_t j = CS_NONE; // prescaler index + uint8_t wgm = WGM_PWM_PC_8; // waveform generation mode // Calculating the prescaler and resolution to use to achieve closest frequency if (f_desired != 0) { - int f = (F_CPU) / (2 * 1024 * size) + 1; // Initialize frequency as lowest (non-zero) achievable - uint16_t prescaler[] = { 0, 1, 8, /*TIMER2 ONLY*/32, 64, /*TIMER2 ONLY*/128, 256, 1024 }; - - // loop over prescaler values - LOOP_S_L_N(i, 1, 8) { - uint16_t res_temp_fast = 255, res_temp_phase_correct = 255; - if (timer.n == 2) { - // No resolution calculation for TIMER2 unless enabled USE_OCR2A_AS_TOP - #if ENABLED(USE_OCR2A_AS_TOP) - const uint16_t rtf = (F_CPU) / (prescaler[i] * f_desired); - res_temp_fast = rtf - 1; - res_temp_phase_correct = rtf / 2; + constexpr uint16_t prescaler[] = { 1, 8, (32), 64, (128), 256, 1024 }; // (*) are Timer 2 only + uint16_t f = (F_CPU) / (2 * 1024 * maxtop) + 1; // Start with the lowest non-zero frequency achievable (1 or 31) + + LOOP_L_N(i, COUNT(prescaler)) { // Loop through all prescaler values + const uint16_t p = prescaler[i]; + uint16_t res_fast_temp, res_pc_temp; + if (is_timer2) { + #if ENABLED(USE_OCR2A_AS_TOP) // No resolution calculation for TIMER2 unless enabled USE_OCR2A_AS_TOP + const uint16_t rft = (F_CPU) / (p * f_desired); + res_fast_temp = rft - 1; + res_pc_temp = rft / 2; + #else + res_fast_temp = res_pc_temp = maxtop; #endif } else { - // Skip TIMER2 specific prescalers when not TIMER2 - if (i == 3 || i == 5) continue; - const uint16_t rtf = (F_CPU) / (prescaler[i] * f_desired); - res_temp_fast = rtf - 1; - res_temp_phase_correct = rtf / 2; + if (p == 32 || p == 128) continue; // Skip TIMER2 specific prescalers when not TIMER2 + const uint16_t rft = (F_CPU) / (p * f_desired); + res_fast_temp = rft - 1; + res_pc_temp = rft / 2; } - LIMIT(res_temp_fast, 1U, size); - LIMIT(res_temp_phase_correct, 1U, size); + LIMIT(res_fast_temp, 1U, maxtop); + LIMIT(res_pc_temp, 1U, maxtop); + // Calculate frequencies of test prescaler and resolution values - const int f_temp_fast = (F_CPU) / (prescaler[i] * (1 + res_temp_fast)), - f_temp_phase_correct = (F_CPU) / (2 * prescaler[i] * res_temp_phase_correct), - f_diff = ABS(f - f_desired), - f_fast_diff = ABS(f_temp_fast - f_desired), - f_phase_diff = ABS(f_temp_phase_correct - f_desired); + const uint32_t f_diff = _MAX(f, f_desired) - _MIN(f, f_desired), + f_fast_temp = (F_CPU) / (p * (1 + res_fast_temp)), + f_fast_diff = _MAX(f_fast_temp, f_desired) - _MIN(f_fast_temp, f_desired), + f_pc_temp = (F_CPU) / (2 * p * res_pc_temp), + f_pc_diff = _MAX(f_pc_temp, f_desired) - _MIN(f_pc_temp, f_desired); - // If FAST values are closest to desired f - if (f_fast_diff < f_diff && f_fast_diff <= f_phase_diff) { - // Remember this combination - f = f_temp_fast; - res = res_temp_fast; - j = i; + if (f_fast_diff < f_diff && f_fast_diff <= f_pc_diff) { // FAST values are closest to desired f // Set the Wave Generation Mode to FAST PWM - if (timer.n == 2) - wgm = TERN(USE_OCR2A_AS_TOP, WGM2_FAST_PWM_OCR2A, WGM2_FAST_PWM); - else - wgm = WGM_FAST_PWM_ICRn; + wgm = is_timer2 ? uint8_t(TERN(USE_OCR2A_AS_TOP, WGM2_FAST_PWM_OCR2A, WGM2_FAST_PWM)) : uint8_t(WGM_FAST_PWM_ICRn); + // Remember this combination + f = f_fast_temp; res = res_fast_temp; j = i + 1; } - // If PHASE CORRECT values are closes to desired f - else if (f_phase_diff < f_diff) { - f = f_temp_phase_correct; - res = res_temp_phase_correct; - j = i; + else if (f_pc_diff < f_diff) { // PHASE CORRECT values are closes to desired f // Set the Wave Generation Mode to PWM PHASE CORRECT - if (timer.n == 2) - wgm = TERN(USE_OCR2A_AS_TOP, WGM2_PWM_PC_OCR2A, WGM2_FAST_PWM); - else - wgm = WGM_PWM_PC_ICRn; + wgm = is_timer2 ? uint8_t(TERN(USE_OCR2A_AS_TOP, WGM2_PWM_PC_OCR2A, WGM2_PWM_PC)) : uint8_t(WGM_PWM_PC_ICRn); + f = f_pc_temp; res = res_pc_temp; j = i + 1; } } } + _SET_WGMnQ(timer.TCCRnQ, wgm); _SET_CSn(timer.TCCRnQ, j); - if (timer.n == 2) { - TERN_(USE_OCR2A_AS_TOP, _SET_OCRnQ(timer.OCRnQ, 0, res)); // Set OCR2A value (TOP) = res + if (is_timer2) { + TERN_(USE_OCR2A_AS_TOP, _SET_OCRnQ(timer.OCRnQ, 0, res)); // Set OCR2A value (TOP) = res } else - _SET_ICRn(timer.ICRn, res); // Set ICRn value (TOP) = res + _SET_ICRn(timer.ICRn, res); // Set ICRn value (TOP) = res } -#endif // NEEDS_HARDWARE_PWM - void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { - #if NEEDS_HARDWARE_PWM - - // If v is 0 or v_size (max), digitalWrite to LOW or HIGH. - // Note that digitalWrite also disables pwm output for us (sets COM bit to 0) - if (v == 0) - digitalWrite(pin, invert); - else if (v == v_size) - digitalWrite(pin, !invert); - else { - Timer timer = get_pwm_timer(pin); - if (timer.n == 0) return; // Don't proceed if protected timer or not recognized - // Set compare output mode to CLEAR -> SET or SET -> CLEAR (if inverted) - _SET_COMnQ(timer.TCCRnQ, timer.q TERN_(HAS_TCCR2, + (timer.q == 2)), COM_CLEAR_SET + invert); // COM20 is on bit 4 of TCCR2, so +1 for q==2 + // If v is 0 or v_size (max), digitalWrite to LOW or HIGH. + // Note that digitalWrite also disables pwm output for us (sets COM bit to 0) + if (v == 0) + digitalWrite(pin, invert); + else if (v == v_size) + digitalWrite(pin, !invert); + else { + Timer timer = get_pwm_timer(pin); + if (timer.isProtected) return; // Leave protected timer unchanged + if (timer.isPWM) { + _SET_COMnQ(timer.TCCRnQ, SUM_TERN(HAS_TCCR2, timer.q, timer.q == 2), COM_CLEAR_SET + invert); // COM20 is on bit 4 of TCCR2, so +1 for q==2 const uint16_t top = timer.n == 2 ? TERN(USE_OCR2A_AS_TOP, *timer.OCRnQ[0], 255) : *timer.ICRn; _SET_OCRnQ(timer.OCRnQ, timer.q, uint16_t(uint32_t(v) * top / v_size)); // Scale 8/16-bit v to top value } + else + digitalWrite(pin, v < 128 ? LOW : HIGH); + } +} - #else - - analogWrite(pin, v); - UNUSED(v_size); - UNUSED(invert); +void init_pwm_timers() { + // Init some timer frequencies to a default 1KHz + const pin_t pwm_pin[] = { + #ifdef __AVR_ATmega2560__ + 10, 5, 6, 46 + #elif defined(__AVR_ATmega1280__) + 12, 31 + #elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega1284__) + 15, 6 + #elif defined(__AVR_AT90USB1286__) || defined(__AVR_mega64) || defined(__AVR_mega128) + 16, 24 + #endif + }; - #endif + LOOP_L_N(i, COUNT(pwm_pin)) + set_pwm_frequency(pwm_pin[i], 1000); } #endif // __AVR__ diff --git a/Marlin/src/HAL/AVR/fastio.cpp b/Marlin/src/HAL/AVR/fastio.cpp index 5083893ae3fd..5c6ef1891512 100644 --- a/Marlin/src/HAL/AVR/fastio.cpp +++ b/Marlin/src/HAL/AVR/fastio.cpp @@ -257,7 +257,7 @@ uint16_t set_pwm_frequency_hz(const_float_t hz, const float dca, const float dcb const float pwm_top = round(count); // Get the rounded count ICR5 = (uint16_t)pwm_top - 1; // Subtract 1 for TOP - OCR5A = pwm_top * ABS(dca); // Update and scale DCs + OCR5A = pwm_top * ABS(dca); // Update and scale DCs OCR5B = pwm_top * ABS(dcb); OCR5C = pwm_top * ABS(dcc); _SET_COM(5, A, dca ? (dca < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL); // Set compare modes diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 8c6e79f36ab1..f2a316d8330e 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -677,11 +677,6 @@ #define CUTTER_UNIT_IS(V) (_CUTTER_POWER(CUTTER_POWER_UNIT) == _CUTTER_POWER(V)) #endif -// Add features that need hardware PWM here -#if ANY(FAST_PWM_FAN, SPINDLE_LASER_USE_PWM) - #define NEEDS_HARDWARE_PWM 1 -#endif - #if !defined(__AVR__) || !defined(USBCON) // Define constants and variables for buffering serial data. // Use only 0 or powers of 2 greater than 1 diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 9a1c8278ba2d..0221f4c8be50 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -3257,33 +3257,33 @@ void Stepper::report_positions() { #elif HAS_MOTOR_CURRENT_PWM - #define _WRITE_CURRENT_PWM(P) set_pwm_duty(pin_t(MOTOR_CURRENT_PWM_## P ##_PIN), 255L * current / (MOTOR_CURRENT_PWM_RANGE)) + #define _WRITE_CURRENT_PWM_DUTY(P) set_pwm_duty(pin_t(MOTOR_CURRENT_PWM_## P ##_PIN), 255L * current / (MOTOR_CURRENT_PWM_RANGE)) switch (driver) { case 0: #if PIN_EXISTS(MOTOR_CURRENT_PWM_X) - _WRITE_CURRENT_PWM(X); + _WRITE_CURRENT_PWM_DUTY(X); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_Y) - _WRITE_CURRENT_PWM(Y); + _WRITE_CURRENT_PWM_DUTY(Y); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - _WRITE_CURRENT_PWM(XY); + _WRITE_CURRENT_PWM_DUTY(XY); #endif break; case 1: #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - _WRITE_CURRENT_PWM(Z); + _WRITE_CURRENT_PWM_DUTY(Z); #endif break; case 2: #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - _WRITE_CURRENT_PWM(E); + _WRITE_CURRENT_PWM_DUTY(E); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E0) - _WRITE_CURRENT_PWM(E0); + _WRITE_CURRENT_PWM_DUTY(E0); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E1) - _WRITE_CURRENT_PWM(E1); + _WRITE_CURRENT_PWM_DUTY(E1); #endif break; } @@ -3302,34 +3302,37 @@ void Stepper::report_positions() { #elif HAS_MOTOR_CURRENT_PWM + #ifdef __SAM3X8E__ + #define _RESET_CURRENT_PWM_FREQ(P) NOOP + #else + #define _RESET_CURRENT_PWM_FREQ(P) set_pwm_frequency(pin_t(P), MOTOR_CURRENT_PWM_FREQUENCY) + #endif + #define INIT_CURRENT_PWM(P) do{ SET_PWM(MOTOR_CURRENT_PWM_## P ##_PIN); _RESET_CURRENT_PWM_FREQ(MOTOR_CURRENT_PWM_## P ##_PIN); }while(0) + #if PIN_EXISTS(MOTOR_CURRENT_PWM_X) - SET_PWM(MOTOR_CURRENT_PWM_X_PIN); + INIT_CURRENT_PWM(X); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_Y) - SET_PWM(MOTOR_CURRENT_PWM_Y_PIN); + INIT_CURRENT_PWM(Y); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - SET_PWM(MOTOR_CURRENT_PWM_XY_PIN); + INIT_CURRENT_PWM(XY); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - SET_PWM(MOTOR_CURRENT_PWM_Z_PIN); + INIT_CURRENT_PWM(Z); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - SET_PWM(MOTOR_CURRENT_PWM_E_PIN); + INIT_CURRENT_PWM(E); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E0) - SET_PWM(MOTOR_CURRENT_PWM_E0_PIN); + INIT_CURRENT_PWM(E0); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E1) - SET_PWM(MOTOR_CURRENT_PWM_E1_PIN); + INIT_CURRENT_PWM(E1); #endif refresh_motor_power(); - // Set Timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise) - #ifdef __AVR__ - SET_CS5(PRESCALER_1); - #endif #endif } diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 6b190889cd31..7967e58c355a 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -317,6 +317,10 @@ class Stepper { #ifndef PWM_MOTOR_CURRENT #define PWM_MOTOR_CURRENT DEFAULT_PWM_MOTOR_CURRENT #endif + #ifndef MOTOR_CURRENT_PWM_FREQUENCY + #define MOTOR_CURRENT_PWM_FREQUENCY 31400 + #endif + #define MOTOR_CURRENT_COUNT LINEAR_AXES #elif HAS_MOTOR_CURRENT_SPI static constexpr uint32_t digipot_count[] = DIGIPOT_MOTOR_CURRENT; From 5617edbb968650762dd02425856e2891bafefd80 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jan 2022 03:14:13 -0600 Subject: [PATCH 027/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Mis?= =?UTF-8?q?c.=20updates=20for=20extra=20axes=20(#23521)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 6 +- Marlin/src/HAL/AVR/endstop_interrupts.h | 1 + Marlin/src/core/language.h | 28 ++---- Marlin/src/feature/direct_stepping.cpp | 10 +-- Marlin/src/feature/direct_stepping.h | 12 +-- Marlin/src/feature/tmc_util.cpp | 2 - Marlin/src/gcode/calibrate/G28.cpp | 29 ++++-- Marlin/src/gcode/calibrate/G425.cpp | 18 ++-- Marlin/src/gcode/calibrate/M425.cpp | 2 +- Marlin/src/gcode/config/M200-M205.cpp | 9 +- Marlin/src/gcode/config/M217.cpp | 39 +++++++- Marlin/src/gcode/config/M92.cpp | 2 +- .../src/gcode/feature/digipot/M907-M910.cpp | 6 +- Marlin/src/gcode/feature/pause/M125.cpp | 15 +++- Marlin/src/gcode/feature/pause/M600.cpp | 18 ++-- Marlin/src/gcode/feature/trinamic/M906.cpp | 3 + Marlin/src/gcode/geometry/G92.cpp | 8 +- Marlin/src/inc/Conditionals_post.h | 1 + Marlin/src/inc/SanityCheck.h | 35 +++----- Marlin/src/module/endstops.cpp | 2 +- Marlin/src/module/motion.cpp | 88 ++++++++++++------- Marlin/src/module/planner.cpp | 30 ++----- Marlin/src/module/probe.cpp | 5 +- Marlin/src/module/stepper.cpp | 84 +++++++++--------- Marlin/src/module/stepper.h | 1 - Marlin/src/pins/pinsDebug_list.h | 18 ++++ Marlin/src/pins/pins_postprocess.h | 22 +++-- 27 files changed, 289 insertions(+), 205 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index cf54cff991cd..dae41f814fe1 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3224,7 +3224,7 @@ #define Z4_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_I(L6470) + #if AXIS_IS_L64XX(I) #define I_MICROSTEPS 128 #define I_OVERCURRENT 2000 #define I_STALLCURRENT 1500 @@ -3233,7 +3233,7 @@ #define I_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_J(L6470) + #if AXIS_IS_L64XX(J) #define J_MICROSTEPS 128 #define J_OVERCURRENT 2000 #define J_STALLCURRENT 1500 @@ -3242,7 +3242,7 @@ #define J_SLEW_RATE 1 #endif - #if AXIS_DRIVER_TYPE_K(L6470) + #if AXIS_IS_L64XX(K) #define K_MICROSTEPS 128 #define K_OVERCURRENT 2000 #define K_STALLCURRENT 1500 diff --git a/Marlin/src/HAL/AVR/endstop_interrupts.h b/Marlin/src/HAL/AVR/endstop_interrupts.h index 50f29c3356ce..0ce8574c53d9 100644 --- a/Marlin/src/HAL/AVR/endstop_interrupts.h +++ b/Marlin/src/HAL/AVR/endstop_interrupts.h @@ -301,5 +301,6 @@ void setup_endstop_interrupts() { pciSetup(Z_MIN_PROBE_PIN); #endif #endif + // If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI. } diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index a540c9c77125..929992a62f46 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -384,20 +384,14 @@ #define STR_I_MIN "w_min" #define STR_I_MAX "w_max" #else - #define STR_I "A" - #define STR_I_MIN "a_min" - #define STR_I_MAX "a_max" + #error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'." #endif #else #define STR_I "" #endif #if HAS_J_AXIS - #if AXIS5_NAME == 'A' - #define STR_J "A" - #define STR_J_MIN "a_min" - #define STR_J_MAX "a_max" - #elif AXIS5_NAME == 'B' + #if AXIS5_NAME == 'B' #define STR_J "B" #define STR_J_MIN "b_min" #define STR_J_MAX "b_max" @@ -418,24 +412,14 @@ #define STR_J_MIN "w_min" #define STR_J_MAX "w_max" #else - #define STR_J "B" - #define STR_J_MIN "b_min" - #define STR_J_MAX "b_max" + #error "AXIS5_NAME can only be one of 'B', 'C', 'U', 'V', or 'W'." #endif #else #define STR_J "" #endif #if HAS_K_AXIS - #if AXIS6_NAME == 'A' - #define STR_K "A" - #define STR_K_MIN "a_min" - #define STR_K_MAX "a_max" - #elif AXIS6_NAME == 'B' - #define STR_K "B" - #define STR_K_MIN "b_min" - #define STR_K_MAX "b_max" - #elif AXIS6_NAME == 'C' + #if AXIS6_NAME == 'C' #define STR_K "C" #define STR_K_MIN "c_min" #define STR_K_MAX "c_max" @@ -452,9 +436,7 @@ #define STR_K_MIN "w_min" #define STR_K_MAX "w_max" #else - #define STR_K "C" - #define STR_K_MIN "c_min" - #define STR_K_MAX "c_max" + #error "AXIS6_NAME can only be one of 'C', 'U', 'V', or 'W'." #endif #else #define STR_K "" diff --git a/Marlin/src/feature/direct_stepping.cpp b/Marlin/src/feature/direct_stepping.cpp index b8ef04fcd908..052e79de41e5 100644 --- a/Marlin/src/feature/direct_stepping.cpp +++ b/Marlin/src/feature/direct_stepping.cpp @@ -52,13 +52,13 @@ namespace DirectStepping { volatile bool SerialPageManager::fatal_error; template - volatile PageState SerialPageManager::page_states[Cfg::NUM_PAGES]; + volatile PageState SerialPageManager::page_states[Cfg::PAGE_COUNT]; template volatile bool SerialPageManager::page_states_dirty; template - uint8_t SerialPageManager::pages[Cfg::NUM_PAGES][Cfg::PAGE_SIZE]; + uint8_t SerialPageManager::pages[Cfg::PAGE_COUNT][Cfg::PAGE_SIZE]; template uint8_t SerialPageManager::checksum; @@ -74,7 +74,7 @@ namespace DirectStepping { template void SerialPageManager::init() { - for (int i = 0 ; i < Cfg::NUM_PAGES ; i++) + for (int i = 0 ; i < Cfg::PAGE_COUNT ; i++) page_states[i] = PageState::FREE; fatal_error = false; @@ -183,10 +183,10 @@ namespace DirectStepping { SERIAL_CHAR(Cfg::CONTROL_CHAR); constexpr int state_bits = 2; - constexpr int n_bytes = Cfg::NUM_PAGES >> state_bits; + constexpr int n_bytes = Cfg::PAGE_COUNT >> state_bits; volatile uint8_t bits_b[n_bytes] = { 0 }; - for (page_idx_t i = 0 ; i < Cfg::NUM_PAGES ; i++) { + for (page_idx_t i = 0 ; i < Cfg::PAGE_COUNT ; i++) { bits_b[i >> state_bits] |= page_states[i] << ((i * state_bits) & 0x7); } diff --git a/Marlin/src/feature/direct_stepping.h b/Marlin/src/feature/direct_stepping.h index b3007731cdb2..962310281edb 100644 --- a/Marlin/src/feature/direct_stepping.h +++ b/Marlin/src/feature/direct_stepping.h @@ -68,10 +68,10 @@ namespace DirectStepping { static State state; static volatile bool fatal_error; - static volatile PageState page_states[Cfg::NUM_PAGES]; + static volatile PageState page_states[Cfg::PAGE_COUNT]; static volatile bool page_states_dirty; - static uint8_t pages[Cfg::NUM_PAGES][Cfg::PAGE_SIZE]; + static uint8_t pages[Cfg::PAGE_COUNT][Cfg::PAGE_SIZE]; static uint8_t checksum; static write_byte_idx_t write_byte_idx; static page_idx_t write_page_idx; @@ -87,8 +87,8 @@ namespace DirectStepping { struct config_t { static constexpr char CONTROL_CHAR = '!'; - static constexpr int NUM_PAGES = num_pages; - static constexpr int NUM_AXES = num_axes; + static constexpr int PAGE_COUNT = num_pages; + static constexpr int AXIS_COUNT = num_axes; static constexpr int BITS_SEGMENT = bits_segment; static constexpr int DIRECTIONAL = dir ? 1 : 0; static constexpr int SEGMENTS = segments; @@ -96,10 +96,10 @@ namespace DirectStepping { static constexpr int NUM_SEGMENTS = _BV(BITS_SEGMENT); static constexpr int SEGMENT_STEPS = _BV(BITS_SEGMENT - DIRECTIONAL) - 1; static constexpr int TOTAL_STEPS = SEGMENT_STEPS * SEGMENTS; - static constexpr int PAGE_SIZE = (NUM_AXES * BITS_SEGMENT * SEGMENTS) / 8; + static constexpr int PAGE_SIZE = (AXIS_COUNT * BITS_SEGMENT * SEGMENTS) / 8; typedef typename TypeSelector<(PAGE_SIZE>256), uint16_t, uint8_t>::type write_byte_idx_t; - typedef typename TypeSelector<(NUM_PAGES>256), uint16_t, uint8_t>::type page_idx_t; + typedef typename TypeSelector<(PAGE_COUNT>256), uint16_t, uint8_t>::type page_idx_t; }; template diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index e793b4cf222a..934c0b726443 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -421,12 +421,10 @@ if (monitor_tmc_driver(stepperI, need_update_error_counters, need_debug_reporting)) step_current_down(stepperI); #endif - #if AXIS_IS_TMC(J) if (monitor_tmc_driver(stepperJ, need_update_error_counters, need_debug_reporting)) step_current_down(stepperJ); #endif - #if AXIS_IS_TMC(K) if (monitor_tmc_driver(stepperK, need_update_error_counters, need_debug_reporting)) step_current_down(stepperK); diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index bd651cd7d830..cda71a1c1040 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -262,7 +262,7 @@ void GcodeSuite::G28() { reset_stepper_timeout(); #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT) - #if HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2) || HAS_CURRENT_HOME(I) || HAS_CURRENT_HOME(J) || HAS_CURRENT_HOME(K) || (ENABLED(DELTA) && HAS_CURRENT_HOME(Z)) + #if HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2) || (ENABLED(DELTA) && HAS_CURRENT_HOME(Z)) || HAS_CURRENT_HOME(I) || HAS_CURRENT_HOME(J) || HAS_CURRENT_HOME(K) #define HAS_HOMING_CURRENT 1 #endif @@ -273,22 +273,22 @@ void GcodeSuite::G28() { #if HAS_CURRENT_HOME(X) const int16_t tmc_save_current_X = stepperX.getMilliamps(); stepperX.rms_current(X_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current(F("X"), tmc_save_current_X, X_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current(F(STR_X), tmc_save_current_X, X_CURRENT_HOME); #endif #if HAS_CURRENT_HOME(X2) const int16_t tmc_save_current_X2 = stepperX2.getMilliamps(); stepperX2.rms_current(X2_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current(F("X2"), tmc_save_current_X2, X2_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current(F(STR_X2), tmc_save_current_X2, X2_CURRENT_HOME); #endif #if HAS_CURRENT_HOME(Y) const int16_t tmc_save_current_Y = stepperY.getMilliamps(); stepperY.rms_current(Y_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current(F("Y"), tmc_save_current_Y, Y_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current(F(STR_Y), tmc_save_current_Y, Y_CURRENT_HOME); #endif #if HAS_CURRENT_HOME(Y2) const int16_t tmc_save_current_Y2 = stepperY2.getMilliamps(); stepperY2.rms_current(Y2_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current(F("Y2"), tmc_save_current_Y2, Y2_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current(F(STR_Y2), tmc_save_current_Y2, Y2_CURRENT_HOME); #endif #if HAS_CURRENT_HOME(I) const int16_t tmc_save_current_I = stepperI.getMilliamps(); @@ -308,7 +308,22 @@ void GcodeSuite::G28() { #if HAS_CURRENT_HOME(Z) && ENABLED(DELTA) const int16_t tmc_save_current_Z = stepperZ.getMilliamps(); stepperZ.rms_current(Z_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current(F("Z"), tmc_save_current_Z, Z_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current(F(STR_Z), tmc_save_current_Z, Z_CURRENT_HOME); + #endif + #if HAS_CURRENT_HOME(I) + const int16_t tmc_save_current_I = stepperI.getMilliamps(); + stepperI.rms_current(I_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current(F(STR_I), tmc_save_current_I, I_CURRENT_HOME); + #endif + #if HAS_CURRENT_HOME(J) + const int16_t tmc_save_current_J = stepperJ.getMilliamps(); + stepperJ.rms_current(J_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current(F(STR_J), tmc_save_current_J, J_CURRENT_HOME); + #endif + #if HAS_CURRENT_HOME(K) + const int16_t tmc_save_current_K = stepperK.getMilliamps(); + stepperK.rms_current(K_CURRENT_HOME); + if (DEBUGGING(LEVELING)) debug_current(F(STR_K), tmc_save_current_K, K_CURRENT_HOME); #endif #endif @@ -361,7 +376,7 @@ void GcodeSuite::G28() { homeX = needX || parser.seen_test('X'), homeY = needY || parser.seen_test('Y'), homeZZ = homeZ, - homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME), homeK = needK || parser.seen_test(AXIS6_NAME), + homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME), homeK = needK || parser.seen_test(AXIS6_NAME) ), home_all = LINEAR_AXIS_GANG( // Home-all if all or none are flagged homeX == homeX, && homeY == homeX, && homeZ == homeX, diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index 9d630ba1e24b..906f8cc4194a 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -241,14 +241,15 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t park_above_object(m, uncertainty); + #define _ACASE(N,A,B) case A: dir = -1; case B: axis = N##_AXIS; break + #define _PCASE(N) _ACASE(N, N##MINIMUM, N##MAXIMUM) + switch (side) { #if AXIS_CAN_CALIBRATE(X) - case RIGHT: dir = -1; - case LEFT: axis = X_AXIS; break; + _ACASE(X, RIGHT, LEFT); #endif #if HAS_Y_AXIS && AXIS_CAN_CALIBRATE(Y) - case BACK: dir = -1; - case FRONT: axis = Y_AXIS; break; + _ACASE(Y, BACK, FRONT); #endif #if HAS_Z_AXIS && AXIS_CAN_CALIBRATE(Z) case TOP: { @@ -259,16 +260,13 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t } #endif #if HAS_I_AXIS && AXIS_CAN_CALIBRATE(I) - case IMINIMUM: dir = -1; - case IMAXIMUM: axis = I_AXIS; break; + _PCASE(I); #endif #if HAS_J_AXIS && AXIS_CAN_CALIBRATE(J) - case JMINIMUM: dir = -1; - case JMAXIMUM: axis = J_AXIS; break; + _PCASE(J); #endif #if HAS_K_AXIS && AXIS_CAN_CALIBRATE(K) - case KMINIMUM: dir = -1; - case KMAXIMUM: axis = K_AXIS; break; + _PCASE(K); #endif default: return; } diff --git a/Marlin/src/gcode/calibrate/M425.cpp b/Marlin/src/gcode/calibrate/M425.cpp index 190af0f71bbe..2d36e0d410d5 100644 --- a/Marlin/src/gcode/calibrate/M425.cpp +++ b/Marlin/src/gcode/calibrate/M425.cpp @@ -55,7 +55,7 @@ void GcodeSuite::M425() { case Z_AXIS: return AXIS_CAN_CALIBRATE(Z), case I_AXIS: return AXIS_CAN_CALIBRATE(I), case J_AXIS: return AXIS_CAN_CALIBRATE(J), - case K_AXIS: return AXIS_CAN_CALIBRATE(K), + case K_AXIS: return AXIS_CAN_CALIBRATE(K) ); } }; diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index b26a2fe28bf9..9490e3c625f3 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -288,8 +288,13 @@ void GcodeSuite::M205_report(const bool forReplay/*=true*/) { report_heading_etc(forReplay, F( "Advanced (B S T" TERN_(HAS_JUNCTION_DEVIATION, " J") - TERN_(HAS_CLASSIC_JERK, " X Y Z") - TERN_(HAS_CLASSIC_E_JERK, " E") + #if HAS_CLASSIC_JERK + LINEAR_AXIS_GANG( + " X", " Y", " Z", + " " STR_I "", " " STR_J "", " " STR_K "" + ) + #endif + TERN_(HAS_CLASSIC_E_JERK, " E") ")" )); SERIAL_ECHOLNPGM_P( diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index 7576272a48b6..344adc34e320 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -50,6 +50,9 @@ * W[linear] 0/1 Enable park & Z Raise * X[linear] Park X (Requires TOOLCHANGE_PARK) * Y[linear] Park Y (Requires TOOLCHANGE_PARK) + * I[linear] Park I (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 4) + * J[linear] Park J (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 5) + * K[linear] Park K (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 6) * Z[linear] Z Raise * F[linear] Fan Speed 0-255 * G[linear/s] Fan time @@ -88,10 +91,23 @@ void GcodeSuite::M217() { #if ENABLED(TOOLCHANGE_PARK) if (parser.seenval('W')) { toolchange_settings.enable_park = parser.value_linear_units(); } if (parser.seenval('X')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.x = constrain(v, X_MIN_POS, X_MAX_POS); } - if (parser.seenval('Y')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.y = constrain(v, Y_MIN_POS, Y_MAX_POS); } + #if HAS_Y_AXIS + if (parser.seenval('Y')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.y = constrain(v, Y_MIN_POS, Y_MAX_POS); } + #endif + #if HAS_I_AXIS + if (parser.seenval('I')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.i = constrain(v, I_MIN_POS, I_MAX_POS); } + #endif + #if HAS_J_AXIS + if (parser.seenval('J')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.j = constrain(v, J_MIN_POS, J_MAX_POS); } + #endif + #if HAS_K_AXIS + if (parser.seenval('K')) { const int16_t v = parser.value_linear_units(); toolchange_settings.change_point.k = constrain(v, K_MIN_POS, K_MAX_POS); } + #endif #endif - if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); } + #if HAS_Z_AXIS + if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); } + #endif #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) migration.target = 0; // 0 = disabled @@ -151,9 +167,24 @@ void GcodeSuite::M217_report(const bool forReplay/*=true*/) { #endif #if ENABLED(TOOLCHANGE_PARK) + { SERIAL_ECHOPGM(" W", LINEAR_UNIT(toolchange_settings.enable_park)); - SERIAL_ECHOPGM_P(SP_X_STR, LINEAR_UNIT(toolchange_settings.change_point.x)); - SERIAL_ECHOPGM_P(SP_Y_STR, LINEAR_UNIT(toolchange_settings.change_point.y)); + SERIAL_ECHOPGM_P( + SP_X_STR, LINEAR_UNIT(toolchange_settings.change_point.x) + #if HAS_Y_AXIS + , SP_Y_STR, LINEAR_UNIT(toolchange_settings.change_point.y) + #endif + #if HAS_I_AXIS + , SP_I_STR, LINEAR_UNIT(toolchange_settings.change_point.i) + #endif + #if HAS_J_AXIS + , SP_J_STR, LINEAR_UNIT(toolchange_settings.change_point.j) + #endif + #if HAS_K_AXIS + , SP_K_STR, LINEAR_UNIT(toolchange_settings.change_point.k) + #endif + ); + } #endif #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED) diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index 54fe698f97b2..8f527919fd83 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -24,7 +24,7 @@ #include "../../module/planner.h" /** - * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, and E. + * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, [I, [J, [K]]] and E. * (Follows the same syntax as G92) * * With multiple extruders use T to specify which one. diff --git a/Marlin/src/gcode/feature/digipot/M907-M910.cpp b/Marlin/src/gcode/feature/digipot/M907-M910.cpp index 757cffd47383..95adde3ea532 100644 --- a/Marlin/src/gcode/feature/digipot/M907-M910.cpp +++ b/Marlin/src/gcode/feature/digipot/M907-M910.cpp @@ -39,7 +39,9 @@ #endif /** - * M907: Set digital trimpot motor current using axis codes X, Y, Z, E, B, S + * M907: Set digital trimpot motor current using axis codes X [Y] [Z] [E] + * B - Special case for 4th (E) axis + * S - Special case to set first 3 axes */ void GcodeSuite::M907() { #if HAS_MOTOR_CURRENT_SPI @@ -75,7 +77,7 @@ void GcodeSuite::M907() { if (parser.seenval('E')) stepper.set_digipot_current(2, parser.value_int()); #endif - #endif + #endif // HAS_MOTOR_CURRENT_PWM #if HAS_MOTOR_CURRENT_I2C // this one uses actual amps in floating point diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index bc31e1225d86..46ec6c552cc0 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -49,6 +49,9 @@ * L = Override retract Length * X = Override park position X * Y = Override park position Y + * A = Override park position A (requires AXIS*_NAME 'A') + * B = Override park position B (requires AXIS*_NAME 'B') + * C = Override park position C (requires AXIS*_NAME 'C') * Z = Override Z raise * * With an LCD menu: @@ -60,9 +63,15 @@ void GcodeSuite::M125() { xyz_pos_t park_point = NOZZLE_PARK_POINT; - // Move XY axes to filament change position or given position - if (parser.seenval('X')) park_point.x = RAW_X_POSITION(parser.linearval('X')); - if (parser.seenval('Y')) park_point.y = RAW_X_POSITION(parser.linearval('Y')); + // Move to filament change position or given position + LINEAR_AXIS_CODE( + if (parser.seenval('X')) park_point.x = RAW_X_POSITION(parser.linearval('X')), + if (parser.seenval('Y')) park_point.y = RAW_Y_POSITION(parser.linearval('Y')), + NOOP, + if (parser.seenval(AXIS4_NAME)) park_point.i = RAW_I_POSITION(parser.linearval(AXIS4_NAME)), + if (parser.seenval(AXIS5_NAME)) park_point.j = RAW_J_POSITION(parser.linearval(AXIS5_NAME)), + if (parser.seenval(AXIS6_NAME)) park_point.k = RAW_K_POSITION(parser.linearval(AXIS6_NAME)) + ); // Lift Z axis if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index febb946befb5..edb06aa947a2 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -101,10 +101,8 @@ void GcodeSuite::M600() { if (standardM600) ui.pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder); - #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE) - // If needed, home before parking for filament change - home_if_needed(true); - #endif + // If needed, home before parking for filament change + TERN_(HOME_BEFORE_FILAMENT_CHANGE, home_if_needed(true)); #if HAS_MULTI_EXTRUDER // Change toolhead if specified @@ -118,12 +116,18 @@ void GcodeSuite::M600() { xyz_pos_t park_point NOZZLE_PARK_POINT; - // Lift Z axis + // Lift Z axis first if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); // Move XY axes to filament change position or given position - if (parser.seenval('X')) park_point.x = parser.linearval('X'); - if (parser.seenval('Y')) park_point.y = parser.linearval('Y'); + LINEAR_AXIS_CODE( + if (parser.seenval('X')) park_point.x = parser.linearval('X'), + if (parser.seenval('Y')) park_point.y = parser.linearval('Y'), + NOOP, + if (parser.seenval(AXIS4_NAME)) park_point.i = parser.linearval(AXIS4_NAME); + if (parser.seenval(AXIS5_NAME)) park_point.j = parser.linearval(AXIS5_NAME); + if (parser.seenval(AXIS6_NAME)) park_point.k = parser.linearval(AXIS6_NAME); + ); #if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA) park_point += hotend_offset[active_extruder]; diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index 92d2210645cd..164ff001795a 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -41,6 +41,9 @@ static void tmc_print_current(TMC &st) { * X[current] - Set mA current for X driver(s) * Y[current] - Set mA current for Y driver(s) * Z[current] - Set mA current for Z driver(s) + * A[current] - Set mA current for A driver(s) (Requires AXIS*_NAME 'A') + * B[current] - Set mA current for B driver(s) (Requires AXIS*_NAME 'B') + * C[current] - Set mA current for C driver(s) (Requires AXIS*_NAME 'C') * E[current] - Set mA current for E driver(s) * * I[index] - Axis sub-index (Omit or 0 for X, Y, Z; 1 for X2, Y2, Z2; 2 for Z3; 3 for Z4.) diff --git a/Marlin/src/gcode/geometry/G92.cpp b/Marlin/src/gcode/geometry/G92.cpp index 990236c0e878..3c49fe2a2640 100644 --- a/Marlin/src/gcode/geometry/G92.cpp +++ b/Marlin/src/gcode/geometry/G92.cpp @@ -29,7 +29,7 @@ #endif /** - * G92: Set the Current Position to the given X Y Z E values. + * G92: Set the Current Position to the given X [Y [Z [A [B [C [E]]]]]] values. * * Behind the scenes the G92 command may modify the Current Position * or the Position Shift depending on settings and sub-commands. @@ -37,14 +37,14 @@ * Since E has no Workspace Offset, it is always set directly. * * Without Workspace Offsets (e.g., with NO_WORKSPACE_OFFSETS): - * G92 : Set NATIVE Current Position to the given X Y Z E. + * G92 : Set NATIVE Current Position to the given X [Y [Z [A [B [C [E]]]]]]. * * Using Workspace Offsets (default Marlin behavior): - * G92 : Modify Workspace Offsets so the reported position shows the given X Y Z E. + * G92 : Modify Workspace Offsets so the reported position shows the given X [Y [Z [A [B [C [E]]]]]]. * G92.1 : Zero XYZ Workspace Offsets (so the reported position = the native position). * * With POWER_LOSS_RECOVERY: - * G92.9 : Set NATIVE Current Position to the given X Y Z E. + * G92.9 : Set NATIVE Current Position to the given X [Y [Z [A [B [C [E]]]]]]. */ void GcodeSuite::G92() { diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 08130d31b7a1..6d2a0e1f7d07 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2214,6 +2214,7 @@ #define TMC_UART_IS(A,N) (defined(A##_HARDWARE_SERIAL) && (CAT(HW_,A##_HARDWARE_SERIAL) == HW_Serial##N || CAT(HW_,A##_HARDWARE_SERIAL) == HW_MSerial##N)) #define ANY_SERIAL_IS(N) ( CONF_SERIAL_IS(N) \ || TMC_UART_IS(X, N) || TMC_UART_IS(Y , N) || TMC_UART_IS(Z , N) \ + || TMC_UART_IS(I, N) || TMC_UART_IS(J , N) || TMC_UART_IS(K , N) \ || TMC_UART_IS(X2, N) || TMC_UART_IS(Y2, N) || TMC_UART_IS(Z2, N) || TMC_UART_IS(Z3, N) || TMC_UART_IS(Z4, N) \ || TMC_UART_IS(E0, N) || TMC_UART_IS(E1, N) || TMC_UART_IS(E2, N) || TMC_UART_IS(E3, N) || TMC_UART_IS(E4, N) ) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index dcffacb5b06b..ee01dbd16d02 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -791,6 +791,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Enable only one of ENDSTOPPULLUP_Y_MAX or ENDSTOPPULLDOWN_Y_MAX." #elif BOTH(ENDSTOPPULLUP_ZMAX, ENDSTOPPULLDOWN_ZMAX) #error "Enable only one of ENDSTOPPULLUP_Z_MAX or ENDSTOPPULLDOWN_Z_MAX." +#elif BOTH(ENDSTOPPULLUP_IMAX, ENDSTOPPULLDOWN_IMAX) + #error "Enable only one of ENDSTOPPULLUP_I_MAX or ENDSTOPPULLDOWN_I_MAX." +#elif BOTH(ENDSTOPPULLUP_JMAX, ENDSTOPPULLDOWN_JMAX) + #error "Enable only one of ENDSTOPPULLUP_J_MAX or ENDSTOPPULLDOWN_J_MAX." +#elif BOTH(ENDSTOPPULLUP_KMAX, ENDSTOPPULLDOWN_KMAX) + #error "Enable only one of ENDSTOPPULLUP_K_MAX or ENDSTOPPULLDOWN_K_MAX." #elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN) #error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN." #elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN) @@ -1417,9 +1423,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Allow only extra axis codes that do not conflict with G-code parameter names */ #if HAS_I_AXIS - #if AXIS4_NAME != 'A' && AXIS4_NAME != 'B' && AXIS4_NAME != 'C' && AXIS4_NAME != 'U' && AXIS4_NAME != 'V' && AXIS4_NAME != 'W' - #error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'." - #elif !defined(I_MIN_POS) || !defined(I_MAX_POS) + #if !defined(I_MIN_POS) || !defined(I_MAX_POS) #error "I_MIN_POS and I_MAX_POS are required with LINEAR_AXES >= 4." #elif !defined(I_HOME_DIR) #error "I_HOME_DIR is required with LINEAR_AXES >= 4." @@ -1430,8 +1434,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if HAS_J_AXIS #if AXIS5_NAME == AXIS4_NAME #error "AXIS5_NAME must be unique." - #elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W' - #error "AXIS5_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'." #elif !defined(J_MIN_POS) || !defined(J_MAX_POS) #error "J_MIN_POS and J_MAX_POS are required with LINEAR_AXES >= 5." #elif !defined(J_HOME_DIR) @@ -1443,8 +1445,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if HAS_K_AXIS #if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME #error "AXIS6_NAME must be unique." - #elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W' - #error "AXIS6_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'." #elif !defined(K_MIN_POS) || !defined(K_MAX_POS) #error "K_MIN_POS and K_MAX_POS are required with LINEAR_AXES >= 6." #elif !defined(K_HOME_DIR) @@ -3304,7 +3304,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * L64XX requirement */ #if HAS_L64XX && HAS_I_AXIS - #error "L64XX requires LINEAR_AXES 3. Homing with L64XX is not yet implemented for LINEAR_AXES > 3." + #error "L64XX requires LINEAR_AXES <= 3. Homing with L64XX is not yet implemented for LINEAR_AXES > 3." #endif /** @@ -3780,22 +3780,15 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #if _BAD_DRIVER(Z) #error "Z_DRIVER_TYPE is not recognized." #endif -#if HAS_I_AXIS - #if _BAD_DRIVER(I) - #error "I_DRIVER_TYPE is not recognized." - #endif +#if _BAD_DRIVER(I) + #error "I_DRIVER_TYPE is not recognized." #endif -#if HAS_J_AXIS - #if _BAD_DRIVER(J) - #error "J_DRIVER_TYPE is not recognized." - #endif +#if _BAD_DRIVER(J) + #error "J_DRIVER_TYPE is not recognized." #endif -#if HAS_K_AXIS - #if _BAD_DRIVER(K) - #error "K_DRIVER_TYPE is not recognized." - #endif +#if _BAD_DRIVER(K) + #error "K_DRIVER_TYPE is not recognized." #endif - #if _BAD_DRIVER(X2) #error "X2_DRIVER_TYPE is not recognized." #endif diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 939dd6d53760..bce27dc88a15 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -558,7 +558,7 @@ void _O2 Endstops::report_states() { #if HAS_J_MAX ES_REPORT(J_MAX); #endif - #if HAS_K_MIN + #if HAS_K_MIN ES_REPORT(K_MIN); #endif #if HAS_K_MAX diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index a9c2ad6a7a7a..51f0681a150e 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -467,8 +467,8 @@ void _internal_move_to_destination(const_feedRate_t fr_mm_s/*=0.0f*/ } /** - * Plan a move to (X, Y, Z, [I, [J, [K]]]) and set the current_position - * Plan a move to (X, Y, Z) with separation of Z from other components. + * Plan a move to (X, Y, Z, [I, [J, [K...]]]) and set the current_position + * Plan a move to (X, Y, Z, [I, [J, [K...]]]) with separation of Z from other components. * * - If Z is moving up, the Z move is done before XY, etc. * - If Z is moving down, the Z move is done after XY, etc. @@ -484,6 +484,15 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s #if HAS_Z_AXIS const feedRate_t z_feedrate = fr_mm_s ?: homing_feedrate(Z_AXIS); #endif + #if HAS_I_AXIS + const feedRate_t i_feedrate = fr_mm_s ?: homing_feedrate(I_AXIS); + #endif + #if HAS_J_AXIS + const feedRate_t j_feedrate = fr_mm_s ?: homing_feedrate(J_AXIS); + #endif + #if HAS_K_AXIS + const feedRate_t k_feedrate = fr_mm_s ?: homing_feedrate(K_AXIS); + #endif #if IS_KINEMATIC if (!position_is_reachable(x, y)) return; @@ -498,8 +507,8 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s // when in the danger zone if (current_position.z > delta_clip_start_height) { - if (z > delta_clip_start_height) { // staying in the danger zone - destination.set(x, y, z); // move directly (uninterpolated) + if (z > delta_clip_start_height) { // staying in the danger zone + destination.set(x, y, z); // move directly (uninterpolated) prepare_internal_fast_move_to_destination(); // set current_position from destination if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position); return; @@ -509,7 +518,7 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position); } - if (z > current_position.z) { // raising? + if (z > current_position.z) { // raising? destination.z = z; prepare_internal_fast_move_to_destination(z_feedrate); // set current_position from destination if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position); @@ -519,7 +528,7 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s prepare_internal_move_to_destination(); // set current_position from destination if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position); - if (z < current_position.z) { // lowering? + if (z < current_position.z) { // lowering? destination.z = z; prepare_internal_fast_move_to_destination(z_feedrate); // set current_position from destination if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position); @@ -528,39 +537,32 @@ void do_blocking_move_to(LINEAR_AXIS_ARGS(const float), const_feedRate_t fr_mm_s #elif IS_SCARA // If Z needs to raise, do it before moving XY - if (destination.z < z) { - destination.z = z; - prepare_internal_fast_move_to_destination(z_feedrate); - } + if (destination.z < z) { destination.z = z; prepare_internal_fast_move_to_destination(z_feedrate); } - destination.set(x, y); - prepare_internal_fast_move_to_destination(xy_feedrate); + destination.set(x, y); prepare_internal_fast_move_to_destination(xy_feedrate); // If Z needs to lower, do it after moving XY - if (destination.z > z) { - destination.z = z; - prepare_internal_fast_move_to_destination(z_feedrate); - } + if (destination.z > z) { destination.z = z; prepare_internal_fast_move_to_destination(z_feedrate); } #else - #if HAS_Z_AXIS - // If Z needs to raise, do it before moving XY - if (current_position.z < z) { - current_position.z = z; - line_to_current_position(z_feedrate); - } + #if HAS_Z_AXIS // If Z needs to raise, do it before moving XY + if (current_position.z < z) { current_position.z = z; line_to_current_position(z_feedrate); } #endif - current_position.set(x, y); - line_to_current_position(xy_feedrate); + current_position.set(x, y); line_to_current_position(xy_feedrate); - #if HAS_Z_AXIS - // If Z needs to lower, do it after moving XY - if (current_position.z > z) { - current_position.z = z; - line_to_current_position(z_feedrate); - } + #if HAS_I_AXIS + current_position.i = i; line_to_current_position(i_feedrate); + #endif + #if HAS_J_AXIS + current_position.j = j; line_to_current_position(j_feedrate); + #endif + #if HAS_K_AXIS + current_position.k = k; line_to_current_position(k_feedrate); + #endif + #if HAS_Z_AXIS // If Z needs to lower, do it after moving XY... + if (current_position.z > z) { current_position.z = z; line_to_current_position(z_feedrate); } #endif #endif @@ -1402,6 +1404,15 @@ void prepare_line_to_destination() { #endif break; #endif + #if I_SENSORLESS + case I_AXIS: stealth_states.i = tmc_enable_stallguard(stepperI); break; + #endif + #if J_SENSORLESS + case J_AXIS: stealth_states.j = tmc_enable_stallguard(stepperJ); break; + #endif + #if K_SENSORLESS + case K_AXIS: stealth_states.k = tmc_enable_stallguard(stepperK); break; + #endif } #if ENABLED(SPI_ENDSTOPS) @@ -1479,6 +1490,15 @@ void prepare_line_to_destination() { #endif break; #endif + #if I_SENSORLESS + case I_AXIS: tmc_disable_stallguard(stepperI, enable_stealth.i); break; + #endif + #if J_SENSORLESS + case J_AXIS: tmc_disable_stallguard(stepperJ, enable_stealth.j); break; + #endif + #if K_SENSORLESS + case K_AXIS: tmc_disable_stallguard(stepperK, enable_stealth.k); break; + #endif } #if ENABLED(SPI_ENDSTOPS) @@ -1815,8 +1835,12 @@ void prepare_line_to_destination() { switch (axis) { default: case X_AXIS: es = X_ENDSTOP; break; - case Y_AXIS: es = Y_ENDSTOP; break; - case Z_AXIS: es = Z_ENDSTOP; break; + #if HAS_Y_AXIS + case Y_AXIS: es = Y_ENDSTOP; break; + #endif + #if HAS_Z_AXIS + case Z_AXIS: es = Z_ENDSTOP; break; + #endif #if HAS_I_AXIS case I_AXIS: es = I_ENDSTOP; break; #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 17d279cfa5f9..6979fa6a80eb 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2041,15 +2041,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move, steps_dist_mm.b = (db + dc) * mm_per_step[B_AXIS]; steps_dist_mm.c = CORESIGN(db - dc) * mm_per_step[C_AXIS]; #endif - #if HAS_I_AXIS - steps_dist_mm.i = di * mm_per_step[I_AXIS]; - #endif - #if HAS_J_AXIS - steps_dist_mm.j = dj * mm_per_step[J_AXIS]; - #endif - #if HAS_K_AXIS - steps_dist_mm.k = dk * mm_per_step[K_AXIS]; - #endif + TERN_(HAS_I_AXIS, steps_dist_mm.i = di * mm_per_step[I_AXIS]); + TERN_(HAS_J_AXIS, steps_dist_mm.j = dj * mm_per_step[J_AXIS]); + TERN_(HAS_K_AXIS, steps_dist_mm.k = dk * mm_per_step[K_AXIS]); #elif ENABLED(MARKFORGED_XY) steps_dist_mm.a = (da - db) * mm_per_step[A_AXIS]; steps_dist_mm.b = db * mm_per_step[B_AXIS]; @@ -2197,15 +2191,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move, ); #endif #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) - #if HAS_I_AXIS - if (block->steps.i) stepper.enable_axis(I_AXIS); - #endif - #if HAS_J_AXIS - if (block->steps.j) stepper.enable_axis(J_AXIS); - #endif - #if HAS_K_AXIS - if (block->steps.k) stepper.enable_axis(K_AXIS); - #endif + TERN_(HAS_I_AXIS, if (block->steps.i) stepper.enable_axis(I_AXIS)); + TERN_(HAS_J_AXIS, if (block->steps.j) stepper.enable_axis(J_AXIS)); + TERN_(HAS_K_AXIS, if (block->steps.k) stepper.enable_axis(K_AXIS)); #endif // Enable extruder(s) @@ -2260,7 +2248,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill #if EITHER(SLOWDOWN, HAS_WIRED_LCD) || defined(XY_FREQUENCY_LIMIT) - // Segment time im micro seconds + // Segment time in microseconds int32_t segment_time_us = LROUND(1000000.0f / inverse_secs); #endif @@ -2419,7 +2407,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, accel = CEIL((esteps ? settings.acceleration : settings.travel_acceleration) * steps_per_mm); #if ENABLED(LIN_ADVANCE) - + // Linear advance is currently not ready for HAS_I_AXIS #define MAX_E_JERK(N) TERN(HAS_LINEAR_E_JERK, max_e_jerk[E_INDEX_N(N)], max_jerk.e) /** @@ -2939,7 +2927,7 @@ bool Planner::buffer_segment(const abce_pos_t &abce SERIAL_ECHOPGM_P(SP_Y_LBL, abce.b); #endif SERIAL_ECHOPGM(" (", position.y, "->", target.y); - #if LINEAR_AXES >= ABC + #if HAS_Z_AXIS #if ENABLED(DELTA) SERIAL_ECHOPGM(") C:", abce.c); #else diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 540b4e1ae6a4..6dd337089cf7 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -772,7 +772,10 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai #endif // On delta keep Z below clip height or do_blocking_move_to will abort - xyz_pos_t npos = { rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, current_position.z), current_position.z) }; + xyz_pos_t npos = LINEAR_AXIS_ARRAY( + rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, current_position.z), current_position.z), + current_position.i, current_position.j, current_position.k + ); if (!can_reach(npos, probe_relative)) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable"); return NAN; diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 0221f4c8be50..ae8a1ef0784c 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -522,7 +522,7 @@ bool Stepper::disable_axis(const AxisEnum axis) { } } - bool Stepper::disable_extruder(E_TERN_(const uint8_t eindex)) { + bool Stepper::disable_extruder(E_TERN_(const uint8_t eindex/*=0*/)) { IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr uint8_t eindex = 0); mark_axis_disabled(E_AXIS E_OPTARG(eindex)); const bool can_disable = can_axis_disable(E_AXIS E_OPTARG(eindex)); @@ -1688,7 +1688,7 @@ void Stepper::pulse_phase_isr() { const bool is_page = IS_PAGE(current_block); #if ENABLED(DIRECT_STEPPING) - // TODO (DerAndere): Add support for HAS_I_AXIS + // Direct stepping is currently not ready for HAS_I_AXIS if (is_page) { #if STEPPER_PAGE_FORMAT == SP_4x4D_128 @@ -1929,7 +1929,7 @@ uint32_t Stepper::block_phase_isr() { // If current block is finished, reset pointer and finalize state if (step_events_completed >= step_event_count) { #if ENABLED(DIRECT_STEPPING) - // TODO (DerAndere): Add support for HAS_I_AXIS + // Direct stepping is currently not ready for HAS_I_AXIS #if STEPPER_PAGE_FORMAT == SP_4x4D_128 #define PAGE_SEGMENT_UPDATE_POS(AXIS) \ count_position[_AXIS(AXIS)] += page_step_state.bd[_AXIS(AXIS)] - 128 * 7; @@ -3352,113 +3352,115 @@ void Stepper::report_positions() { void Stepper::microstep_init() { #if HAS_X_MS_PINS - SET_OUTPUT(X_MS1_PIN); - SET_OUTPUT(X_MS2_PIN); + SET_OUTPUT(X_MS1_PIN); SET_OUTPUT(X_MS2_PIN); #if PIN_EXISTS(X_MS3) SET_OUTPUT(X_MS3_PIN); #endif #endif #if HAS_X2_MS_PINS - SET_OUTPUT(X2_MS1_PIN); - SET_OUTPUT(X2_MS2_PIN); + SET_OUTPUT(X2_MS1_PIN); SET_OUTPUT(X2_MS2_PIN); #if PIN_EXISTS(X2_MS3) SET_OUTPUT(X2_MS3_PIN); #endif #endif #if HAS_Y_MS_PINS - SET_OUTPUT(Y_MS1_PIN); - SET_OUTPUT(Y_MS2_PIN); + SET_OUTPUT(Y_MS1_PIN); SET_OUTPUT(Y_MS2_PIN); #if PIN_EXISTS(Y_MS3) SET_OUTPUT(Y_MS3_PIN); #endif #endif #if HAS_Y2_MS_PINS - SET_OUTPUT(Y2_MS1_PIN); - SET_OUTPUT(Y2_MS2_PIN); + SET_OUTPUT(Y2_MS1_PIN); SET_OUTPUT(Y2_MS2_PIN); #if PIN_EXISTS(Y2_MS3) SET_OUTPUT(Y2_MS3_PIN); #endif #endif #if HAS_Z_MS_PINS - SET_OUTPUT(Z_MS1_PIN); - SET_OUTPUT(Z_MS2_PIN); + SET_OUTPUT(Z_MS1_PIN); SET_OUTPUT(Z_MS2_PIN); #if PIN_EXISTS(Z_MS3) SET_OUTPUT(Z_MS3_PIN); #endif #endif #if HAS_Z2_MS_PINS - SET_OUTPUT(Z2_MS1_PIN); - SET_OUTPUT(Z2_MS2_PIN); + SET_OUTPUT(Z2_MS1_PIN); SET_OUTPUT(Z2_MS2_PIN); #if PIN_EXISTS(Z2_MS3) SET_OUTPUT(Z2_MS3_PIN); #endif #endif #if HAS_Z3_MS_PINS - SET_OUTPUT(Z3_MS1_PIN); - SET_OUTPUT(Z3_MS2_PIN); + SET_OUTPUT(Z3_MS1_PIN); SET_OUTPUT(Z3_MS2_PIN); #if PIN_EXISTS(Z3_MS3) SET_OUTPUT(Z3_MS3_PIN); #endif #endif #if HAS_Z4_MS_PINS - SET_OUTPUT(Z4_MS1_PIN); - SET_OUTPUT(Z4_MS2_PIN); + SET_OUTPUT(Z4_MS1_PIN); SET_OUTPUT(Z4_MS2_PIN); #if PIN_EXISTS(Z4_MS3) SET_OUTPUT(Z4_MS3_PIN); #endif #endif + #if HAS_I_MS_PINS + SET_OUTPUT(I_MS1_PIN); SET_OUTPUT(I_MS2_PIN); + #if PIN_EXISTS(I_MS3) + SET_OUTPUT(I_MS3_PIN); + #endif + #endif + #if HAS_J_MS_PINS + SET_OUTPUT(J_MS1_PIN); SET_OUTPUT(J_MS2_PIN); + #if PIN_EXISTS(J_MS3) + SET_OUTPUT(J_MS3_PIN); + #endif + #endif + #if HAS_K_MS_PINS + SET_OUTPUT(K_MS1_PIN); SET_OUTPUT(K_MS2_PIN); + #if PIN_EXISTS(K_MS3) + SET_OUTPUT(K_MS3_PIN); + #endif + #endif #if HAS_E0_MS_PINS - SET_OUTPUT(E0_MS1_PIN); - SET_OUTPUT(E0_MS2_PIN); + SET_OUTPUT(E0_MS1_PIN); SET_OUTPUT(E0_MS2_PIN); #if PIN_EXISTS(E0_MS3) SET_OUTPUT(E0_MS3_PIN); #endif #endif #if HAS_E1_MS_PINS - SET_OUTPUT(E1_MS1_PIN); - SET_OUTPUT(E1_MS2_PIN); + SET_OUTPUT(E1_MS1_PIN); SET_OUTPUT(E1_MS2_PIN); #if PIN_EXISTS(E1_MS3) SET_OUTPUT(E1_MS3_PIN); #endif #endif #if HAS_E2_MS_PINS - SET_OUTPUT(E2_MS1_PIN); - SET_OUTPUT(E2_MS2_PIN); + SET_OUTPUT(E2_MS1_PIN); SET_OUTPUT(E2_MS2_PIN); #if PIN_EXISTS(E2_MS3) SET_OUTPUT(E2_MS3_PIN); #endif #endif #if HAS_E3_MS_PINS - SET_OUTPUT(E3_MS1_PIN); - SET_OUTPUT(E3_MS2_PIN); + SET_OUTPUT(E3_MS1_PIN); SET_OUTPUT(E3_MS2_PIN); #if PIN_EXISTS(E3_MS3) SET_OUTPUT(E3_MS3_PIN); #endif #endif #if HAS_E4_MS_PINS - SET_OUTPUT(E4_MS1_PIN); - SET_OUTPUT(E4_MS2_PIN); + SET_OUTPUT(E4_MS1_PIN); SET_OUTPUT(E4_MS2_PIN); #if PIN_EXISTS(E4_MS3) SET_OUTPUT(E4_MS3_PIN); #endif #endif #if HAS_E5_MS_PINS - SET_OUTPUT(E5_MS1_PIN); - SET_OUTPUT(E5_MS2_PIN); + SET_OUTPUT(E5_MS1_PIN); SET_OUTPUT(E5_MS2_PIN); #if PIN_EXISTS(E5_MS3) SET_OUTPUT(E5_MS3_PIN); #endif #endif #if HAS_E6_MS_PINS - SET_OUTPUT(E6_MS1_PIN); - SET_OUTPUT(E6_MS2_PIN); + SET_OUTPUT(E6_MS1_PIN); SET_OUTPUT(E6_MS2_PIN); #if PIN_EXISTS(E6_MS3) SET_OUTPUT(E6_MS3_PIN); #endif #endif #if HAS_E7_MS_PINS - SET_OUTPUT(E7_MS1_PIN); - SET_OUTPUT(E7_MS2_PIN); + SET_OUTPUT(E7_MS1_PIN); SET_OUTPUT(E7_MS2_PIN); #if PIN_EXISTS(E7_MS3) SET_OUTPUT(E7_MS3_PIN); #endif @@ -3531,13 +3533,13 @@ void Stepper::report_positions() { #if HAS_E7_MS_PINS case 10: WRITE(E7_MS1_PIN, ms1); break; #endif - #if HAS_I_MICROSTEPS + #if HAS_I_MS_PINS case 11: WRITE(I_MS1_PIN, ms1); break #endif - #if HAS_J_MICROSTEPS + #if HAS_J_MS_PINS case 12: WRITE(J_MS1_PIN, ms1); break #endif - #if HAS_K_MICROSTEPS + #if HAS_K_MS_PINS case 13: WRITE(K_MS1_PIN, ms1); break #endif } @@ -3602,13 +3604,13 @@ void Stepper::report_positions() { #if HAS_E7_MS_PINS case 10: WRITE(E7_MS2_PIN, ms2); break; #endif - #if HAS_I_M_PINS + #if HAS_I_MS_PINS case 11: WRITE(I_MS2_PIN, ms2); break #endif - #if HAS_J_M_PINS + #if HAS_J_MS_PINS case 12: WRITE(J_MS2_PIN, ms2); break #endif - #if HAS_K_M_PINS + #if HAS_K_MS_PINS case 13: WRITE(K_MS2_PIN, ms2); break #endif } diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 7967e58c355a..99aa714ca095 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -320,7 +320,6 @@ class Stepper { #ifndef MOTOR_CURRENT_PWM_FREQUENCY #define MOTOR_CURRENT_PWM_FREQUENCY 31400 #endif - #define MOTOR_CURRENT_COUNT LINEAR_AXES #elif HAS_MOTOR_CURRENT_SPI static constexpr uint32_t digipot_count[] = DIGIPOT_MOTOR_CURRENT; diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index dc0d5225db32..599ce319af2b 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -1601,6 +1601,24 @@ #if PIN_EXISTS(Z4_SERIAL_RX) REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_RX_PIN) #endif +#if PIN_EXISTS(I_SERIAL_TX) + REPORT_NAME_DIGITAL(__LINE__, I_SERIAL_TX_PIN) +#endif +#if PIN_EXISTS(I_SERIAL_RX) + REPORT_NAME_DIGITAL(__LINE__, I_SERIAL_RX_PIN) +#endif +#if PIN_EXISTS(J_SERIAL_TX) + REPORT_NAME_DIGITAL(__LINE__, J_SERIAL_TX_PIN) +#endif +#if PIN_EXISTS(J_SERIAL_RX) + REPORT_NAME_DIGITAL(__LINE__, J_SERIAL_RX_PIN) +#endif +#if PIN_EXISTS(K_SERIAL_TX) + REPORT_NAME_DIGITAL(__LINE__, K_SERIAL_TX_PIN) +#endif +#if PIN_EXISTS(K_SERIAL_RX) + REPORT_NAME_DIGITAL(__LINE__, K_SERIAL_RX_PIN) +#endif #if PIN_EXISTS(E0_DIAG) REPORT_NAME_DIGITAL(__LINE__, E0_DIAG_PIN) #endif diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index aa1def0b40a9..aabe0da85873 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -546,6 +546,7 @@ #undef K_MAX_PIN #endif +// Filament Sensor first pin alias #if HAS_FILAMENT_SENSOR #define FIL_RUNOUT1_PIN FIL_RUNOUT_PIN // Filament Sensor first pin alias #else @@ -598,12 +599,13 @@ #define X2_E_INDEX E_STEPPERS #endif -// The X2 axis, if any, should be the next open extruder port #if HAS_X2_STEPPER && !defined(X2_DIAG_PIN) && !defined(X2_STEP_PIN) && !PIN_EXISTS(X2_CS_PIN) #define Y2_E_INDEX INCREMENT(X2_E_INDEX) #else #define Y2_E_INDEX X2_E_INDEX #endif + +// The X2 axis, if any, should be the next open extruder port #if HAS_X2_STEPPER #ifndef X2_STEP_PIN #define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP) @@ -686,12 +688,13 @@ #define X2_MS3_PIN -1 #endif -// The Y2 axis, if any, should be the next open extruder port #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !defined(Y2_DIAG_PIN) && !defined(Y2_STEP_PIN) && !PIN_EXISTS(Y2_CS_PIN) #define Z2_E_INDEX INCREMENT(Y2_E_INDEX) #else #define Z2_E_INDEX Y2_E_INDEX #endif + +// The Y2 axis, if any, should be the next open extruder port #if ENABLED(Y_DUAL_STEPPER_DRIVERS) #ifndef Y2_STEP_PIN #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) @@ -771,12 +774,13 @@ #define Y2_MS3_PIN -1 #endif -// The Z2 axis, if any, should be the next open extruder port #if NUM_Z_STEPPER_DRIVERS >= 2 && !defined(Z2_DIAG_PIN) && !defined(Z2_STEP_PIN) && !PIN_EXISTS(Z2_CS_PIN) #define Z3_E_INDEX INCREMENT(Z2_E_INDEX) #else #define Z3_E_INDEX Z2_E_INDEX #endif + +// The Z2 axis, if any, should be the next open extruder port #if NUM_Z_STEPPER_DRIVERS >= 2 #ifndef Z2_STEP_PIN #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) @@ -856,12 +860,13 @@ #define Z2_MS3_PIN -1 #endif -// The Z3 axis, if any, should be the next open extruder port #if NUM_Z_STEPPER_DRIVERS >= 3 && !defined(Z3_DIAG_PIN) && !defined(Z3_STEP_PIN) && !PIN_EXISTS(Z3_CS_PIN) #define Z4_E_INDEX INCREMENT(Z3_E_INDEX) #else #define Z4_E_INDEX Z3_E_INDEX #endif + +// The Z3 axis, if any, should be the next open extruder port #if NUM_Z_STEPPER_DRIVERS >= 3 #ifndef Z3_STEP_PIN #define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP) @@ -941,12 +946,13 @@ #define Z3_MS3_PIN -1 #endif -// The Z4 axis, if any, should be the next open extruder port #if NUM_Z_STEPPER_DRIVERS >= 4 && !defined(Z4_DIAG_PIN) && !defined(Z4_STEP_PIN) && !PIN_EXISTS(Z4_CS_PIN) #define I_E_INDEX INCREMENT(Z4_E_INDEX) #else #define I_E_INDEX Z4_E_INDEX #endif + +// The Z4 axis, if any, should be the next open extruder port #if NUM_Z_STEPPER_DRIVERS >= 4 #ifndef Z4_STEP_PIN #define Z4_STEP_PIN _EPIN(Z4_E_INDEX, STEP) @@ -1026,12 +1032,13 @@ #define Z4_MS3_PIN -1 #endif -// The I axis, if any, should be the next open extruder port #if HAS_I_AXIS && !defined(I_DIAG_PIN) && !defined(I_STEP_PIN) && !PIN_EXISTS(I_CS_PIN) #define J_E_INDEX INCREMENT(I_E_INDEX) #else #define J_E_INDEX I_E_INDEX #endif + +// The I axis, if any, should be the next open extruder port #if HAS_I_AXIS #ifndef I_STEP_PIN #define I_STEP_PIN _EPIN(I_E_INDEX, STEP) @@ -1111,12 +1118,13 @@ #define I_MS3_PIN -1 #endif -// The J axis, if any, should be the next open extruder port #if HAS_J_AXIS && !defined(J_DIAG_PIN) && !defined(J_STEP_PIN) && !PIN_EXISTS(J_CS_PIN) #define K_E_INDEX INCREMENT(J_E_INDEX) #else #define K_E_INDEX J_E_INDEX #endif + +// The J axis, if any, should be the next open extruder port #if HAS_J_AXIS #ifndef J_STEP_PIN #define J_STEP_PIN _EPIN(J_E_INDEX, STEP) From cf654bbba218c747d34a559b6555462bf65c46cb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jan 2022 03:43:14 -0600 Subject: [PATCH 028/502] =?UTF-8?q?=F0=9F=A9=B9=20Followup=20to=20extra=20?= =?UTF-8?q?axes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/feature/pause/M600.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index edb06aa947a2..1679c90687bd 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -116,17 +116,14 @@ void GcodeSuite::M600() { xyz_pos_t park_point NOZZLE_PARK_POINT; - // Lift Z axis first - if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); - // Move XY axes to filament change position or given position LINEAR_AXIS_CODE( if (parser.seenval('X')) park_point.x = parser.linearval('X'), if (parser.seenval('Y')) park_point.y = parser.linearval('Y'), - NOOP, - if (parser.seenval(AXIS4_NAME)) park_point.i = parser.linearval(AXIS4_NAME); - if (parser.seenval(AXIS5_NAME)) park_point.j = parser.linearval(AXIS5_NAME); - if (parser.seenval(AXIS6_NAME)) park_point.k = parser.linearval(AXIS6_NAME); + if (parser.seenval('Z')) park_point.z = parser.linearval('Z'), // Lift Z axis + if (parser.seenval(AXIS4_NAME)) park_point.i = parser.linearval(AXIS4_NAME), + if (parser.seenval(AXIS5_NAME)) park_point.j = parser.linearval(AXIS5_NAME), + if (parser.seenval(AXIS6_NAME)) park_point.k = parser.linearval(AXIS6_NAME) ); #if HAS_HOTEND_OFFSET && NONE(DUAL_X_CARRIAGE, DELTA) From d7287e7db838d9027c86118a5089dd47591b2795 Mon Sep 17 00:00:00 2001 From: George Fu Date: Fri, 14 Jan 2022 18:10:35 +0800 Subject: [PATCH 029/502] =?UTF-8?q?=F0=9F=94=A8=20Set=20upload=5Fcommand?= =?UTF-8?q?=20for=20CHEETAH=20v20=20(#23515)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/stm32f4.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 1ac533f4d312..c7d70dd01de2 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -47,6 +47,7 @@ extends = stm32_variant board = marlin_FYSETC_CHEETAH_V20 board_build.offset = 0x8000 build_flags = ${stm32_variant.build_flags} -DSTM32F401xC +upload_command = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE" # # FLYF407ZG From 44249b1380e8d0393c366b75d7b18b45318c6b94 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jan 2022 06:16:14 -0600 Subject: [PATCH 030/502] =?UTF-8?q?=F0=9F=94=A7=20Skip=20unused=20axis=20n?= =?UTF-8?q?ames?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_post.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 6d2a0e1f7d07..3a2a6f2711ee 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -78,13 +78,13 @@ /** * Axis lengths and center */ -#ifndef AXIS4_NAME +#if HAS_I_AXIS && !defined(AXIS4_NAME) #define AXIS4_NAME 'A' #endif -#ifndef AXIS5_NAME +#if HAS_J_AXIS && !defined(AXIS5_NAME) #define AXIS5_NAME 'B' #endif -#ifndef AXIS6_NAME +#if HAS_K_AXIS && !defined(AXIS6_NAME) #define AXIS6_NAME 'C' #endif From 01cb7c19f9bc959a18190d6c8b9efc7a121246ce Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Sat, 15 Jan 2022 23:05:53 -0600 Subject: [PATCH 031/502] =?UTF-8?q?=F0=9F=90=9B=20Fix,=20improve=20PWM=20o?= =?UTF-8?q?n=20AVR=20(#23520)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/fast_pwm.cpp | 23 ++++++++++++++++------- Marlin/src/module/planner.cpp | 9 +++------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Marlin/src/HAL/AVR/fast_pwm.cpp b/Marlin/src/HAL/AVR/fast_pwm.cpp index 071f008e8974..af96fb9e18fd 100644 --- a/Marlin/src/HAL/AVR/fast_pwm.cpp +++ b/Marlin/src/HAL/AVR/fast_pwm.cpp @@ -61,7 +61,6 @@ Timer get_pwm_timer(const pin_t pin) { switch (digitalPinToTimer(pin)) { #ifdef TCCR0A IF_DISABLED(AVR_AT90USB1286_FAMILY, case TIMER0A:) - case TIMER0B: #endif #ifdef TCCR1A case TIMER1A: case TIMER1B: @@ -69,11 +68,16 @@ Timer get_pwm_timer(const pin_t pin) { break; // Protect reserved timers (TIMER0 & TIMER1) + #ifdef TCCR0A + case TIMER0B: // Protected timer, but allow setting the duty cycle on OCR0B for pin D4 only + return Timer({ { &TCCR0A, nullptr, nullptr }, { (uint16_t*)&OCR0B, nullptr, nullptr }, nullptr, 0, 0, true, true }); + #endif + #if HAS_TCCR2 case TIMER2: return Timer({ { &TCCR2, nullptr, nullptr }, { (uint16_t*)&OCR2, nullptr, nullptr }, nullptr, 2, 0, true, false }); #elif ENABLED(USE_OCR2A_AS_TOP) - case TIMER2A: break; // protect TIMER2A since its OCR is used by TIMER2B + case TIMER2A: break; // Protect TIMER2A since its OCR is used by TIMER2B case TIMER2B: return Timer({ { &TCCR2A, &TCCR2B, nullptr }, { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, nullptr, 2, 1, true, false }); #elif defined(TCCR2A) @@ -174,18 +178,23 @@ void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { // If v is 0 or v_size (max), digitalWrite to LOW or HIGH. - // Note that digitalWrite also disables pwm output for us (sets COM bit to 0) + // Note that digitalWrite also disables PWM output for us (sets COM bit to 0) if (v == 0) digitalWrite(pin, invert); else if (v == v_size) digitalWrite(pin, !invert); else { Timer timer = get_pwm_timer(pin); - if (timer.isProtected) return; // Leave protected timer unchanged if (timer.isPWM) { - _SET_COMnQ(timer.TCCRnQ, SUM_TERN(HAS_TCCR2, timer.q, timer.q == 2), COM_CLEAR_SET + invert); // COM20 is on bit 4 of TCCR2, so +1 for q==2 - const uint16_t top = timer.n == 2 ? TERN(USE_OCR2A_AS_TOP, *timer.OCRnQ[0], 255) : *timer.ICRn; - _SET_OCRnQ(timer.OCRnQ, timer.q, uint16_t(uint32_t(v) * top / v_size)); // Scale 8/16-bit v to top value + if (timer.n == 0) { + TCCR0A |= _BV(COM0B1); // Only allow a TIMER0B select and OCR0B duty update for pin D4 outputs no frequency changes are permited. + OCR0B = v; + } + else if (!timer.isProtected) { + const uint16_t top = timer.n == 2 ? TERN(USE_OCR2A_AS_TOP, *timer.OCRnQ[0], 255) : *timer.ICRn; + _SET_COMnQ(timer.TCCRnQ, SUM_TERN(HAS_TCCR2, timer.q, timer.q == 2), COM_CLEAR_SET + invert); // COM20 is on bit 4 of TCCR2, so +1 for q==2 + _SET_OCRnQ(timer.OCRnQ, timer.q, uint16_t(uint32_t(v) * top / v_size)); // Scale 8/16-bit v to top value + } } else digitalWrite(pin, v < 128 ? LOW : HIGH); diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 6979fa6a80eb..8d8f44dc7805 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1244,10 +1244,6 @@ void Planner::recalculate() { recalculate_trapezoids(); } -#if HAS_FAN && DISABLED(LASER_SYNCHRONOUS_M106_M107) - #define HAS_TAIL_FAN_SPEED 1 -#endif - /** * Apply fan speeds */ @@ -1308,8 +1304,9 @@ void Planner::check_axes_activity() { xyze_bool_t axis_active = { false }; #endif - #if HAS_TAIL_FAN_SPEED - static uint8_t tail_fan_speed[FAN_COUNT] = ARRAY_N_1(FAN_COUNT, 255); + #if HAS_FAN && DISABLED(LASER_SYNCHRONOUS_M106_M107) + #define HAS_TAIL_FAN_SPEED 1 + static uint8_t tail_fan_speed[FAN_COUNT] = ARRAY_N_1(FAN_COUNT, 128); bool fans_need_update = false; #endif From a80cafbcfcad382a88db4e0d2ac8657cf3a62c39 Mon Sep 17 00:00:00 2001 From: Sola <42537573+solawc@users.noreply.github.com> Date: Sun, 16 Jan 2022 13:07:37 +0800 Subject: [PATCH 032/502] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20SPI+DMA+interrupt?= =?UTF-8?q?=20method=20(STM32=20/=20MKS=20UI)=20(#23464)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32/tft/tft_spi.cpp | 24 +++++++++ Marlin/src/HAL/STM32/tft/tft_spi.h | 18 +++++-- Marlin/src/lcd/extui/mks_ui/draw_ui.cpp | 5 +- .../extui/mks_ui/tft_lvgl_configuration.cpp | 52 +++++++++++++++++-- .../lcd/extui/mks_ui/tft_lvgl_configuration.h | 2 + Marlin/src/lcd/tft_io/tft_io.h | 5 ++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 4 ++ .../stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 12 +++-- 8 files changed, 110 insertions(+), 12 deletions(-) diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.cpp b/Marlin/src/HAL/STM32/tft/tft_spi.cpp index 4ad35cee8ba3..2e18c8a64c06 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_spi.cpp @@ -242,5 +242,29 @@ void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Coun Abort(); } +#if ENABLED(USE_SPI_DMA_TC) + + void TFT_SPI::TransmitDMA_IT(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) { + + DMAtx.Init.MemInc = MemoryIncrease; + HAL_DMA_Init(&DMAtx); + + if (TFT_MISO_PIN == TFT_MOSI_PIN) + SPI_1LINE_TX(&SPIx); + + DataTransferBegin(); + + HAL_NVIC_SetPriority(DMA2_Stream3_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(DMA2_Stream3_IRQn); + HAL_DMA_Start_IT(&DMAtx, (uint32_t)Data, (uint32_t)&(SPIx.Instance->DR), Count); + __HAL_SPI_ENABLE(&SPIx); + + SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); // Enable Tx DMA Request + } + + extern "C" void DMA2_Stream3_IRQHandler(void) { HAL_DMA_IRQHandler(&TFT_SPI::DMAtx); } + +#endif + #endif // HAS_SPI_TFT #endif // HAL_STM32 diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.h b/Marlin/src/HAL/STM32/tft/tft_spi.h index 667b5f366b7e..de051e229459 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.h +++ b/Marlin/src/HAL/STM32/tft/tft_spi.h @@ -36,20 +36,25 @@ #define LCD_READ_ID4 0xD3 // Read display identification information (0xD3 on ILI9341) #endif -#define DATASIZE_8BIT SPI_DATASIZE_8BIT -#define DATASIZE_16BIT SPI_DATASIZE_16BIT -#define TFT_IO_DRIVER TFT_SPI +#define DATASIZE_8BIT SPI_DATASIZE_8BIT +#define DATASIZE_16BIT SPI_DATASIZE_16BIT +#define TFT_IO_DRIVER TFT_SPI class TFT_SPI { private: static SPI_HandleTypeDef SPIx; - static DMA_HandleTypeDef DMAtx; + static uint32_t ReadID(uint16_t Reg); static void Transmit(uint16_t Data); static void TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count); + #if ENABLED(USE_SPI_DMA_TC) + static void TransmitDMA_IT(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count); + #endif public: + static DMA_HandleTypeDef DMAtx; + static void Init(); static uint32_t GetID(); static bool isBusy(); @@ -63,6 +68,11 @@ class TFT_SPI { static void WriteReg(uint16_t Reg) { WRITE(TFT_A0_PIN, LOW); Transmit(Reg); WRITE(TFT_A0_PIN, HIGH); } static void WriteSequence(uint16_t *Data, uint16_t Count) { TransmitDMA(DMA_MINC_ENABLE, Data, Count); } + + #if ENABLED(USE_SPI_DMA_TC) + static void WriteSequenceIT(uint16_t *Data, uint16_t Count) { TransmitDMA_IT(DMA_MINC_ENABLE, Data, Count); } + #endif + static void WriteMultiple(uint16_t Color, uint16_t Count) { static uint16_t Data; Data = Color; TransmitDMA(DMA_MINC_DISABLE, &Data, Count); } static void WriteMultiple(uint16_t Color, uint32_t Count) { static uint16_t Data; Data = Color; diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp index 66b2deda6605..aa6fe5e063ed 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp @@ -1331,7 +1331,6 @@ void lv_screen_menu_item_onoff_update(lv_obj_t *btn, const bool curValue) { lv_label_set_text((lv_obj_t*)btn->child_ll.head, curValue ? machine_menu.enable : machine_menu.disable); } - #if ENABLED(SDSUPPORT) void sd_detection() { @@ -1360,7 +1359,9 @@ void print_time_count() { } void LV_TASK_HANDLER() { - lv_task_handler(); + + if (TERN1(USE_SPI_DMA_TC, !get_lcd_dma_lock())) + lv_task_handler(); #if BOTH(MKS_TEST, SDSUPPORT) if (mks_test_flag == 0x1E) mks_hardware_test(); diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp index f960bdc63c24..82b209593e97 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -133,6 +133,27 @@ void tft_lvgl_init() { watchdog_refresh(); // LVGL init takes time + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + uint16_t usb_flash_loop = 1000; + #if ENABLED(MULTI_VOLUME) && !HAS_SD_HOST_DRIVE + SET_INPUT_PULLUP(SD_DETECT_PIN); + if (READ(SD_DETECT_PIN) == LOW) card.changeMedia(&card.media_driver_sdcard); + else card.changeMedia(&card.media_driver_usbFlash); + #endif + do { + card.media_driver_usbFlash.idle(); + watchdog_refresh(); + delay(2); + } while (!card.media_driver_usbFlash.isInserted() && usb_flash_loop--); + card.mount(); + #elif HAS_LOGO_IN_FLASH + delay(1000); + watchdog_refresh(); + delay(1000); + #endif + + watchdog_refresh(); // LVGL init takes time + #if ENABLED(SDSUPPORT) UpdateAssets(); watchdog_refresh(); // LVGL init takes time @@ -231,19 +252,44 @@ void tft_lvgl_init() { #endif } +static lv_disp_drv_t* disp_drv_p; + +#if ENABLED(USE_SPI_DMA_TC) + bool lcd_dma_trans_lock = false; +#endif + +void dmc_tc_handler(struct __DMA_HandleTypeDef * hdma) { + #if ENABLED(USE_SPI_DMA_TC) + lv_disp_flush_ready(disp_drv_p); + lcd_dma_trans_lock = false; + TFT_SPI::Abort(); + #endif +} + void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) { uint16_t width = area->x2 - area->x1 + 1, height = area->y2 - area->y1 + 1; - SPI_TFT.setWindow((uint16_t)area->x1, (uint16_t)area->y1, width, height); + TERN_(USE_SPI_DMA_TC, disp_drv_p = disp); - SPI_TFT.tftio.WriteSequence((uint16_t*)color_p, width * height); + SPI_TFT.setWindow((uint16_t)area->x1, (uint16_t)area->y1, width, height); - lv_disp_flush_ready(disp); // Indicate you are ready with the flushing + #if ENABLED(USE_SPI_DMA_TC) + lcd_dma_trans_lock = true; + SPI_TFT.tftio.WriteSequenceIT((uint16_t*)color_p, width * height); + TFT_SPI::DMAtx.XferCpltCallback = dmc_tc_handler; + #else + SPI_TFT.tftio.WriteSequence((uint16_t*)color_p, width * height); + lv_disp_flush_ready(disp_drv_p); // Indicate you are ready with the flushing + #endif W25QXX.init(SPI_QUARTER_SPEED); } +#if ENABLED(USE_SPI_DMA_TC) + bool get_lcd_dma_lock() { return lcd_dma_trans_lock; } +#endif + void lv_fill_rect(lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2, lv_color_t bk_color) { uint16_t width, height; width = x2 - x1 + 1; diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h index 0790d8323c5d..0368140b2858 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h @@ -64,6 +64,8 @@ lv_fs_res_t sd_tell_cb(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); void lv_fill_rect(lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2, lv_color_t bk_color); +bool get_lcd_dma_lock(); + #ifdef __cplusplus } /* C-declarations for C++ */ #endif diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index 65602240d63a..50b921cd2a93 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -121,6 +121,11 @@ class TFT_IO { inline static void WriteReg(uint16_t Reg) { io.WriteReg(Reg); }; inline static void WriteSequence(uint16_t *Data, uint16_t Count) { io.WriteSequence(Data, Count); }; + + #if ENABLED(USE_SPI_DMA_TC) + inline static void WriteSequenceIT(uint16_t *Data, uint16_t Count) { io.WriteSequenceIT(Data, Count); }; + #endif + // static void WriteMultiple(uint16_t Color, uint16_t Count) { static uint16_t Data; Data = Color; TransmitDMA(DMA_MINC_DISABLE, &Data, Count); } inline static void WriteMultiple(uint16_t Color, uint32_t Count) { io.WriteMultiple(Color, Count); }; diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 2d70e7234708..ce033d4013f5 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -44,6 +44,10 @@ //#define LED_PIN PB2 +#if HAS_TFT_LVGL_UI + #define BOARD_INIT OUT_WRITE(PB0, LOW) +#endif + #include "pins_MKS_ROBIN_NANO_common.h" #if HAS_TFT_LVGL_UI && FAN1_PIN != PB0 && HEATER_1_PIN != PB0 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index bbf162bb0d98..2c191946cd52 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -366,9 +366,15 @@ #endif // HAS_WIRED_LCD +#if HAS_TFT_LVGL_UI + #define USE_SPI_DMA_TC +#endif + #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI, HAS_WIRED_LCD) #define BEEPER_PIN EXP1_10_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #if DISABLED(USE_SPI_DMA_TC) + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN + #endif #endif From 4f2ed6732446f28cbab31c3b6e02cd7d550a271c Mon Sep 17 00:00:00 2001 From: Taylor Talkington Date: Mon, 17 Jan 2022 00:34:50 -0500 Subject: [PATCH 033/502] =?UTF-8?q?=F0=9F=92=84=20MarlinUI+DOGM=20leveled?= =?UTF-8?q?=20bed=20bitmaps=20(#23539)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/dogm/status/bed.h | 29 ++++++++++++++++++++++ Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 12 ++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/dogm/status/bed.h b/Marlin/src/lcd/dogm/status/bed.h index 175a50e34188..27f5617ef703 100644 --- a/Marlin/src/lcd/dogm/status/bed.h +++ b/Marlin/src/lcd/dogm/status/bed.h @@ -42,6 +42,18 @@ B00000011,B11111111,B11111111 }; + #if HAS_LEVELING + const unsigned char status_bed_leveled_bmp[] PROGMEM = { + B11111111,B11111111,B11001110, + B01000000,B00100000,B00100100, + B00100000,B00010000,B00010000, + B00011111,B11111111,B11111000, + B00001000,B00000100,B00000100, + B00100100,B00000010,B00000010, + B01110011,B11111111,B11111111 + }; + #endif + const unsigned char status_bed_on_bmp[] PROGMEM = { B00000010,B00100010,B00000000, B00000100,B01000100,B00000000, @@ -57,6 +69,23 @@ B00000011,B11111111,B11111111 }; + #if HAS_LEVELING + const unsigned char status_bed_leveled_on_bmp[] PROGMEM = { + B00000010,B00100010,B00000000, + B00000100,B01000100,B00000000, + B00000100,B01000100,B00000000, + B00000010,B00100010,B00000000, + B00000001,B00010001,B00000000, + B11111111,B11111111,B11001110, + B01000000,B10101000,B10100100, + B00100001,B00010001,B00010000, + B00011111,B11111111,B11111000, + B00001000,B00000100,B00000100, + B00100100,B00000010,B00000010, + B01110011,B11111111,B11111111 + }; + #endif + #else #define STATUS_BED_WIDTH 21 diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 45f69e2886a5..c2174decb681 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -49,6 +49,10 @@ #include "../../module/planner.h" #endif +#if HAS_LEVELING + #include "../../module/planner.h" +#endif + #if HAS_CUTTER #include "../../feature/spindle_laser.h" #endif @@ -602,7 +606,13 @@ void MarlinUI::draw_status_screen() { #if DO_DRAW_BED && DISABLED(STATUS_COMBINE_HEATERS) #if ANIM_BED - #define BED_BITMAP(S) ((S) ? status_bed_on_bmp : status_bed_bmp) + #if BOTH(HAS_LEVELING, STATUS_ALT_BED_BITMAP) + #define BED_BITMAP(S) ((S) \ + ? (planner.leveling_active ? status_bed_leveled_on_bmp : status_bed_on_bmp) \ + : (planner.leveling_active ? status_bed_leveled_bmp : status_bed_bmp)) + #else + #define BED_BITMAP(S) ((S) ? status_bed_on_bmp : status_bed_bmp) + #endif #else #define BED_BITMAP(S) status_bed_bmp #endif From 420f0749150a2cc280239a2ad2335a0f6d6b3560 Mon Sep 17 00:00:00 2001 From: Miguel Risco-Castillo Date: Mon, 17 Jan 2022 00:36:03 -0500 Subject: [PATCH 034/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20PLR=20for=20E3V2?= =?UTF-8?q?=20Enhanced=20UI=20(#23543)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/enhanced/dwin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp index f12f981b7289..484aa392f035 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp @@ -1445,6 +1445,9 @@ void Draw_Main_Area() { case PrintStatsProcess: Draw_PrintStats(); break; #endif case PauseOrStop: Popup_window_PauseOrStop(); break; + #if ENABLED(POWER_LOSS_RECOVERY) + case PwrlossRec: Popup_PowerLossRecovery(); break; + #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) case FilamentPurge: Draw_Popup_FilamentPurge(); break; #endif @@ -1589,7 +1592,7 @@ void EachMomentUpdate() { #if ENABLED(POWER_LOSS_RECOVERY) else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // resume print before power off - Goto_PowerLossRecovery(); + return Goto_PowerLossRecovery(); } #endif // POWER_LOSS_RECOVERY @@ -1675,6 +1678,9 @@ void DWIN_HandleScreen() { #endif case NothingToDo: break; case Locked: HMI_LockScreen(); break; + #if ENABLED(POWER_LOSS_RECOVERY) + case PwrlossRec: HMI_PowerlossRecovery(); break; + #endif #if HAS_ESDIAG case ESDiagProcess: HMI_Popup(); break; #endif From ab40c998931a8c0b5c0693c2a828bc239c70adb2 Mon Sep 17 00:00:00 2001 From: Anson Liu Date: Mon, 17 Jan 2022 00:39:09 -0500 Subject: [PATCH 035/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Ultimain=202=20E-a?= =?UTF-8?q?utofan=20pin=20mapping=20(#23466)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/temperature.cpp | 10 ---------- Marlin/src/pins/ramps/pins_ULTIMAIN_2.h | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index bb1768054ee8..07f72b570a3c 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -888,16 +888,6 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) { HOTEND_LOOP() { if (temp_hotend[e].celsius >= EXTRUDER_AUTO_FAN_TEMPERATURE) { SBI(fanState, pgm_read_byte(&fanBit[e])); - #if MOTHERBOARD == BOARD_ULTIMAIN_2 - // For the UM2 the head fan is connected to PJ6, which does not have an Arduino PIN definition. So use direct register access. - // https://github.com/Ultimaker/Ultimaker2Marlin/blob/master/Marlin/temperature.cpp#L553 - SBI(DDRJ, 6); SBI(PORTJ, 6); - #endif - } - else { - #if MOTHERBOARD == BOARD_ULTIMAIN_2 - SBI(DDRJ, 6); CBI(PORTJ, 6); - #endif } } diff --git a/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h index 9823d4cf4b75..128f1974e0e6 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h @@ -98,7 +98,7 @@ #endif #ifndef E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN 69 + #define E0_AUTO_FAN_PIN 77 #endif // From 70f03ad852ae0453afdd532e96775aecf51c6319 Mon Sep 17 00:00:00 2001 From: zerkix <97692157+zerkix@users.noreply.github.com> Date: Mon, 17 Jan 2022 07:05:31 +0100 Subject: [PATCH 036/502] =?UTF-8?q?=F0=9F=90=9B=20Finish=20and=20organize?= =?UTF-8?q?=20temp=20sensors=20(#23519)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/HAL/ESP32/HAL.cpp | 2 + Marlin/src/HAL/SAMD51/HAL.cpp | 42 ++-- Marlin/src/HAL/STM32F1/HAL.cpp | 233 +++++------------- Marlin/src/core/macros.h | 2 + Marlin/src/inc/Conditionals_adv.h | 6 +- Marlin/src/inc/Conditionals_post.h | 14 +- .../lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp | 12 +- Marlin/src/module/temperature.cpp | 8 +- Marlin/src/module/temperature.h | 22 +- Marlin/src/module/thermistor/thermistors.h | 16 +- Marlin/src/pins/pinsDebug_list.h | 16 +- 11 files changed, 144 insertions(+), 229 deletions(-) diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index 810e386894ec..499582b8c194 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -211,7 +211,9 @@ void HAL_adc_init() { TERN_(HAS_TEMP_ADC_7, adc3_set_attenuation(get_channel(TEMP_7_PIN), ADC_ATTEN_11db)); TERN_(HAS_HEATED_BED, adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db)); TERN_(HAS_TEMP_CHAMBER, adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_PROBE, adc1_set_attenuation(get_channel(TEMP_PROBE_PIN), ADC_ATTEN_11db)); TERN_(HAS_TEMP_COOLER, adc1_set_attenuation(get_channel(TEMP_COOLER_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_BOARD, adc1_set_attenuation(get_channel(TEMP_BOARD_PIN), ADC_ATTEN_11db)); TERN_(FILAMENT_WIDTH_SENSOR, adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db)); // Note that adc2 is shared with the WiFi module, which has higher priority, so the conversion may fail. diff --git a/Marlin/src/HAL/SAMD51/HAL.cpp b/Marlin/src/HAL/SAMD51/HAL.cpp index 8baad31bc751..a5febad83be1 100644 --- a/Marlin/src/HAL/SAMD51/HAL.cpp +++ b/Marlin/src/HAL/SAMD51/HAL.cpp @@ -54,20 +54,22 @@ #define GET_TEMP_5_ADC() TERN(HAS_TEMP_ADC_5, PIN_TO_ADC(TEMP_5_PIN), -1) #define GET_TEMP_6_ADC() TERN(HAS_TEMP_ADC_6, PIN_TO_ADC(TEMP_6_PIN), -1) #define GET_TEMP_7_ADC() TERN(HAS_TEMP_ADC_7, PIN_TO_ADC(TEMP_7_PIN), -1) -#define GET_PROBE_ADC() TERN(HAS_TEMP_PROBE, PIN_TO_ADC(TEMP_PROBE_PIN), -1) #define GET_BED_ADC() TERN(HAS_TEMP_ADC_BED, PIN_TO_ADC(TEMP_BED_PIN), -1) #define GET_CHAMBER_ADC() TERN(HAS_TEMP_ADC_CHAMBER, PIN_TO_ADC(TEMP_CHAMBER_PIN), -1) +#define GET_PROBE_ADC() TERN(HAS_TEMP_ADC_PROBE, PIN_TO_ADC(TEMP_PROBE_PIN), -1) #define GET_COOLER_ADC() TERN(HAS_TEMP_ADC_COOLER, PIN_TO_ADC(TEMP_COOLER_PIN), -1) +#define GET_BOARD_ADC() TERN(HAS_TEMP_ADC_BOARD, PIN_TO_ADC(TEMP_BOARD_PIN), -1) #define GET_FILAMENT_WIDTH_ADC() TERN(FILAMENT_WIDTH_SENSOR, PIN_TO_ADC(FILWIDTH_PIN), -1) #define GET_BUTTONS_ADC() TERN(HAS_ADC_BUTTONS, PIN_TO_ADC(ADC_KEYPAD_PIN), -1) #define IS_ADC_REQUIRED(n) ( \ GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n || GET_TEMP_3_ADC() == n \ || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n || GET_TEMP_6_ADC() == n || GET_TEMP_7_ADC() == n \ - || GET_PROBE_ADC() == n \ || GET_BED_ADC() == n \ || GET_CHAMBER_ADC() == n \ + || GET_PROBE_ADC() == n \ || GET_COOLER_ADC() == n \ + || GET_BOARD_ADC() == n \ || GET_FILAMENT_WIDTH_ADC() == n \ || GET_BUTTONS_ADC() == n \ ) @@ -137,18 +139,21 @@ uint16_t HAL_adc_result; #if GET_TEMP_7_ADC() == 0 TEMP_7_PIN, #endif - #if GET_PROBE_ADC() == 0 - TEMP_PROBE_PIN, - #endif #if GET_BED_ADC() == 0 TEMP_BED_PIN, #endif #if GET_CHAMBER_ADC() == 0 TEMP_CHAMBER_PIN, #endif + #if GET_PROBE_ADC() == 0 + TEMP_PROBE_PIN, + #endif #if GET_COOLER_ADC() == 0 TEMP_COOLER_PIN, #endif + #if GET_BOARD_ADC() == 0 + TEMP_BOARD_PIN, + #endif #if GET_FILAMENT_WIDTH_ADC() == 0 FILWIDTH_PIN, #endif @@ -180,18 +185,21 @@ uint16_t HAL_adc_result; #if GET_TEMP_7_ADC() == 1 TEMP_7_PIN, #endif - #if GET_PROBE_ADC() == 1 - TEMP_PROBE_PIN, - #endif #if GET_BED_ADC() == 1 TEMP_BED_PIN, #endif #if GET_CHAMBER_ADC() == 1 TEMP_CHAMBER_PIN, #endif + #if GET_PROBE_ADC() == 1 + TEMP_PROBE_PIN, + #endif #if GET_COOLER_ADC() == 1 TEMP_COOLER_PIN, #endif + #if GET_BOARD_ADC() == 1 + TEMP_BOARD_PIN, + #endif #if GET_FILAMENT_WIDTH_ADC() == 1 FILWIDTH_PIN, #endif @@ -231,18 +239,21 @@ uint16_t HAL_adc_result; #if GET_TEMP_7_ADC() == 0 { PIN_TO_INPUTCTRL(TEMP_7_PIN) }, #endif - #if GET_PROBE_ADC() == 0 - { PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) }, - #endif #if GET_BED_ADC() == 0 { PIN_TO_INPUTCTRL(TEMP_BED_PIN) }, #endif #if GET_CHAMBER_ADC() == 0 { PIN_TO_INPUTCTRL(TEMP_CHAMBER_PIN) }, #endif + #if GET_PROBE_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) }, + #endif #if GET_COOLER_ADC() == 0 { PIN_TO_INPUTCTRL(TEMP_COOLER_PIN) }, #endif + #if GET_BOARD_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_BOARD_PIN) }, + #endif #if GET_FILAMENT_WIDTH_ADC() == 0 { PIN_TO_INPUTCTRL(FILWIDTH_PIN) }, #endif @@ -283,18 +294,21 @@ uint16_t HAL_adc_result; #if GET_TEMP_7_ADC() == 1 { PIN_TO_INPUTCTRL(TEMP_7_PIN) }, #endif - #if GET_PROBE_ADC() == 1 - { PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) }, - #endif #if GET_BED_ADC() == 1 { PIN_TO_INPUTCTRL(TEMP_BED_PIN) }, #endif #if GET_CHAMBER_ADC() == 1 { PIN_TO_INPUTCTRL(TEMP_CHAMBER_PIN) }, #endif + #if GET_PROBE_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) }, + #endif #if GET_COOLER_ADC() == 1 { PIN_TO_INPUTCTRL(TEMP_COOLER_PIN) }, #endif + #if GET_BOARD_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_BOARD_PIN) }, + #endif #if GET_FILAMENT_WIDTH_ADC() == 1 { PIN_TO_INPUTCTRL(FILWIDTH_PIN) }, #endif diff --git a/Marlin/src/HAL/STM32F1/HAL.cpp b/Marlin/src/HAL/STM32F1/HAL.cpp index f29b30536146..a0486da5b0b8 100644 --- a/Marlin/src/HAL/STM32F1/HAL.cpp +++ b/Marlin/src/HAL/STM32F1/HAL.cpp @@ -120,123 +120,49 @@ uint16_t HAL_adc_result; STM32ADC adc(ADC1); const uint8_t adc_pins[] = { - #if HAS_TEMP_ADC_0 - TEMP_0_PIN, - #endif - #if HAS_TEMP_ADC_PROBE - TEMP_PROBE_PIN, - #endif - #if HAS_HEATED_BED - TEMP_BED_PIN, - #endif - #if HAS_TEMP_CHAMBER - TEMP_CHAMBER_PIN, - #endif - #if HAS_TEMP_COOLER - TEMP_COOLER_PIN, - #endif - #if HAS_TEMP_ADC_1 - TEMP_1_PIN, - #endif - #if HAS_TEMP_ADC_2 - TEMP_2_PIN, - #endif - #if HAS_TEMP_ADC_3 - TEMP_3_PIN, - #endif - #if HAS_TEMP_ADC_4 - TEMP_4_PIN, - #endif - #if HAS_TEMP_ADC_5 - TEMP_5_PIN, - #endif - #if HAS_TEMP_ADC_6 - TEMP_6_PIN, - #endif - #if HAS_TEMP_ADC_7 - TEMP_7_PIN, - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - FILWIDTH_PIN, - #endif - #if HAS_ADC_BUTTONS - ADC_KEYPAD_PIN, - #endif - #if HAS_JOY_ADC_X - JOY_X_PIN, - #endif - #if HAS_JOY_ADC_Y - JOY_Y_PIN, - #endif - #if HAS_JOY_ADC_Z - JOY_Z_PIN, - #endif - #if ENABLED(POWER_MONITOR_CURRENT) - POWER_MONITOR_CURRENT_PIN, - #endif - #if ENABLED(POWER_MONITOR_VOLTAGE) - POWER_MONITOR_VOLTAGE_PIN, - #endif + OPTITEM(HAS_TEMP_ADC_0, TEMP_0_PIN) + OPTITEM(HAS_TEMP_ADC_1, TEMP_1_PIN) + OPTITEM(HAS_TEMP_ADC_2, TEMP_2_PIN) + OPTITEM(HAS_TEMP_ADC_3, TEMP_3_PIN) + OPTITEM(HAS_TEMP_ADC_4, TEMP_4_PIN) + OPTITEM(HAS_TEMP_ADC_5, TEMP_5_PIN) + OPTITEM(HAS_TEMP_ADC_6, TEMP_6_PIN) + OPTITEM(HAS_TEMP_ADC_7, TEMP_7_PIN) + OPTITEM(HAS_HEATED_BED, TEMP_BED_PIN) + OPTITEM(HAS_TEMP_CHAMBER, TEMP_CHAMBER_PIN) + OPTITEM(HAS_TEMP_ADC_PROBE, TEMP_PROBE_PIN) + OPTITEM(HAS_TEMP_COOLER, TEMP_COOLER_PIN) + OPTITEM(HAS_TEMP_BOARD, TEMP_BOARD_PIN) + OPTITEM(FILAMENT_WIDTH_SENSOR, FILWIDTH_PIN) + OPTITEM(HAS_ADC_BUTTONS, ADC_KEYPAD_PIN) + OPTITEM(HAS_JOY_ADC_X, JOY_X_PIN) + OPTITEM(HAS_JOY_ADC_Y, JOY_Y_PIN) + OPTITEM(HAS_JOY_ADC_Z, JOY_Z_PIN) + OPTITEM(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN) + OPTITEM(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN) }; enum TempPinIndex : char { - #if HAS_TEMP_ADC_0 - TEMP_0, - #endif - #if HAS_TEMP_ADC_PROBE - TEMP_PROBE, - #endif - #if HAS_HEATED_BED - TEMP_BED, - #endif - #if HAS_TEMP_CHAMBER - TEMP_CHAMBER, - #endif - #if HAS_TEMP_COOLER - TEMP_COOLER_PIN, - #endif - #if HAS_TEMP_ADC_1 - TEMP_1, - #endif - #if HAS_TEMP_ADC_2 - TEMP_2, - #endif - #if HAS_TEMP_ADC_3 - TEMP_3, - #endif - #if HAS_TEMP_ADC_4 - TEMP_4, - #endif - #if HAS_TEMP_ADC_5 - TEMP_5, - #endif - #if HAS_TEMP_ADC_6 - TEMP_6, - #endif - #if HAS_TEMP_ADC_7 - TEMP_7, - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - FILWIDTH, - #endif - #if HAS_ADC_BUTTONS - ADC_KEY, - #endif - #if HAS_JOY_ADC_X - JOY_X, - #endif - #if HAS_JOY_ADC_Y - JOY_Y, - #endif - #if HAS_JOY_ADC_Z - JOY_Z, - #endif - #if ENABLED(POWER_MONITOR_CURRENT) - POWERMON_CURRENT, - #endif - #if ENABLED(POWER_MONITOR_VOLTAGE) - POWERMON_VOLTS, - #endif + OPTITEM(HAS_TEMP_ADC_0, TEMP_0) + OPTITEM(HAS_TEMP_ADC_1, TEMP_1) + OPTITEM(HAS_TEMP_ADC_2, TEMP_2) + OPTITEM(HAS_TEMP_ADC_3, TEMP_3) + OPTITEM(HAS_TEMP_ADC_4, TEMP_4) + OPTITEM(HAS_TEMP_ADC_5, TEMP_5) + OPTITEM(HAS_TEMP_ADC_6, TEMP_6) + OPTITEM(HAS_TEMP_ADC_7, TEMP_7) + OPTITEM(HAS_HEATED_BED, TEMP_BED) + OPTITEM(HAS_TEMP_CHAMBER, TEMP_CHAMBER) + OPTITEM(HAS_TEMP_ADC_PROBE, TEMP_PROBE) + OPTITEM(HAS_TEMP_COOLER, TEMP_COOLER) + OPTITEM(HAS_TEMP_BOARD, TEMP_BOARD) + OPTITEM(FILAMENT_WIDTH_SENSOR, FILWIDTH) + OPTITEM(HAS_ADC_BUTTONS, ADC_KEY) + OPTITEM(HAS_JOY_ADC_X, JOY_X) + OPTITEM(HAS_JOY_ADC_Y, JOY_Y) + OPTITEM(HAS_JOY_ADC_Z, JOY_Z) + OPTITEM(POWER_MONITOR_CURRENT, POWERMON_CURRENT) + OPTITEM(POWER_MONITOR_VOLTAGE, POWERMON_VOLTS) ADC_PIN_COUNT }; @@ -375,67 +301,32 @@ void HAL_adc_init() { } void HAL_adc_start_conversion(const uint8_t adc_pin) { + #define __TCASE(N,I) case N: pin_index = I; break; + #define _TCASE(C,N,I) TERN_(C, __TCASE(N, I)) //TEMP_PINS pin_index; TempPinIndex pin_index; switch (adc_pin) { default: return; - #if HAS_TEMP_ADC_0 - case TEMP_0_PIN: pin_index = TEMP_0; break; - #endif - #if HAS_TEMP_ADC_PROBE - case TEMP_PROBE_PIN: pin_index = TEMP_PROBE; break; - #endif - #if HAS_HEATED_BED - case TEMP_BED_PIN: pin_index = TEMP_BED; break; - #endif - #if HAS_TEMP_CHAMBER - case TEMP_CHAMBER_PIN: pin_index = TEMP_CHAMBER; break; - #endif - #if HAS_TEMP_COOLER - case TEMP_COOLER_PIN: pin_index = TEMP_COOLER; break; - #endif - #if HAS_TEMP_ADC_1 - case TEMP_1_PIN: pin_index = TEMP_1; break; - #endif - #if HAS_TEMP_ADC_2 - case TEMP_2_PIN: pin_index = TEMP_2; break; - #endif - #if HAS_TEMP_ADC_3 - case TEMP_3_PIN: pin_index = TEMP_3; break; - #endif - #if HAS_TEMP_ADC_4 - case TEMP_4_PIN: pin_index = TEMP_4; break; - #endif - #if HAS_TEMP_ADC_5 - case TEMP_5_PIN: pin_index = TEMP_5; break; - #endif - #if HAS_TEMP_ADC_6 - case TEMP_6_PIN: pin_index = TEMP_6; break; - #endif - #if HAS_TEMP_ADC_7 - case TEMP_7_PIN: pin_index = TEMP_7; break; - #endif - #if HAS_JOY_ADC_X - case JOY_X_PIN: pin_index = JOY_X; break; - #endif - #if HAS_JOY_ADC_Y - case JOY_Y_PIN: pin_index = JOY_Y; break; - #endif - #if HAS_JOY_ADC_Z - case JOY_Z_PIN: pin_index = JOY_Z; break; - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - case FILWIDTH_PIN: pin_index = FILWIDTH; break; - #endif - #if HAS_ADC_BUTTONS - case ADC_KEYPAD_PIN: pin_index = ADC_KEY; break; - #endif - #if ENABLED(POWER_MONITOR_CURRENT) - case POWER_MONITOR_CURRENT_PIN: pin_index = POWERMON_CURRENT; break; - #endif - #if ENABLED(POWER_MONITOR_VOLTAGE) - case POWER_MONITOR_VOLTAGE_PIN: pin_index = POWERMON_VOLTS; break; - #endif + _TCASE(HAS_TEMP_ADC_0, TEMP_0_PIN, TEMP_0) + _TCASE(HAS_TEMP_ADC_1, TEMP_1_PIN, TEMP_1) + _TCASE(HAS_TEMP_ADC_2, TEMP_2_PIN, TEMP_2) + _TCASE(HAS_TEMP_ADC_3, TEMP_3_PIN, TEMP_3) + _TCASE(HAS_TEMP_ADC_4, TEMP_4_PIN, TEMP_4) + _TCASE(HAS_TEMP_ADC_5, TEMP_5_PIN, TEMP_5) + _TCASE(HAS_TEMP_ADC_6, TEMP_6_PIN, TEMP_6) + _TCASE(HAS_TEMP_ADC_7, TEMP_7_PIN, TEMP_7) + _TCASE(HAS_HEATED_BED, TEMP_BED_PIN, TEMP_BED) + _TCASE(HAS_TEMP_CHAMBER, TEMP_CHAMBER_PIN, TEMP_CHAMBER) + _TCASE(HAS_TEMP_ADC_PROBE, TEMP_PROBE_PIN, TEMP_PROBE) + _TCASE(HAS_TEMP_COOLER, TEMP_COOLER_PIN, TEMP_COOLER) + _TCASE(HAS_TEMP_BOARD, TEMP_BOARD_PIN, TEMP_BOARD) + _TCASE(HAS_JOY_ADC_X, JOY_X_PIN, JOY_X) + _TCASE(HAS_JOY_ADC_Y, JOY_Y_PIN, JOY_Y) + _TCASE(HAS_JOY_ADC_Z, JOY_Z_PIN, JOY_Z) + _TCASE(FILAMENT_WIDTH_SENSOR, FILWIDTH_PIN, FILWIDTH) + _TCASE(HAS_ADC_BUTTONS, ADC_KEYPAD_PIN, ADC_KEY) + _TCASE(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN, POWERMON_CURRENT) + _TCASE(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN, POWERMON_VOLTS) } HAL_adc_result = HAL_adc_results[(int)pin_index] >> (12 - HAL_ADC_RESOLUTION); // shift out unused bits } diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 34fc3bc4108e..31808586cf0d 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -235,6 +235,8 @@ #define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1' #define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B. +#define _OPTITEM(A...) A, +#define OPTITEM(O,A...) TERN_(O,DEFER4(_OPTITEM)(A)) #define _OPTARG(A...) , A #define OPTARG(O,A...) TERN_(O,DEFER4(_OPTARG)(A)) #define _OPTCODE(A) A; diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index f2a316d8330e..9c3fe6bfd3a6 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -118,9 +118,9 @@ // Temperature sensor IDs #define HID_REDUNDANT -6 -#define HID_COOLER -5 -#define HID_PROBE -4 -#define HID_BOARD -3 +#define HID_BOARD -5 +#define HID_COOLER -4 +#define HID_PROBE -3 #define HID_CHAMBER -2 #define HID_BED -1 #define HID_E0 0 diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 3a2a6f2711ee..5d3ac7a690cb 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -507,7 +507,13 @@ #ifndef TEMP_SENSOR_REDUNDANT_MAX_DIFF #define TEMP_SENSOR_REDUNDANT_MAX_DIFF 10 #endif - #if REDUNDANT_TEMP_MATCH(SOURCE, COOLER) + #if REDUNDANT_TEMP_MATCH(SOURCE, BOARD) + #if !PIN_EXISTS(TEMP_BOARD) + #error "TEMP_SENSOR_REDUNDANT_SOURCE set to BOARD requires TEMP_BOARD_PIN." + #else + #define TEMP_REDUNDANT_PIN TEMP_BOARD_PIN + #endif + #elif REDUNDANT_TEMP_MATCH(SOURCE, COOLER) #if !PIN_EXISTS(TEMP_COOLER) #error "TEMP_SENSOR_REDUNDANT_SOURCE set to COOLER requires TEMP_COOLER_PIN." #else @@ -2446,12 +2452,12 @@ #if HAS_TEMP(BED) #define HAS_TEMP_BED 1 #endif -#if HAS_TEMP(PROBE) - #define HAS_TEMP_PROBE 1 -#endif #if HAS_TEMP(CHAMBER) #define HAS_TEMP_CHAMBER 1 #endif +#if HAS_TEMP(PROBE) + #define HAS_TEMP_PROBE 1 +#endif #if HAS_TEMP(COOLER) #define HAS_TEMP_COOLER 1 #endif diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp index f3f361f84e83..4c850183da0f 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp @@ -222,12 +222,12 @@ const uint16_t VPList_SDPrintTune[] PROGMEM = { }; const uint16_t VPList_StepPerMM[] PROGMEM = { - VP_X_STEP_PER_MM - , VP_Y_STEP_PER_MM - , VP_Z_STEP_PER_MM - OPTARG(HAS_HOTEND, VP_E0_STEP_PER_MM) - OPTARG(HAS_MULTI_HOTEND, VP_E1_STEP_PER_MM) - , 0x0000 + VP_X_STEP_PER_MM, + VP_Y_STEP_PER_MM, + VP_Z_STEP_PER_MM, + OPTITEM(HAS_HOTEND, VP_E0_STEP_PER_MM) + OPTITEM(HAS_MULTI_HOTEND, VP_E1_STEP_PER_MM) + 0x0000 }; const uint16_t VPList_PIDE0[] PROGMEM = { diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 07f72b570a3c..c9107a9b1c40 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -2361,12 +2361,12 @@ void Temperature::init() { #if HAS_TEMP_ADC_CHAMBER HAL_ANALOG_SELECT(TEMP_CHAMBER_PIN); #endif - #if HAS_TEMP_ADC_COOLER - HAL_ANALOG_SELECT(TEMP_COOLER_PIN); - #endif #if HAS_TEMP_ADC_PROBE HAL_ANALOG_SELECT(TEMP_PROBE_PIN); #endif + #if HAS_TEMP_ADC_COOLER + HAL_ANALOG_SELECT(TEMP_COOLER_PIN); + #endif #if HAS_TEMP_ADC_BOARD HAL_ANALOG_SELECT(TEMP_BOARD_PIN); #endif @@ -2948,8 +2948,8 @@ void Temperature::update_raw_temperatures() { TERN_(HAS_TEMP_ADC_BED, temp_bed.update()); TERN_(HAS_TEMP_ADC_CHAMBER, temp_chamber.update()); TERN_(HAS_TEMP_ADC_PROBE, temp_probe.update()); - TERN_(HAS_TEMP_ADC_BOARD, temp_board.update()); TERN_(HAS_TEMP_ADC_COOLER, temp_cooler.update()); + TERN_(HAS_TEMP_ADC_BOARD, temp_board.update()); TERN_(HAS_JOY_ADC_X, joystick.x.update()); TERN_(HAS_JOY_ADC_Y, joystick.y.update()); diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 5affcf740d75..ade1d480b22c 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -231,9 +231,6 @@ struct PIDHeaterInfo : public HeaterInfo { typedef heater_info_t bed_info_t; #endif #endif -#if HAS_TEMP_PROBE - typedef temp_info_t probe_info_t; -#endif #if HAS_HEATED_CHAMBER #if ENABLED(PIDTEMPCHAMBER) typedef struct PIDHeaterInfo chamber_info_t; @@ -243,12 +240,15 @@ struct PIDHeaterInfo : public HeaterInfo { #elif HAS_TEMP_CHAMBER typedef temp_info_t chamber_info_t; #endif -#if HAS_TEMP_BOARD - typedef temp_info_t board_info_t; +#if HAS_TEMP_PROBE + typedef temp_info_t probe_info_t; #endif #if EITHER(HAS_COOLER, HAS_TEMP_COOLER) typedef heater_info_t cooler_info_t; #endif +#if HAS_TEMP_BOARD + typedef temp_info_t board_info_t; +#endif // Heater watch handling template @@ -318,12 +318,12 @@ typedef struct { int16_t raw_min, raw_max; celsius_t mintemp, maxtemp; } temp_ra #if TEMP_SENSOR_BED_IS_CUSTOM CTI_BED, #endif - #if TEMP_SENSOR_PROBE_IS_CUSTOM - CTI_PROBE, - #endif #if TEMP_SENSOR_CHAMBER_IS_CUSTOM CTI_CHAMBER, #endif + #if TEMP_SENSOR_PROBE_IS_CUSTOM + CTI_PROBE, + #endif #if TEMP_SENSOR_COOLER_IS_CUSTOM CTI_COOLER, #endif @@ -599,12 +599,12 @@ class Temperature { #if HAS_HEATED_BED static celsius_float_t analog_to_celsius_bed(const int16_t raw); #endif - #if HAS_TEMP_PROBE - static celsius_float_t analog_to_celsius_probe(const int16_t raw); - #endif #if HAS_TEMP_CHAMBER static celsius_float_t analog_to_celsius_chamber(const int16_t raw); #endif + #if HAS_TEMP_PROBE + static celsius_float_t analog_to_celsius_probe(const int16_t raw); + #endif #if HAS_TEMP_COOLER static celsius_float_t analog_to_celsius_cooler(const int16_t raw); #endif diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 85f4449636e8..002beea5b535 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -283,13 +283,6 @@ typedef struct { int16_t value; celsius_t celsius; } temp_entry_t; #define TEMPTABLE_CHAMBER_LEN 0 #endif -#if TEMP_SENSOR_COOLER > 0 - #define TEMPTABLE_COOLER TT_NAME(TEMP_SENSOR_COOLER) - #define TEMPTABLE_COOLER_LEN COUNT(TEMPTABLE_COOLER) -#else - #define TEMPTABLE_COOLER_LEN 0 -#endif - #if TEMP_SENSOR_PROBE > 0 #define TEMPTABLE_PROBE TT_NAME(TEMP_SENSOR_PROBE) #define TEMPTABLE_PROBE_LEN COUNT(TEMPTABLE_PROBE) @@ -297,6 +290,13 @@ typedef struct { int16_t value; celsius_t celsius; } temp_entry_t; #define TEMPTABLE_PROBE_LEN 0 #endif +#if TEMP_SENSOR_COOLER > 0 + #define TEMPTABLE_COOLER TT_NAME(TEMP_SENSOR_COOLER) + #define TEMPTABLE_COOLER_LEN COUNT(TEMPTABLE_COOLER) +#else + #define TEMPTABLE_COOLER_LEN 0 +#endif + #if TEMP_SENSOR_BOARD > 0 #define TEMPTABLE_BOARD TT_NAME(TEMP_SENSOR_BOARD) #define TEMPTABLE_BOARD_LEN COUNT(TEMPTABLE_BOARD) @@ -316,8 +316,8 @@ static_assert(255 > TEMPTABLE_0_LEN || 255 > TEMPTABLE_1_LEN || 255 > TEMPTABLE_ || 255 > TEMPTABLE_4_LEN || 255 > TEMPTABLE_5_LEN || 255 > TEMPTABLE_6_LEN || 255 > TEMPTABLE_7_LEN || 255 > TEMPTABLE_BED_LEN || 255 > TEMPTABLE_CHAMBER_LEN - || 255 > TEMPTABLE_COOLER_LEN || 255 > TEMPTABLE_PROBE_LEN + || 255 > TEMPTABLE_COOLER_LEN || 255 > TEMPTABLE_BOARD_LEN || 255 > TEMPTABLE_REDUNDANT_LEN , "Temperature conversion tables over 255 entries need special consideration." diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index 599ce319af2b..2328a826ef7e 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -141,24 +141,24 @@ REPORT_NAME_ANALOG(__LINE__, TEMP_BED_PIN) #endif #endif -#if PIN_EXISTS(TEMP_BOARD) - #if ANALOG_OK(TEMP_BOARD_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_BOARD_PIN) - #endif -#endif #if PIN_EXISTS(TEMP_CHAMBER) #if ANALOG_OK(TEMP_CHAMBER_PIN) REPORT_NAME_ANALOG(__LINE__, TEMP_CHAMBER_PIN) #endif #endif +#if PIN_EXISTS(TEMP_PROBE) + #if ANALOG_OK(TEMP_PROBE_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_PROBE_PIN) + #endif +#endif #if PIN_EXISTS(TEMP_COOLER) #if ANALOG_OK(TEMP_COOLER_PIN) REPORT_NAME_ANALOG(__LINE__, TEMP_COOLER_PIN) #endif #endif -#if PIN_EXISTS(TEMP_PROBE) - #if ANALOG_OK(TEMP_PROBE_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_PROBE_PIN) +#if PIN_EXISTS(TEMP_BOARD) + #if ANALOG_OK(TEMP_BOARD_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_BOARD_PIN) #endif #endif #if PIN_EXISTS(ADC_KEYPAD) From d18558bbd31f963014b759aee5a59b001b74365c Mon Sep 17 00:00:00 2001 From: John Lagonikas <39417467+zeleps@users.noreply.github.com> Date: Mon, 17 Jan 2022 14:56:25 +0200 Subject: [PATCH 037/502] =?UTF-8?q?=F0=9F=9A=B8=20Suppressible=20pin=20war?= =?UTF-8?q?nings=20(#23530)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/Warnings.cpp | 932 ++++++++++++++++++------------------ 1 file changed, 469 insertions(+), 463 deletions(-) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index c2fe42ae82e2..684ab82d0079 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -59,474 +59,478 @@ #warning "Your Configuration provides no method to acquire user feedback!" #endif -#if AUTO_ASSIGNED_X2_STEPPER - #warning "Auto-assigned X2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_X2_MS1 - #warning "Auto-assigned X2_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_X2_MS2 - #warning "Auto-assigned X2_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_X2_MS3 - #warning "Auto-assigned X2_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_X2_CS - #warning "Auto-assigned X2_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_X2_DIAG - #if X2_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned X2_DIAG_PIN to X_MIN_PIN." - #elif X2_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned X2_DIAG_PIN to X_MAX_PIN." - #elif X2_USE_ENDSTOP == _XSTOP_ - #warning "Auto-assigned X2_DIAG_PIN to X_STOP_PIN." - #elif X2_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned X2_DIAG_PIN to Y_MIN_PIN." - #elif X2_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned X2_DIAG_PIN to Y_MAX_PIN." - #elif X2_USE_ENDSTOP == _YSTOP_ - #warning "Auto-assigned X2_DIAG_PIN to Y_STOP_PIN." - #elif X2_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned X2_DIAG_PIN to Z_MIN_PIN." - #elif X2_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned X2_DIAG_PIN to Z_MAX_PIN." - #elif X2_USE_ENDSTOP == _ZSTOP_ - #warning "Auto-assigned X2_DIAG_PIN to Z_STOP_PIN." - #elif X2_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned X2_DIAG_PIN to X_DIAG_PIN." - #elif X2_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned X2_DIAG_PIN to Y_DIAG_PIN." - #elif X2_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned X2_DIAG_PIN to Z_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E0_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E1_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E2_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E3_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E4_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E5_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E6_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E7_DIAG_PIN." +#ifndef NO_AUTO_ASSIGN_WARNING + + #if AUTO_ASSIGNED_X2_STEPPER + #warning "Note: Auto-assigned X2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" #endif -#endif -#if AUTO_ASSIGNED_Y2_STEPPER - #warning "Auto-assigned Y2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_Y2_MS1 - #warning "Auto-assigned Y2_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_Y2_MS2 - #warning "Auto-assigned Y2_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_Y2_MS3 - #warning "Auto-assigned Y2_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_Y2_CS - #warning "Auto-assigned Y2_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_Y2_DIAG - #if Y2_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned Y2_DIAG_PIN to X_MIN_PIN." - #elif Y2_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned Y2_DIAG_PIN to X_MAX_PIN." - #elif Y2_USE_ENDSTOP == _XSTOP_ - #warning "Auto-assigned Y2_DIAG_PIN to X_STOP_PIN." - #elif Y2_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned Y2_DIAG_PIN to Y_MIN_PIN." - #elif Y2_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned Y2_DIAG_PIN to Y_MAX_PIN." - #elif Y2_USE_ENDSTOP == _YSTOP_ - #warning "Auto-assigned Y2_DIAG_PIN to Y_STOP_PIN." - #elif Y2_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned Y2_DIAG_PIN to Z_MIN_PIN." - #elif Y2_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned Y2_DIAG_PIN to Z_MAX_PIN." - #elif Y2_USE_ENDSTOP == _ZSTOP_ - #warning "Auto-assigned Y2_DIAG_PIN to Z_STOP_PIN." - #elif Y2_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to X_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to Y_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to Z_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E0_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E1_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E2_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E3_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E4_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E5_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E6_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E7_DIAG_PIN." + #if AUTO_ASSIGNED_X2_MS1 + #warning "Note: Auto-assigned X2_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" #endif -#endif -#if AUTO_ASSIGNED_Z2_STEPPER - #warning "Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_Z2_MS1 - #warning "Auto-assigned Z2_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_Z2_MS2 - #warning "Auto-assigned Z2_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_Z2_MS3 - #warning "Auto-assigned Z2_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_Z2_CS - #warning "Auto-assigned Z2_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_Z2_DIAG - #if Z2_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned Z2_DIAG_PIN to X_MIN_PIN." - #elif Z2_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned Z2_DIAG_PIN to X_MAX_PIN." - #elif Z2_USE_ENDSTOP == _XSTOP_ - #warning "Auto-assigned Z2_DIAG_PIN to X_STOP_PIN." - #elif Z2_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned Z2_DIAG_PIN to Y_MIN_PIN." - #elif Z2_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned Z2_DIAG_PIN to Y_MAX_PIN." - #elif Z2_USE_ENDSTOP == _YSTOP_ - #warning "Auto-assigned Z2_DIAG_PIN to Y_STOP_PIN." - #elif Z2_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned Z2_DIAG_PIN to Z_MIN_PIN." - #elif Z2_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned Z2_DIAG_PIN to Z_MAX_PIN." - #elif Z2_USE_ENDSTOP == _ZSTOP_ - #warning "Auto-assigned Z2_DIAG_PIN to Z_STOP_PIN." - #elif Z2_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to X_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to Y_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to Z_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E0_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E1_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E2_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E3_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E4_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E5_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E6_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E7_DIAG_PIN." + #if AUTO_ASSIGNED_X2_MS2 + #warning "Note: Auto-assigned X2_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" #endif -#endif -#if AUTO_ASSIGNED_Z3_STEPPER - #warning "Auto-assigned Z3 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_Z3_CS - #warning "Auto-assigned Z3_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_Z3_MS1 - #warning "Auto-assigned Z3_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_Z3_MS2 - #warning "Auto-assigned Z3_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_Z3_MS3 - #warning "Auto-assigned Z3_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_Z3_DIAG - #if Z3_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned Z3_DIAG_PIN to X_MIN_PIN." - #elif Z3_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned Z3_DIAG_PIN to X_MAX_PIN." - #elif Z3_USE_ENDSTOP == _XSTOP_ - #warning "Auto-assigned Z3_DIAG_PIN to X_STOP_PIN." - #elif Z3_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned Z3_DIAG_PIN to Y_MIN_PIN." - #elif Z3_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned Z3_DIAG_PIN to Y_MAX_PIN." - #elif Z3_USE_ENDSTOP == _YSTOP_ - #warning "Auto-assigned Z3_DIAG_PIN to Y_STOP_PIN." - #elif Z3_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned Z3_DIAG_PIN to Z_MIN_PIN." - #elif Z3_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned Z3_DIAG_PIN to Z_MAX_PIN." - #elif Z3_USE_ENDSTOP == _ZSTOP_ - #warning "Auto-assigned Z3_DIAG_PIN to Z_STOP_PIN." - #elif Z3_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to X_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to Y_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to Z_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E0_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E1_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E2_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E3_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E4_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E5_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E6_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E7_DIAG_PIN." + #if AUTO_ASSIGNED_X2_MS3 + #warning "Note: Auto-assigned X2_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" #endif -#endif -#if AUTO_ASSIGNED_Z4_STEPPER - #warning "Auto-assigned Z4 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_Z4_CS - #warning "Auto-assigned Z4_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_Z4_MS1 - #warning "Auto-assigned Z4_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_Z4_MS2 - #warning "Auto-assigned Z4_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_Z4_MS3 - #warning "Auto-assigned Z4_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_Z4_DIAG - #if Z4_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned Z4_DIAG_PIN to X_MIN_PIN." - #elif Z4_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned Z4_DIAG_PIN to X_MAX_PIN." - #elif Z4_USE_ENDSTOP == _XSTOP_ - #warning "Auto-assigned Z4_DIAG_PIN to X_STOP_PIN." - #elif Z4_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned Z4_DIAG_PIN to Y_MIN_PIN." - #elif Z4_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned Z4_DIAG_PIN to Y_MAX_PIN." - #elif Z4_USE_ENDSTOP == _YSTOP_ - #warning "Auto-assigned Z4_DIAG_PIN to Y_STOP_PIN." - #elif Z4_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned Z4_DIAG_PIN to Z_MIN_PIN." - #elif Z4_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned Z4_DIAG_PIN to Z_MAX_PIN." - #elif Z4_USE_ENDSTOP == _ZSTOP_ - #warning "Auto-assigned Z4_DIAG_PIN to Z_STOP_PIN." - #elif Z4_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to X_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to Y_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to Z_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E0_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E1_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E2_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E3_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E4_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E5_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E6_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E7_DIAG_PIN." + #if AUTO_ASSIGNED_X2_CS + #warning "Note: Auto-assigned X2_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" #endif -#endif -#if AUTO_ASSIGNED_I_STEPPER - #warning "Auto-assigned I STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_I_CS - #warning "Auto-assigned I_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_I_MS1 - #warning "Auto-assigned I_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_I_MS2 - #warning "Auto-assigned I_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_I_MS3 - #warning "Auto-assigned I_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_I_DIAG - #if I_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned I_DIAG_PIN to X_MIN_PIN." - #elif I_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned I_DIAG_PIN to X_MAX_PIN." - #elif I_USE_ENDSTOP == _XSTOP_ - #warning "Auto-assigned I_DIAG_PIN to X_STOP_PIN." - #elif I_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned I_DIAG_PIN to Y_MIN_PIN." - #elif I_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned I_DIAG_PIN to Y_MAX_PIN." - #elif I_USE_ENDSTOP == _YSTOP_ - #warning "Auto-assigned I_DIAG_PIN to Y_STOP_PIN." - #elif I_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned I_DIAG_PIN to Z_MIN_PIN." - #elif I_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned I_DIAG_PIN to Z_MAX_PIN." - #elif I_USE_ENDSTOP == _ZSTOP_ - #warning "Auto-assigned I_DIAG_PIN to Z_STOP_PIN." - #elif I_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned I_DIAG_PIN to X_DIAG_PIN." - #elif I_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned I_DIAG_PIN to Y_DIAG_PIN." - #elif I_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned I_DIAG_PIN to Z_DIAG_PIN." - #elif I_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E0_DIAG_PIN." - #elif I_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E1_DIAG_PIN." - #elif I_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E2_DIAG_PIN." - #elif I_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E3_DIAG_PIN." - #elif I_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E4_DIAG_PIN." - #elif I_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E5_DIAG_PIN." - #elif I_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E6_DIAG_PIN." - #elif I_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E7_DIAG_PIN." + #if AUTO_ASSIGNED_X2_DIAG + #if X2_USE_ENDSTOP == _XMIN_ + #warning "Note: Auto-assigned X2_DIAG_PIN to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _XMAX_ + #warning "Note: Auto-assigned X2_DIAG_PIN to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _XSTOP_ + #warning "Note: Auto-assigned X2_DIAG_PIN to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _YMIN_ + #warning "Note: Auto-assigned X2_DIAG_PIN to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _YMAX_ + #warning "Note: Auto-assigned X2_DIAG_PIN to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _YSTOP_ + #warning "Note: Auto-assigned X2_DIAG_PIN to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _ZMIN_ + #warning "Note: Auto-assigned X2_DIAG_PIN to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _ZMAX_ + #warning "Note: Auto-assigned X2_DIAG_PIN to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _ZSTOP_ + #warning "Note: Auto-assigned X2_DIAG_PIN to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _XDIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to X_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _YDIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to Y_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _ZDIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to Z_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _E0DIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _E1DIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _E2DIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _E3DIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _E4DIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _E5DIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _E6DIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif X2_USE_ENDSTOP == _E7DIAG_ + #warning "Note: Auto-assigned X2_DIAG_PIN to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif #endif -#endif -#if AUTO_ASSIGNED_J_STEPPER - #warning "Auto-assigned J STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_J_CS - #warning "Auto-assigned J_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_J_MS1 - #warning "Auto-assigned J_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_J_MS2 - #warning "Auto-assigned J_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_J_MS3 - #warning "Auto-assigned J_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_J_DIAG - #if J_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned J_DIAG_PIN to X_MIN_PIN." - #elif J_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned J_DIAG_PIN to X_MAX_PIN." - #elif J_USE_ENDSTOP == _XSTOP_ - #warning "Auto-assigned J_DIAG_PIN to X_STOP_PIN." - #elif J_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned J_DIAG_PIN to Y_MIN_PIN." - #elif J_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned J_DIAG_PIN to Y_MAX_PIN." - #elif J_USE_ENDSTOP == _YSTOP_ - #warning "Auto-assigned J_DIAG_PIN to Y_STOP_PIN." - #elif J_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned J_DIAG_PIN to Z_MIN_PIN." - #elif J_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned J_DIAG_PIN to Z_MAX_PIN." - #elif J_USE_ENDSTOP == _ZSTOP_ - #warning "Auto-assigned J_DIAG_PIN to Z_STOP_PIN." - #elif J_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned J_DIAG_PIN to X_DIAG_PIN." - #elif J_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned J_DIAG_PIN to Y_DIAG_PIN." - #elif J_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned J_DIAG_PIN to Z_DIAG_PIN." - #elif J_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E0_DIAG_PIN." - #elif J_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E1_DIAG_PIN." - #elif J_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E2_DIAG_PIN." - #elif J_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E3_DIAG_PIN." - #elif J_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E4_DIAG_PIN." - #elif J_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E5_DIAG_PIN." - #elif J_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E6_DIAG_PIN." - #elif J_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E7_DIAG_PIN." + #if AUTO_ASSIGNED_Y2_STEPPER + #warning "Note: Auto-assigned Y2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" #endif -#endif -#if AUTO_ASSIGNED_K_STEPPER - #warning "Auto-assigned K STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_K_CS - #warning "Auto-assigned K_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_K_MS1 - #warning "Auto-assigned K_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_K_MS2 - #warning "Auto-assigned K_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_K_MS3 - #warning "Auto-assigned K_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_K_DIAG - #if K_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned K_DIAG_PIN to X_MIN_PIN." - #elif K_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned K_DIAG_PIN to X_MAX_PIN." - #elif K_USE_ENDSTOP == _XSTOP_ - #warning "Auto-assigned K_DIAG_PIN to X_STOP_PIN." - #elif K_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned K_DIAG_PIN to Y_MIN_PIN." - #elif K_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned K_DIAG_PIN to Y_MAX_PIN." - #elif K_USE_ENDSTOP == _YSTOP_ - #warning "Auto-assigned K_DIAG_PIN to Y_STOP_PIN." - #elif K_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned K_DIAG_PIN to Z_MIN_PIN." - #elif K_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned K_DIAG_PIN to Z_MAX_PIN." - #elif K_USE_ENDSTOP == _ZSTOP_ - #warning "Auto-assigned K_DIAG_PIN to Z_STOP_PIN." - #elif K_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned K_DIAG_PIN to X_DIAG_PIN." - #elif K_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned K_DIAG_PIN to Y_DIAG_PIN." - #elif K_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned K_DIAG_PIN to Z_DIAG_PIN." - #elif K_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E0_DIAG_PIN." - #elif K_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E1_DIAG_PIN." - #elif K_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E2_DIAG_PIN." - #elif K_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E3_DIAG_PIN." - #elif K_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E4_DIAG_PIN." - #elif K_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E5_DIAG_PIN." - #elif K_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E6_DIAG_PIN." - #elif K_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E7_DIAG_PIN." + #if AUTO_ASSIGNED_Y2_MS1 + #warning "Note: Auto-assigned Y2_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Y2_MS2 + #warning "Note: Auto-assigned Y2_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Y2_MS3 + #warning "Note: Auto-assigned Y2_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Y2_CS + #warning "Note: Auto-assigned Y2_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Y2_DIAG + #if Y2_USE_ENDSTOP == _XMIN_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _XMAX_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _XSTOP_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _YMIN_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _YMAX_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _YSTOP_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _ZMIN_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _ZMAX_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _ZSTOP_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _XDIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to X_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _YDIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to Y_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _ZDIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to Z_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _E0DIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _E1DIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _E2DIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _E3DIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _E4DIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _E5DIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _E6DIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Y2_USE_ENDSTOP == _E7DIAG_ + #warning "Note: Auto-assigned Y2_DIAG_PIN to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #endif + #if AUTO_ASSIGNED_Z2_STEPPER + #warning "Note: Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z2_MS1 + #warning "Note: Auto-assigned Z2_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z2_MS2 + #warning "Note: Auto-assigned Z2_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z2_MS3 + #warning "Note: Auto-assigned Z2_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z2_CS + #warning "Note: Auto-assigned Z2_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z2_DIAG + #if Z2_USE_ENDSTOP == _XMIN_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _XMAX_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _XSTOP_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _YMIN_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _YMAX_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _YSTOP_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _ZMIN_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _ZMAX_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _ZSTOP_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _XDIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to X_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _YDIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to Y_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _ZDIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to Z_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _E0DIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _E1DIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _E2DIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _E3DIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _E4DIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _E5DIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _E6DIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z2_USE_ENDSTOP == _E7DIAG_ + #warning "Note: Auto-assigned Z2_DIAG_PIN to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #endif + #if AUTO_ASSIGNED_Z3_STEPPER + #warning "Note: Auto-assigned Z3 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z3_CS + #warning "Note: Auto-assigned Z3_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z3_MS1 + #warning "Note: Auto-assigned Z3_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z3_MS2 + #warning "Note: Auto-assigned Z3_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z3_MS3 + #warning "Note: Auto-assigned Z3_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z3_DIAG + #if Z3_USE_ENDSTOP == _XMIN_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _XMAX_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _XSTOP_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _YMIN_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _YMAX_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _YSTOP_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _ZMIN_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _ZMAX_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _ZSTOP_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _XDIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to X_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _YDIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to Y_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _ZDIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to Z_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _E0DIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _E1DIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _E2DIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _E3DIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _E4DIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _E5DIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _E6DIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z3_USE_ENDSTOP == _E7DIAG_ + #warning "Note: Auto-assigned Z3_DIAG_PIN to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #endif + #if AUTO_ASSIGNED_Z4_STEPPER + #warning "Note: Auto-assigned Z4 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z4_CS + #warning "Note: Auto-assigned Z4_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z4_MS1 + #warning "Note: Auto-assigned Z4_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z4_MS2 + #warning "Note: Auto-assigned Z4_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z4_MS3 + #warning "Note: Auto-assigned Z4_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_Z4_DIAG + #if Z4_USE_ENDSTOP == _XMIN_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _XMAX_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _XSTOP_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _YMIN_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _YMAX_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _YSTOP_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _ZMIN_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _ZMAX_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _ZSTOP_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _XDIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to X_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _YDIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to Y_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _ZDIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to Z_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _E0DIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _E1DIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _E2DIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _E3DIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _E4DIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _E5DIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _E6DIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif Z4_USE_ENDSTOP == _E7DIAG_ + #warning "Note: Auto-assigned Z4_DIAG_PIN to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #endif + #if AUTO_ASSIGNED_I_STEPPER + #warning "Note: Auto-assigned I STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_I_CS + #warning "Note: Auto-assigned I_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_I_MS1 + #warning "Note: Auto-assigned I_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_I_MS2 + #warning "Note: Auto-assigned I_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_I_MS3 + #warning "Note: Auto-assigned I_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_I_DIAG + #if I_USE_ENDSTOP == _XMIN_ + #warning "Note: Auto-assigned I_DIAG_PIN to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _XMAX_ + #warning "Note: Auto-assigned I_DIAG_PIN to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _XSTOP_ + #warning "Note: Auto-assigned I_DIAG_PIN to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _YMIN_ + #warning "Note: Auto-assigned I_DIAG_PIN to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _YMAX_ + #warning "Note: Auto-assigned I_DIAG_PIN to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _YSTOP_ + #warning "Note: Auto-assigned I_DIAG_PIN to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _ZMIN_ + #warning "Note: Auto-assigned I_DIAG_PIN to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _ZMAX_ + #warning "Note: Auto-assigned I_DIAG_PIN to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _ZSTOP_ + #warning "Note: Auto-assigned I_DIAG_PIN to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _XDIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to X_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _YDIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to Y_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _ZDIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to Z_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _E0DIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _E1DIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _E2DIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _E3DIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _E4DIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _E5DIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _E6DIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif I_USE_ENDSTOP == _E7DIAG_ + #warning "Note: Auto-assigned I_DIAG_PIN to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #endif + #if AUTO_ASSIGNED_J_STEPPER + #warning "Note: Auto-assigned J STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_J_CS + #warning "Note: Auto-assigned J_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_J_MS1 + #warning "Note: Auto-assigned J_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_J_MS2 + #warning "Note: Auto-assigned J_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_J_MS3 + #warning "Note: Auto-assigned J_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_J_DIAG + #if J_USE_ENDSTOP == _XMIN_ + #warning "Note: Auto-assigned J_DIAG_PIN to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _XMAX_ + #warning "Note: Auto-assigned J_DIAG_PIN to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _XSTOP_ + #warning "Note: Auto-assigned J_DIAG_PIN to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _YMIN_ + #warning "Note: Auto-assigned J_DIAG_PIN to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _YMAX_ + #warning "Note: Auto-assigned J_DIAG_PIN to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _YSTOP_ + #warning "Note: Auto-assigned J_DIAG_PIN to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _ZMIN_ + #warning "Note: Auto-assigned J_DIAG_PIN to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _ZMAX_ + #warning "Note: Auto-assigned J_DIAG_PIN to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _ZSTOP_ + #warning "Note: Auto-assigned J_DIAG_PIN to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _XDIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to X_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _YDIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to Y_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _ZDIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to Z_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _E0DIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _E1DIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _E2DIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _E3DIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _E4DIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _E5DIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _E6DIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif J_USE_ENDSTOP == _E7DIAG_ + #warning "Note: Auto-assigned J_DIAG_PIN to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #endif + #if AUTO_ASSIGNED_K_STEPPER + #warning "Note: Auto-assigned K STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_K_CS + #warning "Note: Auto-assigned K_CS_PIN to an unused En_CS_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_K_MS1 + #warning "Note: Auto-assigned K_MS1_PIN to an unused En_MS1_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_K_MS2 + #warning "Note: Auto-assigned K_MS2_PIN to an unused En_MS2_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_K_MS3 + #warning "Note: Auto-assigned K_MS3_PIN to an unused En_MS3_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_K_DIAG + #if K_USE_ENDSTOP == _XMIN_ + #warning "Note: Auto-assigned K_DIAG_PIN to X_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _XMAX_ + #warning "Note: Auto-assigned K_DIAG_PIN to X_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _XSTOP_ + #warning "Note: Auto-assigned K_DIAG_PIN to X_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _YMIN_ + #warning "Note: Auto-assigned K_DIAG_PIN to Y_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _YMAX_ + #warning "Note: Auto-assigned K_DIAG_PIN to Y_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _YSTOP_ + #warning "Note: Auto-assigned K_DIAG_PIN to Y_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _ZMIN_ + #warning "Note: Auto-assigned K_DIAG_PIN to Z_MIN_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _ZMAX_ + #warning "Note: Auto-assigned K_DIAG_PIN to Z_MAX_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _ZSTOP_ + #warning "Note: Auto-assigned K_DIAG_PIN to Z_STOP_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _XDIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to X_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _YDIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to Y_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _ZDIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to Z_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _E0DIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to E0_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _E1DIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to E1_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _E2DIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to E2_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _E3DIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to E3_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _E4DIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to E4_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _E5DIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to E5_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _E6DIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to E6_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #elif K_USE_ENDSTOP == _E7DIAG_ + #warning "Note: Auto-assigned K_DIAG_PIN to E7_DIAG_PIN. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif #endif -#endif -#if ENABLED(CHAMBER_FAN) && !defined(CHAMBER_FAN_INDEX) - #warning "Auto-assigned CHAMBER_FAN_INDEX to the first free FAN pin." -#endif + #if ENABLED(CHAMBER_FAN) && !defined(CHAMBER_FAN_INDEX) + #warning "Note: Auto-assigned CHAMBER_FAN_INDEX to the first free FAN pin. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + +#endif // !NO_AUTO_ASSIGN_WARNING #if IS_LEGACY_TFT #warning "Don't forget to update your TFT settings in Configuration.h." @@ -544,10 +548,12 @@ // // Warn users of potential endstop/DIAG pin conflicts to prevent homing issues when not using sensorless homing // -#if !USE_SENSORLESS && ENABLED(USES_DIAG_JUMPERS) - #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled." -#elif !USE_SENSORLESS && ENABLED(USES_DIAG_PINS) - #warning "Driver DIAG pins must be physically removed unless SENSORLESS_HOMING is enabled. (See https://bit.ly/2ZPRlt0)" +#if NONE(USE_SENSORLESS, DIAG_JUMPERS_REMOVED) + #if ENABLED(USES_DIAG_JUMPERS) + #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled. (Define DIAG_JUMPERS_REMOVED to suppress this warning.)" + #elif ENABLED(USES_DIAG_PINS) + #warning "Driver DIAG pins must be physically removed unless SENSORLESS_HOMING is enabled. (See https://bit.ly/2ZPRlt0) (Define DIAG_JUMPERS_REMOVED to suppress this warning.)" + #endif #endif #if CANNOT_EMBED_CONFIGURATION From 31ec8f2449e28caaa064d0bf4885f26e45508c02 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 18 Jan 2022 00:30:52 -0800 Subject: [PATCH 038/502] =?UTF-8?q?=F0=9F=94=A8=20Suppressible=20CONFIGURA?= =?UTF-8?q?TION=5FEMBEDDING=20warning=20(#23545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Warnings.cpp | 8 ++++---- buildroot/share/PlatformIO/scripts/signature.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 684ab82d0079..0d6f9bb13458 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -548,11 +548,11 @@ // // Warn users of potential endstop/DIAG pin conflicts to prevent homing issues when not using sensorless homing // -#if NONE(USE_SENSORLESS, DIAG_JUMPERS_REMOVED) - #if ENABLED(USES_DIAG_JUMPERS) +#if !USE_SENSORLESS + #if ENABLED(USES_DIAG_JUMPERS) && DISABLED(DIAG_JUMPERS_REMOVED) #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled. (Define DIAG_JUMPERS_REMOVED to suppress this warning.)" - #elif ENABLED(USES_DIAG_PINS) - #warning "Driver DIAG pins must be physically removed unless SENSORLESS_HOMING is enabled. (See https://bit.ly/2ZPRlt0) (Define DIAG_JUMPERS_REMOVED to suppress this warning.)" + #elif ENABLED(USES_DIAG_PINS) && DISABLED(DIAG_PINS_REMOVED) + #warning "Driver DIAG pins must be physically removed unless SENSORLESS_HOMING is enabled. (See https://bit.ly/2ZPRlt0) (Define DIAG_PINS_REMOVED to suppress this warning.)" #endif #endif diff --git a/buildroot/share/PlatformIO/scripts/signature.py b/buildroot/share/PlatformIO/scripts/signature.py index 654e3ea67738..593f9580b330 100644 --- a/buildroot/share/PlatformIO/scripts/signature.py +++ b/buildroot/share/PlatformIO/scripts/signature.py @@ -163,7 +163,9 @@ def compute_build_signature(env): # Generate a C source file for storing this array with open('Marlin/src/mczip.h','wb') as result_file: - result_file.write(b'#warning "Generated file \'mc.zip\' is embedded"\n') + result_file.write(b'#ifndef NO_CONFIGURATION_EMBEDDING_WARNING\n') + result_file.write(b' #warning "Generated file \'mc.zip\' is embedded (Define NO_CONFIGURATION_EMBEDDING_WARNING to suppress this warning.)"\n') + result_file.write(b'#endif\n') result_file.write(b'const unsigned char mc_zip[] PROGMEM = {\n ') count = 0 for b in open(os.path.join(build_dir, 'mc.zip'), 'rb').read(): From 3f4112aee41dccc32cd781a8b4cfeb7d0e5a1400 Mon Sep 17 00:00:00 2001 From: Taylor Talkington Date: Mon, 17 Jan 2022 08:07:45 -0500 Subject: [PATCH 039/502] =?UTF-8?q?=F0=9F=92=84=20Improve=20Ender3=20v2=20?= =?UTF-8?q?DWIN=20MarlinUI=20(#23369)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/lcd/e3v2/marlinui/dwin_lcd.h | 2 + Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 3 - .../lcd/e3v2/marlinui/ui_status_480x272.cpp | 260 ++++--- Marlin/src/lcd/marlinui.cpp | 1 + Marlin/src/lcd/marlinui.h | 1 + buildroot/share/dwin/bin/DWIN_ICO.py | 342 +++++++++ buildroot/share/dwin/bin/LICENSE | 674 ++++++++++++++++++ buildroot/share/dwin/bin/README.md | 92 +++ buildroot/share/dwin/bin/makeIco.py | 53 ++ buildroot/share/dwin/bin/splitIco.py | 52 ++ .../share/dwin/icons-2/000-ICON_BootLogo.jpg | Bin 0 -> 16062 bytes .../icons-2/001-ICON_OpenSourceFirmware.jpg | Bin 0 -> 3206 bytes .../share/dwin/icons-2/002-ICON_GitHub.jpg | Bin 0 -> 3399 bytes .../share/dwin/icons-2/003-ICON_Website.jpg | Bin 0 -> 2049 bytes .../share/dwin/icons-2/004-ICON_Copyright.jpg | Bin 0 -> 1951 bytes .../dwin/icons-3/000-ICON_LOGO_Marlin.jpg | Bin 0 -> 9089 bytes .../share/dwin/icons-3/001-ICON_HotendOff.jpg | Bin 0 -> 3140 bytes .../share/dwin/icons-3/002-ICON_HotendOn.jpg | Bin 0 -> 3000 bytes .../share/dwin/icons-3/003-ICON_BedOff.jpg | Bin 0 -> 1798 bytes .../share/dwin/icons-3/004-ICON_BedOn.jpg | Bin 0 -> 3600 bytes .../share/dwin/icons-3/005-ICON_Fan0.jpg | Bin 0 -> 5003 bytes .../share/dwin/icons-3/006-ICON_Fan1.jpg | Bin 0 -> 4933 bytes .../share/dwin/icons-3/007-ICON_Fan2.jpg | Bin 0 -> 5035 bytes .../share/dwin/icons-3/008-ICON_Fan3.jpg | Bin 0 -> 4977 bytes .../share/dwin/icons-3/009-ICON_Halted.jpg | Bin 0 -> 10236 bytes .../share/dwin/icons-3/010-ICON_Question.jpg | Bin 0 -> 12319 bytes .../share/dwin/icons-3/011-ICON_Alert.jpg | Bin 0 -> 8217 bytes .../share/dwin/icons-3/012-ICON_RotateCW.jpg | Bin 0 -> 3291 bytes .../share/dwin/icons-3/013-ICON_RotateCCW.jpg | Bin 0 -> 3300 bytes .../share/dwin/icons-3/014-ICON_UpArrow.jpg | Bin 0 -> 1998 bytes .../share/dwin/icons-3/015-ICON_DownArrow.jpg | Bin 0 -> 1994 bytes .../dwin/icons-6/000-ICON_LOGO_Creality.jpg | Bin 0 -> 4258 bytes .../share/dwin/icons-6/001-ICON_Print_0.jpg | Bin 0 -> 3756 bytes .../share/dwin/icons-6/002-ICON_Print_1.jpg | Bin 0 -> 3754 bytes .../share/dwin/icons-6/003-ICON_Prepare_0.jpg | Bin 0 -> 3603 bytes .../share/dwin/icons-6/004-ICON_Prepare_1.jpg | Bin 0 -> 3616 bytes .../share/dwin/icons-6/005-ICON_Control_0.jpg | Bin 0 -> 4158 bytes .../share/dwin/icons-6/006-ICON_Control_1.jpg | Bin 0 -> 4157 bytes .../dwin/icons-6/007-ICON_Leveling_0.jpg | Bin 0 -> 3480 bytes .../dwin/icons-6/008-ICON_Leveling_1.jpg | Bin 0 -> 3474 bytes .../dwin/icons-6/009-ICON_HotendTemp.jpg | Bin 0 -> 1671 bytes .../share/dwin/icons-6/010-ICON_BedTemp.jpg | Bin 0 -> 1655 bytes .../share/dwin/icons-6/011-ICON_Speed.jpg | Bin 0 -> 1706 bytes .../share/dwin/icons-6/012-ICON_Zoffset.jpg | Bin 0 -> 1654 bytes .../share/dwin/icons-6/013-ICON_Back.jpg | Bin 0 -> 1594 bytes .../share/dwin/icons-6/014-ICON_File.jpg | Bin 0 -> 1852 bytes .../share/dwin/icons-6/015-ICON_PrintTime.jpg | Bin 0 -> 1759 bytes .../dwin/icons-6/016-ICON_RemainTime.jpg | Bin 0 -> 1703 bytes .../share/dwin/icons-6/017-ICON_Setup_0.jpg | Bin 0 -> 3990 bytes .../share/dwin/icons-6/018-ICON_Setup_1.jpg | Bin 0 -> 3981 bytes .../share/dwin/icons-6/019-ICON_Pause_0.jpg | Bin 0 -> 3592 bytes .../share/dwin/icons-6/020-ICON_Pause_1.jpg | Bin 0 -> 3583 bytes .../dwin/icons-6/021-ICON_Continue_0.jpg | Bin 0 -> 3657 bytes .../dwin/icons-6/022-ICON_Continue_1.jpg | Bin 0 -> 3656 bytes .../share/dwin/icons-6/023-ICON_Stop_0.jpg | Bin 0 -> 3490 bytes .../share/dwin/icons-6/024-ICON_Stop_1.jpg | Bin 0 -> 3482 bytes buildroot/share/dwin/icons-6/025-ICON_Bar.jpg | Bin 0 -> 6315 bytes .../share/dwin/icons-6/026-ICON_More.jpg | Bin 0 -> 1612 bytes .../share/dwin/icons-6/027-ICON_Axis.jpg | Bin 0 -> 1905 bytes .../dwin/icons-6/028-ICON_CloseMotor.jpg | Bin 0 -> 1945 bytes .../share/dwin/icons-6/029-ICON_Homing.jpg | Bin 0 -> 1920 bytes .../share/dwin/icons-6/030-ICON_SetHome.jpg | Bin 0 -> 1881 bytes .../dwin/icons-6/031-ICON_PLAPreheat.jpg | Bin 0 -> 1745 bytes .../dwin/icons-6/032-ICON_ABSPreheat.jpg | Bin 0 -> 1743 bytes .../share/dwin/icons-6/033-ICON_Cool.jpg | Bin 0 -> 1843 bytes .../share/dwin/icons-6/034-ICON_Language.jpg | Bin 0 -> 1960 bytes .../share/dwin/icons-6/035-ICON_MoveX.jpg | Bin 0 -> 1871 bytes .../share/dwin/icons-6/036-ICON_MoveY.jpg | Bin 0 -> 1874 bytes .../share/dwin/icons-6/037-ICON_MoveZ.jpg | Bin 0 -> 1820 bytes .../share/dwin/icons-6/038-ICON_Extruder.jpg | Bin 0 -> 1692 bytes .../dwin/icons-6/040-ICON_Temperature.jpg | Bin 0 -> 1821 bytes .../share/dwin/icons-6/041-ICON_Motion.jpg | Bin 0 -> 1906 bytes .../dwin/icons-6/042-ICON_WriteEEPROM.jpg | Bin 0 -> 1812 bytes .../dwin/icons-6/043-ICON_ReadEEPROM.jpg | Bin 0 -> 1876 bytes .../dwin/icons-6/044-ICON_ResumeEEPROM.jpg | Bin 0 -> 1940 bytes .../share/dwin/icons-6/045-ICON_Info.jpg | Bin 0 -> 1679 bytes .../dwin/icons-6/046-ICON_SetEndTemp.jpg | Bin 0 -> 1808 bytes .../dwin/icons-6/047-ICON_SetBedTemp.jpg | Bin 0 -> 1712 bytes .../share/dwin/icons-6/048-ICON_FanSpeed.jpg | Bin 0 -> 1787 bytes .../dwin/icons-6/049-ICON_SetPLAPreheat.jpg | Bin 0 -> 1782 bytes .../dwin/icons-6/050-ICON_SetABSPreheat.jpg | Bin 0 -> 1785 bytes .../share/dwin/icons-6/051-ICON_MaxSpeed.jpg | Bin 0 -> 1718 bytes .../dwin/icons-6/052-ICON_MaxAccelerated.jpg | Bin 0 -> 1768 bytes .../share/dwin/icons-6/053-ICON_MaxJerk.jpg | Bin 0 -> 1756 bytes .../share/dwin/icons-6/054-ICON_Step.jpg | Bin 0 -> 1816 bytes .../share/dwin/icons-6/055-ICON_PrintSize.jpg | Bin 0 -> 1898 bytes .../share/dwin/icons-6/056-ICON_Version.jpg | Bin 0 -> 1957 bytes .../share/dwin/icons-6/057-ICON_Contact.jpg | Bin 0 -> 1862 bytes .../icons-6/058-ICON_StockConfiguraton.jpg | Bin 0 -> 1624 bytes .../share/dwin/icons-6/059-ICON_MaxSpeedX.jpg | Bin 0 -> 1896 bytes .../share/dwin/icons-6/060-ICON_MaxSpeedY.jpg | Bin 0 -> 1891 bytes .../share/dwin/icons-6/061-ICON_MaxSpeedZ.jpg | Bin 0 -> 1901 bytes .../share/dwin/icons-6/062-ICON_MaxSpeedE.jpg | Bin 0 -> 1888 bytes .../share/dwin/icons-6/063-ICON_MaxAccX.jpg | Bin 0 -> 1929 bytes .../share/dwin/icons-6/064-ICON_MaxAccY.jpg | Bin 0 -> 1924 bytes .../share/dwin/icons-6/065-ICON_MaxAccZ.jpg | Bin 0 -> 1934 bytes .../share/dwin/icons-6/066-ICON_MaxAccE.jpg | Bin 0 -> 1933 bytes .../dwin/icons-6/067-ICON_MaxSpeedJerkX.jpg | Bin 0 -> 1936 bytes .../dwin/icons-6/068-ICON_MaxSpeedJerkY.jpg | Bin 0 -> 1938 bytes .../dwin/icons-6/069-ICON_MaxSpeedJerkZ.jpg | Bin 0 -> 1943 bytes .../dwin/icons-6/070-ICON_MaxSpeedJerkE.jpg | Bin 0 -> 1934 bytes .../share/dwin/icons-6/071-ICON_StepX.jpg | Bin 0 -> 1976 bytes .../share/dwin/icons-6/072-ICON_StepY.jpg | Bin 0 -> 1979 bytes .../share/dwin/icons-6/073-ICON_StepZ.jpg | Bin 0 -> 1984 bytes .../share/dwin/icons-6/074-ICON_StepE.jpg | Bin 0 -> 1979 bytes .../share/dwin/icons-6/075-ICON_Setspeed.jpg | Bin 0 -> 1748 bytes .../dwin/icons-6/076-ICON_SetZOffset.jpg | Bin 0 -> 1881 bytes .../share/dwin/icons-6/077-ICON_Rectangle.jpg | Bin 0 -> 1142 bytes .../share/dwin/icons-6/078-ICON_BLTouch.jpg | Bin 0 -> 2016 bytes .../dwin/icons-6/079-ICON_TempTooLow.jpg | Bin 0 -> 2058 bytes .../dwin/icons-6/080-ICON_AutoLeveling.jpg | Bin 0 -> 2110 bytes .../dwin/icons-6/081-ICON_TempTooHigh.jpg | Bin 0 -> 2137 bytes .../share/dwin/icons-6/082-ICON_NoTips_C.jpg | Bin 0 -> 2529 bytes .../share/dwin/icons-6/083-ICON_NoTips_E.jpg | Bin 0 -> 2784 bytes .../dwin/icons-6/084-ICON_Continue_C.jpg | Bin 0 -> 3376 bytes .../dwin/icons-6/085-ICON_Continue_E.jpg | Bin 0 -> 3029 bytes .../share/dwin/icons-6/086-ICON_Cancel_C.jpg | Bin 0 -> 1988 bytes .../share/dwin/icons-6/087-ICON_Cancel_E.jpg | Bin 0 -> 2170 bytes .../share/dwin/icons-6/088-ICON_Confirm_C.jpg | Bin 0 -> 2471 bytes .../share/dwin/icons-6/089-ICON_Confirm_E.jpg | Bin 0 -> 2841 bytes .../share/dwin/icons-6/090-ICON_Info_0.jpg | Bin 0 -> 3469 bytes .../share/dwin/icons-6/091-ICON_Info_1.jpg | Bin 0 -> 3465 bytes buildroot/share/dwin/icons-svg/alert.svg | 85 +++ .../share/dwin/icons-svg/bed_flat_old.svg | 72 ++ .../share/dwin/icons-svg/bed_flat_on.svg | 91 +++ .../share/dwin/icons-svg/bed_leveled_off.svg | 83 +++ .../share/dwin/icons-svg/bed_leveled_on.svg | 103 +++ buildroot/share/dwin/icons-svg/bed_off.svg | 64 ++ buildroot/share/dwin/icons-svg/bed_on.svg | 84 +++ buildroot/share/dwin/icons-svg/bedline.svg | 64 ++ buildroot/share/dwin/icons-svg/down_arrow.svg | 112 +++ buildroot/share/dwin/icons-svg/fan.svg | 155 ++++ buildroot/share/dwin/icons-svg/halted.svg | 83 +++ buildroot/share/dwin/icons-svg/hotend_off.svg | 114 +++ buildroot/share/dwin/icons-svg/hotend_on.svg | 114 +++ buildroot/share/dwin/icons-svg/question.svg | 75 ++ buildroot/share/dwin/icons-svg/rotate_ccw.svg | 99 +++ buildroot/share/dwin/icons-svg/rotate_cw.svg | 98 +++ buildroot/share/dwin/icons-svg/up_arrow.svg | 112 +++ buildroot/share/dwin/make_jpgs.sh | 31 + 140 files changed, 3022 insertions(+), 97 deletions(-) create mode 100644 buildroot/share/dwin/bin/DWIN_ICO.py create mode 100644 buildroot/share/dwin/bin/LICENSE create mode 100644 buildroot/share/dwin/bin/README.md create mode 100755 buildroot/share/dwin/bin/makeIco.py create mode 100755 buildroot/share/dwin/bin/splitIco.py create mode 100644 buildroot/share/dwin/icons-2/000-ICON_BootLogo.jpg create mode 100644 buildroot/share/dwin/icons-2/001-ICON_OpenSourceFirmware.jpg create mode 100644 buildroot/share/dwin/icons-2/002-ICON_GitHub.jpg create mode 100644 buildroot/share/dwin/icons-2/003-ICON_Website.jpg create mode 100644 buildroot/share/dwin/icons-2/004-ICON_Copyright.jpg create mode 100644 buildroot/share/dwin/icons-3/000-ICON_LOGO_Marlin.jpg create mode 100644 buildroot/share/dwin/icons-3/001-ICON_HotendOff.jpg create mode 100644 buildroot/share/dwin/icons-3/002-ICON_HotendOn.jpg create mode 100644 buildroot/share/dwin/icons-3/003-ICON_BedOff.jpg create mode 100644 buildroot/share/dwin/icons-3/004-ICON_BedOn.jpg create mode 100644 buildroot/share/dwin/icons-3/005-ICON_Fan0.jpg create mode 100644 buildroot/share/dwin/icons-3/006-ICON_Fan1.jpg create mode 100644 buildroot/share/dwin/icons-3/007-ICON_Fan2.jpg create mode 100644 buildroot/share/dwin/icons-3/008-ICON_Fan3.jpg create mode 100644 buildroot/share/dwin/icons-3/009-ICON_Halted.jpg create mode 100644 buildroot/share/dwin/icons-3/010-ICON_Question.jpg create mode 100644 buildroot/share/dwin/icons-3/011-ICON_Alert.jpg create mode 100644 buildroot/share/dwin/icons-3/012-ICON_RotateCW.jpg create mode 100644 buildroot/share/dwin/icons-3/013-ICON_RotateCCW.jpg create mode 100644 buildroot/share/dwin/icons-3/014-ICON_UpArrow.jpg create mode 100644 buildroot/share/dwin/icons-3/015-ICON_DownArrow.jpg create mode 100644 buildroot/share/dwin/icons-6/000-ICON_LOGO_Creality.jpg create mode 100644 buildroot/share/dwin/icons-6/001-ICON_Print_0.jpg create mode 100644 buildroot/share/dwin/icons-6/002-ICON_Print_1.jpg create mode 100644 buildroot/share/dwin/icons-6/003-ICON_Prepare_0.jpg create mode 100644 buildroot/share/dwin/icons-6/004-ICON_Prepare_1.jpg create mode 100644 buildroot/share/dwin/icons-6/005-ICON_Control_0.jpg create mode 100644 buildroot/share/dwin/icons-6/006-ICON_Control_1.jpg create mode 100644 buildroot/share/dwin/icons-6/007-ICON_Leveling_0.jpg create mode 100644 buildroot/share/dwin/icons-6/008-ICON_Leveling_1.jpg create mode 100644 buildroot/share/dwin/icons-6/009-ICON_HotendTemp.jpg create mode 100644 buildroot/share/dwin/icons-6/010-ICON_BedTemp.jpg create mode 100644 buildroot/share/dwin/icons-6/011-ICON_Speed.jpg create mode 100644 buildroot/share/dwin/icons-6/012-ICON_Zoffset.jpg create mode 100644 buildroot/share/dwin/icons-6/013-ICON_Back.jpg create mode 100644 buildroot/share/dwin/icons-6/014-ICON_File.jpg create mode 100644 buildroot/share/dwin/icons-6/015-ICON_PrintTime.jpg create mode 100644 buildroot/share/dwin/icons-6/016-ICON_RemainTime.jpg create mode 100644 buildroot/share/dwin/icons-6/017-ICON_Setup_0.jpg create mode 100644 buildroot/share/dwin/icons-6/018-ICON_Setup_1.jpg create mode 100644 buildroot/share/dwin/icons-6/019-ICON_Pause_0.jpg create mode 100644 buildroot/share/dwin/icons-6/020-ICON_Pause_1.jpg create mode 100644 buildroot/share/dwin/icons-6/021-ICON_Continue_0.jpg create mode 100644 buildroot/share/dwin/icons-6/022-ICON_Continue_1.jpg create mode 100644 buildroot/share/dwin/icons-6/023-ICON_Stop_0.jpg create mode 100644 buildroot/share/dwin/icons-6/024-ICON_Stop_1.jpg create mode 100644 buildroot/share/dwin/icons-6/025-ICON_Bar.jpg create mode 100644 buildroot/share/dwin/icons-6/026-ICON_More.jpg create mode 100644 buildroot/share/dwin/icons-6/027-ICON_Axis.jpg create mode 100644 buildroot/share/dwin/icons-6/028-ICON_CloseMotor.jpg create mode 100644 buildroot/share/dwin/icons-6/029-ICON_Homing.jpg create mode 100644 buildroot/share/dwin/icons-6/030-ICON_SetHome.jpg create mode 100644 buildroot/share/dwin/icons-6/031-ICON_PLAPreheat.jpg create mode 100644 buildroot/share/dwin/icons-6/032-ICON_ABSPreheat.jpg create mode 100644 buildroot/share/dwin/icons-6/033-ICON_Cool.jpg create mode 100644 buildroot/share/dwin/icons-6/034-ICON_Language.jpg create mode 100644 buildroot/share/dwin/icons-6/035-ICON_MoveX.jpg create mode 100644 buildroot/share/dwin/icons-6/036-ICON_MoveY.jpg create mode 100644 buildroot/share/dwin/icons-6/037-ICON_MoveZ.jpg create mode 100644 buildroot/share/dwin/icons-6/038-ICON_Extruder.jpg create mode 100644 buildroot/share/dwin/icons-6/040-ICON_Temperature.jpg create mode 100644 buildroot/share/dwin/icons-6/041-ICON_Motion.jpg create mode 100644 buildroot/share/dwin/icons-6/042-ICON_WriteEEPROM.jpg create mode 100644 buildroot/share/dwin/icons-6/043-ICON_ReadEEPROM.jpg create mode 100644 buildroot/share/dwin/icons-6/044-ICON_ResumeEEPROM.jpg create mode 100644 buildroot/share/dwin/icons-6/045-ICON_Info.jpg create mode 100644 buildroot/share/dwin/icons-6/046-ICON_SetEndTemp.jpg create mode 100644 buildroot/share/dwin/icons-6/047-ICON_SetBedTemp.jpg create mode 100644 buildroot/share/dwin/icons-6/048-ICON_FanSpeed.jpg create mode 100644 buildroot/share/dwin/icons-6/049-ICON_SetPLAPreheat.jpg create mode 100644 buildroot/share/dwin/icons-6/050-ICON_SetABSPreheat.jpg create mode 100644 buildroot/share/dwin/icons-6/051-ICON_MaxSpeed.jpg create mode 100644 buildroot/share/dwin/icons-6/052-ICON_MaxAccelerated.jpg create mode 100644 buildroot/share/dwin/icons-6/053-ICON_MaxJerk.jpg create mode 100644 buildroot/share/dwin/icons-6/054-ICON_Step.jpg create mode 100644 buildroot/share/dwin/icons-6/055-ICON_PrintSize.jpg create mode 100644 buildroot/share/dwin/icons-6/056-ICON_Version.jpg create mode 100644 buildroot/share/dwin/icons-6/057-ICON_Contact.jpg create mode 100644 buildroot/share/dwin/icons-6/058-ICON_StockConfiguraton.jpg create mode 100644 buildroot/share/dwin/icons-6/059-ICON_MaxSpeedX.jpg create mode 100644 buildroot/share/dwin/icons-6/060-ICON_MaxSpeedY.jpg create mode 100644 buildroot/share/dwin/icons-6/061-ICON_MaxSpeedZ.jpg create mode 100644 buildroot/share/dwin/icons-6/062-ICON_MaxSpeedE.jpg create mode 100644 buildroot/share/dwin/icons-6/063-ICON_MaxAccX.jpg create mode 100644 buildroot/share/dwin/icons-6/064-ICON_MaxAccY.jpg create mode 100644 buildroot/share/dwin/icons-6/065-ICON_MaxAccZ.jpg create mode 100644 buildroot/share/dwin/icons-6/066-ICON_MaxAccE.jpg create mode 100644 buildroot/share/dwin/icons-6/067-ICON_MaxSpeedJerkX.jpg create mode 100644 buildroot/share/dwin/icons-6/068-ICON_MaxSpeedJerkY.jpg create mode 100644 buildroot/share/dwin/icons-6/069-ICON_MaxSpeedJerkZ.jpg create mode 100644 buildroot/share/dwin/icons-6/070-ICON_MaxSpeedJerkE.jpg create mode 100644 buildroot/share/dwin/icons-6/071-ICON_StepX.jpg create mode 100644 buildroot/share/dwin/icons-6/072-ICON_StepY.jpg create mode 100644 buildroot/share/dwin/icons-6/073-ICON_StepZ.jpg create mode 100644 buildroot/share/dwin/icons-6/074-ICON_StepE.jpg create mode 100644 buildroot/share/dwin/icons-6/075-ICON_Setspeed.jpg create mode 100644 buildroot/share/dwin/icons-6/076-ICON_SetZOffset.jpg create mode 100644 buildroot/share/dwin/icons-6/077-ICON_Rectangle.jpg create mode 100644 buildroot/share/dwin/icons-6/078-ICON_BLTouch.jpg create mode 100644 buildroot/share/dwin/icons-6/079-ICON_TempTooLow.jpg create mode 100644 buildroot/share/dwin/icons-6/080-ICON_AutoLeveling.jpg create mode 100644 buildroot/share/dwin/icons-6/081-ICON_TempTooHigh.jpg create mode 100644 buildroot/share/dwin/icons-6/082-ICON_NoTips_C.jpg create mode 100644 buildroot/share/dwin/icons-6/083-ICON_NoTips_E.jpg create mode 100644 buildroot/share/dwin/icons-6/084-ICON_Continue_C.jpg create mode 100644 buildroot/share/dwin/icons-6/085-ICON_Continue_E.jpg create mode 100644 buildroot/share/dwin/icons-6/086-ICON_Cancel_C.jpg create mode 100644 buildroot/share/dwin/icons-6/087-ICON_Cancel_E.jpg create mode 100644 buildroot/share/dwin/icons-6/088-ICON_Confirm_C.jpg create mode 100644 buildroot/share/dwin/icons-6/089-ICON_Confirm_E.jpg create mode 100644 buildroot/share/dwin/icons-6/090-ICON_Info_0.jpg create mode 100644 buildroot/share/dwin/icons-6/091-ICON_Info_1.jpg create mode 100644 buildroot/share/dwin/icons-svg/alert.svg create mode 100644 buildroot/share/dwin/icons-svg/bed_flat_old.svg create mode 100644 buildroot/share/dwin/icons-svg/bed_flat_on.svg create mode 100644 buildroot/share/dwin/icons-svg/bed_leveled_off.svg create mode 100644 buildroot/share/dwin/icons-svg/bed_leveled_on.svg create mode 100644 buildroot/share/dwin/icons-svg/bed_off.svg create mode 100644 buildroot/share/dwin/icons-svg/bed_on.svg create mode 100644 buildroot/share/dwin/icons-svg/bedline.svg create mode 100644 buildroot/share/dwin/icons-svg/down_arrow.svg create mode 100644 buildroot/share/dwin/icons-svg/fan.svg create mode 100644 buildroot/share/dwin/icons-svg/halted.svg create mode 100644 buildroot/share/dwin/icons-svg/hotend_off.svg create mode 100644 buildroot/share/dwin/icons-svg/hotend_on.svg create mode 100644 buildroot/share/dwin/icons-svg/question.svg create mode 100644 buildroot/share/dwin/icons-svg/rotate_ccw.svg create mode 100644 buildroot/share/dwin/icons-svg/rotate_cw.svg create mode 100644 buildroot/share/dwin/icons-svg/up_arrow.svg create mode 100755 buildroot/share/dwin/make_jpgs.sh diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.h b/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.h index 3e80a0103ee8..dc6c79bd2d0e 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.h +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.h @@ -64,6 +64,8 @@ #define ICON_UpArrow 14 #define ICON_DownArrow 15 #define ICON_BedLine 16 +#define ICON_BedLevelOff 17 +#define ICON_BedLevelOn 18 #include "../common/dwin_font.h" diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 126700185b04..b6093784a83f 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -81,9 +81,6 @@ bool MarlinUI::detected() { return true; } // Initialize or re-initialize the LCD void MarlinUI::init_lcd() { DWIN_Startup(); - - // Load the assets JPG (currently just the status screen 'icon') - DWIN_JPG_CacheTo1(DWIN_MarlinUI_Assets); } // This LCD should clear where it will draw anew diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index 306e9044f703..c2948048c119 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -37,6 +37,7 @@ #include "../../../module/motion.h" #include "../../../module/temperature.h" #include "../../../module/printcounter.h" +#include "../../../module/planner.h" #if ENABLED(SDSUPPORT) #include "../../../libs/duration_t.h" @@ -46,8 +47,13 @@ #include "../../../MarlinCore.h" // for printingIsActive #endif -#define STATUS_HEATERS_X 15 -#define STATUS_HEATERS_Y 56 +#if ENABLED(DWIN_MARLINUI_PORTRAIT) + #define STATUS_HEATERS_X 15 + #define STATUS_HEATERS_Y 56 +#else + #define STATUS_HEATERS_X 154 + #define STATUS_HEATERS_Y 10 +#endif #define STATUS_HEATERS_XSPACE 64 #define STATUS_FAN_WIDTH 48 #define STATUS_FAN_HEIGHT 48 @@ -61,35 +67,63 @@ // Homed and known, display constantly. // FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink, const uint16_t x, const uint16_t y) { - uint8_t vallen = utf8_strlen(value); - if (!ui.did_first_redraw) { - dwin_string.set(); - dwin_string.add('X' + axis); - DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (vallen * 14 - 14) / 2, y + 2, S(dwin_string.string())); - } + #if ENABLED(DWIN_MARLINUI_PORTRAIT) - dwin_string.set(); - if (blink) - dwin_string.add(value); - else { - if (!TEST(axis_homed, axis)) + uint8_t vallen = utf8_strlen(value); + if (!ui.did_first_redraw) { + dwin_string.set(); + dwin_string.add('X' + axis); + DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (vallen * 14 - 14) / 2, y + 2, S(dwin_string.string())); + } + + dwin_string.set(); + if (blink) + dwin_string.add(value); + else if (!TEST(axis_homed, axis)) while (const char c = *value++) dwin_string.add(c <= '.' ? c : '?'); + else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !TEST(axis_trusted, axis)) + dwin_string.add(TERN1(DWIN_MARLINUI_PORTRAIT, axis == Z_AXIS) ? PSTR(" ") : PSTR(" ")); + else + dwin_string.add(value); + + // For E_TOTAL there may be some characters to cover up + if (BOTH(DWIN_MARLINUI_PORTRAIT, LCD_SHOW_E_TOTAL) && axis == X_AXIS) + dwin_string.add(" "); + + DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + 32, S(dwin_string.string())); + + #else // !DWIN_MARLINUI_PORTRAIT + + if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) { + dwin_string.set(); + dwin_string.add('X' + axis); + DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x, y, S(dwin_string.string())); + } + + dwin_string.set(); + if (blink) + dwin_string.add(value); else { - #if NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) - if (!TEST(axis_trusted, axis)) - dwin_string.add(TERN1(DWIN_MARLINUI_PORTRAIT, axis == Z_AXIS) ? PSTR(" ") : PSTR(" ")); - else - #endif - dwin_string.add(value); + if (!TEST(axis_homed, axis)) + while (const char c = *value++) dwin_string.add(c <= '.' ? c : '?'); + else { + #if NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) + if (!TEST(axis_trusted, axis)) + dwin_string.add(TERN1(DWIN_MARLINUI_PORTRAIT, axis == Z_AXIS) ? PSTR(" ") : PSTR(" ")); + else + #endif + dwin_string.add(value); + } } - } - // For E_TOTAL there may be some characters to cover up - if (BOTH(DWIN_MARLINUI_PORTRAIT, LCD_SHOW_E_TOTAL) && axis == X_AXIS) - dwin_string.add(" "); + // For E_TOTAL there may be some characters to cover up + if (ENABLED(LCD_SHOW_E_TOTAL) && (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) && axis == X_AXIS) + dwin_string.add(" "); + + DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x + 32, y + 4, S(dwin_string.string())); - DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + 32, S(dwin_string.string())); + #endif // !DWIN_MARLINUI_PORTRAIT } #if ENABLED(LCD_SHOW_E_TOTAL) @@ -97,20 +131,36 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const FORCE_INLINE void _draw_e_value(const_float_t value, const uint16_t x, const uint16_t y) { const uint8_t scale = value >= 100000.0f ? 10 : 1; // show cm after 99,999mm - if (!ui.did_first_redraw) { - // Extra spaces so we don't have to clear the 'Y' label separately - dwin_string.set("E "); - DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (4 * 14 / 2) - 7, y + 2, S(dwin_string.string())); - } + #if ENABLED(DWIN_MARLINUI_PORTRAIT) - dwin_string.set(ui16tostr5rj(value / scale)); - DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + 32, S(dwin_string.string())); + if (!ui.did_first_redraw) { + // Extra spaces to erase previous value + dwin_string.set("E "); + DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (4 * 14 / 2) - 7, y + 2, S(dwin_string.string())); + } + + dwin_string.set(ui16tostr5rj(value / scale)); + DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + 32, S(dwin_string.string())); + + // Extra spaces to erase previous value + DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, x + (5 * 14), y + 32, S(scale == 1 ? "mm " : "cm ")); + + #else // !DWIN_MARLINUI_PORTRAIT + + if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) { + dwin_string.set("E "); + DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x, y, S(dwin_string.string())); + } + + dwin_string.set(ui16tostr5rj(value / scale)); + DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x + 32, y + 4, S(dwin_string.string())); + + DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, x + (32 + 70), y + 4, S(scale == 1 ? "mm " : "cm ")); - // Extra spaces so we don't have to clear out the Y value separately - DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, x + (5 * 14), y + 32, S(scale == 1 ? "mm " : "cm ")); + #endif // !DWIN_MARLINUI_PORTRAIT } -#endif +#endif // LCD_SHOW_E_TOTAL // // Fan Icon and Percentage @@ -126,6 +176,7 @@ FORCE_INLINE void _draw_fan_status(const uint16_t x, const uint16_t y) { DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + STATUS_FAN_HEIGHT, S(dwin_string.string())); } else { + DWIN_ICON_AnimationControl(0x0000); // disable all icon animations (this is the only one) DWIN_ICON_Show(ICON, ICON_Fan0, x + fanx, y); dwin_string.set(PSTR(" ")); DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + STATUS_FAN_HEIGHT, S(dwin_string.string())); @@ -153,18 +204,35 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x #if HAS_HEATED_BED static celsius_t old_bed_temp = 500, old_bed_target = 500; static bool old_bed_on = false; + #if HAS_LEVELING + static bool old_leveling_on = false; + #endif #endif #if HAS_HOTEND && HAS_HEATED_BED const bool isBed = heater < 0; - const float tc = (isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)), - tt = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater)); - const uint8_t ta = isBed ? thermalManager.isHeatingBed() : thermalManager.isHeatingHotend(heater); - const bool c_draw = tc != (isBed ? old_bed_temp : old_temp[heater]), - t_draw = tt != (isBed ? old_bed_target : old_target[heater]), - i_draw = ta != (isBed ? old_bed_on : old_on[heater]); - if (isBed) { old_bed_temp = tc; old_bed_target = tt; old_bed_on = ta; } - else { old_temp[heater] = tc; old_target[heater] = tt; old_on[heater] = ta; } + const float tc = isBed ? thermalManager.degBed() : thermalManager.degHotend(heater), + tt = isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater); + const bool ta = isBed ? thermalManager.isHeatingBed() : thermalManager.isHeatingHotend(heater); + + bool c_draw = tc != (isBed ? old_bed_temp : old_temp[heater]), + t_draw = tt != (isBed ? old_bed_target : old_target[heater]), + i_draw = ta != (isBed ? old_bed_on : old_on[heater]); + + if (isBed) { + #if HAS_LEVELING + if (!i_draw && planner.leveling_active != old_leveling_on) i_draw = true; + old_leveling_on = planner.leveling_active; + #endif + old_bed_temp = tc; + old_bed_target = tt; + old_bed_on = ta; + } + else { + old_temp[heater] = tc; + old_target[heater] = tt; + old_on[heater] = ta; + } #elif HAS_HOTEND constexpr bool isBed = false; const float tc = thermalManager.degHotend(heater), tt = thermalManager.degTargetHotend(heater); @@ -175,7 +243,11 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x constexpr bool isBed = true; const float tc = thermalManager.degBed(), tt = thermalManager.degTargetBed(); const uint8_t ta = thermalManager.isHeatingBed(); - const bool c_draw = tc != old_temp[heater], t_draw = tt != old_target[heater], i_draw = ta != old_on[heater]; + bool c_draw = tc != old_temp[heater], t_draw = tt != old_target[heater], i_draw = ta != old_on[heater]; + #if HAS_LEVELING + if (!idraw && planner.leveling_active != old_leveling_on) i_draw = true; + old_leveling_on = tl; + #endif old_bed_temp = tc; old_bed_target = tt; old_bed_on = ta; #endif @@ -185,8 +257,10 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y, S(dwin_string.string())); } - if (!ui.did_first_redraw || i_draw) - DWIN_ICON_Show(ICON, (isBed ? ICON_BedOff : ICON_HotendOff) + ta, x, y + STATUS_CHR_HEIGHT + 2); + if (!ui.did_first_redraw || i_draw){ + const uint8_t ico = isBed ? (TERN0(HAS_LEVELING, planner.leveling_active) ? ICON_BedLevelOff : ICON_BedOff) : ICON_HotendOff; + DWIN_ICON_Show(ICON, ico + ta, x, y + STATUS_CHR_HEIGHT + 2); + } if (!ui.did_first_redraw || c_draw) { dwin_string.set(i16tostr3rj(tc + 0.5)); @@ -220,14 +294,22 @@ void MarlinUI::draw_status_screen() { // Logo/Status Icon #define STATUS_LOGO_WIDTH 128 #define STATUS_LOGO_HEIGHT 40 - DWIN_ICON_Show(ICON, ICON_LOGO_Marlin, (LCD_PIXEL_WIDTH - (STATUS_LOGO_WIDTH)) / 2, ((STATUS_HEATERS_Y - 4) - (STATUS_LOGO_HEIGHT)) / 2); + DWIN_ICON_Show(ICON, ICON_LOGO_Marlin, + #if ENABLED(DWIN_MARLINUI_PORTRAIT) + (LCD_PIXEL_WIDTH - (STATUS_LOGO_WIDTH)) / 2, ((STATUS_HEATERS_Y - 4) - (STATUS_LOGO_HEIGHT)) / 2 + #else + 5, 42 + #endif + ); // Draw a frame around the x/y/z values - #if ENABLED(DWIN_MARLINUI_PORTRAIT) - DWIN_Draw_Rectangle(0, Select_Color, 0, 193, LCD_PIXEL_WIDTH, 260); - #else - //DWIN_Draw_Rectangle(0, Select_Color, LCD_PIXEL_WIDTH - 106, 50, LCD_PIXEL_WIDTH - 1, 230); - #endif + DWIN_Draw_Rectangle(0, Select_Color, + #if ENABLED(DWIN_MARLINUI_PORTRAIT) + 0, 193, LCD_PIXEL_WIDTH, 260 + #else + 0, 115, LCD_PIXEL_WIDTH - 1, 152 + #endif + ); } uint16_t hx = STATUS_HEATERS_X; @@ -244,33 +326,22 @@ void MarlinUI::draw_status_screen() { #endif #if HAS_FAN - // Fan display, pinned to the right side - #if ENABLED(DWIN_MARLINUI_PORTRAIT) - _draw_fan_status(LCD_PIXEL_WIDTH - STATUS_CHR_WIDTH * 4, STATUS_FAN_Y); - #else - _draw_fan_status(212, STATUS_FAN_Y); - #endif + _draw_fan_status(LCD_PIXEL_WIDTH - STATUS_CHR_WIDTH * 5, STATUS_FAN_Y); #endif // Axis values const xyz_pos_t lpos = current_position.asLogical(); const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive()); UNUSED(show_e_total); - #if ENABLED(DWIN_MARLINUI_PORTRAIT) - constexpr int16_t cpy = 195; - if (show_e_total) { - TERN_(LCD_SHOW_E_TOTAL, _draw_e_value(e_move_accumulator, 6, cpy)); - } - else { - _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink, 6, cpy); - TERN_(HAS_Y_AXIS, _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink, 95, cpy)); - } - TERN_(HAS_Z_AXIS, _draw_axis_value(Z_AXIS, ftostr52sp(lpos.z), blink, 165, cpy)); - #else - constexpr int16_t cpx = LCD_PIXEL_WIDTH - 104; - _draw_axis_value(X_AXIS, ftostr52sp(lpos.x), blink, cpx, STATUS_HEATERS_Y); - TERN_(HAS_Y_AXIS, _draw_axis_value(Y_AXIS, ftostr52sp(lpos.y), blink, cpx, STATUS_HEATERS_Y + 59)); - TERN_(HAS_Z_AXIS, _draw_axis_value(Z_AXIS, ftostr52sp(lpos.z), blink, cpx, STATUS_HEATERS_Y + 118)); - #endif + + constexpr int16_t cpy = TERN(DWIN_MARLINUI_PORTRAIT, 195, 117); + if (show_e_total) { + TERN_(LCD_SHOW_E_TOTAL, _draw_e_value(e_move_accumulator, TERN(DWIN_MARLINUI_PORTRAIT, 6, 75), cpy)); + } + else { + _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink, TERN(DWIN_MARLINUI_PORTRAIT, 6, 75), cpy); + TERN_(HAS_Y_AXIS, _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink, TERN(DWIN_MARLINUI_PORTRAIT, 95, 184), cpy)); + } + TERN_(HAS_Z_AXIS, _draw_axis_value(Z_AXIS, ftostr52sp(lpos.z), blink, TERN(DWIN_MARLINUI_PORTRAIT, 165, 300), cpy)); // Feedrate static uint16_t old_fp = 0; @@ -278,9 +349,9 @@ void MarlinUI::draw_status_screen() { old_fp = feedrate_percentage; _draw_feedrate_status(i16tostr3rj(feedrate_percentage), #if ENABLED(DWIN_MARLINUI_PORTRAIT) - 5, 290 + 5, 290 #else - 294, STATUS_HEATERS_Y + 14, 195 #endif ); } @@ -317,25 +388,23 @@ void MarlinUI::draw_status_screen() { time.toDigital(buffer); dwin_string.set(" "); dwin_string.add(buffer); - DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, 280, 100, S(dwin_string.string())); + DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, 230, 170, S(dwin_string.string())); - #if ENABLED(LCD_SHOW_E_TOTAL) - if (show_e_total && TERN1(SHOW_REMAINING_TIME, !blink)) { // if SHOW_REMAINING_TIME is also - const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // show cm after 99,000mm - - DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, 249, 135, S("E")); - dwin_string.set(ui16tostr5rj(e_move_accumulator * escale)); - DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, 263, 135, S(dwin_string.string())); - DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, 333, 135, S(escale==1 ? "mm" : "cm")); - } - #endif #if ENABLED(SHOW_REMAINING_TIME) - if (!show_e_total || blink) { - DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, 249, 135, S(" R ")); + if (print_job_timer.isRunning()) { time = get_remaining_time(); - time.toDigital(buffer); - dwin_string.set(buffer); - DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, 291, 135, S(dwin_string.string())); + DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, 336, 170, S(" R ")); + if (print_job_timer.isPaused() && blink) + dwin_string.set(" "); + else { + time.toDigital(buffer); + dwin_string.set(buffer); + } + DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, 378, 170, S(dwin_string.string())); + } + else if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) { + dwin_string.set(" "); + DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, 336, 170, S(dwin_string.string())); } #endif #endif @@ -343,9 +412,11 @@ void MarlinUI::draw_status_screen() { // // Progress Bar // - constexpr int16_t pb_margin = 5, pb_left = pb_margin, pb_height = 60, - pb_right = LCD_PIXEL_WIDTH - TERN(DWIN_MARLINUI_PORTRAIT, 0, 107) - pb_margin, - pb_bottom = TERN(DWIN_MARLINUI_PORTRAIT, 410, 230), + constexpr int16_t pb_margin = 5, + pb_left = pb_margin + TERN(DWIN_MARLINUI_PORTRAIT, 0, 90), + pb_height = TERN(DWIN_MARLINUI_PORTRAIT, 60, 20), + pb_right = LCD_PIXEL_WIDTH - pb_margin, + pb_bottom = TERN(DWIN_MARLINUI_PORTRAIT, 410, 220), pb_top = pb_bottom - pb_height, pb_width = pb_right - pb_left; @@ -385,6 +456,7 @@ void MarlinUI::draw_status_screen() { draw_status_message(blink); ui.did_first_redraw = true; + ui.old_is_printing = print_job_timer.isRunning(); } #endif // IS_DWIN_MARLINUI diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index d22b11f9bd80..2a576f647b98 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -244,6 +244,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #if IS_DWIN_MARLINUI bool MarlinUI::did_first_redraw; + bool MarlinUI::old_is_printing; #endif // Encoder Handling diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index c2b26b6f4723..dcf74b9e2720 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -468,6 +468,7 @@ class MarlinUI { #if IS_DWIN_MARLINUI static bool did_first_redraw; + static bool old_is_printing; #endif #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) diff --git a/buildroot/share/dwin/bin/DWIN_ICO.py b/buildroot/share/dwin/bin/DWIN_ICO.py new file mode 100644 index 000000000000..8ac680c61e7c --- /dev/null +++ b/buildroot/share/dwin/bin/DWIN_ICO.py @@ -0,0 +1,342 @@ +# DWIN_ICO +# - Dissect and create DWIN .ico files for their LCD displays. +# +# Copyright (c) 2020 Brent Burton +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +#---------------------------------------------------------------- +# +# This is not a normal Microsoft .ICO file, but it has a similar +# structure for containing a number of icon images. Each icon is +# a small JPG file. +# +# The file has a directory header containing fixed-length +# records, and each record points to its data at an offset later +# in the file. +# +# The directory entries are 16 bytes each, and the entire +# directory is 4KB (0 - 0x1000). This supports 256 entries. +# +# Multibyte values are in Big Endian format. +# +# Header: (offset 0x0) +# W H offset ?? len ?? ?? +# Entry 0: xxxx xxxx 00001000 xx 10a2 00 00000000 +# Entry 1: xxxx xxxx 000020a2 xx 0eac 00 00000000 +# Entry 2: xxxx xxxx 00002f4e xx 0eaa 00 00000000 +# ... +# 0x00001000: ffd8 ffe1 0018 ... jpeg exif and data follow .. ffd9 +# 0x000020a2: ffd8 ffe1 ... +# ...rest of ICO entries' data... +# +# Header structure: +# Offset Len What +# 0 2 width +# 2 2 height +# 4 4 file byte position from SEEK_BEG +# 8 3 length of data +# 11 5 ??? all zeroes +# +# Other notes: +# * The index of each icon corresponds to the Icon number in dwin.h +# * One exception is number 39: that header entry is blank, and dwin.h +# does not define a name for 39. This is specially handled to +# prevent reordering stock icons. + +import os +import struct +from PIL import Image + +def getJpegResolution(jpegFile): + """Returns a 2-tuple containing the jpegFile's (width, height). + """ + img = Image.open(jpegFile) + return img.size + +class DWIN_ICO_File(): + def __init__(self): + self.entries = [] # list of header entries + + def splitFile(self, filename, outDir): + if not filename[-4:].lower() == '.ico': + raise RuntimeError('Input file must end in .ico') + + with open(filename, 'rb') as infile: + self._parseHeader(infile) + self._splitEntryData(infile, outDir) + + return + + def _parseHeader(self, infile): + maxEntries = 256 + count = 0 + validEntries = 0 + while count < maxEntries: + rawBytes = infile.read(16) + entry = Entry() + entry.parseRawData(rawBytes) + # check that it is valid: is offset nonzero? + # Special case: treat 39 as valid + if (entry.offset > 0) or (count == 39): + validEntries += 1 + self.entries.append(entry) + count += 1 + return + + def _splitEntryData(self, infile, outDir): + print('Splitting Entry Data...') + if 0 == len(self.entries): + raise RuntimeError('.ico file is not loaded yet') + + # check for output dir: + if not os.path.exists(outDir): + os.mkdir(outDir) + + # keep a count + count = 0 + for entry in self.entries: + # Skip any empty entries. (Special handling of 39.) + if entry.length == 0: + count += 1 + continue + # Seek file position, read length bytes, and write to new output file. + print('%02d: offset: 0x%06x len: 0x%04x width: %d height: %d' % + (count, entry.offset, entry.length, entry.width, entry.height)) + outfilename = os.path.join(outDir, + '%03d-%s.jpg' % (count, _iconNames[count])) + with open(outfilename, 'wb') as outfile: + infile.seek(entry.offset) + blob = infile.read(entry.length) + outfile.write(blob) + print('Wrote %d bytes to %s' % (entry.length, outfilename)) + + count += 1 + return + + def createFile(self, iconDir, filename): + '''Create a new .ico file from the contents of iconDir. + + The contents of iconDir are processed to get image + resolution, and a new entry is created for each. + + Each filename must have a leading number followed by a + dash, which is the icon index. E.g., "071-ICON_StepX.jpg". + ''' + self.entries = [Entry() for i in range(0,256)] + # 1. Scan icon directory and record all valid files + print('Scanning icon directory', iconDir) + count = 0 + for dirEntry in os.scandir(iconDir): + if not dirEntry.is_file(): + print('...Ignoring', dirEntry.path) + continue + # process each file: + try: + index = int(dirEntry.name[0:3]) + if (index < 0) or (index > 255): + print('...Ignoring invalid index on', dirEntry.path) + continue + #dirEntry.path is iconDir/name + w,h = getJpegResolution(dirEntry.path) + length = dirEntry.stat().st_size + e = self.entries[index] + e.width = w + e.height = h + e.length = length + e.filename = dirEntry.path + count += 1 + except Exception as e: + print('Whoops: ', e) + pass + print('...Scanned %d icon files' % (count)) + + # 2. Scan over valid header entries and update offsets + self._updateHeaderOffsets() + + # 3. Write out header to .ico file, the append each icon file + self._combineAndWriteIcoFile(filename) + print('Scanning done. %d icons included.' % (count)) + + def _updateHeaderOffsets(self): + """Iterate over all header entries and update their offsets. + """ + offset = 256 * 16 + for i in range(0,256): + e = self.entries[i] + if e.length == 0: + continue + e.offset = offset + offset += e.length + #print('%03d: (%d x %d) len=%d off=%d' % + # (i, e.width, e.height, e.length, e.offset)) + return + + def _combineAndWriteIcoFile(self, filename): + """Write out final .ico file. + All header entries are updated, so write out + the final header contents, and concat each icon + file to the .ico. + """ + with open(filename, 'wb') as outfile: + # 1. Write header directory + for e in self.entries: + outfile.write( e.serialize() ) + if outfile.tell() != 4096: + raise RuntimeError('Header directory write failed. Not 4096 bytes') + # 2. For each entry, concat the icon file data + for e in self.entries: + if 0 == e.length: continue + guts = self._getFileContents(e.filename, e.length) + outfile.write(guts) + return + + def _getFileContents(self, filename, length): + """Read contents of filename, and return bytes""" + with open(filename, 'rb') as infile: + contents = infile.read(length) + if len(contents) != length: + raise RuntimeError('Failed to read contents of', filename) + return contents + +class Entry(): + '''Entry objects record resolution and size information + about each icon stored in an ICO file. + ''' + __slots__ = ('width', 'height', 'offset', 'length', 'filename') + + def __init__(self, w=0, h=0, length=0, offset=0): + self.width = w + self.height = h + self.offset = offset + self.length = length + self.filename = None + + def parseRawData(self, rawEntryBytes): + if len(rawEntryBytes) != 16: + raise RuntimeError('Entry: data must be 16 bytes long') + + # Split data into bigendian fields + (w, h, off, len3, len21, b1,b2,b3,b4,b5) = \ + struct.unpack('>HHLBHBBBBB', rawEntryBytes) + self.width = w + self.height = h + self.offset = off + self.length = len3 * 65536 + len21 + return + + def serialize(self): + """Convert this Entry's information into a 16-byte + .ico directory entry record. Return bytes object. + """ + len21 = self.length % 65536 + len3 = self.length // 65536 + rawdata = struct.pack('>HHLBHBBBBB', self.width, self.height, + self.offset, len3, len21, + 0, 0, 0, 0, 0) + return rawdata + +_iconNames = { + 0 : 'ICON_LOGO', + 1 : 'ICON_Print_0', + 2 : 'ICON_Print_1', + 3 : 'ICON_Prepare_0', + 4 : 'ICON_Prepare_1', + 5 : 'ICON_Control_0', + 6 : 'ICON_Control_1', + 7 : 'ICON_Leveling_0', + 8 : 'ICON_Leveling_1', + 9 : 'ICON_HotendTemp', + 10 : 'ICON_BedTemp', + 11 : 'ICON_Speed', + 12 : 'ICON_Zoffset', + 13 : 'ICON_Back', + 14 : 'ICON_File', + 15 : 'ICON_PrintTime', + 16 : 'ICON_RemainTime', + 17 : 'ICON_Setup_0', + 18 : 'ICON_Setup_1', + 19 : 'ICON_Pause_0', + 20 : 'ICON_Pause_1', + 21 : 'ICON_Continue_0', + 22 : 'ICON_Continue_1', + 23 : 'ICON_Stop_0', + 24 : 'ICON_Stop_1', + 25 : 'ICON_Bar', + 26 : 'ICON_More', + 27 : 'ICON_Axis', + 28 : 'ICON_CloseMotor', + 29 : 'ICON_Homing', + 30 : 'ICON_SetHome', + 31 : 'ICON_PLAPreheat', + 32 : 'ICON_ABSPreheat', + 33 : 'ICON_Cool', + 34 : 'ICON_Language', + 35 : 'ICON_MoveX', + 36 : 'ICON_MoveY', + 37 : 'ICON_MoveZ', + 38 : 'ICON_Extruder', + # no 39 + 40 : 'ICON_Temperature', + 41 : 'ICON_Motion', + 42 : 'ICON_WriteEEPROM', + 43 : 'ICON_ReadEEPROM', + 44 : 'ICON_ResumeEEPROM', + 45 : 'ICON_Info', + 46 : 'ICON_SetEndTemp', + 47 : 'ICON_SetBedTemp', + 48 : 'ICON_FanSpeed', + 49 : 'ICON_SetPLAPreheat', + 50 : 'ICON_SetABSPreheat', + 51 : 'ICON_MaxSpeed', + 52 : 'ICON_MaxAccelerated', + 53 : 'ICON_MaxJerk', + 54 : 'ICON_Step', + 55 : 'ICON_PrintSize', + 56 : 'ICON_Version', + 57 : 'ICON_Contact', + 58 : 'ICON_StockConfiguraton', + 59 : 'ICON_MaxSpeedX', + 60 : 'ICON_MaxSpeedY', + 61 : 'ICON_MaxSpeedZ', + 62 : 'ICON_MaxSpeedE', + 63 : 'ICON_MaxAccX', + 64 : 'ICON_MaxAccY', + 65 : 'ICON_MaxAccZ', + 66 : 'ICON_MaxAccE', + 67 : 'ICON_MaxSpeedJerkX', + 68 : 'ICON_MaxSpeedJerkY', + 69 : 'ICON_MaxSpeedJerkZ', + 70 : 'ICON_MaxSpeedJerkE', + 71 : 'ICON_StepX', + 72 : 'ICON_StepY', + 73 : 'ICON_StepZ', + 74 : 'ICON_StepE', + 75 : 'ICON_Setspeed', + 76 : 'ICON_SetZOffset', + 77 : 'ICON_Rectangle', + 78 : 'ICON_BLTouch', + 79 : 'ICON_TempTooLow', + 80 : 'ICON_AutoLeveling', + 81 : 'ICON_TempTooHigh', + 82 : 'ICON_NoTips_C', + 83 : 'ICON_NoTips_E', + 84 : 'ICON_Continue_C', + 85 : 'ICON_Continue_E', + 86 : 'ICON_Cancel_C', + 87 : 'ICON_Cancel_E', + 88 : 'ICON_Confirm_C', + 89 : 'ICON_Confirm_E', + 90 : 'ICON_Info_0', + 91 : 'ICON_Info_1' + } diff --git a/buildroot/share/dwin/bin/LICENSE b/buildroot/share/dwin/bin/LICENSE new file mode 100644 index 000000000000..f288702d2fa1 --- /dev/null +++ b/buildroot/share/dwin/bin/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/buildroot/share/dwin/bin/README.md b/buildroot/share/dwin/bin/README.md new file mode 100644 index 000000000000..9d513bc0c8f5 --- /dev/null +++ b/buildroot/share/dwin/bin/README.md @@ -0,0 +1,92 @@ +# DWIN Icon Tools + +Tools for processing `.ICO` files used by DWIN displays. + +## Introduction + +The DWIN LCDs that come with the Creality Ender 3 v2 and other 3D printers contain image and container files stored on them which are used to draw various the UI elements. + +Standard `.JPG` files can be installed for things like the boot screen, and `.ICO` files can contain several images within a structured file format. + +## DWIN Banks + +Each JPEG and ICO file starts with a number that tells DWIN which bank it should be stored in. Each numbered bank is 32K in size, so a single JPEG or ICO file can be up to 32kB before it starts to overwrite the next bank. For example, if the file loaded into bank 0 is over 32K, the next file should be numbered "2" so it loads into bank 2. The limit to the total size of all files installed on the display is usually 512KB, corresponding to 16 banks. All JPEG images, ICO containers, and fonts must fit into this space, so you may need to apply a lot of JPEG compression. + +## The Tools + +This folder includes two useful scripts, one to convert JPEG images into ICO files and another to extract JPEGs from ICO files. + +### splitIco.py + +The `splitIco.py` script reads an ICO file and extracts the component JPEG images, saving them in a new folder. Each icon is named by its index in the ICO, also using symbol names from Marlin's `dwin.h` header file for the display. + +### makeIco.py + +The `makeIco.py` script reads all the images in a folder and combines them into a single `.ICO` file. + +## Dependencies + +These tools are written in Python 3 using the [Pillow image library](https://pillow.readthedocs.io/en/latest/index.html). + +## Credits + +Created by Brent Burton [[@b-pub](https://github.com/b-pub)] + +## License + +These tools are provided under the GPL 3 license. See the `LICENSE` file for details. + +# Usage & Dependencies + +These tools must be run from a terminal with access to an installed Python 3 and the Pillow image library. + +Pillow is most easily installed with pip: + + python3 -m pip install pillow + +## Examples + +These tools process an `.ICO` file that you specify. The safest method is to create a folder and copy your `.ICO` file there. For example: + + $ mkdir hackicons + $ cp 9.ICO hackicons + $ cd hackicons + +The following explanations will refer back to this layout. + +### `splitIco.py` - Split the ICO archive + +If you want to edit the individual icons stored in an ICO file (or add more images) you'll first need to extract all the images from the archive using `splitIco.py`. + +**Usage:** `splitIco.py #.ICO foldername`. + +**Example:** + +In this example we're extracting the constituent JPEG files from `9.ICO` and storing them in a folder named `icons`. As each file is extracted the script reports its index number, byte offset, size, dimensions, and filename: + + $ cd buildroot/share/dwin + $ ./bin/splitIco.py 9.ICO icons-9 + Splitting 9.ICO into dir icons + Splitting Entry Data... + 00: offset: 0x001000 len: 0x10a2 width: 130 height: 17 + Wrote 4258 bytes to icons/000-ICON_LOGO.jpg + 01: offset: 0x0020a2 len: 0x0eac width: 110 height: 100 + Wrote 3756 bytes to icons/001-ICON_Print_0.jpg + 02: offset: 0x002f4e len: 0x0eaa width: 110 height: 100 + Wrote 3754 bytes to icons/002-ICON_Print_1.jpg + ... + 91: offset: 0x0345fc len: 0x0d89 width: 110 height: 100 + Wrote 3465 bytes to icons/091-ICON_Info_1.jpg + +Once the individual JPEG files have been saved they can be edited using common graphics applications like Photoshop. JPEG files are inherently lossy and will usually contain ugly artifacts, so cleanup may be needed before they are re-exported. Keep the limits of bank size in mind when exporting images and try to find the best balance between compressed size and image quality. + +### `makeIco.py` - Combine JPEGs into `ICO` archive + +After editing images you'll create a new `9.ICO` archive with `makeIco.py` like so: + + $ cd buildroot/share/dwin + $ ./bin/makeIco.py icons-3 3.ICO + Making .ico file '3.ICO' from contents of 'icons-3' + Scanning icon directory icons-3 + ...Scanned 16 icon files + Scanning done. 16 icons included. diff --git a/buildroot/share/dwin/bin/makeIco.py b/buildroot/share/dwin/bin/makeIco.py new file mode 100755 index 000000000000..274082acee87 --- /dev/null +++ b/buildroot/share/dwin/bin/makeIco.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# +# Make a DWIN .ico file from a directory of JPEG icon files. +# +# Copyright (c) 2020 Brent Burton +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +#---------------------------------------------------------------- + +import os +import os.path +import argparse +import DWIN_ICO + +version = '2.0.7' + +#---------------- +if __name__ == '__main__': + try: + parser = argparse.ArgumentParser(description='Make .ico from JPEG files') + parser.add_argument('iconDir', type=str, nargs=1, + help='name of directory containing icon JPGs') + parser.add_argument('filename', type=str, nargs=1, + help='name of new .ico file to create') + args = parser.parse_args() + + filename = args.filename[0] + iconDir = args.iconDir[0] + + if os.path.isfile(filename): + raise RuntimeError("ICO file '%s' already exists." % (filename)) + + if not os.path.exists(iconDir): + raise RuntimeError("Icon directory '%s' doesn't exist." % (iconDir)) + + print("Making .ico file '%s' from contents of '%s'" % (filename, iconDir)) + ico = DWIN_ICO.DWIN_ICO_File() + ico.createFile(iconDir, filename) + + except Exception as e: + print('Error: ', e) + diff --git a/buildroot/share/dwin/bin/splitIco.py b/buildroot/share/dwin/bin/splitIco.py new file mode 100755 index 000000000000..ce6ba89749c9 --- /dev/null +++ b/buildroot/share/dwin/bin/splitIco.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# +# Split a DWIN .ico file into separate images. +# +# Copyright (c) 2020 Brent Burton +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +#---------------------------------------------------------------- + +import os +import os.path +import argparse +import DWIN_ICO + +version = '2.0.7' + +#---------------- +if __name__ == '__main__': + try: + parser = argparse.ArgumentParser(description='Split .ico into JPEG files') + parser.add_argument('filename', type=str, nargs=1, + help='name of input .ico file to split') + parser.add_argument('outputDir', type=str, nargs=1, + help='name of output directory to create') + args = parser.parse_args() + + filename = args.filename[0] + outputDir = args.outputDir[0] + + if not os.path.isfile(filename): + raise RuntimeError("ICO file '%s' doesn't exist" % (filename)) + + if os.path.exists(outputDir): + raise RuntimeError("Output directory '%s' already exists." % (outputDir)) + + print('Splitting %s into dir %s' % (filename, outputDir)) + ico = DWIN_ICO.DWIN_ICO_File() + ico.splitFile(filename, outputDir) + + except Exception as e: + print('Error: ', e) diff --git a/buildroot/share/dwin/icons-2/000-ICON_BootLogo.jpg b/buildroot/share/dwin/icons-2/000-ICON_BootLogo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3ca4d1cf55cc09425773afbbaa034dd44e023152 GIT binary patch literal 16062 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-2/001-ICON_OpenSourceFirmware.jpg b/buildroot/share/dwin/icons-2/001-ICON_OpenSourceFirmware.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a2c43da314b1524e9448c77fa25fad845c365fbf GIT binary patch literal 3206 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-2/002-ICON_GitHub.jpg b/buildroot/share/dwin/icons-2/002-ICON_GitHub.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0be90fa9bd943b3b4e59a1f4c04bcc34ad5aa666 GIT binary patch literal 3399 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-2/004-ICON_Copyright.jpg b/buildroot/share/dwin/icons-2/004-ICON_Copyright.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a3691d68c24479271fbdcdc55d742abe6f85117d GIT binary patch literal 1951 zcmbu4X*k=77RLXHC9zAW)*3@?BVsqCN^6N5LG6MWTP-EDl-NSr(Yjr%Rf$Te)?Q+% zed}0C`=BGLwHs>RGL($i8NDCwhkHNHdp@1_eb4WC>0cS3uYjgT(+K5D4%(8{l*j zF#W#$BYlVbBf$6L(+&Uz1$Y562M7j$VIU3|=(HP<0st@vzySjOD=uyhP6z;o@}8wC z!e=Q60C9rB0OUUn4o)x^HwXfQi--c}#N?rJ7ZsGWbla8v)t#kd$GyM_H z9(lTx|8n9>6-{w{4Q!pjuY{J`FSaGtEo?`xAuiYkmZPGmjjjjf3HlWck+hEARQka^ zV!W-3??#nH{>N-=;H6vvVoGeXeOC{OONDZXV+VDUizV|R$DS!QQ4MJEDUBTrxyp1w z(xE7)>ZR>BG2?go))sOF+OJjP*B3QiXeGXsj?9*!GSp`wjX}tVnA*y}hVtrFb2w4Tk&THXffxR$m5c>H8) z-H%{hq6T*Lx*Q{12>>bu=?`WTrlmS#?l3_eOz3=42hlsklN!$X*wV-xe^pEgz;Ab7y8lM97>Q zdk}Stn-R>(LA)v#apG4ENoJ)_TeRQiTJ0FlJy$T%wZQt2&3DsT3hvx};}yNKtRP!b z-UPbiA+p7GCA?1xEFq>VFJ4u%cdcN+eFZ4z06Bip#-%CNfjJ!-@QLa7w_s(Xo3K`h^ z#%7i6b291kxEf2o8?d_?c2enHuR9-F735%*U%)f1#c^#&KV?S7GKtYKnQS z)72Vlz-k>Ld6DQCt3Ots8*>|pXGCJue-N~}y>NX+#$g?a$?BU;f;^-Bs|LxVYB=8h!6i@+WuFR@;o7w?6$?4pJQGyyw_V)bdYL# zFDJgDoOOO(lVQrSsMMo>xVR>fs<*LBi_OCkjN)h1_a!T1jYf@TLe^?K8`g~{kB{r1 z?^O|5GrQ(cfjp{anm#NBJ@*ImBo#F=Zh$B)x>H}0eLc^lwpZeXi^7UMBhSA5X%^i5 zgkqo)DvYR#H*t4Q3cTmkJAr2;W~Gy_h12^N4#{c*ilgmc-tHb#I2G`_u}A$-FQq2i zFFoQ7qBJAZ~r&R+7gUUTj4@@H~$< zDzcR=s3;d&=0%LPD)N(~=NkCBr#}rC?)z|G;K#0Reogge{nj<0CFqYtz^8wDm>V4C zR?_F=Cht2qH-EcwNRVGDdB5{&lW@8}2fKSKXU+qcv56KVs8zW9qFxo?CA24rb2&z7 zsk1*%t~`$2+=d&kSlOp1I-CLqQ0%~UW(n#q>CoLMrEO;uNMo&z_||1E2VvDe;YxJ3 zqDYrY9e5%X_2fwCbo_7nH%s3D literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/000-ICON_LOGO_Marlin.jpg b/buildroot/share/dwin/icons-3/000-ICON_LOGO_Marlin.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f3e81f2284f15fbeec1ab8cb8b3ab0bc182a5298 GIT binary patch literal 9089 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 F|6j_;6t@5X literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/001-ICON_HotendOff.jpg b/buildroot/share/dwin/icons-3/001-ICON_HotendOff.jpg new file mode 100644 index 0000000000000000000000000000000000000000..08e18413ec0f46015131c1a92cc5726826f9459a GIT binary patch literal 3140 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/002-ICON_HotendOn.jpg b/buildroot/share/dwin/icons-3/002-ICON_HotendOn.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5b501bd6d99517b552879f664d4afd9a9ef249cc GIT binary patch literal 3000 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/003-ICON_BedOff.jpg b/buildroot/share/dwin/icons-3/003-ICON_BedOff.jpg new file mode 100644 index 0000000000000000000000000000000000000000..db9b546b3303407c834c974c99f2780ed4086817 GIT binary patch literal 1798 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 #xj?eKleLL%@8FK1aOXF{3m#?&D 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 V?letUL>Ln%^9Akx$ol2X{{a*uH8B7H literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/006-ICON_Fan1.jpg b/buildroot/share/dwin/icons-3/006-ICON_Fan1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8111a3db74854ff5412d5f436b400bd81981e1bd GIT binary patch literal 4933 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/008-ICON_Fan3.jpg b/buildroot/share/dwin/icons-3/008-ICON_Fan3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ba0cae54b012ae7d6edb4fba89aa56b7ed927dd9 GIT binary patch literal 4977 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/010-ICON_Question.jpg b/buildroot/share/dwin/icons-3/010-ICON_Question.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a8d0cddaa8eb9d42025e770b620b328a57477609 GIT binary patch literal 12319 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/011-ICON_Alert.jpg b/buildroot/share/dwin/icons-3/011-ICON_Alert.jpg new file mode 100644 index 0000000000000000000000000000000000000000..603648e864333acdd8c65b888ee8666f3d7eab4a GIT binary patch literal 8217 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 S>pUgX0J5@$OPQAsv;PBeD|jOS literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/012-ICON_RotateCW.jpg b/buildroot/share/dwin/icons-3/012-ICON_RotateCW.jpg new file mode 100644 index 0000000000000000000000000000000000000000..36f404b9c963676c0e541ce35eab20525eca96c5 GIT binary patch literal 3291 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 VsM;cYNSw0Dy`~W#{|d(RzX8=F_8|ZO literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/013-ICON_RotateCCW.jpg b/buildroot/share/dwin/icons-3/013-ICON_RotateCCW.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3dc443c193ccd5c9da1e759c6914a7e5df7db50e GIT binary patch literal 3300 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/014-ICON_UpArrow.jpg b/buildroot/share/dwin/icons-3/014-ICON_UpArrow.jpg new file mode 100644 index 0000000000000000000000000000000000000000..26b08ca10c13af9d7ead1aedaa1794c575469396 GIT binary patch literal 1998 zcmbtUcU02}68CsK`w7?n^I31s8Fy?gKe-kHDVeKX%TZ{EysXShqiQOENR=K&B10DO54 zaOVL#UiA0u2g%=K;8k;J089|j2lV+sFaQh#@xegcK0p=#0bsr#?f%dBgrNdLf?yt~ zaTEYSz+f;4!uMAK1kA?|1qlFxLK1LEv&a^hl(Y;lQI1Cd;{QJu0T7rUDkucup*lQ0 zFo+Kff&N#BrwHK(pfCZrpoFB7l(7k(LRF5uFKxh`14MaRU>F|^um(!G03x`*kbw|) zWSo|0)$|BSv!?bEe^tqu&l7DjSzAfzt_S`+jO2R-mh^OAcHq zb`(iy7*HEw-kX}iJb?Pj>6sCzqIP=AkW*VXYGcH3IA$I8WTto-+b8ZU&CI1+y=U($ zdm#&&Y_%ychnBo_u0taR`*mTe=ToQI*DE6~B1fw=)vq=hX}8(3E$pkFhDSX6q|%&z z1w%jjXng^Tr0|A<#w7R&Pc#%> zj}laqI?(t!q=nbc<<rvkbl2){5l2 z=N?^tw^kWDJJ)<2G7f)gpjL+G$FOXQi!QJ^v=ft zDOeY((GQdVg*deGfkq@v!xOOCI#`-hBD~eil)YcJB77c-KmKLZMC6ehBS139)3K*P zZ!jBsKXe40pfi`GJnZC}R?2?p5X)|LfcG(f#w|RH4cQpLP#0P^GANUtXNn1FTDPAK zXB$jB2^l9(w4+DKN?KK(=oC9)hGp=~w_UqT0(AjZqotF1zkSi26<@s+wTF&h7{Ib! zkI>8r<--+HS?#yp1T`hiVg!3a9jAV3dr)xfu|Pqlo_Y3iQCwJf)8oa0gW;CO>L(wl zk$kSRLH^+{b#tpT^K3l_l)^9`bdiPdn`DUoZx_D7vnlZ&#GPrUj{5KGjY#kDR=PWg zl-bZBChKTkhg7^(ab`AB`gjq=J`45yK_gO8xtq+Qt`2IIl`pfC0*nEgia>Yv1k$soG+QTg_&A-Np?yufur77&wBAmKXoz~{> zf|@yvkx0dqp}Eo{S=AZDDLTdGaiR-7DIma5gPv{^jX`im6Y)k@ld&07?`Blf%KJT0 za2-67O}`G?G#tu&m?N5iEsTP30gpe%{CE4qrctN+OpPo`$=U+(v#a2q&3C)<$hm+1 zB5W&}H8JaX4C0u=-d|e#9eTvqzszsK>G#gL`uy^U^W*WcS3{rc`W-)6D2>xp!cjaF zQb#>LKHNKWP>oB#s5&Hod%N2+nL}yUO z5kGFb5)oQvM!%9C{eCxy<|PfIcblQNfj@>v&N#n#L+@<`il6I-SLQ` z?F=fD*s!%5!}^6|Z0&X%{r!03Ju35{!?HFw(tO(Hub)xpd~3cQv*XifzIa#BUHzS! zm>Z+R1MXUNM)l?Ee}rwnCB9vNI+Vtz4-1R?&@~R|Qg*9Tl{Yu;sQ)nrone@AmZwf6 z+D~p>lNC}Y78(Z+h&}Wd_n#qM{>f|H(2B7I`|KKhnwVMNG_PwWwc=Tj=6}SNk~+7+ zu{O#W$|Kw)L%6Pld&!l2rguh9i?0vm8cF4hB>RNT;p-MhIK!w`Y-mNzzTVKE& XSUi!PF{24%a{*+{1>SFc$({WZv=w#4 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-3/015-ICON_DownArrow.jpg b/buildroot/share/dwin/icons-3/015-ICON_DownArrow.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5587a3f7f2db15067db737a4e44d3e528ea2f80e GIT binary patch literal 1994 zcmbtQc{tmN7X2lJXaxziRgofTQA-%Dt-RL6-l~q&PEi^vM2FhV5IVM&l2BXe60~DU zMmDOXQZltZyDHPME2>%(OQ}h}@4ffE|L5Gl?sv{T_ug|be((;EalqPR0T2iP{DlP^ zOakYH-9N)OlYizQoIYp=;84H-Fc1O30WcgS0tX%NfTI8i0E0z<|AWXOu!NX6R7j#^ z0FWpc3`0jPv5Le4ab1(#P4>Qsd9f*{|1{vX6aV2Bu0LR84=3fF-_ zB481y$bS@I5s)YZ5QB>&pt4B0Bgain6B$hTsC2`FH-My21cr;i0V|;D08qwvmTay& zH*c$jnrqZ;o)o0wQ~i#FcZ|Bsl$4@Q@Ae}4iMI8IvyVK{D=H1@kiFcH!PG*mWmXu> zlpd}EB_ws+<(A*0o^EX@Rj(oHPt;6sRJ5HVeLnjtSQHDm_VF9Mu2#1{V9TA{{s^1E zA__s-u$(QJ(9WiY%BuzKg!08Ma@kb3E| zOE>QF@e&fs@yquJ8u8|YB6rXkwn=c82cJc?ez2}Z`ZCNZrSTKG}0=T6!kB}X2)N8;WeC_o;n@TrH^>an^&j3r{hNN-U`Mj z($*UB^-iC$g=TRsF^-xV&0^5!ZM|Wxs4{%@x1=Vle(_@$`C3`l?b=?8vRSt6- z<#7HmWF~FNcjrrZ!{kTh(jM`*j*Wg9)P0RQj_T17z4^g>Nn%Cps&c}8K2la0c-gf`FGhTYF6*8M)veS+aAJzxtkDvsCTsYcEQZn-;IEB~$z(mAsSx?7D`*^|4LK zRXx<`vX;UrueQQb51H3Dy5+6;nZ-&Kw#5(h%?f5h5+llgs~C^lXRv7YFWxig5I57H zxlk)vN^M?Y`y{_L%>PYSmMY9%hSV4!x{WMgBx^PQHQvf;{GvpUp$=551&S$S`NPKK z6Ut4xNqYBTp1-r>3D4B+9zHzI942Ki*qs@QI8p6NwS9S%(DLXB`xuwp#>OaFkk2kl>7p(LrYBq}JC;@JfZX41-l8RcZgr*J>pihb8Rl z>eB1{HOKE7(ZS~Gl_&?SLz2zpYA;J7i!kRV8d8dFi5l6+TdMN>d`@wf@noGosz+1E zUzE-6*D4_4P&!hu{%nujGeZ}QM;f0aw`BLx9(K`D>pE-A?+tFAY)~^?pS$1dyJ3gt zXAI92viJ`jp*BY8HZn zYK<#3zS>*~wFzXP4Hv4j`zQ%%k&kNF@l)*bzNLn8h&1;i@z7kxzpZ&teIt*c!3uQq zepoJkYtp^vD|pAiUxw|E4G6%+Te(uw)-_we;LKx<`p7q{Xfy7nm6fcf8S7=%oqjB3d z%ORg&ysuUBD_a33zx}CbeLYIyG+g)M8!QS1H5eI}&Mdy8??HW4NXF&-Fj>ZFaQt!B z`CCq75lfaMkt;9WRS`T-sy>6s$Hw7adDR>1_Jn?&%H7{^Oy zbLOS1s%0tMg;Vb^!%>^rw+CaHV!{5NoH>;Y;>vuhCO$;95sk5sv*~PTHKFJyuH6_N z?h%hx=|$mC)?7^8FU8j!`KgqaE| zAR99liIf$70&$3=Qf-(%W6~;l#t@i~?Wi|UR!z}Cj+J?t-)FHgWArV@qNz9|Ix5Ju zX8W>F;_l9Mm(;We9x|DF4#B}w1x>^R*|4iIR26mn)#daQ6D)+XTG&nSOO&o|@?{d5 YKA@YN=^z;z{7(4-+6z~PZ#bCv8z)p*1poj5 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/000-ICON_LOGO_Creality.jpg b/buildroot/share/dwin/icons-6/000-ICON_LOGO_Creality.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2ceb758a881a87dd5e7b0c979f088568a1b6f64e GIT binary patch literal 4258 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/001-ICON_Print_0.jpg b/buildroot/share/dwin/icons-6/001-ICON_Print_0.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8729a753c180bddaaa42b8cb2dabab946ec0e69d GIT binary patch literal 3756 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 uB=!8Pg8{@E(!jzxZRHb%Wp9E<^KTrQxf$6 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/002-ICON_Print_1.jpg b/buildroot/share/dwin/icons-6/002-ICON_Print_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f89841ad1c80552ec4e41355701b98da1d43ce2f GIT binary patch literal 3754 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/003-ICON_Prepare_0.jpg b/buildroot/share/dwin/icons-6/003-ICON_Prepare_0.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2722fa4352db527a5a002e6e2ed1994e4f26e584 GIT binary patch literal 3603 zcmcgsc|6ox8~=^TlDcVIMMj z<|=>~@EwA20A}n%q6GjDU>&&Z2mpd1D9VG&^~Rx442~+1%ygxwl9+UqKhYb7R#ig* zx(5E<(C}S$Z2$Jg89u-`$2^!^CdY&64L34cxiu~LUOOs-%=F{z`^vGj#F;ZVTq1)+F*nvj zfKgPbR5H#Gt%g?9!hkSVN25&)wT#sb4NcLST3AgjQ&UruRjx6UF}?|#!-J>i`q})edCgUUJLrCTohOgYUOc%c)~h#IIOqoPK1 z?EY%2l8DZ}p5U8Y^@nQHN!UzOZO#Qs{oHJBUuRyBC}ylqJ9WBl(0WGK1Y6U0DO)SG z-!}-I`(k_E`buuo#Os2XA&V&;ZuU@hRmn68j#N6j+|lB8{C>Wg?c;XOV_AfHq9R6ofw4_-ATN8 zKPvoa&_EwfB6)kZQz5;TxlgSQ*rnYIm(RA0<6l!hb>~x2a7MX>U;5Fb z!R1eQ2SctXT68Wg43@VPlsK|r1{0h9FnIDRG|slkQP$J3xivF*kn}#}ih~`#t)M;$@$ViR;jwDGStMM4$C@`iI3R1OSF2Vzud5ylRomR z>=*5}wyQcXJ4OSoa`hBCuD4cg`@&KRdq6OWXw2Rd($6n>7aF4x%J2Bk>O){eFf{?& zaeb5a^JT5MuP0^)#9O>5V0kZyrpJ zZZIk9NQ^7qYlFo)1!k7ht!C}CwE=DxWPWhW4VL`%?bcFD}7Toc3~S^0KobZMPoi!w1!_~?t$z0Ivg?igS+J# z_u+WAqEe5>Ywm*bd9%ou$?H1~M<|tEt`yF%y5!~=?6>&&^upEPFSR4$U8kN8{V4$A zPr92fN%};zT)VH9gU~i;STBpkl2x)k^tU-XPXs-6qLlse@%a6WLvF}?r=0rTX-Vvj zT^{(jBI~5f#fTCAOG#AZE}9NQWWv^hdGtjDH_-UKvIc5=AW@e#xGWv50~?aE@3`T# z$!@4@L@K$gA;&HZls4h1@?l#ge1r%?t2i?>?sPr7^=@oHg0`)$Qhzy&W~rh~;$>ka z?7DvAWCxAto-NykTMVg9*6Ynn4C~9Pb##3Fz?{HW+&nC=z>$iI^&0gGsedQIXTzgR>cCDL_c$Cp2v?kzrQ&7$-$5GWFW`=15LU zK>Lmpq=NYbYF#jjbW2C;0`j)bf9y5#y7xL#>wW0K&9V46V^dd;vZqNdQ@hwxeenDn4w_4-S0@*T$A_=W zRY!+xR$FSi{&0s|bA$iscHe8=-2v&Q5(Vkvc~?cKtcVxSx-MOgIXG-auUtlEf=$aY zoaaf76gxgOa2kMc%1;Fi;eGU2qw!W!qoBia?z=F3o z%E<$^@dJ#?!0rN%4u@EpwI?iMgIoGp^{K-#_pIg2LN6~^Df4N}-uCV@6o z;(}%s2T~Ekd7619z~}9Jutq_Bgvi@i<{`RmHhsg+RKq=&l)A07(NFmM;>?sZdgEdh ztpi~e_o_H=Quwyhe(}h ziL+Fd3`I)C&1BW!0_-o{pMrWry=-3GJY}X9(`u^@@` z{Am6AnkUOs&2N0X;GItWgo%sMJ5@cwTfS3hjw>;>AUOL=CY8@EYvijuuAAt7S@>-B z*{HfrK)|a>JKy^7YMqh~iwEYmM+*SOEUjzt5390$W~B7nKT@a47sHwFa$adEO9$Uw zl|DYvJ+KrjVgo5b_-8R+3{q}+4exKjm zjNB7wd)>HoM+l;`JzjJ^lQp3gu2Y!q> z)z(%Ay9imUruLN670&em=j2*(7b19duJR$o!vsIX{x<%2Be6@XrG*YQWV3G#`FK() z&Mxk){<{il%N}XPz?2EQME{sqk97GXfjtr%`zIgq#_sWpZ^?ZjS?S|RHsuFm8O<+s{Lxm9XfxP<);|SUVk_ttsoQMGc#8fyrdxj mn)gvQDIKE5%Mx{Dy^;^TLp-^F-`kgxp0#$S|A%29==mSNtG*Qg literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/004-ICON_Prepare_1.jpg b/buildroot/share/dwin/icons-6/004-ICON_Prepare_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..627082b6fb31578b5fbd88cdfee06d740b7f8df5 GIT binary patch literal 3616 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/006-ICON_Control_1.jpg b/buildroot/share/dwin/icons-6/006-ICON_Control_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2a813b655e2b2fc60f561cbc3789808d85522070 GIT binary patch literal 4157 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/007-ICON_Leveling_0.jpg b/buildroot/share/dwin/icons-6/007-ICON_Leveling_0.jpg new file mode 100644 index 0000000000000000000000000000000000000000..34d12c62f52174b07dab5b295fdd692c0fe4378b GIT binary patch literal 3480 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 Ox9eT~fBb?(FaHY|?10_? literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/008-ICON_Leveling_1.jpg b/buildroot/share/dwin/icons-6/008-ICON_Leveling_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f75e3720043c0c1d4e9add7af2e9bcae051aa9bf GIT binary patch literal 3474 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 J*JADU{{V2Be@XxV literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/009-ICON_HotendTemp.jpg b/buildroot/share/dwin/icons-6/009-ICON_HotendTemp.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0bf1437c646d026ee3df5e16fcc65f6144cadfb2 GIT binary patch literal 1671 zcmaJ=drVVT96tB_DYr7$AnpDWAIl;Z0I43w11MVTB2E{5coY|(%={DywXLnjDm__{lIQgA(zVG|} z&N;smIUnfmVm_&(Z_x0vExgygQDS3>%z%U^D`Xmct33I$gf~*tYLxo zDEvZ5V06>Nee}5RM6Go{Jfc|e)rBJHn;{i~}5mc5C7oaj&38GO# z-vlbdlrqtKJjt19u7L@FT#3jOaUz0hAQeodtcl7AZoO)89X`(%=>el*8n~qab3sk} z9OuctvAu_;eUmtQXI1KR=G@8>(J_YAEet(DQmsiFEb4GV9-du!`s~1wZN<7Tmj{|m zr#^k5sB`(sUDm{_HQ`Wp;<49BjdHxX_F#8e(dB{F?>7gkcQ!2DvEcKs?kbrT{FRjV zUcyt4{%~k3=I?z<*;E$pK5%3G)G5~|37hlVF5>svu06eFDK*g1z5iv_X4^U?TsPCc zd&a!nOO95$yB_^mQ84!Y;R~hQM{`_D-q@TvTQT#KG^JxcDlcv9DIC{wFI0TZFnw>s z)_3hE_EuMsS*?33J6HF8hBn;j(%{p$+NQb_jmLy8bwMb3fc&EV#y@H7+AXe8)!T2U zafXw2vPR%X1_U=_(Rr*`?`P-_#PQBuqe(8e=@{O+=_Z-~V z+R~N1puVQUdl}pJ@1*SOJx!=WdogFxcZ=(sD{MdKk$+VFPLy;`9P?x2lfTdj%I)Fj zMOAGpc0Bo<_0H=h<g|4^;aNS(+JW@c$vRenv@2ft9{~ zUa?+cN`6wRUUGh}ennz|zM-ChK7);YML}Y6c4~=2Qfhi;o~_dR-TRdkGE;1o!cBb* zd<&dYGcrA@ic*8C{6dnevXd=Sl&_Q3Q(W~w5=#5%__*n4QdyVXR8GDRC#&1Ub(Seeo?xG?WUP)qwZeFo6%mkOz;^d;tf|AVqJOz-6iAnjTCALaHmqNUdTL3o}Ygi#E^!3HB zG&dI%0AOQ_OM+4n?!{_waY$uBs(w&vaeir0aw<@{GDvfQm2**QVo82cNPd0}EEEGW z@=NlIGx7@*oSi|TW}%=Fo|%`DUtX*U*5m7I<(XGpl9-pA>gi&u1T;l2Gc(1?($&qx z!ot$U$jHUS(9qSF|+YBuXjBvmNWHB)TNgx3M%uLKc03=vIfSDBx z*g=2;4nW$0s#%$tS=m`xSdnDlO7JuOA7BvVU=U&uVrCR%U=n0x7G(T?grS~+fteAJ z{edhFPA-rO(S+F=~y0b!_Y1l^yo* z@t=H&d(Iha3@3VBxv`=v+tc&X&7GppXF4}E&2y#?DbXG?jJmU zF1v5ey$@%c7#miHCOO=mlGT*(%3OVJu*H0pohRZxh?lUqy6`OcGSlcs0_(Tk+r;+w z9h)x0pSb2$(4+YE*?nudd$N-2+aI}EJ1kB4Y@;sS zee!Poms_@GCcCq9D!oPD+L&!hixv}HGWY4E_4P|0oqoD<>DD{Ump7W2B;SzOuIrc1 z7ZkYZxz$pS23L<_#^&X7{nJt(KQ7{#mp;wRZY`tgk;uiLwyh8>T{->qpSXI(1E*U% z1*ZA*U%%pz&AeWDdXQv+6!&%|?u&WP1HZqVw(ITBOJ81{JO3%~)$NWCHww3joNR4h z;_B|Z)`FjJbBD>L&_l}#?`+qS-OH*W^N2}S=HBj|g}0ACd9~@OZ5cyggT>CUBU2rw z?fkS(&A#vR{qu#VIF3J7^e>sXFWs_nwgbzA3$y3M76tH2&ExaSzEB$dZ^r(`JKTTD if7gHW{<*yQsh`td*m>Xmu~csVgY_aSv>#3Ve-i*zHX2s| literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/011-ICON_Speed.jpg b/buildroot/share/dwin/icons-6/011-ICON_Speed.jpg new file mode 100644 index 0000000000000000000000000000000000000000..387c166566b72257cbca8cd39c46ceee6d9653c0 GIT binary patch literal 1706 zcmaJ=c~BEq9Dd8@AaXT;%6QOaH43rGW;Y38QzJ(fN;*x2kcxELaYC}n0?DqM#RNPm z>gbdar$Y~{Iy$5(9;IXJ(Rxs^^p7gonW{b1b{uM*ibD}!B~|baApki`L!+& zTS;r(tQQNqI1Jb7Ft9i`$hq7#w18C7s~DdJy?^#RiZC7vT5h!K?3|UZVu~Ahx~$<< zr@NuXO?uGWCCK8SIq2oQwBSO5-ddmE9JHWOakCglrZE(WrU*3_G(S=mS#B>utSnC> zMs2pnjT;EWL~8MD9Z48oKnNXf!gMAK*K2gRS(k0rlgJoQu^R7LX?9RWW3|MQ1sz*d zAP~?7^jel*h2bPgVmbmN2#uJb@z?tVS5V{g&l^{uXuq3hIDuh(NJP<9$<_%LRCM}y z30`hO_L+P2M55jP|EXSYWCNnIe!)Rc`hBLb-&xPmn1lASb-bGv)8|FVoY~6LE`jBp zEL%IiizQX8!1}9L4zXGzyOx7wmNPyN8}MgEId;3*=JN|KpPRN(7F1NxGK|M;%Fi(t zWK$H8O_*@JFrU;DrUGNWo)RSrDIGP=rC4{Jm-Y$cT+bx8a7u2Z9lV@anWA}S4ecr7 zSuYY@wwamQOTmdwfdlph!5;y5eA>`Dvfn@x0jD;X#lX zZCK#x60Z;xz6rK~mERjkgkjkV{$YgSPtXwWrD5gzQDB_<61jDdYB2~y_ zii9{tTtZT!h@_-w(%2{d@#tyZ#3YnK$Qav-$lmLQ6%hHHm z6i|$q2xsKG2+2@sBU;I)=%uTZ9jVjXF7y>_Y6%%+Gr~7OJPe5jVI{}~m*mZ~+9uh2 za#>u`o_oC&^V5qmhPU1$w_TY1BDG^yXg7yD-n{TlTj5d@Zrf0z`Mdexd#XMM1eGPI zhKdbMi^yBD_8#ZI?M5oAxO-Dxme%=I+}rCMtHerV&?bM0}P9y}oMX&H>d)>yoMZmP2ForX0g zI8*(~_x9!Hixmyd=S$13wcO1)Jsd9|xl{UZWoO06-kaBMAG@;li;DDCbI&igcKp%t zPG%`uEh`HN zqquhF@_#~WuLd_(ABssR+P?XSYvkvy?Yi!cyxtF9cJ6`_4W&Dq3XZN-4~9N2ID2NW zT2;abjk6ZjH=j@)>KSaZ<_c>PuGWTnV5^#HQf1hJbMg*krcpXsvMQ@uQC#0Ut7dLf z>w?!0YVtwsp2Gtj9oQwq=Nr0L3~xQX;%rm5>ru{)JHOAbNT0L5bGN;vVVMcvmVWn9 z;M8p0ucIjo>lTC-_L2*}TT*`e)+m2t|CbK7eD?XJohQlM%l=i!_v^xA{cUSnm@g5p-J42K)2DZLXea39_swy-%8 zGAEe1FfyZKahcPNxHue%8!9R=5F+5BnF9o}ff^@~xMjw%g}LsoQgDg*`{T{?KJWAU zJ79B3V-p5ih90k!OY69E4xj1@@|Z^bZH)VoQp zfYN(72J^Xj%&0eDU~P(zcYBH{2`QioY1W4R*4%<3G-*R~O-_T8w^K#*hH`;=tvoBo zQ(o*LNHk>~veswyF+4*_Zp6owu%gvxLj&Sg*;d>biUdNWVjG&OWJR_*U5K3%D8!^s zPVg9$aKudLjmZWAPl`uygVBr`%$PAT!C3D z_3FKedQK?Bj08bo1{}lj1UVu>EMq0NFM$3PUo{j8AfS9KvtBpshN78DlF!d@f4O#iCn4Rq2%ybh0I&+0_B!CA&28i zf?aeKaS|sMaXezTD_yf7t8!_UsDaa*fxT&*pm2qHrIkSTj=-m{VA#e;5 zxVDv^y%zJVdQ)6-_F62naxu9WOnKZV9y{ogCrB};M_1lV4?o4q6EDc4?Y|Eq0s{-k zR{0A-{vq%#fTp36EtN`M<>fJ86)Zzu)Cyot0HF%PrlHW~XblW&LN#j56DQLl&o=z6 zKpO@kK_m=mfl3R(TFBo4Dgc0?neQ)KVc~N^A=&wVZ%C*nYykivkV*}Q2ag~Xtk#5t zf-r65!tkhM%W^x}5xpqGOnj^bkWwnF2}(m+6<8h#t5Y>0#)VNR9-5Z8BKk%DAebko zS7~7_NC5};R5i8rPfGfT=8}QQ+RJaKNY#bn$v@h2(pDOlzSO4~YF{BNSu|4D5Vf`a zN;e9YwcdQxHnjJhyPanb{BmYu!$eF+xCu_hUrqbB= z&!4Z^(*45HYlSBlGG2%&KBfHHOs}?pU_0H^0YK-*TvW^N$C6 zL4AKuwhxceqEja$@nYc4b!&o&0bCRaE7k)xs#j6 ze#$#Fa(wBf?lbH$q2XBPz0dBB9n9K(I7+>LfiK&Viw=IXtKqx9&gh4uu6O5{U31^B zwvlAjd&IpvdgyY~*IkS5%x(N3nK;$t8(zO{&fc~ICezWl=Ja0D%R_~HCrd5;?RM2zZgSKPi> fU*Y@vVs3BC^53`X91F_*pz<72wdR_-!hhpG8+8u9 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/013-ICON_Back.jpg b/buildroot/share/dwin/icons-6/013-ICON_Back.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7ffb646b396ecf6e564ca4f1a79c5a40a82a86fe GIT binary patch literal 1594 zcmex=+JW@c$vRenv@2ft9{~ zUa?+cN`6wRUUGh}ennz|zM-ChK7);YML}Y6c4~=2Qfhi;o~_dR-TRdkGE;1o!cBb* zd<&dYGcrA@ic*8C{6dnevXd=Sl&_Q3Q(W~w5=#5%__*n4QdyVXR8GDRC#&1Ub(Seeo?xG?WUP)qwZeFo6%mkOz;^d;tf|AVqJOz-6iAnjTCALaHmqNUdTL3o}Ygi#E^!3HB zG&dI%0AOQ_OM+4n?!{_waY$uBs(w&vaeir0aw<@{GDvfQm2**QVo82cNPd0}EEEGW z@=NlIGx7@*oSi|TW}%=Fo|%`DUtX*U*5m7I<(XGpl9-pA>gi&u1T;l2Gc(1?(8So( z(ZbQ($k@Qr(9qS<$ms$-v1Krq?AuximL5uLPzy1)F|+YBuXjBvmNWHB)TNgx3M%uLKc03=vIfSDBx z*g=2;4nW$0s#%$tS=m`xSdnDlO7JuOA7BvVU=U#tVP+I$U=n0x7G(T?grN!OK2}8b z2eLRBSlQUQ7#SIuffxy}uyU}m3otOSu&}Z)F~g)7nV4BbSlKuPg@i@f8I;606~zr5 z1C0e47=a#QVdjJxz{nuTB*enXEUai4DC(GKG;yI)lCg*iJIDW93_L*7m;{*x8SEL( z#?gXj~xMZ5O0=7yCYH~kuI_r!H}$F$nupfA<08hhHJxY$DdQUyHD^D#GR z%zjcT;=$u$qOHZW_wme`Dtp?U&t*uSS}MF;WA3T@Ua=C5AJkZuajFzD9RJ)NtZ(>T z?9%cup~jaAj^9_!ajQD6xO`{!YTk&_mX`KyDy>4Vq_#yr`#SS&aYLT^g`*#T{jT*t z`6KSp+C#T2TbDFVNt%^&BfLoLPPKVp=4Gco$!C@4QqwXyI{S(xPZnxk(Nb{`Tl<~y z@O6G)+sD>3w>sM|P*+eX`PlPv&%@iQJb?<9S?)fm$6ZrC9$BTbLB>A*;N__OyFT31 zkmdgEWU}Cd=#^Utoj*=_45TmQ;>^#0|e)xXM5ZfBQMm)+%XR%zRdj^52Vg*%?Ny}QtS Zt>gH1Z@aoPcZ;%D`@{RvXPKC1X&U!UrsGny z%v7v`3steBR2ZjK8L(1H6{*W$(JFOCs)*Z+ML}ze3zhT*0sSF|i<7UL6 zwIV{k00Gep99FHq03$g%EZ<~N@CIAkcpQ^K!CM-s5ooLln9-C}YQq+new3jvEzrvi zyah3wXb0*rTg@1$%@mUG6yqq5lyd1$&aaV!_LQ}D(vRa{)m zFBbE0TRtL`%jJkbgos2DR73<(Vj;DT2n!KBuAsySz0G7LO}K^QQq<~jJE`DNmA<}$ z**YQn&R)G0sL{MX)NFP&U{sbM)3G=8zEhaUD6wKlI!54jn;xUWgI#1Rnqb4UByP*V z@xt*grWtV(Cycn2laS!*S`;UIsmWr%i-|d-9E}E5TL@BX(PL_*f=8+FO(p{>6f2{o ziLykISRfY)RdG==dAv#~j#8#C6A;-Cf32u~NQm$(p%vLJ160@0B zVunN;Zsv?$8#PT{i*i!EF|J|KT4bt8xd>GZ;(FY-9(&wHO_0l+7+q>JG5nZ?ns^&E z+RgzmZFFFP;W+h$AZHIK1JDF$ltrUaE491^OoJ&<3*7~nF$#AVm=kc(sb~faGu#<; z##<*7A@4Vw#{r88{D2<}u>g$)!7Rvm64ZU z&ZN^kp|L|6%z)@_?tsPi_45y4a(RJ4y5P;C^tGzcx-et;l<6!0=v2v5eBdz#L}SB% z<;$h}33&{Ex41R&mHJvkKc;sW3#<3bVihaF4&_ zR5@FpZ_sS%R@2W0jqrDPT|0dQqkkmvPWzme+e?Jct(56_p`=dJdN%DYdXw({x} z?hFq$)FA7tXs!>>A=!VJ=(_uolcm^N7YbjhN*srbdL7p!; z*spBumOA8GybVr|3G zmW9DX#Kup5b%Jk$w-0x>FG=d>Z}~p&bHxK`?d;r3GdsQZiyDPNGi%Q^uWLEl+?l!K zr>n`UGIjPj{hwLwO+|LaUr^G%n%g1CO&=cE752yym_?g++tib|IDUO{W@W~`dA3td z(Aieeo1I?ry!Y0zgOX#t^-qi7XTz<%W%jz^6ZMTX$b;jCo3E~J{8F)}|5^L#)VsXx d>uWxc$7EPmd0yTf5O^^&b@{=+Tf3ay{{#JPWHkT) literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/015-ICON_PrintTime.jpg b/buildroot/share/dwin/icons-6/015-ICON_PrintTime.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9b7bfdbaf124e081e4f9a8f6bf59ea2bef1017c5 GIT binary patch literal 1759 zcmaJ=Yfuwc6uz4fL9C7m@@NXWEI36p*=!I(R-+RMp{T)tAck6}d90GgWY^6?0<^R< zYOPeAfM8okiy}%b)fpaY1&fa=QXGGX)+ac%)tLf@=?fAT>1>1c29YKLUJJp3zbOAmGQka{zGP=c2g`L*XcDvy1g6(m;rf zq!o4QDHIb+P_S^ZlhPY41Opq0^=6v_dE9&kfz2ibk{z#+Xs9G2*Zf`~O{^?T%QO~R zjB*pQcoDqNi94;7m0gpur5?@2?i9%Ar5p~2 z*byft>Gdckm&;L!6qQOvY=p>OU}N-7krn@cjJJ(r~5q$E$*65*I^v&}?0>~p*vjRsG(*%`gfNTjM12&*DCn@u<-!Q?U- zrk2J@yijIiE18 zY0?UNuZ^20u0=JW-YC~JVJ%qlgj|#@2K7AdxW^uIu@mGmeWS~6e8W%J*omjv(RTNP zY2JYarnBr9g4}n(W&ruXVJ!}aUD@RoxEwAEcJcFo%k#qDg8&~qbT*pD}Gse5|?pbNIf5kh#xX(1=CX{6Wq3;rvUJhs!#;@Zx6OH|mDC zSX0UuHx6}HU2My0*{q}&gx4$+pP1W~Tq3+x*?CP+mJ(W89UVMtmh0W+@xe>l17~LJ zKrb)+$+AD;`HfX&<@K|E{d7-6Q?cSlr1+WRWzo5RqeR1kG$^Z~Mt1x!s=v1(|K6S# zb97U(nL5qiGj2Z$eo?r$_1?il+f52~R}KJfDN~Ho3C8s;%mmTbt4w ziIi=9eVq>uSL~e9$ES-{YQ9=Mq@284I3n0mSt+om#cnZNz0zZjZECEs9XwpQ`k1y+ ze6lq)wS&QW462*PR$26bYmoD0v--E{imAfBXpZW+Ybx*e{`B+KCrI8-c?3_FSGTrj zUfQ4koV`_DUY2-zMEG%eb|)K8wkpyNt>`_o;c=!E>z6zo zP!ybpMv|h29icr>PQR?ZGt7(>oEoy+wC!6|UUj;vJyCORvvT95@DFQ6X>;!!FNp~I oI{bRsv6Pt7+Gs%~?21`FqavrheHv1NUWV(0F%d0++3wr_0ix|k2LJ#7 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/016-ICON_RemainTime.jpg b/buildroot/share/dwin/icons-6/016-ICON_RemainTime.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ad958d31af678b6f903d3f23d75a2e4340494f62 GIT binary patch literal 1703 zcmaJ=eNYr-7=Q2fPO!9GDCR=4WzkgNZg1~Sj$Q9$;J&0d6Qgi6nK|wjS>bNi+eHri zXmSck1RN(!!?G;1XSrWs1oW|v0vMG(5 z@nQiNi{TnA224o-*5%HlcqE%zO8d;{-Nv6$g!Y)x%vnyYleJK}^xR@U^>*>R40my! zoA97Xa}ZO240u^D#k-JzH{ZvR0W%sjC&gGwV<-}&@Ofr5S*nUGbk0XCjGsbgX%f_K z+@M2@ga%L05;{XXqSN9=Ol!n&y;_Tt+5}QhAcH`~YJN`+xxi{4tR?Qu=-{CW3kx-c zdJW@Wis1x7U|Jof)2T&Mt*=cZDvW>j?1(6oot+AS76k!;oJ zwFHjak_o%fX2Fd{tHollTI_})t(9>Xcqt!0r1gwwZDVSsaqzNYWh>>US5O|ipYbBW zW0UmQy`+rkH>mZD-HT;REhaXDNk4bg&mKyN6C{PhqbqKPhoAC^6Ym#CTet&W2o5ap z92K9COy~d~0@*O+VkDP~tGGM?B!@(Zi$VgV3?f8A=rAO?$W}s-GDN9Rj`}i8d3GQi z1#l=(0Tm>JfgF}WuuM1(d;mZ)*~t3`AS86W;yEz|jZOlf7#A`L$P`k;&=4Pz$rZ|R zA#i9|IEY4HdU-r7GGxk8QW=2dkRlonQ;tjj;49%Wm>`PfFa(1n(DilHj_ObTFeJ9n zZu!ZW>IemtRyAdUeTu8&)e6&AMzz+!oy$rgB3rM&_g!htz4ZgjuDt(!zrJo|JB2&2WOR8GJ0((Gs_P4({%ek zMTrmpJYHM-DU}`}fci_H>!06vZ9r2uwU(}{X{_sgFgMb~s7@|+U&@)y3bvDyR{zj6b2M=ah_>%b@9vNsUcc}0(w-~TD?zIIRf z@~|IR?{@z!0o26w{r7EsO+(YZfr&iKZhoBFJw*c@sXt?I++Lbqb%oa-A;a^JA#b%+ zN9l=n_W_A(1X&rp96fHk%ui)txuB1IMQ&G` z)|Pf2#IHG~Uq)khHN`i!$F-V0H&>r@?yo;lcXeg>vW~W_6?^z|rjlRYIn-bEAo1$d aO$W+!25#%`mFmdyXcN3`N35Ytxb#1b-!%UK literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/017-ICON_Setup_0.jpg b/buildroot/share/dwin/icons-6/017-ICON_Setup_0.jpg new file mode 100644 index 0000000000000000000000000000000000000000..92fdc079c6198aba12abc9c8fd95a32a77fb2fb9 GIT binary patch literal 3990 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 ULbl8Khxh3JJWl_QMhk!Fzx3csf&c&j literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/018-ICON_Setup_1.jpg b/buildroot/share/dwin/icons-6/018-ICON_Setup_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6c6793452182947a859ec71fc2fee5530610261a GIT binary patch literal 3981 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 M`Hq)$ literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/019-ICON_Pause_0.jpg b/buildroot/share/dwin/icons-6/019-ICON_Pause_0.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2f6e83110965fd56b0366cbed7c0a52524a60922 GIT binary patch literal 3592 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 E1+kvgZ2$lO literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/022-ICON_Continue_1.jpg b/buildroot/share/dwin/icons-6/022-ICON_Continue_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4c8c78f38fa3e075cf2b9d40e24fe310bfbda200 GIT binary patch literal 3656 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 Wzu5zx?*TTu_cFIHz4)H8H}-#Hi`xwV literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/026-ICON_More.jpg b/buildroot/share/dwin/icons-6/026-ICON_More.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6ee088a7f221e94c265d3d1524b7c1ab6f8e5df6 GIT binary patch literal 1612 zcmaJ=drVVT7(chSFE(@(S{_?6FBcOY(%#-aX+vpR3Zc_3%0po>nSESrE$zMBUZmi3 z%*`+t-@Lzl z$eg4P3)(3Rm&q}ZZwyj)rQaoLY-5Jp7L)F*U z%j%Ufl3t79I-L%aD=>vZ$}*&Z20vpDO8tS1n1h7~IB5^Xct}4IakM+gI>vyqojy2% zkD9T4=v~br+H8-e`h1ZKh}s62Qew8>hZ+aU8z=%RB?4p}?Ic)wMnp{M3u(g6kaRgo z*2HdcxtnCjfSaU{!otX{WGYgsv=*(xY{o4yt%Y>f`3OG~)4FE0nt8R6aqv-WWeY)j))TH` zn)D&jW9vQh_oAHFZ(8e`zZccKT8wQ5i~QUw5XS z!Ov}-3EST-FA@|dC-(NA-c{iMIsEfxi)t$;weR4bi#yhoWezsg-c$4M_gGK$NtOuO zpm+YbnSZ*oeMomWaOVE@SrOPAek8U|ziG?0s$aWXjaOP`~^2fzA&)v<6M`!PQ%*mdJXH zEj>g{cYn$+X|nG2k8UMe`?9dj|8j4HPTsk`p?S++M@q&e)K9+R^?jP1*IvXo9$9?+ zjZ>|ap@N%dlfIFR?Brg4Z^KiW;!oN~L)a6yUpO&t{BzIOe@mNx`|4u;rY%>Pu>pTv r)oa@hRJ%T1Ak&ofGCPi~9I4y7x3<*!?PvT0#gl6$5~_~(gopnFUE%Vm literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/027-ICON_Axis.jpg b/buildroot/share/dwin/icons-6/027-ICON_Axis.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2eb19a0011eeae5d2ecd293d50724b966d81bcc7 GIT binary patch literal 1905 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 H);s?LiaLdi literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/031-ICON_PLAPreheat.jpg b/buildroot/share/dwin/icons-6/031-ICON_PLAPreheat.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7b8eb5857d6ca93ed643c2d66942c6b731ada656 GIT binary patch literal 1745 zcmaJ=eM}Q)9DdttX+?Av5u5{eT+x8oUazGsSFNtC2xN3d(ZRy ze((GKUjNVj0Wd$q=XL>Lu`B^%FbV%3Kw_?Rlve{D5OB-u0Pqh$Xc^1WIu!LVa+{N~ z6LJSdqCOjqVsZrvmZ$k>o1>gyVLMUk_UMr(-=0HYw^NT4s;vquolcawSJrrmH8nW} zj+$}@?nKg7z{`C)A4!u0YlD5{W)GwD>5-thj*A1!C;|s5Y`GpW2C~9M);u_!@)EFG zu8}#g6eX<1<(Ni+D^r%jN(H7x64bxsU>sgI&AKTM9B{PRsY+IlaFxE= z0!fE#Uwc+lh*s;HsU#UVfS@hIt|lhyeXTK5P)!r)YJ#CEy$*t-O9NtBm+mEOEafer zsLd0nm{&%z6jMggaC&;+)KcNZLbu0BRWV6Hjn%5Nco^2^aS#@>9^qW%ZnsmHp)i|O z%2bU~tx;iEhS6v=nayh4sK~^W=9G-o39XrORFZ^;ozOZbwc2U5fp#EiF0+~Ny0;L{ zOfN;k!ENi@)7O$Rt>3uTIejhaX|*U<3>vuHDVII5#C1?047Dyd2{k|A;X2;SwYL8; zm>q0b;5^SgA)fyZXaKwr_*}&2b0asr0>pYGak3n+Z_M+ zN6i~A3`pAYGp+Yq2NPC3-g_80c)1O?>M<(0f(`G~K3^8yV9W+{S{^@p`d{~#ku_1- zpW{d0%Zpm1N-8YwT5pKW27ku&&MP~4{e9`Om<5I<_SS};VPdPny8W$d`*WK1#tvuC zc)l-58s6w4o-03Ajtw1dv&>rMsZ0DMday8YYkm7Zdx;?jmvq+6&+X5B+I73QC+_8D zGNS9n*vr#@A6x8lt(9eEF7>6Q9)HoX|7Oc?-?&DPyFcv87$~A1o>_S3?!q|DLg}Mb z<@?MZoI>=M->JJ=_jPMn$!D>(56;Cpar{o=kCWwfeVNKYP+=lCl~E&Hx(I1 znwn2qcda~_gyp-Ait-y2N4;QH>-WQJ$SuRL^d6>fGTz_RfsZA}#Q;4NymeA04`r^!O zBZ=#Jk32eiX7^1-w~et}6`ntRFZRY&&setPRy`cZk>iQ-** zwtw-vA8a^t&ksyb#x4zBjXBjk(sEa;*l{;^F?k{ad%B@`aBP28^X2ZZHV&(AP*6lq UR)^}l>;IlL+Qmza@A_~54~lRyX#fBK literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/032-ICON_ABSPreheat.jpg b/buildroot/share/dwin/icons-6/032-ICON_ABSPreheat.jpg new file mode 100644 index 0000000000000000000000000000000000000000..274604d2f92b46cc581a629b4d4cd8e9a6e2212e GIT binary patch literal 1743 zcmaJ=Yfuwc6u#NbhWHpY^6*h>mrX^mB)fSLvJxedM59JYKxh%`g$C^g##Qq=7m!xHvAY(x(_-C+^85W# zze37*3vii6qrnL|E|*IpH=AKf zdTueZkYO2LA>%tONwaBX42&Lu{O7ZGU>G#=OT5voTPzBNzutP zM!70QA(I(&I-^Qq)T!l4gW6zJr^+IF)h<>%&&qV^^fPp-~DWX#&0g?y=^Hpy2?Hj+bHl7=cBO#OiDdx5q`@ zvu2G5HG{z%4-&y5Fd1CSuiw20{de!-$N3dR4wKuwr#-WN%szzn&e(%pom-QWxMR0g zYT34`Xu$n01ge=?F-ZDp`BSm5ZP*~!l_$i>9Jcy^GV9sI8OIiun3wJui_AW_jb2jI zLTHyObJh;uIciMo^7xZ)VoIGAyOWHKSsEW>OFUOnQI}xPtP51uEFUZe7@U^!m#4RcRkfhKj5SV&3|7gQghLor3iT((z%zW%X$dw~t%s%Ic1!TFQ^8 zYp#!*b@o>Csx9M(KHl{GvekG0q~BOupduHo`01~8hK3(6cBPhuz?7TXBl!<4zOn?( z<>=8}_gznZf9=+#mX-@_2voJS*>6nUslRdggQ+X8cEI!BJD;0YSFip2vrVt3%~Quh z%7dopL&dsxHdY11!VP7Qj5YH{7X&L>6|L>?>gFf@&eKgf$;NjLr##Icj(=<0uCeCpmN}JMiW&^xY>0bcZ0yKu`f$heKdkBG<{b&^X1{+{MCm(%i9^P% z-tM1utKFwa-+PP(V(rbmaWhYBOcc~6CDme*!RU7Ww_WjV&%Ss#X$fAr>ywY_${R0Q zN2pSRaT}0$)0+LJfnS1Hs01RmJX?PW-(P*Epz-e^7pm0s(cAOw=Nf9;qZN52TUX6T z8kbt{1rAJ|duZadig{#yQ=4VqKUothPk+a#_9bq9>i0e(V-v`)ADD}fpR=noJ4-vi TIyEW;ib#A~vJNR1hkpAHdSxuI literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/033-ICON_Cool.jpg b/buildroot/share/dwin/icons-6/033-ICON_Cool.jpg new file mode 100644 index 0000000000000000000000000000000000000000..014e6f5dcbabcbee31662d8ed1f2f728c81f318a GIT binary patch literal 1843 zcmaJ=Yfuwc6u!ykh3^0gma6N5R;^@{Kmth#7?aRO3?&eh`p#pKfXT*9cslh}s*b3| zT3!`##4=PtVZb^vicsZYMJyGi8lfFjusRB31;N*(8w9j7;`iguxo5xcJLld#*KyO) z2|N`k##jK9$_0Q0-oo(+u;q#Rgj7HQG%~#c07oZ;#@TEZF^Zb49IXM@VH`bfLQ}LB zl*i$sASfioqSYs0Hdu$PH<~3#@7WpzHX0ZJ7L^vR(WfQoMFu1! z7!FDirPG8dDvGmRqf5XF`tL8Q*AaEvMfmf-{j3phewJrrUkLNLya1FNfb#r&xjZpfDE1S@4D(PA^=X4vVd)!~UY2|{-I<_IRs zsO@|2>K&p=^Xi=VG9B#v{akvGR$(*+q2+vz?G#l__>--^&N+njBtv0P$k16F6gmmE;jRvtiR3Y^j z@Iv_lp&yT@kOl_w{T1>6nKY0qk_C#mBU(AGPc&g>+lbaMs^xRX)H=t(WFafdF~XRH z8A1u%1P>isY#h56`IvsgTEm#V@DyWeQL-7-`E%d-*&``(f}G*#=#rb!;m6G6#1rIb zJ9@yRp@9X4TJi}|9JfI_pp1e_MpP=flFJ)FREPw*(42tiLtr|=8ii9%vgr^+XVPi( zcfO2LJ{&k|0hv!E_n+V^gTE z5Dm=cxw%UbIzz41O`XQvzc|ucruW%+gulJQ@4y^|hrm1FAJa)GFNIk|zF9oZC|k$-vJy@<5pj4O1(ik*dSDyUOd_bSRXQ>lXz7POpM zT9SM}d`VGO?N7@pR_?#W&)6TcheKbrLqO!K86NGY)#pl|dhKrRwx9PBZ<_UKRK!Pp zKR)=mEmys7x+*)f{f1_3o$E6@zm-*KjgNb5k8PgwXnRg;K@wiy?ADxHdnO)6 z&sldCh1`W+ce4^p!g!}n475~vYJ3)V)wtWY=DUA&siUN^zwC_XK~v_@0SispI3ak~ zK;&Z2E?7v?sG z>kuE0!Z3N&Ng7o>b=;b5E)^a3CNsMC%~&4sOKF-ix668zRU&BGWZwvjmLTm#iz@Uj z@|=f956rse642V6{pae{`oHpG^XfX*5##qXX=3hNT2NC~(NQ2?_+oAYvS`x$)*bL; z=A^TwtqC(I-zvSn4rG__Nh>RFU_9(qNI%Z2YKal9G3FPebuj~brMo-pqoaG!?I(LN z+xn_4jny5h_UCCaZqJC$U3k2Hu%Iorw=%Jk_?&!0)66n?K;P}fhfBSn zF5%(+BiC1*z7}xv;L^c;VRxQyYC9Jq`7A4>Z_1%tMfKi)Jh-x!Ke6{zkIkO(iodxc zD8Tv@JgQGFd^zrXr}g5KUcY~TKY)pbbJ73+ literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/034-ICON_Language.jpg b/buildroot/share/dwin/icons-6/034-ICON_Language.jpg new file mode 100644 index 0000000000000000000000000000000000000000..055b4c1ae8e6bd17d5cee0c393dcf8f297fc669c GIT binary patch literal 1960 zcmaJ=c~BEq7=Oto1U!%+mx7&jK|FwL4oFCbfH?>t#?lx;Y#j~B8dgX)WCIC~XthqQ zf~^N2h@w^<0d>??#CjBkqKK$?jDvN?)}!hO74V{3G2I}boe_V3ym{|?-|zPw?|aU6 z=N%9b@4y!Ukd!nHxP$j_b^^9CSD%#+Xn;YP=Ki${EUkV?mR@W? z;$q<#hs0sBm@u0Tc9^owq{Jab`o$&G-epD+xZlN=B}HVesPJ5M3alWk7#zhBM(BBw zd{`vr@Pu43KQbKVb9o|^D?)jK2rf^;6-oqRcmN0$&1zUA(I`~|v8a<287Rtbw{z?Q z4q-K-Jh51ea``BqA3=FUkojht&JkfIg9jCq7^%1778_2OVV9yVgUGc>5h~MnC73Kj zvLEf$2aam>r(I1ZR|EQGNt*_HpYKP7No~FbLp2yl2Qc4j@g@fY;iJYfYL<)E^ zew0Ya`@wR-eF!c(<;{d3CX2~nesDA7 z^68E9G+?^}AK(Mg*nrNaL2R1yH?SE1Iz)T_{{djR)7?BqP|*PNe>22%^P;L5!GPS{ z2Cv*`Y`QlzmcjI8`S|&}gW!OPGDHyKq2p)#Sd6JAk7ENs@gOE+hJs=jH0rlvmrK!0}oTXZvQE~I{nrR#!6w~ zBF?nnj%bhZg-!Rq<|E=x?Q_MtaGj>;tYUX+vSNJ|ykSIji`;ikqN>0?hujrilJ_LN zF(-)I9e>oP?Z}mF5B%rjqCFBJSu;7xW6e5wPV3Zjm&&mVkFudrlVYj^yG}apt@&=N zeV_j^>8ec66WL+-Maf#`=}`^E$yxq^$sw8L_C8qmrN+DOGO;NvIk^3A%Z(?MXGYq{1Cj(~La_1Yno|=x zPEM<2g%xDQ^z_{Byqa6fo&R>FWNdT&zMGquiP|?gZsZmGdf*k|vmvdwZMoOFg#1!v z#eT+dzZRqA30mjgmS9x*FCgwzq#GA@O{9CLUUS@dnr>@B5EAleUA=Jb)iXyDi*6n< zw-$!1J&(xu&zz8dW!~-%?=je(+p%`l{if3R9kF@{1iq~Ze{=M)RHV+*#5;DIgI@KR z^T+9Xa}qiQzS`!1TVnW^Qp3ikgd9DN&%$f8UiRj-vDyt)-AOqOH~mmrh$U(@gj ze#!KU+IrsP@9~q{w|0cxCSP{5cD!yV*)r`|(8MN{q2h37ZSua?i+3!pzT5Lvl)dI( z(VhC|Y4V5di%ST2{l zsg|}QcMli$?(EG|2aTRYQ%+5{Ruvt~Sem`Y2^^2pp7t5yx&%qxPEh_=LA____Rhe) e=MFq;YW$aBRHp(UmHGoJn1sy=Xp$^NdJZ4}GVcBi09!8!R$-V<0K-}XORhvy5S9Yfz(%2#YZ4^;!1t*XT zh45LNU^br{I1l2oIUz7R1m^IVY>t2(Ea35>G0^dBdS$90UJ^Z)3%?2JV@+jeXS1?- zEL5KcbNGBd%;v&eE)$Pn8gjIl+{n}#7~={O#Guftb(k8}LUu)Y3Yvup>3F5DTF~ew zWZyWe*8*j-w})yp_5qB_8nAd|vfeie8xnJL2po?X&@8B|JWRoGU>USsFx(jdPWg+@LAB_I1$c@XQiKuU>;F zqxGl;8f{ykp1Kz9lzL-a<Cq%H_1RDWi0z}**67ds1UV%g;;lK~F9VE&q9POY^z)r`bDI^lbkwT`t z_GKdE?S`!p(5S!#xR3}mK%@~!G=l9c*a85NM3{X40FbC;2d8O-|GS9}cw)kP0Fdz# zNMzC&g-9Y(XtSIh90@K|;N`m5%|k@zGQ8cL@Eio9y&I>oNCJ^Iiv+x!$s7^IK~5LD ziHkNvg)Wd_jq@Q7H&+bOr#`0?x~Oy)K0F-6E}KCU#^d9e!lRYqI#vrbz$YN zOAct&8CMI3e|%D&<}EGVRn1i7N(#^U|04aS$n^R2J>s&1M6QEMaXi1_(aSBa$7ore z?b9{{t&2ZIoNcA;qw9o>hK$=G&iZoAn)a?U&F9{K(UiC3D~1n}E7I?-G(R0W=~%mW zZsBCuFWz5GGjM#ara|LGUPLRTLPT9lObwF0$)i!GL&x^k%I@8-JmcL+nzrdczp z29o^6?%BR;AKmXcb?@;!^_Fxbciw^Ie7)PIg`J37NuKi$ad%oe!#AsjOf&i`u}kpJ z(Y0N!yRTAW=UO(j^A2r3Tt=lpXScQvUDsFzhyP06w6ZDSh^Lv@y*n6xSg*(YBd)xmvoq_L+BD;SGd5^UKZn0;L(!loC17e zL=NlCTfL$Vx0PXcE!I6JntK*qn_bN;+Cfz=`K}>0k-D#==$)K{Uf<6gO4j^2u*vU4 zO~S&?w&gJeo9}Z{EAo!T-fA)5FMZCifxt|(HDY%}+XG=?-Of|@MsmMwYVD|~{wH(z zr{80SSC5Pw`SPkMtuvW3bXRONoi6qX=<^JRgXfP(ul-i=VnMA&_3x^Z;fif1Uwkqr z|Kj!s3+itBKJNTtV^(+E-ukw|xe>MOC;f~YYYXN3KP~r9UH71McF#kIFED*3N0@g}> z;iyb2R$IrZmWs6M6xu=2suZn^4;;~0G@~$$2#AU(R?`jga601ml|Xn;YbQvh(vI@nN-0t5`b79n|`Du`@IVQfrR1tyUExo3OJFr_Mqnvl#xsZ{ zVmMUJ7s-Tjv1AS`7K%az!cc)IgeMd!gfc~l93BLh>Si{kE8;cLgT1Jok~?^)yu3Vq zUI-sIuM&vla=Ab#7Kp_>s)A?9$4I@EhgkxL6f}s%U`7cN#WC2Ws87RlNF|qY`t}GW zVp#UQclA!8PWRzblgV`f1F{w}9vSibUSUgOK7k105euGUHXu}apo>f>)Mi9a;^ssg zUp;h-OEPd0w`AZ1tX8{jZ7w`(8HyS4JWKEZN2gQ7Vir=58IV|wl1r)ZQPil=L`4as zR5GntDhm;bv?`TWCZ4O(ie=i6xhi#tc8IIN4LK$RBZs)g5pMLTT-P|52&%INF{8PN zG1`oq;DKW+(9yl9N7WnT8b|k{8I>!b%m`dR_nn_Tl%gic6%LOswHY3M1fwS2OpUg) z3ydEaSYWKDo)FDx10{eq3_2Cj>C{RsZvoLE3e>`I0b&k-B13-spBkvyo))=N6do1n$X{H+;Vlg}bU@#~T z5Oa`1hZsy6$J5Qrdx8%O1h4~r$B4LoDshw~hy!R4jYTQw_IIoeXT)hmZ0Bv@PWhm7AP$HG_UDb&Rd1s6Co%V2Fxbkb`yVC0SU~=Hwalab z{Osn+iJBQO#~Tie6T&41wq}L>X5O?5H~)_C-pegDLtsnNf?%eQ*R_jwbv99s@}70XCi~0;EKC_ z*7e+`Jtt#4$0@c}E;s<@6i-{^X)E1ZSnKobLhI#U-^8yA?@~+l6VKziFKwE{t3Bb~ z#UyXU9MPKhqi^b__xtr?P0KPJ$NEcuXuaKVDf9EJ8}Lk9hZb8QKW|>XdrorCSLIlf z7iw%<$46tb?^aA{Ob&%l-Tr8Se@Rtm?#|-LJ2s$Qay1h2F?4cF>Eh zCsXc7_47QRE32%2j>37ND}8ES{=!EiJlfFfcv$qI_4m-apJsw5Df2JJWjtwz3eOdt zJGG>H{Y1}~z7JSateUc|$L?P$esS&Y{Z@8r{o^P7w(Q#9!hJ779u@nO`AcfgOV1GU zv4NY*HV1!sb|dV*F%s{rOlZL}>!MpZsoM^JdaYjJ%h=r_2@8AJ$D5thXG^Z;o} zJy~W+jnfgL)4o1!=HTYZ(s9cp)>Ur*`i5xHU+vkV?4MVq2CdIYsCd=1Hn1bYk`R>i zu(m39O{c@*I8ek5YAl+;-p30tVWzdm(laMjdi|@LDLrCHnAY*2F6B_uny;K zd9><|pgb;NWydt}YhFyC?Vo*CNAJ#<-sML#9<0ng-r3rP=@z;dMBH!gAu=~w{mXkQ zemr>MOv~>43Uf?tIO@FhAEE1f AEC2ui literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/037-ICON_MoveZ.jpg b/buildroot/share/dwin/icons-6/037-ICON_MoveZ.jpg new file mode 100644 index 0000000000000000000000000000000000000000..487d6e4e4436a05c8931814f6bdd217184f40968 GIT binary patch literal 1820 zcmaJ=Yfuwc6uz5HNbofTQLBPoqYN+e4k1|y8WI>$6M0!$?WiGHAV9KfvPb}H$4W;l zVig&r;wToaq86)Ds8fVu6<<`T777v_Q4tX}Djm_PkZzENoe{qucg{WceBU|u+;g3+ z&fDOl2%9kpfT*ZIzyc$1J_2lYhCVF|K!8rUmjU3s4f9h-l0f-PSeW` zoOxkLs13E52opx?5SuC8Y(;Gf&VV>d*)BJqgA9a_X$p?gl@<9^6OE{F3x)*qq+GpF zB0@ssJfTz|7fI$IB7rc3F9_ia#aw|96-ZIB92o?M%4RVnp|R@7!Ccf%!5O?%W@aWY zQ_RCH$$X()F6RqGe36JtMR2WIW>RP4nys^j6x5hiZ!r?25jP_)MO`AEK`J;@rEjlb zB8Fw(+pBj1HJT5HnoO<+49Hr^SZt);_X=C%vj~hIi&^muiyouGXSv7(sAax2E6(qEflKCPVxajAjF#X$=_QXf$Y)*-GlndMrw<;7}?&qtSq>!zChB zh)N&|mWqYK2&F7oEsTg%%cZgirC2Tz4RO`DKEs5W$sw*`gex4C>lz0WL1k8B7ULSs z5NW|p$iTHx9# z2sD_^aD&*M6TK!)X0iZhmTtED6gGfh8r=<|!-KLAo8}4A!A#CXp)$scQWA+JlXR=Y zoo!$om7B(f*X=@4_3;I;&Y&8|vJC~#gk#a^%`}d5+_U+zZB{H6Ve4+pR{rtKf$?`E7-hcKM zm3_`O79HIL9@yv}r3KcrH9ax;GdBj6r>;!wE^K`HWV7+|o8OCc(AN1UF9huQJCGQc zAGhs_cFUn_xm(HjQ%&yn&B0K8xm(gnx5-4F&kP0mtNmQdsRJ*HyVIE^@R^H5*V6U- zZX77^6s&(N&9Ci|%z3zOZb^&-_bZz0cKqh@@+;i-uCM7dVWtxt^Ol`H?OoF3s0ezn zrKF;+!{2&$W2(V?O&hmMnXq{GGS9H+;=J>|vg&Q6FB7wid>xvFM5E*%cWLpe($q!G zZ}RK=T7N$JVrf}48tZ#Ca))3Et*Ib4+M}b4rr6tJn#0X$Se9P4dO?+M{`jI&=?!L6 z%hBk=vLjY-H!z`o!#By5c5{FFFBdBUTm7CT{oCSQrFEO3zI$=*5m_6Jt xQ~#x9>Y|>E)3G@y+wb7mu(>B3Q)}e@xwofUUT0(H#La(&2K6V0#yoRg{}1V&YO4SM literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/038-ICON_Extruder.jpg b/buildroot/share/dwin/icons-6/038-ICON_Extruder.jpg new file mode 100644 index 0000000000000000000000000000000000000000..155b9a58576d83b82bce168280b0872d4c294d41 GIT binary patch literal 1692 zcmaJ=c~BE)6#tUVLF6(JJjQETJX#CcY`DzUR6`bOlsHP_Sw|=CE@TI?8+I2GXlnd@x))Pj9LOO%j>Wk3cLQg|5v!CnY;i=r1tQC85qC~hOI zCpi!5cX?4vZ$QEP1%9uKETlzvBVE9-X5@C`83bl1GqNh(Zm@f;w3}H}&eM+arB1TE zkTg-qg4f{re%$ZzdT7xF`#nXhfcwozm>ieRp)iWT;S{mZj95Zd;nntKu$AL!I9;ES zLSkt~IMbxZG7KhTS~6@jV40{P6U9a?6z*9}|kRehvp32Abh@7EXl4nMSn)3O4 zdS9xZ;|oyCWHO-!BWg6JNEs(+QJ>NVjGi z31cRPWm_!sa-(#G@BY6ts4On6}d z)ht~hS+EmS0{MtR(g{*XPe`FugiNVYhE1hXt0UBEl}0meoJJG%yvZO4QYw@hl}ZyG zsfmn^jgc%iHk>r{ihAljj~nrV%|IIgbU+8mv_P(vL0VbxoFoj$A=&8t2SBA(C?hm7 zNig(m7*fg8yk|fBrkQOWey#w)3O-J|ks8`}o^Tdwt?qCkP z&ZcQwLq|DVa~mS|Uz1l_+c&q?K0Z82_wR;|0?@@Ww>s0aHuu^3z{&l}hT10clkThM z(YrVL9yPZYCr>$4Z?D!}oxJzQX^y(wH;(;Xe|h(NTWf0bDv7sAH2ISGokOL6?!74c zbwYspyl3jSO+m0SBbTYY&}Ca0Fz+H(L<`Pc*Kcc1|I7_8d2l_?e6)0+XZ4Zz)-zuR zj;1A{X$^y~zuV-x@XLn&6_2v3n*Q;c@;Z;=Wb*mbiH%R%J1_aTDdd2mWyZ=md+uNF zwtH%7lM}9d@K#pf)jP$vChtp~y3RS!9Oam?2T>oiw`H8r-AZf@ME+%E7xvWbI1c%C z2>pAu48+VtFHEF}@nsd)ax=`gXWxrIezSa&!|6Vou&wQG`O-CY?P_}Y7wq&K$;E+F z-3hIQ=uaKnk93V&F?&|(^wJ{1-S*~js;+|Hw(#7B-Pn|Cryd-u7_8FUv!({L`LmK{ zb*TRoLjbNS}(P>I{4dvkkBjY literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/040-ICON_Temperature.jpg b/buildroot/share/dwin/icons-6/040-ICON_Temperature.jpg new file mode 100644 index 0000000000000000000000000000000000000000..eaea25bbd88154c2ebb3e50991d3da78fd7991cc GIT binary patch literal 1821 zcmaJ=Yfuwc6uz5H2wJOzM8P_>%i<$Y$!5bdk!KQ85h4;^T2nP73t1uAkSr#EGuYZz z$Kq54i$oDoJ5{MV9i>uVNG*1XQ(u5pe3j~e^3aivk1~Vl26_DuzaMwbJ@hM8?5oq@_CM0(1E zIdm2b7l|V{Eq@Ly@5nIyVZ9b7w`Csh1)O%1R)iqOc%6 z9wI@)r6N2`ER}>TKqO*39219QcyN#ymx;qPL)fSStDa!O{oQ1XOkpK-G-XYr zsJxLbE;Uj#WiwJ1M4@nZEdmi{l4b*Cw*?Gw)M{CR*+%QkdLls?g)%B4k~GK^%6N%f zF2^OI!EzjrkCUq8QYEfX%9T<{oIF%9!c|iG0uy1TN4SPDu4F>4dmKy_CbN>Tl4}Wr z%1W7#p=-;?32TW{O{h1_HB4NKctS456oa`Rcidx-xR?oYo1>%4Y(|HlFf$WxWk%ce z1WX+oSYSBMd?Cnn8+-|%QLq?`#bQ=wc>|aQGhi0B8!%@GTsJ&N;ifau92n+sIc(0j zlhKfO8?N(!=LrNr07E>$;z2MEa{V@3*x3IEVDcocCj%79-eG30N5NBo5LA7 zfmkrdo9)5%>&wmv&G_6{8nsZoOd1&1y2acYps@pGIe69cTvfRh9SFQ=VPc#x_Py37R zi-ML@*?V^TmtS&(t(kdgyZlh8*S@XL`WL%S-dfWh+H^rE`KE76$X0Y?ecgw?+nkMs zQ|CEF)wQp#lrLZ2dZyN{dS17oDO3INA#rrJfV1~-f|rM(ajFm7(NbR%5&di-B}}S2 zm*#IZ+po83`gG)j*s{eZ(N}-h7N2%b5~h}?m+ufxk*9!wQWh)Kms8zF-<4k+7}(_O zytm8n#om0sr*L0h37Wx$R(2dW4fcIqZCP~uSo+;X2b$J@kT<`q>cUR8a>|_QM;kh4 zrSIs3Z|*iWZ?E-zWK!XDn1w-P>5iw`E1)~x^TtSbJfSQ^mjAsxIgPYjfOC0S8uN~xNYf)~DD z%->{Fs*HTp60kq|c4|fC4?bA)>~)?UFK4|Dw_iAQB<3S~^y{lTZ(P6LK9IAdtK^sd zpBwUu_V5(bw2^ZMDoXBEo+zoAd^izni@ZNmdQ6bKJ*%?owCavs@aSOtWwZBz?1#Ij zudeS|alC(3UHbhK#Z<2_hF)7uoVwcm?TwJgzL=vw&h~2ZQEH8t-UV8E>xw^XIGNnl xt1&!i8z_63*qHfGedx2h8}h&ZtLJ$`ZGGCRpH`o#*gPkdpIAz4yi?-3^*?kZU*7-# literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/041-ICON_Motion.jpg b/buildroot/share/dwin/icons-6/041-ICON_Motion.jpg new file mode 100644 index 0000000000000000000000000000000000000000..472a6354e43d81743bdffdf8eb4928cbe69fd8a1 GIT binary patch literal 1906 zcmaJ=Yfuwc6u!wOJnEwcqfu*RSr`#9*=)kYq{IjW1T;khNKvO4k`+?SZYCQbP^^kt z1O`;pnS$c@LY~1vOBIXwLR3(!PXsDH@KJ3=M6IQarW*?A5ApkP=iIa3_nmX^o@>2j zy$2=*nRP1w2o0SH9Kd^6{{kFEk|r?~FaV2AF9E=M4?+`6CW9132}+>Wl5w~|L+Vkp z+JIsLAqxEDW`kOjh@0RzJYGl0kmtXiKwzC#hD3WSg-Sypo}dd!GvX0xUq@=v5;YPn zBA)~MnWbjEL64i%uvx#7prmFQGGH#HV_O2s>0tW7s7$05r@46K70-4 zC4zk=0?bD!5qZsmMMBIM75bu>m@mYnLLaGE0uKVAs~NQ`q$)-5U@dwlLk16(l9D1w z5erCTJc>yq5>zNcMIt`U;8UrDNp0p6l9o>-pdjx6 zNw8StEe^o2Ab-hh2^K8z5()jWfIwd?U`VSVHA#A$Fb!$7@3medYHj17H_(+8xKWpk zYlDrX9v(QhR5x-j*oc0ETJ6Zah(^?+bTg>!=YH_Bhf?$e*}~z`r8mRFj}!F78|l%u zc7w440}He#=_kanc7XMOF$^XhF`4vAFaHB#LNw@wWdp<>fV~Y4!?4L|HXDN2_G}jW zgD=CBPY2eMfa3tTfD17=fXQJ%9EP<4WC6g0-amgja&Tm_KV#5Y#)oM;d%$*JjicEP zEH=a%k}#MYCy2#m+u4twFwp_HAg(+tz|p^2lp%JT%%Kl$M>hp6;BeT(X?pQ(2 z?u+gbeO-&^_QWhJx&n{+0>U7#1nssp@C+fNA#O1%_2(W1 zDYvGhH& zg4>HmSM%7J$g<;;*HoO4z9gI=>Ox0HYfWZdN8#3M8(z$hIBH+AM+MwR@fy9YAiqvl zyeoaj&L?lDWhfqV48jXBiuzH{E47N6d5 zadA-WvZ5V_PsPT{ey;LyJkpw`toJ;=xy+Nd)Z(F)HIhlL{q9dR{c-kwLd`8t{|D9E z!w-(BkI1S>y?e9O=ic&~3e}YJU6bt`HYxsIm%r`wwe`QW^;v$8T1V)vdR-22L1xd3 zdgC5+2I`CL)F1BitdDiR`m8#p7B8-Nw!LhhM^=B#)TVeWd8^D)C=I#go9?uEYFSAH z@91KM&^MuX46BJdm$&9FQTwebw|FzQxNMx_;`r{FYeaSp^D`d&f46bg4Yv)sSKC+cSDy`e*X_PnnxB_GyFOx* z6)Y$U&a2FBC{%hc%TKNfKP~U+u!5KT>@W4+^9~%?f1*0;)oBaW(%W`3cJkKpXQe%e zOH|{#y2ZQzOrEHUC)n`?cf+5-Q<`1dxAlgPUw4Pt({{P?`j!>v%fmWvL>enF i)XUUT9`agoso=1@mHW0%e!%HOd1=3E_D)lmwe3G?50dl% literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/042-ICON_WriteEEPROM.jpg b/buildroot/share/dwin/icons-6/042-ICON_WriteEEPROM.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2a4dd5b9296c40e0f7044421ace29a1e1342c007 GIT binary patch literal 1812 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 DCYE&& literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/044-ICON_ResumeEEPROM.jpg b/buildroot/share/dwin/icons-6/044-ICON_ResumeEEPROM.jpg new file mode 100644 index 0000000000000000000000000000000000000000..840bac57286160038a403837ee36b6afbe7c271f GIT binary patch literal 1940 zcmaJ=X;4#F6uwCaBviy8n}YW7P+25-B!nfAh#?6BLMTF1+;BqjGy#$qlOQ0JYEg=| zb*x*dV+*3PGsSU4r7Biq8N{I?D63Uea6mzUx>X^4LAD>__v6mF=brC7=bn46vDMfG z97U)TUg7G<^36o`sX@CICaQAuuj9nx|q1S7;2%^?8q;f1CWymlUk}B08 zOolfC0)tXDQduIZhvLz#N;MCD@kb2|DdjwPt*_WytP!9JW#|qq8nYu(BHNKD!Q+=oNl9U( z_%JZ-R)opna1d`6!eY_!2)Zs!t(T_K)jHP+1tF@FX_Xqi5>rDaMQJ>itmnaar5~@L z(oD*JvRBgr#p2J0s#K;1jLGWs(dbmYpA^D*lBC#tyI>5GFyyEg}(L@#P~(L=p~sF*AWg9)pDmlu4NAcr=+rB3qEn z$kR?HLq2a9uL2qc*aBM;fd+^)0*OX28bCGxL=s`@{{ujw63OP4c(&d(No2xYGjj`?jjf$M1-LA7aHR5G=P_x3fFGHgnOTfW5NJdjk{NJe&L#7u!M1kh z+hCUcuAj6Ht4^GWcNJI|+rcbcmPjMfKoEGk^j=*$;{-L?{!;p~{Aa6cly*aFHW%6U z#2sF7Q2#QIdmVuy7Tuz%Boa~5yeN6$4S}UsZsCsw%*w~^a%Y8T1>0jt@yo`SO&)*K zL0)v6nj&otg|fcgs9NAt?U8VfQ!P2qJKN?Jcro7b~B@}@?yc86+Lmz zxw8Vr2Dib|qBPe>4YT(5^wF281|R;$J3BA4|GCfpf>#|4@7gfNV&2JhcdNDEur&jN zFT+20mAtY3>a`KX#?*J$*7W}O^UZzVR~aO5MCOz28^YzD8TUM!@0XT|mz2g780_7b zh7TugOQ?v-@~EhSgbU4WZxb7tM~8assX^lYcO!M}cTP1@`V_~9dS%T$5zLTAL-rGg z57(|;NoUXQ&x?sk=IIunYOuc&o9(c0j;K%l;ZAzWtE@{EhUjAz7kU{7j;SB`b+#6d z)HM`E*c3z?PVGE!{BE}$E#Is3&+>(e_3@OQhNtmlQ;hKDF+U?tZ|L>Hb}Ut4$d zsS6`<&()k9GcuhV>d^JJEn$0cUGuP&M^a1nL7?%Bx<+lKQVLr#H-~LL{ZDMQ|M`pW zFRgKGX^T95$FY;wQdQlj-c&P)4s3LPKbrMmLF8y0Te3Wt^(aC!3^TebYunpv&W|{~ ze<+Fby4AXNRz_*bWv?qJZ$t6Hf0v+TasG?y2Gb7JJ0<>L-J#0ssByM?-4gS3UDGh< z$WZr<`J=5F50-KgGOGAJF7+KYg24^twZ$#ZtooYTGoPTFic5G#ke=?+A9-Zo-F5d= zw=Z06?|pNBuWnCYr>1Q5(2Iev%eo+!;4S6MBvCb6@;IB}Sb=nWO$r#|r0vb1l)UVc Rbe5d+stm9?ce%#c_CLbQrBMI? literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/045-ICON_Info.jpg b/buildroot/share/dwin/icons-6/045-ICON_Info.jpg new file mode 100644 index 0000000000000000000000000000000000000000..34e63e587a1c07c0efbe4291b4ebf1907d585e75 GIT binary patch literal 1679 zcmex=+JW@c$vRenv@2ft9{~ zUa?+cN`6wRUUGh}ennz|zM-ChK7);YML}Y6c4~=2Qfhi;o~_dR-TRdkGE;1o!cBb* zd<&dYGcrA@ic*8C{6dnevXd=Sl&_Q3Q(W~w5=#5%__*n4QdyVXR8GDRC#&1Ub(Seeo?xG?WUP)qwZeFo6%mkOz;^d;tf|AVqJOz-6iAnjTCALaHmqNUdTL3o}Ygi#E^!3HB zG&dI%0AOQ_OM+4n?!{_waY$uBs(w&vaeir0aw<@{GDvfQm2**QVo82cNPd0}EEEGW z@=NlIGx7@*oSi|TW}%=Fo|%`DUtX*U*5m7I<(XGpl9-pA>gi&u1T;l2Gc(1?%*4Xn z+{Mts$kf=((9qS<(Za;p!qvhAXn>^&kPXx8lAm0fo0?Yw)0=|OYl%}YC^_U70Bv?j zEy^rQO>ryA&s6|>+bR>cTg-5p2i2Q`+b!le_38s1qYsK)q{xN|0aFl&2~WB}4m|Ov z<^fZD5in{0f5*TFPOuCq2Y^|K@&9dx76wK*U;?t3n1CdZfBk8y6!`lo45&nU#f|gH3>effeWk7Pt;ZCT12^VKxRqAyIZk5l%xTaSq3YCV~u% zOstHoZ0s--7zLRa6or^s3>^c7S=kZ`8%0Dp79Lb8Y7%4re~W#!=WcR zIaAIwYs{#4`gCc^R3*cUxq*R)r*msqdCl@vVzWGx_<~h~qmMi7^gA2VhUu~lGwlRq z=FBe3oqnevJ4$3y0OOv?OKjzpuE}@pGx+%Wi`SK3e~(;WF8R~2;?%wBZ$GVj=YBi7 ztM}0Lf+?rkR8OrqI!DH*%RPDP6o-zfPWrwM7d!u)pOTum!|3n!=t3^$Sy90?2U=w& zuQ1rz?RzGA?XCkJs(sl_@4_aV{K)2L=X&@icE`=F*A-8g#kls`Ji4*_oupY|*`Lqh z-kTyf&kQ{+70h(@ob!amF%CERgF4z5JiPDwC^e;+JFM_dblKxu$0m4aJ@%L}?}qOc z|6^&q$DbJ3U6zW8a!_dN+G1qoy-jlebiOdJ=TFWlKN9Pn7rCG3_94A@;q0Puwv}eQ z2fl_Fbj(+op;Bm8>sOrqvitp=bN<{jBM&%j(_N_^6gTUKiQK1TyXuse&E3rtXFc>h zu~V&+L1Gv0z5J!MH2CA~?|znflfG2RKGAfYtG&Me6l2A* K$Lst5-vj_KUm}wL literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/046-ICON_SetEndTemp.jpg b/buildroot/share/dwin/icons-6/046-ICON_SetEndTemp.jpg new file mode 100644 index 0000000000000000000000000000000000000000..33f50041836c0c6a19356f8f8103e51ad864c591 GIT binary patch literal 1808 zcmaJ=c~BEq7=N2h44x$rL~3!CMJ^@T-CU3;SO`HPrd0@s?NlZtD`X(qxLF_^T2XXR zTTv`UsW^^Ttq0Tt#(JO@I$EcWjDU*QD3w-56daE#RMQP|*ctKn$D8kc@B96}?|tuk z&g;&5V2Z|JUIKttI|I0Z5jeYnASTC{l@B1mW!+x@;JgQ8nG9o7VVKn}Hkhb%Qf#Cw zn8RSh2r-U<*>fB=gE5O_kaRM`Y>hyBPM$##vnc{ik?U}sO-*K+;|gdpvEVbku^`K+ zG@)}Mk=YKF!(y|Li~(_2vaNQNBLW=|SFyIsjiJau2$L0oM!B*gsk#M-nxaWWE>?() zgiL~jDaC{WS4w1|hy*9XFgy$+q#~S9;R=;hi3|c|v(cs{s)U%>!CdSv0v)_mUS6I! zPb#M942)1Jl^8C;BoYxDA+qON8G}P)wfhe##E^C)ZMHFH%8IxY4e3-46M?dozP*CQ zHZ1$zUcD2j(|tJ9VsSNKK-SJAkR$cJSJ=c=$;xJMlC-+Rn#d z(!jt1(^>WlLC%|?1VF>!uoj2IuI%y_Fb8JAE?gI2-T?S6xDCTaXQO#A%;WR8ymwB9 zLq2Rc&jNuP5CS0#2>?d`!2-zH1j+$`p^@*;TKuu&+#uEo{m(sy5A)pI0pM~uJgz%` zkO6UEt|xB{U*G}!gkElhZ1R-eg-g+BY2x&f0C}LoJHuy9P-Xbo5TyV>FyscoTzH5o zV7b7Li1J_s78+1t@unyI=mdY~4KRVNh$DanU=H}sDhSYQfVZpQVGO819^7gos59htX{=xJJEfF=gN7O%mIlk~>y^5`j_Is#UN zZ!F?;yL)y{Zgzqj6<&6_RXA~b9I}ro{tM-n)b03rhR0RozT$g{Q>PwZe5&=lFsz~M za7EA9-1H<(ie}3m{UwudX;)W&vTo0YX~72%KlEM~nnJE#r}3K*=$o3=G;7(c^0KY> z7ij}zP+5{_NhN?HuZ%l%4f=NT8RN6Q4Zk#LFC@}l8>&Pqb?4Pz<5xhBM6m9k@@ONu z5c>XU`_b^*H)Ce^Hf9xji}6<|*;`m}tUS}&v3ULSe{WvtFKchh-JPcSJTf%*a9&M{ z<%eX(w=ga!t^L43kNY)pe4Ov8bN=zdMX_a_HJ(bttn3Uv0j_VntDOJI%1PBT>sp#C zTiVW_)JASX&Na^4wMFk=wR`pPyG13B|8AXr-`7_sTQlRh+;Vbqwf3i4pSla)L}~B* z*3Kl8Bf03%Z}n~Cnb*`;&XyJk4uA4hr-+`tWfV=ha8IZl%%t`#S1ti&9_Iw_GpXUb^;0 z-ApH#aJt|`?X~LE22NLZOQ93&T7K=pvvTaw_}jIf{OZ2Oi?13k?N!{l)YzZb-QV#b i_1MPc)UxKt(?$J#e?Iy853IGO@a3wOXQ5v@+y4XP(N*IB literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/047-ICON_SetBedTemp.jpg b/buildroot/share/dwin/icons-6/047-ICON_SetBedTemp.jpg new file mode 100644 index 0000000000000000000000000000000000000000..09e5072ab9b4e69a5ca2d17ce6eb83abd720e81b GIT binary patch literal 1712 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 N6&^`@uf^)U@*j7!O6dRq literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/049-ICON_SetPLAPreheat.jpg b/buildroot/share/dwin/icons-6/049-ICON_SetPLAPreheat.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f69c6f454e1985298e99d1dec6a742964e0bbd33 GIT binary patch literal 1782 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/053-ICON_MaxJerk.jpg b/buildroot/share/dwin/icons-6/053-ICON_MaxJerk.jpg new file mode 100644 index 0000000000000000000000000000000000000000..119df1a03d640da7a8df0627c27e160b0a05a6e7 GIT binary patch literal 1756 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 M;thp=d|_|<5Bm^qc>n+a literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/055-ICON_PrintSize.jpg b/buildroot/share/dwin/icons-6/055-ICON_PrintSize.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4f08d5f1f92ca938c1a811604246d9e9c14a4a20 GIT binary patch literal 1898 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�@l5=u&K zm$p@M8wZ;nyqdE4)_&$o{E=>Hgg=xU{f#f>@$1{4)-n|*OSF9_8mxoQfmfqk4!M=j zK6dG+&kI{ayt3ZJ4g8Eo?l_w$@$rfK;g-A0wy*NaKNB}R;{URo=Zd?6Z&*_op(9Vf z70?!_SV~s6{C)AUcfxRH)2fG=^1IQ$cYF2i{<^(F{$|l%a}x`Z!bh7vF*L1ZD(`ju zIyC)N^}2%UZurz(%k#1z|+ML(nonCd__>g1u-e3OGjgfiV4%EX{H|?NZ@Sk<@+sxGFh}K&5{iL$q m;q1nJ8`SeJ-rHWVZ&{_slboT}eBL?F49|s>>Mz6Xcm4-V>Taq4 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/058-ICON_StockConfiguraton.jpg b/buildroot/share/dwin/icons-6/058-ICON_StockConfiguraton.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8e2b6fedbe13d70828d9edfd21ff5c0e95272e7a GIT binary patch literal 1624 zcmaJ=eN0nV6u+;prPU2WZRuQb?D>ExZtZIeZFw&i2K|V{l^__HfQ$Wj(xxA;zCPB1 z+kz7&j%DJU+rR}>B7=VxNS4frV~oIzb6*;nQ!!4aamy4x<|a$*y4y;DKg8c3H|L&v ze!p|hz2`=MiCzKA&0+Ue07^>M01=o+^ac={>K&d2fB-&pR|62ef)Xx{3s3~%4=Qa= z#!f38jE@N00)$$rBEZ_haKPs9&>Uu`>)d_=erxC}9CJGjc$LO2jmCzWcQiqz!2fN4}}J)zPQ>Rg3NO{sKLE{V+ohuK)?R;t`&nau@v27I=u zP$;AfMWa?Q54Z|~IsdAS;ksn}d(G$*(w#!>I1{ak|Uoad5@a%1D*3&6}KnsvWQ zJ1s2Z!{TjI?!{}-Evh%mbuM0ueo-y~iy>lAQbQg3r^-j z9&bcPfLH{iK#C$_z!M{=7>SO7HUN0&{P%~JXer7UA^;H}3*AD5hYFJTsQ{pS5l@hu zIO7SD5Eu`{%OujYr*4WNKTq3bJjo8 zY44dD7!llC|0i<%HR_u+9W^x-IiLS`c~9H3cf2m&%;}>C&Cgw1#Wr>>n>n!W+mn%9 z!}klm`}e}d-MWEIp5g~`=|TBYNq_6%3D+Qd+R|R|VY}r07Gw6lzgG7hv3y*Se&qWX z^T+o7+La`FFr13?;prA#PhB@(dbBk4?)8lI)S(aF=1(3g$yz5#&29>#8hh$^tFY%C zZp-b|A8@s7Gc|Ch$CK`~i!7M@_}3@4?KQV!^i=r|XqoQ`frJc?IDvCO4Nnen~AL2K2@0@$@`Mz`Rx#wE% zSbKqcv`L)>KwO+JV1Nl&`v6mBQ0AHe1yITDWB{zaFp@(MS}}rPdago+XQEssu0c!+ zEyCyW5D*q_(khg>D8b4^v(=b{{iO9Ao26Ds*sB8NJh@hi=BQ)yb?A!xrHRV?T%}0G z4qwO$Gl@+atp+6&ER!Y=(~C_K_K3Kcv~Al6n>FG><3q`C^u*qmTRhBqG7Bd=)TuIoYmogfS zT%(YS>#`BPNF+jd0z@F-kRBYp86y-X4yN}SQ;?y0rB1CS)HuenDJn8?10i9PnZCb* zMmsM1(OP}rD3^cQRim*LU_@3=B%l-depFbWXx5@g0;~KYA}t6aXL5QE7=lTV6V(QoHUhd0jB(iLq&E$QX>=Nu z_QA=x%cl)%8(=bkGjN6}OaL({Fq2|!2W0?2FlFNZ13+g$v?=x!3V_Km0Xm@BQ5iD; zfN6F#m^OAqfv8N_nP%tcfOmxSuUk$DNkmdvddw>*A12Wl3}E!peut!*f+Lswd4RZEH%FiWdm?ibDu zlf>4a`|`#*Z{Objd&C#=!gv=*ekcn1r#&gcWam}1dDnM7{b%~5+QsSW;rlHOXS+9M ztWaN@<{C94ZM|(qpi@kw(IIZ@1w>#MUVj7kQxtm(|_aEJ=ODzpK&h)@yqp2;@ zHd+Yd(I)DKOSfMAT9B7x!M?fq>~Pf3PI2{X_1j|p!ibqC+uNWH`cA(;y6bbREQ$7F_v6aVi>W1l z8=0m?2W5t5UGwe#bc2tQ3ybSAo+VYfhWkD4`1VUpxwI9(u~+`8xAAcNrfcSHhmVAo zT&>P7TKN1zD0SE~{Y|G#Dqd5qsTmyJ<5tyl)>Ts6rS0f*ypr1W8Izu61w#!3t$AnO z8S9ayg9DVskxQ9@8y8gsm|7<+Gn}u;F4p8>B+>hdh=raQ#U94b!~NwF*&KDT3Awhs%+Nr YR?nk{-mXf!?f+&?({-PI3vTWCA2hvu)Bpeg literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/060-ICON_MaxSpeedY.jpg b/buildroot/share/dwin/icons-6/060-ICON_MaxSpeedY.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c3b3cc7ce18f4bdc64e26a25c9e43a2546ef087f GIT binary patch literal 1891 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 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/062-ICON_MaxSpeedE.jpg b/buildroot/share/dwin/icons-6/062-ICON_MaxSpeedE.jpg new file mode 100644 index 0000000000000000000000000000000000000000..519f1b448c84021fff252a8e10ed9bf583145b73 GIT binary patch literal 1888 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 IJFM;h0Yw;+u>b%7 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/064-ICON_MaxAccY.jpg b/buildroot/share/dwin/icons-6/064-ICON_MaxAccY.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1a163314560cf2101c522785e0cf3ebff3f906a9 GIT binary patch literal 1924 zcmaJ=eKeF=7{Bvnq@)qb9;bbc2$^~39cD0*n4vT~5sF22$IOd2X5KL~7^1SLU2JVf zZG^~?=%}@ONICl0oU^v9=L2Kz zg7yA7EDnIcKxbeK7NH*j3{i?KF&&Tqm2gJ_pnpn%6SP{D0EU$swp5PCqHGzifOS$8 zjIcQ{@bb~Aq_RX*3&o=Gn9`g1>iR7vgvq^`;XDaPq7tGB*p3V}8k(^yOqP)-^OQ4v zwnAPyfli@Ppjs)UQzR)h0-ZN=R$M^X1~<%vW<#`z-b`OZRwzOe3<+^H3h~%{mJD&@ zLhhbygwOHhy177H4&n}T++oC(#X$rdzQENJngf%_rk2MELPP;`xrm)NbM8`UX=&^< zS2nJWhY?RtPng4nxm*?z!P2BFwNf2Rsj-_^5TP2G8dGU8TnQNzrLlO5)|*LG`u++E z)q?B?d$lA`BKdfzLSbmYtgJ>Gf-ctkL19f;x(bCuPz|1t$M zJZZj*!3nq)*CgO7NGLRP%>!}_$CPqBP2)7nkw^rAN{v>kl%atlZziF_#xS|SmE-T> z$M<#T@^~Ty@%Q!M@P&TvLXQA9gwNx<@#eWAT$Z9hmD+i(e39$1EY~m&3KfxAgsQPr zR34zl70~Rp1=#Yn@Rrq^g}*EpCW?U#kGtft=Uv1E8O(*zB{mDgk1C0YR}-VH ze+gF44lIy26JLm=?*>NzX#r%yB9n=gSl)v|rVt<&ssR+*Ea(OpFTg-2qG=QgjZUM| zmYghveB97C1BNlM02UMy1CSXc3WKC?0eJvWNQ>W}u;|7sOh_a^rY!Z+$wpL~@fsqS zMkmv#^JgS7QLUvBongM#!fKr{VA}d}?KWont+#fwU%>!?N+D>pd3_RtY;H@T0>pQ% z1#LIi(ny+|eS#Ts($#7mUH=fQA_^fhC=B2OTJP9+)c4hNYM(@J-uIbIq#K25oayHW zai!RSK6{fbMQ*Ei%cza(LLaP|9_|BS9K+|yK7 z=2MyEpmZ&5MYFA}ZW z)2gX!72@7Bt2Lcr;_@J8v7m$9G~PTYeWZR zjOjbiR8iZ`wpW)0S+t%(T*Wk(ZNU{|j$qupZfonQkhG4tb0#$fj;L|psg1sv*%$da zU<>cib6Whx%;vLGnDhNS`$0z^i?6CD>x54GrKgLW`b~0Wk%e{A@)e@JtFS8r6^DNIm>O**=)#+)7F9Y4shO0 zmDe`u!DOT!^k?|l^jxrFwYS6dv>|NpPVL*C-|WUG>}n^yDoM?E{dlXgj*vH5y}P{H zHb-qc5;K|l_&JQf5MWK##XdH-n;QSy5IoSI>K^cj6@LC+K%$2E%cgx3*zMuFD@V6A zc}}0}I=%f_>hOrs)SemE>6=w=D*2UB!haj@yc3Dx?6JDot_@S=yB}QprdF_Nu%*6d v`sAU_15rL9z literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/065-ICON_MaxAccZ.jpg b/buildroot/share/dwin/icons-6/065-ICON_MaxAccZ.jpg new file mode 100644 index 0000000000000000000000000000000000000000..23255ce0e591fcccf003ec52339bc53122fec042 GIT binary patch literal 1934 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 Jx8FJ&{s&Xtn1=uW literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/067-ICON_MaxSpeedJerkX.jpg b/buildroot/share/dwin/icons-6/067-ICON_MaxSpeedJerkX.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c316c750b58cbb87b50e938651e249524afb005b GIT binary patch literal 1936 zcmaJ=X;4#F6uvJnfnco?7ExiwmxrJNSzbuMq((~;5R@Qd%IZ`@@{kmh7m`2%S}AVh z0%}=Qa4Qy!b<}|trv`1sWssp_i~E8yf{IuLv9@3p(-#WJ5ApkP=iGD8_nmXkJ=cEA z{s2r4w`kG;h>8jTbnqVbXMiEgQf1@-2vA9PG641mFelw)(u+78osq3n6R9{`MQAw| zrJjSaxg0QOo<*-zW#A?x6Wm_b7#$QBk+#FlL6N}_Q-&A~b7Vyl<*|sAFyM%Q9l}y! zd>#@iWMd&*A&(z~@VHngha1Ylf>~Tl#0?Pz3y~q9WHy63O%x}K7|KQN#OTna%w{v& z9Ly#RD>#@?DCBT?93GEFMzD-II+N1E(iwe+6=b+kWzgtN8bXIS6qTt&mPw3~mHvMP zt$sxIgS{FRD3^acRI7C~U{Ka*io@U6`$1u&B1eyN;&3C8Wl-T{xUYk(7fB7c(nJ^( z1hI0si?Qj1i7=)UdPFL9bZs^=GeM(M6K3PAL5^H5iqaWPN}URil8I4Lg{{%3MWF%# zU&fR2c>+NMhJ}ZP@gx$dOe&G`L&60@LFh17MyRs1xXv`pRlny7#^gH2L8~V-%W#7x z8&^jd2rV*rZINc|T6kmX4RO_D*AhG?mqQlAaXjv*#~yZ(6XY;QMwi@-3_q?TC*DAg zw!Irn7#vujt|z|`WWNj6184*k(xOnvm0bP@Oo2&|3)KObHV9`2=p%5@$!Ho3)0}Bk z+NhI}kdGVodcdFq58weq3_xK(Faxq*0EOf~hoSfX9{?AM6MY;6C=__K*U1^sAu7!k z0N9BJQ)slILkg7!G2CD$XLk?JNp!&ULVdBY3Z9E3HF)wA1^`qljY6e54@E-^iW?Jl zrvfa@gXZa^{1$c2=fzE0Tq7y+E%vhC0prP9C=8eZ=7EPxw(VVJ?GB$3-}YIXAz$6! z8RlJ5{zFprch|m%-+8D>`AwB?F`Rh&5ckg6@!C~>HAmeg{@mC-*=-v1>AeJV@T?Rh zQV|i5aAn7}JPt3e&kk(v{cmim&C_NW^Y}jWkSaQTZfb2*J-oC4$vw7WQ!8Y%J~@@s zFgJm<;PlTBBu*;~KPuU#b$z*Ioqzq>^rtR4Qw_UQSm#Rx#Xc=mW`V>UZd?_dUza@n z_R>PU(ql)`INAJH^h)T+3->>KH+EAh)7-imFtBUju~( z7;fNfVMlUb<9+6xhSOz7pAYPz8*?uknWb+kwt8RbJN3BF+_mhA&YY4~m>{S-*?78F zwWj^Yt~Z?aGFk@Oto{yi)LUYV7Z}lk|Irt*iUC}LDJ=1M7V~lQV)yJpS9x21* z#WB9zFPh$-=*S6t*RZP^C~OP%oO~Tk|H>}{qb$10Xq-qF^tOI& z&1>1$JQ4c})pyyV(2}Gx?^Erlh(!_fga6cQ!wtuR){3fHi^5k|mZg;`8rhJ%1bMt!y>2Tz(Yml8^zQv>J0IHkuMR4@mSv literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/068-ICON_MaxSpeedJerkY.jpg b/buildroot/share/dwin/icons-6/068-ICON_MaxSpeedJerkY.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c7cda895033b1fd4aab35285009224d93ad4263b GIT binary patch literal 1938 zcmaJ=X;c$e6n>M*21nGe2rktzs0UFpnS=mIj2H+sp`s8`S*kS42q7esCWDD`tQ#sQ z;9lITSgIV4yPiT(K}Ffrsnc$&d1OF$gcV0bypSLr7A!zQ z#XKy8FBSw(L+6y=Aam@tTsN%$cWp&01_m&#_<&y%PX(LK4Sos8RaDZAayvkQ5I zH4VkYVlm1WpaMY<6%k}xU?w$=AhXTCS3!Z>bXJ3fG!SOQrKr&oS)`0hRr>AW?ZmQ{yS;r=eNMG|SnH6&q8Ac)M~ zF2Zz;TIepojBc=8VE4gAr=l4!%wRF-j1Nxw zLOyLcs{n@$yn#0iaR7}2!5qk04e|k?!SBC6WwG68Om_$Z5aUBPiwPh)gFP4kn8|=? z%w7&eV{klSI+Nw)?K6Z8M*DL8G5H=rgjVP_lmh^r&Y;ohtR5wZL-QOBd(i^Iysr8$pAeoUy;rDcIFx)AHUw(d9o^KNICkvY(wORuFY@W`fI9|S zQP7(FckOSZZ~roPYUBL>E|cY_)5PoQyRMurcw$WIG)iBjUN_rQ<`v8q{Zv+a>e;o* zuan5G&hzG)%4n~(^^?Q&c`wJ_KHvlgE9{D!b$N-o3AB@`!`J663AnlmsVnWssMCPC`9Ky$Nf99`tOH(|=g7uD86$oJy2 z#?wv^^04cyAOknmG{!3%k`-PM=Jj%laHV_7z50rZOHD-=1COt&5B_&iYUX%VV9k1r zHfx&VxNm*yU{7Pl%84t~5%j0kO2hS)c_WiYC@o8NEkDuBT$*h-*EwQUz^*MoShBp> zZ3%msLKQcp?5(nfeWne~ExN!<9p^sOi=NAf<}!D~Q{|UYXvsj72C{ zf?*r0>oc-bObe7HmE1kdko^+=u; zl%n4AO|5T(`_|C;=~Nhcxf4%*R;>^!JXFe#7J-HO^b;&_m-x^zy{Vb#+)(@E*5>DM~9E#Jbr zc)m9KP|K+|Qc2^h_Pgabe$*T({W7Pt{6WP1Ol5vUWSF*Gc93%?WQRv}Qq`5AZO<+c RS06q8d0(<}m++|b*8h}OlsNzZ literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/069-ICON_MaxSpeedJerkZ.jpg b/buildroot/share/dwin/icons-6/069-ICON_MaxSpeedJerkZ.jpg new file mode 100644 index 0000000000000000000000000000000000000000..be450cd460ac69baeb096607fecc8e2f95790a49 GIT binary patch literal 1943 zcmaJ=X;4#F6uwzmL?MU>Q_)ATtdf@m0!d0(Llh*k2<}Ql@`M1%i&-GxQltzzh=a1& zvIvzyYo?%Bpn_CEkrphpidqptL_o(8wY1ven!cbcKg93Ho%7E7zVDoS@45P3{SdGT z)=IYn5E9}FjKK`_V}Qcfh?CL)4iK^QCIIw91UNyhR&ZfhuA+$~XdFTlqcT`4Qosxv z9R@yrT7^iQgs7o7Bwi}#QJ*!pP$8*=M_tbn(uIm3Btg0=U5TtsUlT1(PZDz^R6k$H zN6Xd96f#6Dg0!+^xr(dhQ76s0SZqkcRA`c-PU2Am3{{~G!U!k`RU#0J=H)JCcrqbx z4vpbO=P*52KukKr8>V~13=elYgG=|~dT^i*pkmdOlI`3mzTiVG?2AYJu&LD4R9dPB z4OPa&3=W3_)0r@n>5ehnRcUgyNb4?FIZQe55tUdeRj8$?95OhH;!us6N5wjQzXh3M z+V-PoHH#<|ewr$i84h65R;7+YX8Qf8u_`)EfxuCS3e_mZ2u61>h!xx*B_dLz%4if# zo;t;d1XPWx5>N#c6l6FxHsrisDwm+CDwj!(P{<9DtJEU77zyF?sF({)DwS}(Jp<@` zwl|&0VhI?G-~bLgFqrKT$QIB8Sq$t7rnG!itdSvd^^{gJqh-vgHH?EyfmP-sN@)rr z5hzg^G`VfAbk1J9g6H)6pq0$oi0-k^YTZje_NRu!!z<3%4ImRXt2qYsC zku>YiH09HQz7_J8eV;I3mf| z0ssP;M8K1$G&nqoVo4y9jTTxhvNi_xi>VHbfMd)+lQ<7s3IIeR2~RMZa>7yYmiB~& zM8F8JB2meai;P5j4>O~z7oQ2tcPP;J0W$&)YmGnwexT!fJ9bNWe-5+eLh6N4%g*uN zGfT5dbQ`md-H2Itr1FwU=5dG4L;i7HqWv}xt+VJB^ukthitNtrsslf0w)S@&Pu^=E zX`_n`4T^m0yL|QFyQ=Wvr=#QjyN-6hxvGHr3L)ra&NU}6UrFCvl;k70H@`cg^2wmh z%PkG2|7;-=UzD({&$xQ_E&n?wBX|cnQA6HFE;|vK-F7L5V&mu%`Z5=H;}p7G;k}w) z>UOxgJ~Mxw{i^-%E?Q--4UJ_w8y}Bi-@n*say2f2xYjPWM0Vy?dmg!mF+&_}yC7xjUYTO*J=v z2_FAd@U|Tpef=CqK7We+1pJbyAb%(E4_C)8`e7U3~w3sUJu`F6= z7g|#3RPNkmQHxypoKln=)X?gZWqW<#tZm2Ozbk5ML3C4SY2$(dfIC?vfI?oyaaMwy z;fdFN5sm|~Y{#&$n#QjWjM^rJhY@csJxNxynLZ%>^>bN%qfc1)(7v%nZlzWgW-dQE zT#wO&FTEGG{&i-}KI0dx=mvPF%gDXljk>yWvoc$grk>7_EB^M`lrEdvSYhLu&4)(X zu4IstYuTA$Spn3_$c%!#NVB#!W8W$`=bLudSl6Kf&sF(u&KkUMIfU=IN(R1c;+uAv z9`wdKKRBM^JJyjHzR*SYM0WPu-KUy$JM$VU3N{W_nbT|E6b_rlY)I$i`aQojn5hT# z&-B0=qxbAc>?@i#;eWn2y0f`1NcVhecyg1=d1i69pZOBy?J;v{fB56}vH#jy0=A?U zKXHoC`4_~T5-k%3KKf%crD>&|o2sEY=b+Bo_6z6w;UmZiZIN5E<`M6J?&&`9qgTGF z2o;#tFYF!B^zn+#de;(LDX_{{g3Kn3Dhi literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/070-ICON_MaxSpeedJerkE.jpg b/buildroot/share/dwin/icons-6/070-ICON_MaxSpeedJerkE.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3c926b85651935a5e5f4b0d1fd1d4302349f613b GIT binary patch literal 1934 zcmaJ=X;4#F6u!yJg18J}Q4kA{2QDDw<%JMTAV?sgf`qb-po7woJSD{B#Uwz$k*cLA zVznSGYN-pZRa%R6r&LO*)RnP9l^qmh#t|5)Qelee3$pk_{C?ay_uTV+=iGD8H9sDa1THt}WSuZnkIRjOKAs>p zPINIkl`s;9R6+-bhFZF|3|^9;(kh8egXb7WCKHBh4Mw?Efrm>(2&uwWsgy#09#7)W z=X1G!eqk6U6$^M_9DzTNBbM^{d@+Via3zEyU4v_l6I|sK*LPa3WgIj*GP4BNt1@t9 zn4ZwUW7ig{rmuxFt=>3SIejhIv|N-d2DLoyJC8l#A}7dVPL3|QnH+vxOHRC=9Bp$y zm@_u8Kv_+GA&R*Lj_5T5wL1kE3Qvj6;z3XK#ffa>Dw*dfR z&><>g;*dh6vuq(6gK1~)FxLvW%|qNV@lkHbj1*rd763FFoeDAO<4P13)z%HNqXA58 zPe&Mq4$K(&wu;!f^SB{J?)%KmU=~>ll?AcDa?l;Or!@Igztm|}M?i-@U-`OMEUS^l zm)Ar;^E$gSMo#-Jwy^t87+cS&oncFth*>?|@_4PUqCtb82 zY^Bj&9rT-9;T72IF}Q21bQ2>jow1HldNL;O_nKWS$3>nI!@DW>liKfeYQM?nC%CUx z(LLsd6tYIQdxEs8nrxcx{LioAs$O?TUh65h;TN6soaq!r-yWOXTwES@{7QB35h@bw zi2b5oH|$&+utt6J;JuEfA4~kpd$~@@S07eX`KW_58*;vW6KA;A!b`jQL*otUlLF^| z9ZE_D4moFtMmVK8tf4Mvr17tF*H^#vt32Q2V4d=1OnF_=X_oa)J9*xzIVU3zc}vCK ziE`_tvas9x=VV*~>p8Bg{v+H!dvyAdhXXtMZYwi<+ic0{MjMY&Y{9Wy_(kiMQ>X2; z=SuAsEn3wUJh&@t&4ULNY;QcYOzt;YG{`^J>nc#Si*?Yx!OSW~yUhE>iNeM+EjxeW z8Rr*yU)c7v$Fra@@<{kXTb`pPpPlRbRep(QS*=?hkXXMQ$m_{+iE*zzzH}vI=eD&- zDvO7oQ`i%ZHSGkA^`8)7S6Gn9Ud z^NSmXF16eVdbqZss;;^IX8FMV-u;O=5u3j7DihaL#u8!jgA3fb1-ryDO(Wu`4 z@q_4VhEevzC68~l_NkF$Y0|u?TRzKr4yX<-jOcI6{v_qu=A(~Ba`u)sET|6RyM(r7 z&hBk$`upρCP>=S^xk5 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/071-ICON_StepX.jpg b/buildroot/share/dwin/icons-6/071-ICON_StepX.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f1015b82185f1a126f222893c0df32cc2f09b05c GIT binary patch literal 1976 zcmaJ=X;c$e6n@E&kknQUOJq~WfF3t8StKE&krD!m7(_%+P&CV+Lrf;jB(kXI^t4)0 zidH~Tv;wwTMUNtADej6}MXR_Aih@NeqEtO-i%U9*fc_A_AMf0E-~I0W-hKDkZ`zxH zS9k`V0zhQsNWcLfU~dCFwM}o#1PtIpyAuJhH$ljJtJQ)ch?x><4TKI8>IoB)p|v1l zp$GxvLNY8`y%Dp*I&2g2K`BTG(ug#cFl;_PF^j~eWktv7vy6I$K@c(? z9+!b;m@FpDs)aL53(ORnp%gfiqqOaCBLdhNVl^rSp^mEX3{4CiMvxdBB$Nf}#bYF} zTp<+8L<-56(Xd1$mLnoLB9;b<#HdJyN)>Py1avjhkb=glBf4tQJEfrOQt9dG!gQ&S zAm<@sg+hUdB#1;3NJj)xnP#gtBhXCwcV|#zl%B*bR-7=yj*MCzVY4a)w9@xiFj;!i zezI2|1!^>(4>g$_4REHVtg+Y!y`M}>#bsJBBo?Cx8>z?WaDNBcf`*Zp)=H3Z1hJsI zi!t*FD?!aCEO1zuqiezN@C4j!AkwK3PL4){Mw%(B)~v@O)k*=KMTp}DR3r_O%fe-H zNsvq|7Keuht7URkSXh``5~`Aj6`|c+HKDheFtfFrYxuwo?v?8p2a|=atj0)uA!djm z2@~wRHj4MIC8*bYU0g%&T4cR)5n2r5c-)U3yW2%iki+a5U3$|q{Fs@Zc#1k0SlKKy?GI9&D@POTq1T{&!4e*hpht-F)0Yg;&UgA*g-hd!)E)Osuz-6+TP**gA$8-Zj#G#P83yUrAoGMXy z@CRt~(*j)W_25g0L2H6|AOy5jnNjYR_~ai2cQ&^s9-&e;gcRg&sn-)o{$$T&!xgwz!W-BSxsJc?M|+IWgsl6^bp zL1Av`)~wY^$)bs}cRtp(1qYf@JaFAkyrS}YK>vKv@u0C^0nOY=(lc92PTz0HZ`c;> z8vO!36PY-xeRL~}q2AZ82`{>{u+dh&xBkK7q}??O`U?FZKkx6eo-f^Wi@&SPr5^p} zm%m?D+g@*fS$Z`RtvGt+a6;b3D->}ox8JA@wWt2d;oep}TYllRyy@oK`&DP7r^b;; z?#i63p)V7{+bj0n^=TI=GN~Un2JGig&5K`Il{DSGN^@ur>FeL{EQ@5$o3^BUR8h&b zTGib(n^Xnl>w?QZ>XY~#xK9CayHVgXqrPsR&a3D=d)P4J!pWNUm2*QPq=SDJdhOCr zgq6IrKZW~VRh8utrSIy>QfkfzCAY1UCi++!UwzBf?VLV2anB=qDp*(J+H=y@J?yO6 z?i;n=%D;BiXgFMX&J*uAV{4pH`{&nVN2+x`vs>hGxig!lkh=p$`l6g7n4=!bo#1zS zhM(NKx#-TT#Pfda!;IFn=jF-GsSLNy3+w8apRFF0ufNo+*Yn+)F4sNCtS*T!+i{Pz zaOTEWk^b*0J33;YY)wJ=#W95~TT*sd{>eNiwS$e^hs`hEEDpy0i!W~T7LHCB;kkY1 z;2V#l;tzl&X}KN0R;}{LSLj+Q=2Tt!Eut*y?ZNc+-}!fSBiDAWP|P}#x^`3Trl+=x z6FB0u6)lTeR=e0i%bX!k*Uv7Sw*Fad-r$g}JX19u@nZ9Zw!63ey&Chv2PHj;LM91q z#hr@!d#}*aIuGuir0O+q&DONki=E!f2Yv@_9^^$GttlS=T3RV@+!h@@Oc$ybR3F)} yMdf))NtPB5_*ZUuw~L~D`z-z=4hi3%I_E^Jwln5Ud3op9{3kHVRZ~YIMP_JwN literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/072-ICON_StepY.jpg b/buildroot/share/dwin/icons-6/072-ICON_StepY.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9bb3e6e6beb79f8acf54eccfda0bf8ae7c1cfa34 GIT binary patch literal 1979 zcmaJ=X;c$e6n@!*S|Ex->ox`~$dXCI5)z3qB%qN-5d|tmX-GyHA(@cHBp?=-x*Mv3 z8_)`BKt((js3>lSY5@d5#?uJ^*qcajiou{2z_3QoQmC+Ggr&sPuvwvnIV?5| z!bE1RLYayfpk!nLsu41u*PLWRs7lC;50fn9$;2`RvM}8O zn8WAuVKx`$aszNifZn1pD9iyGy=Sk36wxbnsMdgD8pz?ONXCo?ArtTP!x7ZlKHE>; z)kj3R{PR?`+HnEhwt7Ph(%1JbCTJJ4J zr(gz5pMq&2iNtYhp^#5Js!?Gk{e*6fTrQAl^ah1SiO8fvCho#QQI&wrjpXqoczkYf z2#3Ro5Qj!`#ZnGi%H#3^LvWW~trSxl)riK>t5x-D#RF;`%z`cYHsD<%nV8_q>=x6t)@CkB+eWQzS`i39T;1jRIN8A1kICl>$ zP@Te`5W(IERscdDh7#r; zu%7}9I&cGSBmx5v83Yo8U_T930ze}4KYu);(VYf$_xf>`MyFC-aViz>kJig4lE{Ri z!zff5!)-VnFh{s^!aY64i4}*ug1>ZP00N0XB~yvL_5=oTC<%w))M81t{tE1 zabgyGvSP}RO*@!$bQ$BvwXQqPQi|E5yxT5U6&LLsJ!PJ4yLNd(Le%-M<(}Eqz8g&s z*UhMTn`tb>VukLzBC2$E^JlhYMnID9J40Pcj3_P4S|%{OZe4wly~97tYqGJdSj4`0nDNQyE?rAb}*_?=%?Tj#{Y-~%^jxf&BJ3hNM?rF})g^?*5UW z$`_qSV&9f_7S+oH6-kfo?Y|)Z_fF$Ko|20#x)&B^t;u<@q9fh<%DCi3<3n$seSG(G zl!*Il&JBKgq%$u6!Q2)a%u3&^+E#p#8+A2)C2!8wGW7M&4}Rk*mZxsEl`b58&?mp> zs6lF-Uc}hDv3|LiZ0n9_CwgpwYu&sU%Zy67$4Z!Rc*Sv(bpMUcLRxF~-dT}}zMKtE zcGsvimn@dmiLx+tcI%scSv2$G@_mI`TXkr7e+?Rj-8gv4E=+CX6N*6lIYCI>9txPLy<`>e8-=^2wHhaH_Lc0U)`wCaLb;JX$Fn8UE&alngpk+}`mh#beWS@7ng5 z(+3TkL{CIX3-dI2+gj&}qPI2|&#$aDhqbJ?gO*y$t7Gp)&LdC6mb|4##rfr~t&h!l z@}JEwt0bx1FAHsZFilo)NY?~6wkCQS_q@Mb^YYFh?9f-Xlck&U>RKwxS`z=(muG~E z*R7x7_m{uf+Ya&;uR0pj7E^G}n)uV}cRuTKC{-g*Wb!J0(5_dW@md>pEd86%J^A^+ zzZ=!2%`7Z6L@o_}V&aMpT(Pps?4W2{`YkrUscF^3F8=f96%zxq9;+VKUz+N#isxMm yni~G9q&zOL!49a;#x`3uN=43g)+)EexaO|$wy}F$>IS>)s?Ms;QHvYxxBmxO^R0gX literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/073-ICON_StepZ.jpg b/buildroot/share/dwin/icons-6/073-ICON_StepZ.jpg new file mode 100644 index 0000000000000000000000000000000000000000..78dce2a36933d6f986f21027cdb263d23326ec59 GIT binary patch literal 1984 zcmaJ=X;c$e6n@ztfC~{Ys0d>~R5Z&ZK%7Wwk%&eNAfS|`+K>#AU@~Je2oV*i3j(4? zC>A|p6^pHHU2rKBHxS`ySv=x`0xne4qooLP(5lsRf`I%GzaQ`1ci;WKd*6NcnQxoh zf%E(nO*{Z{xffu9k1%%vmMlq?XaW>KC*9EinA>Um1cJaNe7@euQ>w8zl&8XU{1he5 zhj{`%@SB^0D^-ao0mY#!HF_!M`I!qGNTZf=B7GDB1s;GVXcn$Dpy6wSBUEb>Rfw81 z_Y24`MUtY!bts{PQgo~IMoEg4(=RR|ZHt@Ff%-#;L@CGLk`?+&5efxh1{Ct)`EpgT zw-6E|JlI!&2)$=PLIEu13&ea_#1+62fv-e_Km*{A*$nDHF`CcY@E^0Q79yGy^&DrRj6Dh<&Y{ojYcgI2xkZS z_T-M$hC}v4kt6qP=jU- zstz<@I;j8J63vLUhyq8{8{n!(u0=2+mroYMw><8!#~yT%6J#-mMwi?S4L_Kz#M{wPDV3mG=?>U z&KPzw6!Lk)TnSiA;0PRP6c(VeC^Qzud$4d=pwbwWaSn7VYnG!E6L7|}=eavif&G=G9zHe`Sb#zUOuE&OJcUIa2d2O@2Rg&b zpEJ*CiBjk|p1nFh!^7I#0!Gm&WK}d4m<#HH?{+TTw!ibn`L41!;;#Z*#*O1qt@yXa zIezPvvx`KMsU9_mDBC-%13uBQwS8Mt%SD-|fNNiMal_qKlgs%pwMd`XV4oNyH`#fX z<4%k)uU=06%XjxG8dH}^JhOApZ!E=Jn==TPN!F#6SrgmRY4wbR(WA7D)wf^Phc5fU z;C9rm=uLZU`L@IPzxNn_oiXvS)M-s|ICMNnn|Z@#hA7x++WKy9JjUy;o}9VH)V*o% zO>UGUy#>k3?rnM$`Rrg*=8{E8@fWV2i_D9>Zp12c$IjecSJRPW(}wh9Hq_2(Z+`c% z>~ipu2m?PiJEz7Wx8Rzw^S83vGxcL!T^@Q~;m-d~T~K_?PJ2MS^m=dWjyt0>MxUC# zx#rxlhM5cRX8Ta=U#lK@Xaksz6<+kTJdwg88y^p;C!UuLBq`6no| zqju`!#pTOObD{LNE?M;^)7BWdpC* zyrj8;F>~6vJ*|nmlH-EdQm;zg72D_nSy^9$U2xOkQxg+pVa0uN-_s$tmfD2>nPVHM z2njAk5Wh+Ey!$raF!4Ddnw6)|KIHM7AKcovk~p4(H2zF~&+gR*KWlrhum;@aZMB*>*s0=Ona{M`)_$#+Q}^! z3efjedG~7YozdB)@78Oy&GILI=R7|mJ*)q*u#U~mdw0%Gtu4OLTDIYBhT^4rM04Lb z!yoHz73{6s+m&>68WUcf)t=hEgKh?oR!r&o{_9`D3wx^b+*T~&v{q>XpYLnvyx->T z+#~1g2$>YtIAh-9UNcxQC)V|eb~0uAklM?9$y`UG(1N)vG&2 zyU+Ita10)2H^Hgq=^l?MvEfG}L@j1u)#Y|`JI`H-9rns}j9FIlV$rO*UT#~)yG_I2 MtafeM_>=k0|4X^ClK=n! literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/074-ICON_StepE.jpg b/buildroot/share/dwin/icons-6/074-ICON_StepE.jpg new file mode 100644 index 0000000000000000000000000000000000000000..58eaff565032860f0ba11c2cccaa8f965aa5298a GIT binary patch literal 1979 zcmaJ=X;4#F6u#L=5U>Uk!KM0mpdvyx5J)s&ARsA?vRT=R4aq|iNnT8XB#785)e6;4 zQK7aXR%fsUWyT6ql~Jf|LBt}W0)ohnf-A+MfSSHUwjbj6Al07N2JKmk)QJ_b}_igb$s-~bVG#{gjLBrub7IyH~URB0I!8Jd7Fq^Odqm#CR+ z28#(+`{~sZ=@vu>B_NySDn9(IyaI;gGCsUqk+v>UnzlvCmBD_# z&}uzTuT(1$odnV=lT})to)4Ro^Dx`wX2Os;M7M)j_G((7Sp4BorP9;@b6Tw~9GTMl-o)BSgBoFmBU&^?BSo-qClguC3(z1E9jb{$ z(d3CPh9;ppRGWmVp@0BW*L)zCjdGO?P1P7uaJKHue7jpjZ-TnYB)Lk|`FXIRIelNCZ52 z`~*)Rl5FiP$T%vE4&b@=6ekBuw!fo5a@Kj}JSxBua27-okuV;OqvCA|z>!TPSqNY| zI>(YNUC$Wxy;ErBFAZuM@ThZ=*F52JNT?`Ek~X5uG*~iEj*ezzo8-Czouj% z>5s_l%RMm}?d46;Hx$*vn_*?gpPpG;))7A2W_NRkaR1XaxIX*~i`vn~tIeSoV#nA$ zdDVf}UbPpM2sV7;_c4Q>nDdKDk+CB_%sI!~Lt&A7SP^kN@>hmq7PI9~ssziche&UBBQ9&-6QdvcB(9wA-m;HlFui?y^iM7Q}xx^l#~L3h0!* zyehtauD~@u*}2@;vHnJB7(M%BPHok|pz_D0h^Pn~f9Z2|YMQ*n^-4Z17vxjB*R>yl zD6?1rJy)LO7awcVUOy?w1csyE%&*USunK&+xMTTmOS|tG_*T$pSpnR6?eFjh^q{iy z_k%ap2$C1|I~YM@#^pBGw&Jk*@{Er5!Xrg3y}h&ro;&|JOw$_PR_wKYJ5c+2_mX0I zKU_waj=t{CYL}07XSL5y(>LU#zz&c%|^EuJ=JM*qP>&^0=$)_uVHE+&;rxdgr@BR-f CEV7;e literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/075-ICON_Setspeed.jpg b/buildroot/share/dwin/icons-6/075-ICON_Setspeed.jpg new file mode 100644 index 0000000000000000000000000000000000000000..94b808f716a24c444918d3919e909e90ee413fb7 GIT binary patch literal 1748 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 H);s?LiaLdi literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/077-ICON_Rectangle.jpg b/buildroot/share/dwin/icons-6/077-ICON_Rectangle.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3069eccd504847de5704c53d7e29472b5c07b05f GIT binary patch literal 1142 zcmaJ=O>fgc5M9TK8YEQV8^@J<0YtpE(|oK|QzdpQB4JdON=4jUd)rv4y_UTpZY2Z< zeh_yK^uSNxz{ja~1V6#7-NdO%(|1_S&dz%?J3E_y&o9BlohU^IFHnqZ0iH<0Y9 zH#q|WsB`xl0P;%_jTws#grZb&eR@O`kA^67W27l60$bZz?0OTz;1M|qB2)hR`HKt# z-;@tKj_Sk~83)hL6Y}c(<$-rT@vtv%KZ9GDk%e(cma z($hs3_r{dbbWCGtSw+|S@X=uq`E-^(E;){4jG~mekw-?hDRUJi2z&!~Ep0fohI*%m zHEn0mx78jVwuig@LAPULyx`i@n}#G}3$DN9S}VE5ID|3JY?CB-OZ?r0hOoT05v;BS zuhg4!{nfP$R&o(91{IHc?XedwK0$?9jV|9*!%reU@d+R8{0~?!2Nw7j{0j;BFYplv z6>8k7)%ePnD~L6bgD>?0Vxz=bfo6q*&Z8Tm*jQ`S8`n;%kh_ii0!U4;3D!kH0yRkx xB_aO`Uhu+}zrVDaJkt%=y$3fvK>E*<{{;6%flG@L*an}zy{mtyWZvgL{sEzwA0_|* literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/078-ICON_BLTouch.jpg b/buildroot/share/dwin/icons-6/078-ICON_BLTouch.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b3234d45aa12f9c909b935e13022bdeec8569220 GIT binary patch literal 2016 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 l5F^VjosfC3&^Iz)796JC2 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/082-ICON_NoTips_C.jpg b/buildroot/share/dwin/icons-6/082-ICON_NoTips_C.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b55706060c8bf390c00d7eed531be8a0afee4ccc GIT binary patch literal 2529 zcmaJ>dpMM78-K@`K{<^gDmBJ=?3_%)%w+OegCrdsL$YJ$#hB*M9L%U}>!M8*pGXZY z6&(~g<d46O^#UT#=M36reSVtZ1Q3%D_OG zekg%2`Xu|ez52q@-~a!+^7)zu%*#ro0pRC+|5jKMlqdoT0iZ-E6SG0c-C9Ey(LKc= zODYrx357csy0|4yC>2WLgd()3r>1LEv_mLYz!AzNj`JLUf4Z+gB4r8Kpf8hwfmHBZ zE{E>zMW#_n-_j^d5|c#o@}SX3UR2LDR0`FbMk0HAFL0Scwu}!7qzhcmXRgOrxtej{ zi=fC%P|QsLIo@I+A3a|-o%{7%T)(RKk<0mdF4V7b2~aWw&EM=CSDAUwt5sWoF7<#(+E8wn7R*01++c^4(;ID&ged|=pgm< z7A?}#)Bh`Aa5x;HjnG3P^$Zs4EjBPRgkWSe@AUDb|H1kz?~|o&1W>ww9l(LZP=FQ+ z21miv%|H_L&fzfF=N|w7Xd`tHTCflJ;vA;Q*H}{r46cQQAwF>6+Au8y51(;<*j8o9qLLdG z5xqRqx%)XT<@Nfn%IXb{S-oaYjT8CPQCIIz_lC;Hawj@}#wH!EtVq5(J*#MQ&-x{O zc3GkF~i3`d)#!)j&Yr5^GY#Bv`vo(DxQV^ zc=TP=nKzw2D!7ZHPYiW-_&ZY8%)^OR*(iNNIX`9yXm(W8W~; z`zKaWv1{3C`KFhxJ5{mkWVh1gbMAGr{BCZ_GxD@V`B=3IzBc!E5l3XWHSCW^CyaT? z#y4BOt2R$7ci7Z(SyuR@z`N$|_R)qu3qLgw-lPUz?#`Mj5YCRQ3ay^nG!|qVPbOlC zc6XN;e=9N$Pa8ioT)j% z9X6{d8QROaoI0ReP=9{;Ge?1{HTXs65au@z%$<(Bt9~|j4C zqu)9kkbIEu!V6bfB-xiHHiYBWEvt(EF7LrwB3!Y*M@bbXT^V^Yk?rPD?{;cO$6!9GlcVgugs=Et~6+iWy4nBDIUnOBj@xIn&=%yIp}-+EA)}CD>oRv z+nj0?A{xQfO-zrz$Ppx5U00ODGbnW!^^Cn=eBz!{aeVpew?{TdQLvPIS-KT0zxME| zr?l(sAKJ#Uk^mbX{Pkb_0skAeDn%*#owAQ77hQXH1{pH-mqrYP<%nm#_dVL?-+?L)f z%e=uO#U0$Qw7nf;@0#0qG>$HTCn_2gY`--b9uy*A|Zm*Nr z7gX2$6LVQ>%jP?+Lsh>H=9qT$4C4atUOMk~COH%DdoJmshf0;-nH_Z8rMKIhZGJl5 r>ak3z%vWKo%hW*Fl(_i6x;fKDdtMA|ZSee|pK1tSSUxo0N!{~5yK2uq literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/083-ICON_NoTips_E.jpg b/buildroot/share/dwin/icons-6/083-ICON_NoTips_E.jpg new file mode 100644 index 0000000000000000000000000000000000000000..470b88a52664651c164450d16c27578f02b23703 GIT binary patch literal 2784 zcmaJ>2{@G78~?^Eb{a~O7=y?%i($r0$sJ}CHCeKilri&RXl9rhj3PI!NJOMXi#FLC zrQ2T09wk{qxhd5x)aakfE#`jQmfQ2({_k_1?>p}~@9+06=RHT!t#}6LGo`#R0C0D= z0#tzSq8I|uj95-o0ssRL(6Sc*D4xOb5fVu>4UZRyacr(I6vT0ae7uw$jVIy=cwmXM zG@8wc0wtJGFq|iF!oItD6N}+-ov;B8ECMUq6^!65-y{N8Z(8Nc*%Za0at95I#wJONi2FJ3f*VXqlAs{jiDE*ypil+Z9Z z8m71lBt!RH2@Zq7zCQs7BuohfS5|=*r{((w0GkeZ763!Q5K1sO5`fQa!eL5K3IJM1 zclI1Ttf?~5u4Ws3S&7+T4Ms6+RTdC$HL-`6Hr^Z*(Vi4q!)2AqKx z7vC=RdY}pXFm#d|C;RJN3Xn(5$yK_wAB<^BdWJH}H~v-{bvN?)jige?ZFmR&T-jl7 zlObtWT!~=~@ffeRsXCLdxxDemG`Xzz?WCT0(S=9M9$oy0 ze}!4(JDIib)6}(1VcPV4%#}$XCxEybM=v*j5^S@jL#>eh*OZH=#j)t|kD~s=ag&WD zmPd?3Hff|;ao$=RTuwVE(u~2q`GYf7rDkCam}(w5mO?2?O$`ep|q5{y7PGe znf(5xZDLdY#fSGTNe1oLIkVxqM{7=o7CaF!;_hIFs}@|`ze>9@7R6{vrNZSU`<}ng zqp@x#NvdzF-P2z&zuG4i(fX`Wy}q%r@f7Fq6{q5JuG{+b`Fbwz>HF^q2IU)H)|QoK z_dJfIlEPuxg-rDaL9@=n0=+eh%QqW#U7S|2!`nzJox;a?>Ri>StB`+kx8GOP60@W;Cepebq2adk3h556?S0*{ zu7*rvnr=}m-uy|Z-)NS1NJrK7NjgctQEm}-x!_}?NnhI;N~Ydxae<+Awn28U-o8!0 zsI|yH7k2+OksU~ivES=)Ds;|Bq`|GS{Z$+4#3rHha)Zmk-1gvImW{-7?8}^1sYf)(7Qmq@S1f&=PL)JDA+SnbxF=(5f_ z&^KX6(nrMV>Zys2NVdn}0PL78;q)&>W@M9&*Idc2*`<42r8%HiWx!y3<(-tZ16dE9 zNa?1twpszQrfY?MElFZKv3(BMe!;{VOMQQvfl=WUJM{Z`kwBC&_?Xu(icT(`#E$P3uSWfQnjHG6j}i{;im;ys2> zcG9&TKK1pxs+viW@3l=04Y0_6l)A?JqJ&wX3YK(K=Ev<##Fh`wcgJL8oz!i0>o%?C zbRR^G7&)YX(wqvD^hIILpk{WI&B>;@WtVQ&8TKsyFfebxxmR<0Vano$g)%y2eZ6}~ zZ)j*)?9{AhTrXvH`C!7kUuk{G@-xZWx6GE!l>FGB2X z6osPS7t`^`HC`(7~w|s zqiL1AC$gNi1ovD!?guT##Hzd)#tsB14y;}Nu?>#09Gf3_Y$Lj^rGpZDNmP>S7wYBz zBBPjo+}^T>JqzEzb#3XE{__+^hClgT;jIyG4f*Q^tx0~emp pc=2cPP-mgV>)okE`%#09uckalrfA1APN05`_;KXS?95g?{u}4~Lf-%Y literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/084-ICON_Continue_C.jpg b/buildroot/share/dwin/icons-6/084-ICON_Continue_C.jpg new file mode 100644 index 0000000000000000000000000000000000000000..718fd59591a4c8890ad43e90517cea7615906c2a GIT binary patch literal 3376 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 UvWC^W#p(Zi3O~P(iSmK}0pVrKTL1t6 literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/086-ICON_Cancel_C.jpg b/buildroot/share/dwin/icons-6/086-ICON_Cancel_C.jpg new file mode 100644 index 0000000000000000000000000000000000000000..af203f5081076fe7cbcdf4a51946d77665a47814 GIT binary patch literal 1988 zcmaJ>c~BEq7=N2h0>O9$q$(a=7OHaPf&j@7nLr3q4JtyxD%Fr(C4^){vM~Y2w%&*$ zqoXJuSWzm62a2Mo2;x=hQLS=TQAQDOlwz&U*mQ${I+gzZ*nQvI@AvzT_r0|>+1kL! z2&-m308vriz!7|a?J3~M&1!8rfB>D^o(_Pm4dx}2q(Q>t=}lY}MkL`}HKF5KRR*4b z%jbcRP^&?u*5V|RgfGzOrD*5LY8266QZ!zqF5_9zTdD@b}{jB>X^$zZmHSN<}kb^CdBIMQ<$1lA^suSu7T=#h*(U z7w`mPv6#mf@`OS^%EQl;t|wJiKfTGLPeG2G)JBbg)DU{auBb{P%%l{hGJRiy&d@LW z*lIA6f$hXwa><%HU-!}Vkz7yG~sACPMw2c3b6EXR$Sg*c`# z5;~-(Y>8&zT*L$F^>VR+bCC_m z(lf9CtD&wCWcvdw2ef{`)C#6kPngc2+reNmdcb5lI5;{uFj*`oCl-tSDIgez8FU7V z$z%;4#2Pes=nx7+hxR!2zS!@rPkH^8tp;!$!FYhd5C_mW5X^yW=fENWL4XEBAN~M< z&UB!`jtuBMKKcOJGad#YI?bL8&Efqg7^2Y`fXQ)oaj0E39F@De`^$tLN55DY#IZ}; zi|yBdI5c->8T>+!CJeK+05%nu#(_B?6r3w>c%y)!A8Y3EN3xkPv}9V#qSo!+sqWNH zYW9SScOJwpay`yEa%J1WgvPU?A^S_mpLef0OfO)@bhm_=5*llLSeJrRijJF3)Q`%p zID25L^5=A8^~=kN$rX2UyQ23eI-gunUB7hJnJR2)UE_Ur%$OIll6=7{_FZqog1vOb zE1#|1Df(meIlf6swq*Zi{AOTcZeX=VhL10bIqjKOkB6`(zL{ltZe(`W>C9`-<`_fLTF#3z8;kR9 zeg(Dejto)m$klx5ea#Gx9?m&<+XXAgajz|I8pP7>2$(955X#fmwTZ4iei#{AJiE4X zpRsgw(S_fq)Q;J=h3)kHjn?kAnJTJFu>MiTp}?VTM0?(z)X|CFsc+AYMGNMo$cC?< zH&-%s^*8=V^jbtQW>@icxmvzr)Hp@Zo62YDmRFabSi71Qm!Ijnldo96L788EpV{eF zuFCgnRv&7Jt}u_C&?#8%d2Cj3CN!em2OSr@bnm-Ue`ni3eAl0+i)e1Hw-X9k8>bv- znl*dU^zD?f z*}#dqt6SfN{PSB&*_<0pn6~rC>#E?`rf_OpHoi!TihR90yK_-oNnDD#AnoGA=i+yv zDls5QLownF= zw65Z>xf@pKO_60g=Z^CXzNDhDAKJh;HmBjjDD>-f3Fl-NT->r=R;H(f=6BR@X0>)q zT$?V;LFd#(?hI6|M#(qSIh*nxhi%-GQJVj{>emi&{HC~eLvDNHCN`51s_D!y6ql|1 K&$aNeHUA4eW4Lwz literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/087-ICON_Cancel_E.jpg b/buildroot/share/dwin/icons-6/087-ICON_Cancel_E.jpg new file mode 100644 index 0000000000000000000000000000000000000000..db1642e00c59e0ab5044af1d86adaffcc0062ac9 GIT binary patch literal 2170 zcmaJ>c~}z%7N5z4gdm84)}m-OCMyDkBojHm0AwDwAEF&mNno>yWNtVghTta?E7Qpz4yJ}?;Z2r zID4FTfPgrgZan}EW}J#AzGbY%ou7p$Dr#pVn!NI#*rCfkxbp&8;r<18xrN} z4OwcTh7q-dzSt(Rp#~H&E9o{gTW=EC#0)pN2-jV1HiPaCF=vSx(XOoYbXhVz7BeDr z9*ZBYh8J?_0wD|LbA;T5VRSAB7O*)2HXISofkhm?C_+dd7Y3fqs97&sA&DQ)gV#H2Rr3}zjsr@I)HD$HUQ zGw@2sT0jkxw0}6OR{~|S{~wB?t^v4dP39HI%Xl_yS>M44229z)CQ+1x57c39RNN7M>F8S_jmC zXOakcq6{rP6sgEy|93$6+a=+*$-?52$KTg8brjO5YdC^5)YDxTSz1_*^^8rQ7B$s z6pHt61%x2TgXlpaktjaXDARm=r{m)5>kb-!d5>AY#Z6kyR)FdW1OXZdqyhvg2vI?2 z8;}oxWAgGBK=gn}Ao+K00CW{R0|1Ex5F&UGA`Xzppv-R z@@=L-WI4QM=36t+(2p}0)H5ladqV9`?i8#_88$LMJYuWhHtoB0%_#IAk!KVEzju)t z3BKEcB*u!R6@sWD;hfz~^`DnrZ~}*lXf^9=3ywFUqVw~c^PZR4L#;`fzXTU1Ri)qR z^gF$0?#8o6_SWUJ&uM7)d%)_Lc{wOG!K=`JXk(|bSMFlGA`=f4PAN!>Y(275oxKC-!?+;PLEZtJgVtV&w&Lv!eRQ5#qXD{7yo z!q22HOrZ^1Lypy~!_aB0w0f>2r$Tyl-jMmjVEX**I-4(EYCFGX2;X&``>r}T6?0a zxb9uq2pOy0*|N6Jk!;_jrOiJ*{GVqZ9OFrP7Y^rEz4&>1SWmY3y{9#eDr>-vVYOv- zX{2`f`=^gu(H2E7Z)z3?({8hiZ^$z&;%;1H1mquD`mb`%J{IQK7@VbrFPpZNGe%_&R?^ z>pES>t=n10*J_U_dIzf{(EiHH`?E{@=8#V|7fy*_VDL!M;{kHuL-|?^ZUlbTLx3Phw?lN z_6}*k4q3EuqtA~I|GC$HU!_Vqa|pA@9Q|LRFgc@9zj}JR!f)gv;dWp4Fz1Z#pK|tB zs(7?=W_5++U&WyX_R>RT*1nNdRs2+||NVCd`edh?svn#}50+Q{y%GtW9Tehi6+0fP iXLsH&@GL1EPLLL%CmL5JzjC%?XY9J?vAs@n_Wlpn)e)@# literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/088-ICON_Confirm_C.jpg b/buildroot/share/dwin/icons-6/088-ICON_Confirm_C.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6f441efb82cbd36c3b0d03b7d8e01d0ae32985ee GIT binary patch literal 2471 zcmaJ>d010d7Jn}r39|GFrGgb=pvWTG!;%u#5Cx6HDog!Zvpgg~7Lou7bV?CK5IPD) zWJGb?s)+0`2pJVEBLXUF6(WcoJ}DLvtrgMMYUTw&@%w7eA20WuoZs*K&b{YegWfO( zEDO;{5&~pwie>Pd3AcIBz7Rno^v|j^y&@Yat$oG~ZNa zW+pk4L6$4GP-s3rJ`^gQLZ^Em86GOFOfArO$W)FC3|v?xQc4tRiCjiBG75z9bTx;B zD1F_6RPl!PPxoq3BA@@)sZyzN1LkN|>PYyl-ajQ)MQar>B@$N2)0H9^Nq01Y73^Ro zEKtjp(Qg_q5gf|pkPsHK zL?UMMLcDoYZx)NirEzJrkiZ}=jp-di3-M+Ic~QN2+yyLGE=rfeGW7yh{1)r^UaWB( zqza@m7gkC#U@=cAmlEgNW=r0$h4Eg#d93*TTA1&}QV=l|W`5&{_-n+Oro}mkX@PIQQMuQN5f#ZIw!=){^h{i6msIZ_{eDq1pW0D7Y!$(=oMMKR}x zT?(xmW5=x>%Z}bJL{HFTZh6Ivsz#t9JKbK3gKezjn>+N1jLRoyzxtzjedsjm>V=rA zw+W~{RbRIAw%y2Ue;IXlD7i}h#i8lhOm^iDQ_m8VQx(-!Ueh%LdcU@tBQC-eJAJjJ zcIp7Wa5mfY+|aa6H!kV(?Cl@@mtDm14JX%49ZqP_ZGX(`dfxQYGoqsvRMPrgAl+*; zt~+n}VVjxXtDmee&zinoaDO1_+S9(+`uL&yqb&x2U!tnrSPK`pAFMw`MR~;-05OAc z@9y0z@rggiGw@v(8<{flaA|Lf&aaO?X4?#xfThI{iGT7{W&f{BI31Jy&DREB4NUzz zX^&NXY}A=0AdbrYF0A!S+bP#w1p(WeNtS~hWV8k6RfL0|tADV={ofT6>G4(n=xJlD zvY9~ng0_Se4kNWmGk;GYpC6f#CeMB*4S5thF_~fWv>nFrYSLHj&j`DiZ^{c*Inrr< zeoeN5_Dc*=$%TCO!5^icv<~>viIr=+OOM*rhczuex@QSLH*-wu8i$(Lr+EV%qocE1 zBk%o^(bl?mifuEf-(fSY-My>65m2ui_Dx*B!J0ksJ{XSTSi3d+gmO?AEV-(>+SbyMqPFuSmhq@;CZ{vL;BdhLqdE}Nu8E6ZeJ0k zeBNyyXKT_to1$|$7M1eC{q)*YcF*T42CF;6My;x{>{e^aTN)#`2fr+nP85#wB7D!Z zk2*Uw9oad_R-EX3c=`${$Tlq` zgavg3STe~ZU|r88%bo4}^cRY&*LSee5BN2>F1k_?%9*%hvbvs|Ee+Yylwp%TcfE4k zDgkhj8g*o&y&Yt>6uYZ@X;*=nE>&wkR_h<`ZNJ|pW8~Dmk+!m#jumFd#Xe!VN8Iq3 zXl%tdRh@0Iyyn}Hd}sYvouoG2{x!pWPTrV2XDuqYNGt576-Vse0hizWA%cInA-4WjlZwmA zjj7srx#E)&&8+~B@d4INRN{H!*AM|JESd4Fd{|zXo%hjk!MXA+oex*{fX>T$%hv+S zi+$1}libvs`%he+ot)TkIk2X{?*ZyE=X2+ox^~>7CX0R`yas|3b(f0^G#Kw(mY`i{H2$ H!>#`VsArrs literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/089-ICON_Confirm_E.jpg b/buildroot/share/dwin/icons-6/089-ICON_Confirm_E.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5f424b67ea7c0860166632aadb36ece5ddb943fa GIT binary patch literal 2841 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 RVfmik%lF&=Wk62U^ literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-6/091-ICON_Info_1.jpg b/buildroot/share/dwin/icons-6/091-ICON_Info_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cde9c0b064e25ace2783184bcdbc4d807d0e62af GIT binary patch literal 3465 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 I9*8ygU(%eKsQ>@~ literal 0 HcmV?d00001 diff --git a/buildroot/share/dwin/icons-svg/alert.svg b/buildroot/share/dwin/icons-svg/alert.svg new file mode 100644 index 000000000000..e98bd58bd8e1 --- /dev/null +++ b/buildroot/share/dwin/icons-svg/alert.svg @@ -0,0 +1,85 @@ + + + + + + + + image/svg+xml + + + + + + + + ! + + diff --git a/buildroot/share/dwin/icons-svg/bed_flat_old.svg b/buildroot/share/dwin/icons-svg/bed_flat_old.svg new file mode 100644 index 000000000000..e4b860bc7158 --- /dev/null +++ b/buildroot/share/dwin/icons-svg/bed_flat_old.svg @@ -0,0 +1,72 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/bed_flat_on.svg b/buildroot/share/dwin/icons-svg/bed_flat_on.svg new file mode 100644 index 000000000000..a87b0c0ff071 --- /dev/null +++ b/buildroot/share/dwin/icons-svg/bed_flat_on.svg @@ -0,0 +1,91 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/bed_leveled_off.svg b/buildroot/share/dwin/icons-svg/bed_leveled_off.svg new file mode 100644 index 000000000000..161b8d11d457 --- /dev/null +++ b/buildroot/share/dwin/icons-svg/bed_leveled_off.svg @@ -0,0 +1,83 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/bed_leveled_on.svg b/buildroot/share/dwin/icons-svg/bed_leveled_on.svg new file mode 100644 index 000000000000..bda0c77a9ebc --- /dev/null +++ b/buildroot/share/dwin/icons-svg/bed_leveled_on.svg @@ -0,0 +1,103 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/bed_off.svg b/buildroot/share/dwin/icons-svg/bed_off.svg new file mode 100644 index 000000000000..936710e49bda --- /dev/null +++ b/buildroot/share/dwin/icons-svg/bed_off.svg @@ -0,0 +1,64 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/bed_on.svg b/buildroot/share/dwin/icons-svg/bed_on.svg new file mode 100644 index 000000000000..61218e57a6a2 --- /dev/null +++ b/buildroot/share/dwin/icons-svg/bed_on.svg @@ -0,0 +1,84 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/bedline.svg b/buildroot/share/dwin/icons-svg/bedline.svg new file mode 100644 index 000000000000..51670b7a196a --- /dev/null +++ b/buildroot/share/dwin/icons-svg/bedline.svg @@ -0,0 +1,64 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/down_arrow.svg b/buildroot/share/dwin/icons-svg/down_arrow.svg new file mode 100644 index 000000000000..9c1d07efe064 --- /dev/null +++ b/buildroot/share/dwin/icons-svg/down_arrow.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/fan.svg b/buildroot/share/dwin/icons-svg/fan.svg new file mode 100644 index 000000000000..0040f26b6b8e --- /dev/null +++ b/buildroot/share/dwin/icons-svg/fan.svg @@ -0,0 +1,155 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/halted.svg b/buildroot/share/dwin/icons-svg/halted.svg new file mode 100644 index 000000000000..38a78384bcdc --- /dev/null +++ b/buildroot/share/dwin/icons-svg/halted.svg @@ -0,0 +1,83 @@ + + + + + + + + image/svg+xml + + + + + + + + X + + diff --git a/buildroot/share/dwin/icons-svg/hotend_off.svg b/buildroot/share/dwin/icons-svg/hotend_off.svg new file mode 100644 index 000000000000..14da6a23ebfb --- /dev/null +++ b/buildroot/share/dwin/icons-svg/hotend_off.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/hotend_on.svg b/buildroot/share/dwin/icons-svg/hotend_on.svg new file mode 100644 index 000000000000..f112ba186b06 --- /dev/null +++ b/buildroot/share/dwin/icons-svg/hotend_on.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/question.svg b/buildroot/share/dwin/icons-svg/question.svg new file mode 100644 index 000000000000..8d8849ca4e56 --- /dev/null +++ b/buildroot/share/dwin/icons-svg/question.svg @@ -0,0 +1,75 @@ + + + + + + + + image/svg+xml + + + + + + + + ? + + diff --git a/buildroot/share/dwin/icons-svg/rotate_ccw.svg b/buildroot/share/dwin/icons-svg/rotate_ccw.svg new file mode 100644 index 000000000000..8b007725c674 --- /dev/null +++ b/buildroot/share/dwin/icons-svg/rotate_ccw.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/rotate_cw.svg b/buildroot/share/dwin/icons-svg/rotate_cw.svg new file mode 100644 index 000000000000..446ad519ec0c --- /dev/null +++ b/buildroot/share/dwin/icons-svg/rotate_cw.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/buildroot/share/dwin/icons-svg/up_arrow.svg b/buildroot/share/dwin/icons-svg/up_arrow.svg new file mode 100644 index 000000000000..bc20be269339 --- /dev/null +++ b/buildroot/share/dwin/icons-svg/up_arrow.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/buildroot/share/dwin/make_jpgs.sh b/buildroot/share/dwin/make_jpgs.sh new file mode 100755 index 000000000000..0acace7388df --- /dev/null +++ b/buildroot/share/dwin/make_jpgs.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +mkdir -p icons-3 + +convert -size 48x36 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/hotend_off.svg ./icons-3/001-ICON_HotendOff.jpg +convert -size 48x36 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/hotend_on.svg ./icons-3/002-ICON_HotendOn.jpg + +convert -size 48x36 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/bed_off.svg ./icons-3/003-ICON_BedOff.jpg +convert -size 48x36 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/bed_on.svg ./icons-3/004-ICON_BedOn.jpg + +convert -size 48x48 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/fan.svg ./icons-3/005-ICON_Fan0.jpg +convert -size 48x48 -background "#080808" -quality 100 -sampling-factor 4:4:4 -distort SRT 22.5 ./icons-svg/fan.svg ./icons-3/006-ICON_Fan1.jpg +convert -size 48x48 -background "#080808" -quality 100 -sampling-factor 4:4:4 -distort SRT 45 ./icons-svg/fan.svg ./icons-3/007-ICON_Fan2.jpg +convert -size 48x48 -background "#080808" -quality 100 -sampling-factor 4:4:4 -distort SRT 67.5 ./icons-svg/fan.svg ./icons-3/008-ICON_Fan3.jpg + +convert -size 96x96 -background "#333e44" -quality 100 -sampling-factor 4:4:4 ./icons-svg/halted.svg ./icons-3/009-ICON_Halted.jpg +convert -size 96x96 -background "#333e44" -quality 100 -sampling-factor 4:4:4 ./icons-svg/question.svg ./icons-3/010-ICON_Question.jpg +convert -size 96x96 -background "#333e44" -quality 100 -sampling-factor 4:4:4 ./icons-svg/alert.svg ./icons-3/011-ICON_Alert.jpg + +convert -size 48x48 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/rotate_cw.svg ./icons-3/012-ICON_RotateCW.jpg +convert -size 48x48 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/rotate_ccw.svg ./icons-3/013-ICON_RotateCCW.jpg +convert -size 48x48 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/up_arrow.svg ./icons-3/014-ICON_UpArrow.jpg +convert -size 48x48 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/down_arrow.svg ./icons-3/015-ICON_DownArrow.jpg + +convert -size 48x8 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/bedline.svg ./icons-3/016-ICON_Bedline.jpg + +convert -size 48x36 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/bed_leveled_off.svg ./icons-3/017-ICON_BedLeveledOff.jpg +convert -size 48x36 -background "#080808" -quality 100 -sampling-factor 4:4:4 ./icons-svg/bed_leveled_on.svg ./icons-3/018-ICON_BedLeveledOn.jpg + +rm 3.ICO +./bin/makeIco.py icons-3 3.ICO From ac6c1a9e1266ff1b66715785d989e78f4133547b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 18 Jan 2022 03:01:09 -0600 Subject: [PATCH 040/502] =?UTF-8?q?=F0=9F=92=A5=20Generalize=20extra=20deb?= =?UTF-8?q?ugging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/language.h | 2 +- Marlin/src/gcode/control/M111.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 929992a62f46..c53ebdfbf838 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -254,7 +254,7 @@ #define STR_DEBUG_ERRORS "ERRORS" #define STR_DEBUG_DRYRUN "DRYRUN" #define STR_DEBUG_COMMUNICATION "COMMUNICATION" -#define STR_DEBUG_LEVELING "LEVELING" +#define STR_DEBUG_DETAIL "DETAIL" #define STR_PRINTER_LOCKED "Printer locked! (Unlock with M511 or LCD)" #define STR_WRONG_PASSWORD "Incorrect Password" diff --git a/Marlin/src/gcode/control/M111.cpp b/Marlin/src/gcode/control/M111.cpp index 08c39b762ea4..d6aeb774108b 100644 --- a/Marlin/src/gcode/control/M111.cpp +++ b/Marlin/src/gcode/control/M111.cpp @@ -34,12 +34,12 @@ void GcodeSuite::M111() { static PGMSTR(str_debug_8, STR_DEBUG_DRYRUN); static PGMSTR(str_debug_16, STR_DEBUG_COMMUNICATION); #if ENABLED(DEBUG_LEVELING_FEATURE) - static PGMSTR(str_debug_lvl, STR_DEBUG_LEVELING); + static PGMSTR(str_debug_detail, STR_DEBUG_DETAIL); #endif static PGM_P const debug_strings[] PROGMEM = { str_debug_1, str_debug_2, str_debug_4, str_debug_8, str_debug_16, - TERN_(DEBUG_LEVELING_FEATURE, str_debug_lvl) + TERN_(DEBUG_LEVELING_FEATURE, str_debug_detail) }; SERIAL_ECHO_START(); From 4e72df9a28aeddd3a4e51fc031b602eda2bd0a4b Mon Sep 17 00:00:00 2001 From: Salvatore Bramante Date: Tue, 18 Jan 2022 10:09:06 +0100 Subject: [PATCH 041/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Octopus=20v1.x=20p?= =?UTF-8?q?robe=20pin=20(#23548)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_PRO_V1_0.h | 4 ++++ Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_PRO_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_PRO_V1_0.h index fd367e87c04f..dd8812fe2af9 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_PRO_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_PRO_V1_0.h @@ -37,4 +37,8 @@ #define TEMP_0_PIN PF4 // TH0 #endif +#if !defined(Z_MIN_PROBE_PIN) && DISABLED(BLTOUCH) + #define Z_MIN_PROBE_PIN PC5 // Probe (Proximity switch) port +#endif + #include "pins_BTT_OCTOPUS_V1_common.h" diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h index 04a7d9e0b4b2..8652a815c21b 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -61,11 +61,7 @@ // Z Probe (when not Z_MIN_PIN) // #ifndef Z_MIN_PROBE_PIN - #if ENABLED(BLTOUCH) - #define Z_MIN_PROBE_PIN PB7 - #else - #define Z_MIN_PROBE_PIN PC5 // Probe (Proximity switch) port - #endif + #define Z_MIN_PROBE_PIN PB7 #endif // From d8c5e49281ccb20ca1d4c77342cbed1594b51831 Mon Sep 17 00:00:00 2001 From: Ave6683 <53094187+Ave6683@users.noreply.github.com> Date: Mon, 27 Dec 2021 22:28:27 +0100 Subject: [PATCH 042/502] =?UTF-8?q?=E2=9C=A8=20MagLev=20V4=20probe=20by=20?= =?UTF-8?q?MDD=20(#23192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 11 +++++++++++ Marlin/src/MarlinCore.cpp | 4 ++++ Marlin/src/core/utility.cpp | 3 ++- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/inc/SanityCheck.h | 23 ++++++++++++++++++----- Marlin/src/module/probe.cpp | 15 +++++++++++++++ 6 files changed, 51 insertions(+), 7 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 768654f97aee..a0dae835931b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1094,6 +1094,17 @@ */ //#define BLTOUCH +/** + * MagLev V4 probe by MDD + * + * This probe is deployed and activated by powering a built-in electromagnet. + */ +//#define MAGLEV4 +#if ENABLED(MAGLEV4) + //#define MAGLEV_TRIGGER_PIN 11 // Set to the connected digital output + #define MAGLEV_TRIGGER_DELAY 15 // Changing this risks overheating the coil +#endif + /** * Touch-MI Probe by hotends.fr * diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 7e3151c44652..2c290306693a 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1502,6 +1502,10 @@ void setup() { SETUP_RUN(bltouch.init(/*set_voltage=*/true)); #endif + #if ENABLED(MAGLEV4) + OUT_WRITE(MAGLEV_TRIGGER_PIN, LOW); + #endif + #if ENABLED(I2C_POSITION_ENCODERS) SETUP_RUN(I2CPEM.init()); #endif diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index cc3b1ace2fdb..19e76267447d 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -74,7 +74,8 @@ void safe_delay(millis_t ms) { TERN_(Z_PROBE_SLED, "Z_PROBE_SLED") TERN_(Z_PROBE_ALLEN_KEY, "Z_PROBE_ALLEN_KEY") TERN_(SOLENOID_PROBE, "SOLENOID_PROBE") - TERN(PROBE_SELECTED, "", "NONE") + TERN_(MAGLEV4, "MAGLEV4") + IF_DISABLED(PROBE_SELECTED, "NONE") ); #if HAS_BED_PROBE diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 8393f3a53cda..4386964744dc 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -834,7 +834,7 @@ /** * Set a flag for any type of bed probe, including the paper-test */ -#if ANY(HAS_Z_SERVO_PROBE, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, SOLENOID_PROBE, SENSORLESS_PROBING, RACK_AND_PINION_PROBE) +#if ANY(HAS_Z_SERVO_PROBE, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, SOLENOID_PROBE, SENSORLESS_PROBING, RACK_AND_PINION_PROBE, MAGLEV4) #define HAS_BED_PROBE 1 #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index ee01dbd16d02..f44ef43f091f 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1509,8 +1509,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS */ #if 1 < 0 \ + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \ - + COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING) - #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." + + COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4) + #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, MAGLEV4, or Z Servo." #endif #if HAS_BED_PROBE @@ -1612,6 +1612,19 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif + /** + * MagLev V4 probe requirements + */ + #if ENABLED(MAGLEV4) + #if !PIN_EXISTS(MAGLEV_TRIGGER) + #error "MAGLEV4 requires MAGLEV_TRIGGER_PIN to be defined." + #elif DISABLED(Z_SAFE_HOMING) + #error "MAGLEV4 requires Z_SAFE_HOMING." + #elif MAGLEV_TRIGGER_DELAY != 15 + #error "MAGLEV_TRIGGER_DELAY should not be changed. Comment out this line to continue." + #endif + #endif + /** * Require pin options and pins to be defined */ @@ -1699,11 +1712,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Require some kind of probe for bed leveling and probe testing */ #if HAS_ABL_NOT_UBL && !PROBE_SELECTED - #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo." + #error "Auto Bed Leveling requires either PROBE_MANUALLY, SENSORLESS_PROBING, or a real probe." #endif #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." + #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a real probe." #endif #endif @@ -3447,7 +3460,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #if ENABLED(MECHANICAL_GANTRY_CALIBRATION) #if NONE(HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC, HAS_TRINAMIC_CONFIG, HAS_MOTOR_CURRENT_PWM) - #error "It is highly recommended to have adjustable current drivers to prevent damage. Disable this line to continue anyway." + #error "Adjustable current drivers are highly recommended to prevent damage. Comment out this line to continue anyway." #elif !defined(GANTRY_CALIBRATION_CURRENT) #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_CURRENT to be set." #elif !defined(GANTRY_CALIBRATION_EXTRA_HEIGHT) diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 6dd337089cf7..cc3851597bdf 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -121,6 +121,17 @@ xyz_pos_t Probe::offset; // Initialized by settings.load() #endif } +#elif ENABLED(MAGLEV4) + + // Write trigger pin to release the probe + inline void maglev_deploy() { + WRITE(MAGLEV_TRIGGER_PIN, HIGH); + delay(MAGLEV_TRIGGER_DELAY); + WRITE(MAGLEV_TRIGGER_PIN, LOW); + } + + inline void maglev_idle() { do_blocking_move_to_z(10); } + #elif ENABLED(TOUCH_MI_PROBE) // Move to the magnet to unlock the probe @@ -311,6 +322,10 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { WRITE(SOL1_PIN, deploy); #endif + #elif ENABLED(MAGLEV4) + + deploy ? maglev_deploy() : maglev_idle(); + #elif ENABLED(Z_PROBE_SLED) dock_sled(!deploy); From 8695f462b757eb0762d9b108f2329ebc9f7e1678 Mon Sep 17 00:00:00 2001 From: "A. Herlas" <45262264+protektwar@users.noreply.github.com> Date: Sun, 16 Jan 2022 06:08:31 +0100 Subject: [PATCH 043/502] =?UTF-8?q?=E2=9C=A8=20Z=20Offset=20Wizard=20for?= =?UTF-8?q?=20TFT=5FLVGL=5FUI=20(English)=20(#23489)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 55 +++-- .../lcd/extui/mks_ui/draw_level_settings.cpp | 11 +- Marlin/src/lcd/extui/mks_ui/draw_ui.cpp | 14 ++ Marlin/src/lcd/extui/mks_ui/draw_ui.h | 2 + .../lcd/extui/mks_ui/draw_z_offset_wizard.cpp | 228 ++++++++++++++++++ .../lcd/extui/mks_ui/draw_z_offset_wizard.h | 36 +++ Marlin/src/lcd/extui/mks_ui/tft_Language_en.h | 3 + .../lcd/extui/mks_ui/tft_multi_language.cpp | 14 +- .../src/lcd/extui/mks_ui/tft_multi_language.h | 5 + Marlin/src/lcd/menu/menu_probe_offset.cpp | 10 +- Marlin/src/module/probe.h | 8 + 11 files changed, 343 insertions(+), 43 deletions(-) create mode 100644 Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp create mode 100644 Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.h diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index dae41f814fe1..0bcd41fd5299 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1280,37 +1280,36 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif +#if HAS_BED_PROBE && EITHER(HAS_LCD_MENU, HAS_TFT_LVGL_UI) + //#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu + #if ENABLED(PROBE_OFFSET_WIZARD) + /** + * Enable to init the Probe Z-Offset when starting the Wizard. + * Use a height slightly above the estimated nozzle-to-probe Z offset. + * For example, with an offset of -5, consider a starting height of -4. + */ + //#define PROBE_OFFSET_WIZARD_START_Z -4.0 + + // Set a convenient position to do the calibration (probing point and nozzle/bed-distance) + //#define PROBE_OFFSET_WIZARD_XY_POS { X_CENTER, Y_CENTER } + #endif +#endif + #if HAS_LCD_MENU // Add Probe Z Offset calibration to the Z Probe Offsets menu - #if HAS_BED_PROBE - //#define PROBE_OFFSET_WIZARD - #if ENABLED(PROBE_OFFSET_WIZARD) - // - // Enable to init the Probe Z-Offset when starting the Wizard. - // Use a height slightly above the estimated nozzle-to-probe Z offset. - // For example, with an offset of -5, consider a starting height of -4. - // - //#define PROBE_OFFSET_WIZARD_START_Z -4.0 - - // Set a convenient position to do the calibration (probing point and nozzle/bed-distance) - //#define PROBE_OFFSET_WIZARD_XY_POS { X_CENTER, Y_CENTER } - #endif - - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - // Add a calibration procedure in the Probe Offsets menu - // to compensate for twist in the X-axis. - //#define X_AXIS_TWIST_COMPENSATION - #if ENABLED(X_AXIS_TWIST_COMPENSATION) - /** - * Enable to init the Probe Z-Offset when starting the Wizard. - * Use a height slightly above the estimated nozzle-to-probe Z offset. - * For example, with an offset of -5, consider a starting height of -4. - */ - #define XATC_START_Z 0.0 - #define XATC_MAX_POINTS 3 // Number of points to probe in the wizard - #define XATC_Y_POSITION Y_CENTER // (mm) Y position to probe - #endif + #if BOTH(HAS_BED_PROBE, AUTO_BED_LEVELING_BILINEAR) + // Add calibration in the Probe Offsets menu to compensate for X-axis twist. + //#define X_AXIS_TWIST_COMPENSATION + #if ENABLED(X_AXIS_TWIST_COMPENSATION) + /** + * Enable to init the Probe Z-Offset when starting the Wizard. + * Use a height slightly above the estimated nozzle-to-probe Z offset. + * For example, with an offset of -5, consider a starting height of -4. + */ + #define XATC_START_Z 0.0 + #define XATC_MAX_POINTS 3 // Number of points to probe in the wizard + #define XATC_Y_POSITION Y_CENTER // (mm) Y position to probe #endif #endif diff --git a/Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp b/Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp index 93d34a85785c..aee5573283e7 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp @@ -36,7 +36,8 @@ enum { ID_LEVEL_RETURN = 1, ID_LEVEL_POSITION, ID_LEVEL_COMMAND, - ID_LEVEL_ZOFFSET + ID_LEVEL_ZOFFSET, + ID_Z_OFFSET_WIZARD }; static void event_handler(lv_obj_t *obj, lv_event_t event) { @@ -57,6 +58,11 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { case ID_LEVEL_ZOFFSET: lv_draw_auto_level_offset_settings(); break; + #if ENABLED(PROBE_OFFSET_WIZARD) + case ID_Z_OFFSET_WIZARD: + lv_draw_z_offset_wizard(); + break; + #endif #endif } } @@ -67,6 +73,9 @@ void lv_draw_level_settings() { lv_screen_menu_item(scr, machine_menu.LevelingAutoCommandConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_LEVEL_COMMAND, 1); #if HAS_BED_PROBE lv_screen_menu_item(scr, machine_menu.LevelingAutoZoffsetConf, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_LEVEL_ZOFFSET, 2); + #if ENABLED(PROBE_OFFSET_WIZARD) + lv_screen_menu_item(scr, machine_menu.LevelingZoffsetWizard, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_Z_OFFSET_WIZARD, 3); + #endif #endif lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_LEVEL_RETURN, true); } diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp index aa6fe5e063ed..d3f192e44f70 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp @@ -456,6 +456,10 @@ char *getDispText(int index) { } break; case MOVE_MOTOR_UI: strcpy(public_buf_l, move_menu.title); break; + + #if ENABLED(PROBE_OFFSET_WIZARD) + case Z_OFFSET_WIZARD_UI: break; + #endif case OPERATE_UI: switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) { IF_DISABLED(TFT35, case OPERATE_UI: case PAUSE_UI:) @@ -785,6 +789,10 @@ void GUI_RefreshPage() { case MOVE_MOTOR_UI: break; + #if ENABLED(PROBE_OFFSET_WIZARD) + case Z_OFFSET_WIZARD_UI: break; + #endif + #if ENABLED(MKS_WIFI_MODULE) case WIFI_UI: if (temps_update_flag) { @@ -885,6 +893,9 @@ void clear_cur_ui() { case PRINT_FILE_UI: lv_clear_print_file(); break; case PRINTING_UI: lv_clear_printing(); break; case MOVE_MOTOR_UI: lv_clear_move_motor(); break; + #if ENABLED(PROBE_OFFSET_WIZARD) + case Z_OFFSET_WIZARD_UI: lv_clear_z_offset_wizard(); break; + #endif case OPERATE_UI: lv_clear_operation(); break; case PAUSE_UI: break; case EXTRUSION_UI: lv_clear_extrusion(); break; @@ -993,6 +1004,9 @@ void draw_return_ui() { break; case MOVE_MOTOR_UI: lv_draw_move_motor(); break; + #if ENABLED(PROBE_OFFSET_WIZARD) + case Z_OFFSET_WIZARD_UI: lv_draw_z_offset_wizard(); break; + #endif case OPERATE_UI: lv_draw_operation(); break; case PAUSE_UI: break; case EXTRUSION_UI: lv_draw_extrusion(); break; diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/mks_ui/draw_ui.h index 950386f878e5..798e662220ef 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/mks_ui/draw_ui.h @@ -69,6 +69,7 @@ #include "draw_max_feedrate_settings.h" #include "draw_tmc_step_mode_settings.h" #include "draw_level_settings.h" +#include "draw_z_offset_wizard.h" #include "draw_tramming_pos_settings.h" #include "draw_auto_level_offset_settings.h" #include "draw_filament_change.h" @@ -266,6 +267,7 @@ typedef enum { PRINT_FILE_UI, PRINTING_UI, MOVE_MOTOR_UI, + Z_OFFSET_WIZARD_UI, OPERATE_UI, PAUSE_UI, EXTRUSION_UI, diff --git a/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp b/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp new file mode 100644 index 000000000000..d95efd862ba9 --- /dev/null +++ b/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp @@ -0,0 +1,228 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfigPre.h" + +#if BOTH(HAS_TFT_LVGL_UI, PROBE_OFFSET_WIZARD) + +#include "draw_ui.h" +#include + +#include "../../../gcode/queue.h" +#include "../../../module/motion.h" + +#include "../../../module/planner.h" +#include "../../../inc/MarlinConfig.h" +#include "../../../module/probe.h" + +#if HAS_LEVELING + #include "../../../feature/bedlevel/bedlevel.h" + bool leveling_was_active; +#endif + +extern lv_group_t *g; +static lv_obj_t *scr; + +static lv_obj_t *labelV, *buttonV, *labelP; +static lv_obj_t *labelP_z_offset_ref; +static lv_task_t *updatePosTask; +static char cur_label = 'Z'; +static float cur_pos = 0; +static float cur_OffsetPos = 0; + +// Global storage +float z_offset_backup, calculated_z_offset, z_offset_ref; + +enum { + ID_M_Z_P = 1, + ID_M_Z_N, + ID_M_STEP, + ID_M_SAVE, + ID_M_RETURN +}; + +void disp_cur_wizard_pos() { + char str_1[18]; + sprintf_P(public_buf_l, PSTR("%c:%s mm"), cur_label, dtostrf(cur_pos, 1, 3, str_1)); + if (labelP) lv_label_set_text(labelP, public_buf_l); + + sprintf_P(public_buf_l, PSTR("%c Offset:%s mm"), cur_label, dtostrf(cur_OffsetPos, 1, 3, str_1)); + if (labelP_z_offset_ref) lv_label_set_text(labelP_z_offset_ref, public_buf_l); +} + +static void event_handler(lv_obj_t *obj, lv_event_t event) { + char str_1[16]; + if (event != LV_EVENT_RELEASED) return; + //lv_clear_z_offset_wizard(); + if (!queue.ring_buffer.full(3)) { + bool do_inject = true; + float dist = uiCfg.move_dist; + switch (obj->mks_obj_id) { + case ID_M_Z_N: dist *= -1; case ID_M_Z_P: cur_label = 'Z'; break; + default: do_inject = false; + } + if (do_inject) { + sprintf_P(public_buf_l, PSTR("G91\nG1 %c%s F%d\nG90"), cur_label, dtostrf(dist, 1, 3, str_1), uiCfg.moveSpeed); + queue.inject(public_buf_l); + //calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref; + disp_cur_wizard_pos(); + } + } + + switch (obj->mks_obj_id) { + case ID_M_STEP: + if (ABS((int)(10 * uiCfg.move_dist)) == 10) + uiCfg.move_dist = 0.025; + else if (ABS((int)(1000 * uiCfg.move_dist)) == 25) + uiCfg.move_dist = 0.1; + else + uiCfg.move_dist *= 10.0f; + disp_move_wizard_dist(); + break; + case ID_M_SAVE: + current_position.z = z_offset_ref; // Set Z to z_offset_ref, as we can expect it is at probe height + probe.offset.z = calculated_z_offset; + sync_plan_position(); + // Raise Z as if it was homed + do_z_clearance(Z_POST_CLEARANCE); + watchdog_refresh(); + draw_return_ui(); + return; + case ID_M_RETURN: + probe.offset.z = z_offset_backup; + SET_SOFT_ENDSTOP_LOOSE(false); + TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); + #if HOMING_Z_WITH_PROBE && defined(PROBE_OFFSET_WIZARD_START_Z) + set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction + queue.inject_P(PSTR("G28Z")); + #else // Otherwise do a Z clearance move like after Homing + do_z_clearance(Z_POST_CLEARANCE); + #endif + watchdog_refresh(); + draw_return_ui(); + return; + } + disp_cur_wizard_pos(); +} + +void refresh_wizard_pos(lv_task_t *) { + switch (cur_label) { + case 'Z': + cur_pos = current_position.z; + calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref; + cur_OffsetPos = calculated_z_offset; + break; + default: return; + } + disp_cur_wizard_pos(); +} + +void lv_draw_z_offset_wizard() { + + set_all_unhomed(); + + // Store probe.offset.z for Case: Cancel + z_offset_backup = probe.offset.z; + + #ifdef PROBE_OFFSET_WIZARD_START_Z + probe.offset.z = PROBE_OFFSET_WIZARD_START_Z; + #endif + + // Store Bed-Leveling-State and disable + #if HAS_LEVELING + leveling_was_active = planner.leveling_active; + set_bed_leveling_enabled(leveling_was_active); + #endif + + queue.inject_P(PSTR("G28")); + + z_offset_ref = 0; // Set Z Value for Wizard Position to 0 + calculated_z_offset = probe.offset.z + current_position.z - z_offset_ref; + cur_OffsetPos = calculated_z_offset; + + scr = lv_screen_create(Z_OFFSET_WIZARD_UI, machine_menu.LevelingZoffsetTitle); + + lv_obj_t *buttonXI = lv_big_button_create(scr, "F:/bmp_zAdd.bin", move_menu.z_add, INTERVAL_V, titleHeight, event_handler, ID_M_Z_P); + lv_obj_clear_protect(buttonXI, LV_PROTECT_FOLLOW); + lv_big_button_create(scr, "F:/bmp_zDec.bin", move_menu.z_dec, INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_Z_N); + + // button with image and label changed dynamically by disp_move_dist + buttonV = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_M_STEP); + labelV = lv_label_create_empty(buttonV); + #if HAS_ROTARY_ENCODER + if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonV); + #endif + + // save and back + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_save, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_SAVE); + // cancel and back + 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_M_RETURN); + + // We need to patch the title to leave some space on the right for displaying the status + lv_obj_t * z_offset_ref_title = lv_obj_get_child_back(scr, nullptr); + if (z_offset_ref_title != nullptr) lv_obj_set_width(z_offset_ref_title, (int)(TFT_WIDTH / 2) - 101); + labelP_z_offset_ref = lv_label_create(scr, (int)(TFT_WIDTH / 2) - 80, (int)(TFT_HEIGHT/2)-20, "Z Offset:0.0mm"); + + // We need to patch the Z Offset to leave some space in the middle for displaying the status + lv_obj_t * title= lv_obj_get_child_back(scr, nullptr); + if (title != nullptr) lv_obj_set_width(title, TFT_WIDTH - 101); + labelP = lv_label_create(scr, TFT_WIDTH - 100, TITLE_YPOS, "Z:0.0mm"); + + if (labelP != nullptr) + updatePosTask = lv_task_create(refresh_wizard_pos, 300, LV_TASK_PRIO_LOWEST, 0); + + disp_move_wizard_dist(); + disp_cur_wizard_pos(); +} + +void disp_move_wizard_dist() { + if ((int)(1000 * uiCfg.move_dist) == 25) + lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move0_1.bin"); + else if ((int)(10 * uiCfg.move_dist) == 1) + lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move1.bin"); + else if ((int)(10 * uiCfg.move_dist) == 10) + lv_imgbtn_set_src_both(buttonV, "F:/bmp_step_move10.bin"); + + if (gCfgItems.multiple_language) { + if ((int)(1000 * uiCfg.move_dist) == 25) { + lv_label_set_text(labelV, move_menu.step_0025mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if ((int)(10 * uiCfg.move_dist) == 1) { + lv_label_set_text(labelV, move_menu.step_01mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + else if ((int)(10 * uiCfg.move_dist) == 10) { + lv_label_set_text(labelV, move_menu.step_1mm); + lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); + } + } +} + +void lv_clear_z_offset_wizard() { + #if HAS_ROTARY_ENCODER + if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g); + #endif + lv_obj_del(scr); +} + +#endif // HAS_TFT_LVGL_UI && PROBE_OFFSET_WIZARD diff --git a/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.h b/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.h new file mode 100644 index 000000000000..47a3d69c46d9 --- /dev/null +++ b/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.h @@ -0,0 +1,36 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifdef __cplusplus + extern "C" { /* C-declarations for C++ */ +#endif + +void lv_draw_z_offset_wizard(); +void refresh_wizard_pos(); +void disp_cur_wizard_pos(); +void disp_move_wizard_dist(); +void lv_clear_z_offset_wizard(); + +#ifdef __cplusplus + } /* C-declarations for C++ */ +#endif diff --git a/Marlin/src/lcd/extui/mks_ui/tft_Language_en.h b/Marlin/src/lcd/extui/mks_ui/tft_Language_en.h index a41864eec479..5195986e3584 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_Language_en.h +++ b/Marlin/src/lcd/extui/mks_ui/tft_Language_en.h @@ -103,6 +103,8 @@ #define LEVELING_AUTO_COMMAND_EN "AutoLeveling command settings" #define LEVELING_AUTO_ZOFFSET_EN "Nozzle-to-probe offsets settings" +#define LEVELING_ZOFFSET_TITLE_EN "Machine Settings>Z Offset Wizard" + #define LEVELING_PARA_CONF_TITLE_EN "leveling setting" #define AUTO_LEVELING_ENABLE_EN "Enable auto leveling" #define BLTOUCH_LEVELING_ENABLE_EN "Enable BLTouch" @@ -293,6 +295,7 @@ #define CLOSE_TEXT_EN "Close" #define BACK_TEXT_EN "Back" +#define SAVE_TEXT_EN "Save" #define TOOL_PREHEAT_EN "Preheat" #define TOOL_EXTRUDE_EN "Extrusion" diff --git a/Marlin/src/lcd/extui/mks_ui/tft_multi_language.cpp b/Marlin/src/lcd/extui/mks_ui/tft_multi_language.cpp index c69ccf65872b..6e9c37b0169e 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_multi_language.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_multi_language.cpp @@ -578,6 +578,8 @@ void machine_setting_disp() { machine_menu.OutLength = FILAMENT_OUT_LENGTH_EN; machine_menu.OutSpeed = FILAMENT_OUT_SPEED_EN; + machine_menu.LevelingZoffsetTitle = LEVELING_ZOFFSET_TITLE_EN; + machine_menu.LevelingParaConfTitle = LEVELING_CONF_TITLE_EN; machine_menu.LevelingParaConf = LEVELING_PARA_CONF_EN; machine_menu.TrammingPosConf = TRAMMING_POS_EN; @@ -767,11 +769,12 @@ void disp_language_init() { move_menu.z_add = AXIS_Z_ADD_TEXT; move_menu.z_dec = AXIS_Z_DEC_TEXT; - move_menu.step_001mm = TEXT_001MM; - move_menu.step_005mm = TEXT_005MM; - move_menu.step_01mm = TEXT_01MM; - move_menu.step_1mm = TEXT_1MM; - move_menu.step_10mm = TEXT_10MM; + move_menu.step_001mm = TEXT_001MM; + move_menu.step_0025mm = TEXT_0025MM; + move_menu.step_005mm = TEXT_005MM; + move_menu.step_01mm = TEXT_01MM; + move_menu.step_1mm = TEXT_1MM; + move_menu.step_10mm = TEXT_10MM; home_menu.home_x = HOME_X_TEXT; home_menu.home_y = HOME_Y_TEXT; @@ -1346,6 +1349,7 @@ void disp_language_init() { case LANG_ENGLISH: common_menu.dialog_confirm_title = TITLE_DIALOG_CONFIRM_EN; common_menu.text_back = BACK_TEXT_EN; + common_menu.text_save = SAVE_TEXT_EN; common_menu.close_machine_tips = DIALOG_CLOSE_MACHINE_EN; common_menu.unbind_printer_tips = DIALOG_UNBIND_PRINTER_EN; common_menu.print_special_title = PRINTING_OTHER_LANGUGE; diff --git a/Marlin/src/lcd/extui/mks_ui/tft_multi_language.h b/Marlin/src/lcd/extui/mks_ui/tft_multi_language.h index 0d0285f322af..2a5135dded4f 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_multi_language.h +++ b/Marlin/src/lcd/extui/mks_ui/tft_multi_language.h @@ -101,6 +101,8 @@ typedef struct machine_common_disp { const char *OutLength; const char *OutSpeed; + const char *LevelingZoffsetTitle; + const char *LevelingParaConfTitle; const char *LevelingParaConf; const char *TrammingPosConf; @@ -294,6 +296,7 @@ extern machine_common_def machine_menu; typedef struct common_menu_disp { const char *text_back; + const char *text_save; const char *dialog_confirm_title; const char *close_machine_tips; const char *unbind_printer_tips; @@ -355,6 +358,7 @@ typedef struct move_menu_disp { const char *z_add; const char *z_dec; const char *step_001mm; + const char *step_0025mm; const char *step_005mm; const char *step_01mm; const char *step_1mm; @@ -777,6 +781,7 @@ extern eeprom_def eeprom_menu; #define AXIS_Z_ADD_TEXT "Z+" #define AXIS_Z_DEC_TEXT "Z-" #define TEXT_001MM "0.01 mm" +#define TEXT_0025MM "0.025 mm" #define TEXT_005MM "0.05 mm" #define TEXT_01MM "0.1 mm" #define TEXT_1MM "1 mm" diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index add739553380..ae785fa641cb 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -45,15 +45,7 @@ void _goto_manual_move_z(const_float_t); float z_offset_backup, calculated_z_offset, z_offset_ref; inline void z_clearance_move() { - do_z_clearance( - #ifdef Z_AFTER_HOMING - Z_AFTER_HOMING - #elif defined(Z_HOMING_HEIGHT) - Z_HOMING_HEIGHT - #else - 10 - #endif - ); + do_z_clearance(Z_POST_CLEARANCE); } void set_offset_and_go_back(const_float_t z) { diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index d9c50b01251f..752e83f46785 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -45,6 +45,14 @@ #define PROBE_TRIGGERED() (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) #endif +#ifdef Z_AFTER_HOMING + #define Z_POST_CLEARANCE Z_AFTER_HOMING +#elif defined(Z_HOMING_HEIGHT) + #define Z_POST_CLEARANCE Z_HOMING_HEIGHT +#else + #define Z_POST_CLEARANCE 10 +#endif + #if ENABLED(PREHEAT_BEFORE_LEVELING) #ifndef LEVELING_NOZZLE_TEMP #define LEVELING_NOZZLE_TEMP 0 From e704de9bb05ac57011ac80700f7bd97c9d45eaff Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Tue, 18 Jan 2022 07:56:11 +0100 Subject: [PATCH 044/502] =?UTF-8?q?=E2=9C=A8=20Long=20filename=20open/crea?= =?UTF-8?q?te/write=20(#23526)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 28 +- Marlin/src/gcode/eeprom/M500-M504.cpp | 2 + Marlin/src/gcode/host/M115.cpp | 8 +- Marlin/src/sd/SdBaseFile.cpp | 584 ++++++++++++++++++++++---- Marlin/src/sd/SdBaseFile.h | 22 +- Marlin/src/sd/cardreader.cpp | 6 +- buildroot/share/scripts/upload.py | 78 ++-- buildroot/tests/mega2560 | 2 +- 8 files changed, 582 insertions(+), 148 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 0bcd41fd5299..ba396431c93b 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1525,33 +1525,23 @@ // LCD's font must contain the characters. Check your selected LCD language. //#define UTF_FILENAME_SUPPORT - // This allows hosts to request long names for files and folders with M33 - //#define LONG_FILENAME_HOST_SUPPORT + //#define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 ' and list long filenames with 'M20 L' + //#define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol - // Enable this option to scroll long filenames in the SD card menu - //#define SCROLL_LONG_FILENAMES + //#define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu - // Leave the heaters on after Stop Print (not recommended!) - //#define SD_ABORT_NO_COOLDOWN + //#define SD_ABORT_NO_COOLDOWN // Leave the heaters on after Stop Print (not recommended!) /** - * This option allows you to abort SD printing when any endstop is triggered. - * This feature must be enabled with "M540 S1" or from the LCD menu. - * To have any effect, endstops must be enabled during SD printing. + * Abort SD printing when any endstop is triggered. + * This feature is enabled with 'M540 S1' or from the LCD menu. + * Endstops must be activated for this option to work. */ //#define SD_ABORT_ON_ENDSTOP_HIT - /** - * This option makes it easier to print the same SD Card file again. - * On print completion the LCD Menu will open with the file selected. - * You can just click to start the print, or navigate elsewhere. - */ - //#define SD_REPRINT_LAST_SELECTED_FILE + //#define SD_REPRINT_LAST_SELECTED_FILE // On print completion open the LCD Menu and select the same file - /** - * Auto-report SdCard status with M27 S - */ - //#define AUTO_REPORT_SD_STATUS + //#define AUTO_REPORT_SD_STATUS // Auto-report media status with 'M27 S' /** * Support for USB thumb drives using an Arduino USB Host Shield or diff --git a/Marlin/src/gcode/eeprom/M500-M504.cpp b/Marlin/src/gcode/eeprom/M500-M504.cpp index a1f295ebde06..412d0033558f 100644 --- a/Marlin/src/gcode/eeprom/M500-M504.cpp +++ b/Marlin/src/gcode/eeprom/M500-M504.cpp @@ -56,6 +56,8 @@ void GcodeSuite::M502() { /** * M503: print settings currently in memory * + * S : Include / exclude header comments in the output. (Default: S1) + * * With CONFIGURATION_EMBEDDING: * C : Save the full Marlin configuration to SD Card as "mc.zip" */ diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index 08943ed5f299..45e0061a5b84 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -154,6 +154,12 @@ void GcodeSuite::M115() { // LONG_FILENAME_HOST_SUPPORT (M33) cap_line(F("LONG_FILENAME"), ENABLED(LONG_FILENAME_HOST_SUPPORT)); + // LONG_FILENAME_WRITE_SUPPORT (M23, M28, M30...) + cap_line(F("LFN_WRITE"), ENABLED(LONG_FILENAME_WRITE_SUPPORT)); + + // CUSTOM_FIRMWARE_UPLOAD (M20 F) + cap_line(F("CUSTOM_FIRMWARE_UPLOAD"), ENABLED(CUSTOM_FIRMWARE_UPLOAD)); + // EXTENDED_M20 (M20 L) cap_line(F("EXTENDED_M20"), ENABLED(LONG_FILENAME_HOST_SUPPORT)); @@ -179,7 +185,7 @@ void GcodeSuite::M115() { cap_line(F("MEATPACK"), SERIAL_IMPL.has_feature(port, SerialFeature::MeatPack)); // CONFIG_EXPORT - cap_line(F("CONFIG_EXPORT"), ENABLED(CONFIG_EMBED_AND_SAVE_TO_SD)); + cap_line(F("CONFIG_EXPORT"), ENABLED(CONFIGURATION_EMBEDDING)); // Machine Geometry #if ENABLED(M115_GEOMETRY_REPORT) diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index b357495a3edb..64d0ad68bd80 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -89,6 +89,7 @@ bool SdBaseFile::addDirCluster() { } // cache a file's directory entry +// cache the current "dirBlock_" and return the entry at index "dirIndex_" // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { if (!vol_->cacheRawBlock(dirBlock_, action)) return nullptr; @@ -384,6 +385,20 @@ int8_t SdBaseFile::lsPrintNext(uint8_t flags, uint8_t indent) { return DIR_IS_FILE(&dir) ? 1 : 2; } +/** + * Calculate a checksum for an 8.3 filename + * + * \param name The 8.3 file name to calculate + * + * \return The checksum byte + */ +uint8_t lfn_checksum(const uint8_t *name) { + uint8_t sum = 0; + for (uint8_t i = 11; i; i--) + sum = ((sum & 1) << 7) + (sum >> 1) + *name++; + return sum; +} + // Format directory name field from a 8.3 name string bool SdBaseFile::make83Name(const char *str, uint8_t *name, const char **ptr) { uint8_t n = 7, // Max index until a dot is found @@ -430,6 +445,10 @@ bool SdBaseFile::mkdir(SdBaseFile *parent, const char *path, bool pFlag) { SdBaseFile *sub = &dir1; SdBaseFile *start = parent; + #if ENABLED(LONG_FILENAME_WRITE_SUPPORT) + uint8_t dlname[LONG_FILENAME_LENGTH]; + #endif + if (!parent || isOpen()) return false; if (*path == '/') { @@ -439,28 +458,31 @@ bool SdBaseFile::mkdir(SdBaseFile *parent, const char *path, bool pFlag) { parent = &dir2; } } - while (1) { - if (!make83Name(path, dname, &path)) return false; + + for (;;) { + if (!TERN(LONG_FILENAME_WRITE_SUPPORT, parsePath(path, dname, dlname, &path), make83Name(path, dname, &path))) return false; while (*path == '/') path++; if (!*path) break; - if (!sub->open(parent, dname, O_READ)) { - if (!pFlag || !sub->mkdir(parent, dname)) + if (!sub->open(parent, dname OPTARG(LONG_FILENAME_WRITE_SUPPORT, dlname), O_READ)) { + if (!pFlag || !sub->mkdir(parent, dname OPTARG(LONG_FILENAME_WRITE_SUPPORT, dlname))) return false; } if (parent != start) parent->close(); parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; } - return mkdir(parent, dname); + return mkdir(parent, dname OPTARG(LONG_FILENAME_WRITE_SUPPORT, dlname)); } -bool SdBaseFile::mkdir(SdBaseFile *parent, const uint8_t dname[11]) { +bool SdBaseFile::mkdir(SdBaseFile *parent, const uint8_t dname[11] + OPTARG(LONG_FILENAME_WRITE_SUPPORT, const uint8_t dlname[LONG_FILENAME_LENGTH]) +) { if (ENABLED(SDCARD_READONLY)) return false; if (!parent->isDir()) return false; // create a normal file - if (!open(parent, dname, O_CREAT | O_EXCL | O_RDWR)) return false; + if (!open(parent, dname OPTARG(LONG_FILENAME_WRITE_SUPPORT, dlname), O_CREAT | O_EXCL | O_RDWR)) return false; // convert file to directory flags_ = O_READ; @@ -578,6 +600,10 @@ bool SdBaseFile::open(SdBaseFile *dirFile, const char *path, uint8_t oflag) { SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile, *sub = &dir1; + #if ENABLED(LONG_FILENAME_WRITE_SUPPORT) + uint8_t dlname[LONG_FILENAME_LENGTH]; + #endif + if (!dirFile || isOpen()) return false; if (*path == '/') { // Path starts with '/' @@ -589,90 +615,244 @@ bool SdBaseFile::open(SdBaseFile *dirFile, const char *path, uint8_t oflag) { } for (;;) { - if (!make83Name(path, dname, &path)) return false; + if (!TERN(LONG_FILENAME_WRITE_SUPPORT, parsePath(path, dname, dlname, &path), make83Name(path, dname, &path))) return false; while (*path == '/') path++; if (!*path) break; - if (!sub->open(parent, dname, O_READ)) return false; + if (TERN0(LONG_FILENAME_WRITE_SUPPORT, !sub->open(parent, dname, dlname, O_READ))) return false; if (parent != dirFile) parent->close(); parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; } - return open(parent, dname, oflag); + return open(parent, dname OPTARG(LONG_FILENAME_WRITE_SUPPORT, dlname), oflag); } -// open with filename in dname -bool SdBaseFile::open(SdBaseFile *dirFile, const uint8_t dname[11], uint8_t oflag) { +// open with filename in dname and long filename in dlname +bool SdBaseFile::open(SdBaseFile *dirFile, const uint8_t dname[11] + OPTARG(LONG_FILENAME_WRITE_SUPPORT, const uint8_t dlname[LONG_FILENAME_LENGTH]) + , uint8_t oflag +) { bool emptyFound = false, fileFound = false; - uint8_t index; + uint8_t index = 0; dir_t *p; - vol_ = dirFile->vol_; + #if ENABLED(LONG_FILENAME_WRITE_SUPPORT) + // LFN - Long File Name support + const bool useLFN = dlname[0] != 0; + bool lfnFileFound = false; + vfat_t *pvFat; + uint8_t emptyCount = 0, + emptyIndex = 0, + reqEntriesNum = useLFN ? getLFNEntriesNum((char*)dlname) + 1 : 1, + lfnNameLength = useLFN ? strlen((char*)dlname) : 0, + lfnName[LONG_FILENAME_LENGTH], + lfnSequenceNumber = 0, + lfnChecksum = 0; + #endif + // Rewind this dir + vol_ = dirFile->vol_; dirFile->rewind(); - // search for file + // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { - index = 0xF & (dirFile->curPosition_ >> 5); - p = dirFile->readDirCache(); - if (!p) return false; + // Get absolute index position + index = (dirFile->curPosition_ >> 5) IF_DISABLED(LONG_FILENAME_WRITE_SUPPORT, & 0x0F); + // Get next entry + if (!(p = dirFile->readDirCache())) return false; + + // Check empty status: Is entry empty? if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { - // remember first empty slot + // Count the contiguous available entries in which (eventually) fit the new dir entry, if it's a write operation if (!emptyFound) { - dirBlock_ = dirFile->vol_->cacheBlockNumber(); - dirIndex_ = index; - emptyFound = true; + #if ENABLED(LONG_FILENAME_WRITE_SUPPORT) + if (emptyCount == 0) emptyIndex = index; + // Incr empty entries counter + // If found the required empty entries, mark it + if (++emptyCount == reqEntriesNum) { + dirBlock_ = dirFile->vol_->cacheBlockNumber(); + dirIndex_ = index & 0xF; + emptyFound = true; + } + #else + dirBlock_ = dirFile->vol_->cacheBlockNumber(); + dirIndex_ = index; + emptyFound = true; + #endif } - // done if no entries follow + // Done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } - else if (!memcmp(dname, p->name, 11)) { - fileFound = true; - break; + else { // Entry not empty + #if ENABLED(LONG_FILENAME_WRITE_SUPPORT) + // Reset empty counter + if (!emptyFound) emptyCount = 0; + // Search for SFN or LFN? + if (!useLFN) { + // Check using SFN: file found? + if (!memcmp(dname, p->name, 11)) { + fileFound = true; + break; + } + } + else { + // Check using LFN: LFN not found? continue search for LFN + if (!lfnFileFound) { + // Is this dir a LFN? + if (isDirLFN(p)) { + // Get VFat dir entry + pvFat = (vfat_t *) p; + // Get checksum from the last entry of the sequence + if (pvFat->sequenceNumber & 0x40) lfnChecksum = pvFat->checksum; + // Get LFN sequence number + lfnSequenceNumber = pvFat->sequenceNumber & 0x1F; + if WITHIN(lfnSequenceNumber, 1, reqEntriesNum) { + // Check checksum for all other entries with the starting checksum fetched before + if (lfnChecksum == pvFat->checksum) { + // Set chunk of LFN from VFAT entry into lfnName + getLFNName(pvFat, (char *)lfnName, lfnSequenceNumber); + // LFN found? + if (!strncasecmp((char*)dlname, (char*)lfnName, lfnNameLength)) lfnFileFound = true; + } + } + } + } + else { // Complete LFN found, check for related SFN + // Check if only the SFN checksum match because the filename may be different due to different truncation methods + if (!isDirLFN(p) && (lfnChecksum == lfn_checksum(p->name))) { + fileFound = true; + break; + } + else lfnFileFound = false; // SFN not valid for the LFN found, reset LFN FileFound + } + } + #else + + if (!memcmp(dname, p->name, 11)) { + fileFound = true; + break; + } + + #endif // LONG_FILENAME_WRITE_SUPPORT } } + if (fileFound) { // don't open existing file if O_EXCL if (oflag & O_EXCL) return false; + TERN_(LONG_FILENAME_WRITE_SUPPORT, index &= 0xF); } else { // don't create unless O_CREAT and O_WRITE if ((oflag & (O_CREAT | O_WRITE)) != (O_CREAT | O_WRITE)) return false; - if (emptyFound) { - index = dirIndex_; - p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); - if (!p) return false; - } - else { - if (dirFile->type_ == FAT_FILE_TYPE_ROOT_FIXED) return false; - // add and zero cluster for dirFile - first cluster is in cache for write - if (!dirFile->addDirCluster()) return false; + #if ENABLED(LONG_FILENAME_WRITE_SUPPORT) - // use first entry in cluster - p = dirFile->vol_->cache()->dir; - index = 0; - } - // initialize as empty file - memset(p, 0, sizeof(*p)); - memcpy(p->name, dname, 11); + // Use bookmark index if found empty entries + if (emptyFound) index = emptyIndex; - // set timestamps - if (dateTime_) { - // call user date/time function - dateTime_(&p->creationDate, &p->creationTime); - } - else { - // use default date/time - p->creationDate = FAT_DEFAULT_DATE; - p->creationTime = FAT_DEFAULT_TIME; - } - p->lastAccessDate = p->creationDate; - p->lastWriteDate = p->creationDate; - p->lastWriteTime = p->creationTime; + // Make room for needed entries + while (emptyCount < reqEntriesNum) { + p = dirFile->readDirCache(); + if (!p) break; + emptyCount++; + } + while (emptyCount < reqEntriesNum) { + if (dirFile->type_ == FAT_FILE_TYPE_ROOT_FIXED) return false; + // add and zero cluster for dirFile - first cluster is in cache for write + if (!dirFile->addDirCluster()) return false; + emptyCount += dirFile->vol_->blocksPerCluster() * 16; + } + + // Move to 1st entry to write + if (!dirFile->seekSet(32 * index)) return false; + + // Dir entries write loop: [LFN] + SFN(1) + LOOP_L_N(dirWriteIdx, reqEntriesNum) { + index = (dirFile->curPosition_ / 32) & 0xF; + p = dirFile->readDirCache(); + // LFN or SFN Entry? + if (dirWriteIdx < reqEntriesNum - 1) { + // Write LFN Entries + pvFat = (vfat_t *) p; + // initialize as empty file + memset(pvFat, 0, sizeof(*pvFat)); + lfnSequenceNumber = (reqEntriesNum - dirWriteIdx - 1) & 0x1F; + pvFat->attributes = DIR_ATT_LONG_NAME; + pvFat->checksum = lfn_checksum(dname); + // Set sequence number and mark as last LFN entry if it's the 1st loop + pvFat->sequenceNumber = lfnSequenceNumber | (dirWriteIdx == 0 ? 0x40 : 0); + // Set LFN name block + setLFNName(pvFat, (char*)dlname, lfnSequenceNumber); + } + else { + // Write SFN Entry + // initialize as empty file + memset(p, 0, sizeof(*p)); + memcpy(p->name, dname, 11); + + // set timestamps + if (dateTime_) { + // call user date/time function + dateTime_(&p->creationDate, &p->creationTime); + } + else { + // use default date/time + p->creationDate = FAT_DEFAULT_DATE; + p->creationTime = FAT_DEFAULT_TIME; + } + p->lastAccessDate = p->creationDate; + p->lastWriteDate = p->creationDate; + p->lastWriteTime = p->creationTime; + } + + // write entry to SD + dirFile->vol_->cacheSetDirty(); + if (!dirFile->vol_->cacheFlush()) return false; + } + + #else // !LONG_FILENAME_WRITE_SUPPORT + + if (emptyFound) { + index = dirIndex_; + p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); + if (!p) return false; + } + else { + if (dirFile->type_ == FAT_FILE_TYPE_ROOT_FIXED) return false; + + // add and zero cluster for dirFile - first cluster is in cache for write + if (!dirFile->addDirCluster()) return false; + + // use first entry in cluster + p = dirFile->vol_->cache()->dir; + index = 0; + } + + // initialize as empty file + memset(p, 0, sizeof(*p)); + memcpy(p->name, dname, 11); + + // set timestamps + if (dateTime_) { + // call user date/time function + dateTime_(&p->creationDate, &p->creationTime); + } + else { + // use default date/time + p->creationDate = FAT_DEFAULT_DATE; + p->creationTime = FAT_DEFAULT_TIME; + } + + p->lastAccessDate = p->creationDate; + p->lastWriteDate = p->creationDate; + p->lastWriteTime = p->creationTime; + + // write entry to SD + if (!dirFile->vol_->cacheFlush()) return false; + + #endif // !LONG_FILENAME_WRITE_SUPPORT - // write entry to SD - if (!dirFile->vol_->cacheFlush()) return false; } // open entry in cache return openCachedEntry(index, oflag); @@ -808,6 +988,191 @@ bool SdBaseFile::openNext(SdBaseFile *dirFile, uint8_t oflag) { return false; } +#if ENABLED(LONG_FILENAME_WRITE_SUPPORT) + + /** + * Check if dir is a long file name entry (LFN) + * + * \param[in] dir Parent of this directory will be opened. Must not be root. + * \return true if the dir is a long file name entry (LFN) + */ + bool SdBaseFile::isDirLFN(const dir_t* dir) { + if (DIR_IS_LONG_NAME(dir)) { + vfat_t *VFAT = (vfat_t*)dir; + // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0 + if ((VFAT->firstClusterLow == 0) && WITHIN((VFAT->sequenceNumber & 0x1F), 1, MAX_VFAT_ENTRIES)) return true; + } + return false; + } + + /** + * Check if dirname string is a long file name (LFN) + * + * \param[in] dirname The string to check + * \return true if the dirname is a long file name (LFN) + * \return false if the dirname is a short file name 8.3 (SFN) + */ + bool SdBaseFile::isDirNameLFN(const char *dirname) { + uint8_t length = strlen(dirname); + uint8_t idx = length; + bool dotFound = false; + if (idx > 12) return true; // LFN due to filename length > 12 ("filename.ext") + // Check dot(s) position + while (idx) { + if (dirname[--idx] == '.') { + if (!dotFound) { + // Last dot (extension) is allowed only + // in position [1..8] from start or [0..3] from end for SFN else it's a LFN + // A filename starting with "." is a LFN (eg. ".file" ->in SFN-> "file~1 ") + // A filename ending with "." is a SFN (if length <= 9) (eg. "file." ->in SFN-> "file ") + if (idx > 8 || idx == 0 || (length - idx - 1) > 3) return true; // LFN due to dot extension position + dotFound = true; + } + else { + // Found another dot, is a LFN + return true; + } + } + } + // If no dots found, the filename must be of max 8 characters + if ((!dotFound) && length > 8) return true; // LFN due to max filename (without extension) length + return false; + } + + /** + * Parse path and return 8.3 format and LFN filenames (if the parsed path is a LFN) + * The SFN is without dot ("FILENAMEEXT") + * The LFN is complete ("Filename.ext") + */ + bool SdBaseFile::parsePath(const char *path, uint8_t *name, uint8_t *lname, const char **ptrNextPath) { + // Init randomizer for SFN generation + randomSeed(millis()); + // Parse the LFN + uint8_t ilfn = 0; + bool lastDotFound = false; + const char *pLastDot = 0; + const char *lfnpath = path; + uint8_t c; + + while (*lfnpath && *lfnpath != '/') { + if (ilfn == LONG_FILENAME_LENGTH - 1) return false; // Name too long + c = *lfnpath++; // Get char and advance + // Fail for illegal characters + PGM_P p = PSTR("|<>^+=?/[];:,*\"\\"); + while (uint8_t b = pgm_read_byte(p++)) if (b == c) return false; // Check reserved characters + if (c < 0x20 || c == 0x7F) return false; // Check non-printable characters + if (c == '.' && (lfnpath - 1) > path) { // Skip dot '.' check in 1st position + // Save last dot pointer (skip if starts with '.') + pLastDot = lfnpath - 1; + lastDotFound = true; + } + lname[ilfn++] = c; // Set LFN character + } + // Terminate LFN + lname[ilfn] = 0; + + // Parse/generate 8.3 SFN. Will take + // until 8 characters for the filename part + // until 3 characters for the extension part (if exists) + // Add 4 more characters if name part < 3 + // Add '~cnt' characters if it's a LFN + const bool isLFN = isDirNameLFN((char*)lname); + + uint8_t n = isLFN ? 5 : 7, // Max index for each component of the file: + // starting with 7 or 5 (if LFN) + // switch to 10 for extension if the last dot is found + i = 11; + while (i) name[--i] = ' '; // Set whole FILENAMEEXT to spaces + while (*path && *path != '/') { + c = *path++; // Get char and advance + // Skip spaces and dots (if it's not the last dot) + if (c == ' ') continue; + if (c == '.' && (!lastDotFound || (lastDotFound && path < pLastDot))) continue; + // Fail for illegal characters + PGM_P p = PSTR("|<>^+=?/[];:,*\"\\"); + while (uint8_t b = pgm_read_byte(p++)) if (b == c) return false; // Check reserved characters + if (c < 0x21 || c == 0x7F) return false; // Check non-printable characters + // Is last dot? + if (c == '.') { + // Switch to extension part + n = 10; + i = 8; + } + // If in valid range add the character + else if (i <= n) // Check size for 8.3 format + name[i++] = c + (WITHIN(c, 'a', 'z') ? 'A' - 'a' : 0); // Uppercase required for 8.3 name + } + // If it's a LFN then the SFN always need: + // - A minimal of 3 characters (otherwise 4 chars are added) + // - The '~cnt' at the end + if (isLFN) { + // Get the 1st free character + uint8_t iFree = 0; + while (1) if (name[iFree++] == ' ' || iFree == 11) break; + iFree--; + // Check minimal length + if (iFree < 3) { + // Append 4 extra characters + name[iFree++] = random(0,24) + 'A'; name[iFree++] = random(0,24) + 'A'; + name[iFree++] = random(0,24) + 'A'; name[iFree++] = random(0,24) + 'A'; + } + // Append '~cnt' characters + if (iFree > 5) iFree = 5; // Force the append in the last 3 characters of name part + name[iFree++] = '~'; + name[iFree++] = random(1,9) + '0'; + name[iFree++] = random(1,9) + '0'; + } + + // Check if LFN is needed + if (!isLFN) lname[0] = 0; // Zero LFN + *ptrNextPath = path; // Set passed pointer to the end + return name[0] != ' '; // Return true if any name was set + } + + /** + * Get the LFN filename block from a dir. Get the block in lname at startOffset + */ + void SdBaseFile::getLFNName(vfat_t *pFatDir, char *lname, uint8_t sequenceNumber) { + uint8_t startOffset = (sequenceNumber - 1) * FILENAME_LENGTH; + LOOP_L_N(i, FILENAME_LENGTH) { + const uint16_t utf16_ch = (i >= 11) ? pFatDir->name3[i - 11] : (i >= 5) ? pFatDir->name2[i - 5] : pFatDir->name1[i]; + #if ENABLED(UTF_FILENAME_SUPPORT) + // We can't reconvert to UTF-8 here as UTF-8 is variable-size encoding, but joining LFN blocks + // needs static bytes addressing. So here just store full UTF-16LE words to re-convert later. + uint16_t idx = (startOffset + i) * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding + longFilename[idx] = utf16_ch & 0xFF; + longFilename[idx + 1] = (utf16_ch >> 8) & 0xFF; + #else + // Replace all multibyte characters to '_' + lname[startOffset + i] = (utf16_ch > 0xFF) ? '_' : (utf16_ch & 0xFF); + #endif + } + } + + /** + * Set the LFN filename block lname to a dir. Put the block based on sequence number + */ + void SdBaseFile::setLFNName(vfat_t *pFatDir, char *lname, uint8_t sequenceNumber) { + uint8_t startOffset = (sequenceNumber - 1) * FILENAME_LENGTH; + uint8_t nameLength = strlen(lname); + LOOP_L_N(i, FILENAME_LENGTH) { + uint16_t ch = 0; + if ((startOffset + i) < nameLength) + ch = lname[startOffset + i]; + else if ((startOffset + i) > nameLength) + ch = 0xFFFF; + // Set char + if (i < 5) + pFatDir->name1[i] = ch; + else if (i < 11) + pFatDir->name2[i - 5] = ch; + else + pFatDir->name3[i - 11] = ch; + } + } + +#endif // LONG_FILENAME_WRITE_SUPPORT + #if 0 /** * Open a directory's parent directory. @@ -1049,20 +1414,6 @@ int16_t SdBaseFile::read(void *buf, uint16_t nbyte) { return nbyte; } -/** - * Calculate a checksum for an 8.3 filename - * - * \param name The 8.3 file name to calculate - * - * \return The checksum byte - */ -uint8_t lfn_checksum(const uint8_t *name) { - uint8_t sum = 0; - for (uint8_t i = 11; i; i--) - sum = ((sum & 1) << 7) + (sum >> 1) + *name++; - return sum; -} - /** * Read the next entry in a directory. * @@ -1110,30 +1461,40 @@ int8_t SdBaseFile::readDir(dir_t *dir, char *longFilename) { if (VFAT->firstClusterLow == 0) { const uint8_t seq = VFAT->sequenceNumber & 0x1F; if (WITHIN(seq, 1, MAX_VFAT_ENTRIES)) { - n = (seq - 1) * (FILENAME_LENGTH); - if (n == 0) { + if (seq == 1) { checksum = VFAT->checksum; checksum_error = 0; } else if (checksum != VFAT->checksum) // orphan detected checksum_error = 1; - LOOP_L_N(i, FILENAME_LENGTH) { - const uint16_t utf16_ch = (i >= 11) ? VFAT->name3[i - 11] : (i >= 5) ? VFAT->name2[i - 5] : VFAT->name1[i]; - #if ENABLED(UTF_FILENAME_SUPPORT) - // We can't reconvert to UTF-8 here as UTF-8 is variable-size encoding, but joining LFN blocks - // needs static bytes addressing. So here just store full UTF-16LE words to re-convert later. - uint16_t idx = (n + i) * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding - longFilename[idx] = utf16_ch & 0xFF; - longFilename[idx + 1] = (utf16_ch >> 8) & 0xFF; - #else - // Replace all multibyte characters to '_' - longFilename[n + i] = (utf16_ch > 0xFF) ? '_' : (utf16_ch & 0xFF); - #endif - } + #if ENABLED(LONG_FILENAME_WRITE_SUPPORT) + + getLFNName(VFAT, longFilename, seq); // Get chunk of LFN from VFAT entry + + #else // !LONG_FILENAME_WRITE_SUPPORT + + n = (seq - 1) * (FILENAME_LENGTH); + + LOOP_L_N(i, FILENAME_LENGTH) { + const uint16_t utf16_ch = (i >= 11) ? VFAT->name3[i - 11] : (i >= 5) ? VFAT->name2[i - 5] : VFAT->name1[i]; + #if ENABLED(UTF_FILENAME_SUPPORT) + // We can't reconvert to UTF-8 here as UTF-8 is variable-size encoding, but joining LFN blocks + // needs static bytes addressing. So here just store full UTF-16LE words to re-convert later. + uint16_t idx = (n + i) * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding + longFilename[idx] = utf16_ch & 0xFF; + longFilename[idx + 1] = (utf16_ch >> 8) & 0xFF; + #else + // Replace all multibyte characters to '_' + longFilename[n + i] = (utf16_ch > 0xFF) ? '_' : (utf16_ch & 0xFF); + #endif + } + + #endif // !LONG_FILENAME_WRITE_SUPPORT + // If this VFAT entry is the last one, add a NUL terminator at the end of the string if (VFAT->sequenceNumber & 0x40) - longFilename[(n + FILENAME_LENGTH) * LONG_FILENAME_CHARSIZE] = '\0'; + longFilename[LONG_FILENAME_CHARSIZE * TERN(LONG_FILENAME_WRITE_SUPPORT, seq * FILENAME_LENGTH, (n + FILENAME_LENGTH))] = '\0'; } } } @@ -1227,6 +1588,11 @@ bool SdBaseFile::remove() { dir_t *d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); if (!d) return false; + #if ENABLED(LONG_FILENAME_WRITE_SUPPORT) + // get SFN checksum before name rewrite (needed for LFN deletion) + const uint8_t sfn_checksum = lfn_checksum(d->name); + #endif + // mark entry deleted d->name[0] = DIR_NAME_DELETED; @@ -1234,8 +1600,48 @@ bool SdBaseFile::remove() { type_ = FAT_FILE_TYPE_CLOSED; // write entry to SD - return vol_->cacheFlush(); - return true; + #if DISABLED(LONG_FILENAME_WRITE_SUPPORT) + + return vol_->cacheFlush(); + + #else // LONG_FILENAME_WRITE_SUPPORT + + flags_ = 0; + + if (!vol_->cacheFlush()) return false; + + // Check if the entry has a LFN + bool lastEntry = false; + // loop back to search for any LFN entries related to this file + LOOP_S_LE_N(sequenceNumber, 1, MAX_VFAT_ENTRIES) { + dirIndex_ = (dirIndex_ - 1) & 0xF; + if (dirBlock_ == 0) break; + if (dirIndex_ == 0xF) dirBlock_--; + dir_t *dir = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); + if (!dir) return false; + + // check for valid LFN: not deleted, not top dirs (".", ".."), must be a LFN + if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.' || !isDirLFN(dir)) break; + // check coherent LFN: checksum and sequenceNumber must match + vfat_t* dirlfn = (vfat_t*) dir; + if (dirlfn->checksum != sfn_checksum || (dirlfn->sequenceNumber & 0x1F) != sequenceNumber) break; // orphan entry + // is last entry of LFN ? + lastEntry = (dirlfn->sequenceNumber & 0x40); + // mark as deleted + dirlfn->sequenceNumber = DIR_NAME_DELETED; + // Flush to SD + if (!vol_->cacheFlush()) return false; + // exit on last entry of LFN deleted + if (lastEntry) break; + } + + // Restore current index + //if (!seekSet(32UL * dirIndex_)) return false; + //dirIndex_ += prevDirIndex; + + return true; + + #endif // LONG_FILENAME_WRITE_SUPPORT } /** diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h index 342edefb7079..bda44c6bd5c3 100644 --- a/Marlin/src/sd/SdBaseFile.h +++ b/Marlin/src/sd/SdBaseFile.h @@ -377,8 +377,26 @@ class SdBaseFile { dir_t* cacheDirEntry(uint8_t action); int8_t lsPrintNext(uint8_t flags, uint8_t indent); static bool make83Name(const char *str, uint8_t *name, const char **ptr); - bool mkdir(SdBaseFile *parent, const uint8_t dname[11]); - bool open(SdBaseFile *dirFile, const uint8_t dname[11], uint8_t oflag); + bool mkdir(SdBaseFile *parent, const uint8_t dname[11] + OPTARG(LONG_FILENAME_WRITE_SUPPORT, const uint8_t dlname[LONG_FILENAME_LENGTH]) + ); + bool open(SdBaseFile *dirFile, const uint8_t dname[11] + OPTARG(LONG_FILENAME_WRITE_SUPPORT, const uint8_t dlname[LONG_FILENAME_LENGTH]) + , uint8_t oflag + ); bool openCachedEntry(uint8_t cacheIndex, uint8_t oflags); dir_t* readDirCache(); + + // Long Filename create/write support + #if ENABLED(LONG_FILENAME_WRITE_SUPPORT) + static bool isDirLFN(const dir_t* dir); + static bool isDirNameLFN(const char *dirname); + static bool parsePath(const char *str, uint8_t *name, uint8_t *lname, const char **ptr); + /** + * Return the number of entries needed in the FAT for this LFN + */ + static inline uint8_t getLFNEntriesNum(const char *lname) { return (strlen(lname) + 12) / 13; } + static void getLFNName(vfat_t *vFatDir, char *lname, uint8_t startOffset); + static void setLFNName(vfat_t *vFatDir, char *lname, uint8_t lfnSequenceNumber); + #endif }; diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 25f9d7d802f9..8c1d08a4605d 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -328,7 +328,7 @@ void CardReader::printListing( if (includeLongNames) { SERIAL_CHAR(' '); if (prependLong) { SERIAL_ECHO(prependLong); SERIAL_CHAR('/'); } - SERIAL_ECHO(longFilename[0] ? longFilename : "???"); + SERIAL_ECHO(longFilename[0] ? longFilename : filename); } #endif SERIAL_EOL(); @@ -385,9 +385,9 @@ void CardReader::ls( diveDir.rewind(); selectByName(diveDir, segment); - // Print /LongNamePart to serial output + // Print /LongNamePart to serial output or the short name if not available SERIAL_CHAR('/'); - SERIAL_ECHO(longFilename[0] ? longFilename : "???"); + SERIAL_ECHO(longFilename[0] ? longFilename : filename); // If the filename was printed then that's it if (!flag.filenameIsDir) break; diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index bfce4ea49dfd..ceb0db4f10ab 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -84,21 +84,26 @@ def _CheckSDCard(): #----------------# # File functions # #----------------# - def _GetFirmwareFiles(): + def _GetFirmwareFiles(UseLongFilenames): if Debug: print('Get firmware files...') - _Send('M20 F') + _Send(f"M20 F{'L' if UseLongFilenames else ''}") Responses = _Recv() if len(Responses) < 3 or not any('file list' in r for r in Responses): raise Exception('Error getting firmware files') if Debug: print('OK') return Responses - def _FilterFirmwareFiles(FirmwareList): + def _FilterFirmwareFiles(FirmwareList, UseLongFilenames): Firmwares = [] for FWFile in FirmwareList: - if not '/' in FWFile and '.BIN' in FWFile: - idx = FWFile.index('.BIN') - Firmwares.append(FWFile[:idx+4]) + # For long filenames take the 3rd column of the firmwares list + if UseLongFilenames: + Space = 0 + Space = FWFile.find(' ') + if Space >= 0: Space = FWFile.find(' ', Space + 1) + if Space >= 0: FWFile = FWFile[Space + 1:] + if not '/' in FWFile and '.BIN' in FWFile.upper(): + Firmwares.append(FWFile[:FWFile.upper().index('.BIN') + 4]) return Firmwares def _RemoveFirmwareFile(FirmwareFile): @@ -124,6 +129,8 @@ def _RemoveFirmwareFile(FirmwareFile): marlin_board_info_name = _GetMarlinEnv(MarlinEnv, 'BOARD_INFO_NAME') marlin_board_custom_build_flags = _GetMarlinEnv(MarlinEnv, 'BOARD_CUSTOM_BUILD_FLAGS') marlin_firmware_bin = _GetMarlinEnv(MarlinEnv, 'FIRMWARE_BIN') + marlin_long_filename_host_support = _GetMarlinEnv(MarlinEnv, 'LONG_FILENAME_HOST_SUPPORT') is not None + marlin_longname_write = _GetMarlinEnv(MarlinEnv, 'LONG_FILENAME_WRITE_SUPPORT') is not None marlin_custom_firmware_upload = _GetMarlinEnv(MarlinEnv, 'CUSTOM_FIRMWARE_UPLOAD') is not None marlin_short_build_version = _GetMarlinEnv(MarlinEnv, 'SHORT_BUILD_VERSION') marlin_string_config_h_author = _GetMarlinEnv(MarlinEnv, 'STRING_CONFIG_H_AUTHOR') @@ -148,6 +155,10 @@ def _RemoveFirmwareFile(FirmwareFile): # "upload_delete_old_bins": delete all *.bin files in the root of SD Card upload_delete_old_bins = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V423', 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', 'BOARD_CREALITY_V24S1'] + # "upload_random_name": generate a random 8.3 firmware filename to upload + upload_random_filename = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V423', 'BOARD_CREALITY_V427', + 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', 'BOARD_CREALITY_V24S1'] and not marlin_long_filename_host_support + try: # Start upload job @@ -156,28 +167,34 @@ def _RemoveFirmwareFile(FirmwareFile): # Dump some debug info if Debug: print('Upload using:') - print('---- Marlin --------------------') - print(f' PIOENV : {marlin_pioenv}') - print(f' SHORT_BUILD_VERSION : {marlin_short_build_version}') - print(f' STRING_CONFIG_H_AUTHOR : {marlin_string_config_h_author}') - print(f' MOTHERBOARD : {marlin_motherboard}') - print(f' BOARD_INFO_NAME : {marlin_board_info_name}') - print(f' CUSTOM_BUILD_FLAGS : {marlin_board_custom_build_flags}') - print(f' FIRMWARE_BIN : {marlin_firmware_bin}') - print(f' CUSTOM_FIRMWARE_UPLOAD : {marlin_custom_firmware_upload}') - print('---- Upload parameters ---------') - print(f' Source : {upload_firmware_source_name}') - print(f' Target : {upload_firmware_target_name}') - print(f' Port : {upload_port} @ {upload_speed} baudrate') - print(f' Timeout : {upload_timeout}') - print(f' Block size : {upload_blocksize}') - print(f' Compression : {upload_compression}') - print(f' Error ratio : {upload_error_ratio}') - print(f' Test : {upload_test}') - print(f' Reset : {upload_reset}') - print('--------------------------------') + print('---- Marlin -----------------------------------') + print(f' PIOENV : {marlin_pioenv}') + print(f' SHORT_BUILD_VERSION : {marlin_short_build_version}') + print(f' STRING_CONFIG_H_AUTHOR : {marlin_string_config_h_author}') + print(f' MOTHERBOARD : {marlin_motherboard}') + print(f' BOARD_INFO_NAME : {marlin_board_info_name}') + print(f' CUSTOM_BUILD_FLAGS : {marlin_board_custom_build_flags}') + print(f' FIRMWARE_BIN : {marlin_firmware_bin}') + print(f' LONG_FILENAME_HOST_SUPPORT : {marlin_long_filename_host_support}') + print(f' LONG_FILENAME_WRITE_SUPPORT : {marlin_longname_write}') + print(f' CUSTOM_FIRMWARE_UPLOAD : {marlin_custom_firmware_upload}') + print('---- Upload parameters ------------------------') + print(f' Source : {upload_firmware_source_name}') + print(f' Target : {upload_firmware_target_name}') + print(f' Port : {upload_port} @ {upload_speed} baudrate') + print(f' Timeout : {upload_timeout}') + print(f' Block size : {upload_blocksize}') + print(f' Compression : {upload_compression}') + print(f' Error ratio : {upload_error_ratio}') + print(f' Test : {upload_test}') + print(f' Reset : {upload_reset}') + print('-----------------------------------------------') # Custom implementations based on board parameters + # Generate a new 8.3 random filename + if upload_random_filename: + upload_firmware_target_name = f"fw-{''.join(random.choices('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', k=5))}.BIN" + print(f"Board {marlin_motherboard}: Overriding firmware filename to '{upload_firmware_target_name}'") # Delete all *.bin files on the root of SD Card (if flagged) if upload_delete_old_bins: @@ -185,11 +202,6 @@ def _RemoveFirmwareFile(FirmwareFile): if not marlin_custom_firmware_upload: raise Exception(f"CUSTOM_FIRMWARE_UPLOAD must be enabled in 'Configuration_adv.h' for '{marlin_motherboard}'") - # Generate a new 8.3 random filename - # This board remember the last firmware filename and doesn't allow to flash from that filename - upload_firmware_target_name = f"fw-{''.join(random.choices('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', k=5))}.BIN" - print(f"Board {marlin_motherboard}: Overriding firmware filename to '{upload_firmware_target_name}'") - # Init serial port port = serial.Serial(upload_port, baudrate = upload_speed, write_timeout = 0, timeout = 0.1) port.reset_input_buffer() @@ -198,13 +210,13 @@ def _RemoveFirmwareFile(FirmwareFile): _CheckSDCard() # Get firmware files - FirmwareFiles = _GetFirmwareFiles() + FirmwareFiles = _GetFirmwareFiles(marlin_long_filename_host_support) if Debug: for FirmwareFile in FirmwareFiles: print(f'Found: {FirmwareFile}') # Get all 1st level firmware files (to remove) - OldFirmwareFiles = _FilterFirmwareFiles(FirmwareFiles[1:len(FirmwareFiles)-2]) # Skip header and footers of list + OldFirmwareFiles = _FilterFirmwareFiles(FirmwareFiles[1:len(FirmwareFiles)-2], marlin_long_filename_host_support) # Skip header and footers of list if len(OldFirmwareFiles) == 0: print('No old firmware files to delete') else: diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560 index bf3290b9d02c..5ae9a2dbcf0b 100755 --- a/buildroot/tests/mega2560 +++ b/buildroot/tests/mega2560 @@ -35,7 +35,7 @@ opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO LCD_LANGUAGE jp_kana DEFAULT_EJERK 10 \ EXTRUDERS 5 TEMP_SENSOR_1 1 TEMP_SENSOR_2 5 TEMP_SENSOR_3 20 TEMP_SENSOR_4 1000 TEMP_SENSOR_BED 1 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI SHOW_CUSTOM_BOOTSCREEN BOOT_MARLIN_LOGO_SMALL \ LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES \ - SDSUPPORT SDCARD_SORT_ALPHA NO_SD_AUTOSTART USB_FLASH_DRIVE_SUPPORT CANCEL_OBJECTS \ + SDSUPPORT LONG_FILENAME_WRITE_SUPPORT SDCARD_SORT_ALPHA NO_SD_AUTOSTART USB_FLASH_DRIVE_SUPPORT CANCEL_OBJECTS \ Z_PROBE_SLED AUTO_BED_LEVELING_UBL UBL_HILBERT_CURVE RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT \ EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_MENU_MAIN \ MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE QUICK_HOME \ From 5d5be55ef9fd9607d5c02380890472df99039cf0 Mon Sep 17 00:00:00 2001 From: Fahad Alduraibi Date: Tue, 18 Jan 2022 12:16:39 +0300 Subject: [PATCH 045/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20RAMPS=201.4=20Plus?= =?UTF-8?q?=20EXP=20headers=20(#23523)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/ramps/pins_RAMPS_PLUS.h | 48 +++++++++++++++++-------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h index a69572dee7a8..0c554c353faf 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h @@ -23,10 +23,6 @@ /** * Arduino Mega with RAMPS v1.4Plus, also known as 3DYMY version, pin assignments - * The differences to the RAMPS v1.4 are: - * - Swap heater E0 with E1 - * - Swap pins 8 and 10. Bed/Fan/Hotend as labeled on the board are on pins 8/9/10. - * - Change pins 16->42, 17->44 and 29->53 used for display. * * Applies to the following boards: * @@ -35,6 +31,11 @@ * RAMPS_PLUS_EFF (Extruder, Fan, Fan) * RAMPS_PLUS_EEF (Extruder, Extruder, Fan) * RAMPS_PLUS_SF (Spindle, Controller Fan) + * + * Differences from RAMPS v1.4: + * - Swap heater E0 with E1 + * - Swap pins 8 and 10. Bed/Fan/Hotend as labeled on the board are on pins 8/9/10. + * - Change EXP1/2 pins */ #include "env_validate.h" @@ -62,15 +63,32 @@ #define E1_ENABLE_PIN 24 #define E1_CS_PIN -1 -#include "pins_RAMPS.h" +/** 3DYMY Expansion Headers + * ------ ------ + * 37 |10 9 | 35 (MISO) 50 |10 9 | 52 (SCK) + * 31 | 8 7 | 41 29 | 8 7 | 53 + * 33 6 5 | 23 25 6 5 | 51 (MOSI) + * 42 | 4 3 | 44 49 | 4 3 | 27 + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN 44 +#define EXP1_04_PIN 42 +#define EXP1_05_PIN 23 +#define EXP1_06_PIN 33 +#define EXP1_07_PIN 41 +#define EXP1_08_PIN 31 +#define EXP1_09_PIN 35 +#define EXP1_10_PIN 37 -#if IS_ULTRA_LCD && NONE(REPRAPWORLD_GRAPHICAL_LCD, CR10_STOCKDISPLAY) && !BOTH(IS_NEWPANEL, PANEL_ONE) - #if DISABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #undef LCD_PINS_RS - #define LCD_PINS_RS 42 // 3DYMY boards pin 16 -> 42 - #undef LCD_PINS_ENABLE - #define LCD_PINS_ENABLE 44 // 3DYMY boards pin 17 -> 44 - #endif - #undef LCD_PINS_D7 - #define LCD_PINS_D7 53 // 3DYMY boards pin 29 -> 53 -#endif +#define EXP2_03_PIN 27 +#define EXP2_04_PIN 49 +#define EXP2_05_PIN 51 +#define EXP2_06_PIN 25 +#define EXP2_07_PIN 53 +#define EXP2_08_PIN 29 +#define EXP2_09_PIN 52 +#define EXP2_10_PIN 50 + +#include "pins_RAMPS.h" From 6f82d1befbb8061fab4730b4d0adf7a745257959 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 18 Jan 2022 03:18:37 -0600 Subject: [PATCH 046/502] =?UTF-8?q?=F0=9F=93=8C=20RAMPS=20AUX=201-2=20head?= =?UTF-8?q?ers=20(#23544)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/ramps/pins_RAMPS.h | 110 +++++++++++++++++------------ 1 file changed, 65 insertions(+), 45 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 121fb1b045bf..d647ec491bcd 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -422,6 +422,28 @@ #define E_MUX2_PIN 44 // E1_CS_PIN #endif +// +// AUX1 : 5V GND D2 D1 +// 5V GND A3 A4 + +#define AUX1_05_PIN 57 // (A3) +#define AUX1_06_PIN 2 +#define AUX1_07_PIN 58 // (A4) +#define AUX1_08_PIN 1 + +// +// AUX2 : GND A9 D40 D42 A11 +// VCC A5 A10 D44 A12 + +#define AUX2_03_PIN 59 // (A5) +#define AUX2_04_PIN 63 // (A9) +#define AUX2_05_PIN 64 // (A10) +#define AUX2_06_PIN 40 +#define AUX2_07_PIN 44 +#define AUX2_08_PIN 42 +#define AUX2_09_PIN 66 // (A12) +#define AUX2_10_PIN 65 // (A11) + // // AUX3 : GND D52 D50 5V // NC D53 D51 D49 @@ -507,12 +529,12 @@ #elif BOTH(IS_NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS 40 - #define LCD_PINS_ENABLE 42 - #define LCD_PINS_D4 65 - #define LCD_PINS_D5 66 - #define LCD_PINS_D6 44 - #define LCD_PINS_D7 64 + #define LCD_PINS_RS AUX2_06_PIN + #define LCD_PINS_ENABLE AUX2_08_PIN + #define LCD_PINS_D4 AUX2_10_PIN + #define LCD_PINS_D5 AUX2_09_PIN + #define LCD_PINS_D6 AUX2_07_PIN + #define LCD_PINS_D7 AUX2_05_PIN #elif ENABLED(TFTGLCD_PANEL_SPI) @@ -533,12 +555,12 @@ #elif ENABLED(ZONESTAR_LCD) #error "CAUTION! ZONESTAR_LCD on RAMPS requires wiring modifications. It plugs into AUX2 but GND and 5V need to be swapped. Comment out this line to continue." - #define LCD_PINS_RS 64 - #define LCD_PINS_ENABLE 44 - #define LCD_PINS_D4 63 - #define LCD_PINS_D5 40 - #define LCD_PINS_D6 42 - #define LCD_PINS_D7 65 + #define LCD_PINS_RS AUX2_05_PIN + #define LCD_PINS_ENABLE AUX2_07_PIN + #define LCD_PINS_D4 AUX2_04_PIN + #define LCD_PINS_D5 AUX2_06_PIN + #define LCD_PINS_D6 AUX2_08_PIN + #define LCD_PINS_D7 AUX2_10_PIN #else @@ -570,8 +592,8 @@ // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK_PIN 38 - //#define SHIFT_LD_PIN 42 - //#define SHIFT_OUT_PIN 40 + //#define SHIFT_LD_PIN AUX2_08_PIN + //#define SHIFT_OUT_PIN AUX2_06_PIN //#define SHIFT_EN_PIN EXP1_08_PIN #endif @@ -612,10 +634,10 @@ #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 + #define BTN_EN1 AUX2_05_PIN + #define BTN_EN2 AUX2_03_PIN + #define BTN_ENC AUX2_04_PIN + #define SD_DETECT_PIN AUX2_08_PIN #elif ENABLED(LCD_I2C_PANELOLU2) @@ -627,8 +649,8 @@ #elif ENABLED(LCD_I2C_VIKI) - #define BTN_EN1 40 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 42 + #define BTN_EN1 AUX2_06_PIN // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains AUX2-06 and AUX2-08. + #define BTN_EN2 AUX2_08_PIN #define BTN_ENC -1 #define LCD_SDSS SDSS @@ -636,17 +658,17 @@ #elif ANY(VIKI2, miniVIKI) - #define DOGLCD_CS 45 - #define DOGLCD_A0 44 + #define DOGLCD_CS AUX4_05_PIN + #define DOGLCD_A0 AUX2_07_PIN #define LCD_SCREEN_ROT_180 #define BEEPER_PIN EXP2_06_PIN - #define STAT_LED_RED_PIN 32 + #define STAT_LED_RED_PIN AUX4_03_PIN #define STAT_LED_BLUE_PIN EXP1_09_PIN #define BTN_EN1 22 #define BTN_EN2 7 - #define BTN_ENC 39 + #define BTN_ENC AUX4_08_PIN #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board #define KILL_PIN EXP2_08_PIN @@ -723,19 +745,18 @@ #elif ENABLED(MINIPANEL) - #define BEEPER_PIN 42 - // not connected to a pin - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 + #define BEEPER_PIN AUX2_08_PIN + #define LCD_BACKLIGHT_PIN AUX2_10_PIN - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 + #define DOGLCD_A0 AUX2_07_PIN + #define DOGLCD_CS AUX2_09_PIN - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 + #define BTN_EN1 AUX2_06_PIN + #define BTN_EN2 AUX2_04_PIN + #define BTN_ENC AUX2_03_PIN - #define SD_DETECT_PIN EXP2_04_PIN - #define KILL_PIN 64 + #define SD_DETECT_PIN AUX3_07_PIN + #define KILL_PIN AUX2_05_PIN #elif ENABLED(ZONESTAR_LCD) @@ -764,11 +785,10 @@ #define BEEPER_PIN EXP2_06_PIN - // Buttons are directly attached to AUX-2 - #if ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC EXP2_04_PIN + #if ENABLED(PANEL_ONE) // Buttons connect directly to AUX-2 + #define BTN_EN1 AUX2_03_PIN + #define BTN_EN2 AUX2_04_PIN + #define BTN_ENC AUX3_07_PIN #else #define BTN_EN1 EXP1_10_PIN #define BTN_EN2 EXP1_09_PIN @@ -781,17 +801,17 @@ #endif // HAS_WIRED_LCD #if IS_RRW_KEYPAD && !HAS_ADC_BUTTONS - #define SHIFT_OUT_PIN 40 - #define SHIFT_CLK_PIN 44 - #define SHIFT_LD_PIN 42 + #define SHIFT_OUT_PIN AUX2_06_PIN + #define SHIFT_CLK_PIN AUX2_07_PIN + #define SHIFT_LD_PIN AUX2_08_PIN #ifndef BTN_EN1 - #define BTN_EN1 64 + #define BTN_EN1 AUX2_05_PIN #endif #ifndef BTN_EN2 - #define BTN_EN2 59 + #define BTN_EN2 AUX2_03_PIN #endif #ifndef BTN_ENC - #define BTN_ENC 63 + #define BTN_ENC AUX2_04_PIN #endif #endif From 7b4f5108ace3e4a8891613465e86602f0b2ce5c1 Mon Sep 17 00:00:00 2001 From: John Lagonikas <39417467+zeleps@users.noreply.github.com> Date: Wed, 19 Jan 2022 10:13:47 +0200 Subject: [PATCH 047/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20conditional=20M81?= =?UTF-8?q?=20suicide=20(#23549)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/language.h | 2 ++ Marlin/src/feature/power.cpp | 10 +++++++--- Marlin/src/gcode/control/M80_M81.cpp | 5 ++++- Marlin/src/libs/MAX31865.cpp | 4 ++-- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 4 +++- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h | 4 +++- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 4 +++- .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 4 +++- 8 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index c53ebdfbf838..8e0784f70d76 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -105,6 +105,7 @@ #define STR_ENQUEUEING "enqueueing \"" #define STR_POWERUP "PowerUp" +#define STR_POWEROFF "PowerOff" #define STR_EXTERNAL_RESET " External Reset" #define STR_BROWNOUT_RESET " Brown out Reset" #define STR_WATCHDOG_RESET " Watchdog Reset" @@ -306,6 +307,7 @@ #define STR_Z_PROBE_OFFSET "Z-Probe Offset" #define STR_TEMPERATURE_UNITS "Temperature Units" #define STR_USER_THERMISTORS "User thermistors" +#define STR_DELAYED_POWEROFF "Delayed poweroff" // // Endstop Names used by Endstops::report_states diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 0e4d5452e486..c2ed169aa809 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -24,7 +24,9 @@ * power.cpp - power control */ -#include "../inc/MarlinConfig.h" +#include "../inc/MarlinConfigPre.h" + +#if EITHER(PSU_CONTROL, AUTO_POWER_CONTROL) #include "power.h" #include "../module/planner.h" @@ -40,8 +42,6 @@ #include "../gcode/gcode.h" #endif -#if EITHER(PSU_CONTROL, AUTO_POWER_CONTROL) - Power powerManager; bool Power::psu_on; @@ -97,6 +97,10 @@ void Power::power_on() { * Processes any PSU_POWEROFF_GCODE and makes a PS_OFF_SOUND if enabled. */ void Power::power_off() { + SERIAL_ECHOLNPGM(STR_POWEROFF); + + TERN_(HAS_SUICIDE, suicide()); + if (!psu_on) return; #ifdef PSU_POWEROFF_GCODE diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index cbb3c85f40ca..6a3788c4a919 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -107,7 +107,10 @@ void GcodeSuite::M81() { } #endif - if (delayed_power_off) return; + if (delayed_power_off) { + SERIAL_ECHOLNPGM(STR_DELAYED_POWEROFF); + return; + } #if HAS_SUICIDE suicide(); diff --git a/Marlin/src/libs/MAX31865.cpp b/Marlin/src/libs/MAX31865.cpp index 6cc8ffca3990..1cafbe5f170e 100644 --- a/Marlin/src/libs/MAX31865.cpp +++ b/Marlin/src/libs/MAX31865.cpp @@ -300,14 +300,14 @@ uint16_t MAX31865::readRaw() { enableBias(); nextEventStamp = millis() + 11; // wait at least 11msec before enabling 1shot nextEvent = SETUP_1_SHOT_MODE; - DEBUG_ECHOLN("MAX31865 bias voltage enabled"); + DEBUG_ECHOLNPGM("MAX31865 bias voltage enabled"); break; case SETUP_1_SHOT_MODE: oneShot(); nextEventStamp = millis() + 65; // wait at least 65msec before reading RTD register nextEvent = READ_RTD_REG; - DEBUG_ECHOLN("MAX31865 1 shot mode enabled"); + DEBUG_ECHOLNPGM("MAX31865 1 shot mode enabled"); break; case READ_RTD_REG: { diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 592d585982df..5fdd37b10415 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -193,7 +193,9 @@ // #if ENABLED(MKS_PWC) #if ENABLED(TFT_LVGL_UI) - #undef PSU_CONTROL + #if ENABLED(PSU_CONTROL) + #error "PSU_CONTROL is incompatible with MKS_PWC plus TFT_LVGL_UI." + #endif #undef MKS_PWC #define SUICIDE_PIN PB2 #define SUICIDE_PIN_STATE LOW diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h index 859529c2c302..e057e13c25f0 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h @@ -118,7 +118,9 @@ // #if ENABLED(MKS_PWC) #if ENABLED(TFT_LVGL_UI) - #undef PSU_CONTROL + #if ENABLED(PSU_CONTROL) + #error "PSU_CONTROL is incompatible with MKS_PWC plus TFT_LVGL_UI." + #endif #undef MKS_PWC #define SUICIDE_PIN PB2 #define SUICIDE_PIN_STATE LOW diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index a738a4faa259..53f207adb7ab 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -185,7 +185,9 @@ // #if ENABLED(MKS_PWC) #if ENABLED(TFT_LVGL_UI) - #undef PSU_CONTROL + #if ENABLED(PSU_CONTROL) + #error "PSU_CONTROL is incompatible with MKS_PWC plus TFT_LVGL_UI." + #endif #undef MKS_PWC #define SUICIDE_PIN PG11 #define SUICIDE_PIN_STATE LOW diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index 2c191946cd52..5b2c1b0f4345 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -165,7 +165,9 @@ // #if ENABLED(MKS_PWC) #if ENABLED(TFT_LVGL_UI) - #undef PSU_CONTROL + #if ENABLED(PSU_CONTROL) + #error "PSU_CONTROL is incompatible with MKS_PWC plus TFT_LVGL_UI." + #endif #undef MKS_PWC #define SUICIDE_PIN PB2 #define SUICIDE_PIN_STATE LOW From 8ea172cafeed9d39afe5dbdda3aec6e876d9b513 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 19 Jan 2022 02:20:32 -0600 Subject: [PATCH 048/502] =?UTF-8?q?=F0=9F=8E=A8=20Misc.=20style=20and=20cl?= =?UTF-8?q?eanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/common/dwin_api.cpp | 2 +- Marlin/src/module/settings.cpp | 4 +--- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 2 +- Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 2 +- Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.cpp b/Marlin/src/lcd/e3v2/common/dwin_api.cpp index d89b22a7aa74..f6780bba6c26 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.cpp +++ b/Marlin/src/lcd/e3v2/common/dwin_api.cpp @@ -21,7 +21,7 @@ */ #include "../../../inc/MarlinConfigPre.h" -#if EITHER(HAS_DWIN_E3V2, IS_DWIN_MARLINUI) +#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI #include "dwin_api.h" #include "dwin_set.h" diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 750aab74fda7..baab8b6dec12 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1990,9 +1990,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(lcd_contrast); uint8_t lcd_contrast; EEPROM_READ(lcd_contrast); - if (!validating) { - TERN_(HAS_LCD_CONTRAST, ui.set_contrast(lcd_contrast)); - } + TERN_(HAS_LCD_CONTRAST, if (!validating) ui.set_contrast(lcd_contrast)); } // diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index 03a0360b6e87..df6ae8c01721 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -272,7 +272,7 @@ #define EXP2_09_PIN P0_15 #define EXP2_10_PIN P0_17 -#if EITHER(HAS_DWIN_E3V2, IS_DWIN_MARLINUI) +#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI // RET6 DWIN ENCODER LCD #define BTN_ENC EXP1_06_PIN diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index 091613836197..56ee7fa73235 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -203,7 +203,7 @@ #define EXP1_09_PIN P0_16 #define EXP1_10_PIN P2_08 -#if EITHER(HAS_DWIN_E3V2, IS_DWIN_MARLINUI) +#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI #error "Ender-3 V2 display requires a custom cable with TX = P0_15, RX = P0_16. Comment out this line to continue." /** diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index bbf38e414fde..a8ba9049efee 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -136,7 +136,7 @@ #define EXP1_3 PB7 #endif -#if EITHER(HAS_DWIN_E3V2, IS_DWIN_MARLINUI) +#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI /** * ------ ------ ------ * (ENT) |10 9 | (BEEP) |10 9 | |10 9 | diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index cb7e784751a4..dea20642b13d 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -187,7 +187,7 @@ #error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the Creality V4 controller." #endif -#elif EITHER(HAS_DWIN_E3V2, IS_DWIN_MARLINUI) +#elif HAS_DWIN_E3V2 || IS_DWIN_MARLINUI // RET6 DWIN ENCODER LCD #define BTN_ENC PB14 diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h index 4941949f8116..6ec5de4ba314 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -216,7 +216,7 @@ #define BTN_EN1 EXP1_08_PIN #define BTN_EN2 EXP1_06_PIN -#elif EITHER(HAS_DWIN_E3V2, IS_DWIN_MARLINUI) +#elif HAS_DWIN_E3V2 || IS_DWIN_MARLINUI // RET6 DWIN ENCODER LCD #define BTN_ENC PB14 From 1d0ca179b54efed64e6951fc93e974ee92df9a9e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 19 Jan 2022 03:27:10 -0600 Subject: [PATCH 049/502] =?UTF-8?q?=F0=9F=8E=A8=20LCD=5FSCREEN=5FROT=5F*?= =?UTF-8?q?=20=3D>=20LCD=5FSCREEN=5FROTATE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 10 ++++++-- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 10 +++++--- Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 19 +++++---------- Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 6 +---- Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 10 +++----- Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h | 10 +++----- Marlin/src/pins/mega/pins_CNCONTROLS_12.h | 3 ++- Marlin/src/pins/mega/pins_MEGACONTROLLER.h | 9 +++----- Marlin/src/pins/rambo/pins_RAMBO.h | 3 ++- Marlin/src/pins/rambo/pins_SCOOVO_X9H.h | 5 ++-- Marlin/src/pins/ramps/pins_K8800.h | 3 +-- Marlin/src/pins/ramps/pins_RAMPS.h | 7 ++---- Marlin/src/pins/ramps/pins_TT_OSCAR.h | 23 +++++++------------ Marlin/src/pins/samd/pins_RAMPS_144.h | 19 +++++---------- .../src/pins/sanguino/pins_SANGUINOLOLU_11.h | 6 +---- Marlin/src/pins/stm32f1/pins_CHITU3D.h | 11 ++++----- Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h | 4 +--- Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h | 4 +--- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 2 +- .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 2 +- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 2 +- Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h | 2 +- .../stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 2 +- Marlin/src/pins/teensy2/pins_PRINTRBOARD.h | 3 ++- .../src/pins/teensy2/pins_PRINTRBOARD_REVF.h | 3 ++- 25 files changed, 72 insertions(+), 106 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index f44ef43f091f..a9744a09c02a 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -601,6 +601,12 @@ #error "PROBE_TEMP_COMPENSATION is now set using the PTC_PROBE, PTC_BED, PTC_HOTEND options." #elif defined(BTC_PROBE_TEMP) #error "BTC_PROBE_TEMP is now PTC_PROBE_TEMP." +#elif defined(LCD_SCREEN_ROT_90) + #error "LCD_SCREEN_ROT_90 is now LCD_SCREEN_ROTATE with a value of 90." +#elif defined(LCD_SCREEN_ROT_180) + #error "LCD_SCREEN_ROT_180 is now LCD_SCREEN_ROTATE with a value of 180." +#elif defined(LCD_SCREEN_ROT_270) + #error "LCD_SCREEN_ROT_270 is now LCD_SCREEN_ROTATE with a value of 270." #endif #if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) @@ -2758,8 +2764,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Please enable only one of TFT_INTERFACE_SPI or TFT_INTERFACE_SPI." #endif -#if MANY(LCD_SCREEN_ROT_0, LCD_SCREEN_ROT_90, LCD_SCREEN_ROT_180, LCD_SCREEN_ROT_270) - #error "Please enable only one LCD_SCREEN_ROT_* option: 0, 90, 180, or 270." +#if defined(LCD_SCREEN_ROTATE) && LCD_SCREEN_ROTATE != 0 && LCD_SCREEN_ROTATE != 90 && LCD_SCREEN_ROTATE != 180 && LCD_SCREEN_ROTATE != 270 + #error "LCD_SCREEN_ROTATE must be 0, 90, 180, or 270." #endif #if MANY(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, TFT_RES_1024x600) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 59c74148adef..82c9b9a34041 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -294,9 +294,13 @@ void MarlinUI::init_lcd() { TERN_(HAS_LCD_CONTRAST, refresh_contrast()); - TERN_(LCD_SCREEN_ROT_90, u8g.setRot90()); - TERN_(LCD_SCREEN_ROT_180, u8g.setRot180()); - TERN_(LCD_SCREEN_ROT_270, u8g.setRot270()); + #if LCD_SCREEN_ROTATE == 90 + u8g.setRot90(); + #elif LCD_SCREEN_ROTATE == 180 + u8g.setRot180(); + #elif LCD_SCREEN_ROTATE == 270 + u8g.setRot270(); + #endif update_language_font(); } diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index acf2d31cf604..372f96765239 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -584,7 +584,6 @@ #define DOGLCD_CS 45 #define DOGLCD_A0 44 - #define LCD_SCREEN_ROT_180 #define BEEPER_PIN 33 #define STAT_LED_RED_PIN 32 @@ -597,6 +596,8 @@ #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board #define KILL_PIN 31 + #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #define DOGLCD_CS 29 @@ -618,12 +619,6 @@ #define DOGLCD_A0 27 #define DOGLCD_CS 25 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - #define BEEPER_PIN 37 // not connected to a pin #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 @@ -635,6 +630,8 @@ #define SD_DETECT_PIN 49 #define KILL_PIN 64 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(MINIPANEL) #define BEEPER_PIN 42 @@ -644,12 +641,6 @@ #define DOGLCD_A0 44 #define DOGLCD_CS 66 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - #define BTN_EN1 40 #define BTN_EN2 63 #define BTN_ENC 59 @@ -657,6 +648,8 @@ #define SD_DETECT_PIN 49 #define KILL_PIN 64 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(ZONESTAR_LCD) #define ADC_KEYPAD_PIN 12 diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index 406e65d2954d..7f9e530f3c72 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -278,11 +278,7 @@ #endif #elif ENABLED(MINIPANEL) - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index bf214761d3b2..ee9d0e8c7a1d 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -348,8 +348,6 @@ #endif #if ANY(VIKI2, miniVIKI) - //#define LCD_SCREEN_ROT_180 - #define DOGLCD_CS P0_16 // (16) #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 #define DOGLCD_SCK SD_SCK_PIN @@ -358,6 +356,8 @@ #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #else #if ENABLED(FYSETC_MINI_12864) @@ -406,11 +406,7 @@ #endif #if ENABLED(MINIPANEL) - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h index f3ecebde4674..4fbc19eed843 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h @@ -155,8 +155,6 @@ #endif #if ANY(VIKI2, miniVIKI) - //#define LCD_SCREEN_ROT_180 - #define BEEPER_PIN P1_30 // (37) may change if cable changes #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2 #define DOGLCD_SCK SD_SCK_PIN @@ -164,6 +162,8 @@ #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes + + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #else #if IS_ULTIPANEL #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO @@ -180,11 +180,7 @@ #endif #if ENABLED(MINIPANEL) - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #endif #endif diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h index f1200e09018a..137650eeed58 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h @@ -147,7 +147,6 @@ #define DOGLCD_CS 35 #define DOGLCD_MOSI 48 #define DOGLCD_SCK 49 -#define LCD_SCREEN_ROT_180 // The encoder and click button #define BTN_EN1 36 @@ -164,3 +163,5 @@ #define STAT_LED_BLUE_PIN -1 #define STAT_LED_RED_PIN 10 // TOOL_0_PWM_PIN + +#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 diff --git a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h index 0af37bb217ed..dc9fa52af8e6 100644 --- a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h +++ b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h @@ -139,17 +139,12 @@ #if ENABLED(MINIPANEL) #define BEEPER_PIN 46 - // Pins for DOGM SPI LCD Support + #define DOGLCD_A0 47 #define DOGLCD_CS 45 #define LCD_BACKLIGHT_PIN 44 // backlight LED on PA3 #define KILL_PIN 12 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 #define BTN_EN1 48 #define BTN_EN2 11 @@ -157,6 +152,8 @@ #define SD_DETECT_PIN 49 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #endif // MINIPANEL // diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index 41e59c1b22dd..f27bced6238b 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -214,7 +214,6 @@ #define DOGLCD_A0 70 #define DOGLCD_CS 71 - #define LCD_SCREEN_ROT_180 #define BTN_EN1 85 #define BTN_EN2 84 @@ -225,6 +224,8 @@ #define STAT_LED_RED_PIN 22 #define STAT_LED_BLUE_PIN 32 + #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #else // !VIKI2 && !miniVIKI #define BEEPER_PIN 79 // AUX-4 diff --git a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h index c2a691a3b73b..4c2645e64b2a 100644 --- a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h +++ b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h @@ -148,10 +148,11 @@ // Pins for DOGM SPI LCD Support #define DOGLCD_A0 70 #define DOGLCD_CS 71 - #define LCD_SCREEN_ROT_180 #define SD_DETECT_PIN -1 // Pin 72 if using easy adapter board #define STAT_LED_RED_PIN 22 #define STAT_LED_BLUE_PIN 32 -#endif // VIKI2/miniVIKI + + #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 +#endif diff --git a/Marlin/src/pins/ramps/pins_K8800.h b/Marlin/src/pins/ramps/pins_K8800.h index 9bc74943b47a..653d31762995 100644 --- a/Marlin/src/pins/ramps/pins_K8800.h +++ b/Marlin/src/pins/ramps/pins_K8800.h @@ -30,8 +30,6 @@ #define BOARD_INFO_NAME "K8800" #define DEFAULT_MACHINE_NAME "Vertex Delta" -//#define LCD_SCREEN_ROT_180 - // // Limit Switches // @@ -110,6 +108,7 @@ #define LCD_CONTRAST_MIN 0 #define LCD_CONTRAST_MAX 100 #define DEFAULT_LCD_CONTRAST 30 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #if IS_NEWPANEL #define BTN_EN1 17 diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index d647ec491bcd..94e6ccdcbe31 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -513,10 +513,7 @@ #if HAS_WIRED_LCD - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 // // LCD Display output pins @@ -660,7 +657,7 @@ #define DOGLCD_CS AUX4_05_PIN #define DOGLCD_A0 AUX2_07_PIN - #define LCD_SCREEN_ROT_180 + #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #define BEEPER_PIN EXP2_06_PIN #define STAT_LED_RED_PIN AUX4_03_PIN diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index a07892914e16..277b1af2de86 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -402,7 +402,6 @@ #define DOGLCD_CS 45 #define DOGLCD_A0 44 - #define LCD_SCREEN_ROT_180 #define BEEPER_PIN 33 #define STAT_LED_RED_PIN 32 @@ -416,6 +415,8 @@ #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board //#define KILL_PIN 31 + #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #define DOGLCD_CS 29 @@ -437,13 +438,6 @@ #define DOGLCD_A0 27 #define DOGLCD_CS 25 - // GLCD features - //#define LCD_CONTRAST_INIT 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - #define BEEPER_PIN 37 #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 @@ -455,6 +449,9 @@ #define SD_DETECT_PIN 49 //#define KILL_PIN 64 + //#define LCD_CONTRAST_INIT 190 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(MINIPANEL) #define BEEPER_PIN 42 @@ -464,13 +461,6 @@ #define DOGLCD_A0 44 #define DOGLCD_CS 66 - // GLCD features - //#define LCD_CONTRAST_INIT 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - #define BTN_EN1 40 #define BTN_EN2 63 #define BTN_ENC 59 @@ -479,6 +469,9 @@ #define SD_DETECT_PIN 49 //#define KILL_PIN 64 + //#define LCD_CONTRAST_INIT 190 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #else // Beeper on AUX-4 diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index 449ae0273e23..406162c0896e 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -413,7 +413,6 @@ // TO TEST //#define DOGLCD_CS 45 //#define DOGLCD_A0 44 - //#define LCD_SCREEN_ROT_180 //#define BEEPER_PIN 33 //#define STAT_LED_RED_PIN 32 @@ -426,6 +425,8 @@ //#define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board //#define KILL_PIN 31 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) // TO TEST @@ -460,18 +461,14 @@ //#define DOGLCD_A0 27 //#define DOGLCD_CS 25 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // not connected to a pin //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) //#define BTN_EN1 31 //#define BTN_EN2 33 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(FYSETC_MINI_12864) // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 @@ -518,12 +515,6 @@ //#define DOGLCD_A0 44 //#define DOGLCD_CS 58 // Mega/Due:66 - AGCM4:58 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - //#define BTN_EN1 40 //#define BTN_EN2 55 // Mega/Due:63 - AGCM4:55 //#define BTN_ENC 72 // Mega/Due:59 - AGCM4:72 @@ -531,6 +522,8 @@ //#define SD_DETECT_PIN 49 //#define KILL_PIN 56 // Mega/Due:64 - AGCM4:56 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(ZONESTAR_LCD) // TO TEST diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h index ba9cc350a8f7..8471d1c7f5f3 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h @@ -207,11 +207,7 @@ #endif - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_0 - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index 7d30d6efad88..1f56e59a23c5 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -178,7 +178,6 @@ // Pins for DOGM SPI LCD Support #define DOGLCD_A0 PC12 // 44 #define DOGLCD_CS PC13 // 45 - #define LCD_SCREEN_ROT_180 #define BTN_EN1 PB6 // 22 #define BTN_EN2 PA7 // 7 @@ -192,6 +191,8 @@ #define STAT_LED_RED_PIN PC0 // 32 #define STAT_LED_BLUE_PIN PC3 // 35 + #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #define BTN_EN1 PC3 // 35 #define BTN_EN2 PC5 // 37 @@ -214,11 +215,7 @@ #define SDSS PD5 // 53 #define KILL_PIN PE0 // 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 + // The encoder and click button #define BTN_EN1 PC8 // 40 #define BTN_EN2 PD15 // 63 @@ -226,6 +223,8 @@ // not connected to a pin #define SD_DETECT_PIN PD1 // 49 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #else // Beeper on AUX-4 diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h index 7ffe67c4f86b..de91db22d554 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h @@ -166,9 +166,7 @@ #endif //#define LCD_CONTRAST_INIT 190 - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #endif diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h index 0c2f2fc5db31..e0f906bf9ecc 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h @@ -163,13 +163,11 @@ #define DOGLCD_CS EXP1_04_PIN #define DOGLCD_SCK EXP1_05_PIN #define DOGLCD_MOSI EXP1_03_PIN - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 #if EITHER(FYSETC_MINI_12864, U8GLIB_ST7920) #define FORCE_SOFT_SPI #endif + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #endif #define LCD_PINS_RS EXP1_04_PIN // CS -- SOFT SPI for ENDER3 LCD diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index a51f28bf957f..11d42ca6de85 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -326,7 +326,7 @@ #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif - //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #else // !MKS_MINI_12864 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index b0303861c919..14591eb78114 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -207,7 +207,7 @@ #define DOGLCD_SCK EXP2_09_PIN #define FORCE_SOFT_SPI #define SOFTWARE_SPI - //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #else diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 5fdd37b10415..40ce442e6ceb 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -352,7 +352,7 @@ #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif - //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #else // !MKS_MINI_12864 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h index 0e960a17e2c0..6e9e0e4b4f79 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h @@ -363,7 +363,7 @@ #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif - //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #else diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index 5b2c1b0f4345..b892affe68ef 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -349,7 +349,7 @@ #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif - //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #else // !MKS_MINI_12864 diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h index cb038fe73702..c813287866dd 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h @@ -135,7 +135,6 @@ #define DOGLCD_A0 40 // F2 JP2-2 #define DOGLCD_CS 41 // F3 JP2-4 - #define LCD_SCREEN_ROT_180 #define BTN_EN1 2 // D2 TX1 JP2-5 #define BTN_EN2 3 // D3 RX1 JP2-7 @@ -146,6 +145,8 @@ #define STAT_LED_RED_PIN 12 // C2 JP11-14 #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 + #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(LCD_I2C_PANELOLU2) #define BTN_EN1 3 // D3 RX1 JP2-7 diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h index 76b98ccbeb33..1ac953c89f8b 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h @@ -212,7 +212,6 @@ #define BEEPER_PIN 8 // E0 JP11-10 #define DOGLCD_A0 40 // F2 JP2-2 #define DOGLCD_CS 41 // F3 JP2-4 - #define LCD_SCREEN_ROT_180 #define BTN_EN1 2 // D2 TX1 JP2-5 #define BTN_EN2 3 // D3 RX1 JP2-7 @@ -223,6 +222,8 @@ #define STAT_LED_RED_PIN 12 // C2 JP11-14 #define STAT_LED_BLUE_PIN 10 // C0 JP11-12 + #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #elif ENABLED(MINIPANEL) #if DISABLED(USE_INTERNAL_SD) From f33ec4aacfff4af61879d8cd2de66e03706e1b84 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 15 Feb 2021 04:10:17 -0600 Subject: [PATCH 050/502] =?UTF-8?q?=F0=9F=93=9D=20Tweak=20G26=20Q=20descri?= =?UTF-8?q?ption?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/bedlevel/G26.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 728771d5809d..941861f04472 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -71,8 +71,8 @@ * pliers while holding the LCD Click wheel in a depressed state. If you do not have * an LCD, you must specify a value if you use P. * - * Q # Multiplier Retraction Multiplier. Normally not needed. Retraction defaults to 1.0mm and - * un-retraction is at 1.2mm These numbers will be scaled by the specified amount + * Q # Multiplier Retraction Multiplier. (Normally not needed.) During G26 retraction will use the length + * specified by this parameter (1mm by default). Recover will be 1.2x the retract distance. * * R # Repeat Prints the number of patterns given as a parameter, starting at the current location. * If a parameter isn't given, every point will be printed unless G26 is interrupted. From 369ba99fdb95887371e3fcac3e88b8fb6e980b81 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 19 Jan 2022 05:11:06 -0600 Subject: [PATCH 051/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Robin=20Nano=20BOA?= =?UTF-8?q?RD=5FINIT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index ce033d4013f5..2d70e7234708 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -44,10 +44,6 @@ //#define LED_PIN PB2 -#if HAS_TFT_LVGL_UI - #define BOARD_INIT OUT_WRITE(PB0, LOW) -#endif - #include "pins_MKS_ROBIN_NANO_common.h" #if HAS_TFT_LVGL_UI && FAN1_PIN != PB0 && HEATER_1_PIN != PB0 From 32ff8c1489e658c2c29c8664ccee04d988c9f4ca Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 19 Jan 2022 05:12:03 -0600 Subject: [PATCH 052/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Add?= =?UTF-8?q?=20chmod=20to=20mfprep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/git/mfprep | 1 + 1 file changed, 1 insertion(+) diff --git a/buildroot/share/git/mfprep b/buildroot/share/git/mfprep index 7a8e05ee317c..b329d7d8c5d9 100755 --- a/buildroot/share/git/mfprep +++ b/buildroot/share/git/mfprep @@ -60,5 +60,6 @@ cat "$LOGB" | while read line; do fi done mv "$TMPF" "$SCRF" +chmod ug+x "$SCRF" open "$TMPDIR" From 63f3e347d999767f98810955621847a989f642ac Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 19 Jan 2022 18:33:19 -0600 Subject: [PATCH 053/502] =?UTF-8?q?=F0=9F=A9=B9=20BOARD=5FINIT=20followup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 2d70e7234708..115058a19f77 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -47,5 +47,5 @@ #include "pins_MKS_ROBIN_NANO_common.h" #if HAS_TFT_LVGL_UI && FAN1_PIN != PB0 && HEATER_1_PIN != PB0 - #define BOARD_INIT OUT_WRITE(PB0, LOW) + #define BOARD_INIT() OUT_WRITE(PB0, LOW) #endif From 17099e797334abeb0cd92156e32af1e9e5d671ee Mon Sep 17 00:00:00 2001 From: John Lagonikas <39417467+zeleps@users.noreply.github.com> Date: Thu, 20 Jan 2022 13:58:36 +0200 Subject: [PATCH 054/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20power.h=20compile?= =?UTF-8?q?=20(#23573)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/power.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 9ecd832afce6..839366ca602b 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -25,7 +25,7 @@ * power.h - power control */ -#if ENABLED(AUTO_POWER_CONTROL) +#if EITHER(AUTO_POWER_CONTROL, POWER_OFF_TIMER) #include "../core/millis_t.h" #endif From de0bc19230a0d253fd6d6f4a945a465abf67ab70 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Thu, 10 Mar 2022 15:20:13 -0800 Subject: [PATCH 055/502] =?UTF-8?q?=F0=9F=9A=B8=20TH3D=20EZBoard=20V2=20TM?= =?UTF-8?q?C=20slave=20addresses=20(#23857)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h index bd4798209e6a..fd6b96054214 100644 --- a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h +++ b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h @@ -130,6 +130,20 @@ // Reduce baud rate to improve software serial reliability #define TMC_BAUD_RATE 19200 + + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 1 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 2 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif #endif // From 99f3b8b4a8238bf11ae6ee70c58e3e053abfcffc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 22 Jan 2022 10:14:47 -0600 Subject: [PATCH 056/502] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Adjust=20LCD=20ini?= =?UTF-8?q?t,=20contrast=20default,=20settings=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/LPC1768/inc/SanityCheck.h | 2 +- Marlin/src/MarlinCore.cpp | 24 ++- Marlin/src/gcode/lcd/M250.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/inc/Conditionals_post.h | 11 +- Marlin/src/inc/Warnings.cpp | 4 + Marlin/src/lcd/e3v2/creality/dwin.cpp | 3 + Marlin/src/lcd/e3v2/enhanced/dwin.cpp | 3 + Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 4 +- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/lcd/marlinui.cpp | 149 +++++++++--------- Marlin/src/lcd/marlinui.h | 29 ++-- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- Marlin/src/module/settings.cpp | 44 ++---- Marlin/src/pins/mega/pins_GT2560_REV_A.h | 2 +- Marlin/src/pins/mega/pins_HJC2560C_REV2.h | 2 +- Marlin/src/pins/ramps/pins_K8800.h | 2 +- Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h | 2 +- 19 files changed, 137 insertions(+), 154 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h index 3ea054589ec3..8265d58a6e8f 100644 --- a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h @@ -113,7 +113,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o #define _IS_RX1_1 IS_RX1 #if IS_TX1(TMC_SW_SCK) #error "Serial port pins (1) conflict with other pins!" - #elif HAS_WIRED_LCD + #elif HAS_ROTARY_ENCODER #if IS_TX1(BTN_EN2) || IS_RX1(BTN_EN1) #error "Serial port pins (1) conflict with Encoder Buttons!" #elif ANY_TX(1, SD_SCK_PIN, LCD_PINS_D4, DOGLCD_SCK, LCD_RESET_PIN, LCD_PINS_RS, SHIFT_CLK_PIN) \ diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 2c290306693a..d0065655f185 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1294,16 +1294,7 @@ void setup() { // UI must be initialized before EEPROM // (because EEPROM code calls the UI). - #if HAS_DWIN_E3V2_BASIC - SETUP_RUN(DWIN_Startup()); - #else - SETUP_RUN(ui.init()); - #if BOTH(HAS_WIRED_LCD, SHOW_BOOTSCREEN) - SETUP_RUN(ui.show_bootscreen()); - const millis_t bootscreen_ms = millis(); - #endif - SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.) - #endif + SETUP_RUN(ui.init()); #if PIN_EXISTS(SAFE_POWER) #if HAS_DRIVER_SAFE_POWER_PROTECT @@ -1314,10 +1305,6 @@ void setup() { #endif #endif - #if ENABLED(PROBE_TARE) - SETUP_RUN(probe.tare_init()); - #endif - #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) SETUP_RUN(card.mount()); // Mount media with settings before first_load #endif @@ -1325,6 +1312,15 @@ void setup() { SETUP_RUN(settings.first_load()); // Load data from EEPROM if available (or use defaults) // This also updates variables in the planner, elsewhere + #if BOTH(HAS_WIRED_LCD, SHOW_BOOTSCREEN) + SETUP_RUN(ui.show_bootscreen()); + const millis_t bootscreen_ms = millis(); + #endif + + #if ENABLED(PROBE_TARE) + SETUP_RUN(probe.tare_init()); + #endif + #if HAS_ETHERNET SETUP_RUN(ethernet.init()); #endif diff --git a/Marlin/src/gcode/lcd/M250.cpp b/Marlin/src/gcode/lcd/M250.cpp index 25e423278883..58b6dac872a3 100644 --- a/Marlin/src/gcode/lcd/M250.cpp +++ b/Marlin/src/gcode/lcd/M250.cpp @@ -31,7 +31,7 @@ * M250: Read and optionally set the LCD contrast */ void GcodeSuite::M250() { - if (parser.seenval('C')) + if (LCD_CONTRAST_MIN < LCD_CONTRAST_MAX && parser.seenval('C')) ui.set_contrast(parser.value_byte()); else M250_report(); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 4386964744dc..2daa15d0d3ea 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -237,7 +237,7 @@ #define LCD_HEIGHT 10 // Character lines #define LCD_CONTRAST_MIN 127 #define LCD_CONTRAST_MAX 255 - #define DEFAULT_LCD_CONTRAST 250 + #define LCD_CONTRAST_DEFAULT 250 #define CONVERT_TO_EXT_ASCII // Use extended 128-255 symbols from ASCII table. // At this time present conversion only for cyrillic - bg, ru and uk languages. // First 7 ASCII symbols in panel font must be replaced with Marlin's special symbols. diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 5d3ac7a690cb..734676559cdc 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -376,7 +376,6 @@ #elif EITHER(MKS_MINI_12864_V3, BTT_MINI_12864_V1) #define _LCD_CONTRAST_MIN 255 #define _LCD_CONTRAST_INIT 255 - #define _LCD_CONTRAST_MAX 255 #elif ENABLED(FYSETC_MINI_12864) #define _LCD_CONTRAST_INIT 220 #elif ENABLED(ULTI_CONTROLLER) @@ -389,18 +388,12 @@ #elif ENABLED(ZONESTAR_12864OLED) #define _LCD_CONTRAST_MIN 64 #define _LCD_CONTRAST_INIT 128 - #define _LCD_CONTRAST_MAX 255 #elif IS_TFTGLCD_PANEL - #define _LCD_CONTRAST_MIN 0 #define _LCD_CONTRAST_INIT 250 - #define _LCD_CONTRAST_MAX 255 #endif #ifdef _LCD_CONTRAST_INIT #define HAS_LCD_CONTRAST 1 -#endif - -#if HAS_LCD_CONTRAST #ifndef LCD_CONTRAST_MIN #ifdef _LCD_CONTRAST_MIN #define LCD_CONTRAST_MIN _LCD_CONTRAST_MIN @@ -420,8 +413,8 @@ #define LCD_CONTRAST_MAX 63 // ST7567 6-bits contrast #endif #endif - #ifndef DEFAULT_LCD_CONTRAST - #define DEFAULT_LCD_CONTRAST LCD_CONTRAST_INIT + #ifndef LCD_CONTRAST_DEFAULT + #define LCD_CONTRAST_DEFAULT LCD_CONTRAST_INIT #endif #endif diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 0d6f9bb13458..e1b4a1f9a8ed 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -559,3 +559,7 @@ #if CANNOT_EMBED_CONFIGURATION #warning "Disabled CONFIGURATION_EMBEDDING because the target usually has less flash storage. Define FORCE_CONFIG_EMBED to override." #endif + +#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX + #warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX." +#endif diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 03f08ac18435..f17d97cc7c4c 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -1834,6 +1834,9 @@ void make_name_without_ext(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT) void HMI_SDCardInit() { card.cdroot(); } +// Initialize or re-initialize the LCD +void MarlinUI::init_lcd() { DWIN_Startup(); } + void MarlinUI::refresh() { /* Nothing to see here */ } #if HAS_LCD_BRIGHTNESS diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp index 484aa392f035..64e90c361edd 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp @@ -888,6 +888,9 @@ void make_name_without_ext(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT) void HMI_SDCardInit() { card.cdroot(); } +// Initialize or re-initialize the LCD +void MarlinUI::init_lcd() { DWIN_Startup(); } + void MarlinUI::refresh() { /* Nothing to see here */ } #if HAS_LCD_BRIGHTNESS diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index eea464dcfd17..1356c0e47552 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4980,7 +4980,7 @@ void CrealityDWINClass::Reset_Settings() { Redraw_Screen(); } -void MarlinUI::init() { +void MarlinUI::init_lcd() { delay(800); SERIAL_ECHOPGM("\nDWIN handshake "); if (DWIN_Handshake()) SERIAL_ECHOLNPGM("ok."); else SERIAL_ECHOLNPGM("error."); diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index b6093784a83f..dbf2f7717c84 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -79,9 +79,7 @@ void MarlinUI::set_font(const uint8_t font_nr) { bool MarlinUI::detected() { return true; } // Initialize or re-initialize the LCD -void MarlinUI::init_lcd() { - DWIN_Startup(); -} +void MarlinUI::init_lcd() { DWIN_Startup(); } // This LCD should clear where it will draw anew void MarlinUI::clear_lcd() { diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 54e7db55c290..f2763c893f70 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -1144,7 +1144,7 @@ namespace ExtUI { // At the moment we hook into MarlinUI methods, but this could be cleaned up in the future -void MarlinUI::init() { ExtUI::onStartup(); } +void MarlinUI::init_lcd() { ExtUI::onStartup(); } void MarlinUI::update() { ExtUI::onIdle(); } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 2a576f647b98..c068082c09f7 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -43,7 +43,6 @@ MarlinUI ui; #if HAS_DISPLAY #include "../gcode/queue.h" #include "fontutils.h" - #include "../sd/cardreader.h" #endif #if ENABLED(DWIN_CREALITY_LCD) @@ -176,6 +175,77 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif +// Encoder Handling +#if HAS_ENCODER_ACTION + uint32_t MarlinUI::encoderPosition; + volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update +#endif + +void MarlinUI::init() { + + init_lcd(); + + #if HAS_DIGITAL_BUTTONS + #if BUTTON_EXISTS(EN1) + SET_INPUT_PULLUP(BTN_EN1); + #endif + #if BUTTON_EXISTS(EN2) + SET_INPUT_PULLUP(BTN_EN2); + #endif + #if BUTTON_EXISTS(ENC) + SET_INPUT_PULLUP(BTN_ENC); + #endif + #if BUTTON_EXISTS(ENC_EN) + SET_INPUT_PULLUP(BTN_ENC_EN); + #endif + #if BUTTON_EXISTS(BACK) + SET_INPUT_PULLUP(BTN_BACK); + #endif + #if BUTTON_EXISTS(UP) + SET_INPUT(BTN_UP); + #endif + #if BUTTON_EXISTS(DWN) + SET_INPUT(BTN_DWN); + #endif + #if BUTTON_EXISTS(LFT) + SET_INPUT(BTN_LFT); + #endif + #if BUTTON_EXISTS(RT) + SET_INPUT(BTN_RT); + #endif + #endif + + #if HAS_SHIFT_ENCODER + + #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register + + SET_OUTPUT(SR_DATA_PIN); + SET_OUTPUT(SR_CLK_PIN); + + #elif PIN_EXISTS(SHIFT_CLK) + + SET_OUTPUT(SHIFT_CLK_PIN); + OUT_WRITE(SHIFT_LD_PIN, HIGH); + #if PIN_EXISTS(SHIFT_EN) + OUT_WRITE(SHIFT_EN_PIN, LOW); + #endif + SET_INPUT_PULLUP(SHIFT_OUT_PIN); + + #endif + + #endif // HAS_SHIFT_ENCODER + + #if BOTH(HAS_ENCODER_ACTION, HAS_SLOW_BUTTONS) + slow_buttons = 0; + #endif + + update_buttons(); + + TERN_(HAS_ENCODER_ACTION, encoderDiff = 0); + + reset_status(); // Set welcome message +} + #if HAS_WIRED_LCD #if HAS_MARLINUI_U8GLIB @@ -184,8 +254,6 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #include "lcdprint.h" - #include "../sd/cardreader.h" - #include "../module/temperature.h" #include "../module/planner.h" #include "../module/motion.h" @@ -247,16 +315,8 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; bool MarlinUI::old_is_printing; #endif - // Encoder Handling - #if HAS_ENCODER_ACTION - uint32_t MarlinUI::encoderPosition; - volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update - #endif - #if ENABLED(SDSUPPORT) - #include "../sd/cardreader.h" - #if MARLINUI_SCROLL_NAME uint8_t MarlinUI::filename_scroll_pos, MarlinUI::filename_scroll_max; #endif @@ -393,69 +453,6 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif // HAS_LCD_MENU - void MarlinUI::init() { - - init_lcd(); - - #if HAS_DIGITAL_BUTTONS - #if BUTTON_EXISTS(EN1) - SET_INPUT_PULLUP(BTN_EN1); - #endif - #if BUTTON_EXISTS(EN2) - SET_INPUT_PULLUP(BTN_EN2); - #endif - #if BUTTON_EXISTS(ENC) - SET_INPUT_PULLUP(BTN_ENC); - #endif - #if BUTTON_EXISTS(ENC_EN) - SET_INPUT_PULLUP(BTN_ENC_EN); - #endif - #if BUTTON_EXISTS(BACK) - SET_INPUT_PULLUP(BTN_BACK); - #endif - #if BUTTON_EXISTS(UP) - SET_INPUT(BTN_UP); - #endif - #if BUTTON_EXISTS(DWN) - SET_INPUT(BTN_DWN); - #endif - #if BUTTON_EXISTS(LFT) - SET_INPUT(BTN_LFT); - #endif - #if BUTTON_EXISTS(RT) - SET_INPUT(BTN_RT); - #endif - #endif - - #if HAS_SHIFT_ENCODER - - #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register - - SET_OUTPUT(SR_DATA_PIN); - SET_OUTPUT(SR_CLK_PIN); - - #elif PIN_EXISTS(SHIFT_CLK) - - SET_OUTPUT(SHIFT_CLK_PIN); - OUT_WRITE(SHIFT_LD_PIN, HIGH); - #if PIN_EXISTS(SHIFT_EN) - OUT_WRITE(SHIFT_EN_PIN, LOW); - #endif - SET_INPUT_PULLUP(SHIFT_OUT_PIN); - - #endif - - #endif // HAS_SHIFT_ENCODER - - #if BOTH(HAS_ENCODER_ACTION, HAS_SLOW_BUTTONS) - slow_buttons = 0; - #endif - - update_buttons(); - - TERN_(HAS_ENCODER_ACTION, encoderDiff = 0); - } - //////////////////////////////////////////// ///////////// Keypad Handling ////////////// //////////////////////////////////////////// @@ -629,9 +626,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; next_filament_display = millis() + 5000UL; // Show status message for 5s #endif goto_screen(menu_main); - #if DISABLED(NO_LCD_REINIT) - init_lcd(); // May revive the LCD if static electricity killed it - #endif + IF_DISABLED(NO_LCD_REINIT, init_lcd()); // May revive the LCD if static electricity killed it return; } diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index dcf74b9e2720..3217d3531b1f 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -21,6 +21,7 @@ */ #pragma once +#include "../sd/cardreader.h" #include "../module/motion.h" #include "buttons.h" @@ -30,10 +31,6 @@ #include "../libs/buzzer.h" #endif -#if ENABLED(SDSUPPORT) - #include "../sd/cardreader.h" -#endif - #if ENABLED(TOUCH_SCREEN_CALIBRATION) #include "tft_io/touch_calibration.h" #endif @@ -204,6 +201,20 @@ class MarlinUI { TERN_(HAS_LCD_MENU, currentScreen = status_screen); } + static void init(); + + #if HAS_DISPLAY || HAS_DWIN_E3V2 + static void init_lcd(); + #else + static void init_lcd() {} + #endif + + #if HAS_WIRED_LCD + static bool detected(); + #else + static bool detected() { return true; } + #endif + #if HAS_MULTI_LANGUAGE static uint8_t language; static void set_language(const uint8_t lang); @@ -270,14 +281,6 @@ class MarlinUI { } #endif - #if HAS_WIRED_LCD - static bool detected(); - static void init_lcd(); - #else - static bool detected() { return true; } - static void init_lcd() {} - #endif - #if HAS_PRINT_PROGRESS #if HAS_PRINT_PROGRESS_PERMYRIAD typedef uint16_t progress_t; @@ -365,7 +368,6 @@ class MarlinUI { #if HAS_DISPLAY - static void init(); static void update(); static void abort_print(); @@ -480,7 +482,6 @@ class MarlinUI { #else // No LCD - static void init() {} static void update() {} static void return_to_status() {} diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 4cd43e787aca..7642c7671068 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -538,7 +538,7 @@ void menu_configuration() { #if HAS_LCD_BRIGHTNESS EDIT_ITEM_FAST(uint8, MSG_BRIGHTNESS, &ui.brightness, LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.refresh_brightness, true); #endif - #if HAS_LCD_CONTRAST + #if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN < LCD_CONTRAST_MAX EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true); #endif #if ENABLED(FWRETRACT) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index baab8b6dec12..90bb9f6d6e5f 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1965,8 +1965,10 @@ void MarlinSettings::postprocess() { // #if HAS_USER_THERMISTORS { + user_thermistor_t user_thermistor[USER_THERMISTORS]; _FIELD_TEST(user_thermistor); - EEPROM_READ(thermalManager.user_thermistor); + EEPROM_READ(user_thermistor); + if (!validating) COPY(thermalManager.user_thermistor, user_thermistor); } #endif @@ -1974,13 +1976,10 @@ void MarlinSettings::postprocess() { // Power monitor // { - #if HAS_POWER_MONITOR - uint8_t &power_monitor_flags = power_monitor.flags; - #else - uint8_t power_monitor_flags; - #endif + uint8_t power_monitor_flags; _FIELD_TEST(power_monitor_flags); EEPROM_READ(power_monitor_flags); + TERN_(HAS_POWER_MONITOR, if (!validating) power_monitor.flags = power_monitor_flags); } // @@ -1997,7 +1996,6 @@ void MarlinSettings::postprocess() { // LCD Brightness // { - _FIELD_TEST(lcd_brightness); uint8_t lcd_brightness; EEPROM_READ(lcd_brightness); TERN_(HAS_LCD_BRIGHTNESS, if (!validating) ui.set_brightness(lcd_brightness)); @@ -2007,45 +2005,37 @@ void MarlinSettings::postprocess() { // Controller Fan // { + controllerFan_settings_t cfs = { 0 }; _FIELD_TEST(controllerFan_settings); - #if ENABLED(CONTROLLER_FAN_EDITABLE) - const controllerFan_settings_t &cfs = controllerFan.settings; - #else - controllerFan_settings_t cfs = { 0 }; - #endif EEPROM_READ(cfs); + TERN_(CONTROLLER_FAN_EDITABLE, if (!validating) controllerFan.settings = cfs); } // // Power-Loss Recovery // { + bool recovery_enabled; _FIELD_TEST(recovery_enabled); - #if ENABLED(POWER_LOSS_RECOVERY) - const bool &recovery_enabled = recovery.enabled; - #else - bool recovery_enabled; - #endif EEPROM_READ(recovery_enabled); + TERN_(POWER_LOSS_RECOVERY, if (!validating) recovery.enabled = recovery_enabled); } // // Firmware Retraction // { + fwretract_settings_t fwretract_settings; + bool autoretract_enabled; _FIELD_TEST(fwretract_settings); + EEPROM_READ(fwretract_settings); + EEPROM_READ(autoretract_enabled); #if ENABLED(FWRETRACT) - EEPROM_READ(fwretract.settings); - #else - fwretract_settings_t fwretract_settings; - EEPROM_READ(fwretract_settings); - #endif - #if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT) - EEPROM_READ(fwretract.autoretract_enabled); - #else - bool autoretract_enabled; - EEPROM_READ(autoretract_enabled); + if (!validating) { + fwretract.settings = fwretract_settings; + TERN_(FWRETRACT_AUTORETRACT, fwretract.autoretract_enabled = autoretract_enabled); + } #endif } diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h index 1adf8d3079f4..ecd341984b6f 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h @@ -127,7 +127,7 @@ #define LCD_RESET_PIN 16 - #define DEFAULT_LCD_CONTRAST 220 + #define LCD_CONTRAST_DEFAULT 220 #define LCD_BACKLIGHT_PIN -1 #else diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h index 73d4bac47273..5c3b1dc9f6d6 100644 --- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h +++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h @@ -134,7 +134,7 @@ #if ENABLED(HJC_LCD_SMART_CONTROLLER) #define LCD_BACKLIGHT_PIN 5 // LCD_Backlight //#ifndef LCD_CONTRAST_PIN - // #define LCD_CONTRAST_PIN 5 // LCD_Contrast + // #define LCD_CONTRAST_PIN 5 // LCD_Contrast //#endif #ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN 24 // Filament runout diff --git a/Marlin/src/pins/ramps/pins_K8800.h b/Marlin/src/pins/ramps/pins_K8800.h index 653d31762995..5cc4b4323a5a 100644 --- a/Marlin/src/pins/ramps/pins_K8800.h +++ b/Marlin/src/pins/ramps/pins_K8800.h @@ -107,7 +107,7 @@ #define LCD_CONTRAST_MIN 0 #define LCD_CONTRAST_MAX 100 - #define DEFAULT_LCD_CONTRAST 30 + #define LCD_CONTRAST_DEFAULT 30 //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #if IS_NEWPANEL diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h index 6d5928e86d58..e6d7c3c20c3c 100644 --- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h +++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h @@ -157,7 +157,7 @@ #define NEOPIXEL_PIN PB9 #endif - #define DEFAULT_LCD_CONTRAST 255 + #define LCD_CONTRAST_DEFAULT 255 #else #define LCD_PINS_RS PC15 #define LCD_PINS_ENABLE PB6 From 2142456a255d66aa8bda782d9950c024039e21f5 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Sat, 22 Jan 2022 10:16:41 -0600 Subject: [PATCH 057/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20LCD=20contrast/bri?= =?UTF-8?q?ghtness=20init=20(#23567)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_post.h | 1 + Marlin/src/lcd/marlinui.cpp | 3 +-- Marlin/src/module/settings.cpp | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 734676559cdc..2f06fe255a0a 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -377,6 +377,7 @@ #define _LCD_CONTRAST_MIN 255 #define _LCD_CONTRAST_INIT 255 #elif ENABLED(FYSETC_MINI_12864) + #define _LCD_CONTRAST_MIN 180 #define _LCD_CONTRAST_INIT 220 #elif ENABLED(ULTI_CONTROLLER) #define _LCD_CONTRAST_INIT 127 diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index c068082c09f7..7b9dc468e489 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -96,8 +96,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif #if HAS_LCD_CONTRAST - uint8_t MarlinUI::contrast; // Initialized by settings.load() - + uint8_t MarlinUI::contrast = LCD_CONTRAST_DEFAULT; // Initialized by settings.load() void MarlinUI::set_contrast(const uint8_t value) { contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); _set_contrast(); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 90bb9f6d6e5f..b737d41c2ddb 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -578,6 +578,9 @@ void MarlinSettings::postprocess() { update_software_endstops((AxisEnum)i); } + TERN_(HAS_LCD_CONTRAST, ui.refresh_contrast()); + TERN_(HAS_LCD_BRIGHTNESS, ui.refresh_brightness()); + TERN_(ENABLE_LEVELING_FADE_HEIGHT, set_z_fade_height(new_z_fade_height, false)); // false = no report TERN_(AUTO_BED_LEVELING_BILINEAR, refresh_bed_level()); @@ -1986,10 +1989,10 @@ void MarlinSettings::postprocess() { // LCD Contrast // { - _FIELD_TEST(lcd_contrast); uint8_t lcd_contrast; + _FIELD_TEST(lcd_contrast); EEPROM_READ(lcd_contrast); - TERN_(HAS_LCD_CONTRAST, if (!validating) ui.set_contrast(lcd_contrast)); + TERN_(HAS_LCD_CONTRAST, if (!validating) ui.contrast = lcd_contrast); } // @@ -1997,8 +2000,9 @@ void MarlinSettings::postprocess() { // { uint8_t lcd_brightness; + _FIELD_TEST(lcd_brightness); EEPROM_READ(lcd_brightness); - TERN_(HAS_LCD_BRIGHTNESS, if (!validating) ui.set_brightness(lcd_brightness)); + TERN_(HAS_LCD_BRIGHTNESS, if (!validating) ui.brightness = lcd_brightness); } // @@ -3018,12 +3022,12 @@ void MarlinSettings::reset() { // // LCD Contrast // - TERN_(HAS_LCD_CONTRAST, ui.set_contrast(DEFAULT_LCD_CONTRAST)); + TERN_(HAS_LCD_CONTRAST, ui.contrast = LCD_CONTRAST_DEFAULT); // // LCD Brightness // - TERN_(HAS_LCD_BRIGHTNESS, ui.set_brightness(DEFAULT_LCD_BRIGHTNESS)); + TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = DEFAULT_LCD_BRIGHTNESS); // // Controller Fan From 2d032b734c7a2e92af597e44dcf111b551d4f6a6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 22 Jan 2022 10:19:26 -0600 Subject: [PATCH 058/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fix?= =?UTF-8?q?=20up=20some=20AUX=20/=20EXP=20pins=20(#23577)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h | 6 +- Marlin/src/pins/esp32/pins_PANDA_common.h | 56 +++++-- Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h | 2 +- Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h | 2 +- Marlin/src/pins/ramps/pins_RAMPS.h | 150 +++++++++++------- Marlin/src/pins/sanguino/pins_ZMIB_V2.h | 78 ++++----- Marlin/src/pins/stm32f1/pins_GTM32_MINI.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 4 +- .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 5 +- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 4 +- Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h | 2 +- Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h | 4 +- .../stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 4 +- 14 files changed, 196 insertions(+), 125 deletions(-) diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 5cae63d31add..122dad214641 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -120,7 +120,7 @@ #define SD_MISO_PIN 19 #define SD_SCK_PIN 18 #define SDSS 5 -#define SD_DETECT_PIN 34 // IO34 default is SD_DET signal(Jump to SDDET) +#define SD_DETECT_PIN 34 // IO34 default is SD_DET signal (Jump to SDDET) #define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers /** @@ -177,9 +177,9 @@ #elif ENABLED(MKS_MINI_12864_V3) + #define LCD_PINS_DC EXP1_07_PIN #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define LCD_PINS_DC DOGLCD_A0 + #define DOGLCD_A0 LCD_PINS_DC #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN EXP1_06_PIN #define NEOPIXEL_PIN EXP1_05_PIN diff --git a/Marlin/src/pins/esp32/pins_PANDA_common.h b/Marlin/src/pins/esp32/pins_PANDA_common.h index 81862fbd553c..7deeca3f6227 100644 --- a/Marlin/src/pins/esp32/pins_PANDA_common.h +++ b/Marlin/src/pins/esp32/pins_PANDA_common.h @@ -62,6 +62,13 @@ #define TEMP_0_PIN 39 // Analog Input #define TEMP_BED_PIN 36 // Analog Input +#if ENABLED(MAX31856_PANDAPI) + #define MAX31856_CLK_PIN 29 + #define MAX31856_MISO_PIN 24 + #define MAX31856_MOSI_PIN 28 + #define MAX31856_CS_PIN 27 +#endif + // // Heaters / Fans // @@ -74,25 +81,48 @@ #define E0_AUTO_FAN_PIN 120 // FAN2 #endif +/** ------ ------ + * (MISO 19?) |10 9 | (18 SCK?) (BEEPER) 129 |10 9 | 12 (^ENC) + * (EN1) 33 | 8 7 | (5 SDSS?) (EN) 26 | 8 7 | 27 (RS) + * (EN2) 32 6 5 | (23 MOSI?) (D4) 14 | 6 5 -- + * (SDDET 2?) | 4 3 | (RESET) -- | 4 3 | -- + * -- | 2 1 | -- (GND) | 2 1 | (5V) + * ------ ------ + * EXP2 EXP1 + */ +#define EXP1_06_PIN 14 +#define EXP1_07_PIN 27 +#define EXP1_08_PIN 26 +#define EXP1_09_PIN 12 +#define EXP1_10_PIN 129 + +#define EXP2_04_PIN 2 // ? +#define EXP2_05_PIN 23 // ? +#define EXP2_06_PIN 32 +#define EXP2_07_PIN 5 // ? +#define EXP2_08_PIN 33 +#define EXP2_09_PIN 18 // ? +#define EXP2_10_PIN 19 // ? + // -// SD card +// SD Card // #if ENABLED(SDSUPPORT) - #define SD_MOSI_PIN 23 - #define SD_MISO_PIN 19 - #define SD_SCK_PIN 18 - #define SDSS 5 - #define SD_DETECT_PIN 2 + #define SD_MOSI_PIN EXP2_05_PIN + #define SD_MISO_PIN EXP2_10_PIN + #define SD_SCK_PIN EXP2_09_PIN + #define SDSS EXP2_07_PIN + #define SD_DETECT_PIN EXP2_04_PIN #endif #if HAS_WIRED_LCD - #define BEEPER_PIN 129 - #define BTN_ENC 12 + #define BEEPER_PIN EXP1_10_PIN - #define BTN_EN1 33 - #define BTN_EN2 32 + #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN - #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 26 - #define LCD_PINS_D4 14 + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #endif diff --git a/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h b/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h index af5cfd6a2eef..4a32472949a3 100644 --- a/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h +++ b/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h @@ -84,7 +84,7 @@ #define E1_ENABLE_PIN 33 // -// Filament runout +// Filament Runout Sensor // #define FIL_RUNOUT_PIN 42 // ROT2 Connector #define FIL_RUNOUT2_PIN 44 // ROT1 Connector diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index d5122e46a9b3..eb92ab5cd010 100644 --- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -69,7 +69,7 @@ #endif // -// Filament Runout Pins +// Filament Runout Sensor // #ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN 49 diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 94e6ccdcbe31..70da23af73e5 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -120,14 +120,14 @@ #define X_DIR_PIN 55 #define X_ENABLE_PIN 38 #ifndef X_CS_PIN - #define X_CS_PIN AUX3_03_PIN + #define X_CS_PIN 53 #endif #define Y_STEP_PIN 60 #define Y_DIR_PIN 61 #define Y_ENABLE_PIN 56 #ifndef Y_CS_PIN - #define Y_CS_PIN AUX3_07_PIN + #define Y_CS_PIN 49 #endif #ifndef Z_STEP_PIN @@ -241,7 +241,7 @@ // Misc. Functions // #ifndef SDSS - #define SDSS AUX3_03_PIN + #define SDSS AUX3_06_PIN #endif #define LED_PIN 13 @@ -423,18 +423,22 @@ #endif // -// AUX1 : 5V GND D2 D1 -// 5V GND A3 A4 - +// AUX1 5V GND D2 D1 +// 2 4 6 8 +// 1 3 5 7 +// 5V GND A3 A4 +// #define AUX1_05_PIN 57 // (A3) #define AUX1_06_PIN 2 #define AUX1_07_PIN 58 // (A4) #define AUX1_08_PIN 1 // -// AUX2 : GND A9 D40 D42 A11 -// VCC A5 A10 D44 A12 - +// AUX2 GND A9 D40 D42 A11 +// 2 4 6 8 10 +// 1 3 5 7 9 +// VCC A5 A10 D44 A12 +// #define AUX2_03_PIN 59 // (A5) #define AUX2_04_PIN 63 // (A9) #define AUX2_05_PIN 64 // (A10) @@ -445,19 +449,20 @@ #define AUX2_10_PIN 65 // (A11) // -// AUX3 : GND D52 D50 5V -// NC D53 D51 D49 - -#define AUX3_03_PIN 53 -#define AUX3_04_PIN 52 -#define AUX3_05_PIN 51 -#define AUX3_06_PIN 50 -#define AUX3_07_PIN 49 +// AUX3 GND D52 D50 5V +// 7 5 3 1 +// 8 6 4 2 +// NC D53 D51 D49 +// +#define AUX3_02_PIN 49 +#define AUX3_03_PIN 50 +#define AUX3_04_PIN 51 +#define AUX3_05_PIN 52 +#define AUX3_06_PIN 53 // -// AUX4 : D16 D17 D23 D25 D27 D29 D31 D33 D35 D37 D39 D41 D43 D45 D47 D32 GND 5V +// AUX4 5V GND D32 D47 D45 D43 D41 D39 D37 D35 D33 D31 D29 D27 D25 D23 D17 D16 // - #define AUX4_03_PIN 32 #define AUX4_04_PIN 47 #define AUX4_05_PIN 45 @@ -476,35 +481,69 @@ #define AUX4_18_PIN 16 /** - * LCD adapter. NOTE: These come in two variants. The socket keys can be + * LCD adapters come in different variants. The socket keys can be * on either side, and may be backwards on some boards / displays. - * ------ ------ - * D37 |10 9 | D35 (MISO) D50 |10 9 | D52 (SCK) - * D17 | 8 7 | D16 D31 | 8 7 | D53 - * D23 6 5 D25 D33 6 5 D51 (MOSI) - * D27 | 4 3 | D29 D49 | 4 3 | D41 - * GND | 2 1 | 5V GND | 2 1 | -- - * ------ ------ - * EXP1 EXP2 */ #ifndef EXP1_03_PIN + #define EXP1_03_PIN AUX4_13_PIN #define EXP1_04_PIN AUX4_14_PIN #define EXP1_05_PIN AUX4_15_PIN #define EXP1_06_PIN AUX4_16_PIN #define EXP1_07_PIN AUX4_18_PIN #define EXP1_08_PIN AUX4_17_PIN - #define EXP1_09_PIN AUX4_10_PIN - #define EXP1_10_PIN AUX4_09_PIN - #define EXP2_03_PIN AUX4_07_PIN - #define EXP2_04_PIN AUX3_07_PIN - #define EXP2_05_PIN AUX3_05_PIN - #define EXP2_06_PIN AUX4_11_PIN - #define EXP2_07_PIN AUX3_03_PIN - #define EXP2_08_PIN AUX4_12_PIN - #define EXP2_09_PIN AUX3_04_PIN - #define EXP2_10_PIN AUX3_06_PIN + #define EXP2_04_PIN AUX3_02_PIN + #define EXP2_05_PIN AUX3_04_PIN + #define EXP2_07_PIN AUX3_06_PIN + #define EXP2_09_PIN AUX3_05_PIN + #define EXP2_10_PIN AUX3_03_PIN + + #if ENABLED(G3D_PANEL) + /** Gadgets3D Smart Adapter + * ------ ------ + * 4-11 |10 9 | 4-12 (MISO) 3-03 |10 9 | 3-05 (SCK) + * 4-17 | 8 7 | 4-18 4-10 | 8 7 | 3-06 + * 4-16 6 5 | 4-15 4-09 6 5 | 3-04 (MOSI) + * 4-14 | 4 3 | 4-13 3-02 | 4 3 | 4-07 + * (GND) 4-02 | 2 1 | 4-01 (5V) -- | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ + #define EXP1_09_PIN AUX4_12_PIN + #define EXP1_10_PIN AUX4_11_PIN + + #define EXP2_03_PIN AUX4_07_PIN + #define EXP2_06_PIN AUX4_09_PIN + #define EXP2_08_PIN AUX4_10_PIN + + #else + + /** Smart Adapter (c) RRD + * ------ ------ + * 4-09 |10 9 | 4-10 (MISO) 3-03 |10 9 | 3-05 (SCK) + * 4-17 | 8 7 | 4-18 4-12 | 8 7 | 3-06 + * 4-16 6 5 | 4-15 4-11 6 5 | 3-04 (MOSI) + * 4-14 | 4 3 | 4-13 3-02 | 4 3 | 4-07 + * (GND) 3-07 | 2 1 | 3-01 (5V) (GND) 3-07 | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ + #define EXP1_09_PIN AUX4_10_PIN + #define EXP1_10_PIN AUX4_09_PIN + + #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) + #define EXP2_03_PIN -1 // RESET + #define EXP2_06_PIN AUX4_12_PIN + #define EXP2_08_PIN AUX4_11_PIN + #else + #define EXP2_03_PIN AUX4_07_PIN + #define EXP2_06_PIN AUX4_11_PIN + #define EXP2_08_PIN AUX4_12_PIN + #endif + + #endif + #endif ////////////////////////// @@ -752,7 +791,7 @@ #define BTN_EN2 AUX2_04_PIN #define BTN_ENC AUX2_03_PIN - #define SD_DETECT_PIN AUX3_07_PIN + #define SD_DETECT_PIN AUX3_02_PIN #define KILL_PIN AUX2_05_PIN #elif ENABLED(ZONESTAR_LCD) @@ -765,14 +804,14 @@ #elif ENABLED(G3D_PANEL) - #define BEEPER_PIN EXP2_06_PIN + #define BEEPER_PIN EXP1_10_PIN #define SD_DETECT_PIN EXP2_04_PIN #define KILL_PIN EXP2_03_PIN - #define BTN_EN1 EXP1_10_PIN - #define BTN_EN2 EXP1_09_PIN - #define BTN_ENC EXP2_08_PIN + #define BTN_EN1 EXP2_06_PIN + #define BTN_EN2 EXP2_08_PIN + #define BTN_ENC EXP1_09_PIN #elif IS_TFTGLCD_PANEL @@ -785,7 +824,7 @@ #if ENABLED(PANEL_ONE) // Buttons connect directly to AUX-2 #define BTN_EN1 AUX2_03_PIN #define BTN_EN2 AUX2_04_PIN - #define BTN_ENC AUX3_07_PIN + #define BTN_ENC AUX3_02_PIN #else #define BTN_EN1 EXP1_10_PIN #define BTN_EN2 EXP1_09_PIN @@ -819,15 +858,15 @@ /** * FYSETC TFT-81050 display pinout * - * Board Display - * ------ ------ - * GND |10 9 | -- 5V |10 9 | GND - * (SD_DET) 49 | 8 7 | RESET RESET | 8 7 | (SD_DET) - * (BTN_EN1) 31 6 5 | 51 (MOSI) (MOSI) 6 5 | (LCD_CS) - * (BTN_EN2) 33 | 4 3 | 53 (SD_CS) (SD_CS) | 4 3 | (MOD_RESET) - * (MISO) 50 | 2 1 | 52 (SCK) (SCK) | 2 1 | (MISO) - * ------ ------ - * EXP2 EXP1 + * Board Display + * ------ ------ + * (MISO) 50 |10 9 | 52 (SCK) 5V |10 9 | GND + * (BTN_EN2) 33 | 8 7 | 53 (SD_CS) RESET | 8 7 | (SD_DET) + * (BTN_EN1) 31 6 5 | 51 (MOSI) (MOSI) 6 5 | (LCD_CS) + * (SD_DET) 49 | 4 3 | RESET (SD_CS) | 4 3 | (MOD_RESET) + * GND | 2 1 | -- (SCK) | 2 1 | (MISO) + * ------ ------ + * EXP2 * * Needs custom cable: * @@ -852,6 +891,7 @@ #define SD_DETECT_PIN EXP2_04_PIN - #define CLCD_MOD_RESET EXP2_08_PIN - #define CLCD_SPI_CS EXP2_06_PIN + #define CLCD_MOD_RESET EXP2_06_PIN + #define CLCD_SPI_CS EXP2_08_PIN + #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 diff --git a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h index cb2dec160029..0a8143c37600 100644 --- a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h +++ b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h @@ -146,7 +146,7 @@ #define FAN1_PIN -1 // -//filament run out sensor +// Filament Runout Sensor // #if EITHER(Z6S_ZFAULT, Z6BS_ZFAULT) #define FIL_RUNOUT_PIN 13 @@ -162,32 +162,38 @@ #endif #define SD_DETECT_PIN -1 -/*=================================================== - * ZMIB Version 1 - EXP1 Connector - * MOSI(D5) TX1(D11) ENA(D12) ENC(D29/A2) 5V - * SCK(D7) RX1(D10) SCS(D4) ENB(D2) GND - *=================================================== - * ZMIB Version 2 - EXP1 Connector - * MOSI(D5) TX1(D11) ENA(D12) ENC(D29/A2) 5V - * SCK(D7) RX1(D10) SCS(D3) ENB(D2) GND - *=================================================== - * LCD 128x64 - *==================================================*/ +/** EXP1 + * ------ + * (MOSI) D5 |10 9 | D7 (SCK) + * (CS) D11 | 8 7 | D10 (DC/D4) + * (EN2) D12 6 5 | D4 or D3 (EN/RS) + * (ENC) D29 | 4 3 | D2 (EN1) + * (GND) | 2 1 | (5V) + * ------ + */ +#define EXP1_03_PIN 2 +#define EXP1_04_PIN 29 +#ifndef IS_ZMIB_V2 + #define EXP1_05_PIN 4 // ZMIB V1 +#else + #define EXP1_05_PIN 3 // ZMIB V2 +#endif +#define EXP1_06_PIN 12 +#define EXP1_07_PIN 10 +#define EXP1_08_PIN 11 +#define EXP1_09_PIN 7 +#define EXP1_10_PIN 5 #if ENABLED(ZONESTAR_12864LCD) // // LCD 128x64 // - #define LCDSCREEN_NAME "ZONESTAR_12864LCD" + #define LCDSCREEN_NAME "ZONESTAR_12864LCD" #define FORCE_SOFT_SPI - //#define LCD_SDSS 11 - #define LCD_PINS_RS 11 // ST7920_CS_PIN LCD_PIN_RS (PIN4 of LCD module) - #ifdef IS_ZMIB_V2 - #define LCD_PINS_ENABLE 3 // ST7920_DAT_PIN LCD_PIN_R/W (PIN5 of LCD module) - #else - #define LCD_PINS_ENABLE 4 // ST7920_DAT_PIN LCD_PIN_R/W (PIN5 of LCD module) - #endif - #define LCD_PINS_D4 10 // ST7920_CLK_PIN LCD_PIN_ENABLE (PIN6 of LCD module) + //#define LCD_SDSS EXP1_08_PIN + #define LCD_PINS_RS EXP1_08_PIN // ST7920_CS_PIN (LCD module pin 4) + #define LCD_PINS_ENABLE EXP1_05_PIN // ST7920_DAT_PIN (LCD module pin 5) + #define LCD_PINS_D4 EXP1_07_PIN // ST7920_CLK_PIN (LCD module pin 6) #define BOARD_ST7920_DELAY_1 DELAY_2_NOP #define BOARD_ST7920_DELAY_2 DELAY_2_NOP @@ -199,34 +205,28 @@ // #define LCDSCREEN_NAME "ZONESTAR 12864OLED" #define FORCE_SOFT_SPI - #ifdef IS_ZMIB_V2 - #define LCD_PINS_RS 3 // RESET - #else - #define LCD_PINS_RS 4 // RESET - #endif - #define LCD_PINS_DC 10 // DC - #define DOGLCD_CS 11 // CS + #define LCD_PINS_RS EXP1_05_PIN + #define LCD_PINS_DC EXP1_07_PIN + #define DOGLCD_CS EXP1_08_PIN + #if ENABLED(OLED_HW_IIC) #error "Oops! can't choose HW IIC for ZMIB board!!" - #elif ENABLED(OLED_HW_SPI) - // HW SPI - #define DOGLCD_A0 LCD_PINS_DC // A0 = DC #else - // SW SPI - #define DOGLCD_A0 LCD_PINS_DC // A0 = DC - #define DOGLCD_MOSI AVR_MOSI_PIN // SDA - #define DOGLCD_SCK AVR_SCK_PIN // SCK + #define DOGLCD_A0 LCD_PINS_DC + #if DISABLED(OLED_HW_SPI) + #define DOGLCD_MOSI AVR_MOSI_PIN // Software SPI + #define DOGLCD_SCK AVR_SCK_PIN + #endif #endif - #endif // // All the above are also RRDSC with rotary encoder // #if IS_RRD_SC - #define BTN_EN1 2 - #define BTN_EN2 12 - #define BTN_ENC 29 + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_06_PIN + #define BTN_ENC EXP1_04_PIN #define BEEPER_PIN -1 #define KILL_PIN -1 #endif diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index 520764a503bc..03547381c010 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -186,7 +186,7 @@ #ifdef GTM32_PRO_VB_USE_LCD_BEEPER // This is pin 32 on J2 FFC40 and pin, goes to the beeper // on Geeetech's version of RepRapDiscount Smart Controller - // (e.g. on Rostock 301) + // (e.g., on Rostock 301) #define BEEPER_PIN PE12 #else // This is the beeper on the board itself diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index 29baeba934f1..150c18d79a1b 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -125,7 +125,7 @@ //#define TEMP_0_CS_PIN PE6 // TC2 - CS2 // -// Filament runout sensor +// Filament Runout Sensor // #define FIL_RUNOUT_PIN PF11 // MT_DET diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 11d42ca6de85..88c5d5f53c73 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -315,9 +315,9 @@ #endif #elif ENABLED(FYSETC_MINI_12864_2_1) + #define LCD_PINS_DC PC6 #define DOGLCD_CS PD13 - #define DOGLCD_A0 PC6 - #define LCD_PINS_DC DOGLCD_A0 + #define DOGLCD_A0 DOGLCD_A0 #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN PE14 #define NEOPIXEL_PIN PE15 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index 14591eb78114..a1a822a9c2f3 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -197,9 +197,10 @@ #define DOGLCD_MOSI EXP2_05_PIN #elif ENABLED(FYSETC_MINI_12864_2_1) + + #define LCD_PINS_DC EXP1_07_PIN #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define LCD_PINS_DC DOGLCD_A0 + #define DOGLCD_A0 LCD_PINS_DC #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN EXP1_06_PIN #define NEOPIXEL_PIN EXP1_05_PIN diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 40ce442e6ceb..07ee8c4fa060 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -341,9 +341,9 @@ #endif #elif ENABLED(FYSETC_MINI_12864_2_1) + #define LCD_PINS_DC PC6 #define DOGLCD_CS PD13 - #define DOGLCD_A0 PC6 - #define LCD_PINS_DC DOGLCD_A0 + #define DOGLCD_A0 DOGLCD_A0 #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN PE14 #define NEOPIXEL_PIN PE15 diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h index ba948bc479fe..b1e5f77d0e9f 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h @@ -224,7 +224,7 @@ #define LCD_PINS_RS EXP1_05_PIN // = LCD_RESET_PIN #define LCD_PINS_DC EXP1_07_PIN // DC #define DOGLCD_CS EXP1_08_PIN // CS - #define DOGLCD_A0 LCD_PINS_DC // A0 = DC + #define DOGLCD_A0 LCD_PINS_DC #define DOGLCD_MOSI EXP1_10_PIN // SDA #define DOGLCD_SCK EXP1_09_PIN // SCK // Encoder diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h index 6e9e0e4b4f79..af71f0d562c8 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h @@ -352,9 +352,9 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) + #define LCD_PINS_DC EXP1_07_PIN #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define LCD_PINS_DC DOGLCD_A0 + #define DOGLCD_A0 LCD_PINS_DC #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN EXP1_06_PIN #define NEOPIXEL_PIN EXP1_05_PIN diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index b892affe68ef..dee6923076b3 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -338,9 +338,9 @@ //#undef SHOW_BOOTSCREEN #elif ENABLED(FYSETC_MINI_12864_2_1) + #define LCD_PINS_DC EXP1_07_PIN #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define LCD_PINS_DC DOGLCD_A0 + #define DOGLCD_A0 LCD_PINS_DC #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN EXP1_06_PIN #define NEOPIXEL_PIN EXP1_05_PIN From 50906876824881a807917310e05f77b9d6f9b04b Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 25 Jan 2022 00:09:53 -0800 Subject: [PATCH 059/502] =?UTF-8?q?=F0=9F=94=A8=20Creality=20RCT6=20(256K)?= =?UTF-8?q?=20variants=20(#23599)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- .github/workflows/test-builds.yml | 4 +- Marlin/src/core/boards.h | 110 +++++++++--------- Marlin/src/pins/pins.h | 16 +-- ...F103RET6_creality => STM32F103RE_creality} | 2 +- ini/stm32f1-maple.ini | 2 +- ini/stm32f1.ini | 36 +++++- 6 files changed, 97 insertions(+), 73 deletions(-) rename buildroot/tests/{STM32F103RET6_creality => STM32F103RE_creality} (97%) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index c50a15399de6..069f36714d93 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -66,7 +66,7 @@ jobs: - mks_robin_lite_maple - mks_robin_pro_maple #- mks_robin_nano35_maple - #- STM32F103RET6_creality_maple + #- STM32F103RE_creality_maple - STM32F103VE_ZM3E4V2_USB_maple # STM32 (ST) Environments @@ -75,7 +75,7 @@ jobs: #- STM32F103RC_btt_USB - STM32F103RE_btt - STM32F103RE_btt_USB - - STM32F103RET6_creality + - STM32F103RE_creality - STM32F103VE_longer - STM32F407VE_black - STM32F401VE_STEVAL diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index aee9b3c49287..6d294ddcc2e2 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -300,26 +300,26 @@ #define BOARD_MALYAN_M200_V2 4000 // STM32F070CB controller #define BOARD_MALYAN_M300 4001 // STM32F070-based delta #define BOARD_STM32F103RE 4002 // STM32F103RE Libmaple-based STM32F1 controller -#define BOARD_MALYAN_M200 4003 // STM32C8T6 Libmaple-based STM32F1 controller +#define BOARD_MALYAN_M200 4003 // STM32C8 Libmaple-based STM32F1 controller #define BOARD_STM3R_MINI 4004 // STM32F103RE Libmaple-based STM32F1 controller -#define BOARD_GTM32_PRO_VB 4005 // STM32F103VET6 controller -#define BOARD_GTM32_MINI 4006 // STM32F103VET6 controller -#define BOARD_GTM32_MINI_A30 4007 // STM32F103VET6 controller -#define BOARD_GTM32_REV_B 4008 // STM32F103VET6 controller +#define BOARD_GTM32_PRO_VB 4005 // STM32F103VE controller +#define BOARD_GTM32_MINI 4006 // STM32F103VE controller +#define BOARD_GTM32_MINI_A30 4007 // STM32F103VE controller +#define BOARD_GTM32_REV_B 4008 // STM32F103VE controller #define BOARD_MORPHEUS 4009 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller -#define BOARD_CHITU3D 4010 // Chitu3D (STM32F103RET6) -#define BOARD_MKS_ROBIN 4011 // MKS Robin (STM32F103ZET6) -#define BOARD_MKS_ROBIN_MINI 4012 // MKS Robin Mini (STM32F103VET6) -#define BOARD_MKS_ROBIN_NANO 4013 // MKS Robin Nano (STM32F103VET6) -#define BOARD_MKS_ROBIN_NANO_V2 4014 // MKS Robin Nano V2 (STM32F103VET6) -#define BOARD_MKS_ROBIN_LITE 4015 // MKS Robin Lite/Lite2 (STM32F103RCT6) -#define BOARD_MKS_ROBIN_LITE3 4016 // MKS Robin Lite3 (STM32F103RCT6) -#define BOARD_MKS_ROBIN_PRO 4017 // MKS Robin Pro (STM32F103ZET6) -#define BOARD_MKS_ROBIN_E3 4018 // MKS Robin E3 (STM32F103RCT6) -#define BOARD_MKS_ROBIN_E3_V1_1 4019 // MKS Robin E3 V1.1 (STM32F103RCT6) -#define BOARD_MKS_ROBIN_E3D 4020 // MKS Robin E3D (STM32F103RCT6) -#define BOARD_MKS_ROBIN_E3D_V1_1 4021 // MKS Robin E3D V1.1 (STM32F103RCT6) -#define BOARD_MKS_ROBIN_E3P 4022 // MKS Robin E3p (STM32F103VET6) +#define BOARD_CHITU3D 4010 // Chitu3D (STM32F103RE) +#define BOARD_MKS_ROBIN 4011 // MKS Robin (STM32F103ZE) +#define BOARD_MKS_ROBIN_MINI 4012 // MKS Robin Mini (STM32F103VE) +#define BOARD_MKS_ROBIN_NANO 4013 // MKS Robin Nano (STM32F103VE) +#define BOARD_MKS_ROBIN_NANO_V2 4014 // MKS Robin Nano V2 (STM32F103VE) +#define BOARD_MKS_ROBIN_LITE 4015 // MKS Robin Lite/Lite2 (STM32F103RC) +#define BOARD_MKS_ROBIN_LITE3 4016 // MKS Robin Lite3 (STM32F103RC) +#define BOARD_MKS_ROBIN_PRO 4017 // MKS Robin Pro (STM32F103ZE) +#define BOARD_MKS_ROBIN_E3 4018 // MKS Robin E3 (STM32F103RC) +#define BOARD_MKS_ROBIN_E3_V1_1 4019 // MKS Robin E3 V1.1 (STM32F103RC) +#define BOARD_MKS_ROBIN_E3D 4020 // MKS Robin E3D (STM32F103RC) +#define BOARD_MKS_ROBIN_E3D_V1_1 4021 // MKS Robin E3D V1.1 (STM32F103RC) +#define BOARD_MKS_ROBIN_E3P 4022 // MKS Robin E3p (STM32F103VE) #define BOARD_BTT_SKR_MINI_V1_1 4023 // BigTreeTech SKR Mini v1.1 (STM32F103RC) #define BOARD_BTT_SKR_MINI_E3_V1_0 4024 // BigTreeTech SKR Mini E3 (STM32F103RC) #define BOARD_BTT_SKR_MINI_E3_V1_2 4025 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC) @@ -328,11 +328,11 @@ #define BOARD_BTT_SKR_MINI_MZ_V1_0 4028 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC) #define BOARD_BTT_SKR_E3_DIP 4029 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE) #define BOARD_BTT_SKR_CR6 4030 // BigTreeTech SKR CR6 v1.0 (STM32F103RE) -#define BOARD_JGAURORA_A5S_A1 4031 // JGAurora A5S A1 (STM32F103ZET6) +#define BOARD_JGAURORA_A5S_A1 4031 // JGAurora A5S A1 (STM32F103ZE) #define BOARD_FYSETC_AIO_II 4032 // FYSETC AIO_II #define BOARD_FYSETC_CHEETAH 4033 // FYSETC Cheetah #define BOARD_FYSETC_CHEETAH_V12 4034 // FYSETC Cheetah V1.2 -#define BOARD_LONGER3D_LK 4035 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6 +#define BOARD_LONGER3D_LK 4035 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VE #define BOARD_CCROBOT_MEEB_3DP 4036 // ccrobot-online.com MEEB_3DP (STM32F103RC) #define BOARD_CHITU3D_V5 4037 // Chitu3D TronXY X5SA V5 Board #define BOARD_CHITU3D_V6 4038 // Chitu3D TronXY X5SA V6 Board @@ -349,16 +349,16 @@ #define BOARD_CREALITY_V452 4049 // Creality v4.5.2 (STM32F103RE) #define BOARD_CREALITY_V453 4050 // Creality v4.5.3 (STM32F103RE) #define BOARD_CREALITY_V24S1 4051 // Creality v2.4.S1 (STM32F103RE) v101 as found in the Ender 7 -#define BOARD_TRIGORILLA_PRO 4052 // Trigorilla Pro (STM32F103ZET6) -#define BOARD_FLY_MINI 4053 // FLYmaker FLY MINI (STM32F103RCT6) -#define BOARD_FLSUN_HISPEED 4054 // FLSUN HiSpeedV1 (STM32F103VET6) -#define BOARD_BEAST 4055 // STM32F103RET6 Libmaple-based controller -#define BOARD_MINGDA_MPX_ARM_MINI 4056 // STM32F103ZET6 Mingda MD-16 -#define BOARD_GTM32_PRO_VD 4057 // STM32F103VET6 controller -#define BOARD_ZONESTAR_ZM3E2 4058 // Zonestar ZM3E2 (STM32F103RCT6) -#define BOARD_ZONESTAR_ZM3E4 4059 // Zonestar ZM3E4 V1 (STM32F103VCT6) -#define BOARD_ZONESTAR_ZM3E4V2 4060 // Zonestar ZM3E4 V2 (STM32F103VCT6) -#define BOARD_ERYONE_ERY32_MINI 4061 // Eryone Ery32 mini (STM32F103VET6) +#define BOARD_TRIGORILLA_PRO 4052 // Trigorilla Pro (STM32F103ZE) +#define BOARD_FLY_MINI 4053 // FLYmaker FLY MINI (STM32F103RC) +#define BOARD_FLSUN_HISPEED 4054 // FLSUN HiSpeedV1 (STM32F103VE) +#define BOARD_BEAST 4055 // STM32F103RE Libmaple-based controller +#define BOARD_MINGDA_MPX_ARM_MINI 4056 // STM32F103ZE Mingda MD-16 +#define BOARD_GTM32_PRO_VD 4057 // STM32F103VE controller +#define BOARD_ZONESTAR_ZM3E2 4058 // Zonestar ZM3E2 (STM32F103RC) +#define BOARD_ZONESTAR_ZM3E4 4059 // Zonestar ZM3E4 V1 (STM32F103VC) +#define BOARD_ZONESTAR_ZM3E4V2 4060 // Zonestar ZM3E4 V2 (STM32F103VC) +#define BOARD_ERYONE_ERY32_MINI 4061 // Eryone Ery32 mini (STM32F103VE) // // ARM Cortex-M4F @@ -372,44 +372,44 @@ // #define BOARD_ARMED 4200 // Arm'ed STM32F4-based controller -#define BOARD_RUMBA32_V1_0 4201 // RUMBA32 STM32F446VET6 based controller from Aus3D -#define BOARD_RUMBA32_V1_1 4202 // RUMBA32 STM32F446VET6 based controller from Aus3D -#define BOARD_RUMBA32_MKS 4203 // RUMBA32 STM32F446VET6 based controller from Makerbase -#define BOARD_RUMBA32_BTT 4204 // RUMBA32 STM32F446VET6 based controller from BIGTREETECH +#define BOARD_RUMBA32_V1_0 4201 // RUMBA32 STM32F446VE based controller from Aus3D +#define BOARD_RUMBA32_V1_1 4202 // RUMBA32 STM32F446VE based controller from Aus3D +#define BOARD_RUMBA32_MKS 4203 // RUMBA32 STM32F446VE based controller from Makerbase +#define BOARD_RUMBA32_BTT 4204 // RUMBA32 STM32F446VE based controller from BIGTREETECH #define BOARD_BLACK_STM32F407VE 4205 // BLACK_STM32F407VE #define BOARD_BLACK_STM32F407ZE 4206 // BLACK_STM32F407ZE #define BOARD_STEVAL_3DP001V1 4207 // STEVAL-3DP001V1 3D PRINTER BOARD -#define BOARD_BTT_SKR_PRO_V1_1 4208 // BigTreeTech SKR Pro v1.1 (STM32F407ZGT6) -#define BOARD_BTT_SKR_PRO_V1_2 4209 // BigTreeTech SKR Pro v1.2 (STM32F407ZGT6) -#define BOARD_BTT_BTT002_V1_0 4210 // BigTreeTech BTT002 v1.0 (STM32F407VGT6) -#define BOARD_BTT_E3_RRF 4211 // BigTreeTech E3 RRF (STM32F407VGT6) -#define BOARD_BTT_SKR_V2_0_REV_A 4212 // BigTreeTech SKR v2.0 Rev A (STM32F407VGT6) -#define BOARD_BTT_SKR_V2_0_REV_B 4213 // BigTreeTech SKR v2.0 Rev B (STM32F407VGT6/STM32F429VGT6) +#define BOARD_BTT_SKR_PRO_V1_1 4208 // BigTreeTech SKR Pro v1.1 (STM32F407ZG) +#define BOARD_BTT_SKR_PRO_V1_2 4209 // BigTreeTech SKR Pro v1.2 (STM32F407ZG) +#define BOARD_BTT_BTT002_V1_0 4210 // BigTreeTech BTT002 v1.0 (STM32F407VG) +#define BOARD_BTT_E3_RRF 4211 // BigTreeTech E3 RRF (STM32F407VG) +#define BOARD_BTT_SKR_V2_0_REV_A 4212 // BigTreeTech SKR v2.0 Rev A (STM32F407VG) +#define BOARD_BTT_SKR_V2_0_REV_B 4213 // BigTreeTech SKR v2.0 Rev B (STM32F407VG/STM32F429VG) #define BOARD_BTT_GTR_V1_0 4214 // BigTreeTech GTR v1.0 (STM32F407IGT) -#define BOARD_BTT_OCTOPUS_V1_0 4215 // BigTreeTech Octopus v1.0 (STM32F446ZET6) -#define BOARD_BTT_OCTOPUS_V1_1 4216 // BigTreeTech Octopus v1.1 (STM32F446ZET6) -#define BOARD_BTT_OCTOPUS_PRO_V1_0 4217 // BigTreeTech Octopus Pro v1.0 (STM32F446ZET6/STM32F429ZGT6) +#define BOARD_BTT_OCTOPUS_V1_0 4215 // BigTreeTech Octopus v1.0 (STM32F446ZE) +#define BOARD_BTT_OCTOPUS_V1_1 4216 // BigTreeTech Octopus v1.1 (STM32F446ZE) +#define BOARD_BTT_OCTOPUS_PRO_V1_0 4217 // BigTreeTech Octopus Pro v1.0 (STM32F446ZE/STM32F429ZG) #define BOARD_LERDGE_K 4218 // Lerdge K (STM32F407ZG) #define BOARD_LERDGE_S 4219 // Lerdge S (STM32F407VE) #define BOARD_LERDGE_X 4220 // Lerdge X (STM32F407VE) -#define BOARD_VAKE403D 4221 // VAkE 403D (STM32F446VET6) -#define BOARD_FYSETC_S6 4222 // FYSETC S6 (STM32F446VET6) -#define BOARD_FYSETC_S6_V2_0 4223 // FYSETC S6 v2.0 (STM32F446VET6) -#define BOARD_FYSETC_SPIDER 4224 // FYSETC Spider (STM32F446VET6) +#define BOARD_VAKE403D 4221 // VAkE 403D (STM32F446VE) +#define BOARD_FYSETC_S6 4222 // FYSETC S6 (STM32F446VE) +#define BOARD_FYSETC_S6_V2_0 4223 // FYSETC S6 v2.0 (STM32F446VE) +#define BOARD_FYSETC_SPIDER 4224 // FYSETC Spider (STM32F446VE) #define BOARD_FLYF407ZG 4225 // FLYmaker FLYF407ZG (STM32F407ZG) #define BOARD_MKS_ROBIN2 4226 // MKS_ROBIN2 (STM32F407ZE) #define BOARD_MKS_ROBIN_PRO_V2 4227 // MKS Robin Pro V2 (STM32F407VE) #define BOARD_MKS_ROBIN_NANO_V3 4228 // MKS Robin Nano V3 (STM32F407VG) -#define BOARD_MKS_MONSTER8 4229 // MKS Monster8 (STM32F407VGT6) -#define BOARD_ANET_ET4 4230 // ANET ET4 V1.x (STM32F407VGT6) -#define BOARD_ANET_ET4P 4231 // ANET ET4P V1.x (STM32F407VGT6) +#define BOARD_MKS_MONSTER8 4229 // MKS Monster8 (STM32F407VG) +#define BOARD_ANET_ET4 4230 // ANET ET4 V1.x (STM32F407VG) +#define BOARD_ANET_ET4P 4231 // ANET ET4P V1.x (STM32F407VG) #define BOARD_FYSETC_CHEETAH_V20 4232 // FYSETC Cheetah V2.0 #define BOARD_TH3D_EZBOARD_V2 4233 // TH3D EZBoard v2.0 -#define BOARD_INDEX_REV03 4234 // Index PnP Controller REV03 (STM32F407VET6/VGT6) -#define BOARD_MKS_ROBIN_NANO_V1_3_F4 4235 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VET6) -#define BOARD_MKS_EAGLE 4236 // MKS Eagle (STM32F407VET6) -#define BOARD_ARTILLERY_RUBY 4237 // Artillery Ruby (STM32F401RCT6) -#define BOARD_FYSETC_SPIDER_V2_2 4238 // FYSETC Spider V2.2 (STM32F446VET6) +#define BOARD_INDEX_REV03 4234 // Index PnP Controller REV03 (STM32F407VE/VG) +#define BOARD_MKS_ROBIN_NANO_V1_3_F4 4235 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VE) +#define BOARD_MKS_EAGLE 4236 // MKS Eagle (STM32F407VE) +#define BOARD_ARTILLERY_RUBY 4237 // Artillery Ruby (STM32F401RC) +#define BOARD_FYSETC_SPIDER_V2_2 4238 // FYSETC Spider V2.2 (STM32F446VE) // // ARM Cortex M7 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 7ca78677e9ff..858a00524fd5 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -558,21 +558,21 @@ #elif MB(CHITU3D_V9) #include "stm32f1/pins_CHITU3D_V9.h" // STM32F1 env:chitu_f103 env:chitu_f103_maple #elif MB(CREALITY_V4) - #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V4210) - #include "stm32f1/pins_CREALITY_V4210.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V4210.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V423) - #include "stm32f1/pins_CREALITY_V423.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer + #include "stm32f1/pins_CREALITY_V423.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer #elif MB(CREALITY_V427) - #include "stm32f1/pins_CREALITY_V427.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V427.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V431, CREALITY_V431_A, CREALITY_V431_B, CREALITY_V431_C, CREALITY_V431_D) - #include "stm32f1/pins_CREALITY_V431.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V431.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V452) - #include "stm32f1/pins_CREALITY_V452.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V452.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V453) - #include "stm32f1/pins_CREALITY_V453.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V453.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V24S1) - #include "stm32f1/pins_CREALITY_V24S1.h" // STM32F1 env:STM32F103RET6_creality env:STM32F103RET6_creality_xfer env:STM32F103RET6_creality_maple + #include "stm32f1/pins_CREALITY_V24S1.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(TRIGORILLA_PRO) #include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro env:trigorilla_pro_maple #elif MB(FLY_MINI) diff --git a/buildroot/tests/STM32F103RET6_creality b/buildroot/tests/STM32F103RE_creality similarity index 97% rename from buildroot/tests/STM32F103RET6_creality rename to buildroot/tests/STM32F103RE_creality index 8eda5f801dd4..27fc26f0a09c 100755 --- a/buildroot/tests/STM32F103RET6_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Build tests for STM32F103RET6_creality +# Build tests for STM32F103RE_creality # # exit on first failure diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index 878ccd6f7ce6..774c3b2efb92 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -114,7 +114,7 @@ monitor_speed = 115200 # # Creality (STM32F103RET6) # -[env:STM32F103RET6_creality_maple] +[env:STM32F103RE_creality_maple] extends = env:STM32F103RE_maple build_flags = ${common_stm32f1.build_flags} -DTEMP_TIMER_CHAN=4 board_build.address = 0x08007000 diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index a0957dbaece3..07b75e4e9458 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -103,11 +103,10 @@ build_unflags = ${common_STM32F103RC_variant.build_unflags} debug_tool = stlink # -# Creality (STM32F103RET6) +# Creality (STM32F103Rx) # -[env:STM32F103RET6_creality] +[STM32F103Rx_creality] extends = stm32_variant -board = genericSTM32F103RE board_build.variant = MARLIN_F103Rx board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 @@ -123,12 +122,37 @@ monitor_speed = 115200 debug_tool = jlink upload_protocol = jlink -[env:STM32F103RET6_creality_xfer] -extends = env:STM32F103RET6_creality -extra_scripts = ${env:STM32F103RET6_creality.extra_scripts} +# +# Custom upload to SD via Marlin with Binary Protocol +# +[STM32F103Rx_creality_xfer] +extends = STM32F103Rx_creality +extra_scripts = ${STM32F103Rx_creality.extra_scripts} pre:buildroot/share/scripts/upload.py upload_protocol = custom +# +# Creality 512K (STM32F103RE) +# +[env:STM32F103RE_creality] +extends = STM32F103Rx_creality +board = genericSTM32F103RE + +[env:STM32F103RE_creality_xfer] +extends = STM32F103Rx_creality_xfer +board = genericSTM32F103RE + +# +# Creality 256K (STM32F103RC) +# +[env:STM32F103RC_creality] +extends = STM32F103Rx_creality +board = genericSTM32F103RC + +[env:STM32F103RC_creality_xfer] +extends = STM32F103Rx_creality_xfer +board = genericSTM32F103RC + # # BigTree SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3) # From 2f48c30445281266adf19bc00232db66f885f516 Mon Sep 17 00:00:00 2001 From: DejitaruJin Date: Tue, 25 Jan 2022 03:52:23 -0500 Subject: [PATCH 060/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20DWIN=20float=20deb?= =?UTF-8?q?ugging=20(#23601)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h | 2 +- Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h | 2 +- Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 4 ++-- Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h | 2 +- Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h index dfc1e9ea7d68..d4fdf1d27e2a 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h @@ -206,7 +206,7 @@ class DGUSScreenHandler { static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPGM(" >> ", f, 6); + DEBUG_ECHOLNPAIR_F(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h index dfc1e9ea7d68..d4fdf1d27e2a 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h @@ -206,7 +206,7 @@ class DGUSScreenHandler { static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPGM(" >> ", f, 6); + DEBUG_ECHOLNPAIR_F(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 8054181353ec..ab2150a886c1 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -93,7 +93,7 @@ void DGUSScreenHandler::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) { void DGUSScreenHandler::DGUSLCD_SendBabyStepToDisplay_MKS(DGUS_VP_Variable &var) { float value = current_position.z; - DEBUG_ECHOLNPGM(" >> ", value, 6); + DEBUG_ECHOLNPAIR_F(" >> ", value, 6); value *= cpow(10, 2); dgusdisplay.WriteVariable(VP_SD_Print_Baby, (uint16_t)value); } @@ -756,7 +756,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { else if (manualMoveStep == 0x02) manualMoveStep = 100; else if (manualMoveStep == 0x03) manualMoveStep = 1000; - DEBUG_ECHOLNPGM("QUEUE LEN:", queue.length); + DEBUG_ECHOLNPGM("QUEUE LEN:", queue.ring_buffer.length); if (!print_job_timer.isPaused() && !queue.ring_buffer.empty()) return; diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h index ee423b7bb943..2e6c8af9852b 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h @@ -273,7 +273,7 @@ class DGUSScreenHandler { static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPGM(" >> ", f, 6); + DEBUG_ECHOLNPAIR_F(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h index dfc1e9ea7d68..d4fdf1d27e2a 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h @@ -206,7 +206,7 @@ class DGUSScreenHandler { static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPGM(" >> ", f, 6); + DEBUG_ECHOLNPAIR_F(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } From 9f06079549ffad265579e6933bb81491fc179892 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 25 Jan 2022 01:25:19 -0800 Subject: [PATCH 061/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Creality=20DWIN=20?= =?UTF-8?q?LCD=20with=20SKR=20Mini=20E3=20V3=20(#23593)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 2daa15d0d3ea..1200d18dd036 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -509,7 +509,7 @@ #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI #define SERIAL_CATCHALL 0 #ifndef LCD_SERIAL_PORT - #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_E3_TURBO) + #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO) #define LCD_SERIAL_PORT 1 #else #define LCD_SERIAL_PORT 3 // Creality 4.x board From a4ea8bc1e121301fe4dfaf304ae482709fae1754 Mon Sep 17 00:00:00 2001 From: Lars Date: Tue, 25 Jan 2022 10:30:45 +0100 Subject: [PATCH 062/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20DGUS=5FReloaded=20?= =?UTF-8?q?G-code=20execution=20(#23592)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lcd/extui/dgus_reloaded/DGUSDisplay.cpp | 7 ++- .../src/lcd/extui/dgus_reloaded/DGUSDisplay.h | 3 + .../extui/dgus_reloaded/DGUSScreenHandler.cpp | 59 +++++++------------ 3 files changed, 29 insertions(+), 40 deletions(-) diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp index 1d97902c7171..fe7313b17008 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp @@ -57,7 +57,7 @@ void DGUSDisplay::Loop() { void DGUSDisplay::Init() { LCD_SERIAL.begin(LCD_BAUDRATE); - Read(DGUS_VERSION, 1); + ReadVersions(); } void DGUSDisplay::Read(uint16_t addr, uint8_t size) { @@ -158,6 +158,11 @@ void DGUSDisplay::WriteStringPGM(uint16_t addr, const void* data_ptr, uint8_t si } } +void DGUSDisplay::ReadVersions() { + if (gui_version != 0 && os_version != 0) return; + Read(DGUS_VERSION, 1); +} + void DGUSDisplay::SwitchScreen(DGUS_Screen screen) { DEBUG_ECHOLNPGM("SwitchScreen ", (uint8_t)screen); const uint8_t command[] = { 0x5A, 0x01, 0x00, (uint8_t)screen }; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h index 332108d81a30..fa5bf3039696 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h @@ -69,6 +69,9 @@ class DGUSDisplay { // Until now I did not need to actively read from the display. That's why there is no ReadVariable // (I extensively use the auto upload of the display) + // Read GUI and OS version from screen + static void ReadVersions(); + // Force display into another screen. static void SwitchScreen(DGUS_Screen screen); // Play sounds using the display speaker. diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 17e7a3844592..6388e1683d05 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -100,37 +100,37 @@ void DGUSScreenHandler::Loop() { if (new_screen != DGUS_Screen::BOOT) { const DGUS_Screen screen = new_screen; new_screen = DGUS_Screen::BOOT; - - if (current_screen == screen) { + if (current_screen == screen) TriggerFullUpdate(); - } - else { + else MoveToScreen(screen); - } return; } if (!booted && ELAPSED(ms, 3000)) { booted = true; - if (current_screen == DGUS_Screen::BOOT) { + dgus_display.ReadVersions(); + + if (current_screen == DGUS_Screen::BOOT) MoveToScreen(DGUS_Screen::HOME); - } + return; } if (ELAPSED(ms, next_event_ms) || full_update) { next_event_ms = ms + DGUS_UPDATE_INTERVAL_MS; - if (!SendScreenVPData(current_screen, full_update)) { + if (!SendScreenVPData(current_screen, full_update)) DEBUG_ECHOLNPGM("SendScreenVPData failed"); - } + return; } if (current_screen == DGUS_Screen::WAIT && ((wait_continue && !wait_for_user) - || (!wait_continue && IsPrinterIdle()))) { + || (!wait_continue && IsPrinterIdle())) + ) { MoveToScreen(wait_return_screen, true); return; } @@ -151,7 +151,6 @@ void DGUSScreenHandler::Loop() { if (eeprom_save > 0 && ELAPSED(ms, eeprom_save) && IsPrinterIdle()) { eeprom_save = 0; - queue.enqueue_now_P(DGUS_CMD_EEPROM_SAVE); return; } @@ -187,7 +186,6 @@ void DGUSScreenHandler::SettingsReset() { if (!settings_ready) { settings_ready = true; - Ready(); } @@ -225,9 +223,8 @@ void DGUSScreenHandler::LoadSettings(const char *buff) { } void DGUSScreenHandler::ConfigurationStoreWritten(bool success) { - if (!success) { + if (!success) SetStatusMessage(F("EEPROM write failed")); - } } void DGUSScreenHandler::ConfigurationStoreRead(bool success) { @@ -236,7 +233,6 @@ void DGUSScreenHandler::ConfigurationStoreRead(bool success) { } else if (!settings_ready) { settings_ready = true; - Ready(); } } @@ -245,33 +241,25 @@ void DGUSScreenHandler::PlayTone(const uint16_t frequency, const uint16_t durati UNUSED(duration); if (frequency >= 1 && frequency <= 255) { - if (duration >= 1 && duration <= 255) { + if (duration >= 1 && duration <= 255) dgus_display.PlaySound((uint8_t)frequency, (uint8_t)duration); - } - else { + else dgus_display.PlaySound((uint8_t)frequency); - } } } void DGUSScreenHandler::MeshUpdate(const int8_t xpos, const int8_t ypos) { if (current_screen != DGUS_Screen::LEVELING_PROBING) { - if (current_screen == DGUS_Screen::LEVELING_AUTOMATIC) { + if (current_screen == DGUS_Screen::LEVELING_AUTOMATIC) TriggerFullUpdate(); - } - return; } uint8_t point = ypos * GRID_MAX_POINTS_X + xpos; probing_icons[point < 16 ? 0 : 1] |= (1U << (point % 16)); - if (xpos >= GRID_MAX_POINTS_X - 1 - && ypos >= GRID_MAX_POINTS_Y - 1 - && !ExtUI::getMeshValid()) { - probing_icons[0] = 0; - probing_icons[1] = 0; - } + if (xpos >= GRID_MAX_POINTS_X - 1 && ypos >= GRID_MAX_POINTS_Y - 1 && !ExtUI::getMeshValid()) + probing_icons[0] = probing_icons[1] = 0; TriggerFullUpdate(); } @@ -282,15 +270,12 @@ void DGUSScreenHandler::PrintTimerStarted() { void DGUSScreenHandler::PrintTimerPaused() { dgus_display.PlaySound(3); - TriggerFullUpdate(); } void DGUSScreenHandler::PrintTimerStopped() { - if (current_screen != DGUS_Screen::PRINT_STATUS - && current_screen != DGUS_Screen::PRINT_ADJUST) { + if (current_screen != DGUS_Screen::PRINT_STATUS && current_screen != DGUS_Screen::PRINT_ADJUST) return; - } dgus_display.PlaySound(3); @@ -309,23 +294,19 @@ void DGUSScreenHandler::FilamentRunout(const ExtUI::extruder_t extruder) { #if ENABLED(SDSUPPORT) void DGUSScreenHandler::SDCardInserted() { - if (current_screen == DGUS_Screen::HOME) { + if (current_screen == DGUS_Screen::HOME) TriggerScreenChange(DGUS_Screen::PRINT); - } } void DGUSScreenHandler::SDCardRemoved() { - if (current_screen == DGUS_Screen::PRINT) { + if (current_screen == DGUS_Screen::PRINT) TriggerScreenChange(DGUS_Screen::HOME); - } } void DGUSScreenHandler::SDCardError() { SetStatusMessage(GET_TEXT_F(MSG_MEDIA_READ_ERROR)); - - if (current_screen == DGUS_Screen::PRINT) { + if (current_screen == DGUS_Screen::PRINT) TriggerScreenChange(DGUS_Screen::HOME); - } } #endif // SDSUPPORT From 33c89547f041843c3bb8e247654ed861825b5f4a Mon Sep 17 00:00:00 2001 From: Timofey Titovets Date: Tue, 25 Jan 2022 12:36:09 +0300 Subject: [PATCH 063/502] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Tuned=20Thermistor?= =?UTF-8?q?=2066=20(T-D500)=20(#23585)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/thermistor/thermistor_66.h | 109 +++++++++++++++---- 1 file changed, 88 insertions(+), 21 deletions(-) diff --git a/Marlin/src/module/thermistor/thermistor_66.h b/Marlin/src/module/thermistor/thermistor_66.h index 3b057ac6960e..07cb29767935 100644 --- a/Marlin/src/module/thermistor/thermistor_66.h +++ b/Marlin/src/module/thermistor/thermistor_66.h @@ -27,27 +27,94 @@ constexpr temp_entry_t temptable_66[] PROGMEM = { { OV( 17.9), 500 }, { OV( 21.7), 480 }, { OV( 26.6), 460 }, - { OV( 33.1), 440 }, - { OV( 41.0), 420 }, - { OV( 52.3), 400 }, - { OV( 67.7), 380 }, - { OV( 86.5), 360 }, - { OV( 112.0), 340 }, - { OV( 147.2), 320 }, - { OV( 194.0), 300 }, - { OV( 254.3), 280 }, - { OV( 330.2), 260 }, - { OV( 427.9), 240 }, - { OV( 533.4), 220 }, - { OV( 646.5), 200 }, - { OV( 754.4), 180 }, - { OV( 844.3), 160 }, - { OV( 911.7), 140 }, - { OV( 958.6), 120 }, - { OV( 988.8), 100 }, + { OV( 34.0), 430 }, + { OV( 36.0), 426 }, + { OV( 37.0), 422 }, + { OV( 38.0), 418 }, + { OV( 40.4), 414 }, + { OV( 43.0), 410 }, + { OV( 45.6), 406 }, + { OV( 48.0), 402 }, + { OV( 50.6), 398 }, + { OV( 53.0), 394 }, + { OV( 56.0), 390 }, + { OV( 58.0), 386 }, + { OV( 61.0), 382 }, + { OV( 64.0), 378 }, + { OV( 68.0), 374 }, + { OV( 72.0), 370 }, + { OV( 75.0), 366 }, + { OV( 79.0), 362 }, + { OV( 83.0), 358 }, + { OV( 88.0), 354 }, + { OV( 93.0), 350 }, + { OV( 97.0), 346 }, + { OV( 103.0), 342 }, + { OV( 109.0), 338 }, + { OV( 115.0), 334 }, + { OV( 121.0), 330 }, + { OV( 128.0), 326 }, + { OV( 135.0), 322 }, + { OV( 143.0), 318 }, + { OV( 151.0), 314 }, + { OV( 160.0), 310 }, + { OV( 168.0), 306 }, + { OV( 177.0), 302 }, + { OV( 188.0), 298 }, + { OV( 198.0), 294 }, + { OV( 209.0), 290 }, + { OV( 222.0), 286 }, + { OV( 235.0), 282 }, + { OV( 248.0), 278 }, + { OV( 262.0), 274 }, + { OV( 276.0), 270 }, + { OV( 291.0), 266 }, + { OV( 306.0), 262 }, + { OV( 323.0), 258 }, + { OV( 340.0), 254 }, + { OV( 357.0), 250 }, + { OV( 378.0), 246 }, + { OV( 397.0), 242 }, + { OV( 417.0), 238 }, + { OV( 437.0), 234 }, + { OV( 458.0), 230 }, + { OV( 481.0), 226 }, + { OV( 502.0), 222 }, + { OV( 525.0), 218 }, + { OV( 547.0), 214 }, + { OV( 570.0), 210 }, + { OV( 594.0), 206 }, + { OV( 615.0), 202 }, + { OV( 637.0), 198 }, + { OV( 660.0), 194 }, + { OV( 683.0), 190 }, + { OV( 705.0), 186 }, + { OV( 727.0), 182 }, + { OV( 747.0), 178 }, + { OV( 767.0), 174 }, + { OV( 787.0), 170 }, + { OV( 805.0), 166 }, + { OV( 822.0), 162 }, + { OV( 839.0), 158 }, + { OV( 854.0), 154 }, + { OV( 870.0), 150 }, + { OV( 883.0), 146 }, + { OV( 898.0), 142 }, + { OV( 909.0), 138 }, + { OV( 919.0), 134 }, + { OV( 931.0), 130 }, + { OV( 940.0), 126 }, + { OV( 949.0), 122 }, + { OV( 957.0), 118 }, + { OV( 964.0), 114 }, + { OV( 971.0), 110 }, + { OV( 977.0), 106 }, + { OV( 982.0), 102 }, + { OV( 997.0), 93 }, + { OV(1002.2), 86 }, { OV(1006.6), 80 }, { OV(1015.8), 60 }, - { OV(1021.3), 30 }, - { OV( 1022), 25 }, - { OV( 1023), 20 } + { OV(1019.8), 36 }, + { OV(1020.9), 23 }, + { OV(1022.0), -1 } }; From 2dcc3ddeedcbebf1bbd1b1cfc4bd8be17f14d020 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 25 Jan 2022 15:33:03 -0600 Subject: [PATCH 064/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20HAS?= =?UTF-8?q?=5FMARLINUI=5FMENU,=20HAS=5FMANUAL=5FMOVE=5FMENU?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 8 +-- Marlin/src/MarlinCore.cpp | 4 +- Marlin/src/feature/bedlevel/ubl/ubl.h | 2 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 24 +++---- Marlin/src/feature/password/password.cpp | 4 +- Marlin/src/feature/password/password.h | 2 +- Marlin/src/feature/pause.cpp | 6 +- Marlin/src/feature/power_monitor.cpp | 2 +- Marlin/src/feature/spindle_laser.h | 4 +- Marlin/src/feature/tmc_util.cpp | 2 +- Marlin/src/feature/tmc_util.h | 20 +++--- Marlin/src/gcode/bedlevel/G26.cpp | 22 +++---- Marlin/src/gcode/control/M80_M81.cpp | 2 +- Marlin/src/gcode/feature/pause/M125.cpp | 2 +- Marlin/src/gcode/feature/powerloss/M1000.cpp | 6 +- Marlin/src/gcode/lcd/M0_M1.cpp | 6 +- Marlin/src/gcode/parser.h | 4 +- Marlin/src/gcode/queue.cpp | 2 +- Marlin/src/gcode/sd/M1001.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 6 +- Marlin/src/inc/Conditionals_post.h | 8 +-- Marlin/src/inc/SanityCheck.h | 16 ++--- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 8 +-- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 4 +- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 4 +- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 4 +- Marlin/src/lcd/extui/mks_ui/wifi_module.cpp | 2 +- Marlin/src/lcd/extui/ui_api.h | 2 +- Marlin/src/lcd/marlinui.cpp | 64 +++++++++---------- Marlin/src/lcd/marlinui.h | 30 ++++----- Marlin/src/lcd/menu/menu.cpp | 6 +- Marlin/src/lcd/menu/menu_advanced.cpp | 4 +- Marlin/src/lcd/menu/menu_backlash.cpp | 4 +- Marlin/src/lcd/menu/menu_bed_corners.cpp | 4 +- Marlin/src/lcd/menu/menu_cancelobject.cpp | 4 +- Marlin/src/lcd/menu/menu_configuration.cpp | 4 +- Marlin/src/lcd/menu/menu_delta_calibrate.cpp | 4 +- Marlin/src/lcd/menu/menu_filament.cpp | 4 +- Marlin/src/lcd/menu/menu_info.cpp | 4 +- Marlin/src/lcd/menu/menu_job_recovery.cpp | 4 +- Marlin/src/lcd/menu/menu_led.cpp | 4 +- Marlin/src/lcd/menu/menu_main.cpp | 4 +- Marlin/src/lcd/menu/menu_media.cpp | 4 +- Marlin/src/lcd/menu/menu_mixer.cpp | 4 +- Marlin/src/lcd/menu/menu_mmu2.cpp | 4 +- Marlin/src/lcd/menu/menu_motion.cpp | 4 +- Marlin/src/lcd/menu/menu_password.cpp | 4 +- Marlin/src/lcd/menu/menu_power_monitor.cpp | 4 +- Marlin/src/lcd/menu/menu_spindle_laser.cpp | 4 +- Marlin/src/lcd/menu/menu_temperature.cpp | 4 +- Marlin/src/lcd/menu/menu_tmc.cpp | 2 +- Marlin/src/lcd/menu/menu_touch_screen.cpp | 2 +- Marlin/src/lcd/menu/menu_tramming.cpp | 4 +- Marlin/src/lcd/menu/menu_tune.cpp | 4 +- Marlin/src/lcd/menu/menu_ubl.cpp | 4 +- Marlin/src/lcd/tft/ui_1024x600.cpp | 4 +- Marlin/src/lcd/tft/ui_320x240.cpp | 4 +- Marlin/src/lcd/tft/ui_480x320.cpp | 4 +- Marlin/src/module/temperature.cpp | 4 +- Marlin/src/module/temperature.h | 4 +- Marlin/src/module/tool_change.cpp | 4 +- .../PlatformIO/scripts/common-dependencies.h | 2 +- ini/features.ini | 2 +- 63 files changed, 201 insertions(+), 197 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index ba396431c93b..9091a6bdd059 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1257,7 +1257,7 @@ // @section lcd -#if ANY(HAS_LCD_MENU, EXTENSIBLE_UI, HAS_DWIN_E3V2) +#if HAS_MANUAL_MOVE_MENU #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel #define FINE_MANUAL_MOVE 0.025 // (mm) Smallest manual move (< 0.1mm) applying to Z on most machines #if IS_ULTIPANEL @@ -1280,7 +1280,7 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif -#if HAS_BED_PROBE && EITHER(HAS_LCD_MENU, HAS_TFT_LVGL_UI) +#if HAS_BED_PROBE && EITHER(HAS_MARLINUI_MENU, HAS_TFT_LVGL_UI) //#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu #if ENABLED(PROBE_OFFSET_WIZARD) /** @@ -1295,7 +1295,7 @@ #endif #endif -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU // Add Probe Z Offset calibration to the Z Probe Offsets menu #if BOTH(HAS_BED_PROBE, AUTO_BED_LEVELING_BILINEAR) @@ -1351,7 +1351,7 @@ // Insert a menu for preheating at the top level to allow for quick access //#define PREHEAT_SHORTCUT_MENU_ITEM -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU #if ANY(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI) //#define SOUND_MENU_ITEM // Add a mute option to the LCD menu diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index d0065655f185..e34c0d6c3c10 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -506,7 +506,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { next_cub_ms_##N = ms + CUB_DEBOUNCE_DELAY_##N; \ CODE; \ queue.inject(F(BUTTON##N##_GCODE)); \ - TERN_(HAS_LCD_MENU, ui.quick_feedback()); \ + TERN_(HAS_MARLINUI_MENU, ui.quick_feedback()); \ } \ } \ }while(0) @@ -1611,7 +1611,7 @@ void setup() { SETUP_RUN(password.lock_machine()); // Will not proceed until correct password provided #endif - #if BOTH(HAS_LCD_MENU, TOUCH_SCREEN_CALIBRATION) && EITHER(TFT_CLASSIC_UI, TFT_COLOR_UI) + #if BOTH(HAS_MARLINUI_MENU, TOUCH_SCREEN_CALIBRATION) && EITHER(TFT_CLASSIC_UI, TFT_COLOR_UI) SETUP_RUN(ui.check_touch_calibration()); #endif diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 73581504b787..f117c1af65d3 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -120,7 +120,7 @@ class unified_bed_leveling { static const float _mesh_index_to_xpos[GRID_MAX_POINTS_X], _mesh_index_to_ypos[GRID_MAX_POINTS_Y]; - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU static bool lcd_map_control; static void steppers_were_disabled(); #else diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index df83923fef0a..15395bcc8d58 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -57,7 +57,7 @@ #define UBL_G29_P31 -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU bool unified_bed_leveling::lcd_map_control = false; @@ -443,7 +443,7 @@ void unified_bed_leveling::G29() { #endif // HAS_BED_PROBE case 2: { - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU // // Manually Probe Mesh in areas that can't be reached by the probe // @@ -555,7 +555,7 @@ void unified_bed_leveling::G29() { } case 4: // Fine Tune (i.e., Edit) the Mesh - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU fine_tune_mesh(param.XY_pos, parser.seen_test('T')); #else SERIAL_ECHOLNPGM("?P4 is only available when an LCD is present."); @@ -646,7 +646,7 @@ void unified_bed_leveling::G29() { LEAVE: - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU ui.reset_alert_level(); ui.quick_feedback(); ui.reset_status(); @@ -725,7 +725,7 @@ void unified_bed_leveling::shift_mesh_height() { void unified_bed_leveling::probe_entire_mesh(const xy_pos_t &nearby, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) { probe.deploy(); // Deploy before ui.capture() to allow for PAUSE_BEFORE_DEPLOY_STOW - TERN_(HAS_LCD_MENU, ui.capture()); + TERN_(HAS_MARLINUI_MENU, ui.capture()); save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained uint8_t count = GRID_MAX_POINTS; @@ -739,7 +739,7 @@ void unified_bed_leveling::shift_mesh_height() { SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, "."); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS))); - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU if (ui.button_pressed()) { ui.quick_feedback(false); // Preserve button state for click-and-hold SERIAL_ECHOLNPGM("\nMesh only partially populated.\n"); @@ -774,9 +774,9 @@ void unified_bed_leveling::shift_mesh_height() { TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::G29_FINISH)); // Release UI during stow to allow for PAUSE_BEFORE_DEPLOY_STOW - TERN_(HAS_LCD_MENU, ui.release()); + TERN_(HAS_MARLINUI_MENU, ui.release()); probe.stow(); - TERN_(HAS_LCD_MENU, ui.capture()); + TERN_(HAS_MARLINUI_MENU, ui.capture()); probe.move_z_after_probing(); @@ -791,7 +791,7 @@ void unified_bed_leveling::shift_mesh_height() { #endif // HAS_BED_PROBE void set_message_with_feedback(FSTR_P const fstr) { - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU ui.set_status(fstr); ui.quick_feedback(); #else @@ -799,7 +799,7 @@ void set_message_with_feedback(FSTR_P const fstr) { #endif } -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU typedef void (*clickFunc_t)(); @@ -1070,7 +1070,7 @@ void set_message_with_feedback(FSTR_P const fstr) { ui.return_to_status(); } -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU /** * Parse and validate most G29 parameters, store for use by G29 functions. @@ -1210,7 +1210,7 @@ void unified_bed_leveling::save_ubl_active_state_and_disable() { } void unified_bed_leveling::restore_ubl_active_state_and_leave() { - TERN_(HAS_LCD_MENU, ui.release()); + TERN_(HAS_MARLINUI_MENU, ui.release()); #if ENABLED(UBL_DEVEL_DEBUGGING) if (--ubl_state_recursion_chk) { SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); diff --git a/Marlin/src/feature/password/password.cpp b/Marlin/src/feature/password/password.cpp index 4e841c243cf0..1d376cc586cd 100644 --- a/Marlin/src/feature/password/password.cpp +++ b/Marlin/src/feature/password/password.cpp @@ -40,7 +40,7 @@ uint32_t Password::value, Password::value_entry; // void Password::lock_machine() { is_locked = true; - TERN_(HAS_LCD_MENU, authenticate_user(ui.status_screen, screen_password_entry)); + TERN_(HAS_MARLINUI_MENU, authenticate_user(ui.status_screen, screen_password_entry)); } // @@ -55,7 +55,7 @@ void Password::authentication_check() { is_locked = true; SERIAL_ECHOLNPGM(STR_WRONG_PASSWORD); } - TERN_(HAS_LCD_MENU, authentication_done()); + TERN_(HAS_MARLINUI_MENU, authentication_done()); } #endif // PASSWORD_FEATURE diff --git a/Marlin/src/feature/password/password.h b/Marlin/src/feature/password/password.h index 829d222e20b9..208765b21225 100644 --- a/Marlin/src/feature/password/password.h +++ b/Marlin/src/feature/password/password.h @@ -33,7 +33,7 @@ class Password { static void lock_machine(); static void authentication_check(); - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU static void access_menu_password(); static void authentication_done(); static void media_gatekeeper(); diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 191c0e4b08ef..08f540f2eeda 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -97,7 +97,7 @@ fil_change_settings_t fc_settings[EXTRUDERS]; #if HAS_BUZZER static void impatient_beep(const int8_t max_beep_count, const bool restart=false) { - if (TERN0(HAS_LCD_MENU, pause_mode == PAUSE_MODE_PAUSE_PRINT)) return; + if (TERN0(HAS_MARLINUI_MENU, pause_mode == PAUSE_MODE_PAUSE_PRINT)) return; static millis_t next_buzz = 0; static int8_t runout_beep = 0; @@ -277,7 +277,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load // Show "Purge More" / "Resume" menu and wait for reply KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = false; - #if EITHER(HAS_LCD_MENU, DWIN_CREALITY_LCD_ENHANCED) + #if EITHER(HAS_MARLINUI_MENU, DWIN_CREALITY_LCD_ENHANCED) ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR #else pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; @@ -691,7 +691,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_ TERN_(HAS_FILAMENT_SENSOR, runout.reset()); TERN_(HAS_STATUS_MESSAGE, ui.reset_status()); - TERN_(HAS_LCD_MENU, ui.return_to_status()); + TERN_(HAS_MARLINUI_MENU, ui.return_to_status()); TERN_(DWIN_CREALITY_LCD_ENHANCED, HMI_ReturnScreen()); } diff --git a/Marlin/src/feature/power_monitor.cpp b/Marlin/src/feature/power_monitor.cpp index 1937a54102a8..504f1ea48e3b 100644 --- a/Marlin/src/feature/power_monitor.cpp +++ b/Marlin/src/feature/power_monitor.cpp @@ -26,7 +26,7 @@ #include "power_monitor.h" -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "../lcd/marlinui.h" #include "../lcd/lcdprint.h" #endif diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 7a8cd2c83004..89e11fca0851 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -242,7 +242,7 @@ class SpindleLaser { } #endif - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU static void enable_with_dir(const bool reverse) { isReady = true; const uint8_t ocr = TERN(SPINDLE_LASER_USE_PWM, upower_to_ocr(menuPower), 255); @@ -279,7 +279,7 @@ class SpindleLaser { } #endif - #endif // HAS_LCD_MENU + #endif // HAS_MARLINUI_MENU #if ENABLED(LASER_POWER_INLINE) /** diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index 934c0b726443..cf3fa3b7b0b7 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -40,7 +40,7 @@ #endif #endif -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "../module/stepper.h" #endif diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index 44cde9c7633a..892d33768b6f 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -128,7 +128,7 @@ class TMCMarlin : public TMC, public TMCStorage { } void set_pwm_thrs(const uint32_t thrs) { TMC::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID])); - TERN_(HAS_LCD_MENU, this->stored.hybrid_thrs = thrs); + TERN_(HAS_MARLINUI_MENU, this->stored.hybrid_thrs = thrs); } #endif @@ -137,14 +137,14 @@ class TMCMarlin : public TMC, public TMCStorage { void homing_threshold(int16_t sgt_val) { sgt_val = (int16_t)constrain(sgt_val, sgt_min, sgt_max); TMC::sgt(sgt_val); - TERN_(HAS_LCD_MENU, this->stored.homing_thrs = sgt_val); + TERN_(HAS_MARLINUI_MENU, this->stored.homing_thrs = sgt_val); } #if ENABLED(SPI_ENDSTOPS) bool test_stall_status(); #endif #endif - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU void refresh_stepper_current() { rms_current(this->val_mA); } #if ENABLED(HYBRID_THRESHOLD) @@ -203,11 +203,11 @@ class TMCMarlin : public TMC220 } void set_pwm_thrs(const uint32_t thrs) { TMC2208Stepper::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID])); - TERN_(HAS_LCD_MENU, this->stored.hybrid_thrs = thrs); + TERN_(HAS_MARLINUI_MENU, this->stored.hybrid_thrs = thrs); } #endif - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU void refresh_stepper_current() { rms_current(this->val_mA); } #if ENABLED(HYBRID_THRESHOLD) @@ -257,7 +257,7 @@ class TMCMarlin : public TMC220 } void set_pwm_thrs(const uint32_t thrs) { TMC2209Stepper::TPWMTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID])); - TERN_(HAS_LCD_MENU, this->stored.hybrid_thrs = thrs); + TERN_(HAS_MARLINUI_MENU, this->stored.hybrid_thrs = thrs); } #endif #if USE_SENSORLESS @@ -265,11 +265,11 @@ class TMCMarlin : public TMC220 void homing_threshold(int16_t sgt_val) { sgt_val = (int16_t)constrain(sgt_val, sgt_min, sgt_max); TMC2209Stepper::SGTHRS(sgt_val); - TERN_(HAS_LCD_MENU, this->stored.homing_thrs = sgt_val); + TERN_(HAS_MARLINUI_MENU, this->stored.homing_thrs = sgt_val); } #endif - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU void refresh_stepper_current() { rms_current(this->val_mA); } #if ENABLED(HYBRID_THRESHOLD) @@ -311,11 +311,11 @@ class TMCMarlin : public TMC266 void homing_threshold(int16_t sgt_val) { sgt_val = (int16_t)constrain(sgt_val, sgt_min, sgt_max); TMC2660Stepper::sgt(sgt_val); - TERN_(HAS_LCD_MENU, this->stored.homing_thrs = sgt_val); + TERN_(HAS_MARLINUI_MENU, this->stored.homing_thrs = sgt_val); } #endif - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU void refresh_stepper_current() { rms_current(this->val_mA); } #if USE_SENSORLESS diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 941861f04472..6691d6c9ab55 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -156,7 +156,7 @@ constexpr float g26_e_axis_feedrate = 0.025; static MeshFlags circle_flags; float g26_random_deviation = 0.0; -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU /** * If the LCD is clicked, cancel, wait for release, return true @@ -164,7 +164,7 @@ float g26_random_deviation = 0.0; bool user_canceled() { if (!ui.button_pressed()) return false; // Return if the button isn't pressed ui.set_status(GET_TEXT_F(MSG_G26_CANCELED), 99); - TERN_(HAS_LCD_MENU, ui.quick_feedback()); + TERN_(HAS_MARLINUI_MENU, ui.quick_feedback()); ui.wait_for_release(); return true; } @@ -325,7 +325,7 @@ typedef struct { #if HAS_WIRED_LCD ui.set_status(GET_TEXT_F(MSG_G26_HEATING_BED), 99); ui.quick_feedback(); - TERN_(HAS_LCD_MENU, ui.capture()); + TERN_(HAS_MARLINUI_MENU, ui.capture()); #endif thermalManager.setTargetBed(bed_temp); @@ -365,7 +365,7 @@ typedef struct { bool prime_nozzle() { const feedRate_t fr_slow_e = planner.settings.max_feedrate_mm_s[E_AXIS] / 15.0f; - #if HAS_LCD_MENU && !HAS_TOUCH_BUTTONS // ui.button_pressed issue with touchscreen + #if HAS_MARLINUI_MENU && !HAS_TOUCH_BUTTONS // ui.button_pressed issue with touchscreen #if ENABLED(PREVENT_LENGTHY_EXTRUDE) float Total_Prime = 0.0; #endif @@ -579,7 +579,7 @@ void GcodeSuite::G26() { if (parser.seen('P')) { if (!parser.has_value()) { - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU g26.prime_flag = -1; #else SERIAL_ECHOLNPGM("?Prime length must be specified when not using an LCD."); @@ -638,7 +638,7 @@ void GcodeSuite::G26() { // Get repeat from 'R', otherwise do one full circuit int16_t g26_repeats; - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1); #else if (parser.seen('R')) @@ -699,7 +699,7 @@ void GcodeSuite::G26() { move_to(destination, 0.0); move_to(destination, g26.ooze_amount); - TERN_(HAS_LCD_MENU, ui.capture()); + TERN_(HAS_MARLINUI_MENU, ui.capture()); #if DISABLED(ARC_SUPPORT) @@ -795,7 +795,7 @@ void GcodeSuite::G26() { destination = current_position; } - if (TERN0(HAS_LCD_MENU, user_canceled())) goto LEAVE; // Check if the user wants to stop the Mesh Validation + if (TERN0(HAS_MARLINUI_MENU, user_canceled())) goto LEAVE; // Check if the user wants to stop the Mesh Validation #else // !ARC_SUPPORT @@ -819,7 +819,7 @@ void GcodeSuite::G26() { for (int8_t ind = start_ind; ind <= end_ind; ind++) { - if (TERN0(HAS_LCD_MENU, user_canceled())) goto LEAVE; // Check if the user wants to stop the Mesh Validation + if (TERN0(HAS_MARLINUI_MENU, user_canceled())) goto LEAVE; // Check if the user wants to stop the Mesh Validation xyz_float_t p = { circle.x + _COS(ind ), circle.y + _SIN(ind ), g26.layer_height }, q = { circle.x + _COS(ind + 1), circle.y + _SIN(ind + 1), g26.layer_height }; @@ -846,7 +846,7 @@ void GcodeSuite::G26() { g26.connect_neighbor_with_line(location.pos, 0, 1); planner.synchronize(); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(location.pos, ExtUI::G26_POINT_FINISH)); - if (TERN0(HAS_LCD_MENU, user_canceled())) goto LEAVE; + if (TERN0(HAS_MARLINUI_MENU, user_canceled())) goto LEAVE; } SERIAL_FLUSH(); // Prevent host M105 buffer overrun. @@ -866,7 +866,7 @@ void GcodeSuite::G26() { planner.calculate_volumetric_multipliers(); #endif - TERN_(HAS_LCD_MENU, ui.release()); // Give back control of the LCD + TERN_(HAS_MARLINUI_MENU, ui.release()); // Give back control of the LCD if (!g26.keep_heaters_on) { TERN_(HAS_HEATED_BED, thermalManager.setTargetBed(0)); diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index 6a3788c4a919..90b25e7ed34d 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -63,7 +63,7 @@ OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_STATE); #endif - TERN_(HAS_LCD_MENU, ui.reset_status()); + TERN_(HAS_MARLINUI_MENU, ui.reset_status()); } #endif // PSU_CONTROL diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index 46ec6c552cc0..940e1b369bc6 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -85,7 +85,7 @@ void GcodeSuite::M125() { ui.pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT); // If possible, show an LCD prompt with the 'P' flag - const bool show_lcd = TERN0(HAS_LCD_MENU, parser.boolval('P')); + const bool show_lcd = TERN0(HAS_MARLINUI_MENU, parser.boolval('P')); if (pause_print(retract, park_point, show_lcd, 0)) { if (ENABLED(EXTENSIBLE_UI) || BOTH(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT) || !sd_printing || show_lcd) { diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index c086ca842c1d..b7fa45e2d063 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -54,7 +54,7 @@ inline void plr_error(FSTR_P const prefix) { #endif } -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU void lcd_power_loss_recovery_cancel(); #endif @@ -67,7 +67,7 @@ void GcodeSuite::M1000() { if (recovery.valid()) { if (parser.seen_test('S')) { - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU ui.goto_screen(menu_job_recovery); #elif HAS_DWIN_E3V2_BASIC recovery.dwin_flag = true; @@ -80,7 +80,7 @@ void GcodeSuite::M1000() { #endif } else if (parser.seen_test('C')) { - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU lcd_power_loss_recovery_cancel(); #else recovery.cancel(); diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index 6a93861407f1..2bf3c94f1cc2 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -31,7 +31,7 @@ #include "../../module/planner.h" // for synchronize() #include "../../MarlinCore.h" // for wait_for_user_response() -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "../../lcd/marlinui.h" #elif ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" @@ -55,7 +55,7 @@ void GcodeSuite::M0_M1() { planner.synchronize(); - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU if (parser.string_arg) ui.set_status(parser.string_arg, true); @@ -89,7 +89,7 @@ void GcodeSuite::M0_M1() { TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms)); - TERN_(HAS_LCD_MENU, ui.reset_status()); + TERN_(HAS_MARLINUI_MENU, ui.reset_status()); } #endif // HAS_RESUME_CONTINUE diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index bd0846729883..1487c083ec60 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -355,7 +355,7 @@ class GCodeParser { return input_temp_units == TEMPUNIT_K ? F("Kelvin") : input_temp_units == TEMPUNIT_F ? F("Fahrenheit") : F("Celsius"); } - #if HAS_LCD_MENU && DISABLED(DISABLE_M503) + #if HAS_MARLINUI_MENU && DISABLED(DISABLE_M503) static float to_temp_units(celsius_t c) { switch (input_temp_units) { @@ -366,7 +366,7 @@ class GCodeParser { } } - #endif // HAS_LCD_MENU && !DISABLE_M503 + #endif // HAS_MARLINUI_MENU && !DISABLE_M503 static celsius_t value_celsius() { float f = value_float(); diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index cc52a3bb9e80..2250cd3b7452 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -522,7 +522,7 @@ void GCodeQueue::get_serial_commands() { #if DISABLED(EMERGENCY_PARSER) // Process critical commands early if (command[0] == 'M') switch (command[3]) { - case '8': if (command[2] == '0' && command[1] == '1') { wait_for_heatup = false; TERN_(HAS_LCD_MENU, wait_for_user = false); } break; + case '8': if (command[2] == '0' && command[1] == '1') { wait_for_heatup = false; TERN_(HAS_MARLINUI_MENU, wait_for_user = false); } break; case '2': if (command[2] == '1' && command[1] == '1') kill(FPSTR(M112_KILL_STR), nullptr, true); break; case '0': if (command[1] == '4' && command[2] == '1') quickstop_stepper(); break; } diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 417f3747c17f..ad549946f06c 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -98,7 +98,7 @@ void GcodeSuite::M1001() { printerEventLEDs.onPrintCompleted(); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_PRINT_DONE))); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_PRINT_DONE), FPSTR(CONTINUE_STR))); - TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(SEC_TO_MS(TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30)))); + TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(SEC_TO_MS(TERN(HAS_MARLINUI_MENU, PE_LEDS_COMPLETED_TIME, 30)))); printerEventLEDs.onResumeAfterWait(); } #endif diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 1200d18dd036..825898f88244 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -542,7 +542,11 @@ #endif #if IS_ULTIPANEL && DISABLED(NO_LCD_MENUS) - #define HAS_LCD_MENU 1 + #define HAS_MARLINUI_MENU 1 +#endif + +#if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, HAS_DWIN_E3V2) + #define HAS_MANUAL_MOVE_MENU 1 #endif #if ANY(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI, HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL, IS_DWIN_MARLINUI, DWIN_CREALITY_LCD_JYERSUI) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 2f06fe255a0a..37f0a5cbe5d6 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -437,7 +437,7 @@ // Set SD_DETECT_STATE based on hardware if not overridden #if PIN_EXISTS(SD_DETECT) && !defined(SD_DETECT_STATE) - #if BOTH(HAS_LCD_MENU, ELB_FULL_GRAPHIC_CONTROLLER) && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)) + #if BOTH(HAS_MARLINUI_MENU, ELB_FULL_GRAPHIC_CONTROLLER) && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)) #define SD_DETECT_STATE HIGH #else #define SD_DETECT_STATE LOW @@ -3052,7 +3052,7 @@ #define HAS_TEMPERATURE 1 #endif -#if HAS_TEMPERATURE && EITHER(HAS_LCD_MENU, HAS_DWIN_E3V2) +#if HAS_TEMPERATURE && EITHER(HAS_MARLINUI_MENU, HAS_DWIN_E3V2) #ifdef PREHEAT_6_LABEL #define PREHEAT_COUNT 6 #elif defined(PREHEAT_5_LABEL) @@ -3177,7 +3177,7 @@ * Advanced Pause - Filament Change */ #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if ANY(HAS_LCD_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI) || BOTH(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT) + #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI) || BOTH(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT) #define M600_PURGE_MORE_RESUMABLE 1 #endif #ifndef FILAMENT_CHANGE_SLOW_LOAD_LENGTH @@ -3407,7 +3407,7 @@ #endif #endif -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU // LCD timeout to status screen default is 15s #ifndef LCD_TIMEOUT_TO_STATUS #define LCD_TIMEOUT_TO_STATUS 15000 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index a9744a09c02a..7b14ef495b3b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -851,7 +851,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "USE_M73_REMAINING_TIME requires LCD_SET_PROGRESS_MANUALLY" #endif -#if !HAS_LCD_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE) +#if !HAS_MARLINUI_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE) #error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu." #endif @@ -874,7 +874,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * SD Card Settings */ -#if ALL(SDSUPPORT, ELB_FULL_GRAPHIC_CONTROLLER, HAS_LCD_MENU) && PIN_EXISTS(SD_DETECT) && SD_DETECT_STATE != HIGH && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)) +#if ALL(SDSUPPORT, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && PIN_EXISTS(SD_DETECT) && SD_DETECT_STATE != HIGH && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)) #error "SD_DETECT_STATE must be set HIGH for SD on the ELB_FULL_GRAPHIC_CONTROLLER." #endif @@ -1081,9 +1081,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "PRUSA_MMU2S requires FILAMENT_RUNOUT_SENSOR. Enable it to continue." #elif ENABLED(MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR) #error "MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue." - #elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_LCD_MENU + #elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_MARLINUI_MENU #error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI." - #elif ENABLED(MMU2_MENUS) && !HAS_LCD_MENU + #elif ENABLED(MMU2_MENUS) && !HAS_MARLINUI_MENU #error "MMU2_MENUS requires an LCD supporting MarlinUI." #elif DISABLED(ADVANCED_PAUSE_FEATURE) static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / HAS_EXTENDABLE_MMU(S)."); @@ -1479,9 +1479,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "You probably want to use Max Endstops for DELTA!" #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." - #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_LCD_MENU) + #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_MARLINUI_MENU) #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller." - #elif ENABLED(DELTA_CALIBRATION_MENU) && !HAS_LCD_MENU + #elif ENABLED(DELTA_CALIBRATION_MENU) && !HAS_MARLINUI_MENU #error "DELTA_CALIBRATION_MENU requires an LCD Controller." #elif ABL_USES_GRID #if ((GRID_MAX_POINTS_X) & 1) == 0 || ((GRID_MAX_POINTS_Y) & 1) == 0 @@ -1820,7 +1820,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * LCD_BED_LEVELING requirements */ #if ENABLED(LCD_BED_LEVELING) - #if NONE(HAS_LCD_MENU, DWIN_CREALITY_LCD, DWIN_CREALITY_LCD_ENHANCED) + #if NONE(HAS_MARLINUI_MENU, DWIN_CREALITY_LCD, DWIN_CREALITY_LCD_ENHANCED) #error "LCD_BED_LEVELING is not supported by the selected LCD controller." #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL) #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING." @@ -3743,7 +3743,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); * Sanity Check for Password Feature */ #if ENABLED(PASSWORD_FEATURE) - #if NONE(HAS_LCD_MENU, PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE) + #if NONE(HAS_MARLINUI_MENU, PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE) #error "Without PASSWORD_UNLOCK_GCODE, PASSWORD_CHANGE_GCODE, or a supported LCD there's no way to unlock the printer or set a password." #elif DISABLED(EEPROM_SETTINGS) #warning "PASSWORD_FEATURE settings will be lost on power-off without EEPROM_SETTINGS." diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index b450c9c10f5a..26344da41219 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -284,7 +284,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS #endif // LCD_PROGRESS_BAR - #if BOTH(SDSUPPORT, HAS_LCD_MENU) + #if BOTH(SDSUPPORT, HAS_MARLINUI_MENU) // CHARSET_MENU const static PROGMEM byte refresh[8] = { @@ -334,7 +334,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS #endif { createChar_P(LCD_STR_UPLEVEL[0], uplevel); - #if BOTH(SDSUPPORT, HAS_LCD_MENU) + #if BOTH(SDSUPPORT, HAS_MARLINUI_MENU) // SD Card sub-menu special characters createChar_P(LCD_STR_REFRESH[0], refresh); createChar_P(LCD_STR_FOLDER[0], folder); @@ -1051,7 +1051,7 @@ void MarlinUI::draw_status_screen() { draw_status_message(blink); } -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "../menu/menu.h" @@ -1584,6 +1584,6 @@ void MarlinUI::draw_status_screen() { #endif // AUTO_BED_LEVELING_UBL -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU #endif // HAS_MARLINUI_HD44780 diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 420bd7cd66ae..dc7910176222 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -922,7 +922,7 @@ void MarlinUI::draw_status_screen() { lcd.print_screen(); } -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "../menu/menu.h" @@ -1084,6 +1084,6 @@ void MarlinUI::draw_status_screen() { #endif // AUTO_BED_LEVELING_UBL -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU #endif // IS_TFTGLCD_PANEL diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 82c9b9a34041..a1540e754f18 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -353,7 +353,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #endif -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "../menu/menu.h" @@ -744,6 +744,6 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU #endif // HAS_MARLINUI_U8GLIB diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index dbf2f7717c84..8b0a700828a0 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -253,7 +253,7 @@ void MarlinUI::draw_status_message(const bool blink) { void MarlinUI::_set_brightness() { DWIN_LCD_Brightness(backlight ? brightness : 0); } #endif -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "../../menu/menu.h" @@ -581,6 +581,6 @@ void MarlinUI::draw_status_message(const bool blink) { #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU #endif // IS_DWIN_MARLINUI diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp index cc8458ce43ef..df90321c895d 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp @@ -2028,7 +2028,7 @@ void get_wifi_commands() { // Process critical commands early if (strcmp_P(command, PSTR("M108")) == 0) { wait_for_heatup = false; - TERN_(HAS_LCD_MENU, wait_for_user = false); + TERN_(HAS_MARLINUI_MENU, wait_for_user = false); } if (strcmp_P(command, PSTR("M112")) == 0) kill(FPSTR(M112_KILL_STR), nullptr, true); if (strcmp_P(command, PSTR("M410")) == 0) quickstop_stepper(); diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 04a298ba582e..59b509981b88 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -196,7 +196,7 @@ namespace ExtUI { #endif inline void simulateUserClick() { - #if ANY(HAS_LCD_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) + #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) ui.lcd_clicked = true; #endif } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 7b9dc468e489..f2fce1c8cdb9 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -155,7 +155,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; } #endif -#if EITHER(HAS_LCD_MENU, EXTENSIBLE_UI) +#if EITHER(HAS_MARLINUI_MENU, EXTENSIBLE_UI) bool MarlinUI::lcd_clicked; #endif @@ -257,7 +257,7 @@ void MarlinUI::init() { #include "../module/planner.h" #include "../module/motion.h" - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU #include "../module/settings.h" #endif @@ -348,7 +348,7 @@ void MarlinUI::init() { #endif - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU #include "menu/menu.h" screenFunc_t MarlinUI::currentScreen; // Initialized in CTOR @@ -450,7 +450,7 @@ void MarlinUI::init() { #endif // !HAS_GRAPHICAL_TFT - #endif // HAS_LCD_MENU + #endif // HAS_MARLINUI_MENU //////////////////////////////////////////// ///////////// Keypad Handling ////////////// @@ -460,7 +460,7 @@ void MarlinUI::init() { volatile uint8_t MarlinUI::keypad_buttons; - #if HAS_LCD_MENU && !HAS_ADC_BUTTONS + #if HAS_MARLINUI_MENU && !HAS_ADC_BUTTONS void lcd_move_x(); void lcd_move_y(); @@ -487,7 +487,7 @@ void MarlinUI::init() { if (keypad_buttons) { #if HAS_ENCODER_ACTION refresh(LCDVIEW_REDRAW_NOW); - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU if (encoderDirection == -(ENCODERBASE)) { // HAS_ADC_BUTTONS forces REVERSE_MENU_DIRECTION, so this indicates menu navigation if (RRK(EN_KEYPAD_UP)) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; else if (RRK(EN_KEYPAD_DOWN)) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; @@ -497,7 +497,7 @@ void MarlinUI::init() { else #endif { - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU if (RRK(EN_KEYPAD_UP)) encoderPosition -= epps; else if (RRK(EN_KEYPAD_DOWN)) encoderPosition += epps; else if (RRK(EN_KEYPAD_LEFT)) { MenuItem_back::action(); quick_feedback(); } @@ -528,7 +528,7 @@ void MarlinUI::init() { const bool homed = all_axes_homed(); - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU if (RRK(EN_KEYPAD_MIDDLE)) goto_screen(menu_move); @@ -547,7 +547,7 @@ void MarlinUI::init() { if (RRK(EN_KEYPAD_UP)) _reprapworld_keypad_move(Y_AXIS, -1); } - #endif // HAS_LCD_MENU + #endif // HAS_MARLINUI_MENU if (!homed && RRK(EN_KEYPAD_F1)) queue.inject_P(G28_STR); return true; @@ -575,7 +575,7 @@ void MarlinUI::init() { void MarlinUI::status_screen() { - TERN_(HAS_LCD_MENU, ENCODER_RATE_MULTIPLY(false)); + TERN_(HAS_MARLINUI_MENU, ENCODER_RATE_MULTIPLY(false)); #if BASIC_PROGRESS_BAR @@ -619,7 +619,7 @@ void MarlinUI::init() { #endif // BASIC_PROGRESS_BAR - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU if (use_click()) { #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) next_filament_display = millis() + 5000UL; // Show status message for 5s @@ -673,7 +673,7 @@ void MarlinUI::init() { void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) { init(); status_printf(1, F(S_FMT ": " S_FMT), FTOP(lcd_error), FTOP(lcd_component)); - TERN_(HAS_LCD_MENU, return_to_status()); + TERN_(HAS_MARLINUI_MENU, return_to_status()); // RED ALERT. RED ALERT. #ifdef LED_BACKLIGHT_TIMEOUT @@ -701,7 +701,7 @@ void MarlinUI::init() { void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); // Wake up the TFT with most buttons - TERN_(HAS_LCD_MENU, refresh()); + TERN_(HAS_MARLINUI_MENU, refresh()); #if HAS_ENCODER_ACTION if (clear_buttons) buttons = 0; @@ -712,9 +712,9 @@ void MarlinUI::init() { #if HAS_CHIRP chirp(); // Buzz and wait. Is the delay needed for buttons to settle? - #if BOTH(HAS_LCD_MENU, USE_BEEPER) + #if BOTH(HAS_MARLINUI_MENU, USE_BEEPER) for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } - #elif HAS_LCD_MENU + #elif HAS_MARLINUI_MENU delay(10); #endif #endif @@ -724,7 +724,7 @@ void MarlinUI::init() { /////////////// Manual Move //////////////// //////////////////////////////////////////// - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU ManualMove MarlinUI::manual_move{}; @@ -836,7 +836,7 @@ void MarlinUI::init() { #endif - #endif // HAS_LCD_MENU + #endif // HAS_MARLINUI_MENU /** * Update the LCD, read encoder buttons, etc. @@ -887,7 +887,7 @@ void MarlinUI::init() { leds.update_timeout(powerManager.psu_on); #endif - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU // Handle any queued Move Axis motion manual_move.task(); @@ -942,7 +942,7 @@ void MarlinUI::init() { goto_previous_screen(); } - #endif // HAS_LCD_MENU + #endif // HAS_MARLINUI_MENU if (ELAPSED(ms, next_lcd_update_ms) || TERN0(HAS_MARLINUI_U8GLIB, drawing_screen)) { @@ -989,7 +989,7 @@ void MarlinUI::init() { if (encoderPastThreshold || lcd_clicked) { if (encoderPastThreshold && TERN1(IS_TFTGLCD_PANEL, !external_control)) { - #if BOTH(HAS_LCD_MENU, ENCODER_RATE_MULTIPLIER) + #if BOTH(HAS_MARLINUI_MENU, ENCODER_RATE_MULTIPLIER) int32_t encoderMultiplier = 1; @@ -1049,7 +1049,7 @@ void MarlinUI::init() { refresh(LCDVIEW_REDRAW_NOW); } - #if BOTH(HAS_LCD_MENU, SCROLL_LONG_FILENAMES) + #if BOTH(HAS_MARLINUI_MENU, SCROLL_LONG_FILENAMES) // If scrolling of long file names is enabled and we are in the sd card menu, // cause a refresh to occur until all the text has scrolled into view. if (currentScreen == menu_media && !lcd_status_update_delay--) { @@ -1120,7 +1120,7 @@ void MarlinUI::init() { #endif - TERN_(HAS_LCD_MENU, lcd_clicked = false); + TERN_(HAS_MARLINUI_MENU, lcd_clicked = false); // Keeping track of the longest time for an individual LCD update. // Used to do screen throttling when the planner starts to fill up. @@ -1334,7 +1334,7 @@ void MarlinUI::init() { case ENCODER_PHASE_2: ENCODER_SPIN(ENCODER_PHASE_1, ENCODER_PHASE_3); break; case ENCODER_PHASE_3: ENCODER_SPIN(ENCODER_PHASE_2, ENCODER_PHASE_0); break; } - #if BOTH(HAS_LCD_MENU, AUTO_BED_LEVELING_UBL) + #if BOTH(HAS_MARLINUI_MENU, AUTO_BED_LEVELING_UBL) external_encoder(); #endif lastEncoderBits = enc; @@ -1460,7 +1460,7 @@ void MarlinUI::init() { void MarlinUI::set_alert_status(FSTR_P const fstr) { set_status(fstr, 1); TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); - TERN_(HAS_LCD_MENU, return_to_status()); + TERN_(HAS_MARLINUI_MENU, return_to_status()); } #include @@ -1545,10 +1545,10 @@ void MarlinUI::init() { IF_DISABLED(SDSUPPORT, print_job_timer.stop()); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("UI Aborted"), FPSTR(DISMISS_STR))); LCD_MESSAGE(MSG_PRINT_ABORTED); - TERN_(HAS_LCD_MENU, return_to_status()); + TERN_(HAS_MARLINUI_MENU, return_to_status()); } - #if BOTH(HAS_LCD_MENU, PSU_CONTROL) + #if BOTH(HAS_MARLINUI_MENU, PSU_CONTROL) void MarlinUI::poweroff() { queue.inject(F("M81" TERN_(POWER_OFF_WAIT_FOR_COOLDOWN, "S"))); @@ -1560,11 +1560,11 @@ void MarlinUI::init() { void MarlinUI::flow_fault() { LCD_ALERTMESSAGE(MSG_FLOWMETER_FAULT); TERN_(HAS_BUZZER, buzz(1000, 440)); - TERN_(HAS_LCD_MENU, return_to_status()); + TERN_(HAS_MARLINUI_MENU, return_to_status()); } void MarlinUI::pause_print() { - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU synchronize(GET_TEXT(MSG_PAUSING)); defer_status_screen(); #endif @@ -1686,7 +1686,7 @@ void MarlinUI::init() { ExtUI::onMediaRemoved(); #elif PIN_EXISTS(SD_DETECT) LCD_MESSAGE(MSG_MEDIA_REMOVED); - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU if (!defer_return_to_status) return_to_status(); #endif #endif @@ -1712,7 +1712,7 @@ void MarlinUI::init() { #endif // SDSUPPORT -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU void MarlinUI::reset_settings() { settings.reset(); completion_feedback(); @@ -1768,7 +1768,7 @@ void MarlinUI::init() { #if ENABLED(EEPROM_SETTINGS) - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU void MarlinUI::init_eeprom() { const bool good = settings.init_eeprom(); completion_feedback(good); @@ -1796,7 +1796,7 @@ void MarlinUI::init() { } void MarlinUI::eeprom_alert(const uint8_t msgid) { - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU editable.uint8 = msgid; goto_screen([]{ PGM_P const restore_msg = GET_TEXT(MSG_INIT_EEPROM); diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 3217d3531b1f..273abbe54a94 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -35,7 +35,7 @@ #include "tft_io/touch_calibration.h" #endif -#if ANY(HAS_LCD_MENU, ULTIPANEL_FEEDMULTIPLY, SOFT_RESET_ON_KILL) +#if ANY(HAS_MARLINUI_MENU, ULTIPANEL_FEEDMULTIPLY, SOFT_RESET_ON_KILL) #define HAS_ENCODER_ACTION 1 #endif @@ -51,7 +51,7 @@ #include "../module/printcounter.h" #endif -#if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_LCD_MENU, EXTENSIBLE_UI, HAS_DWIN_E3V2) +#if ENABLED(ADVANCED_PAUSE_FEATURE) #include "../feature/pause.h" #endif @@ -77,7 +77,7 @@ uint8_t get_ADC_keyValue(); #endif - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU #include "lcdprint.h" @@ -90,7 +90,7 @@ typedef void (*screenFunc_t)(); typedef void (*menuAction_t)(); - #endif // HAS_LCD_MENU + #endif // HAS_MARLINUI_MENU #endif // HAS_WIRED_LCD @@ -126,7 +126,7 @@ } preheat_t; #endif -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU // Manual Movement class class ManualMove { @@ -198,7 +198,7 @@ class MarlinUI { public: MarlinUI() { - TERN_(HAS_LCD_MENU, currentScreen = status_screen); + TERN_(HAS_MARLINUI_MENU, currentScreen = status_screen); } static void init(); @@ -245,7 +245,7 @@ class MarlinUI { // LCD implementations static void clear_lcd(); - #if BOTH(HAS_LCD_MENU, TOUCH_SCREEN_CALIBRATION) + #if BOTH(HAS_MARLINUI_MENU, TOUCH_SCREEN_CALIBRATION) static void check_touch_calibration() { if (touch_calibration.need_calibration()) currentScreen = touch_calibration_screen; } @@ -375,7 +375,7 @@ class MarlinUI { static void resume_print(); static void flow_fault(); - #if BOTH(HAS_LCD_MENU, PSU_CONTROL) + #if BOTH(HAS_MARLINUI_MENU, PSU_CONTROL) static void poweroff(); #endif @@ -488,7 +488,7 @@ class MarlinUI { #endif #if ENABLED(SDSUPPORT) - #if BOTH(SCROLL_LONG_FILENAMES, HAS_LCD_MENU) + #if BOTH(SCROLL_LONG_FILENAMES, HAS_MARLINUI_MENU) #define MARLINUI_SCROLL_NAME 1 #endif #if MARLINUI_SCROLL_NAME @@ -513,7 +513,7 @@ class MarlinUI { TERN(SCREENS_CAN_TIME_OUT, return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS, UNUSED(ms)); } - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU #if HAS_TOUCH_BUTTONS static uint8_t touch_buttons; @@ -597,7 +597,7 @@ class MarlinUI { #endif - #if EITHER(HAS_LCD_MENU, EXTENSIBLE_UI) + #if EITHER(HAS_MARLINUI_MENU, EXTENSIBLE_UI) static bool lcd_clicked; static bool use_click() { const bool click = lcd_clicked; @@ -609,7 +609,7 @@ class MarlinUI { static bool use_click() { return false; } #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_LCD_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI) + #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI) static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); #else static void _pause_show_message() {} @@ -619,12 +619,12 @@ class MarlinUI { // // EEPROM: Reset / Init / Load / Store // - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU static void reset_settings(); #endif #if ENABLED(EEPROM_SETTINGS) - #if HAS_LCD_MENU + #if HAS_MARLINUI_MENU static void init_eeprom(); static void load_settings(); static void store_settings(); @@ -650,7 +650,7 @@ class MarlinUI { // // Block interaction while under external control // - #if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) + #if HAS_MARLINUI_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) static bool external_control; FORCE_INLINE static void capture() { external_control = true; } FORCE_INLINE static void release() { external_control = false; } diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 9337cf4774ff..01b845da6e35 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "menu.h" #include "../../module/planner.h" @@ -220,7 +220,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co screen_changed = true; TERN_(HAS_MARLINUI_U8GLIB, drawing_screen = false); - TERN_(HAS_LCD_MENU, encoder_direction_normal()); + TERN_(HAS_MARLINUI_MENU, encoder_direction_normal()); set_selection(false); } @@ -378,4 +378,4 @@ void MenuItem_confirm::select_screen( } } -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 079d9b80b018..1bc9b9e88ed8 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "menu_item.h" #include "../../module/planner.h" @@ -653,4 +653,4 @@ void menu_advanced_settings() { END_MENU(); } -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU diff --git a/Marlin/src/lcd/menu/menu_backlash.cpp b/Marlin/src/lcd/menu/menu_backlash.cpp index 28be1ca9cfbb..5776234f72dc 100644 --- a/Marlin/src/lcd/menu/menu_backlash.cpp +++ b/Marlin/src/lcd/menu/menu_backlash.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, BACKLASH_GCODE) +#if BOTH(HAS_MARLINUI_MENU, BACKLASH_GCODE) #include "menu_item.h" @@ -68,4 +68,4 @@ void menu_backlash() { END_MENU(); } -#endif // HAS_LCD_MENU && BACKLASH_GCODE +#endif // HAS_MARLINUI_MENU && BACKLASH_GCODE diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 38a074eb0128..7a0f2eaa4918 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, LEVEL_BED_CORNERS) +#if BOTH(HAS_MARLINUI_MENU, LEVEL_BED_CORNERS) #include "menu_item.h" #include "../../module/motion.h" @@ -362,4 +362,4 @@ void _lcd_level_bed_corners() { ui.goto_screen(_lcd_level_bed_corners_homing); } -#endif // HAS_LCD_MENU && LEVEL_BED_CORNERS +#endif // HAS_MARLINUI_MENU && LEVEL_BED_CORNERS diff --git a/Marlin/src/lcd/menu/menu_cancelobject.cpp b/Marlin/src/lcd/menu/menu_cancelobject.cpp index f2a06ecf6a4a..8db698d300f2 100644 --- a/Marlin/src/lcd/menu/menu_cancelobject.cpp +++ b/Marlin/src/lcd/menu/menu_cancelobject.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, CANCEL_OBJECTS) +#if BOTH(HAS_MARLINUI_MENU, CANCEL_OBJECTS) #include "menu_item.h" #include "menu_addon.h" @@ -71,4 +71,4 @@ void menu_cancelobject() { END_MENU(); } -#endif // HAS_LCD_MENU && CANCEL_OBJECTS +#endif // HAS_MARLINUI_MENU && CANCEL_OBJECTS diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 7642c7671068..33e43b08ebda 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "menu_item.h" @@ -577,4 +577,4 @@ void menu_configuration() { END_MENU(); } -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index ea627f69e781..f491c5b576ee 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) +#if HAS_MARLINUI_MENU && EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) #include "menu_item.h" #include "../../module/delta.h" @@ -151,4 +151,4 @@ void menu_delta_calibrate() { END_MENU(); } -#endif // HAS_LCD_MENU && (DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION) +#endif // HAS_MARLINUI_MENU && (DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION) diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index e7365744e9a1..9f432c405c4f 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, ADVANCED_PAUSE_FEATURE) +#if BOTH(HAS_MARLINUI_MENU, ADVANCED_PAUSE_FEATURE) #include "menu_item.h" #include "../../module/temperature.h" @@ -342,4 +342,4 @@ void MarlinUI::pause_show_message( ui.return_to_status(); } -#endif // HAS_LCD_MENU && ADVANCED_PAUSE_FEATURE +#endif // HAS_MARLINUI_MENU && ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index 11027e7f9573..3a23cf004884 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, LCD_INFO_MENU) +#if BOTH(HAS_MARLINUI_MENU, LCD_INFO_MENU) #include "menu_item.h" @@ -317,4 +317,4 @@ void menu_info() { END_MENU(); } -#endif // HAS_LCD_MENU && LCD_INFO_MENU +#endif // HAS_MARLINUI_MENU && LCD_INFO_MENU diff --git a/Marlin/src/lcd/menu/menu_job_recovery.cpp b/Marlin/src/lcd/menu/menu_job_recovery.cpp index 963806b1d6b3..6329c5839786 100644 --- a/Marlin/src/lcd/menu/menu_job_recovery.cpp +++ b/Marlin/src/lcd/menu/menu_job_recovery.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, POWER_LOSS_RECOVERY) +#if BOTH(HAS_MARLINUI_MENU, POWER_LOSS_RECOVERY) #include "menu_item.h" #include "../../gcode/queue.h" @@ -54,4 +54,4 @@ void menu_job_recovery() { END_MENU(); } -#endif // HAS_LCD_MENU && POWER_LOSS_RECOVERY +#endif // HAS_MARLINUI_MENU && POWER_LOSS_RECOVERY diff --git a/Marlin/src/lcd/menu/menu_led.cpp b/Marlin/src/lcd/menu/menu_led.cpp index 3261ecc65874..0c08f6fa944b 100644 --- a/Marlin/src/lcd/menu/menu_led.cpp +++ b/Marlin/src/lcd/menu/menu_led.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && EITHER(LED_CONTROL_MENU, CASE_LIGHT_MENU) +#if HAS_MARLINUI_MENU && EITHER(LED_CONTROL_MENU, CASE_LIGHT_MENU) #include "menu_item.h" @@ -169,4 +169,4 @@ void menu_led() { END_MENU(); } -#endif // HAS_LCD_MENU && LED_CONTROL_MENU +#endif // HAS_MARLINUI_MENU && LED_CONTROL_MENU diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index f7e974a8649b..a15653589523 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "menu_item.h" #include "../../module/temperature.h" @@ -461,4 +461,4 @@ void menu_main() { END_MENU(); } -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index 4ce0a396d4e4..db1baa9bee6f 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, SDSUPPORT) +#if BOTH(HAS_MARLINUI_MENU, SDSUPPORT) #include "menu_item.h" #include "../../sd/cardreader.h" @@ -161,4 +161,4 @@ void menu_media() { TERN(MULTI_VOLUME, menu_media_select, menu_media_filelist)(); } -#endif // HAS_LCD_MENU && SDSUPPORT +#endif // HAS_MARLINUI_MENU && SDSUPPORT diff --git a/Marlin/src/lcd/menu/menu_mixer.cpp b/Marlin/src/lcd/menu/menu_mixer.cpp index be4363574b26..f91f62ef8393 100644 --- a/Marlin/src/lcd/menu/menu_mixer.cpp +++ b/Marlin/src/lcd/menu/menu_mixer.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, MIXING_EXTRUDER) +#if BOTH(HAS_MARLINUI_MENU, MIXING_EXTRUDER) #include "menu_item.h" #include "menu_addon.h" @@ -275,4 +275,4 @@ void menu_mixer() { END_MENU(); } -#endif // HAS_LCD_MENU && MIXING_EXTRUDER +#endif // HAS_MARLINUI_MENU && MIXING_EXTRUDER diff --git a/Marlin/src/lcd/menu/menu_mmu2.cpp b/Marlin/src/lcd/menu/menu_mmu2.cpp index 99e5c0624517..4f3728b74e90 100644 --- a/Marlin/src/lcd/menu/menu_mmu2.cpp +++ b/Marlin/src/lcd/menu/menu_mmu2.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if BOTH(HAS_LCD_MENU, MMU2_MENUS) +#if BOTH(HAS_MARLINUI_MENU, MMU2_MENUS) #include "../../MarlinCore.h" #include "../../feature/mmu/mmu2.h" @@ -167,4 +167,4 @@ uint8_t mmu2_choose_filament() { return feeder_index; } -#endif // HAS_LCD_MENU && MMU2_MENUS +#endif // HAS_MARLINUI_MENU && MMU2_MENUS diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index d46343602165..0a446b1349e3 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #define LARGE_AREA_TEST ((X_BED_SIZE) >= 1000 || (Y_BED_SIZE) >= 1000 || (Z_MAX_POS) >= 1000) @@ -477,4 +477,4 @@ void menu_motion() { END_MENU(); } -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU diff --git a/Marlin/src/lcd/menu/menu_password.cpp b/Marlin/src/lcd/menu/menu_password.cpp index d3a35abff2e0..32059103b3f4 100644 --- a/Marlin/src/lcd/menu/menu_password.cpp +++ b/Marlin/src/lcd/menu/menu_password.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, PASSWORD_FEATURE) +#if BOTH(HAS_MARLINUI_MENU, PASSWORD_FEATURE) #include "../../feature/password/password.h" @@ -184,4 +184,4 @@ void Password::menu_password() { END_MENU(); } -#endif // HAS_LCD_MENU && PASSWORD_FEATURE +#endif // HAS_MARLINUI_MENU && PASSWORD_FEATURE diff --git a/Marlin/src/lcd/menu/menu_power_monitor.cpp b/Marlin/src/lcd/menu/menu_power_monitor.cpp index b43327f63bc2..3cd9909e5cf7 100644 --- a/Marlin/src/lcd/menu/menu_power_monitor.cpp +++ b/Marlin/src/lcd/menu/menu_power_monitor.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && HAS_POWER_MONITOR +#if HAS_MARLINUI_MENU && HAS_POWER_MONITOR #include "menu_item.h" #include "../../feature/power_monitor.h" @@ -59,4 +59,4 @@ void menu_power_monitor() { END_MENU(); } -#endif // HAS_LCD_MENU && HAS_POWER_MONITOR +#endif // HAS_MARLINUI_MENU && HAS_POWER_MONITOR diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp index ca3d6f66a6d4..306d3d6c57df 100644 --- a/Marlin/src/lcd/menu/menu_spindle_laser.cpp +++ b/Marlin/src/lcd/menu/menu_spindle_laser.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfig.h" -#if HAS_LCD_MENU && HAS_CUTTER +#if HAS_MARLINUI_MENU && HAS_CUTTER #include "menu_item.h" @@ -81,4 +81,4 @@ END_MENU(); } -#endif // HAS_LCD_MENU && HAS_CUTTER +#endif // HAS_MARLINUI_MENU && HAS_CUTTER diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 0e3688485804..fb539f006c14 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfig.h" -#if HAS_LCD_MENU && HAS_TEMPERATURE +#if HAS_MARLINUI_MENU && HAS_TEMPERATURE #include "menu_item.h" #include "../../module/temperature.h" @@ -307,4 +307,4 @@ void menu_temperature() { #endif -#endif // HAS_LCD_MENU && HAS_TEMPERATURE +#endif // HAS_MARLINUI_MENU && HAS_TEMPERATURE diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index be6289d851a3..7e206e8d7990 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && HAS_TRINAMIC_CONFIG +#if HAS_MARLINUI_MENU && HAS_TRINAMIC_CONFIG #include "menu_item.h" #include "../../module/stepper/indirection.h" diff --git a/Marlin/src/lcd/menu/menu_touch_screen.cpp b/Marlin/src/lcd/menu/menu_touch_screen.cpp index 5fc4b584d51e..130308dadffa 100644 --- a/Marlin/src/lcd/menu/menu_touch_screen.cpp +++ b/Marlin/src/lcd/menu/menu_touch_screen.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, TOUCH_SCREEN_CALIBRATION) +#if BOTH(HAS_MARLINUI_MENU, TOUCH_SCREEN_CALIBRATION) #include "menu_item.h" #include "../marlinui.h" diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index 4033421b5673..7c241e09ece6 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, ASSISTED_TRAMMING_WIZARD) +#if BOTH(HAS_MARLINUI_MENU, ASSISTED_TRAMMING_WIZARD) #include "menu_item.h" @@ -109,4 +109,4 @@ void goto_tramming_wizard() { }); } -#endif // HAS_LCD_MENU && ASSISTED_TRAMMING_WIZARD +#endif // HAS_MARLINUI_MENU && ASSISTED_TRAMMING_WIZARD diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index b3f078d7a05d..854f36985f84 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "menu_item.h" #include "../../module/motion.h" @@ -236,4 +236,4 @@ void menu_tune() { END_MENU(); } -#endif // HAS_LCD_MENU +#endif // HAS_MARLINUI_MENU diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index a08eceed7797..c7ffd414cb7f 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_LCD_MENU, AUTO_BED_LEVELING_UBL) +#if BOTH(HAS_MARLINUI_MENU, AUTO_BED_LEVELING_UBL) #include "menu_item.h" #include "../../gcode/gcode.h" @@ -684,4 +684,4 @@ void _lcd_ubl_level_bed() { END_MENU(); } -#endif // HAS_LCD_MENU && AUTO_BED_LEVELING_UBL +#endif // HAS_MARLINUI_MENU && AUTO_BED_LEVELING_UBL diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 160f8c29f396..7c3d04345f48 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -596,9 +596,9 @@ MotionAxisState motionAxisState; static void quick_feedback() { #if HAS_CHIRP ui.chirp(); // Buzz and wait. Is the delay needed for buttons to settle? - #if BOTH(HAS_LCD_MENU, USE_BEEPER) + #if BOTH(HAS_MARLINUI_MENU, USE_BEEPER) for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } - #elif HAS_LCD_MENU + #elif HAS_MARLINUI_MENU delay(10); #endif #endif diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index d85a917983c0..5447e7d33e27 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -578,9 +578,9 @@ MotionAxisState motionAxisState; static void quick_feedback() { #if HAS_CHIRP ui.chirp(); // Buzz and wait. Is the delay needed for buttons to settle? - #if BOTH(HAS_LCD_MENU, USE_BEEPER) + #if BOTH(HAS_MARLINUI_MENU, USE_BEEPER) for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } - #elif HAS_LCD_MENU + #elif HAS_MARLINUI_MENU delay(10); #endif #endif diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index ff14a9d588ed..286879a6e066 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -583,9 +583,9 @@ MotionAxisState motionAxisState; static void quick_feedback() { #if HAS_CHIRP ui.chirp(); // Buzz and wait. Is the delay needed for buttons to settle? - #if BOTH(HAS_LCD_MENU, USE_BEEPER) + #if BOTH(HAS_MARLINUI_MENU, USE_BEEPER) for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } - #elif HAS_LCD_MENU + #elif HAS_MARLINUI_MENU delay(10); #endif #endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index c9107a9b1c40..e59a9f49cbeb 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -3786,7 +3786,7 @@ void Temperature::isr() { #if G26_CLICK_CAN_CANCEL if (click_to_cancel && ui.use_click()) { wait_for_heatup = false; - TERN_(HAS_LCD_MENU, ui.quick_feedback()); + TERN_(HAS_MARLINUI_MENU, ui.quick_feedback()); } #endif @@ -3920,7 +3920,7 @@ void Temperature::isr() { #if G26_CLICK_CAN_CANCEL if (click_to_cancel && ui.use_click()) { wait_for_heatup = false; - TERN_(HAS_LCD_MENU, ui.quick_feedback()); + TERN_(HAS_MARLINUI_MENU, ui.quick_feedback()); } #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index ade1d480b22c..eb2f4337c091 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -186,7 +186,7 @@ enum ADCSensorState : char { #define unscalePID_d(d) ( float(d) * PID_dT ) #endif -#if ENABLED(G26_MESH_VALIDATION) && EITHER(HAS_LCD_MENU, EXTENSIBLE_UI) +#if ENABLED(G26_MESH_VALIDATION) && EITHER(HAS_MARLINUI_MENU, EXTENSIBLE_UI) #define G26_CLICK_CAN_CANCEL 1 #endif @@ -965,7 +965,7 @@ class Temperature { static void set_heating_message(const uint8_t) {} #endif - #if HAS_LCD_MENU && HAS_TEMPERATURE + #if HAS_MARLINUI_MENU && HAS_TEMPERATURE static void lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb); #endif diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 285b4cba845f..f2767f2b5b85 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -89,7 +89,7 @@ #include "../feature/mmu/mmu2.h" #endif -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #include "../lcd/marlinui.h" #endif @@ -1027,7 +1027,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { DEBUG_ECHOLNPGM("No move (not homed)"); } - TERN_(HAS_LCD_MENU, if (!no_move) ui.update()); + TERN_(HAS_MARLINUI_MENU, if (!no_move) ui.update()); #if ENABLED(DUAL_X_CARRIAGE) const bool idex_full_control = dual_x_carriage_mode == DXC_FULL_CONTROL_MODE; diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h index a88e7084670b..f004c54adb85 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.h +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h @@ -53,7 +53,7 @@ #define HAS_SMART_EFF_MOD #endif -#if HAS_LCD_MENU +#if HAS_MARLINUI_MENU #if ENABLED(BACKLASH_GCODE) #define HAS_MENU_BACKLASH #endif diff --git a/ini/features.ini b/ini/features.ini index 142b42c63876..564b4701e69d 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -52,7 +52,7 @@ IS_DWIN_MARLINUI = src_filter=+ HAS_GRAPHICAL_TFT = src_filter=+ IS_TFTGLCD_PANEL = src_filter=+ HAS_TOUCH_BUTTONS = src_filter=+ -HAS_LCD_MENU = src_filter=+ +HAS_MARLINUI_MENU = src_filter=+ HAS_GAMES = src_filter=+ MARLIN_BRICKOUT = src_filter=+ MARLIN_INVADERS = src_filter=+ From 38e0e92e9d798fa8bb373e7b876b5f08b07fac0f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 25 Jan 2022 17:19:20 -0600 Subject: [PATCH 065/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20MKS=20enum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h | 2 +- Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h index 407782f5595e..9ec2304a36aa 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h @@ -100,7 +100,7 @@ extern EX_FILAMENT_DEF ex_filament; typedef enum { UNRUNOUT_STATUS, RUNOUT_STATUS, - RUNOUT_WAITTING_STATUS, + RUNOUT_WAITING_STATUS, RUNOUT_BEGIN_STATUS, } RUNOUT_MKS_STATUS_DEF; diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index ab2150a886c1..e729ecf44169 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -195,7 +195,7 @@ void DGUSScreenHandler::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { case 0: { // Resume auto cs = getCurrentScreen(); - if (runout_mks.runout_status != RUNOUT_WAITTING_STATUS && runout_mks.runout_status != UNRUNOUT_STATUS) { + if (runout_mks.runout_status != RUNOUT_WAITING_STATUS && runout_mks.runout_status != UNRUNOUT_STATUS) { if (cs == MKSLCD_SCREEN_PRINT || cs == MKSLCD_SCREEN_PAUSE) GotoScreen(MKSLCD_SCREEN_PAUSE); return; @@ -1501,10 +1501,10 @@ void DGUSScreenHandler::DGUS_Runout_Idle(void) { case RUNOUT_BEGIN_STATUS: if (READ(MT_DET_1_PIN) != MT_DET_PIN_STATE) - runout_mks.runout_status = RUNOUT_WAITTING_STATUS; + runout_mks.runout_status = RUNOUT_WAITING_STATUS; break; - case RUNOUT_WAITTING_STATUS: + case RUNOUT_WAITING_STATUS: if (READ(MT_DET_1_PIN) == MT_DET_PIN_STATE) runout_mks.runout_status = RUNOUT_BEGIN_STATUS; break; From f0f1d33980acef6ab2e202d7c4922453e6ad46dc Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 26 Jan 2022 13:08:15 +1300 Subject: [PATCH 066/502] =?UTF-8?q?=E2=9C=85=20FYSETC=20TFT81050=20CI=20Te?= =?UTF-8?q?st=20(#23604)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lcd/extui/ftdi_eve_touch_ui/language/language_en.h | 1 - buildroot/tests/FYSETC_S6 | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h index f79f788d8d3a..83e762430ce1 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h @@ -116,7 +116,6 @@ namespace Language_en { PROGMEM Language_Str MSG_LOAD_FILAMENT = u8"Load/Extrude"; PROGMEM Language_Str MSG_MOMENTARY = u8"Momentary"; PROGMEM Language_Str MSG_CONTINUOUS = u8"Continuous"; - PROGMEM Language_Str MSG_PLEASE_WAIT = u8"Please wait..."; PROGMEM Language_Str MSG_PRINT_MENU = u8"Print Menu"; PROGMEM Language_Str MSG_FINE_MOTION = u8"Fine motion"; PROGMEM Language_Str MSG_ENABLE_MEDIA = u8"Enable Media"; diff --git a/buildroot/tests/FYSETC_S6 b/buildroot/tests/FYSETC_S6 index 4794e11354d4..6d67800d77ec 100755 --- a/buildroot/tests/FYSETC_S6 +++ b/buildroot/tests/FYSETC_S6 @@ -13,5 +13,13 @@ opt_enable MEATPACK_ON_SERIAL_PORT_1 opt_set Y_DRIVER_TYPE TMC2209 Z_DRIVER_TYPE TMC2130 exec_test $1 $2 "FYSETC S6 Example" "$3" +# +# Build with the default configurations with FYSETC TFT81050 +# +restore_configs +opt_set MOTHERBOARD BOARD_FYSETC_S6_V2_0 SERIAL_PORT 1 +opt_enable TOUCH_UI_FTDI_EVE LCD_FYSETC_TFT81050 S6_TFT_PINMAP +exec_test $1 $2 "FYSETC S6 2 with LCD FYSETC TFT81050" "$3" + # cleanup restore_configs From 361dab93b387d3b1b5b62da016da0614d457db3d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 25 Jan 2022 18:33:30 -0600 Subject: [PATCH 067/502] =?UTF-8?q?=E2=9C=A8=20BOARD=5FCREALITY=5FV24S1=5F?= =?UTF-8?q?301=20(#23620)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Miguel Risco-Castillo --- Marlin/src/core/boards.h | 21 +++--- Marlin/src/inc/Conditionals_LCD.h | 2 + Marlin/src/pins/pins.h | 2 + .../pins/stm32f1/pins_CREALITY_V24S1_301.h | 66 +++++++++++++++++++ Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 4 +- 5 files changed, 84 insertions(+), 11 deletions(-) create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 6d294ddcc2e2..bcedc2059eb9 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -349,16 +349,17 @@ #define BOARD_CREALITY_V452 4049 // Creality v4.5.2 (STM32F103RE) #define BOARD_CREALITY_V453 4050 // Creality v4.5.3 (STM32F103RE) #define BOARD_CREALITY_V24S1 4051 // Creality v2.4.S1 (STM32F103RE) v101 as found in the Ender 7 -#define BOARD_TRIGORILLA_PRO 4052 // Trigorilla Pro (STM32F103ZE) -#define BOARD_FLY_MINI 4053 // FLYmaker FLY MINI (STM32F103RC) -#define BOARD_FLSUN_HISPEED 4054 // FLSUN HiSpeedV1 (STM32F103VE) -#define BOARD_BEAST 4055 // STM32F103RE Libmaple-based controller -#define BOARD_MINGDA_MPX_ARM_MINI 4056 // STM32F103ZE Mingda MD-16 -#define BOARD_GTM32_PRO_VD 4057 // STM32F103VE controller -#define BOARD_ZONESTAR_ZM3E2 4058 // Zonestar ZM3E2 (STM32F103RC) -#define BOARD_ZONESTAR_ZM3E4 4059 // Zonestar ZM3E4 V1 (STM32F103VC) -#define BOARD_ZONESTAR_ZM3E4V2 4060 // Zonestar ZM3E4 V2 (STM32F103VC) -#define BOARD_ERYONE_ERY32_MINI 4061 // Eryone Ery32 mini (STM32F103VE) +#define BOARD_CREALITY_V24S1_301 4052 // Creality v2.4.S1_301 (STM32F103RCT) as found in the Ender 3 S1 +#define BOARD_TRIGORILLA_PRO 4053 // Trigorilla Pro (STM32F103ZE) +#define BOARD_FLY_MINI 4054 // FLYmaker FLY MINI (STM32F103RC) +#define BOARD_FLSUN_HISPEED 4055 // FLSUN HiSpeedV1 (STM32F103VE) +#define BOARD_BEAST 4056 // STM32F103RE Libmaple-based controller +#define BOARD_MINGDA_MPX_ARM_MINI 4057 // STM32F103ZE Mingda MD-16 +#define BOARD_GTM32_PRO_VD 4058 // STM32F103VE controller +#define BOARD_ZONESTAR_ZM3E2 4059 // Zonestar ZM3E2 (STM32F103RC) +#define BOARD_ZONESTAR_ZM3E4 4060 // Zonestar ZM3E4 V1 (STM32F103VC) +#define BOARD_ZONESTAR_ZM3E4V2 4061 // Zonestar ZM3E4 V2 (STM32F103VC) +#define BOARD_ERYONE_ERY32_MINI 4062 // Eryone Ery32 mini (STM32F103VE) // // ARM Cortex-M4F diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 825898f88244..d044a0e68126 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -511,6 +511,8 @@ #ifndef LCD_SERIAL_PORT #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO) #define LCD_SERIAL_PORT 1 + #elif MB(CREALITY_V24S1_301) + #define LCD_SERIAL_PORT 2 // Creality Ender3S1 board #else #define LCD_SERIAL_PORT 3 // Creality 4.x board #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 858a00524fd5..4521f6836e0c 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -573,6 +573,8 @@ #include "stm32f1/pins_CREALITY_V453.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V24S1) #include "stm32f1/pins_CREALITY_V24S1.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple +#elif MB(CREALITY_V24S1_301) + #include "stm32f1/pins_CREALITY_V24S1_301.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(TRIGORILLA_PRO) #include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro env:trigorilla_pro_maple #elif MB(FLY_MINI) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h new file mode 100644 index 000000000000..336754bc1a31 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h @@ -0,0 +1,66 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Creality V24S1_301 (STM32F103RCT) board pin assignments as found on Ender 3 S1 + */ + +#include "env_validate.h" + +#if HAS_MULTI_HOTEND || E_STEPPERS > 1 + #error "Creality V4 only supports one hotend / E-stepper. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "Creality V24S1-301" +#define DEFAULT_MACHINE_NAME "Ender 3 S1" + +// +// Servos +// +#if !defined(SERVO0_PIN) && !defined(HAS_PIN_27_BOARD) + #define SERVO0_PIN PC13 // BLTouch OUT +#endif + +// +// Limit Switches +// +#define Z_STOP_PIN PC14 + +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PC14 // BLTouch IN +#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PC15 // "Pulled-high" +#endif + +// +// Heaters / Fans +// +#define HEATER_BED_PIN PA7 // HOT BED +#define FAN1_PIN PC0 // extruder fan + +#include "pins_CREALITY_V4.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index dea20642b13d..3ed6888c389e 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -72,7 +72,9 @@ // #define X_STOP_PIN PA5 #define Y_STOP_PIN PA6 -#define Z_STOP_PIN PA7 +#ifndef Z_STOP_PIN + #define Z_STOP_PIN PA7 +#endif #ifndef Z_MIN_PROBE_PIN #define Z_MIN_PROBE_PIN PB1 // BLTouch IN From 758dc7af9d340dd5ece4c98374e60a213567a4ec Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Wed, 26 Jan 2022 10:33:10 -0800 Subject: [PATCH 068/502] =?UTF-8?q?=F0=9F=9A=B8=20Better=20"Bed=20Tramming?= =?UTF-8?q?=20Done"=20dialog=20(#23616)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 12 ++++++++---- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 12 ++++++++---- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 4 ++-- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 4 ++-- Marlin/src/lcd/language/language_fr.h | 2 +- Marlin/src/lcd/menu/menu.cpp | 3 ++- Marlin/src/lcd/menu/menu_bed_corners.cpp | 10 ++++++---- Marlin/src/lcd/tft/ui_320x240.cpp | 4 ++-- Marlin/src/lcd/tft/ui_480x320.cpp | 4 ++-- 9 files changed, 33 insertions(+), 22 deletions(-) diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 26344da41219..db4bd4e19e8c 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -1117,10 +1117,14 @@ void MarlinUI::draw_status_screen() { // The Select Screen presents a prompt and two "buttons" void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { ui.draw_select_screen_prompt(pref, string, suff); - SETCURSOR(0, LCD_HEIGHT - 1); - lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd_put_wchar(yesno ? ' ' : ']'); - SETCURSOR_RJ(utf8_strlen_P(yes) + 2, LCD_HEIGHT - 1); - lcd_put_wchar(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd_put_wchar(yesno ? ']' : ' '); + if (no) { + SETCURSOR(0, LCD_HEIGHT - 1); + lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd_put_wchar(yesno ? ' ' : ']'); + } + if (yes) { + SETCURSOR_RJ(utf8_strlen_P(yes) + 2, LCD_HEIGHT - 1); + lcd_put_wchar(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd_put_wchar(yesno ? ']' : ' '); + } } #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index dc7910176222..1c6b03445f47 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -1003,11 +1003,15 @@ void MarlinUI::draw_status_screen() { void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff) { if (!PanelDetected) return; ui.draw_select_screen_prompt(pref, string, suff); - lcd.setCursor(0, MIDDLE_Y); lcd.write(COLOR_EDIT); - lcd.write(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd.write(yesno ? ' ' : ']'); - lcd.setCursor(LCD_WIDTH - utf8_strlen_P(yes) - 3, MIDDLE_Y); - lcd.write(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd.write(yesno ? ']' : ' '); + if (no) { + lcd.setCursor(0, MIDDLE_Y); + lcd.write(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd.write(yesno ? ' ' : ']'); + } + if (yes) { + lcd.setCursor(LCD_WIDTH - utf8_strlen_P(yes) - 3, MIDDLE_Y); + lcd.write(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd.write(yesno ? ']' : ' '); + } lcd.print_line(); } diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index a1540e754f18..aafc4d880318 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -519,8 +519,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { ui.draw_select_screen_prompt(pref, string, suff); - draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno); - draw_boxed_string(LCD_WIDTH - (utf8_strlen_P(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno); + if (no) draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno); + if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen_P(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno); } #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 8b0a700828a0..f49d06d39642 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -437,8 +437,8 @@ void MarlinUI::draw_status_message(const bool blink) { dwin_font.solid = false; dwin_font.fg = Color_White; ui.draw_select_screen_prompt(pref, string, suff); - draw_boxed_string(false, no, !yesno); - draw_boxed_string(true, yes, yesno); + if (no) draw_boxed_string(false, no, !yesno); + if (yes) draw_boxed_string(true, yes, yesno); } #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 6b2d56b1bfcd..2eb64fc2c228 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -111,7 +111,7 @@ namespace Language_fr { LSTR MSG_LEVEL_BED = _UxGT("Niveau du lit"); LSTR MSG_BED_TRAMMING = _UxGT("Niveau des coins"); LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Relever le coin jusqu'à la sonde"); - LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Coins dans la tolérance. Niveau lit "); + LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Coins dans la tolérance. Niveau lit."); LSTR MSG_NEXT_CORNER = _UxGT("Coin suivant"); LSTR MSG_MESH_EDITOR = _UxGT("Modif. maille"); // 13 car. max LSTR MSG_EDIT_MESH = _UxGT("Modifier grille"); diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 01b845da6e35..2dca6c1b826c 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -368,7 +368,8 @@ void MenuItem_confirm::select_screen( PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/ ) { ui.defer_status_screen(); - const bool ui_selection = ui.update_selection(), got_click = ui.use_click(); + const bool ui_selection = !yes ? false : !no || ui.update_selection(), + got_click = ui.use_click(); if (got_click || ui.should_draw()) { draw_select_screen(yes, no, ui_selection, pref, string, suff); if (got_click) { diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 7a0f2eaa4918..e3f5c460ed24 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -207,11 +207,13 @@ static void _lcd_level_bed_corners_get_next_position() { void _lcd_draw_level_prompt() { if (!ui.should_draw()) return; - MenuItem_confirm::confirm_screen( - []{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); } - , ui.goto_previous_screen_no_defer + MenuItem_confirm::select_screen( + GET_TEXT(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE)), + TERN(HAS_LEVELING, GET_TEXT(MSG_BUTTON_BACK), nullptr) + , []{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); } + , TERN(HAS_LEVELING, ui.goto_previous_screen_no_defer, []{}) , GET_TEXT(MSG_BED_TRAMMING_IN_RANGE) - , (const char*)nullptr, PSTR("?") + , (const char*)nullptr, NUL_STR ); } diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 5447e7d33e27..812a03594795 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -440,8 +440,8 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); } #if ENABLED(TOUCH_SCREEN) - add_control(48, TFT_HEIGHT - 64, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL); - add_control(208, TFT_HEIGHT - 64, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM)); + if (no) add_control( 48, TFT_HEIGHT - 64, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL); + if (yes) add_control(208, TFT_HEIGHT - 64, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM)); #endif } diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 286879a6e066..f142dbbc06c1 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -445,8 +445,8 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string); } #if ENABLED(TOUCH_SCREEN) - add_control(88, TFT_HEIGHT - 64, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL); - add_control(328, TFT_HEIGHT - 64, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM)); + if (no) add_control( 88, TFT_HEIGHT - 64, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL); + if (yes) add_control(328, TFT_HEIGHT - 64, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM)); #endif } From 30d1f0ba81ffdb477fab7370584238e69f88cc8f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 26 Jan 2022 13:40:29 -0600 Subject: [PATCH 069/502] =?UTF-8?q?=F0=9F=93=9D=20Update=20Creality=204.2.?= =?UTF-8?q?2=20driver=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Warnings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index e1b4a1f9a8ed..f2b2339729e2 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -538,7 +538,7 @@ // Ender 3 Pro (but, apparently all Creality 4.2.2 boards) #if ENABLED(EMIT_CREALITY_422_WARNING) || MB(CREALITY_V4) - #warning "Creality 4.2.2 boards may have A4988 or TMC2208_STANDALONE drivers. Check your board and make sure to select the correct DRIVER_TYPE!" + #warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225)." #endif #if HOMING_Z_WITH_PROBE && IS_CARTESIAN && DISABLED(Z_SAFE_HOMING) From c7b0626b02fba7ac37a918e6cc2b2f86556fd1e1 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Wed, 26 Jan 2022 14:01:22 -0600 Subject: [PATCH 070/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20SPI=20DMA=20and=20?= =?UTF-8?q?default=20mode=20(#23627)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #23464 --- Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp | 2 +- Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp index 82b209593e97..6e852a748703 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -270,7 +270,7 @@ void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * co uint16_t width = area->x2 - area->x1 + 1, height = area->y2 - area->y1 + 1; - TERN_(USE_SPI_DMA_TC, disp_drv_p = disp); + disp_drv_p = disp; SPI_TFT.setWindow((uint16_t)area->x1, (uint16_t)area->y1, width, height); diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index dee6923076b3..032ce41bcb2f 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -369,7 +369,8 @@ #endif // HAS_WIRED_LCD #if HAS_TFT_LVGL_UI - #define USE_SPI_DMA_TC + // Enable SPI DMA, this requires button pins, thus no buttons. Default is DISABLED. + //#define USE_SPI_DMA_TC #endif #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI, HAS_WIRED_LCD) From 68dfc5056492f70c24b780564622d178346e240d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 27 Jan 2022 07:05:26 -0600 Subject: [PATCH 071/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Sim?= =?UTF-8?q?plify=20Fast=20PWM=20timer=20macros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/fast_pwm.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Marlin/src/HAL/AVR/fast_pwm.cpp b/Marlin/src/HAL/AVR/fast_pwm.cpp index af96fb9e18fd..aa5abf53f36e 100644 --- a/Marlin/src/HAL/AVR/fast_pwm.cpp +++ b/Marlin/src/HAL/AVR/fast_pwm.cpp @@ -34,27 +34,27 @@ struct Timer { }; // Macros for the Timer structure -#define _SET_WGMnQ(TCCRnQ, V) do{ \ - *(TCCRnQ)[0] = (*(TCCRnQ)[0] & ~(0x3 << 0)) | (( int(V) & 0x3) << 0); \ - *(TCCRnQ)[1] = (*(TCCRnQ)[1] & ~(0x3 << 3)) | (((int(V) >> 2) & 0x3) << 3); \ +#define _SET_WGMnQ(T, V) do{ \ + *(T.TCCRnQ)[0] = (*(T.TCCRnQ)[0] & ~(0x3 << 0)) | (( int(V) & 0x3) << 0); \ + *(T.TCCRnQ)[1] = (*(T.TCCRnQ)[1] & ~(0x3 << 3)) | (((int(V) >> 2) & 0x3) << 3); \ }while(0) // Set TCCR CS bits -#define _SET_CSn(TCCRnQ, V) (*(TCCRnQ)[1] = (*(TCCRnQ[1]) & ~(0x7 << 0)) | ((int(V) & 0x7) << 0)) +#define _SET_CSn(T, V) (*(T.TCCRnQ)[1] = (*(T.TCCRnQ[1]) & ~(0x7 << 0)) | ((int(V) & 0x7) << 0)) // Set TCCR COM bits -#define _SET_COMnQ(TCCRnQ, Q, V) (*(TCCRnQ)[0] = (*(TCCRnQ)[0] & ~(0x3 << (6-2*(Q)))) | (int(V) << (6-2*(Q)))) +#define _SET_COMnQ(T, Q, V) (*(T.TCCRnQ)[0] = (*(T.TCCRnQ)[0] & ~(0x3 << (6-2*(Q)))) | (int(V) << (6-2*(Q)))) // Set OCRnQ register -#define _SET_OCRnQ(OCRnQ, Q, V) (*(OCRnQ)[Q] = int(V) & 0xFFFF) +#define _SET_OCRnQ(T, Q, V) (*(T.OCRnQ)[Q] = int(V) & 0xFFFF) // Set ICRn register (one per timer) -#define _SET_ICRn(ICRn, V) (*(ICRn) = int(V) & 0xFFFF) +#define _SET_ICRn(T, V) (*(T.ICRn) = int(V) & 0xFFFF) /** * Return a Timer struct describing a pin's timer. */ -Timer get_pwm_timer(const pin_t pin) { +const Timer get_pwm_timer(const pin_t pin) { uint8_t q = 0; @@ -108,7 +108,7 @@ Timer get_pwm_timer(const pin_t pin) { } void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { - Timer timer = get_pwm_timer(pin); + const Timer timer = get_pwm_timer(pin); if (timer.isProtected || !timer.isPWM) return; // Don't proceed if protected timer or not recognized const bool is_timer2 = timer.n == 2; @@ -166,14 +166,14 @@ void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { } } - _SET_WGMnQ(timer.TCCRnQ, wgm); - _SET_CSn(timer.TCCRnQ, j); + _SET_WGMnQ(timer, wgm); + _SET_CSn(timer, j); if (is_timer2) { - TERN_(USE_OCR2A_AS_TOP, _SET_OCRnQ(timer.OCRnQ, 0, res)); // Set OCR2A value (TOP) = res + TERN_(USE_OCR2A_AS_TOP, _SET_OCRnQ(timer, 0, res)); // Set OCR2A value (TOP) = res } else - _SET_ICRn(timer.ICRn, res); // Set ICRn value (TOP) = res + _SET_ICRn(timer, res); // Set ICRn value (TOP) = res } void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { @@ -184,7 +184,7 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 else if (v == v_size) digitalWrite(pin, !invert); else { - Timer timer = get_pwm_timer(pin); + const Timer timer = get_pwm_timer(pin); if (timer.isPWM) { if (timer.n == 0) { TCCR0A |= _BV(COM0B1); // Only allow a TIMER0B select and OCR0B duty update for pin D4 outputs no frequency changes are permited. @@ -192,8 +192,8 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 } else if (!timer.isProtected) { const uint16_t top = timer.n == 2 ? TERN(USE_OCR2A_AS_TOP, *timer.OCRnQ[0], 255) : *timer.ICRn; - _SET_COMnQ(timer.TCCRnQ, SUM_TERN(HAS_TCCR2, timer.q, timer.q == 2), COM_CLEAR_SET + invert); // COM20 is on bit 4 of TCCR2, so +1 for q==2 - _SET_OCRnQ(timer.OCRnQ, timer.q, uint16_t(uint32_t(v) * top / v_size)); // Scale 8/16-bit v to top value + _SET_COMnQ(timer, SUM_TERN(HAS_TCCR2, timer.q, timer.q == 2), COM_CLEAR_SET + invert); // COM20 is on bit 4 of TCCR2, so +1 for q==2 + _SET_OCRnQ(timer, timer.q, uint16_t(uint32_t(v) * top / v_size)); // Scale 8/16-bit v to top value } } else From c02bc3887aa23dfeb933a47c38bcf8ddfd6fe40c Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Sun, 30 Jan 2022 05:31:56 -0600 Subject: [PATCH 072/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20AVR=20644/1284=20T?= =?UTF-8?q?imer=20/=20PWM=20conflicts=20(#23629)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/HAL_SPI.cpp | 20 +++++++++----------- Marlin/src/HAL/AVR/fast_pwm.cpp | 8 ++++---- Marlin/src/HAL/AVR/timers.h | 22 +++++++++++----------- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL_SPI.cpp b/Marlin/src/HAL/AVR/HAL_SPI.cpp index 8784bb07b30e..dc98f2f79e71 100644 --- a/Marlin/src/HAL/AVR/HAL_SPI.cpp +++ b/Marlin/src/HAL/AVR/HAL_SPI.cpp @@ -35,22 +35,20 @@ void spiBegin() { #if PIN_EXISTS(SD_SS) - OUT_WRITE(SD_SS_PIN, HIGH); + // Do not init HIGH for boards with pin 4 used as Fans or Heaters or otherwise, not likely to have multiple SPI devices anyway. + #if defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__) + // SS must be in output mode even it is not chip select + SET_OUTPUT(SD_SS_PIN); + #else + // set SS high - may be chip select for another SPI device + OUT_WRITE(SD_SS_PIN, HIGH); + #endif #endif SET_OUTPUT(SD_SCK_PIN); SET_INPUT(SD_MISO_PIN); SET_OUTPUT(SD_MOSI_PIN); - #if DISABLED(SOFTWARE_SPI) - // SS must be in output mode even it is not chip select - //SET_OUTPUT(SD_SS_PIN); - // set SS high - may be chip select for another SPI device - //#if SET_SPI_SS_HIGH - //WRITE(SD_SS_PIN, HIGH); - //#endif - // set a default rate - spiInit(1); - #endif + IF_DISABLED(SOFTWARE_SPI, spiInit(SPI_HALF_SPEED)); } #if NONE(SOFTWARE_SPI, FORCE_SOFT_SPI) diff --git a/Marlin/src/HAL/AVR/fast_pwm.cpp b/Marlin/src/HAL/AVR/fast_pwm.cpp index aa5abf53f36e..f8201d028ebd 100644 --- a/Marlin/src/HAL/AVR/fast_pwm.cpp +++ b/Marlin/src/HAL/AVR/fast_pwm.cpp @@ -70,7 +70,7 @@ const Timer get_pwm_timer(const pin_t pin) { #ifdef TCCR0A case TIMER0B: // Protected timer, but allow setting the duty cycle on OCR0B for pin D4 only - return Timer({ { &TCCR0A, nullptr, nullptr }, { (uint16_t*)&OCR0B, nullptr, nullptr }, nullptr, 0, 0, true, true }); + return Timer({ { &TCCR0A, nullptr, nullptr }, { (uint16_t*)&OCR0A, (uint16_t*)&OCR0B, nullptr }, nullptr, 0, 1, true, true }); #endif #if HAS_TCCR2 @@ -187,8 +187,8 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 const Timer timer = get_pwm_timer(pin); if (timer.isPWM) { if (timer.n == 0) { - TCCR0A |= _BV(COM0B1); // Only allow a TIMER0B select and OCR0B duty update for pin D4 outputs no frequency changes are permited. - OCR0B = v; + _SET_COMnQ(timer, timer.q, COM_CLEAR_SET); // Only allow a TIMER0B select... + _SET_OCRnQ(timer, timer.q, v); // ...and OCR0B duty update. For output pin D4 no frequency changes are permitted. } else if (!timer.isProtected) { const uint16_t top = timer.n == 2 ? TERN(USE_OCR2A_AS_TOP, *timer.OCRnQ[0], 255) : *timer.ICRn; @@ -197,7 +197,7 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 } } else - digitalWrite(pin, v < 128 ? LOW : HIGH); + digitalWrite(pin, v < v_size / 2 ? LOW : HIGH); } } diff --git a/Marlin/src/HAL/AVR/timers.h b/Marlin/src/HAL/AVR/timers.h index 36b04eae0d1f..ba3c4acd29ea 100644 --- a/Marlin/src/HAL/AVR/timers.h +++ b/Marlin/src/HAL/AVR/timers.h @@ -58,9 +58,9 @@ typedef uint16_t hal_timer_t; #define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A) #define STEPPER_ISR_ENABLED() TEST(TIMSK1, OCIE1A) -#define ENABLE_TEMPERATURE_INTERRUPT() SBI(TIMSK0, OCIE0B) -#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B) -#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B) +#define ENABLE_TEMPERATURE_INTERRUPT() SBI(TIMSK0, OCIE0A) +#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0A) +#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0A) FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) { switch (timer_num) { @@ -87,7 +87,7 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) { case MF_TIMER_TEMP: // Use timer0 for temperature measurement // Interleave temperature interrupt with millies interrupt - OCR0B = 128; + OCR0A = 128; break; } } @@ -180,7 +180,7 @@ void TIMER1_COMPA_vect() { \ : \ : [timsk0] "i" ((uint16_t)&TIMSK0), \ [timsk1] "i" ((uint16_t)&TIMSK1), \ - [msk0] "M" ((uint8_t)(1< Date: Mon, 31 Jan 2022 00:34:03 +1300 Subject: [PATCH 073/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20FYSETC=20S6,=20S6?= =?UTF-8?q?=20V2=20Serial=20RX=20pins=20(#23642)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 2 +- Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index 0e0266f1a4ca..dfcb4217c9db 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -128,7 +128,7 @@ #define Y_SERIAL_TX_PIN PE14 #endif #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN PC4 + #define Y_SERIAL_RX_PIN PE13 #endif #ifndef Z_SERIAL_TX_PIN #define Z_SERIAL_TX_PIN PD11 diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h index 6f1c9be8f5b0..a9ce1383d8ca 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h @@ -39,11 +39,17 @@ #if HAS_TMC_UART #define X_SERIAL_TX_PIN PE8 + #define X_SERIAL_RX_PIN PE8 #define Y_SERIAL_TX_PIN PC4 + #define Y_SERIAL_RX_PIN PC4 #define Z_SERIAL_TX_PIN PD12 + #define Z_SERIAL_RX_PIN PD12 #define E0_SERIAL_TX_PIN PA15 + #define E0_SERIAL_RX_PIN PA15 #define E1_SERIAL_TX_PIN PC5 + #define E1_SERIAL_RX_PIN PC5 #define E2_SERIAL_TX_PIN PE0 + #define E2_SERIAL_RX_PIN PE0 #endif // From 1cdaddaaf20fa359f4513e13baf08e4df0271fd9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 1 Feb 2022 17:28:29 -0600 Subject: [PATCH 074/502] =?UTF-8?q?=F0=9F=94=A7=20Board=20temp=20sensor=20?= =?UTF-8?q?check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 7b14ef495b3b..a8eb7614ff7c 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2294,6 +2294,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "CONTROLLER_FAN_MIN_BOARD_TEMP requires TEMP_SENSOR_BOARD." #endif +#if TEMP_SENSOR_BOARD && !PIN_EXISTS(TEMP_BOARD) + #error "TEMP_SENSOR_BOARD requires TEMP_BOARD_PIN." +#endif + #if ENABLED(LASER_COOLANT_FLOW_METER) && !(PIN_EXISTS(FLOWMETER) && ENABLED(LASER_FEATURE)) #error "LASER_COOLANT_FLOW_METER requires FLOWMETER_PIN and LASER_FEATURE." #endif From fbbf556e0886d8b2d69bf5b64540b123d37f4894 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 21 Feb 2022 20:50:09 -0600 Subject: [PATCH 075/502] =?UTF-8?q?=F0=9F=94=A8=20Workspace=20file=20with?= =?UTF-8?q?=20recommendation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/extensions.json | 3 +++ buildroot/share/vscode/MarlinFirmware.code-workspace | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 buildroot/share/vscode/MarlinFirmware.code-workspace diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 7226831cb182..f495d14f53e8 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,5 +4,8 @@ "recommendations": [ "marlinfirmware.auto-build", "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" ] } diff --git a/buildroot/share/vscode/MarlinFirmware.code-workspace b/buildroot/share/vscode/MarlinFirmware.code-workspace new file mode 100644 index 000000000000..bd433b07f0e2 --- /dev/null +++ b/buildroot/share/vscode/MarlinFirmware.code-workspace @@ -0,0 +1,4 @@ +{ + "folders": [ { "path": "../../.." } ], + "extensions": { "recommendations": [ "marlinfirmware.auto-build" ] } +} From f8571fc18fc7a846e321581979a093d135c71999 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 5 Feb 2022 05:24:38 +1300 Subject: [PATCH 076/502] =?UTF-8?q?=F0=9F=90=9B=20Creality=20v4=20cleanup,?= =?UTF-8?q?=20pin=20correction=20(#23666)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 47 +++++++++++----------- Marlin/src/pins/pins.h | 4 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 2 - 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index bcedc2059eb9..8d3a53258ab5 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -337,29 +337,30 @@ #define BOARD_CHITU3D_V5 4037 // Chitu3D TronXY X5SA V5 Board #define BOARD_CHITU3D_V6 4038 // Chitu3D TronXY X5SA V6 Board #define BOARD_CHITU3D_V9 4039 // Chitu3D TronXY X5SA V9 Board -#define BOARD_CREALITY_V4 4040 // Creality v4.x (STM32F103RE) -#define BOARD_CREALITY_V423 4041 // Creality v4.2.3 (STM32F103RE) -#define BOARD_CREALITY_V427 4042 // Creality v4.2.7 (STM32F103RE) -#define BOARD_CREALITY_V4210 4043 // Creality v4.2.10 (STM32F103RE) as found in the CR-30 -#define BOARD_CREALITY_V431 4044 // Creality v4.3.1 (STM32F103RE) -#define BOARD_CREALITY_V431_A 4045 // Creality v4.3.1a (STM32F103RE) -#define BOARD_CREALITY_V431_B 4046 // Creality v4.3.1b (STM32F103RE) -#define BOARD_CREALITY_V431_C 4047 // Creality v4.3.1c (STM32F103RE) -#define BOARD_CREALITY_V431_D 4048 // Creality v4.3.1d (STM32F103RE) -#define BOARD_CREALITY_V452 4049 // Creality v4.5.2 (STM32F103RE) -#define BOARD_CREALITY_V453 4050 // Creality v4.5.3 (STM32F103RE) -#define BOARD_CREALITY_V24S1 4051 // Creality v2.4.S1 (STM32F103RE) v101 as found in the Ender 7 -#define BOARD_CREALITY_V24S1_301 4052 // Creality v2.4.S1_301 (STM32F103RCT) as found in the Ender 3 S1 -#define BOARD_TRIGORILLA_PRO 4053 // Trigorilla Pro (STM32F103ZE) -#define BOARD_FLY_MINI 4054 // FLYmaker FLY MINI (STM32F103RC) -#define BOARD_FLSUN_HISPEED 4055 // FLSUN HiSpeedV1 (STM32F103VE) -#define BOARD_BEAST 4056 // STM32F103RE Libmaple-based controller -#define BOARD_MINGDA_MPX_ARM_MINI 4057 // STM32F103ZE Mingda MD-16 -#define BOARD_GTM32_PRO_VD 4058 // STM32F103VE controller -#define BOARD_ZONESTAR_ZM3E2 4059 // Zonestar ZM3E2 (STM32F103RC) -#define BOARD_ZONESTAR_ZM3E4 4060 // Zonestar ZM3E4 V1 (STM32F103VC) -#define BOARD_ZONESTAR_ZM3E4V2 4061 // Zonestar ZM3E4 V2 (STM32F103VC) -#define BOARD_ERYONE_ERY32_MINI 4062 // Eryone Ery32 mini (STM32F103VE) +#define BOARD_CREALITY_V4 4040 // Creality v4.x (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V422 4041 // Creality v4.2.2 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V423 4042 // Creality v4.2.3 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V427 4043 // Creality v4.2.7 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V4210 4044 // Creality v4.2.10 (STM32F103RC / STM32F103RE) as found in the CR-30 +#define BOARD_CREALITY_V431 4045 // Creality v4.3.1 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V431_A 4046 // Creality v4.3.1a (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V431_B 4047 // Creality v4.3.1b (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V431_C 4048 // Creality v4.3.1c (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V431_D 4049 // Creality v4.3.1d (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V452 4050 // Creality v4.5.2 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V453 4051 // Creality v4.5.3 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V24S1 4052 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender 7 +#define BOARD_CREALITY_V24S1_301 4053 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) as found in the Ender 3 S1 +#define BOARD_TRIGORILLA_PRO 4054 // Trigorilla Pro (STM32F103ZE) +#define BOARD_FLY_MINI 4055 // FLYmaker FLY MINI (STM32F103RC) +#define BOARD_FLSUN_HISPEED 4056 // FLSUN HiSpeedV1 (STM32F103VE) +#define BOARD_BEAST 4057 // STM32F103RE Libmaple-based controller +#define BOARD_MINGDA_MPX_ARM_MINI 4058 // STM32F103ZE Mingda MD-16 +#define BOARD_GTM32_PRO_VD 4059 // STM32F103VE controller +#define BOARD_ZONESTAR_ZM3E2 4060 // Zonestar ZM3E2 (STM32F103RC) +#define BOARD_ZONESTAR_ZM3E4 4061 // Zonestar ZM3E4 V1 (STM32F103VC) +#define BOARD_ZONESTAR_ZM3E4V2 4062 // Zonestar ZM3E4 V2 (STM32F103VC) +#define BOARD_ERYONE_ERY32_MINI 4063 // Eryone Ery32 mini (STM32F103VE) // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 4521f6836e0c..07acd0b12274 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -557,12 +557,12 @@ #include "stm32f1/pins_CHITU3D_V6.h" // STM32F1 env:chitu_f103 env:chitu_f103_maple #elif MB(CHITU3D_V9) #include "stm32f1/pins_CHITU3D_V9.h" // STM32F1 env:chitu_f103 env:chitu_f103_maple -#elif MB(CREALITY_V4) +#elif MB(CREALITY_V4, CREALITY_V422) #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V4210) #include "stm32f1/pins_CREALITY_V4210.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V423) - #include "stm32f1/pins_CREALITY_V423.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer + #include "stm32f1/pins_CREALITY_V423.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer #elif MB(CREALITY_V427) #include "stm32f1/pins_CREALITY_V427.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V431, CREALITY_V431_A, CREALITY_V431_B, CREALITY_V431_C, CREALITY_V431_D) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index 3ed6888c389e..6122206d6a8e 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -152,8 +152,6 @@ // #define SD_DETECT_PIN PC7 #define SDCARD_CONNECTION ONBOARD -#define ONBOARD_SPI_DEVICE 1 -#define ONBOARD_SD_CS_PIN PA4 // SDSS #define SDIO_SUPPORT #define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer From f42c1b4cae9549cdc260543aa17f220ee2dbaa53 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Fri, 4 Feb 2022 10:45:34 -0600 Subject: [PATCH 077/502] =?UTF-8?q?=F0=9F=94=A7=20Sanity-check=20AVR=20D9?= =?UTF-8?q?=20Fan=20PWM=20/=20SPEAKER=20Timer2=20(#23672)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/inc/SanityCheck.h | 10 +++++++++- Marlin/src/inc/SanityCheck.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/AVR/inc/SanityCheck.h b/Marlin/src/HAL/AVR/inc/SanityCheck.h index 331d0b04648b..5c1f01a8f477 100644 --- a/Marlin/src/HAL/AVR/inc/SanityCheck.h +++ b/Marlin/src/HAL/AVR/inc/SanityCheck.h @@ -29,7 +29,15 @@ * Checks for FAST PWM */ #if ALL(FAST_PWM_FAN, USE_OCR2A_AS_TOP, HAS_TCCR2) - #error "USE_OCR2A_AS_TOP does not apply to devices with a single output TIMER2" + #error "USE_OCR2A_AS_TOP does not apply to devices with a single output TIMER2." +#endif + +/** + * Checks for SOFT PWM + */ +#if HAS_FAN0 && FAN_PIN == 9 && DISABLED(FAN_SOFT_PWM) && ENABLED(SPEAKER) + #error "FAN_PIN 9 Hardware PWM uses Timer 2 which conflicts with Arduino AVR Tone Timer (for SPEAKER)." + #error "Disable SPEAKER or enable FAN_SOFT_PWM." #endif /** diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index a8eb7614ff7c..09aae1e2c2fe 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2018,7 +2018,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if CONTROLLER_FAN_PIN == FAN_PIN #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN." #elif ENABLED(FAN_SOFT_PWM_REQUIRED) && DISABLED(FAN_SOFT_PWM) - #error "FAN_SOFT_PWM is required. Enable it to continue." + #error "FAN_SOFT_PWM is required for your board. Enable it to continue." #endif #endif From d4801461f504f1a2a68393b57d492b9bb9ac1ff5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 4 Feb 2022 12:39:30 -0600 Subject: [PATCH 078/502] =?UTF-8?q?=F0=9F=92=A1=20Comment=20variant=20time?= =?UTF-8?q?rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32/timers.cpp | 4 ++-- .../variants/MARLIN_ARTILLERY_RUBY/variant.h | 4 ++-- .../variants/MARLIN_BIGTREE_BTT002/variant.h | 6 +++--- .../variants/MARLIN_BIGTREE_E3_RRF/variant.h | 6 +++--- .../variants/MARLIN_BIGTREE_GTR_V1/variant.h | 6 +++--- .../MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.h | 6 +++--- .../variants/MARLIN_BIGTREE_OCTOPUS_V1/variant.h | 6 +++--- .../variants/MARLIN_BIGTREE_SKR_PRO_11/variant.h | 6 +++--- .../PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h | 6 +++--- .../share/PlatformIO/variants/MARLIN_F103Rx/variant.h | 4 ++-- .../PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h | 6 +++--- .../share/PlatformIO/variants/MARLIN_F103Vx/variant.h | 4 ++-- .../share/PlatformIO/variants/MARLIN_F103Zx/variant.h | 4 ++-- .../share/PlatformIO/variants/MARLIN_F407VE/variant.h | 4 ++-- .../share/PlatformIO/variants/MARLIN_F446VE/variant.h | 6 +++--- .../share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h | 6 +++--- .../PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h | 4 ++-- .../variants/MARLIN_FYSETC_CHEETAH_V20/variant.h | 10 ++++------ .../PlatformIO/variants/MARLIN_FYSETC_S6/variant.h | 6 +++--- .../share/PlatformIO/variants/MARLIN_LERDGE/variant.h | 2 +- .../variants/MARLIN_TH3D_EZBOARD_V2/variant.h | 4 ++-- 21 files changed, 54 insertions(+), 56 deletions(-) diff --git a/Marlin/src/HAL/STM32/timers.cpp b/Marlin/src/HAL/STM32/timers.cpp index fe27ca101677..a1e3372bbb2e 100644 --- a/Marlin/src/HAL/STM32/timers.cpp +++ b/Marlin/src/HAL/STM32/timers.cpp @@ -74,10 +74,10 @@ #define MCU_STEP_TIMER 4 #define MCU_TEMP_TIMER 2 #elif defined(STM32F401xC) || defined(STM32F401xE) - #define MCU_STEP_TIMER 9 + #define MCU_STEP_TIMER 9 // STM32F401 has no TIM6, TIM7, or TIM8 #define MCU_TEMP_TIMER 10 #elif defined(STM32F4xx) || defined(STM32F7xx) || defined(STM32H7xx) - #define MCU_STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8 + #define MCU_STEP_TIMER 6 #define MCU_TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used. #endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.h index 0c66ae89b88a..ca7a53d7827b 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.h @@ -107,8 +107,8 @@ extern "C" { // TIM9 - STEP_TIMER // TIM10 - TEMP_TIMER // TIM11 - -#define TIMER_SERVO TIM2 -#define TIMER_TONE TIM5 +#define TIMER_SERVO TIM2 // TIMER_SERVO must be defined in this file +#define TIMER_TONE TIM5 // TIMER_TONE must be defined in this file // UART Definitions #define SERIAL_UART_INSTANCE 1 diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/variant.h index 56574501002d..068d0b9ee587 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/variant.h @@ -245,9 +245,9 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c -#define TIMER_TONE TIM7 -#define TIMER_SERVO TIM5 -#define TIMER_SERIAL TIM2 +#define TIMER_TONE TIM7 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file +#define TIMER_SERIAL TIM2 // TIMER_SERIAL must be defined in this file // UART Definitions // Define here Serial instance number to map on Serial generic name diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/variant.h index 646d635679f6..edc1c91c5374 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/variant.h @@ -245,9 +245,9 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c -#define TIMER_TONE TIM7 -#define TIMER_SERVO TIM5 -#define TIMER_SERIAL TIM8 +#define TIMER_TONE TIM7 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file +#define TIMER_SERIAL TIM8 // TIMER_SERIAL must be defined in this file // UART Definitions // Define here Serial instance number to map on Serial generic name diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/variant.h index 41e46411022c..2c70693991ed 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/variant.h @@ -255,9 +255,9 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c -#define TIMER_TONE TIM10 -#define TIMER_SERVO TIM5 -#define TIMER_SERIAL TIM7 +#define TIMER_TONE TIM10 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file +#define TIMER_SERIAL TIM7 // TIMER_SERIAL must be defined in this file // UART Definitions //#define ENABLE_HWSERIAL1 done automatically by the #define SERIAL_UART_INSTANCE below diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.h index 0147ece0ab20..1870e779297a 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.h @@ -165,9 +165,9 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pin. See PinMap_PWM. -#define TIMER_TONE TIM6 -#define TIMER_SERVO TIM5 -#define TIMER_SERIAL TIM7 +#define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file +#define TIMER_SERIAL TIM7 // TIMER_SERIAL must be defined in this file // UART Definitions //#define SERIAL_UART_INSTANCE 1 // Connected to EXP3 header diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/variant.h index f512a311e32c..424538b3950f 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/variant.h @@ -165,9 +165,9 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pin. See PinMap_PWM. -#define TIMER_TONE TIM6 -#define TIMER_SERVO TIM5 -#define TIMER_SERIAL TIM7 +#define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file +#define TIMER_SERIAL TIM7 // TIMER_SERIAL must be defined in this file // UART Definitions //#define SERIAL_UART_INSTANCE 1 // Connected to EXP3 header diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/variant.h index 11ebf561f36c..b5cf0bad9d50 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/variant.h @@ -255,9 +255,9 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c -#define TIMER_TONE TIM2 -#define TIMER_SERVO TIM5 // Only 1 Servo PIN on SKR-PRO, so use the same timer as defined in PeripheralPins -#define TIMER_SERIAL TIM7 +#define TIMER_TONE TIM2 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM5 // Only 1 Servo PIN on SKR-PRO, so use the same timer as defined in PeripheralPins +#define TIMER_SERIAL TIM7 // TIMER_SERIAL must be defined in this file // UART Definitions //#define ENABLE_HWSERIAL1 done automatically by the #define SERIAL_UART_INSTANCE below diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h index 74f29514a885..285ad662e0fe 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h @@ -157,9 +157,9 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c -#define TIMER_TONE TIM2 -#define TIMER_SERVO TIM5 -#define TIMER_SERIAL TIM7 +#define TIMER_TONE TIM2 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file +#define TIMER_SERIAL TIM7 // TIMER_SERIAL must be defined in this file // UART1 for TFT port #define ENABLE_HWSERIAL1 diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h index 333bb02e5a22..8f17d052bba9 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h @@ -126,10 +126,10 @@ extern "C" { // Timer Definitions #ifndef TIMER_TONE - #define TIMER_TONE TIM3 + #define TIMER_TONE TIM3 // TIMER_TONE must be defined in this file #endif #ifndef TIMER_SERVO - #define TIMER_SERVO TIM2 + #define TIMER_SERVO TIM2 // TIMER_SERVO must be defined in this file #endif // UART Definitions diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h index 56ae719077ce..e64272745b9d 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h @@ -121,9 +121,9 @@ extern "C" { #define TEMP_TIMER 3 // Leave TIMER 4 for TFT backlight PWM or Servo freq... #define STEP_TIMER 5 -#define TIMER_TONE TIM6 -#define TIMER_SERVO TIM7 -#define TIMER_SERIAL TIM8 +#define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM7 // TIMER_SERVO must be defined in this file +#define TIMER_SERIAL TIM8 // TIMER_SERIAL must be defined in this file // UART Definitions // Define here Serial instance number to map on Serial generic name diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h index 496d8817a181..e01d67fd59c1 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h @@ -133,10 +133,10 @@ extern "C" { // Timer Definitions (optional) // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin #ifndef TIMER_TONE - #define TIMER_TONE TIM6 + #define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file #endif #ifndef TIMER_SERVO - #define TIMER_SERVO TIM7 + #define TIMER_SERVO TIM7 // TIMER_SERVO must be defined in this file #endif // UART Definitions diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h index fb878f8b78f3..330a7efbf83a 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h @@ -177,8 +177,8 @@ extern "C" { // Timer Definitions (optional) // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin -#define TIMER_TONE TIM6 -#define TIMER_SERVO TIM7 +#define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM7 // TIMER_SERVO must be defined in this file // UART Definitions // Define here Serial instance number to map on Serial generic name diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h index 3eed1473093c..df8bf064fca1 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h @@ -299,10 +299,10 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c -#define TIMER_TONE TIM6 +#define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file // Do not use basic timer: OC is required -#define TIMER_SERVO TIM2 //TODO: advanced-control timers don't work +#define TIMER_SERVO TIM2 // TODO: advanced-control timers don't work // UART Definitions // Define here Serial instance number to map on Serial generic name diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.h index f00cc5f61235..855616f66b4a 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.h @@ -134,15 +134,15 @@ extern "C" { // Timer Definitions // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin #ifndef TIMER_TONE -#define TIMER_TONE TIM6 + #define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file #endif #ifndef TIMER_SERVO -#define TIMER_SERVO TIM7 + #define TIMER_SERVO TIM7 // TIMER_SERVO must be defined in this file #endif #ifndef TIMER_SERIAL -#define TIMER_SERIAL TIM9 + #define TIMER_SERIAL TIM9 // TIMER_SERIAL must be defined in this file #endif // UART Definitions diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h index 94fa79c065d8..ba145d058cb3 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h @@ -153,13 +153,13 @@ extern "C" { // Timer Definitions // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin #ifndef TIMER_TONE - #define TIMER_TONE TIM6 + #define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file #endif #ifndef TIMER_SERVO - #define TIMER_SERVO TIM7 + #define TIMER_SERVO TIM7 // TIMER_SERVO must be defined in this file #endif #ifndef TIMER_SERIAL - #define TIMER_SERIAL TIM5 + #define TIMER_SERIAL TIM5 // TIMER_SERIAL must be defined in this file #endif // UART Definitions diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h index fd9a5c7741b4..2bfce85e21f9 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h @@ -185,10 +185,10 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c -#define TIMER_TONE TIM6 +#define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file // Do not use basic timer: OC is required -#define TIMER_SERVO TIM1 //TODO: advanced-control timers don't work +#define TIMER_SERVO TIM1 // TODO: advanced-control timers don't work // UART Definitions // Define here Serial instance number to map on Serial generic name diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.h index bcd5aa378edf..d4982113a010 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.h @@ -93,17 +93,15 @@ extern "C" { #define PIN_SPI_MISO PA6 #define PIN_SPI_SCK PA5 - // Timer Definitions -#define TIMER_TONE TIM2 -#define TIMER_SERVO TIM5 -#define TIMER_SERIAL TIM11 +#define TIMER_TONE TIM2 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file +#define TIMER_SERIAL TIM11 // TIMER_SERIAL must be defined in this file // UART Definitions //#define ENABLE_HWSERIAL1 done automatically by the #define SERIAL_UART_INSTANCE below #define ENABLE_HWSERIAL2 - // Define here Serial instance number to map on Serial generic name (if not already used by SerialUSB) #define SERIAL_UART_INSTANCE 1 //1 for Serial = Serial1 (USART1) @@ -148,4 +146,4 @@ extern "C" { #define SERIAL_PORT_HARDWARE_OPEN Serial2 #endif -#endif /* _VARIANT_ARDUINO_STM32_ */ \ No newline at end of file +#endif /* _VARIANT_ARDUINO_STM32_ */ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h index 4bd5b63dfe56..4f77dc688f35 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h @@ -133,9 +133,9 @@ extern "C" { // Timer Definitions // Do not use timer used by PWM pin. See PinMap_PWM. -#define TIMER_TONE TIM6 -#define TIMER_SERVO TIM5 -#define TIMER_SERIAL TIM7 +#define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file +#define TIMER_SERIAL TIM7 // TIMER_SERIAL must be defined in this file // UART Definitions //#define SERIAL_UART_INSTANCE 1 // Connected to EXP3 header diff --git a/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h index d82f0006553f..e7bc7c0bc1db 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h @@ -183,7 +183,7 @@ extern "C" { // Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c // FANs may require PWM timers 3 10 11 13 // The LED/RGB connectors timer 4 -// Beware: STEP_TIMER default is 6 and TEMP_TIMER 14 for the F407 +// Beware: MCU_TIMER_STEP default is 6 and MCU_TIMER_TEMP 14 for the F407 #ifndef TIMER_TONE #define TIMER_TONE TIM8 // TIM3 or TIM8 for SPEAKER compat on the lerdge K (PC6) #endif // TIM4 for that on the Lerdge S (PD11) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h index 2fee15ba3b64..30c3d953494f 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h @@ -103,8 +103,8 @@ extern "C" { // Timer Definitions // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin -#define TIMER_TONE TIM5 -#define TIMER_SERVO TIM4 +#define TIMER_TONE TIM5 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM4 // TIMER_SERVO must be defined in this file // UART Definitions // Define here Serial instance number to map on Serial generic name From a07d7e4b8ab0cdc19ea6f88cc1fc8be4e8294fd7 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Fri, 4 Feb 2022 13:33:52 -0600 Subject: [PATCH 079/502] =?UTF-8?q?=F0=9F=8D=BB=20STM32=20set=5Fpwm=5Fduty?= =?UTF-8?q?=20"on/off"=20for=20digital=20pins=20(#23665)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32/fast_pwm.cpp | 45 ++++++++++--------- Marlin/src/HAL/STM32F1/fast_pwm.cpp | 21 +++++---- .../variant_MARLIN_STM32G0B1RE.h | 4 +- 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/Marlin/src/HAL/STM32/fast_pwm.cpp b/Marlin/src/HAL/STM32/fast_pwm.cpp index f661e11350ef..590c9dbe3da6 100644 --- a/Marlin/src/HAL/STM32/fast_pwm.cpp +++ b/Marlin/src/HAL/STM32/fast_pwm.cpp @@ -30,30 +30,35 @@ static uint16_t timer_freq[TIMER_NUM]; void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { - if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer - const PinName pin_name = digitalPinToPinName(pin); - TIM_TypeDef * const Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); + const uint16_t duty = invert ? v_size - v : v; + if (PWM_PIN(pin)) { + const PinName pin_name = digitalPinToPinName(pin); + TIM_TypeDef * const Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); - const timer_index_t index = get_timer_index(Instance); - const bool needs_freq = (HardwareTimer_Handle[index] == nullptr); - if (needs_freq) // A new instance must be set to the default frequency of PWM_FREQUENCY - HardwareTimer_Handle[index]->__this = new HardwareTimer((TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM)); + const timer_index_t index = get_timer_index(Instance); + const bool needs_freq = (HardwareTimer_Handle[index] == nullptr); + if (needs_freq) // A new instance must be set to the default frequency of PWM_FREQUENCY + HardwareTimer_Handle[index]->__this = new HardwareTimer((TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM)); - HardwareTimer * const HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this); - const uint32_t channel = STM_PIN_CHANNEL(pinmap_function(pin_name, PinMap_PWM)); - const TimerModes_t previousMode = HT->getMode(channel); - if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) - HT->setMode(channel, TIMER_OUTPUT_COMPARE_PWM1, pin); + HardwareTimer * const HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this); + const uint32_t channel = STM_PIN_CHANNEL(pinmap_function(pin_name, PinMap_PWM)); + const TimerModes_t previousMode = HT->getMode(channel); + if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) + HT->setMode(channel, TIMER_OUTPUT_COMPARE_PWM1, pin); - if (needs_freq && timer_freq[index] == 0) // If the timer is unconfigured and no freq is set then default PWM_FREQUENCY - set_pwm_frequency(pin_name, PWM_FREQUENCY); // Set the frequency and save the value to the assigned index no. + if (needs_freq && timer_freq[index] == 0) // If the timer is unconfigured and no freq is set then default PWM_FREQUENCY + set_pwm_frequency(pin_name, PWM_FREQUENCY); // Set the frequency and save the value to the assigned index no. - // Note the resolution is sticky here, the input can be upto 16 bits and that would require RESOLUTION_16B_COMPARE_FORMAT (16) - // If such a need were to manifest then we would need to calc the resolution based on the v_size parameter and add code for it. - const uint16_t value = invert ? v_size - v : v; - HT->setCaptureCompare(channel, value, RESOLUTION_8B_COMPARE_FORMAT); // Sets the duty, the calc is done in the library :) - pinmap_pinout(pin_name, PinMap_PWM); // Make sure the pin output state is set. - if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) HT->resume(); + // Note the resolution is sticky here, the input can be upto 16 bits and that would require RESOLUTION_16B_COMPARE_FORMAT (16) + // If such a need were to manifest then we would need to calc the resolution based on the v_size parameter and add code for it. + HT->setCaptureCompare(channel, duty, RESOLUTION_8B_COMPARE_FORMAT); // Set the duty, the calc is done in the library :) + pinmap_pinout(pin_name, PinMap_PWM); // Make sure the pin output state is set. + if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) HT->resume(); + } + else { + pinMode(pin, OUTPUT); + digitalWrite(pin, duty < v_size / 2 ? LOW : HIGH); + } } void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { diff --git a/Marlin/src/HAL/STM32F1/fast_pwm.cpp b/Marlin/src/HAL/STM32F1/fast_pwm.cpp index c783dda60683..13411d9af084 100644 --- a/Marlin/src/HAL/STM32F1/fast_pwm.cpp +++ b/Marlin/src/HAL/STM32F1/fast_pwm.cpp @@ -39,16 +39,19 @@ inline uint8_t timer_and_index_for_pin(const pin_t pin, timer_dev **timer_ptr) { } void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { - if (!PWM_PIN(pin)) return; - - timer_dev *timer; UNUSED(timer); - if (timer_freq[timer_and_index_for_pin(pin, &timer)] == 0) - set_pwm_frequency(pin, PWM_FREQUENCY); - - const uint8_t channel = PIN_MAP[pin].timer_channel; const uint16_t duty = invert ? v_size - v : v; - timer_set_compare(timer, channel, duty); - timer_set_mode(timer, channel, TIMER_PWM); // PWM Output Mode + if (PWM_PIN(pin)) { + timer_dev *timer; UNUSED(timer); + if (timer_freq[timer_and_index_for_pin(pin, &timer)] == 0) + set_pwm_frequency(pin, PWM_FREQUENCY); + const uint8_t channel = PIN_MAP[pin].timer_channel; + timer_set_compare(timer, channel, duty); + timer_set_mode(timer, channel, TIMER_PWM); // PWM Output Mode + } + else { + pinMode(pin, OUTPUT); + digitalWrite(pin, duty < v_size / 2 ? LOW : HIGH); + } } void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { diff --git a/buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h b/buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h index 65aff2ce27b1..9cb3d45a0d95 100644 --- a/buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h +++ b/buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h @@ -150,10 +150,10 @@ // Timer Definitions // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin #ifndef TIMER_TONE - #define TIMER_TONE TIM6 + #define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file #endif #ifndef TIMER_SERVO - #define TIMER_SERVO TIM7 + #define TIMER_SERVO TIM7 // TIMER_SERVO must be defined in this file #endif // UART Definitions From b2d0f2fd8c1b5eea4be90163b71895651b93d851 Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Fri, 4 Feb 2022 13:34:48 -0600 Subject: [PATCH 080/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20RUMBA=20+=20MKS=20?= =?UTF-8?q?Mini12864=20Neopixel=20pin=20(#23646)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/ramps/pins_RUMBA.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/ramps/pins_RUMBA.h b/Marlin/src/pins/ramps/pins_RUMBA.h index d8e2dd09715f..7d17bf2e12ed 100644 --- a/Marlin/src/pins/ramps/pins_RUMBA.h +++ b/Marlin/src/pins/ramps/pins_RUMBA.h @@ -220,7 +220,7 @@ #define RGB_LED_B_PIN 40 #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 25 + #define NEOPIXEL_PIN 38 #endif #else From 15eabba11d3f0cc3c772e865719802d779a1f21e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 4 Feb 2022 15:49:39 -0600 Subject: [PATCH 081/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Rel?= =?UTF-8?q?ocate=20a=20variant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/boards/marlin_STM32G0B1RE.json | 2 +- .../variants/{STM32G0xx => }/MARLIN_G0B1RE/PeripheralPins.c | 0 .../variants/{STM32G0xx => }/MARLIN_G0B1RE/PinNamesVar.h | 0 .../variants/{STM32G0xx => }/MARLIN_G0B1RE/ldscript.ld | 0 .../MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp | 0 .../{STM32G0xx => }/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h | 0 6 files changed, 1 insertion(+), 1 deletion(-) rename buildroot/share/PlatformIO/variants/{STM32G0xx => }/MARLIN_G0B1RE/PeripheralPins.c (100%) rename buildroot/share/PlatformIO/variants/{STM32G0xx => }/MARLIN_G0B1RE/PinNamesVar.h (100%) rename buildroot/share/PlatformIO/variants/{STM32G0xx => }/MARLIN_G0B1RE/ldscript.ld (100%) rename buildroot/share/PlatformIO/variants/{STM32G0xx => }/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp (100%) rename buildroot/share/PlatformIO/variants/{STM32G0xx => }/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h (100%) diff --git a/buildroot/share/PlatformIO/boards/marlin_STM32G0B1RE.json b/buildroot/share/PlatformIO/boards/marlin_STM32G0B1RE.json index 86f632f53b8d..28c3451b4cdb 100644 --- a/buildroot/share/PlatformIO/boards/marlin_STM32G0B1RE.json +++ b/buildroot/share/PlatformIO/boards/marlin_STM32G0B1RE.json @@ -9,7 +9,7 @@ }, "mcu": "stm32g0b1ret6", "product_line": "STM32G0B1xx", - "variant": "STM32G0xx/MARLIN_G0B1RE" + "variant": "MARLIN_G0B1RE" }, "debug": { "default_tools": [ diff --git a/buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/PeripheralPins.c similarity index 100% rename from buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/PeripheralPins.c rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/PinNamesVar.h similarity index 100% rename from buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/PinNamesVar.h rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/PinNamesVar.h diff --git a/buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/ldscript.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/ldscript.ld rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/ldscript.ld diff --git a/buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp diff --git a/buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h similarity index 100% rename from buildroot/share/PlatformIO/variants/STM32G0xx/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h From 21935b41f076eb04bd851f35b31657e79db6584c Mon Sep 17 00:00:00 2001 From: Bones <97494397+SidSkiba@users.noreply.github.com> Date: Fri, 4 Feb 2022 14:52:57 -0700 Subject: [PATCH 082/502] =?UTF-8?q?=E2=9C=A8=20Add=20ZRIB=20v53,=20patch?= =?UTF-8?q?=20G35=20Z=20drop,=20related=20issues=20(#23636)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 3 + Marlin/src/core/boards.h | 1 + Marlin/src/gcode/bedlevel/G35.cpp | 4 +- Marlin/src/lcd/marlinui.cpp | 3 +- Marlin/src/lcd/thermistornames.h | 4 + Marlin/src/module/thermistor/thermistor_504.h | 93 ++++ Marlin/src/module/thermistor/thermistor_505.h | 82 +++ Marlin/src/module/thermistor/thermistors.h | 6 + Marlin/src/pins/pins.h | 2 + Marlin/src/pins/ramps/pins_ZRIB_V52.h | 216 ++++---- Marlin/src/pins/ramps/pins_ZRIB_V53.h | 511 ++++++++++++++++++ Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h | 2 +- 12 files changed, 816 insertions(+), 111 deletions(-) create mode 100644 Marlin/src/module/thermistor/thermistor_504.h create mode 100644 Marlin/src/module/thermistor/thermistor_505.h create mode 100644 Marlin/src/pins/ramps/pins_ZRIB_V53.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index a0dae835931b..51665804443d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -436,6 +436,9 @@ * 5 : 100kΩ ATC Semitec 104GT-2/104NT-4-R025H42G - Used in ParCan, J-Head, and E3D, SliceEngineering 300°C * 501 : 100kΩ Zonestar - Tronxy X3A * 502 : 100kΩ Zonestar - used by hot bed in Zonestar Průša P802M + * 503 : 100kΩ Zonestar (Z8XM2) Heated Bed thermistor + * 504 : 100kΩ Zonestar P802QR2 (Part# QWG-104F-B3950) Hotend Thermistor + * 505 : 100kΩ Zonestar P802QR2 (Part# QWG-104F-3950) Bed Thermistor * 512 : 100kΩ RPW-Ultra hotend * 6 : 100kΩ EPCOS - Not as accurate as table #1 (created using a fluke thermocouple) * 7 : 100kΩ Honeywell 135-104LAG-J01 diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 8d3a53258ab5..a5460d7b1de3 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -115,6 +115,7 @@ #define BOARD_RAMPS_S_12_EFFB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed) #define BOARD_LONGER3D_LK1_PRO 1160 // Longer LK1 PRO / Alfawise U20 Pro (PRO version) #define BOARD_LONGER3D_LKx_PRO 1161 // Longer LKx PRO / Alfawise Uxx Pro (PRO version) +#define BOARD_ZRIB_V53 1162 // Zonestar zrib V5.3 (Chinese RAMPS replica) // // RAMBo and derivatives diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index 8cabb923825a..4dd1323a6c29 100644 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -106,7 +106,9 @@ void GcodeSuite::G35() { // In BLTOUCH HS mode, the probe travels in a deployed state. // Users of G35 might have a badly misaligned bed, so raise Z by the // length of the deployed pin (BLTOUCH stroke < 7mm) - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES + TERN0(BLTOUCH, bltouch.z_extra_clearance())); + + // Unsure if this is even required. The probe seems to lift correctly after probe done. + do_blocking_move_to_z(SUM_TERN(BLTOUCH, Z_CLEARANCE_BETWEEN_PROBES, bltouch.z_extra_clearance())); const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE, 0, true); if (isnan(z_probed_height)) { diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index f2fce1c8cdb9..7acc3091ed45 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -704,7 +704,8 @@ void MarlinUI::init() { TERN_(HAS_MARLINUI_MENU, refresh()); #if HAS_ENCODER_ACTION - if (clear_buttons) buttons = 0; + if (clear_buttons) + TERN_(HAS_ADC_BUTTONS, keypad_buttons =) buttons = 0; next_button_update_ms = millis() + 500; #else UNUSED(clear_buttons); diff --git a/Marlin/src/lcd/thermistornames.h b/Marlin/src/lcd/thermistornames.h index 4f6dd23ece90..2571efe0759c 100644 --- a/Marlin/src/lcd/thermistornames.h +++ b/Marlin/src/lcd/thermistornames.h @@ -70,6 +70,10 @@ #define THERMISTOR_NAME "Zonestar (P802M Hot Bed)" #elif THERMISTOR_ID == 503 #define THERMISTOR_NAME "Zonestar (Z8XM2 Bed)" +#elif THERMISTOR_ID == 504 + #define THERMISTOR_NAME "Zonestar (P802QR2 Hot End)" +#elif THERMISTOR_ID == 505 + #define THERMISTOR_NAME "Zonestar (P802QR2 Bed)" #elif THERMISTOR_ID == 512 #define THERMISTOR_NAME "RPW-Ultra" #elif THERMISTOR_ID == 6 diff --git a/Marlin/src/module/thermistor/thermistor_504.h b/Marlin/src/module/thermistor/thermistor_504.h new file mode 100644 index 000000000000..61ce3ae1358c --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_504.h @@ -0,0 +1,93 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// QWG 104F B3950 thermistor +constexpr temp_entry_t temptable_504[] PROGMEM = { + { OV( 15), 330 }, + { OV( 17), 315 }, + { OV( 19), 300 }, + { OV( 20), 295 }, + { OV( 21), 290 }, + { OV( 23), 285 }, + { OV( 25), 280 }, + { OV( 27), 275 }, + { OV( 28), 270 }, + { OV( 31), 265 }, + { OV( 33), 260 }, + { OV( 35), 255 }, + { OV( 38), 250 }, + { OV( 41), 245 }, + { OV( 44), 240 }, + { OV( 48), 235 }, + { OV( 52), 230 }, + { OV( 56), 225 }, + { OV( 61), 220 }, + { OV( 66), 215 }, + { OV( 78), 210 }, + { OV( 92), 205 }, + { OV( 100), 200 }, + { OV( 109), 195 }, + { OV( 120), 190 }, + { OV( 143), 185 }, + { OV( 148), 180 }, + { OV( 156), 175 }, + { OV( 171), 170 }, + { OV( 187), 165 }, + { OV( 205), 160 }, + { OV( 224), 155 }, + { OV( 268), 150 }, + { OV( 293), 145 }, + { OV( 320), 140 }, + { OV( 348), 135 }, + { OV( 379), 130 }, + { OV( 411), 125 }, + { OV( 445), 120 }, + { OV( 480), 115 }, + { OV( 516), 110 }, + { OV( 553), 105 }, + { OV( 591), 100 }, + { OV( 628), 95 }, + { OV( 665), 90 }, + { OV( 702), 85 }, + { OV( 737), 80 }, + { OV( 770), 75 }, + { OV( 801), 70 }, + { OV( 830), 65 }, + { OV( 857), 60 }, + { OV( 881), 55 }, + { OV( 903), 50 }, + { OV( 922), 45 }, + { OV( 939), 40 }, + { OV( 954), 35 }, + { OV( 966), 30 }, + { OV( 977), 25 }, + { OV( 985), 23 }, + { OV( 993), 20 }, + { OV( 999), 18 }, + { OV(1004), 15 }, + { OV(1008), 12 }, + { OV(1012), 8 }, + { OV(1016), 5 }, + { OV(1020), 0 }, + { OV(1023), -5 } +}; diff --git a/Marlin/src/module/thermistor/thermistor_505.h b/Marlin/src/module/thermistor/thermistor_505.h new file mode 100644 index 000000000000..6c94b0e1b456 --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_505.h @@ -0,0 +1,82 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// ZONESTAR hotbed QWG-104F-3950 thermistor +constexpr temp_entry_t temptable_505[] PROGMEM = { + { OV( 1), 938 }, + { OV( 8), 320 }, + { OV( 16), 300 }, + { OV( 27), 290 }, + { OV( 36), 272 }, + { OV( 47), 258 }, + { OV( 56), 248 }, + { OV( 68), 245 }, + { OV( 78), 237 }, + { OV( 89), 228 }, + { OV( 99), 221 }, + { OV( 110), 215 }, + { OV( 120), 209 }, + { OV( 131), 204 }, + { OV( 141), 199 }, + { OV( 151), 195 }, + { OV( 161), 190 }, + { OV( 171), 187 }, + { OV( 181), 183 }, + { OV( 201), 179 }, + { OV( 221), 170 }, + { OV( 251), 165 }, + { OV( 261), 160 }, + { OV( 321), 150 }, + { OV( 361), 144 }, + { OV( 401), 140 }, + { OV( 421), 133 }, + { OV( 451), 130 }, + { OV( 551), 120 }, + { OV( 571), 117 }, + { OV( 596), 110 }, + { OV( 626), 105 }, + { OV( 666), 100 }, + { OV( 677), 95 }, + { OV( 697), 90 }, + { OV( 717), 85 }, + { OV( 727), 79 }, + { OV( 750), 72 }, + { OV( 789), 69 }, + { OV( 819), 65 }, + { OV( 861), 57 }, + { OV( 870), 55 }, + { OV( 881), 51 }, + { OV( 911), 45 }, + { OV( 922), 39 }, + { OV( 968), 28 }, + { OV( 977), 25 }, + { OV( 985), 23 }, + { OV( 993), 20 }, + { OV( 999), 18 }, + { OV(1004), 15 }, + { OV(1008), 12 }, + { OV(1012), 8 }, + { OV(1016), 5 }, + { OV(1020), 0 }, + { OV(1023), -5 } +}; diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 002beea5b535..3d9ef5062d50 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -78,6 +78,12 @@ typedef struct { int16_t value; celsius_t celsius; } temp_entry_t; #if ANY_THERMISTOR_IS(503) // Zonestar (Z8XM2) Heated Bed thermistor #include "thermistor_503.h" #endif +#if ANY_THERMISTOR_IS(504) // Zonestar (P802QR2 Hot End) thermistors + #include "thermistor_504.h" +#endif +#if ANY_THERMISTOR_IS(505) // Zonestar (P802QR2 Bed) thermistor + #include "thermistor_505.h" +#endif #if ANY_THERMISTOR_IS(512) // 100k thermistor in RPW-Ultra hotend, Pull-up = 4.7 kOhm, "unknown model" #include "thermistor_512.h" #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 07acd0b12274..8c69bccc2e44 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -123,6 +123,8 @@ #include "ramps/pins_ZRIB_V20.h" // ATmega2560, ATmega1280 env:mega2560 env:mega1280 #elif MB(ZRIB_V52) #include "ramps/pins_ZRIB_V52.h" // ATmega2560, ATmega1280 env:mega2560 env:mega1280 +#elif MB(ZRIB_V53) + #include "ramps/pins_ZRIB_V53.h" // ATmega2560, ATmega1280 env:mega2560 env:mega1280 #elif MB(FELIX2) #include "ramps/pins_FELIX2.h" // ATmega2560, ATmega1280 env:mega2560 env:mega1280 #elif MB(RIGIDBOARD) diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V52.h b/Marlin/src/pins/ramps/pins_ZRIB_V52.h index 27f043914f07..002b9dbef580 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V52.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V52.h @@ -49,111 +49,111 @@ #include "pins_MKS_BASE_common.h" // ... RAMPS -/* - Available connectors on MKS BASE v1.4 (Basically same as ZRIB V5.2) - - ======= - | GND | - |-----| E0 - | 10 | (10) PB4 ** Pin23 ** PWM10 - |-----| - | GND | - |-----| E1 - | 7 | ( 7) PH4 ** Pin16 ** PWM7 - |-----| - | GND | - |-----| FAN - | 9 | ( 9) PH6 ** Pin18 ** PWM9 - ======= - - ======= - | GND | - |-----| Heated Bed - | 8 | ( 8) PH5 ** Pin17 ** PWM8 - ======= - - ========== - | 12-24V | - |--------| Power - | GND | - ========== - - XS3 Connector - ================= - | 65 | GND | 5V | (65) PK3 ** Pin86 ** A11 - |----|-----|----| - | 66 | GND | 5V | (66) PK4 ** Pin85 ** A12 - ================= - - Servos Connector - ================= - | 11 | GND | 5V | (11) PB5 ** Pin24 ** PWM11 - |----|-----|----| - | 12 | GND | 5V | (12) PB6 ** Pin25 ** PWM12 - ================= - - ICSP - ================= - | 5V | 51 | GND | (51) PB2 ** Pin21 ** SPI_MOSI - |----|----|-----| - | 50 | 52 | RST | (50) PB3 ** Pin22 ** SPI_MISO - ================= (52) PB1 ** Pin20 ** SPI_SCK - - XS6/AUX-1 Connector - ====================== - | 5V | GND | NC | 20 | (20) PD1 ** Pin44 ** I2C_SDA - |----|-----|----|----| - | 50 | 51 | 52 | 21 | (50) PB3 ** Pin22 ** SPI_MISO - ====================== (51) PB2 ** Pin21 ** SPI_MOSI - (52) PB1 ** Pin20 ** SPI_SCK - (21) PD0 ** Pin43 ** I2C_SCL - - Temperature - ================================== - | GND | 69 | GND | 68 | GND | 67 | - ================================== - (69) PK7 ** Pin82 ** A15 - (68) PK6 ** Pin83 ** A14 - (67) PK5 ** Pin84 ** A13 - - Limit Switches - ============ - | 2 | GND | X+ ( 2) PE4 ** Pin6 ** PWM2 - |----|-----| - | 3 | GND | X- ( 3) PE5 ** Pin7 ** PWM3 - |----|-----| - | 15 | GND | Y+ (15) PJ0 ** Pin63 ** USART3_RX - |----|-----| - | 14 | GND | Y- (14) PJ1 ** Pin64 ** USART3_TX - |----|-----| - | 19 | GND | Z+ (19) PD2 ** Pin45 ** USART1_RX - |----|-----| - | 18 | GND | Z- (18) PD3 ** Pin46 ** USART1_TX - ============ - - EXP1 - ============ - | 37 | 35 | (37) PC0 ** Pin53 ** D37 - |-----|----| (35) PC2 ** Pin55 ** D35 - | 17 | 16 | (17) PH0 ** Pin12 ** USART2_RX - |-----|----| (16) PH1 ** Pin13 ** USART2_TX - | 23 | 25 | (23) PA1 ** Pin77 ** D23 - |-----|----| (25) PA3 ** Pin75 ** D25 - | 27 | 29 | (27) PA5 ** Pin73 ** D27 - |-----|----| (29) PA7 ** Pin71 ** D29 - | GND | 5V | - ============ - - EXP2 - ============ - | 50 | 52 | (50) PB3 ** Pin22 ** SPI_MISO - |-----|----| (52) PB1 ** Pin20 ** SPI_SCK - | 31 | 53 | (31) PC6 ** Pin59 ** D31 - |-----|----| (53) PB0 ** Pin19 ** SPI_SS - | 33 | 51 | (33) PC4 ** Pin57 ** D33 - |-----|----| (51) PB2 ** Pin21 ** SPI_MOSI - | 49 | 41 | (49) PL0 ** Pin35 ** D49 - |-----|----| (41) PG0 ** Pin51 ** D41 - | GND | NC | - ============ -*/ +/** + * Available connectors on MKS BASE v1.4 (Basically same as ZRIB V5.2) + * + * ======= + * | GND | + * |-----| E0 + * | 10 | (10) PB4 ** Pin23 ** PWM10 + * |-----| + * | GND | + * |-----| E1 + * | 7 | ( 7) PH4 ** Pin16 ** PWM7 + * |-----| + * | GND | + * |-----| FAN + * | 9 | ( 9) PH6 ** Pin18 ** PWM9 + * ======= + * + * ======= + * | GND | + * |-----| Heated Bed + * | 8 | ( 8) PH5 ** Pin17 ** PWM8 + * ======= + * + * ========== + * | 12-24V | + * |--------| Power + * | GND | + * ========== + * + * XS3 Connector + * ================= + * | 65 | GND | 5V | (65) PK3 ** Pin86 ** A11 + * |----|-----|----| + * | 66 | GND | 5V | (66) PK4 ** Pin85 ** A12 + * ================= + * + * Servos Connector + * ================= + * | 11 | GND | 5V | (11) PB5 ** Pin24 ** PWM11 + * |----|-----|----| + * | 12 | GND | 5V | (12) PB6 ** Pin25 ** PWM12 + * ================= + * + * ICSP + * ================= + * | 5V | 51 | GND | (51) PB2 ** Pin21 ** SPI_MOSI + * |----|----|-----| + * | 50 | 52 | RST | (50) PB3 ** Pin22 ** SPI_MISO + * ================= (52) PB1 ** Pin20 ** SPI_SCK + * + * XS6/AUX-1 Connector + * ====================== + * | 5V | GND | NC | 20 | (20) PD1 ** Pin44 ** I2C_SDA + * |----|-----|----|----| + * | 50 | 51 | 52 | 21 | (50) PB3 ** Pin22 ** SPI_MISO + * ====================== (51) PB2 ** Pin21 ** SPI_MOSI + * (52) PB1 ** Pin20 ** SPI_SCK + * (21) PD0 ** Pin43 ** I2C_SCL + * + * Temperature + * ================================== + * | GND | 69 | GND | 68 | GND | 67 | + * ================================== + * (69) PK7 ** Pin82 ** A15 + * (68) PK6 ** Pin83 ** A14 + * (67) PK5 ** Pin84 ** A13 + * + * Limit Switches + * ============ + * | 2 | GND | X+ ( 2) PE4 ** Pin6 ** PWM2 + * |----|-----| + * | 3 | GND | X- ( 3) PE5 ** Pin7 ** PWM3 + * |----|-----| + * | 15 | GND | Y+ (15) PJ0 ** Pin63 ** USART3_RX + * |----|-----| + * | 14 | GND | Y- (14) PJ1 ** Pin64 ** USART3_TX + * |----|-----| + * | 19 | GND | Z+ (19) PD2 ** Pin45 ** USART1_RX + * |----|-----| + * | 18 | GND | Z- (18) PD3 ** Pin46 ** USART1_TX + * ============ + * + * EXP1 + * ============ + * | 37 | 35 | (37) PC0 ** Pin53 ** D37 + * |-----|----| (35) PC2 ** Pin55 ** D35 + * | 17 | 16 | (17) PH0 ** Pin12 ** USART2_RX + * |-----|----| (16) PH1 ** Pin13 ** USART2_TX + * | 23 | 25 | (23) PA1 ** Pin77 ** D23 + * |-----|----| (25) PA3 ** Pin75 ** D25 + * | 27 | 29 | (27) PA5 ** Pin73 ** D27 + * |-----|----| (29) PA7 ** Pin71 ** D29 + * | GND | 5V | + * ============ + * + * EXP2 + * ============ + * | 50 | 52 | (50) PB3 ** Pin22 ** SPI_MISO + * |-----|----| (52) PB1 ** Pin20 ** SPI_SCK + * | 31 | 53 | (31) PC6 ** Pin59 ** D31 + * |-----|----| (53) PB0 ** Pin19 ** SPI_SS + * | 33 | 51 | (33) PC4 ** Pin57 ** D33 + * |-----|----| (51) PB2 ** Pin21 ** SPI_MOSI + * | 49 | 41 | (49) PL0 ** Pin35 ** D49 + * |-----|----| (41) PG0 ** Pin51 ** D41 + * | GND | NC | + * ============ + */ diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V53.h b/Marlin/src/pins/ramps/pins_ZRIB_V53.h new file mode 100644 index 000000000000..6cbc0351ba98 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_ZRIB_V53.h @@ -0,0 +1,511 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * ZRIB V5.3 Based on MKS BASE v1.4 with A4982 stepper drivers and digital micro-stepping + */ + +#include "env_validate.h" + +#if HOTENDS > 2 + #error "ZRIB V5.3 only supports up to 2 hotends. Comment out this line to continue." +#elif E_STEPPERS > 3 + #error "ZRIB V5.3 only supports up to 3 E-steppers. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "ZRIB V5.3" + +// +// PIN 12 Connector +// +#define PIN_12_PIN 12 + +// +// XS1 Connector +// +#define XS1_01_PIN 42 +#define XS1_03_PIN 43 +#define XS1_05_PIN 44 +#define XS1_07_PIN 45 +#define XS1_08_PIN 47 + +// +// XS6 Connector +// +#define XS6_01_PIN 20 +#define XS6_03_PIN 52 +#define XS6_05_PIN 51 +#define XS6_07_PIN 50 +#define XS6_08_PIN 21 + +// +// Servos / XS3 Connector +// +#ifndef SERVO0_PIN + #define SERVO0_PIN 11 // Analog Output +#endif +#ifndef SERVO1_PIN + #define SERVO1_PIN 12 // Analog Output +#endif + +// +// Limit Switches +// +#ifndef X_STOP_PIN + #ifndef X_MIN_PIN + #define X_MIN_PIN 3 + #endif + #ifndef X_MAX_PIN + #define X_MAX_PIN 2 + #endif +#endif +#ifndef Y_STOP_PIN + #ifndef Y_MIN_PIN + #define Y_MIN_PIN 14 + #endif + #ifndef Y_MAX_PIN + #define Y_MAX_PIN 15 + #endif +#endif +#ifndef Z_STOP_PIN + #ifndef Z_MIN_PIN + #define Z_MIN_PIN 18 + #endif + #ifndef Z_MAX_PIN + #define Z_MAX_PIN 19 + #endif +#endif + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 19 +#endif + +// +// Steppers +// +#define X_STEP_PIN 54 +#define X_DIR_PIN 55 +#define X_ENABLE_PIN 38 + +#define Y_STEP_PIN 60 +#define Y_DIR_PIN 61 +#define Y_ENABLE_PIN 56 + +#define Z_STEP_PIN 46 +#define Z_DIR_PIN 48 +#define Z_ENABLE_PIN 62 + +#if NUM_Z_STEPPER_DRIVERS == 2 + #define Z2_STEP_PIN 26 // E0 connector + #define Z2_DIR_PIN 28 + #define Z2_ENABLE_PIN 24 + + #define E0_STEP_PIN 36 // E1 connector + #define E0_DIR_PIN 34 + #define E0_ENABLE_PIN 30 + + #define E1_STEP_PIN 4 // E2 connector + #define E1_DIR_PIN 5 + #define E1_ENABLE_PIN 22 +#else + #define E0_STEP_PIN 26 + #define E0_DIR_PIN 28 + #define E0_ENABLE_PIN 24 + + #define E1_STEP_PIN 36 + #define E1_DIR_PIN 34 + #define E1_ENABLE_PIN 30 + + #define E2_STEP_PIN 4 + #define E2_DIR_PIN 5 + #define E2_ENABLE_PIN 22 +#endif + +// +// Temperature Sensors +// +#ifndef TEMP_0_PIN + #define TEMP_0_PIN 13 // Analog Input +#endif +#ifndef TEMP_1_PIN + #define TEMP_1_PIN 15 // Analog Input +#endif +#ifndef TEMP_BED_PIN + #define TEMP_BED_PIN 14 // Analog Input +#endif + +// +// Heaters / Fans Connectors +// + +#define HEATER_0_PIN 10 +#define HEATER_1_PIN 7 +#define FAN_PIN 9 +#define HEATER_BED_PIN 8 +#define FAN1_PIN 6 + +// +// Misc. Functions +// +#ifndef SDSS + #define SDSS 53 +#endif + +#define LED_PIN 13 + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN XS1_01_PIN +#endif + +#ifndef PS_ON_PIN + #define PS_ON_PIN XS1_03_PIN +#endif + +#if HAS_TMC_UART + /** + * TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + * + * Serial2 -- AUX-4 Pin 18 (D16 TX2) and AUX-4 Pin 17 (D17 RX2) + * Serial1 -- Pins D18 and D19 are used for Z-MIN and Z-MAX + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + #ifndef X_SERIAL_TX_PIN + #define X_SERIAL_TX_PIN XS1_08_PIN + #endif + #ifndef X_SERIAL_RX_PIN + #define X_SERIAL_RX_PIN PIN_12_PIN + #endif + #ifndef X2_SERIAL_TX_PIN + #define X2_SERIAL_TX_PIN -1 + #endif + #ifndef X2_SERIAL_RX_PIN + #define X2_SERIAL_RX_PIN -1 + #endif + + #ifndef Y_SERIAL_TX_PIN + #define Y_SERIAL_TX_PIN XS1_08_PIN + #endif + #ifndef Y_SERIAL_RX_PIN + #define Y_SERIAL_RX_PIN PIN_12_PIN + #endif + #ifndef Y2_SERIAL_TX_PIN + #define Y2_SERIAL_TX_PIN -1 + #endif + #ifndef Y2_SERIAL_RX_PIN + #define Y2_SERIAL_RX_PIN -1 + #endif + + #ifndef Z_SERIAL_TX_PIN + #define Z_SERIAL_TX_PIN XS1_08_PIN + #endif + #ifndef Z_SERIAL_RX_PIN + #define Z_SERIAL_RX_PIN PIN_12_PIN + #endif + #ifndef Z2_SERIAL_TX_PIN + #define Z2_SERIAL_TX_PIN XS1_08_PIN + #endif + #ifndef Z2_SERIAL_RX_PIN + #define Z2_SERIAL_RX_PIN PIN_12_PIN + #endif + + #ifndef E0_SERIAL_TX_PIN + #define E0_SERIAL_TX_PIN -1 + #endif + #ifndef E0_SERIAL_RX_PIN + #define E0_SERIAL_RX_PIN -1 + #endif + #ifndef E1_SERIAL_TX_PIN + #define E1_SERIAL_TX_PIN -1 + #endif + #ifndef E1_SERIAL_RX_PIN + #define E1_SERIAL_RX_PIN -1 + #endif + #ifndef E2_SERIAL_TX_PIN + #define E2_SERIAL_TX_PIN -1 + #endif + #ifndef E2_SERIAL_RX_PIN + #define E2_SERIAL_RX_PIN -1 + #endif + #ifndef E3_SERIAL_TX_PIN + #define E3_SERIAL_TX_PIN -1 + #endif + #ifndef E3_SERIAL_RX_PIN + #define E3_SERIAL_RX_PIN -1 + #endif + #ifndef E4_SERIAL_TX_PIN + #define E4_SERIAL_TX_PIN -1 + #endif + #ifndef E4_SERIAL_RX_PIN + #define E4_SERIAL_RX_PIN -1 + #endif + #ifndef E5_SERIAL_TX_PIN + #define E5_SERIAL_TX_PIN -1 + #endif + #ifndef E5_SERIAL_RX_PIN + #define E5_SERIAL_RX_PIN -1 + #endif + #ifndef E6_SERIAL_TX_PIN + #define E6_SERIAL_TX_PIN -1 + #endif + #ifndef E6_SERIAL_RX_PIN + #define E6_SERIAL_RX_PIN -1 + #endif + #ifndef E7_SERIAL_TX_PIN + #define E7_SERIAL_TX_PIN -1 + #endif + #ifndef E7_SERIAL_RX_PIN + #define E7_SERIAL_RX_PIN -1 + #endif +#endif + +/** + * LCD adapter. NOTE: These come in two variants. The socket keys can be + * on either side, and may be backwards on some displays. + * ------ ------ + * D37 |10 9 | D35 (MISO) D50 |10 9 | D52 (SCK) + * D17 | 8 7 | D16 D31 | 8 7 | D53 + * D23 6 5 D25 D33 6 5 D51 (MOSI) + * D27 | 4 3 | D29 D49 | 4 3 | D41 + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ + +#ifndef EXP1_03_PIN + #define EXP1_03_PIN 29 + #define EXP1_04_PIN 27 + #define EXP1_05_PIN 25 + #define EXP1_06_PIN 23 + #define EXP1_07_PIN 16 + #define EXP1_08_PIN 17 + #define EXP1_09_PIN 35 + #define EXP1_10_PIN 37 + + #define EXP2_03_PIN 41 + #define EXP2_04_PIN 49 + #define EXP2_05_PIN XS6_05_PIN + #define EXP2_06_PIN 33 + #define EXP2_07_PIN 53 + #define EXP2_08_PIN 31 + #define EXP2_09_PIN XS6_03_PIN + #define EXP2_10_PIN XS6_07_PIN +#endif + +////////////////////////// +// LCDs and Controllers // +////////////////////////// + +#if ENABLED(ZONESTAR_12864LCD) + #define LCDSCREEN_NAME "ZONESTAR LCD12864" + #define LCD_SDSS 16 + #define LCD_PINS_RS 16 // ST7920_CS_PIN LCD_PIN_RS (PIN4 of LCD module) + #define LCD_PINS_ENABLE 23 // ST7920_DAT_PIN LCD_PIN_R/W (PIN5 of LCD module) + #define LCD_PINS_D4 17 // ST7920_CLK_PIN LCD_PIN_ENABLE (PIN6 of LCD module) + #define BTN_EN2 25 + #define BTN_EN1 27 + #define BTN_ENC 29 + #define BEEPER_PIN 37 + #define KILL_PIN 35 +#elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define LCDSCREEN_NAME "Reprap LCD12864" + // Use EXP1 & EXP2 connector + #define LCD_PINS_RS 16 // ST7920_CS_PIN LCD_PIN_RS + #define LCD_PINS_ENABLE 17 // ST7920_DAT_PIN LCD_PIN_ENABLE + #define LCD_PINS_D4 23 // ST7920_CLK_PIN LCD_PIN_R/W + #define BTN_EN1 31 + #define BTN_EN2 33 + #define BTN_ENC 35 + #define BEEPER_PIN 37 + #define KILL_PIN 41 +#endif + +//================================================================================ +// OLED 128x64 +//================================================================================ + +#if EITHER(ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) + #define LCDSCREEN_NAME "ZONESTAR 12864OLED" + #define LCD_SDSS 16 + #define LCD_PINS_RS 23 // RESET Pull low for 1s to init + #define LCD_PINS_DC 17 + #define DOGLCD_CS 16 // CS + #define BTN_EN2 25 + #define BTN_EN1 27 + #define BTN_ENC 29 + #define BEEPER_PIN -1 + #define KILL_PIN -1 + #if EITHER(OLED_HW_IIC, OLED_HW_SPI) + #error "Oops! You must choose SW SPI for ZRIB V53 board and connect the OLED screen to EXP1 connector." + #else // SW_SPI + #define DOGLCD_A0 LCD_PINS_DC + #define DOGLCD_MOSI 35 // SDA + #define DOGLCD_SCK 37 // SCK + #endif +#endif // OLED 128x64 + +//================================================================================ +// LCD 2004 KEYPAD +//================================================================================ + +#if ENABLED(ZONESTAR_LCD) + #define LCDSCREEN_NAME "LCD2004 ADCKEY" + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + #define ADC_KEYPAD_PIN 10 // A10 for ADCKEY + #define BEEPER_PIN EXP1_10_PIN +#endif + +/** + * ZRIB V5.3 Main Board + * + * Available connectors on ZRIB V5.3 + * + * ======= + * | GND | + * |-----| E0 + * | 10 | (10) PB4 ** Pin23 ** PWM10 + * |-----| + * | GND | + * |-----| E1 + * | 7 | ( 7) PH4 ** Pin16 ** PWM7 + * |-----| + * | GND | + * |-----| FAN + * | 9 | ( 9) PH6 ** Pin18 ** PWM9 + * ======= + * ======= + * | GND | + * |-----| Heated Bed + * | 8 | ( 8) PH5 ** Pin17 ** PWM8 + * ======= + * ========== + * | 12-24V | + * |--------| Power + * | GND | + * ========== + * XS3 Connector + * ================= + * | 65 | GND | 5V | (65) PK3 ** Pin86 ** A11 + * |----|-----|----| + * | 66 | GND | 5V | (66) PK4 ** Pin85 ** A12 + * ================= + * XS3/Servos Connector + * ================= + * | 11 | GND | 5V | (11) PB5 ** Pin24 ** PWM11 + * |----|-----|----| + * | 12 | GND | 5V | (12) PB6 ** Pin25 ** PWM12 + * ================= + * ICSP + * ================= + * | 5V | 51 | GND | (51) PB2 ** Pin21 ** SPI_MOSI + * |----|----|-----| + * | 50 | 52 | RST | (50) PB3 ** Pin22 ** SPI_MISO + * ================= (52) PB1 ** Pin20 ** SPI_SCK + * XS6 Connector + * ====================== + * | 5V | GND | NC | 20 | (20) PD1 ** Pin44 ** I2C_SDA + * |----|-----|----|----| + * | 50 | 51 | 52 | 21 | (50) PB3 ** Pin22 ** SPI_MISO + * ====================== (51) PB2 ** Pin21 ** SPI_MOSI + * (52) PB1 ** Pin20 ** SPI_SCK + * (21) PD0 ** Pin43 ** I2C_SCL + * XS1 Connector + * ====================== + * | 5V | GND | NC | 47 | (47) PL2 ** Pin37 ** D47 + * |----|-----|----|----| + * | 42 | 43 | 44 | 45 | (45) PL4 ** Pin39 ** D45 + * ====================== (44) PL5 ** Pin40 ** D44 + * (43) PL6 ** Pin41 ** D43 + * (42) PL7 ** Pin42 ** D42 + * Temperature + * ================================== + * | GND | 69 | GND | 68 | GND | 67 | + * ================================== + * (69) PK7 ** Pin82 ** A15 + * (68) PK6 ** Pin83 ** A14 + * (67) PK5 ** Pin84 ** A13 + * Limit Switches + * ============ + * | 2 | GND | X+ ( 2) PE4 ** Pin6 ** PWM2 + * |----|-----| + * | 3 | GND | X- ( 3) PE5 ** Pin7 ** PWM3 + * |----|-----| + * | 15 | GND | Y+ (15) PJ0 ** Pin63 ** USART3_RX + * |----|-----| + * | 14 | GND | Y- (14) PJ1 ** Pin64 ** USART3_TX + * |----|-----| + * | 19 | GND | Z+ (19) PD2 ** Pin45 ** USART1_RX + * |----|-----| + * | 18 | GND | Z- (18) PD3 ** Pin46 ** USART1_TX + * ============ + * EXP1 + * ============ + * | 37 | 35 | (37) PC0 ** Pin53 ** D37 + * |-----|----| (35) PC2 ** Pin55 ** D35 + * | 17 | 16 | (17) PH0 ** Pin12 ** USART2_RX + * |-----|----| (16) PH1 ** Pin13 ** USART2_TX + * | 23 | 25 | (23) PA1 ** Pin77 ** D23 + * |-----|----| (25) PA3 ** Pin75 ** D25 + * | 27 | 29 | (27) PA5 ** Pin73 ** D27 + * |-----|----| (29) PA7 ** Pin71 ** D29 + * | GND | 5V | + * ============ + * EXP2 + * ============ + * | 50 | 52 | (50) PB3 ** Pin22 ** SPI_MISO + * |-----|----| (52) PB1 ** Pin20 ** SPI_SCK + * | 31 | 53 | (31) PC6 ** Pin59 ** D31 + * |-----|----| (53) PB0 ** Pin19 ** SPI_SS + * | 33 | 51 | (33) PC4 ** Pin57 ** D33 + * |-----|----| (51) PB2 ** Pin21 ** SPI_MOSI + * | 49 | 41 | (49) PL0 ** Pin35 ** D49 + * |-----|----| (41) PG0 ** Pin51 ** D41 + * | GND | NC | + * ============ + * + * PIN 12 + * ====== + * | 12 | (12) PB6 ** Pin25 ** D12 + * ====== +*/ diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h index 6ec5de4ba314..0cc3393ebc52 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -1,6 +1,6 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (C) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm From 50ffacfb90a672b6915ea407fce921c72be72a02 Mon Sep 17 00:00:00 2001 From: Bruno Henrique de Paula Date: Fri, 4 Feb 2022 18:57:43 -0300 Subject: [PATCH 083/502] =?UTF-8?q?=F0=9F=93=8C=20Distinct=20BOARD=5FCREAL?= =?UTF-8?q?ITY=5FV422=20(#23674)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/pins.h | 4 ++- Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h | 2 +- .../pins/stm32f1/pins_CREALITY_V24S1_301.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V422.h | 31 +++++++++++++++++++ Marlin/src/pins/stm32f1/pins_CREALITY_V423.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V427.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V431.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V452.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V453.h | 2 +- buildroot/share/scripts/upload.py | 10 +++--- 12 files changed, 49 insertions(+), 14 deletions(-) create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V422.h diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 8c69bccc2e44..54a7c3c610ac 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -559,10 +559,12 @@ #include "stm32f1/pins_CHITU3D_V6.h" // STM32F1 env:chitu_f103 env:chitu_f103_maple #elif MB(CHITU3D_V9) #include "stm32f1/pins_CHITU3D_V9.h" // STM32F1 env:chitu_f103 env:chitu_f103_maple -#elif MB(CREALITY_V4, CREALITY_V422) +#elif MB(CREALITY_V4) #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V4210) #include "stm32f1/pins_CREALITY_V4210.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple +#elif MB(CREALITY_V422) + #include "stm32f1/pins_CREALITY_V422.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V423) #include "stm32f1/pins_CREALITY_V423.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer #elif MB(CREALITY_V427) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h index ffd7baa00c4d..9d7e0f695b79 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h @@ -22,7 +22,7 @@ #pragma once /** - * Creality v2.4.S1 (STM32F103RE) v101 as found in the Ender 7 board pin assignments + * Creality v2.4.S1 (STM32F103RE / STM32F103RC) v101 as found in the Ender 7 board pin assignments */ #define BOARD_INFO_NAME "Creality v2.4.S1 V101" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h index 336754bc1a31..8616a8fb3406 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h @@ -22,7 +22,7 @@ #pragma once /** - * Creality V24S1_301 (STM32F103RCT) board pin assignments as found on Ender 3 S1 + * Creality V24S1_301 (STM32F103RE / STM32F103RC) board pin assignments as found on Ender 3 S1 */ #include "env_validate.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index 6122206d6a8e..d6d496624121 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -22,7 +22,7 @@ #pragma once /** - * Creality 4.2.x (STM32F103RET6) board pin assignments + * Creality 4.2.x (STM32F103RE / STM32F103RC) board pin assignments */ #include "env_validate.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h index 0cc3393ebc52..7bf34441bcf4 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -22,7 +22,7 @@ #pragma once /** - * CREALITY 4.2.10 (STM32F103) board pin assignments + * CREALITY 4.2.10 (STM32F103RE / STM32F103RC) board pin assignments */ #include "env_validate.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V422.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V422.h new file mode 100644 index 000000000000..5499adb07668 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V422.h @@ -0,0 +1,31 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * CREALITY v4.2.2 (STM32F103RE / STM32F103RC) board pin assignments + */ + +#define BOARD_INFO_NAME "Creality v4.2.2" +#define DEFAULT_MACHINE_NAME "Creality3D" + +#include "pins_CREALITY_V4.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V423.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V423.h index 186051c1fcb0..c174b0e56ed6 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V423.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V423.h @@ -22,7 +22,7 @@ #pragma once /** - * CREALITY v4.2.3 (STM32F103) board pin assignments + * CREALITY v4.2.3 (STM32F103RE / STM32F103RC) board pin assignments */ #define BOARD_INFO_NAME "Creality v4.2.3" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h index c327abee7796..077f4c73a657 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V427.h @@ -22,7 +22,7 @@ #pragma once /** - * CREALITY v4.2.7 (STM32F103) board pin assignments + * CREALITY v4.2.7 (STM32F103RE / STM32F103RC) board pin assignments */ #define BOARD_INFO_NAME "Creality v4.2.7" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V431.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V431.h index 2f1f2ffb4113..9226b537d91b 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V431.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V431.h @@ -22,7 +22,7 @@ #pragma once /** - * CREALITY v4.3.1 (STM32F103) board pin assignments + * CREALITY v4.3.1 (STM32F103RE / STM32F103RC) board pin assignments */ #define BOARD_INFO_NAME "Creality v4.3.1" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h index 9b6862d99bd4..ced64e2a893c 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V452.h @@ -22,7 +22,7 @@ #pragma once /** - * Creality v4.5.2 (STM32F103RET6) board pin assignments + * Creality v4.5.2 (STM32F103RE / STM32F103RC) board pin assignments */ #if HAS_MULTI_HOTEND || E_STEPPERS > 1 diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h index fd3ea93c32d3..e7296d1ed077 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V453.h @@ -22,7 +22,7 @@ #pragma once /** - * Creality v4.5.3 (STM32F103RET6) board pin assignments + * Creality v4.5.3 (STM32F103RE / STM32F103RC) board pin assignments */ #if HAS_MULTI_HOTEND || E_STEPPERS > 1 diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index ceb0db4f10ab..f6b25396adad 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -153,11 +153,13 @@ def _RemoveFirmwareFile(FirmwareFile): # Set local upload params based on board type to change script behavior # "upload_delete_old_bins": delete all *.bin files in the root of SD Card - upload_delete_old_bins = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V423', 'BOARD_CREALITY_V427', - 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', 'BOARD_CREALITY_V24S1'] + upload_delete_old_bins = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423', + 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', + 'BOARD_CREALITY_V24S1'] # "upload_random_name": generate a random 8.3 firmware filename to upload - upload_random_filename = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V423', 'BOARD_CREALITY_V427', - 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', 'BOARD_CREALITY_V24S1'] and not marlin_long_filename_host_support + upload_random_filename = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423', + 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', + 'BOARD_CREALITY_V24S1'] and not marlin_long_filename_host_support try: From 22db62d95a81ce67ea6157a3eb1957045de2b63a Mon Sep 17 00:00:00 2001 From: Kelroy Date: Sat, 5 Feb 2022 01:40:35 +0100 Subject: [PATCH 084/502] =?UTF-8?q?=E2=9C=A8=20SAMD51=20Bricolemon=20/=20B?= =?UTF-8?q?ricolemon=20Lite=20boards=20(#23658)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 2 + Marlin/src/pins/pins.h | 4 + .../src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h | 616 ++++++++++++++++ Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h | 676 ++++++++++++++++++ 4 files changed, 1298 insertions(+) create mode 100644 Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h create mode 100644 Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index a5460d7b1de3..21c0eaaf3045 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -443,6 +443,8 @@ // #define BOARD_AGCM4_RAMPS_144 6100 // RAMPS 1.4.4 +#define BOARD_BRICOLEMON_V1_0 6101 // Bricolemon +#define BOARD_BRICOLEMON_LITE_V1_0 6102 // Bricolemon Lite // // Custom board diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 54a7c3c610ac..4ba97a77a736 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -730,6 +730,10 @@ #elif MB(AGCM4_RAMPS_144) #include "samd/pins_RAMPS_144.h" // SAMD51 env:SAMD51_grandcentral_m4 +#elif MB(BRICOLEMON_V1_0) + #include "samd/pins_BRICOLEMON_V1_0.h" // SAMD51 env:SAMD51_grandcentral_m4 +#elif MB(BRICOLEMON_LITE_V1_0) + #include "samd/pins_BRICOLEMON_LITE_V1_0.h" // SAMD51 env:SAMD51_grandcentral_m4 // // Custom board (with custom PIO env) diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h new file mode 100644 index 000000000000..1e0efcf0b21d --- /dev/null +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h @@ -0,0 +1,616 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * BRICOLEMON LITE Board. Based on atsamd51 (AGCM4), bootloader and credits by ADAFRUIT. + * This board its a 3.3V LOGIC Board, following the ADAFRUIT example, all of the board is open source. + * Schematic: Refer to the Bricolemon + * 3DSTEP: https://github.com/bricogeek/bricolemon/blob/master/Documentacion/Bricolemon%20Lite/LC_BG_002_PCB_V1I4.step + * PinDemux: https://github.com/bricogeek/bricolemon/blob/master/Documentacion/Bricolemon/PinDEMUX.xlsx + * + * NOTE: We need the Serial port on the -1 to make it work!!. Remember to change it on configuration.h #define SERIAL_PORT -1 + */ + +#if NOT_TARGET(ARDUINO_GRAND_CENTRAL_M4) + #error "Oops! Select 'Adafruit Grand Central M4' in 'Tools > Board.'" +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "BRICOLEMON LITE V1.0" // , Lemoncrest & BricoGeek collaboration. +#endif + +/** + * EEPROM EMULATION: Works with some bugs already, but the board needs an I2C EEPROM memory soldered on. + */ +//#define FLASH_EEPROM_EMULATION +#define I2C_EEPROM // EEPROM on I2C-0 +#define MARLIN_EEPROM_SIZE 0x70000 // 512K (CAT24C512) + +// This is another option to emulate an EEPROM, but it's more efficient to not lose the data in the first place. +//#define SDCARD_EEPROM_EMULATION + +// +// BLTOUCH PIN: This pin is the signal pin for the BLTOUCH sensor. +// +#define SERVO0_PIN 33 // BLTouch PWM + +// +// Limit Switches +// +#define X_STOP_PIN 10 +#define Y_STOP_PIN 11 +#define Z_STOP_PIN 12 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 12 +#endif + +// +// Steppers +// +#define X_STEP_PIN 3 +#define X_DIR_PIN 22 +#define X_ENABLE_PIN 26 + +#define Y_STEP_PIN 4 +#define Y_DIR_PIN 23 +#define Y_ENABLE_PIN 27 + +#define Z_STEP_PIN 5 +#define Z_DIR_PIN 24 +#define Z_ENABLE_PIN 28 + +#define E0_STEP_PIN 2 +#define E0_DIR_PIN 25 +#define E0_ENABLE_PIN 29 + +// Filament runout. You may choose to use this pin for some other purpose. It's a normal GPIO that can be configured as I/O. +// For example, a switch to detect any kind of behavior, Power supply pin .... etc. +#define FIL_RUNOUT_PIN 32 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 1 +#define TEMP_BED_PIN 3 + +// +// Heaters / Fans +// +#define HEATER_0_PIN 6 +#define HEATER_BED_PIN 7 +#define FAN_PIN 8 +#define FAN1_PIN 9 + +// +// LCD / Controller +// + +/** + * Bricolemon Expansion connectors + * + * ------ ------ + * VCC | 1 2 | GND KILL | 1 2 | GND + * LCD7 | 3 4 | LCDD6 RESET | 3 4 | SD_DETECT + * LCD5 | 5 6 LCDD4 MOSI | 5 6 BTN_EN1 + * LCDRS | 7 8 | LCDDE SS | 7 8 | BTN_EN2 + * BTN_ENCODER | 9 10 | BEEPER SCLK | 9 10 | MISO + * ------ ------ + * EXP1 EXP2 + * + *- This extra connector is for a serial display like the MKS TFT. + * MKS TFT + * ------ + * RX0 | . . | NC + * TX0 | . . NC + * GND | . . GND + * 5B | . . | 5V + * ------ + * + *- Special mapping of EXP1 to EXP3 to work with Ender displays. + * + * Enable CR10_STOCKDISPLAY in Configuration.h and connect EXP1 to the display EXP3 with this mapping. + * ------ + * VCC | 1 2 | GND + * LCDDE | 3 4 | LCDRS + * LCDD4 | 5 6 BTN_EN2 + * RESET | 7 8 | BTN_EN1 + * BTN_ENCODER | 9 10 | BEEPER + * ------ + * + *- Digital pinout reference of the Bricolemon for advanced users/configurations. + * + * ------ ------ + * VCC | 1 2 | GND D49 | 1 2 | GND + * D39 | 3 4 | D38 RST | 3 4 | D44 + * D37 | 5 6 D36 D51 | 5 6 D42 + * D34 | 7 8 | D35 D53 | 7 8 | D43 + * D40 | 9 10 | D41 D52 | 9 10 | D50 + * ------ ------ + * EXP1 EXP2 + * + *- Pin table overview + * LCD--- SPI--- + * LCD4 36 MISO 50 + * LCD5 37 SS 53 + * LCD6 38 SCKL 52 + * LCD7 39 MOSI 51 + * LCDRS 34 BEEPER + * LCDDE 35 BEEP 41 + * ENCODER--- SD-CARD--- + * BTN_EN1 42 + * BTN_EN2 43 SD_DETECT 44 + * BTN_ENCODER 40 KILL_PIN 49 + */ + +#define EXP1_03_PIN 39 +#define EXP1_04_PIN 38 +#define EXP1_05_PIN 37 +#define EXP1_06_PIN 36 +#define EXP1_07_PIN 34 +#define EXP1_08_PIN 35 +#define EXP1_09_PIN 40 +#define EXP1_10_PIN 41 + +#define EXP2_01_PIN 49 +#define EXP2_04_PIN 44 +#define EXP2_05_PIN 51 +#define EXP2_06_PIN 42 +#define EXP2_07_PIN 53 +#define EXP2_08_PIN 43 +#define EXP2_09_PIN 52 +#define EXP2_10_PIN 50 + +#if ENABLED(CR10_STOCKDISPLAY) + #define EXP3_03_PIN EXP1_03_PIN + #define EXP3_04_PIN EXP1_04_PIN + #define EXP3_05_PIN EXP1_05_PIN + #define EXP3_06_PIN EXP1_06_PIN + #define EXP3_07_PIN EXP1_07_PIN + #define EXP3_08_PIN EXP1_08_PIN + #define EXP3_09_PIN EXP1_09_PIN + #define EXP3_10_PIN EXP1_10_PIN +#endif + +/************************************/ +/***** Configurations Section ******/ +/************************************/ + +/** + * This section starts with the pins_RAMPS_144.h as example, after if you need any new + * display, you could use normal duponts and connect it with with the scheme showed before. + * Tested: + * - Ender 3 Old display (Character LCD) + * - Ender 3 New Serial DWING Display + * - Reprap Display + * - Ender 5 New Serial Display + * - Any Reprap character display like + */ + +#if HAS_WIRED_LCD + + // + // LCD Display output pins + // + #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI + + #if LCD_SERIAL_PORT != 1 + #error "LCD_SERIAL_PORT should be 1 for this display." + #endif + + // DWIN Encoder + #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_07_PIN + + #ifndef BEEPER_PIN + #define BEEPER_PIN EXP1_10_PIN + #undef SPEAKER + #endif + + #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + // TO TEST + //#define LCD_PINS_RS EXP2_01_PIN // CS chip select /SS chip slave select + //#define LCD_PINS_ENABLE EXP2_05_PIN // SID (MOSI) + //#define LCD_PINS_D4 EXP2_09_PIN // SCK (CLK) clock + + #elif BOTH(IS_NEWPANEL, PANEL_ONE) + + // TO TEST + //#define LCD_PINS_RS EXP1_09_PIN + //#define LCD_PINS_ENABLE EXP2_06_PIN + //#define LCD_PINS_D4 57 // Mega/Due:65 - AGCM4:57 + //#define LCD_PINS_D5 58 // Mega/Due:66 - AGCM4:58 + //#define LCD_PINS_D6 EXP2_04_PIN + //#define LCD_PINS_D7 56 // Mega/Due:64 - AGCM4:56 + + #else + + #if ENABLED(CR10_STOCKDISPLAY) + + // TO TEST + #define LCD_PINS_RS EXP3_04_PIN + #define LCD_PINS_ENABLE EXP3_03_PIN + #define LCD_PINS_D4 EXP3_05_PIN + + #if !IS_NEWPANEL + // TO TEST + //#define BEEPER_PIN EXP3_05_PIN + #endif + + #elif ENABLED(ZONESTAR_LCD) + + // TO TEST + //#define LCD_PINS_RS 56 // Mega/Due:64 - AGCM4:56 + //#define LCD_PINS_ENABLE EXP2_04_PIN + //#define LCD_PINS_D4 55 // Mega/Due:63 - AGCM4:55 + //#define LCD_PINS_D5 EXP1_09_PIN + //#define LCD_PINS_D6 EXP2_06_PIN + //#define LCD_PINS_D7 57 // Mega/Due:65 - AGCM4:57 + + #else + + #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) + // TO TEST + //#define LCD_PINS_DC 25 // Set as output on init + //#define LCD_PINS_RS 27 // Pull low for 1s to init + // DOGM SPI LCD Support + //#define DOGLCD_CS 16 + //#define DOGLCD_MOSI 17 + //#define DOGLCD_SCK 23 + //#define DOGLCD_A0 LCD_PINS_DC + + + #else + // Definitions for any standard Display + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #endif + + #define LCD_PINS_D7 EXP1_03_PIN + + #if !IS_NEWPANEL + #define BEEPER_PIN EXP1_10_PIN + #endif + + #endif + + #if !IS_NEWPANEL + // Buttons attached to a shift register + // Not wired yet + //#define SHIFT_CLK_PIN EXP1_04_PIN + //#define SHIFT_LD_PIN EXP2_06_PIN + //#define SHIFT_OUT_PIN EXP1_09_PIN + //#define SHIFT_EN_PIN 17 + #endif + + #endif + + // + // LCD Display input pins + // + #if IS_NEWPANEL + + #if IS_RRD_SC + + #define BEEPER_PIN EXP1_10_PIN + + #if ENABLED(CR10_STOCKDISPLAY) + // TO TEST + #define BTN_EN1 EXP3_08_PIN + #define BTN_EN2 EXP3_06_PIN + + #else + // Definitions for any standard Display + #define BTN_EN1 EXP2_06_PIN + #define BTN_EN2 EXP2_08_PIN + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif + + #define BTN_ENC EXP1_09_PIN + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN EXP2_04_PIN + #endif + #define KILL_PIN EXP2_01_PIN + + #if ENABLED(BQ_LCD_SMART_CONTROLLER) + //#define LCD_BACKLIGHT_PIN EXP1_03_PIN // TO TEST + #endif + + #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + // TO TEST + //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 + //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 + //#define BTN_ENC 55 + //#define SD_DETECT_PIN EXP2_06_PIN + + #elif ENABLED(LCD_I2C_PANELOLU2) + + // TO TEST + //#define BTN_EN1 47 + //#define BTN_EN2 EXP2_08_PIN + //#define BTN_ENC 32 + //#define LCD_SDSS SDSS + //#define KILL_PIN EXP1_10_PIN + + #elif ENABLED(LCD_I2C_VIKI) + + // TO TEST + //#define BTN_EN1 EXP1_09_PIN // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + //#define BTN_EN2 EXP2_06_PIN + //#define BTN_ENC -1 + + //#define LCD_SDSS SDSS + //#define SD_DETECT_PIN EXP2_01_PIN + + #elif ANY(VIKI2, miniVIKI) + + // TO TEST + //#define DOGLCD_CS 45 + //#define DOGLCD_A0 EXP2_04_PIN + //#define LCD_SCREEN_ROT_180 + + //#define BEEPER_PIN 33 + //#define STAT_LED_RED_PIN 32 + //#define STAT_LED_BLUE_PIN EXP1_08_PIN + + //#define BTN_EN1 22 + //#define BTN_EN2 7 + //#define BTN_ENC EXP1_03_PIN + + //#define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board + //#define KILL_PIN 31 + + #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + + // TO TEST + //#define DOGLCD_CS 29 + //#define DOGLCD_A0 27 + + //#define BEEPER_PIN 23 + //#define LCD_BACKLIGHT_PIN 33 + + //#define BTN_EN1 EXP1_08_PIN + //#define BTN_EN2 EXP1_05_PIN + //#define BTN_ENC 31 + + //#define LCD_SDSS SDSS + //#define SD_DETECT_PIN EXP2_01_PIN + //#define KILL_PIN EXP1_10_PIN + + #elif EITHER(MKS_MINI_12864, FYSETC_MINI_12864) + + // TO TEST + //#define BEEPER_PIN EXP1_05_PIN + //#define BTN_ENC EXP1_08_PIN + //#define SD_DETECT_PIN EXP2_01_PIN + + //#ifndef KILL_PIN + // #define KILL_PIN EXP1_10_PIN + //#endif + + #if ENABLED(MKS_MINI_12864) + + // TO TEST + //#define DOGLCD_A0 27 + //#define DOGLCD_CS 25 + + // GLCD features + // Uncomment screen orientation + //#define LCD_SCREEN_ROT_90 + //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_270 + + // not connected to a pin + //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) + + //#define BTN_EN1 31 + //#define BTN_EN2 33 + + #elif ENABLED(FYSETC_MINI_12864) + + // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + + // TO TEST + //#define DOGLCD_A0 16 + //#define DOGLCD_CS 17 + + //#define BTN_EN1 33 + //#define BTN_EN2 31 + + //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems + // results in LCD soft SPI mode 3, SD soft SPI mode 0 + + //#define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally. + + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + // TO TEST + //#define RGB_LED_R_PIN 25 + #endif + #ifndef RGB_LED_G_PIN + // TO TEST + //#define RGB_LED_G_PIN 27 + #endif + #ifndef RGB_LED_B_PIN + // TO TEST + //#define RGB_LED_B_PIN 29 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + // TO TEST + //#define NEOPIXEL_PIN 25 + #endif + + #endif + + #elif ENABLED(MINIPANEL) + + // TO TEST + //#define BEEPER_PIN EXP2_06_PIN + // not connected to a pin + //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) + + //#define DOGLCD_A0 EXP2_04_PIN + //#define DOGLCD_CS 58 // Mega/Due:66 - AGCM4:58 + + // GLCD features + // Uncomment screen orientation + //#define LCD_SCREEN_ROT_90 + //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_270 + + //#define BTN_EN1 EXP1_09_PIN + //#define BTN_EN2 55 // Mega/Due:63 - AGCM4:55 + //#define BTN_ENC 72 // Mega/Due:59 - AGCM4:72 + + //#define SD_DETECT_PIN EXP2_01_PIN + //#define KILL_PIN 56 // Mega/Due:64 - AGCM4:56 + + #elif ENABLED(ZONESTAR_LCD) + + // TO TEST + //#define ADC_KEYPAD_PIN 12 + + #elif ENABLED(AZSMZ_12864) + + // TO TEST + + #else + + // Beeper on AUX-4 + //#define BEEPER_PIN 33 + + // Buttons are directly attached to AUX-2 + #if IS_RRW_KEYPAD + // TO TEST + //#define SHIFT_OUT_PIN EXP1_09_PIN + //#define SHIFT_CLK_PIN EXP2_04_PIN + //#define SHIFT_LD_PIN EXP2_06_PIN + //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 + //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 + //#define BTN_ENC 55 // Mega/Due:63 - AGCM4:55 + #elif ENABLED(PANEL_ONE) + // TO TEST + //#define BTN_EN1 72 // AUX2 PIN 3 (Mega/Due:59 - AGCM4:72) + //#define BTN_EN2 55 // AUX2 PIN 4 (Mega/Due:63 - AGCM4:55) + //#define BTN_ENC EXP2_01_PIN // AUX3 PIN 7 + #else + // TO TEST + //#define BTN_EN1 EXP1_05_PIN + //#define BTN_EN2 EXP1_08_PIN + //#define BTN_ENC 31 + #endif + + #if ENABLED(G3D_PANEL) + // TO TEST + //#define SD_DETECT_PIN EXP2_01_PIN + //#define KILL_PIN EXP1_10_PIN + #endif + + #endif + #endif // IS_NEWPANEL + +#endif // HAS_WIRED_LCD + +// +// SD Support +// + +/** + * Bricolemon has an SD slot, but to change it to your LCD or Custom, set the option to one of the following: + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + #define SDSS 83 + #undef SD_DETECT_PIN + #define SD_DETECT_PIN 95 +#else + #define SDSS EXP2_07_PIN +#endif + +#if HAS_TMC_UART + /** + * Address for the UART Configuration of the TMC2209. Override in Configuration files. + * To test TMC2209 Steppers enable TMC_DEBUG in Configuration_adv.h and test the M122 command with voltage on the steppers. + */ + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0b00 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 0b01 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 0b10 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 0b11 + #endif + + /** + * TMC2208/TMC2209 stepper drivers + * It seems to work perfectly fine on Software Serial, if an advanced user wants to test, you could use the SAMD51 Serial1 and Serial 2. Be careful with the Sercom configurations. + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + + // This is the stable default value after testing, but, higher UART rates could be configured, remeber to test the Steppers with the M122 command to check if everything works. + #define TMC_BAUD_RATE 250000 + + // + // Software serial + // + #define X_SERIAL_TX_PIN 0 + #define X_SERIAL_RX_PIN 1 + + #define Y_SERIAL_TX_PIN X_SERIAL_TX_PIN + #define Y_SERIAL_RX_PIN X_SERIAL_RX_PIN + + #define Z_SERIAL_TX_PIN X_SERIAL_TX_PIN + #define Z_SERIAL_RX_PIN X_SERIAL_RX_PIN + + #define E0_SERIAL_TX_PIN X_SERIAL_TX_PIN + #define E0_SERIAL_RX_PIN X_SERIAL_RX_PIN + +#endif diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h new file mode 100644 index 000000000000..2484674a90b3 --- /dev/null +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h @@ -0,0 +1,676 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * BRICOLEMON Board. Based on ATSAMD51 (AGCM4), bootloader and credits by ADAFRUIT. + */ + +#if NOT_TARGET(ARDUINO_GRAND_CENTRAL_M4) + #error "Oops! Select 'Adafruit Grand Central M4' in 'Tools > Board.'" +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "BRICOLEMON V1.0" // , Lemoncrest & BricoGeek collaboration. +#endif + +/** + * BRICOLEMON Board. Based on atsamd51 (AGCM4), bootloader and credits by ADAFRUIT. + * This board its a 3.3V LOGIC Board, following the ADAFRUIT example, all of the board is open source. + * Schematic: https://github.com/bricogeek/bricolemon/blob/master/Documentacion/Bricolemon/EsquemaBricolemon_REVB.pdf + * 3DSTEP: https://github.com/bricogeek/bricolemon/blob/master/Documentacion/Bricolemon/BricolemonREVB.step + * PinDemux: https://github.com/bricogeek/bricolemon/blob/master/Documentacion/Bricolemon/PinDEMUX.xlsx + * + * NOTE: We need the Serial port on the -1 to make it work!!. Remember to change it on configuration.h #define SERIAL_PORT -1 + */ + +/** + * EEPROM EMULATION: Works with some bugs already, but the board needs an I2C EEPROM memory soldered on. + */ +//#define FLASH_EEPROM_EMULATION +#define I2C_EEPROM // EEPROM on I2C-0 +#define MARLIN_EEPROM_SIZE 0x70000 // 512K (CAT24C512) + +//This its another option to emulate an EEPROM, but its more efficient to dont loose the data the first One. +//#define SDCARD_EEPROM_EMULATION + +// +// BLTouch +// +#define SERVO0_PIN 33 // BLTouch PWM + +// +// Limit Switches +// +#define X_STOP_PIN 10 +#define Y_STOP_PIN 11 +#define Z_STOP_PIN 12 + +/** + * NOTE: Useful if extra TMC2209 are to be used as independent axes. + * We need to configure the new digital PIN, for this we could configure on the board the extra pin of this stepper, for example as a MIN_PIN/MAX_PIN. This pin is the D14. + */ +//#define Z2_STOP_PIN 14 +//#define X2_STOP_PIN 14 +//#define Y2_STOP_PIN 14 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 12 +#endif + +// +// Steppers +// +#define X_STEP_PIN 3 +#define X_DIR_PIN 22 +#define X_ENABLE_PIN 26 + +#define Y_STEP_PIN 4 +#define Y_DIR_PIN 23 +#define Y_ENABLE_PIN 27 + +#define Z_STEP_PIN 5 +#define Z_DIR_PIN 24 +#define Z_ENABLE_PIN 28 + +#define E0_STEP_PIN 2 +#define E0_DIR_PIN 25 +#define E0_ENABLE_PIN 29 + +#define E1_STEP_PIN 13 +#define E1_DIR_PIN 46 +#define E1_ENABLE_PIN 47 + +// Filament runout. You may choose to use this pin for some other purpose. It's a normal GPIO that can be configured as I/O. +// For example, a switch to detect any kind of behavior, Power supply pin .... etc. +#define FIL_RUNOUT_PIN 32 + +// This board have the option to use an extra TMC2209 stepper, one of the use could be as a second extruder. +#if EXTRUDERS < 2 + // TODO: Corregir aquí que cuando tenemos dos extrusores o lo que sea, utiliza los endstop que le sobran, osea los max, no hay Z2_endstop + #if NUM_Z_STEPPER_DRIVERS > 1 + #define Z2_STOP_PIN 14 + #endif +#else + // If we want to configure the extra stepper as a Extruder, we should have undef all of the extra motors. + #undef X2_DRIVER_TYPE + #undef Y2_DRIVER_TYPE + #undef Z2_DRIVER_TYPE + #undef Z3_DRIVER_TYPE + #undef Z4_DRIVER_TYPE + + // Si tenemos más de un extrusor lo que hacemos es definir el nuevo extrusor así como sus pines + // Acordarse de definir el #define TEMP_SENSOR_1, ya que este contiene el tipo de sonda del extrusor E1 + + #define FIL_RUNOUT2_PIN 14 + +#endif + +// +// Extruder / Bed +// + +// Temperature Sensors +#define TEMP_0_PIN 1 + +// You could use one of the ADC for a temp chamber if you don't use the second extruder, for example. +#if TEMP_SENSOR_CHAMBER > 0 + #define TEMP_CHAMBER_PIN 3 +#else + #define TEMP_1_PIN 3 +#endif + +#define TEMP_BED_PIN 2 + +// +// Heaters / Fans +// +#define HEATER_0_PIN 6 +#define HEATER_1_PIN 45 +#define HEATER_BED_PIN 7 + +// The board has 4 PWM fans, use and configure as desired +#define FAN_PIN 8 +#define FAN1_PIN 9 +#define FAN2_PIN 30 +#define FAN3_PIN 31 + +// +// LCD / Controller +// + +/** + * Bricolemon Expansion connectors + * + * ------ ------ + * VCC | 1 2 | GND KILL | 1 2 | GND + * LCD7 | 3 4 | LCDD6 RESET | 3 4 | SD_DETECT + * LCD5 | 5 6 LCDD4 MOSI | 5 6 BTN_EN1 + * LCDRS | 7 8 | LCDDE SS | 7 8 | BTN_EN2 + * BTN_ENCODER | 9 10 | BEEPER SCLK | 9 10 | MISO + * ------ ------ + * EXP1 EXP2 + * + *- This extra connector is for a serial display like the MKS TFT. + * MKS TFT + * ------ + * RX0 | . . | NC + * TX0 | . . NC + * GND | . . GND + * 5B | . . | 5V + * ------ + * + *- Special mapping of EXP1 to EXP3 to work with Ender displays. + * + * Enable CR10_STOCKDISPLAY in Configuration.h and connect EXP1 to the display EXP3 with this mapping. + * ------ + * VCC | 1 2 | GND + * LCDDE | 3 4 | LCDRS + * LCDD4 | 5 6 BTN_EN2 + * RESET | 7 8 | BTN_EN1 + * BTN_ENCODER | 9 10 | BEEPER + * ------ + * + *- Digital pinout reference of the Bricolemon for advanced users/configurations. + * + * ------ ------ + * VCC | 1 2 | GND D49 | 1 2 | GND + * D39 | 3 4 | D38 RST | 3 4 | D44 + * D37 | 5 6 D36 D51 | 5 6 D42 + * D34 | 7 8 | D35 D53 | 7 8 | D43 + * D40 | 9 10 | D41 D52 | 9 10 | D50 + * ------ ------ + * EXP1 EXP2 + * + *- Pin table overview + * LCD--- SPI--- + * LCD4 36 MISO 50 + * LCD5 37 SS 53 + * LCD6 38 SCKL 52 + * LCD7 39 MOSI 51 + * LCDRS 34 BEEPER + * LCDDE 35 BEEP 41 + * ENCODER--- SD-CARD--- + * BTN_EN1 42 SD_DETECT 44 + * BTN_EN2 43 KILL_PIN 49 + * BTN_ENCODER 40 + */ + +#define EXP1_03_PIN 39 +#define EXP1_04_PIN 38 +#define EXP1_05_PIN 37 +#define EXP1_06_PIN 36 +#define EXP1_07_PIN 34 +#define EXP1_08_PIN 35 +#define EXP1_09_PIN 40 +#define EXP1_10_PIN 41 + +#define EXP2_01_PIN 49 +#define EXP2_04_PIN 44 +#define EXP2_05_PIN 51 +#define EXP2_06_PIN 42 +#define EXP2_07_PIN 53 +#define EXP2_08_PIN 43 +#define EXP2_09_PIN 52 +#define EXP2_10_PIN 50 + +#if ENABLED(CR10_STOCKDISPLAY) + #define EXP3_03_PIN EXP1_03_PIN + #define EXP3_04_PIN EXP1_04_PIN + #define EXP3_05_PIN EXP1_05_PIN + #define EXP3_06_PIN EXP1_06_PIN + #define EXP3_07_PIN EXP1_07_PIN + #define EXP3_08_PIN EXP1_08_PIN + #define EXP3_09_PIN EXP1_09_PIN + #define EXP3_10_PIN EXP1_10_PIN +#endif + +/************************************/ +/***** Configurations Section ******/ +/************************************/ + +/** + * This sections starts with the pins_RAMPS_144.h as example, after if you need any new + * display, you could use normal duponts and connect it with with the scheme showed before. + * Tested: + * - Ender 3 Old display (Character LCD) + * - Ender 3 New Serial DWING Display + * - Reprap Display + * - Ender 5 New Serial Display + * - Any Reprap character display like + */ + +#if HAS_WIRED_LCD + + // + // LCD Display output pins + // + + #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI + + #if LCD_SERIAL_PORT != 1 + #error "LCD_SERIAL_PORT should be 1 for this display." + #endif + + // DWIN Encoder + #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_07_PIN + + #ifndef BEEPER_PIN + #define BEEPER_PIN EXP1_10_PIN + #undef SPEAKER + #endif + + #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + // TO TEST + //#define LCD_PINS_RS EXP2_01_PIN // CS chip select /SS chip slave select + //#define LCD_PINS_ENABLE EXP2_05_PIN // SID (MOSI) + //#define LCD_PINS_D4 EXP2_09_PIN // SCK (CLK) clock + + #elif BOTH(IS_NEWPANEL, PANEL_ONE) + + // TO TEST + //#define LCD_PINS_RS EXP1_09_PIN + //#define LCD_PINS_ENABLE EXP2_06_PIN + //#define LCD_PINS_D4 57 // Mega/Due:65 - AGCM4:57 + //#define LCD_PINS_D5 58 // Mega/Due:66 - AGCM4:58 + //#define LCD_PINS_D6 EXP2_04_PIN + //#define LCD_PINS_D7 56 // Mega/Due:64 - AGCM4:56 + + #else + + #if ENABLED(CR10_STOCKDISPLAY) + + // TO TEST + #define LCD_PINS_RS EXP3_04_PIN + #define LCD_PINS_ENABLE EXP3_03_PIN + #define LCD_PINS_D4 EXP3_05_PIN + + #if !IS_NEWPANEL + // TO TEST + //#define BEEPER_PIN EXP3_05_PIN + #endif + + #elif ENABLED(ZONESTAR_LCD) + + // TO TEST + //#define LCD_PINS_RS 56 // Mega/Due:64 - AGCM4:56 + //#define LCD_PINS_ENABLE EXP2_04_PIN + //#define LCD_PINS_D4 55 // Mega/Due:63 - AGCM4:55 + //#define LCD_PINS_D5 EXP1_09_PIN + //#define LCD_PINS_D6 EXP2_06_PIN + //#define LCD_PINS_D7 57 // Mega/Due:65 - AGCM4:57 + + #else + + #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) + // TO TEST + //#define LCD_PINS_DC 25 // Set as output on init + //#define LCD_PINS_RS 27 // Pull low for 1s to init + // DOGM SPI LCD Support + //#define DOGLCD_CS 16 + //#define DOGLCD_MOSI 17 + //#define DOGLCD_SCK 23 + //#define DOGLCD_A0 LCD_PINS_DC + + #else + // Definitions for any standard Display + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #endif + + #define LCD_PINS_D7 EXP1_03_PIN + + #if !IS_NEWPANEL + #define BEEPER_PIN EXP1_10_PIN + #endif + + #endif + + #if !IS_NEWPANEL + // Buttons attached to a shift register + // Not wired yet + //#define SHIFT_CLK_PIN EXP1_04_PIN + //#define SHIFT_LD_PIN EXP2_06_PIN + //#define SHIFT_OUT_PIN EXP1_09_PIN + //#define SHIFT_EN_PIN 17 + #endif + + #endif + + // + // LCD Display input pins + // + #if IS_NEWPANEL + + #if IS_RRD_SC + + #define BEEPER_PIN EXP1_10_PIN + + #if ENABLED(CR10_STOCKDISPLAY) + // TO TEST + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_06_PIN + #else + // Definitions fpr any standard Display + #define BTN_EN1 EXP2_06_PIN + #define BTN_EN2 EXP2_08_PIN + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + #endif + + #define BTN_ENC EXP1_09_PIN + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN EXP2_04_PIN + #endif + #define KILL_PIN EXP2_01_PIN + + #if ENABLED(BQ_LCD_SMART_CONTROLLER) + //#define LCD_BACKLIGHT_PIN EXP1_03_PIN // TO TEST + #endif + + #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + // TO TEST + //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 + //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 + //#define BTN_ENC 55 + //#define SD_DETECT_PIN EXP2_06_PIN + + #elif ENABLED(LCD_I2C_PANELOLU2) + + // TO TEST + //#define BTN_EN1 47 + //#define BTN_EN2 EXP2_08_PIN + //#define BTN_ENC 32 + //#define LCD_SDSS SDSS + //#define KILL_PIN EXP1_10_PIN + + #elif ENABLED(LCD_I2C_VIKI) + + // TO TEST + //#define BTN_EN1 EXP1_09_PIN // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + //#define BTN_EN2 EXP2_06_PIN + //#define BTN_ENC -1 + + //#define LCD_SDSS SDSS + //#define SD_DETECT_PIN EXP2_01_PIN + + #elif ANY(VIKI2, miniVIKI) + + // TO TEST + //#define DOGLCD_CS 45 + //#define DOGLCD_A0 EXP2_04_PIN + //#define LCD_SCREEN_ROT_180 + + //#define BEEPER_PIN 33 + //#define STAT_LED_RED_PIN 32 + //#define STAT_LED_BLUE_PIN EXP1_08_PIN + + //#define BTN_EN1 22 + //#define BTN_EN2 7 + //#define BTN_ENC EXP1_03_PIN + + //#define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board + //#define KILL_PIN 31 + + #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + + // TO TEST + //#define DOGLCD_CS 29 + //#define DOGLCD_A0 27 + + //#define BEEPER_PIN 23 + //#define LCD_BACKLIGHT_PIN 33 + + //#define BTN_EN1 EXP1_08_PIN + //#define BTN_EN2 EXP1_05_PIN + //#define BTN_ENC 31 + + //#define LCD_SDSS SDSS + //#define SD_DETECT_PIN EXP2_01_PIN + //#define KILL_PIN EXP1_10_PIN + + #elif EITHER(MKS_MINI_12864, FYSETC_MINI_12864) + + // TO TEST + //#define BEEPER_PIN EXP1_05_PIN + //#define BTN_ENC EXP1_08_PIN + //#define SD_DETECT_PIN EXP2_01_PIN + + //#ifndef KILL_PIN + // #define KILL_PIN EXP1_10_PIN + //#endif + + #if ENABLED(MKS_MINI_12864) + + // TO TEST + //#define DOGLCD_A0 27 + //#define DOGLCD_CS 25 + + // GLCD features + // Uncomment screen orientation + //#define LCD_SCREEN_ROT_90 + //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_270 + + // not connected to a pin + //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) + + //#define BTN_EN1 31 + //#define BTN_EN2 33 + + #elif ENABLED(FYSETC_MINI_12864) + + // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + + // TO TEST + //#define DOGLCD_A0 16 + //#define DOGLCD_CS 17 + + //#define BTN_EN1 33 + //#define BTN_EN2 31 + + //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems + // results in LCD soft SPI mode 3, SD soft SPI mode 0 + + //#define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally. + + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + // TO TEST + //#define RGB_LED_R_PIN 25 + #endif + #ifndef RGB_LED_G_PIN + // TO TEST + //#define RGB_LED_G_PIN 27 + #endif + #ifndef RGB_LED_B_PIN + // TO TEST + //#define RGB_LED_B_PIN 29 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + // TO TEST + //#define NEOPIXEL_PIN 25 + #endif + + #endif + + #elif ENABLED(MINIPANEL) + + // TO TEST + //#define BEEPER_PIN EXP2_06_PIN + // not connected to a pin + //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) + + //#define DOGLCD_A0 EXP2_04_PIN + //#define DOGLCD_CS 58 // Mega/Due:66 - AGCM4:58 + + // GLCD features + // Uncomment screen orientation + //#define LCD_SCREEN_ROT_90 + //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_270 + + //#define BTN_EN1 EXP1_09_PIN + //#define BTN_EN2 55 // Mega/Due:63 - AGCM4:55 + //#define BTN_ENC 72 // Mega/Due:59 - AGCM4:72 + + //#define SD_DETECT_PIN EXP2_01_PIN + //#define KILL_PIN 56 // Mega/Due:64 - AGCM4:56 + + #elif ENABLED(ZONESTAR_LCD) + + // TO TEST + //#define ADC_KEYPAD_PIN 12 + + #elif ENABLED(AZSMZ_12864) + + // TO TEST + + #else + + // Beeper on AUX-4 + //#define BEEPER_PIN 33 + + // Buttons are directly attached to AUX-2 + #if IS_RRW_KEYPAD + // TO TEST + //#define SHIFT_OUT_PIN EXP1_09_PIN + //#define SHIFT_CLK_PIN EXP2_04_PIN + //#define SHIFT_LD_PIN EXP2_06_PIN + //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 + //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 + //#define BTN_ENC 55 // Mega/Due:63 - AGCM4:55 + #elif ENABLED(PANEL_ONE) + // TO TEST + //#define BTN_EN1 72 // AUX2 PIN 3 (Mega/Due:59 - AGCM4:72) + //#define BTN_EN2 55 // AUX2 PIN 4 (Mega/Due:63 - AGCM4:55) + //#define BTN_ENC EXP2_01_PIN // AUX3 PIN 7 + #else + // TO TEST + //#define BTN_EN1 EXP1_05_PIN + //#define BTN_EN2 EXP1_08_PIN + //#define BTN_ENC 31 + #endif + + #if ENABLED(G3D_PANEL) + // TO TEST + //#define SD_DETECT_PIN EXP2_01_PIN + //#define KILL_PIN EXP1_10_PIN + #endif + + #endif + #endif // IS_NEWPANEL + +#endif // HAS_WIRED_LCD + +// +// SD Support +// + +/** + * Bricolemon has an SD slot, but to change it to your LCD or Custom, set the option to one of the following: + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + #define SDSS 83 + #undef SD_DETECT_PIN + #define SD_DETECT_PIN 95 +#else + #define SDSS EXP2_07_PIN +#endif + +#if HAS_TMC_UART + + /** + * Address for the UART Configuration of the TMC2209. Override in Configuration files. + * To test TMC2209 Steppers enable TMC_DEBUG in Configuration_adv.h and test the M122 command with voltage on the steppers. + */ + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0b00 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 0b01 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 0b10 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 0b11 + #endif + #ifndef E1_SLAVE_ADDRESS + #define E1_SLAVE_ADDRESS 0b00 + #endif + + /** + * TMC2208/TMC2209 stepper drivers + * It seems to work perfectly fine on Software Serial, if an advanced user wants to test, you could use the SAMD51 Serial1 and Serial 2. Be careful with the Sercom configurations. + * Steppers 1,2,3,4 (X,Y,Z,E0) are on the Serial1, Sercom (RX = 0, TX = 1), extra stepper 5 (E1 or any axis you want) is on Serial2, Sercom (RX = 17, TX = 16) + */ + + //#define X_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial2 + + #define TMC_BAUD_RATE 250000 + + // + // Software serial + // + #define X_SERIAL_TX_PIN 0 + #define X_SERIAL_RX_PIN 1 + + #define Y_SERIAL_TX_PIN X_SERIAL_TX_PIN + #define Y_SERIAL_RX_PIN X_SERIAL_RX_PIN + + #define Z_SERIAL_TX_PIN X_SERIAL_TX_PIN + #define Z_SERIAL_RX_PIN X_SERIAL_RX_PIN + + #define E0_SERIAL_TX_PIN X_SERIAL_TX_PIN + #define E0_SERIAL_RX_PIN X_SERIAL_RX_PIN + + #define E1_SERIAL_TX_PIN 17 + #define E1_SERIAL_RX_PIN 16 + +#endif From f193729f546600eae327c688e1da46b1cc105586 Mon Sep 17 00:00:00 2001 From: Stephen Hawes Date: Fri, 4 Feb 2022 19:42:15 -0500 Subject: [PATCH 085/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Index=20Mobo=20Rev?= =?UTF-8?q?03=20upload=20(#23676)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformIO/boards/marlin_index_mobo_rev03.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/buildroot/share/PlatformIO/boards/marlin_index_mobo_rev03.json b/buildroot/share/PlatformIO/boards/marlin_index_mobo_rev03.json index c65f1dd70356..ef5ebfa56066 100644 --- a/buildroot/share/PlatformIO/boards/marlin_index_mobo_rev03.json +++ b/buildroot/share/PlatformIO/boards/marlin_index_mobo_rev03.json @@ -5,6 +5,10 @@ "extra_flags": "-DSTM32F407xx", "f_cpu": "168000000L", "hwids": [ + [ + "0x0483", + "0xdf11" + ], [ "0x1EAF", "0x0003" @@ -12,10 +16,6 @@ [ "0x0483", "0x3748" - ], - [ - "0x0483", - "0xdf11" ] ], "mcu": "stm32f407vet6", @@ -35,7 +35,7 @@ "disable_flushing": false, "maximum_ram_size": 131072, "maximum_size": 524288, - "protocol": "stlink", + "protocol": "dfu", "protocols": [ "stlink", "dfu", From 0d07c49c1d91483c59294fce2e58577a4bf23bb9 Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Sat, 5 Feb 2022 01:44:21 +0100 Subject: [PATCH 086/502] =?UTF-8?q?=F0=9F=A9=B9=20Init=20brightness/contra?= =?UTF-8?q?st=20later=20(#23645)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/settings.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index b737d41c2ddb..ab498b7df35a 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -578,9 +578,6 @@ void MarlinSettings::postprocess() { update_software_endstops((AxisEnum)i); } - TERN_(HAS_LCD_CONTRAST, ui.refresh_contrast()); - TERN_(HAS_LCD_BRIGHTNESS, ui.refresh_brightness()); - TERN_(ENABLE_LEVELING_FADE_HEIGHT, set_z_fade_height(new_z_fade_height, false)); // false = no report TERN_(AUTO_BED_LEVELING_BILINEAR, refresh_bed_level()); @@ -602,6 +599,10 @@ void MarlinSettings::postprocess() { // Various factors can change the current position if (oldpos != current_position) report_current_position(); + + // Moved as last update due to interference with Neopixel init + TERN_(HAS_LCD_CONTRAST, ui.refresh_contrast()); + TERN_(HAS_LCD_BRIGHTNESS, ui.refresh_brightness()); } #if BOTH(PRINTCOUNTER, EEPROM_SETTINGS) From f5046a41cd306cf107f8b7bc61bedb81f22ace78 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 5 Feb 2022 13:51:00 +1300 Subject: [PATCH 087/502] =?UTF-8?q?=F0=9F=9A=A8=20Deprecate=20Maple=20buil?= =?UTF-8?q?d=20(#23661)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Warnings.cpp --- Marlin/src/inc/Warnings.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index f2b2339729e2..c5f03e7dbcce 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -563,3 +563,10 @@ #if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX #warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX." #endif + +/** + * Maple environment + */ +#ifdef __STM32F1__ + #warning "Maple build environments are deprecated. Please use a non-Maple build environment. Report issues to the Marlin Firmware project." +#endif From a23ecf0d2f96d9c7547b8c545fb39e9396d271dd Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Fri, 4 Feb 2022 19:00:35 -0600 Subject: [PATCH 088/502] =?UTF-8?q?=F0=9F=A9=B9=20Prevent=20Z=20error=20wi?= =?UTF-8?q?th=20UBL=20+=20Park=20unscaled=20E=20move=20(#23568)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/pause.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 08f540f2eeda..147164c16623 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -39,6 +39,10 @@ #include "../module/printcounter.h" #include "../module/temperature.h" +#if ENABLED(AUTO_BED_LEVELING_UBL) + #include "bedlevel/bedlevel.h" +#endif + #if ENABLED(FWRETRACT) #include "fwretract.h" #endif @@ -440,7 +444,15 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool // Initial retract before move to filament change position if (retract && thermalManager.hotEnoughToExtrude(active_extruder)) { DEBUG_ECHOLNPGM("... retract:", retract); + + #if ENABLED(AUTO_BED_LEVELING_UBL) + const bool leveling_was_enabled = planner.leveling_active; // save leveling state + set_bed_leveling_enabled(false); // turn off leveling + #endif + unscaled_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE); + + TERN_(AUTO_BED_LEVELING_UBL, set_bed_leveling_enabled(leveling_was_enabled)); // restore leveling } // If axes don't need to home then the nozzle can park @@ -640,9 +652,16 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_ prepare_internal_move_to_destination(NOZZLE_PARK_Z_FEEDRATE); } + #if ENABLED(AUTO_BED_LEVELING_UBL) + const bool leveling_was_enabled = planner.leveling_active; // save leveling state + set_bed_leveling_enabled(false); // turn off leveling + #endif + // Unretract unscaled_e_move(PAUSE_PARK_RETRACT_LENGTH, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE)); + TERN_(AUTO_BED_LEVELING_UBL, set_bed_leveling_enabled(leveling_was_enabled)); // restore leveling + // Intelligent resuming #if ENABLED(FWRETRACT) // If retracted before goto pause From cdcf31453b605fb133f10ddd1d1f952fc5a594c4 Mon Sep 17 00:00:00 2001 From: John Lagonikas <39417467+zeleps@users.noreply.github.com> Date: Sat, 5 Feb 2022 03:10:59 +0200 Subject: [PATCH 089/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20dual=20MAX31865=20?= =?UTF-8?q?initialization=20issues=20(#23496)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 29 ++-- Marlin/src/HAL/shared/Delay.h | 2 + Marlin/src/libs/MAX31865.cpp | 317 ++++++++++++++++++++-------------- Marlin/src/libs/MAX31865.h | 22 ++- 4 files changed, 217 insertions(+), 153 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 9091a6bdd059..fa5c461cd7ec 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -138,24 +138,21 @@ #endif /** - * Configuration options for MAX Thermocouples (-2, -3, -5). - * FORCE_HW_SPI: Ignore SCK/MOSI/MISO pins and just use the CS pin & default SPI bus. - * MAX31865_WIRES: Set the number of wires for the probe connected to a MAX31865 board, 2-4. Default: 2 - * MAX31865_50HZ: Enable 50Hz filter instead of the default 60Hz. - * MAX31865_USE_READ_ERROR_DETECTION: Detects random read errors from value spikes (a 20°C difference in less than 1sec) - * MAX31865_USE_AUTO_MODE: Faster and more frequent reads than 1-shot, but bias voltage always on, slightly affecting RTD temperature. - * MAX31865_MIN_SAMPLING_TIME_MSEC: in 1-shot mode, the minimum time between subsequent reads. This reduces the effect of bias voltage by leaving the sensor unpowered for longer intervals. - * MAX31865_WIRE_OHMS: In 2-wire configurations, manually set the wire resistance for more accurate readings + * Thermocouple Options — for MAX6675 (-2), MAX31855 (-3), and MAX31865 (-5). */ -//#define TEMP_SENSOR_FORCE_HW_SPI -//#define MAX31865_SENSOR_WIRES_0 2 +//#define TEMP_SENSOR_FORCE_HW_SPI // Ignore SCK/MOSI/MISO pins; use CS and the default SPI bus. +//#define MAX31865_SENSOR_WIRES_0 2 // (2-4) Number of wires for the probe connected to a MAX31865 board. //#define MAX31865_SENSOR_WIRES_1 2 -//#define MAX31865_50HZ_FILTER -//#define MAX31865_USE_READ_ERROR_DETECTION -//#define MAX31865_USE_AUTO_MODE -//#define MAX31865_MIN_SAMPLING_TIME_MSEC 100 -//#define MAX31865_WIRE_OHMS_0 0.0f -//#define MAX31865_WIRE_OHMS_1 0.0f + +//#define MAX31865_50HZ_FILTER // Use a 50Hz filter instead of the default 60Hz. +//#define MAX31865_USE_READ_ERROR_DETECTION // Treat value spikes (20°C delta in under 1s) as read errors. + +//#define MAX31865_USE_AUTO_MODE // Read faster and more often than 1-shot; bias voltage always on; slight effect on RTD temperature. +//#define MAX31865_MIN_SAMPLING_TIME_MSEC 100 // (ms) 1-shot: minimum read interval. Reduces bias voltage effects by leaving sensor unpowered for longer intervals. +//#define MAX31865_IGNORE_INITIAL_FAULTY_READS 10 // Ignore some read faults (keeping the temperature reading) to work around a possible issue (#23439). + +//#define MAX31865_WIRE_OHMS_0 0.95f // For 2-wire, set the wire resistances for more accurate readings. +//#define MAX31865_WIRE_OHMS_1 0.0f /** * Hephestos 2 24V heated bed upgrade kit. diff --git a/Marlin/src/HAL/shared/Delay.h b/Marlin/src/HAL/shared/Delay.h index df07881f01d9..a6795a78eaf4 100644 --- a/Marlin/src/HAL/shared/Delay.h +++ b/Marlin/src/HAL/shared/Delay.h @@ -166,6 +166,8 @@ void calibrate_delay_loop(); // Delay in microseconds #define DELAY_US(x) DELAY_CYCLES((x) * ((F_CPU) / 1000000UL)) + #define DELAY_CYCLES_VAR DELAY_CYCLES + #elif defined(ESP32) || defined(__PLAT_LINUX__) || defined(__PLAT_NATIVE_SIM__) // DELAY_CYCLES specified inside platform diff --git a/Marlin/src/libs/MAX31865.cpp b/Marlin/src/libs/MAX31865.cpp index 1cafbe5f170e..c042504cf872 100644 --- a/Marlin/src/libs/MAX31865.cpp +++ b/Marlin/src/libs/MAX31865.cpp @@ -50,10 +50,6 @@ #define MAX31865_MIN_SAMPLING_TIME_MSEC 0 #endif -#ifdef TARGET_LPC1768 - #include -#endif - #define DEBUG_OUT ENABLED(DEBUG_MAX31865) #include "../core/debug_out.h" @@ -151,24 +147,62 @@ void MAX31865::begin(max31865_numwires_t wires, float zero_res, float ref_res, f digitalWrite(cselPin, HIGH); if (sclkPin != TERN(LARGE_PINMAP, -1UL, 255)) - softSpiBegin(SPI_QUARTER_SPEED); // Define pin modes for Software SPI + softSpiInit(); // Define pin modes for Software SPI else { - DEBUG_ECHOLNPGM("Initializing MAX31865 Hardware SPI"); + DEBUG_ECHOLNPGM("Init MAX31865 Hardware SPI"); SPI.begin(); // Start and configure hardware SPI } initFixedFlags(wires); - clearFault(); // also initializes flags + DEBUG_ECHOLNPGM("MAX31865 Regs: CFG ", readRegister8(MAX31865_CONFIG_REG), + "|RTD ", readRegister16(MAX31865_RTDMSB_REG), + "|HTHRS ", readRegister16(MAX31865_HFAULTMSB_REG), + "|LTHRS ", readRegister16(MAX31865_LFAULTMSB_REG), + "|FLT ", readRegister8(MAX31865_FAULTSTAT_REG)); + + // fault detection cycle seems to initialize the sensor better + runAutoFaultDetectionCycle(); // also initializes flags + + if (lastFault) + SERIAL_ECHOLNPGM("MAX31865 init fault ", lastFault); + + writeRegister16(MAX31865_HFAULTMSB_REG, 0xFFFF); + writeRegister16(MAX31865_LFAULTMSB_REG, 0); + + #if ENABLED(MAX31865_USE_AUTO_MODE) // make a proper first read to initialize _lastRead + + uint16_t rtd = readRegister16(MAX31865_RTDMSB_REG); + + #if MAX31865_IGNORE_INITIAL_FAULTY_READS > 0 + rtd = fixFault(rtd); + #endif + + if (rtd & 1) { + lastRead = 0xFFFF; // some invalid value + lastFault = readRegister8(MAX31865_FAULTSTAT_REG); + clearFault(); // also clears the bias voltage flag, so no further action is required + + DEBUG_ECHOLNPGM("MAX31865 read fault: ", rtd); + } + else { + DEBUG_ECHOLNPGM("RTD MSB:", (rtd >> 8), " RTD LSB:", (rtd & 0x00FF)); + lastRead = rtd; + TERN_(MAX31865_USE_READ_ERROR_DETECTION, lastReadStamp = millis()); + } - #if DISABLED(MAX31865_USE_AUTO_MODE) // make a proper first 1 shot read to initialize _lastRead + #else enableBias(); - DELAY_US(11500); + DELAY_US(2000); // according to the datasheet, 10.5τ+1msec (see below) oneShot(); - DELAY_US(65000); + DELAY_US(63000); uint16_t rtd = readRegister16(MAX31865_RTDMSB_REG); + #if MAX31865_IGNORE_INITIAL_FAULTY_READS > 0 + rtd = fixFault(rtd); + #endif + if (rtd & 1) { lastRead = 0xFFFF; // some invalid value lastFault = readRegister8(MAX31865_FAULTSTAT_REG); @@ -189,7 +223,7 @@ void MAX31865::begin(max31865_numwires_t wires, float zero_res, float ref_res, f TERN_(MAX31865_USE_READ_ERROR_DETECTION, lastReadStamp = now); } - #endif // !MAX31865_USE_AUTO_MODE + #endif // MAX31865_USE_AUTO_MODE DEBUG_ECHOLNPGM( TERN(LARGE_PINMAP, "LARGE_PINMAP", "Regular") @@ -198,7 +232,7 @@ void MAX31865::begin(max31865_numwires_t wires, float zero_res, float ref_res, f " sclkPin: ", sclkPin, " mosiPin: ", mosiPin, " config: ", readRegister8(MAX31865_CONFIG_REG) - ); + ); } /** @@ -240,6 +274,29 @@ void MAX31865::oneShot() { setConfig(MAX31865_CONFIG_1SHOT | MAX31865_CONFIG_BIAS, 1); } +void MAX31865::runAutoFaultDetectionCycle() { + writeRegister8(MAX31865_CONFIG_REG, (stdFlags & 0x11) | 0x84 ); // cfg reg = 100X010Xb + DELAY_US(600); + for (int i = 0; i < 10 && (readRegister8(MAX31865_CONFIG_REG) & 0xC) > 0; i++) DELAY_US(100); // Fault det completes when bits 2 and 3 are zero (or after 10 tries) + readFault(); + clearFault(); +} + +/** + * Set a value in the configuration register. + * + * @param config 8-bit value for the config item + * @param enable whether to enable or disable the value + */ +void MAX31865::setConfig(uint8_t config, bool enable) { + uint8_t t = stdFlags; + if (enable) + t |= config; + else + t &= ~config; + writeRegister8(MAX31865_CONFIG_REG, t); +} + /** * Initialize standard flags with flags that will not change during operation (Hz, polling mode and no. of wires) * @@ -249,12 +306,59 @@ void MAX31865::initFixedFlags(max31865_numwires_t wires) { // set config-defined flags (same for all sensors) stdFlags = TERN(MAX31865_50HZ_FILTER, MAX31865_CONFIG_FILT50HZ, MAX31865_CONFIG_FILT60HZ) | - TERN(MAX31865_USE_AUTO_MODE, MAX31865_CONFIG_MODEAUTO | MAX31865_CONFIG_BIAS, MAX31865_CONFIG_MODEOFF); + TERN(MAX31865_USE_AUTO_MODE, MAX31865_CONFIG_MODEAUTO | MAX31865_CONFIG_BIAS, MAX31865_CONFIG_MODEOFF); if (wires == MAX31865_3WIRE) - stdFlags |= MAX31865_CONFIG_3WIRE; - else // 2 or 4 wire - stdFlags &= ~MAX31865_CONFIG_3WIRE; + stdFlags |= MAX31865_CONFIG_3WIRE; // 3 wire + else + stdFlags &= ~MAX31865_CONFIG_3WIRE; // 2 or 4 wire +} + +#if MAX31865_IGNORE_INITIAL_FAULTY_READS > 0 + + inline uint16_t MAX31865::fixFault(uint16_t rtd) { + if (!ignore_faults || !(rtd & 1)) + return rtd; + + ignore_faults--; + clearFault(); + + DEBUG_ECHOLNPGM("MAX31865 ignoring fault ", (MAX31865_IGNORE_INITIAL_FAULTY_READS) - ignore_faults); + + return rtd & ~1; // 0xFFFE + } + +#endif + +inline uint16_t MAX31865::readRawImmediate() { + uint16_t rtd = readRegister16(MAX31865_RTDMSB_REG); + DEBUG_ECHOLNPGM("MAX31865 RTD MSB:", (rtd >> 8), " LSB:", (rtd & 0x00FF)); + + #if MAX31865_IGNORE_INITIAL_FAULTY_READS > 0 + rtd = fixFault(rtd); + #endif + + if (rtd & 1) { + lastFault = readRegister8(MAX31865_FAULTSTAT_REG); + lastRead |= 1; + clearFault(); // also clears the bias voltage flag, so no further action is required + DEBUG_ECHOLNPGM("MAX31865 read fault: ", lastFault); + } + else { + TERN_(MAX31865_USE_READ_ERROR_DETECTION, const millis_t ms = millis()); + if (TERN0(MAX31865_USE_READ_ERROR_DETECTION, ABS((int)(lastRead - rtd)) > 500 && PENDING(ms, lastReadStamp + 1000))) { + // If 2 readings within 1s differ too much (~20°C) it's a read error. + lastFault = 0x01; + lastRead |= 1; + DEBUG_ECHOLNPGM("MAX31865 read error: ", rtd); + } + else { + lastRead = rtd; + TERN_(MAX31865_USE_READ_ERROR_DETECTION, lastReadStamp = ms); + } + } + + return rtd; } /** @@ -267,30 +371,13 @@ uint16_t MAX31865::readRaw() { #if ENABLED(MAX31865_USE_AUTO_MODE) - const uint16_t rtd = readRegister16(MAX31865_RTDMSB_REG); - DEBUG_ECHOLNPGM("MAX31865 RTD MSB:", (rtd >> 8), " LSB:", (rtd & 0x00FF)); - - if (rtd & 1) { - lastFault = readRegister8(MAX31865_FAULTSTAT_REG); - lastRead |= 1; - clearFault(); // also clears the bias voltage flag, so no further action is required - DEBUG_ECHOLNPGM("MAX31865 read fault: ", rtd); - } - #if ENABLED(MAX31865_USE_READ_ERROR_DETECTION) - else if (ABS(lastRead - rtd) > 500 && PENDING(millis(), lastReadStamp + 1000)) { // if two readings within a second differ too much (~20°C), consider it a read error. - lastFault = 0x01; - lastRead |= 1; - DEBUG_ECHOLNPGM("MAX31865 read error: ", rtd); - } - #endif - else { - lastRead = rtd; - TERN_(MAX31865_USE_READ_ERROR_DETECTION, lastReadStamp = millis()); - } + readRawImmediate(); #else - if (PENDING(millis(), nextEventStamp)) { + const millis_t ms = millis(); + + if (PENDING(ms, nextEventStamp)) { DEBUG_ECHOLNPGM("MAX31865 waiting for event ", nextEvent); return lastRead; } @@ -298,46 +385,26 @@ uint16_t MAX31865::readRaw() { switch (nextEvent) { case SETUP_BIAS_VOLTAGE: enableBias(); - nextEventStamp = millis() + 11; // wait at least 11msec before enabling 1shot + nextEventStamp = ms + 2; // wait at least 10.5*τ (τ = 100nF*430Ω max for PT100 / 10nF*4.3ΚΩ for PT1000 = 43μsec) + 1msec nextEvent = SETUP_1_SHOT_MODE; DEBUG_ECHOLNPGM("MAX31865 bias voltage enabled"); break; case SETUP_1_SHOT_MODE: oneShot(); - nextEventStamp = millis() + 65; // wait at least 65msec before reading RTD register + nextEventStamp = ms + TERN(MAX31865_50HZ_FILTER, 63, 52); // wait at least 52msec for 60Hz (63msec for 50Hz) before reading RTD register nextEvent = READ_RTD_REG; DEBUG_ECHOLNPGM("MAX31865 1 shot mode enabled"); break; - case READ_RTD_REG: { - const uint16_t rtd = readRegister16(MAX31865_RTDMSB_REG); - DEBUG_ECHOLNPGM("MAX31865 RTD MSB:", (rtd >> 8), " LSB:", (rtd & 0x00FF)); - - if (rtd & 1) { - lastFault = readRegister8(MAX31865_FAULTSTAT_REG); - lastRead |= 1; - clearFault(); // also clears the bias voltage flag, so no further action is required - DEBUG_ECHOLNPGM("MAX31865 read fault: ", rtd); - } - #if ENABLED(MAX31865_USE_READ_ERROR_DETECTION) - else if (ABS(lastRead - rtd) > 500 && PENDING(millis(), lastReadStamp + 1000)) { // if two readings within a second differ too much (~20°C), consider it a read error. - lastFault = 0x01; - lastRead |= 1; - DEBUG_ECHOLNPGM("MAX31865 read error: ", rtd); - } - #endif - else { - lastRead = rtd; - TERN_(MAX31865_USE_READ_ERROR_DETECTION, lastReadStamp = millis()); - } - - if (!(rtd & 1)) // if clearFault() was not invoked, need to clear the bias voltage and 1-shot flags + case READ_RTD_REG: + + if (!(readRawImmediate() & 1)) // if clearFault() was not invoked, need to clear the bias voltage and 1-shot flags resetFlags(); nextEvent = SETUP_BIAS_VOLTAGE; - nextEventStamp = millis() + MAX31865_MIN_SAMPLING_TIME_MSEC; // next step should not occur within less than MAX31865_MIN_SAMPLING_TIME_MSEC from the last one - } break; + nextEventStamp = ms + (MAX31865_MIN_SAMPLING_TIME_MSEC); // next step should not occur within less than MAX31865_MIN_SAMPLING_TIME_MSEC from the last one + break; } #endif @@ -411,21 +478,17 @@ float MAX31865::temperature(float rtd_res) { return temp; } -// -// private: -// - /** - * Set a value in the configuration register. - * - * @param config 8-bit value for the config item - * @param enable whether to enable or disable the value + * MAX31865 SPI Timing constants + * See MAX31865 datasheet (https://datasheets.maximintegrated.com/en/ds/MAX31865.pdf) + * All timings in nsec, minimum values. */ -void MAX31865::setConfig(uint8_t config, bool enable) { - uint8_t t = stdFlags; - if (enable) t |= config; else t &= ~config; - writeRegister8(MAX31865_CONFIG_REG, t); -} + +#define MAX31865_SPI_TIMING_TCC 400 // CS to SCLK setup +#define MAX31865_SPI_TIMING_TDC 35 // Data to SCLK setup +#define MAX31865_SPI_TIMING_TCL 100 // SCK half period +#define MAX31865_SPI_TIMING_TCCH 100 // SCK to CS hold +#define MAX31865_SPI_TIMING_TCWH 400 // CS inactive time (min) /** * Read a single byte from the specified register address. @@ -459,18 +522,10 @@ uint16_t MAX31865::readRegister16(uint8_t addr) { * @param n the number of bytes to read */ void MAX31865::readRegisterN(uint8_t addr, uint8_t buffer[], uint8_t n) { - addr &= 0x7F; // make sure top bit is not set - if (sclkPin == TERN(LARGE_PINMAP, -1UL, 255)) - SPI.beginTransaction(spiConfig); - else - digitalWrite(sclkPin, LOW); - digitalWrite(cselPin, LOW); - - #ifdef TARGET_LPC1768 - DELAY_CYCLES(spiSpeed); - #endif + addr &= 0x7F; // make sure top bit is not set + spiBeginTransaction(); spiTransfer(addr); while (n--) { @@ -478,10 +533,15 @@ void MAX31865::readRegisterN(uint8_t addr, uint8_t buffer[], uint8_t n) { buffer++; } - if (sclkPin == TERN(LARGE_PINMAP, -1UL, 255)) - SPI.endTransaction(); + spiEndTransaction(); +} - digitalWrite(cselPin, HIGH); +void MAX31865::writeRegister16(uint8_t addr, uint16_t data) { + spiBeginTransaction(); + spiTransfer(addr | 0x80); // make sure top bit is set + spiTransfer(data >> 8); + spiTransfer(data & 0xFF); + spiEndTransaction(); } /** @@ -491,22 +551,31 @@ void MAX31865::readRegisterN(uint8_t addr, uint8_t buffer[], uint8_t n) { * @param data the data to write */ void MAX31865::writeRegister8(uint8_t addr, uint8_t data) { - if (sclkPin == TERN(LARGE_PINMAP, -1UL, 255)) - SPI.beginTransaction(spiConfig); - else - digitalWrite(sclkPin, LOW); + spiBeginTransaction(); + spiTransfer(addr | 0x80); // make sure top bit is set + spiTransfer(data); + spiEndTransaction(); +} +void MAX31865::spiBeginTransaction() { + digitalWrite(sclkPin, LOW); // ensure CPOL0 + DELAY_NS_VAR(MAX31865_SPI_TIMING_TCWH); // ensure minimum time of CS inactivity after previous operation digitalWrite(cselPin, LOW); + DELAY_NS_VAR(MAX31865_SPI_TIMING_TCC); - #ifdef TARGET_LPC1768 - DELAY_CYCLES(spiSpeed); - #endif - - spiTransfer(addr | 0x80); // make sure top bit is set - spiTransfer(data); + if (sclkPin == TERN(LARGE_PINMAP, -1UL, 255)) + SPI.beginTransaction(spiConfig); + else + digitalWrite(sclkPin, HIGH); +} +void MAX31865::spiEndTransaction() { if (sclkPin == TERN(LARGE_PINMAP, -1UL, 255)) SPI.endTransaction(); + else + digitalWrite(sclkPin, LOW); + + DELAY_NS_VAR(MAX31865_SPI_TIMING_TCCH); digitalWrite(cselPin, HIGH); } @@ -521,42 +590,30 @@ void MAX31865::writeRegister8(uint8_t addr, uint8_t data) { * @return the 8-bit response */ uint8_t MAX31865::spiTransfer(uint8_t x) { - if (sclkPin == TERN(LARGE_PINMAP, -1UL, 255)) return SPI.transfer(x); - #ifdef TARGET_LPC1768 - - return swSpiTransfer(x, spiSpeed, sclkPin, misoPin, mosiPin); - - #else - - uint8_t reply = 0; - for (int i = 7; i >= 0; i--) { - digitalWrite(sclkPin, HIGH); DELAY_NS_VAR(spiDelay); - reply <<= 1; - digitalWrite(mosiPin, x & _BV(i)); DELAY_NS_VAR(spiDelay); - if (digitalRead(misoPin)) reply |= 1; - digitalWrite(sclkPin, LOW); DELAY_NS_VAR(spiDelay); - } - return reply; - - #endif + uint8_t reply = 0; + for (int i = 7; i >= 0; i--) { + digitalWrite(mosiPin, x & _BV(i)); + DELAY_NS_VAR(MAX31865_SPI_TIMING_TDC); + digitalWrite(sclkPin, LOW); + DELAY_NS_VAR(MAX31865_SPI_TIMING_TCL - MAX31865_SPI_TIMING_TDC); + reply <<= 1; + if (digitalRead(misoPin)) reply |= 1; + DELAY_NS_VAR(MAX31865_SPI_TIMING_TDC); + digitalWrite(sclkPin, HIGH); + DELAY_NS_VAR(MAX31865_SPI_TIMING_TCL - MAX31865_SPI_TIMING_TDC); + } + return reply; } -void MAX31865::softSpiBegin(const uint8_t spi_speed) { +void MAX31865::softSpiInit() { DEBUG_ECHOLNPGM("Initializing MAX31865 Software SPI"); - - #ifdef TARGET_LPC1768 - swSpiBegin(sclkPin, misoPin, mosiPin); - spiSpeed = swSpiInit(spi_speed, sclkPin, mosiPin); - #else - spiDelay = (100UL << spi_speed) / 3; // Calculate delay in ns. Top speed is ~10MHz, or 100ns delay between bits. - pinMode(sclkPin, OUTPUT); - digitalWrite(sclkPin, LOW); - pinMode(mosiPin, OUTPUT); - pinMode(misoPin, INPUT); - #endif + pinMode(sclkPin, OUTPUT); + digitalWrite(sclkPin, LOW); + pinMode(mosiPin, OUTPUT); + pinMode(misoPin, INPUT); } #endif // HAS_MAX31865 && !USE_ADAFRUIT_MAX31865 diff --git a/Marlin/src/libs/MAX31865.h b/Marlin/src/libs/MAX31865.h index bc7733b835ec..baea455485d4 100644 --- a/Marlin/src/libs/MAX31865.h +++ b/Marlin/src/libs/MAX31865.h @@ -101,11 +101,7 @@ class MAX31865 { TERN(LARGE_PINMAP, uint32_t, uint8_t) sclkPin, misoPin, mosiPin, cselPin; - #ifdef TARGET_LPC1768 - uint8_t spiSpeed; - #else - uint16_t spiDelay; - #endif + uint16_t spiDelay; float zeroRes, refRes, wireRes; @@ -121,6 +117,11 @@ class MAX31865 { one_shot_event_t nextEvent; #endif + #ifdef MAX31865_IGNORE_INITIAL_FAULTY_READS + uint8_t ignore_faults = MAX31865_IGNORE_INITIAL_FAULTY_READS; + uint16_t fixFault(uint16_t rtd); + #endif + uint8_t stdFlags = 0; void setConfig(uint8_t config, bool enable); @@ -130,9 +131,12 @@ class MAX31865 { uint16_t readRegister16(uint8_t addr); void writeRegister8(uint8_t addr, uint8_t reg); - uint8_t spiTransfer(uint8_t addr); + void writeRegister16(uint8_t addr, uint16_t reg); - void softSpiBegin(const uint8_t spi_speed); + void softSpiInit(); + void spiBeginTransaction(); + uint8_t spiTransfer(uint8_t addr); + void spiEndTransaction(); void initFixedFlags(max31865_numwires_t wires); @@ -141,6 +145,10 @@ class MAX31865 { void oneShot(); void resetFlags(); + uint16_t readRawImmediate(); + + void runAutoFaultDetectionCycle(); + public: #if ENABLED(LARGE_PINMAP) MAX31865(uint32_t spi_cs, uint8_t pin_mapping); From 8799837d75744c697f7dee994b327632c27cbfe4 Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Sat, 5 Feb 2022 17:23:44 +0100 Subject: [PATCH 090/502] =?UTF-8?q?=F0=9F=94=A8=20Clean=20up=20upload.py?= =?UTF-8?q?=20(#23679)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/scripts/upload.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index f6b25396adad..c7730d8f299d 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -142,7 +142,7 @@ def _RemoveFirmwareFile(FirmwareFile): upload_port = _GetUploadPort(env) # Serial port to use # Set local upload params - upload_firmware_target_name = os.path.basename(upload_firmware_source_name) # WARNING! Need rework on "binary_stream" to allow filename > 8.3 + upload_firmware_target_name = os.path.basename(upload_firmware_source_name) # Target firmware filename upload_timeout = 1000 # Communication timout, lossy/slow connections need higher values upload_blocksize = 512 # Transfer block size. 512 = Autodetect @@ -154,11 +154,11 @@ def _RemoveFirmwareFile(FirmwareFile): # Set local upload params based on board type to change script behavior # "upload_delete_old_bins": delete all *.bin files in the root of SD Card upload_delete_old_bins = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423', - 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', + 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', 'BOARD_CREALITY_V24S1'] # "upload_random_name": generate a random 8.3 firmware filename to upload upload_random_filename = marlin_motherboard in ['BOARD_CREALITY_V4', 'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423', - 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', + 'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453', 'BOARD_CREALITY_V24S1'] and not marlin_long_filename_host_support try: @@ -258,7 +258,7 @@ def _RemoveFirmwareFile(FirmwareFile): print('Trigger firmware update...') protocol.send_ascii('M997', True) - protocol: protocol.shutdown() + protocol.shutdown() print('Firmware update completed') except KeyboardInterrupt: From 82ae3646cb709537574869e469c242b406087827 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 6 Feb 2022 05:52:18 +1300 Subject: [PATCH 091/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20missing=20u8g=5Fes?= =?UTF-8?q?p32=5Fspi=20(#23562)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp | 99 +++++++++++++++++++++++ Marlin/src/lcd/dogm/HAL_LCD_com_defines.h | 5 ++ 2 files changed, 104 insertions(+) create mode 100644 Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp diff --git a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp new file mode 100644 index 000000000000..e454130d43f3 --- /dev/null +++ b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp @@ -0,0 +1,99 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * Copypaste of SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#ifdef ARDUINO_ARCH_ESP32 + +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(FYSETC_MINI_12864_2_1) + +#include +#include "Arduino.h" +#include "../shared/HAL_SPI.h" +#include "SPI.h" + +static SPISettings spiConfig; + +#define MDOGLCD_MOSI 23 +#define MDOGLCD_SCK 18 +#define MLCD_RESET_PIN 0 +#define MLCD_PINS_DC 4 +#define MDOGLCD_CS 21 +#define MDOGLCD_A0 4 + +#ifndef LCD_SPI_SPEED + #ifdef SD_SPI_SPEED + #define LCD_SPI_SPEED SD_SPI_SPEED // Assume SPI speed shared with SD + #else + #define LCD_SPI_SPEED SPI_FULL_SPEED // Use full speed if SD speed is not supplied + #endif +#endif + +uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { + static uint8_t msgInitCount = 2; // Ignore all messages until 2nd U8G_COM_MSG_INIT + if (msgInitCount) { + if (msg == U8G_COM_MSG_INIT) msgInitCount--; + if (msgInitCount) return -1; + } + + switch (msg) { + case U8G_COM_MSG_STOP: break; + + case U8G_COM_MSG_INIT: + OUT_WRITE(MDOGLCD_CS, HIGH); + OUT_WRITE(MDOGLCD_A0, HIGH); + OUT_WRITE(MLCD_RESET_PIN, HIGH); + u8g_Delay(5); + spiBegin(); + spiInit(LCD_SPI_SPEED); + break; + + case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ + WRITE(MDOGLCD_A0, arg_val ? HIGH : LOW); + break; + + case U8G_COM_MSG_CHIP_SELECT: /* arg_val == 0 means HIGH level of U8G_PI_CS */ + WRITE(MDOGLCD_CS, arg_val ? LOW : HIGH); + break; + + case U8G_COM_MSG_RESET: + WRITE(MLCD_RESET_PIN, arg_val); + break; + + case U8G_COM_MSG_WRITE_BYTE: + spiSend((uint8_t)arg_val); + break; + + case U8G_COM_MSG_WRITE_SEQ: + uint8_t *ptr = (uint8_t*) arg_ptr; + while (arg_val > 0) { + spiSend(*ptr++); + arg_val--; + } + break; + } + return 1; +} + +#endif // FYSETC_MINI_12864_2_1 +#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h index a30dd4ca17f3..e5c6524a9ec4 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h @@ -57,6 +57,11 @@ #define U8G_COM_HAL_SW_SPI_FN u8g_com_std_sw_spi_fn #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn + #elif defined(ESP32) + + uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + #define U8G_COM_HAL_HW_SPI_FN u8g_eps_hw_spi_fn + #elif defined(__AVR__) uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); From 58239c65cbe0563d8f3a223b3ca2091dbbd1ee14 Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Sun, 6 Feb 2022 08:35:18 -0600 Subject: [PATCH 092/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20init=20of=20delta?= =?UTF-8?q?=20safe=20height=20(for=20G29,=20G33,=20etc.)=20(#23622)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 4 ++++ Marlin/src/module/delta.cpp | 7 +++++++ Marlin/src/module/delta.h | 2 ++ Marlin/src/module/motion.cpp | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index e34c0d6c3c10..302e94494e1a 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1339,6 +1339,10 @@ void setup() { SETUP_RUN(endstops.init()); // Init endstops and pullups + #if ENABLED(DELTA) && !HAS_SOFTWARE_ENDSTOPS + SETUP_RUN(refresh_delta_clip_start_height()); // Init safe delta height without soft endstops + #endif + SETUP_RUN(stepper.init()); // Init stepper. This enables interrupts! #if HAS_SERVOS diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index 2a4efb47da73..cd40175da4d2 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -63,6 +63,13 @@ abc_float_t delta_diagonal_rod_trim; float delta_safe_distance_from_top(); +void refresh_delta_clip_start_height() { + delta_clip_start_height = TERN(HAS_SOFTWARE_ENDSTOPS, + soft_endstop.max.z, + DIFF_TERN(HAS_BED_PROBE, delta_height, probe.offset.z) + ) - delta_safe_distance_from_top(); +} + /** * Recalculate factors used for delta kinematics whenever * settings have been changed (e.g., by M665). diff --git a/Marlin/src/module/delta.h b/Marlin/src/module/delta.h index f1e43c7e4c9d..7cd42805c90a 100644 --- a/Marlin/src/module/delta.h +++ b/Marlin/src/module/delta.h @@ -82,6 +82,8 @@ void inverse_kinematics(const xyz_pos_t &raw); */ float delta_safe_distance_from_top(); +void refresh_delta_clip_start_height(); + /** * Delta Forward Kinematics * diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 51f0681a150e..4b0c6aba7d35 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -743,7 +743,7 @@ void restore_feedrate_and_scaling() { delta_max_radius_2 = sq(delta_max_radius); break; case Z_AXIS: - delta_clip_start_height = soft_endstop.max[axis] - delta_safe_distance_from_top(); + refresh_delta_clip_start_height(); default: break; } From 6e23ffd12c459908a5c9f8f02c02cd4841cf691f Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Mon, 7 Feb 2022 15:40:14 -0500 Subject: [PATCH 093/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Gen?= =?UTF-8?q?eric=20Maple=20STM32F103RC=20envs=20for=20devs=20(#23686)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/stm32f1-maple.ini | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index 774c3b2efb92..9ea848f1b6b1 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -111,6 +111,14 @@ extends = common_stm32f1 board = genericSTM32F103RE monitor_speed = 115200 +# +# Generic STM32F103RC environment +# +[env:STM32F103RC_maple] +extends = common_stm32f1 +board = genericSTM32F103RC +monitor_speed = 115200 + # # Creality (STM32F103RET6) # @@ -125,6 +133,20 @@ extra_scripts = ${common_stm32f1.extra_scripts} debug_tool = jlink upload_protocol = jlink +# +# Creality (STM32F103RCT6) +# +[env:STM32F103RC_creality_maple] +extends = env:STM32F103RC_maple +build_flags = ${common_stm32f1.build_flags} -DTEMP_TIMER_CHAN=4 +board_build.address = 0x08007000 +board_build.ldscript = creality.ld +extra_scripts = ${common_stm32f1.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/random-bin.py + buildroot/share/PlatformIO/scripts/custom_board.py +debug_tool = jlink +upload_protocol = jlink + # # BigTree SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3) # From c4341a4e351978a228272e583dd72f999eca643c Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Tue, 8 Feb 2022 09:49:26 +1300 Subject: [PATCH 094/502] =?UTF-8?q?=F0=9F=9A=A8=20Cleaner=20errors=20for?= =?UTF-8?q?=20renamed=20envs=20(#23690)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/renamed.ini | 25 +++++++++++++++++++++++++ platformio.ini | 1 + 2 files changed, 26 insertions(+) create mode 100644 ini/renamed.ini diff --git a/ini/renamed.ini b/ini/renamed.ini new file mode 100644 index 000000000000..bc1e438d60c1 --- /dev/null +++ b/ini/renamed.ini @@ -0,0 +1,25 @@ +# +# Marlin Firmware +# PlatformIO Configuration File +# + +################################# +# # +# Renamed Environments # +# # +################################# + +# +# List of environment names that are no longer used +# + +[env:STM32F103RET6_creality_maple] +extends = env:STM32F103RE_maple + +[env:STM32F103RET6_creality] +extends = STM32F103Rx_creality +board = genericSTM32F103RE + +[env:STM32F103RET6_creality_xfer] +extends = STM32F103Rx_creality_xfer +board = genericSTM32F103RE diff --git a/platformio.ini b/platformio.ini index e1db73a4bd12..43c7e2be6bf4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -32,6 +32,7 @@ extra_configs = ini/stm32h7.ini ini/stm32g0.ini ini/teensy.ini + ini/renamed.ini # # The 'common' section applies to most Marlin builds. From 942f08852241a4584e82581967d6d01b375a5474 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Mon, 7 Feb 2022 17:22:18 -0500 Subject: [PATCH 095/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Maple=20HAL=20comp?= =?UTF-8?q?ile=20errors=20(#23685)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32F1/onboard_sd.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/onboard_sd.cpp b/Marlin/src/HAL/STM32F1/onboard_sd.cpp index 582ee3853d00..a3d8dcb2d57e 100644 --- a/Marlin/src/HAL/STM32F1/onboard_sd.cpp +++ b/Marlin/src/HAL/STM32F1/onboard_sd.cpp @@ -38,8 +38,13 @@ #define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_2 #endif -#define CS_LOW() WRITE(ONBOARD_SD_CS_PIN, LOW) // Set OnboardSPI cs low -#define CS_HIGH() WRITE(ONBOARD_SD_CS_PIN, HIGH) // Set OnboardSPI cs high +#if PIN_EXISTS(ONBOARD_SD_CS) && ONBOARD_SD_CS_PIN != SD_SS_PIN + #define CS_LOW() WRITE(ONBOARD_SD_CS_PIN, LOW) // Set OnboardSPI cs low + #define CS_HIGH() WRITE(ONBOARD_SD_CS_PIN, HIGH) // Set OnboardSPI cs high +#else + #define CS_LOW() + #define CS_HIGH() +#endif #define FCLK_FAST() ONBOARD_SD_SPI.setClockDivider(SPI_CLOCK_MAX) #define FCLK_SLOW() ONBOARD_SD_SPI.setClockDivider(SPI_BAUD_PCLK_DIV_256) From e255e4a69fa07c194b44e242cd3d20e2dacffa9b Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Mon, 7 Feb 2022 17:24:18 -0500 Subject: [PATCH 096/502] PLR accessors for Ext UI (#23687) --- Marlin/src/lcd/extui/ui_api.cpp | 9 +++++++++ Marlin/src/lcd/extui/ui_api.h | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index f2763c893f70..f44e8bf72032 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -94,6 +94,10 @@ #include "../../feature/caselight.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../feature/powerloss.h" +#endif + #if ENABLED(BABYSTEPPING) #include "../../feature/babystep.h" #endif @@ -674,6 +678,11 @@ namespace ExtUI { #endif #endif + #if ENABLED(POWER_LOSS_RECOVERY) + bool getPowerLossRecoveryEnabled() { return recovery.enabled; } + void setPowerLossRecoveryEnabled(const bool value) { recovery.enable(value); } + #endif + #if ENABLED(LIN_ADVANCE) float getLinearAdvance_mm_mm_s(const extruder_t extruder) { return (extruder < EXTRUDERS) ? planner.extruder_advance_K[extruder - E0] : 0; diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 59b509981b88..6753c53740f8 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -315,6 +315,11 @@ namespace ExtUI { #endif #endif + #if ENABLED(POWER_LOSS_RECOVERY) + bool getPowerLossRecoveryEnabled(); + void setPowerLossRecoveryEnabled(const bool); + #endif + #if ENABLED(PIDTEMP) float getPIDValues_Kp(const extruder_t); float getPIDValues_Ki(const extruder_t); From 973366e6aafd2eca76105c4948c310e750e65cc2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 8 Feb 2022 17:03:38 -0600 Subject: [PATCH 097/502] =?UTF-8?q?=F0=9F=94=A7=20Update=20MIXING=5FEXTRUD?= =?UTF-8?q?ER=20sanity=20checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixing #23693 --- Marlin/src/inc/SanityCheck.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 09aae1e2c2fe..04b2271ab112 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1224,14 +1224,16 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "For MIXING_EXTRUDER set MIXING_STEPPERS > 1 instead of EXTRUDERS > 1." #elif MIXING_STEPPERS < 2 #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder." - #elif ENABLED(FILAMENT_SENSOR) - #error "MIXING_EXTRUDER is incompatible with FILAMENT_SENSOR. Comment out this line to use it anyway." + #elif ENABLED(FILAMENT_WIDTH_SENSOR) + #error "MIXING_EXTRUDER is incompatible with FILAMENT_WIDTH_SENSOR. Comment out this line to use it anyway." #elif ENABLED(SWITCHING_EXTRUDER) #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both." #elif ENABLED(SINGLENOZZLE) #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE." #elif ENABLED(DISABLE_INACTIVE_EXTRUDER) #error "MIXING_EXTRUDER is incompatible with DISABLE_INACTIVE_EXTRUDER." + #elif HAS_FILAMENT_RUNOUT_DISTANCE + #error "MIXING_EXTRUDER is incompatible with FILAMENT_RUNOUT_DISTANCE_MM." #endif #endif From b964d2fff00a138d59d46cf3213956067df930b3 Mon Sep 17 00:00:00 2001 From: Taylor Talkington Date: Tue, 8 Feb 2022 18:36:06 -0500 Subject: [PATCH 098/502] =?UTF-8?q?=E2=9C=A8=20Optional=20HOST=5FSTATUS=5F?= =?UTF-8?q?NOTIFICATIONS=20(#22833)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 11 +++++++---- Marlin/src/gcode/control/M111.cpp | 8 ++++++++ Marlin/src/inc/SanityCheck.h | 6 ------ Marlin/src/inc/Warnings.cpp | 10 ++++++++++ Marlin/src/lcd/marlinui.cpp | 7 +++++-- Marlin/src/module/printcounter.cpp | 1 - Marlin/src/module/settings.cpp | 23 ++++++++++++++++++++--- Marlin/src/module/temperature.cpp | 4 ++++ buildroot/tests/rambo | 2 +- 9 files changed, 55 insertions(+), 17 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fa5c461cd7ec..7ea1faabb45d 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3952,10 +3952,13 @@ */ //#define HOST_ACTION_COMMANDS #if ENABLED(HOST_ACTION_COMMANDS) - //#define HOST_PAUSE_M76 - //#define HOST_PROMPT_SUPPORT - //#define HOST_START_MENU_ITEM // Add a menu item that tells the host to start - //#define HOST_SHUTDOWN_MENU_ITEM // Add a menu item that tells the host to shut down + //#define HOST_PAUSE_M76 // Tell the host to pause in response to M76 + //#define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback + #if ENABLED(HOST_PROMPT_SUPPORT) + //#define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications + #endif + //#define HOST_START_MENU_ITEM // Add a menu item that tells the host to start + //#define HOST_SHUTDOWN_MENU_ITEM // Add a menu item that tells the host to shut down #endif /** diff --git a/Marlin/src/gcode/control/M111.cpp b/Marlin/src/gcode/control/M111.cpp index d6aeb774108b..846bf7055676 100644 --- a/Marlin/src/gcode/control/M111.cpp +++ b/Marlin/src/gcode/control/M111.cpp @@ -22,12 +22,20 @@ #include "../gcode.h" +#if ENABLED(HOST_ACTION_COMMANDS) + #include "../../feature/host_actions.h" +#endif + /** * M111: Set the debug level */ void GcodeSuite::M111() { if (parser.seenval('S')) marlin_debug_flags = parser.value_byte(); + #if EITHER(HOST_ACTION_COMMANDS, HOST_PROMPT_SUPPORT) + if (parser.seenval('H')) hostui.flag.bits = parser.value_byte(); + #endif + static PGMSTR(str_debug_1, STR_DEBUG_ECHO); static PGMSTR(str_debug_2, STR_DEBUG_INFO); static PGMSTR(str_debug_4, STR_DEBUG_ERRORS); diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 04b2271ab112..43ec02393ede 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -609,12 +609,6 @@ #error "LCD_SCREEN_ROT_270 is now LCD_SCREEN_ROTATE with a value of 270." #endif -#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) - #warning "Onboard temperature sensor for BOARD_DUE3DOM_MINI has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)." -#elif MB(BTT_SKR_E3_TURBO) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) - #warning "Onboard temperature sensor for BOARD_BTT_SKR_E3_TURBO has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)." -#endif - constexpr float arm[] = AXIS_RELATIVE_MODES; static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements."); diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index c5f03e7dbcce..246e152ed4db 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -59,6 +59,12 @@ #warning "Your Configuration provides no method to acquire user feedback!" #endif +#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) + #warning "Onboard temperature sensor for BOARD_DUE3DOM_MINI has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)." +#elif MB(BTT_SKR_E3_TURBO) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) + #warning "Onboard temperature sensor for BOARD_BTT_SKR_E3_TURBO has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)." +#endif + #ifndef NO_AUTO_ASSIGN_WARNING #if AUTO_ASSIGNED_X2_STEPPER @@ -541,6 +547,10 @@ #warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225)." #endif +#if PRINTCOUNTER_SYNC + #warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save." +#endif + #if HOMING_Z_WITH_PROBE && IS_CARTESIAN && DISABLED(Z_SAFE_HOMING) #error "Z_SAFE_HOMING is recommended when homing with a probe. Enable Z_SAFE_HOMING or comment out this line to continue." #endif diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 7acc3091ed45..5c9f48a3f9c8 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1363,7 +1363,7 @@ void MarlinUI::init() { void MarlinUI::set_status(const char * const cstr, const bool persist) { if (alert_level) return; - TERN_(HOST_PROMPT_SUPPORT, hostui.notify(cstr)); + TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify(cstr)); // Here we have a problem. The message is encoded in UTF8, so // arbitrarily cutting it will be a problem. We MUST be sure @@ -1435,7 +1435,7 @@ void MarlinUI::init() { if (level < alert_level) return; alert_level = level; - TERN_(HOST_PROMPT_SUPPORT, hostui.notify(fstr)); + TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify(fstr)); // Since the message is encoded in UTF8 it must // only be cut on a character boundary. @@ -1473,6 +1473,9 @@ void MarlinUI::init() { va_start(args, FTOP(fmt)); vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, FTOP(fmt), args); va_end(args); + + TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify(status_message)); + finish_status(level > 0); } diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index 27dee76715d4..affb6087802c 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -43,7 +43,6 @@ Stopwatch print_job_timer; // Global Print Job Timer instance #if PRINTCOUNTER_SYNC #include "../module/planner.h" - #warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save." #endif // Service intervals diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index ab498b7df35a..17a6500b80c6 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -80,6 +80,10 @@ #include "../lcd/e3v2/jyersui/dwin.h" #endif +#if ENABLED(HOST_PROMPT_SUPPORT) + #include "../feature/host_actions.h" +#endif + #if HAS_SERVOS #include "servo.h" #endif @@ -652,6 +656,10 @@ void MarlinSettings::postprocess() { #define DEBUG_OUT EITHER(EEPROM_CHITCHAT, DEBUG_LEVELING_FEATURE) #include "../core/debug_out.h" +#if BOTH(EEPROM_CHITCHAT, HOST_PROMPT_SUPPORT) + #define HOST_EEPROM_CHITCHAT 1 +#endif + #if ENABLED(EEPROM_SETTINGS) #define EEPROM_ASSERT(TST,ERR) do{ if (!(TST)) { SERIAL_ERROR_MSG(ERR); eeprom_error = true; } }while(0) @@ -1554,7 +1562,10 @@ void MarlinSettings::postprocess() { store_mesh(ubl.storage_slot); #endif - if (!eeprom_error) LCD_MESSAGE(MSG_SETTINGS_STORED); + if (!eeprom_error) { + LCD_MESSAGE(MSG_SETTINGS_STORED); + TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_SETTINGS_STORED))); + } TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreWritten(!eeprom_error)); @@ -1578,6 +1589,7 @@ void MarlinSettings::postprocess() { } DEBUG_ECHO_MSG("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")"); TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_ERR_EEPROM_VERSION)); + TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_VERSION))); IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_version()); eeprom_error = true; @@ -2468,12 +2480,14 @@ void MarlinSettings::postprocess() { eeprom_error = true; DEBUG_ERROR_MSG("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!"); TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_ERR_EEPROM_CRC)); + TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_CRC))); IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_crc()); } else if (!validating) { DEBUG_ECHO_START(); DEBUG_ECHO(version); DEBUG_ECHOLNPGM(" stored settings retrieved (", eeprom_index - (EEPROM_OFFSET), " bytes; crc ", (uint32_t)working_crc, ")"); + TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(F("Stored settings retrieved"))); } if (!validating && !eeprom_error) postprocess(); @@ -2783,7 +2797,6 @@ void MarlinSettings::reset() { #endif #endif - TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset()); TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_SetDataDefaults()); TERN_(DWIN_CREALITY_LCD_JYERSUI, CrealityDWIN.Reset_Settings()); @@ -3142,7 +3155,11 @@ void MarlinSettings::reset() { postprocess(); - DEBUG_ECHO_MSG("Hardcoded Default Settings Loaded"); + FSTR_P const hdsl = F("Hardcoded Default Settings Loaded"); + TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(hdsl)); + DEBUG_ECHO_START(); DEBUG_ECHOLNF(hdsl); + + TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset()); } #if DISABLED(DISABLE_M503) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index e59a9f49cbeb..34ea7c2f3a58 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -629,6 +629,7 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); + TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); return; } @@ -719,6 +720,7 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); + TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); break; } @@ -756,12 +758,14 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(DWIN_CREALITY_LCD, DWIN_Popup_Temperature(0)); TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TUNING_TIMEOUT)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT)); + TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TIMEOUT))); SERIAL_ECHOLNPGM(STR_PID_TIMEOUT); break; } if (cycles > ncycles && cycles > 2) { SERIAL_ECHOLNPGM(STR_PID_AUTOTUNE_FINISHED); + TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE))); #if EITHER(PIDTEMPBED, PIDTEMPCHAMBER) FSTR_P const estring = GHV(F("chamber"), F("bed"), FPSTR(NUL_STR)); diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo index 92e8bc2b5f45..e696dce96ec3 100755 --- a/buildroot/tests/rambo +++ b/buildroot/tests/rambo @@ -115,7 +115,7 @@ opt_set MOTHERBOARD BOARD_RAMBO \ FAN_MIN_PWM 50 FAN_KICKSTART_TIME 100 \ XY_FREQUENCY_LIMIT 15 opt_enable COREYX USE_XMAX_PLUG MIXING_EXTRUDER GRADIENT_MIX \ - BABYSTEPPING BABYSTEP_DISPLAY_TOTAL FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR \ + BABYSTEPPING BABYSTEP_DISPLAY_TOTAL FILAMENT_LCD_DISPLAY \ REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER MENU_ADDAUTOSTART SDSUPPORT SDCARD_SORT_ALPHA \ ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM \ FIX_MOUNTED_PROBE PROBING_ESTEPPERS_OFF PROBE_OFFSET_WIZARD \ From 38484c6eb6b0f1c8a49f46efaef707165dc539f6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 8 Feb 2022 18:02:28 -0600 Subject: [PATCH 099/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Dro?= =?UTF-8?q?p=20hostui.flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/host_actions.cpp | 8 -------- Marlin/src/feature/host_actions.h | 8 -------- Marlin/src/gcode/control/M111.cpp | 8 -------- 3 files changed, 24 deletions(-) diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index be7b055b55f7..c03a6bc5976e 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -39,10 +39,7 @@ HostUI hostui; -flag_t HostUI::flag; - void HostUI::action(FSTR_P const fstr, const bool eol) { - if (!flag.bits) return; PORT_REDIRECT(SerialMask::All); SERIAL_ECHOPGM("//action:"); SERIAL_ECHOF(fstr); @@ -96,21 +93,18 @@ void HostUI::action(FSTR_P const fstr, const bool eol) { #endif void HostUI::notify(const char * const cstr) { - if (!flag.bits) return; PORT_REDIRECT(SerialMask::All); action(F("notification "), false); SERIAL_ECHOLN(cstr); } void HostUI::notify_P(PGM_P const pstr) { - if (!flag.bits) return; PORT_REDIRECT(SerialMask::All); action(F("notification "), false); SERIAL_ECHOLNPGM_P(pstr); } void HostUI::prompt(FSTR_P const ptype, const bool eol/*=true*/) { - if (!flag.bits) return; PORT_REDIRECT(SerialMask::All); action(F("prompt_"), false); SERIAL_ECHOF(ptype); @@ -118,7 +112,6 @@ void HostUI::action(FSTR_P const fstr, const bool eol) { } void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) { - if (!flag.bits) return; prompt(ptype, false); PORT_REDIRECT(SerialMask::All); SERIAL_CHAR(' '); @@ -127,7 +120,6 @@ void HostUI::action(FSTR_P const fstr, const bool eol) { SERIAL_EOL(); } void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) { - if (!flag.bits) return; prompt_end(); host_prompt_reason = reason; prompt_plus(F("begin"), fstr, extra_char); diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index 78a7821eba85..41d66b82ec9b 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -24,11 +24,6 @@ #include "../inc/MarlinConfigPre.h" #include "../HAL/shared/Marduino.h" -typedef union { - uint8_t bits; - struct { bool info:1, errors:1, debug:1; }; -} flag_t; - #if ENABLED(HOST_PROMPT_SUPPORT) enum PromptReason : uint8_t { @@ -45,9 +40,6 @@ typedef union { class HostUI { public: - static flag_t flag; - HostUI() { flag.bits = 0xFF; } - static void action(FSTR_P const fstr, const bool eol=true); #ifdef ACTION_ON_KILL diff --git a/Marlin/src/gcode/control/M111.cpp b/Marlin/src/gcode/control/M111.cpp index 846bf7055676..d6aeb774108b 100644 --- a/Marlin/src/gcode/control/M111.cpp +++ b/Marlin/src/gcode/control/M111.cpp @@ -22,20 +22,12 @@ #include "../gcode.h" -#if ENABLED(HOST_ACTION_COMMANDS) - #include "../../feature/host_actions.h" -#endif - /** * M111: Set the debug level */ void GcodeSuite::M111() { if (parser.seenval('S')) marlin_debug_flags = parser.value_byte(); - #if EITHER(HOST_ACTION_COMMANDS, HOST_PROMPT_SUPPORT) - if (parser.seenval('H')) hostui.flag.bits = parser.value_byte(); - #endif - static PGMSTR(str_debug_1, STR_DEBUG_ECHO); static PGMSTR(str_debug_2, STR_DEBUG_INFO); static PGMSTR(str_debug_4, STR_DEBUG_ERRORS); From 11071c747272d3546ee02e16c1a2a2ffe4893f61 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Thu, 10 Feb 2022 05:46:53 +1300 Subject: [PATCH 100/502] =?UTF-8?q?=F0=9F=9A=B8=20Restore=20active=20tool?= =?UTF-8?q?=20after=20ABL=20G29=20(#23692)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 4 ++-- Marlin/src/gcode/bedlevel/G35.cpp | 2 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 11 ++++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 15395bcc8d58..023d0c5b1d63 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -316,7 +316,7 @@ void unified_bed_leveling::G29() { planner.synchronize(); // Send 'N' to force homing before G29 (internal only) if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes(); - TERN_(HAS_MULTI_HOTEND, if (active_extruder) tool_change(0)); + TERN_(HAS_MULTI_HOTEND, if (active_extruder != 0) tool_change(0, true)); } // Invalidate one or more nearby mesh points, possibly all. @@ -663,7 +663,7 @@ void unified_bed_leveling::G29() { UNUSED(probe_deployed); #endif - TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index)); + TERN_(HAS_MULTI_HOTEND, if (old_tool_index != 0) tool_change(old_tool_index)); return; } diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index 4dd1323a6c29..dd828bf0c873 100644 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -155,7 +155,7 @@ void GcodeSuite::G35() { // Restore the active tool after homing #if HAS_MULTI_HOTEND - tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER)); // Fetch previous toolhead if not PARKING_EXTRUDER + if (old_tool_index != 0) tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER)); // Fetch previous toolhead if not PARKING_EXTRUDER #endif #if BOTH(HAS_LEVELING, RESTORE_LEVELING_AFTER_G35) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index eea5d4a7f251..51d658b20e57 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -93,6 +93,10 @@ class G29_State { bool dryrun, reenable; + #if HAS_MULTI_HOTEND + uint8_t tool_index; + #endif + #if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR) int abl_probe_index; #endif @@ -263,7 +267,10 @@ G29_TYPE GcodeSuite::G29() { */ if (!g29_in_progress) { - TERN_(HAS_MULTI_HOTEND, if (active_extruder) tool_change(0)); + #if HAS_MULTI_HOTEND + abl.tool_index = active_extruder; + if (active_extruder != 0) tool_change(0, true); + #endif #if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR) abl.abl_probe_index = -1; @@ -891,6 +898,8 @@ G29_TYPE GcodeSuite::G29() { TERN_(HAS_DWIN_E3V2_BASIC, DWIN_CompletedLeveling()); + TERN_(HAS_MULTI_HOTEND, if (abl.tool_index != 0) tool_change(abl.tool_index)); + report_current_position(); TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE)); From 3e18cf2b6ac354ec679f028d3b3616e4cc51e72c Mon Sep 17 00:00:00 2001 From: MOHAMMAD RASIM Date: Wed, 9 Feb 2022 21:29:34 +0300 Subject: [PATCH 101/502] =?UTF-8?q?=F0=9F=9A=B8=20Fix,=20Improve=20Power-L?= =?UTF-8?q?oss=20Recovery=20(#22828)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/feature/powerloss.cpp | 43 ++++++++++++++------- Marlin/src/feature/powerloss.h | 4 +- Marlin/src/gcode/calibrate/G28.cpp | 11 ++++-- Marlin/src/gcode/feature/powerloss/M413.cpp | 5 +-- Marlin/src/inc/SanityCheck.h | 2 - Marlin/src/module/planner.cpp | 6 ++- Marlin/src/module/planner.h | 3 +- Marlin/src/module/stepper.cpp | 5 ++- 8 files changed, 51 insertions(+), 28 deletions(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 723ec1903bc8..214c248d359c 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -54,6 +54,10 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0 #include "../module/temperature.h" #include "../core/serial.h" +#if HOMING_Z_WITH_PROBE + #include "../module/probe.h" +#endif + #if ENABLED(FWRETRACT) #include "fwretract.h" #endif @@ -178,7 +182,8 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW info.valid_foot = info.valid_head; // Machine state - info.current_position = current_position; + // info.sdpos and info.current_position are pre-filled from the Stepper ISR + info.feedrate = uint16_t(MMS_TO_MMM(feedrate_mm_s)); info.zraise = zraise; info.flag.raised = raised; // Was Z raised before power-off? @@ -265,6 +270,10 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW #endif +#endif // POWER_LOSS_PIN + +#if PIN_EXISTS(POWER_LOSS) || ENABLED(DEBUG_POWER_LOSS_RECOVERY) + /** * An outage was detected by a sensor pin. * - If not SD printing, let the machine turn off on its own with no "KILL" screen @@ -273,7 +282,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW * - If backup power is available Retract E and Raise Z * - Go to the KILL screen */ - void PrintJobRecovery::_outage() { + void PrintJobRecovery::_outage(TERN_(DEBUG_POWER_LOSS_RECOVERY, const bool simulated/*=false*/)) { #if ENABLED(BACKUP_POWER_SUPPLY) static bool lock = false; if (lock) return; // No re-entrance from idle() during retract_and_lift() @@ -301,10 +310,16 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW retract_and_lift(zraise); #endif - kill(GET_TEXT_F(MSG_OUTAGE_RECOVERY)); + if (TERN0(DEBUG_POWER_LOSS_RECOVERY, simulated)) { + card.fileHasFinished(); + current_position.reset(); + sync_plan_position(); + } + else + kill(GET_TEXT_F(MSG_OUTAGE_RECOVERY)); } -#endif +#endif // POWER_LOSS_PIN || DEBUG_POWER_LOSS_RECOVERY /** * Save the recovery info the recovery file @@ -390,14 +405,12 @@ void PrintJobRecovery::resume() { #if ENABLED(POWER_LOSS_RECOVER_ZHOME) && defined(POWER_LOSS_ZHOME_POS) #define HOMING_Z_DOWN 1 - #else - #define HOME_XY_ONLY 1 #endif float z_now = info.flag.raised ? z_raised : z_print; - // Reset E to 0 and set Z to the real position - #if HOME_XY_ONLY + #if !HOMING_Z_DOWN + // Set Z to the real position sprintf_P(cmd, PSTR("G92.9Z%s"), dtostrf(z_now, 1, 3, str_1)); gcode.process_subcommands_now(cmd); #endif @@ -409,15 +422,15 @@ void PrintJobRecovery::resume() { gcode.process_subcommands_now(cmd); } - // Home XY with no Z raise, and also home Z here if Z isn't homing down below. - gcode.process_subcommands_now(F("G28R0" TERN_(HOME_XY_ONLY, "XY"))); // No raise during G28 + // Home XY with no Z raise + gcode.process_subcommands_now(F("G28R0XY")); // No raise during G28 #endif #if HOMING_Z_DOWN // Move to a safe XY position and home Z while avoiding the print. - constexpr xy_pos_t p = POWER_LOSS_ZHOME_POS; - sprintf_P(cmd, PSTR("G1X%sY%sF1000\nG28Z"), dtostrf(p.x, 1, 3, str_1), dtostrf(p.y, 1, 3, str_2)); + const xy_pos_t p = xy_pos_t(POWER_LOSS_ZHOME_POS) TERN_(HOMING_Z_WITH_PROBE, - probe.offset_xy); + sprintf_P(cmd, PSTR("G1X%sY%sF1000\nG28HZ"), dtostrf(p.x, 1, 3, str_1), dtostrf(p.y, 1, 3, str_2)); gcode.process_subcommands_now(cmd); #endif @@ -431,7 +444,7 @@ void PrintJobRecovery::resume() { sprintf_P(cmd, PSTR("M420S%cZ%s"), '0' + (char)info.flag.leveling, dtostrf(info.fade, 1, 1, str_1)); gcode.process_subcommands_now(cmd); - #if HOME_XY_ONLY + #if !HOMING_Z_DOWN // The physical Z was adjusted at power-off so undo the M420S1 correction to Z with G92.9. sprintf_P(cmd, PSTR("G92.9Z%s"), dtostrf(z_now, 1, 1, str_1)); gcode.process_subcommands_now(cmd); @@ -513,12 +526,12 @@ void PrintJobRecovery::resume() { // Un-retract if there was a retract at outage #if ENABLED(BACKUP_POWER_SUPPLY) && POWER_LOSS_RETRACT_LEN > 0 - gcode.process_subcommands_now(F("G1E" STRINGIFY(POWER_LOSS_RETRACT_LEN) "F3000")); + gcode.process_subcommands_now(F("G1F3000E" STRINGIFY(POWER_LOSS_RETRACT_LEN))); #endif // Additional purge on resume if configured #if POWER_LOSS_PURGE_LEN - sprintf_P(cmd, PSTR("G1 E%d F3000"), (POWER_LOSS_PURGE_LEN) + (POWER_LOSS_RETRACT_LEN)); + sprintf_P(cmd, PSTR("G1F3000E%d"), (POWER_LOSS_PURGE_LEN) + (POWER_LOSS_RETRACT_LEN)); gcode.process_subcommands_now(cmd); #endif diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 50abad92220f..4e97109bb7b9 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -216,9 +216,9 @@ class PrintJobRecovery { static void retract_and_lift(const_float_t zraise); #endif - #if PIN_EXISTS(POWER_LOSS) + #if PIN_EXISTS(POWER_LOSS) || ENABLED(DEBUG_POWER_LOSS_RECOVERY) friend class GcodeSuite; - static void _outage(); + static void _outage(TERN_(DEBUG_POWER_LOSS_RECOVERY, const bool simulated=false)); #endif }; diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index cda71a1c1040..0cb9bb12ed32 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -395,9 +395,10 @@ void GcodeSuite::G28() { TERN_(HOME_Z_FIRST, if (doZ) homeaxis(Z_AXIS)); - const float z_homing_height = parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT; + const bool seenR = parser.seenval('R'); + const float z_homing_height = seenR ? parser.value_linear_units() : Z_HOMING_HEIGHT; - if (z_homing_height && (LINEAR_AXIS_GANG(doX, || doY, || TERN0(Z_SAFE_HOMING, doZ), || doI, || doJ, || doK))) { + if (z_homing_height && (seenR || LINEAR_AXIS_GANG(doX, || doY, || TERN0(Z_SAFE_HOMING, doZ), || doI, || doJ, || doK))) { // Raise Z before homing any other axes and z is not already high enough (never lower z) if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Raise Z (before homing) by ", z_homing_height); do_z_clearance(z_homing_height); @@ -451,7 +452,11 @@ void GcodeSuite::G28() { stepper.set_separate_multi_axis(false); #endif - TERN(Z_SAFE_HOMING, home_z_safely(), homeaxis(Z_AXIS)); + #if ENABLED(Z_SAFE_HOMING) + if (TERN1(POWER_LOSS_RECOVERY, !parser.seen_test('H'))) home_z_safely(); else homeaxis(Z_AXIS); + #else + homeaxis(Z_AXIS); + #endif probe.move_z_after_homing(); } #endif diff --git a/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin/src/gcode/feature/powerloss/M413.cpp index 0ccbfe6341ad..4807d3e8f95b 100644 --- a/Marlin/src/gcode/feature/powerloss/M413.cpp +++ b/Marlin/src/gcode/feature/powerloss/M413.cpp @@ -48,9 +48,8 @@ void GcodeSuite::M413() { if (parser.seen_test('W')) recovery.save(true); if (parser.seen_test('P')) recovery.purge(); if (parser.seen_test('D')) recovery.debug(F("M413")); - #if PIN_EXISTS(POWER_LOSS) - if (parser.seen_test('O')) recovery._outage(); - #endif + if (parser.seen_test('O')) recovery._outage(true); + if (parser.seen_test('C')) recovery.check(); if (parser.seen_test('E')) SERIAL_ECHOF(recovery.exists() ? F("PLR Exists\n") : F("No PLR\n")); if (parser.seen_test('V')) SERIAL_ECHOF(recovery.valid() ? F("Valid\n") : F("Invalid\n")); #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 43ec02393ede..37508b9d27c9 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3440,8 +3440,6 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(BACKUP_POWER_SUPPLY) && !PIN_EXISTS(POWER_LOSS) #error "BACKUP_POWER_SUPPLY requires a POWER_LOSS_PIN." - #elif BOTH(POWER_LOSS_RECOVER_ZHOME, Z_SAFE_HOMING) - #error "POWER_LOSS_RECOVER_ZHOME cannot be used with Z_SAFE_HOMING." #elif BOTH(POWER_LOSS_PULLUP, POWER_LOSS_PULLDOWN) #error "You can't enable POWER_LOSS_PULLUP and POWER_LOSS_PULLDOWN at the same time." #elif ENABLED(POWER_LOSS_RECOVER_ZHOME) && Z_HOME_TO_MAX diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 8d8f44dc7805..f9ddcf8f13b5 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2809,9 +2809,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move, position = target; // Update the position + #if ENABLED(POWER_LOSS_RECOVERY) + block->sdpos = recovery.command_sdpos(); + block->start_position = position_float.asLogical(); + #endif + TERN_(HAS_POSITION_FLOAT, position_float = target_float); TERN_(GRADIENT_MIX, mixer.gradient_control(target_float.z)); - TERN_(POWER_LOSS_RECOVERY, block->sdpos = recovery.command_sdpos()); return true; // Movement was accepted diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 380c35755c96..f29604bea86a 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -244,6 +244,7 @@ typedef struct block_t { #if ENABLED(POWER_LOSS_RECOVERY) uint32_t sdpos; + xyze_pos_t start_position; #endif #if ENABLED(LASER_POWER_INLINE) @@ -252,7 +253,7 @@ typedef struct block_t { } block_t; -#if ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL) +#if ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL, POWER_LOSS_RECOVERY) #define HAS_POSITION_FLOAT 1 #endif diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index ae8a1ef0784c..5da06a5e5078 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2151,7 +2151,10 @@ uint32_t Stepper::block_phase_isr() { cutter.apply_power(current_block->cutter_power); #endif - TERN_(POWER_LOSS_RECOVERY, recovery.info.sdpos = current_block->sdpos); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.info.sdpos = current_block->sdpos; + recovery.info.current_position = current_block->start_position; + #endif #if ENABLED(DIRECT_STEPPING) if (IS_PAGE(current_block)) { From 65c4f14a9e943451ae7379de9c40decd143caae9 Mon Sep 17 00:00:00 2001 From: espr14 Date: Thu, 10 Feb 2022 20:28:38 +0100 Subject: [PATCH 102/502] =?UTF-8?q?=F0=9F=A9=B9=20Simplify=20quick=20homin?= =?UTF-8?q?g=20feedrate=20(#23714)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/gcode/calibrate/G28.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 0cb9bb12ed32..df58992519e4 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -76,10 +76,9 @@ const int x_axis_home_dir = TOOL_X_HOME_DIR(active_extruder); - const float mlx = max_length(X_AXIS), - mly = max_length(Y_AXIS), - mlratio = mlx > mly ? mly / mlx : mlx / mly, - fr_mm_s = _MIN(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)) * SQRT(sq(mlratio) + 1.0); + // Use a higher diagonal feedrate so axes move at homing speed + const float minfr = _MIN(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)), + fr_mm_s = HYPOT(minfr, minfr); #if ENABLED(SENSORLESS_HOMING) sensorless_t stealth_states { @@ -95,7 +94,7 @@ }; #endif - do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * Y_HOME_DIR, fr_mm_s); + do_blocking_move_to_xy(1.5 * max_length(X_AXIS) * x_axis_home_dir, 1.5 * max_length(Y_AXIS) * Y_HOME_DIR, fr_mm_s); endstops.validate_homing_move(); From 59548410b8e76c5a2f18565c9f37338e4f2a4be6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 10 Feb 2022 13:58:50 -0600 Subject: [PATCH 103/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Wra?= =?UTF-8?q?p=20MMU1=20pins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 18 +++++++++-------- Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 10 ++++++---- Marlin/src/pins/rambo/pins_EINSY_RAMBO.h | 8 +++++--- Marlin/src/pins/rambo/pins_EINSY_RETRO.h | 8 +++++--- Marlin/src/pins/rambo/pins_MINIRAMBO.h | 10 ++++++---- Marlin/src/pins/rambo/pins_RAMBO.h | 8 +++++--- Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h | 4 +++- Marlin/src/pins/ramps/pins_RAMPS.h | 18 +++++++++-------- Marlin/src/pins/ramps/pins_RAMPS_S_12.h | 18 +++++++++-------- Marlin/src/pins/ramps/pins_TT_OSCAR.h | 20 ++++++++++--------- Marlin/src/pins/stm32f4/pins_LERDGE_S.h | 6 ++++-- Marlin/src/pins/stm32f4/pins_VAKE403D.h | 6 ++++-- 12 files changed, 79 insertions(+), 55 deletions(-) diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index 372f96765239..e2efdfa4929b 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -234,14 +234,16 @@ // // Průša i3 MK2 Multiplexer Support // -#ifndef E_MUX0_PIN - #define E_MUX0_PIN 40 // Z_CS_PIN -#endif -#ifndef E_MUX1_PIN - #define E_MUX1_PIN 42 // E0_CS_PIN -#endif -#ifndef E_MUX2_PIN - #define E_MUX2_PIN 44 // E1_CS_PIN +#if HAS_PRUSA_MMU1 + #ifndef E_MUX0_PIN + #define E_MUX0_PIN 40 // Z_CS_PIN + #endif + #ifndef E_MUX1_PIN + #define E_MUX1_PIN 42 // E0_CS_PIN + #endif + #ifndef E_MUX2_PIN + #define E_MUX2_PIN 44 // E1_CS_PIN + #endif #endif /** diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index ee9d0e8c7a1d..b08ac536b3d0 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -258,11 +258,13 @@ // // Průša i3 MK2 Multiplexer Support // -#if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0 - #define E_MUX0_PIN P0_03 // ( 0) Z_CS_PIN - #define E_MUX1_PIN P0_02 // ( 1) E0_CS_PIN +#if HAS_PRUSA_MMU1 + #if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0 + #define E_MUX0_PIN P0_03 // ( 0) Z_CS_PIN + #define E_MUX1_PIN P0_02 // ( 1) E0_CS_PIN + #endif + #define E_MUX2_PIN P0_26 // (63) E1_CS_PIN #endif -#define E_MUX2_PIN P0_26 // (63) E1_CS_PIN /** * LCD / Controller diff --git a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h index a7d1a6282048..9150bf13655d 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h @@ -163,9 +163,11 @@ // // Průša i3 MK2 Multiplexer Support // -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 +#if HAS_PRUSA_MMU1 + #define E_MUX0_PIN 17 + #define E_MUX1_PIN 16 + #define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 +#endif // // LCD / Controller diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h index 165475dae8fd..8bc0a90c0586 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h @@ -157,9 +157,11 @@ // // Průša i3 MK2 Multiplexer Support // -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 +#if HAS_PRUSA_MMU1 + #define E_MUX0_PIN 17 + #define E_MUX1_PIN 16 + #define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 +#endif // // LCD / Controller diff --git a/Marlin/src/pins/rambo/pins_MINIRAMBO.h b/Marlin/src/pins/rambo/pins_MINIRAMBO.h index ab25e2e692af..31d44f2b34ba 100644 --- a/Marlin/src/pins/rambo/pins_MINIRAMBO.h +++ b/Marlin/src/pins/rambo/pins_MINIRAMBO.h @@ -130,10 +130,12 @@ // // Průša i3 MK2 Multiplexer Support // -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#if !MB(MINIRAMBO_10A) - #define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 +#if HAS_PRUSA_MMU1 + #define E_MUX0_PIN 17 + #define E_MUX1_PIN 16 + #if !MB(MINIRAMBO_10A) + #define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 + #endif #endif // diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index f27bced6238b..5484b193b93b 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -186,9 +186,11 @@ // // Průša i3 MK2 Multiplexer Support // -#define E_MUX0_PIN 17 -#define E_MUX1_PIN 16 -#define E_MUX2_PIN 84 // 84 in MK2 Firmware +#if HAS_PRUSA_MMU1 + #define E_MUX0_PIN 17 + #define E_MUX1_PIN 16 + #define E_MUX2_PIN 84 // 84 in MK2 Firmware +#endif // // LCD / Controller diff --git a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h index 729a82b9c633..a7817c6f3a7b 100644 --- a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h +++ b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h @@ -105,7 +105,9 @@ // // Průša i3 MK2 Multiplexer Support // -#define E_MUX2_PIN -1 +#if HAS_PRUSA_MMU1 + #define E_MUX2_PIN -1 +#endif // // Misc. Functions diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 70da23af73e5..29caaf0533b9 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -412,14 +412,16 @@ // // Průša i3 MK2 Multiplexer Support // -#ifndef E_MUX0_PIN - #define E_MUX0_PIN 40 // Z_CS_PIN -#endif -#ifndef E_MUX1_PIN - #define E_MUX1_PIN 42 // E0_CS_PIN -#endif -#ifndef E_MUX2_PIN - #define E_MUX2_PIN 44 // E1_CS_PIN +#if HAS_PRUSA_MMU1 + #ifndef E_MUX0_PIN + #define E_MUX0_PIN 40 // Z_CS_PIN + #endif + #ifndef E_MUX1_PIN + #define E_MUX1_PIN 42 // E0_CS_PIN + #endif + #ifndef E_MUX2_PIN + #define E_MUX2_PIN 44 // E1_CS_PIN + #endif #endif // diff --git a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h index e1ba91cde8f0..f41573b527cd 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h @@ -233,14 +233,16 @@ // // Průša i3 MK2 Multiplexer Support // -#ifndef E_MUX0_PIN - #define E_MUX0_PIN 29 // E2_STEP_PIN -#endif -#ifndef E_MUX1_PIN - #define E_MUX1_PIN 28 // E2_DIR_PIN -#endif -#ifndef E_MUX2_PIN - #define E_MUX2_PIN 39 // E2_ENABLE_PIN +#if HAS_PRUSA_MMU1 + #ifndef E_MUX0_PIN + #define E_MUX0_PIN 29 // E2_STEP_PIN + #endif + #ifndef E_MUX1_PIN + #define E_MUX1_PIN 28 // E2_DIR_PIN + #endif + #ifndef E_MUX2_PIN + #define E_MUX2_PIN 39 // E2_ENABLE_PIN + #endif #endif ////////////////////////// diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index 277b1af2de86..9d844ebcdcba 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -252,15 +252,17 @@ // // Průša i3 MK2 Multiplexer Support // -//#ifndef E_MUX0_PIN -// #define E_MUX0_PIN 58 // Y_CS_PIN -//#endif -//#ifndef E_MUX1_PIN -// #define E_MUX1_PIN 53 // Z_CS_PIN -//#endif -//#ifndef E_MUX2_PIN -// #define E_MUX2_PIN 49 // En_CS_PIN -//#endif +#if 0 && HAS_PRUSA_MMU1 + #ifndef E_MUX0_PIN + #define E_MUX0_PIN 58 // Y_CS_PIN + #endif + #ifndef E_MUX1_PIN + #define E_MUX1_PIN 53 // Z_CS_PIN + #endif + #ifndef E_MUX2_PIN + #define E_MUX2_PIN 49 // En_CS_PIN + #endif +#endif ////////////////////////// // LCDs and Controllers // diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h index c904d57a1f0a..e4fc97170c44 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h @@ -133,8 +133,10 @@ // // Průša i3 MK2 Multi Material Multiplexer Support // -//#define E_MUX0_PIN -1 -//#define E_MUX1_PIN -1 +#if HAS_PRUSA_MMU1 + //#define E_MUX0_PIN -1 + //#define E_MUX1_PIN -1 +#endif // // LED / Lighting diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h index bb5507b29a06..c6b24f9eca61 100644 --- a/Marlin/src/pins/stm32f4/pins_VAKE403D.h +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -150,8 +150,10 @@ // // Průša i3 MK2 Multi Material Multiplexer Support // -//#define E_MUX0_PIN PG3 -//#define E_MUX1_PIN PG4 +#if HAS_PRUSA_MMU1 + //#define E_MUX0_PIN PG3 + //#define E_MUX1_PIN PG4 +#endif #define LED_PIN PB14 // Alive #define PS_ON_PIN PE0 From 9f57f6f36f464b412314144d2c72ff0dc8b4be9b Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 11 Feb 2022 04:02:45 +0800 Subject: [PATCH 104/502] =?UTF-8?q?=E2=9C=A8=20Pxmalion=20Core=20i3=20(#23?= =?UTF-8?q?711)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + Marlin/src/pins/ramps/pins_PXMALION_CORE_I3.h | 86 +++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 Marlin/src/pins/ramps/pins_PXMALION_CORE_I3.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 21c0eaaf3045..4435452005ba 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -116,6 +116,7 @@ #define BOARD_LONGER3D_LK1_PRO 1160 // Longer LK1 PRO / Alfawise U20 Pro (PRO version) #define BOARD_LONGER3D_LKx_PRO 1161 // Longer LKx PRO / Alfawise Uxx Pro (PRO version) #define BOARD_ZRIB_V53 1162 // Zonestar zrib V5.3 (Chinese RAMPS replica) +#define BOARD_PXMALION_CORE_I3 1163 // Pxmalion Core I3 // // RAMBo and derivatives diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 4ba97a77a736..0afff4bd42a9 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -201,6 +201,8 @@ #include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560 #elif MB(LONGER3D_LK1_PRO, LONGER3D_LKx_PRO) #include "ramps/pins_LONGER3D_LKx_PRO.h" // ATmega2560 env:mega2560 +#elif MB(PXMALION_CORE_I3) + #include "ramps/pins_PXMALION_CORE_I3.h" // ATmega2560 env:mega2560 // // RAMBo and derivatives diff --git a/Marlin/src/pins/ramps/pins_PXMALION_CORE_I3.h b/Marlin/src/pins/ramps/pins_PXMALION_CORE_I3.h new file mode 100644 index 000000000000..12c40c7dca03 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_PXMALION_CORE_I3.h @@ -0,0 +1,86 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Pxmalion Core i3 - https://github.com/Pxmalion + */ + +#include "env_validate.h" + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Core i3" +#endif + +// +// Servos +// +#define SERVO0_PIN 51 +#define SERVO1_PIN -1 +#define SERVO2_PIN -1 +#define SERVO3_PIN -1 + +// +// Limit Switches +// +#define X_STOP_PIN 3 +#define Y_STOP_PIN 2 +#define Z_MIN_PIN 19 +#define Z_MAX_PIN 18 + +// TODO: Filament Runout Sensor +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN -1 +#endif + +// +// Steppers +// +#define X_CS_PIN -1 +#define Y_CS_PIN -1 +#define Z_CS_PIN -1 +#define E0_CS_PIN -1 +#define E1_CS_PIN -1 + +// +// Heaters / Fans +// +#define FET_ORDER_EFB +#ifndef MOSFET_A_PIN + #define MOSFET_A_PIN 8 +#endif +#ifndef MOSFET_B_PIN + #define MOSFET_B_PIN 7 +#endif +#ifndef MOSFET_C_PIN + #define MOSFET_C_PIN 9 +#endif + +// +// Misc. Functions +// +#ifndef FILWIDTH_PIN + #define FILWIDTH_PIN -1 // Analog Input +#endif + +#define PS_ON_PIN 11 + +#include "pins_RAMPS.h" From 2a584cea96c885df2f6b2c7700d71dfcafe08551 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 10 Feb 2022 16:03:48 -0600 Subject: [PATCH 105/502] =?UTF-8?q?=F0=9F=8E=A8=20Misc.=20DGUS=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp | 28 +++++++++++-------- Marlin/src/lcd/extui/dgus/DGUSDisplay.h | 3 ++ .../src/lcd/extui/dgus/DGUSScreenHandler.cpp | 17 ++++++----- .../extui/dgus/fysetc/DGUSScreenHandler.cpp | 2 +- .../lcd/extui/dgus/fysetc/DGUSScreenHandler.h | 6 ++-- .../extui/dgus/hiprecy/DGUSScreenHandler.cpp | 2 +- .../extui/dgus/hiprecy/DGUSScreenHandler.h | 6 ++-- .../lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 4 +-- .../lcd/extui/dgus/mks/DGUSScreenHandler.h | 8 +++--- .../extui/dgus/origin/DGUSScreenHandler.cpp | 2 +- .../lcd/extui/dgus/origin/DGUSScreenHandler.h | 6 ++-- 11 files changed, 48 insertions(+), 36 deletions(-) diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp index 262dcea36483..e2f11502e7d8 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp @@ -46,6 +46,12 @@ DGUSDisplay dgusdisplay; +#ifdef DEBUG_DGUSLCD_COMM + #define DEBUGLCDCOMM_ECHOPGM DEBUG_ECHOPGM +#else + #define DEBUGLCDCOMM_ECHOPGM(...) NOOP +#endif + // Preamble... 2 Bytes, usually 0x5A 0xA5, but configurable constexpr uint8_t DGUS_HEADER1 = 0x5A; constexpr uint8_t DGUS_HEADER2 = 0xA5; @@ -154,19 +160,19 @@ void DGUSDisplay::ProcessRx() { case DGUS_IDLE: // Waiting for the first header byte receivedbyte = LCD_SERIAL.read(); - //DEBUG_ECHOPGM("< ",x); + //DEBUGLCDCOMM_ECHOPGM("< ", receivedbyte); if (DGUS_HEADER1 == receivedbyte) rx_datagram_state = DGUS_HEADER1_SEEN; break; case DGUS_HEADER1_SEEN: // Waiting for the second header byte receivedbyte = LCD_SERIAL.read(); - //DEBUG_ECHOPGM(" ",x); + //DEBUGLCDCOMM_ECHOPGM(" ", receivedbyte); rx_datagram_state = (DGUS_HEADER2 == receivedbyte) ? DGUS_HEADER2_SEEN : DGUS_IDLE; break; case DGUS_HEADER2_SEEN: // Waiting for the length byte rx_datagram_len = LCD_SERIAL.read(); - DEBUG_ECHOPGM(" (", rx_datagram_len, ") "); + //DEBUGLCDCOMM_ECHOPGM(" (", rx_datagram_len, ") "); // Telegram min len is 3 (command and one word of payload) rx_datagram_state = WITHIN(rx_datagram_len, 3, DGUS_RX_BUFFER_SIZE) ? DGUS_WAIT_TELEGRAM : DGUS_IDLE; @@ -178,20 +184,20 @@ void DGUSDisplay::ProcessRx() { Initialized = true; // We've talked to it, so we defined it as initialized. uint8_t command = LCD_SERIAL.read(); - DEBUG_ECHOPGM("# ", command); + //DEBUGLCDCOMM_ECHOPGM("# ", command); uint8_t readlen = rx_datagram_len - 1; // command is part of len. unsigned char tmp[rx_datagram_len - 1]; unsigned char *ptmp = tmp; while (readlen--) { receivedbyte = LCD_SERIAL.read(); - DEBUG_ECHOPGM(" ", receivedbyte); + //DEBUGLCDCOMM_ECHOPGM(" ", receivedbyte); *ptmp++ = receivedbyte; } - DEBUG_ECHOPGM(" # "); + //DEBUGLCDCOMM_ECHOPGM(" # "); // mostly we'll get this: 5A A5 03 82 4F 4B -- ACK on 0x82, so discard it. if (command == DGUS_CMD_WRITEVAR && 'O' == tmp[0] && 'K' == tmp[1]) { - DEBUG_ECHOLNPGM(">"); + //DEBUGLCDCOMM_ECHOPGM(">"); rx_datagram_state = DGUS_IDLE; break; } @@ -253,16 +259,16 @@ void DGUSDisplay::loop() { rx_datagram_state_t DGUSDisplay::rx_datagram_state = DGUS_IDLE; uint8_t DGUSDisplay::rx_datagram_len = 0; -bool DGUSDisplay::Initialized = false; -bool DGUSDisplay::no_reentrance = false; +bool DGUSDisplay::Initialized = false, + DGUSDisplay::no_reentrance = false; // A SW memory barrier, to ensure GCC does not overoptimize loops #define sw_barrier() asm volatile("": : :"memory"); bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy) { - // DEBUG_ECHOPGM("populate_VPVar ", VP); + //DEBUG_ECHOPGM("populate_VPVar ", VP); const DGUS_VP_Variable *pvp = DGUSLCD_FindVPVar(VP); - // DEBUG_ECHOLNPGM(" pvp ", (uint16_t )pvp); + //DEBUG_ECHOLNPGM(" pvp ", (uint16_t )pvp); if (!pvp) return false; memcpy_P(ramcopy, pvp, sizeof(DGUS_VP_Variable)); return true; diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h index 3040225d071a..17303c689bb9 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h @@ -29,6 +29,9 @@ #include // size_t +//#define DEBUG_DGUSLCD +//#define DEBUG_DGUSLCD_COMM + #if HAS_BED_PROBE #include "../../../module/probe.h" #endif diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index 70bcca185960..9b25f8aeb13f 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -55,14 +55,14 @@ void (*DGUSScreenHandler::confirm_action_cb)() = nullptr; #if ENABLED(SDSUPPORT) int16_t DGUSScreenHandler::top_file = 0, DGUSScreenHandler::file_to_print = 0; - static ExtUI::FileList filelist; + ExtUI::FileList filelist; #endif #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) filament_data_t filament_data; #endif -void DGUSScreenHandler::sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool l4inflash) { +void DGUSScreenHandler::sendinfoscreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool l4inflash) { DGUS_VP_Variable ramcopy; if (populate_VPVar(VP_MSGSTR1, &ramcopy)) { ramcopy.memadr = (void*) line1; @@ -76,13 +76,15 @@ void DGUSScreenHandler::sendinfoscreen(const char *line1, const char *line2, con ramcopy.memadr = (void*) line3; l3inflash ? DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenHandler::DGUSLCD_SendStringToDisplay(ramcopy); } - if (populate_VPVar(VP_MSGSTR4, &ramcopy)) { - ramcopy.memadr = (void*) line4; - l4inflash ? DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenHandler::DGUSLCD_SendStringToDisplay(ramcopy); - } + #ifdef VP_MSGSTR4 + if (populate_VPVar(VP_MSGSTR4, &ramcopy)) { + ramcopy.memadr = (void*) line4; + l4inflash ? DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(ramcopy) : DGUSScreenHandler::DGUSLCD_SendStringToDisplay(ramcopy); + } + #endif } -void DGUSScreenHandler::HandleUserConfirmationPopUp(uint16_t VP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1, bool l2, bool l3, bool l4) { +void DGUSScreenHandler::HandleUserConfirmationPopUp(uint16_t VP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1, bool l2, bool l3, bool l4) { if (current_screen == DGUSLCD_SCREEN_CONFIRM) // Already showing a pop up, so we need to cancel that first. PopToOldScreen(); @@ -344,6 +346,7 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) SetupConfirmAction(nullptr); GotoScreen(DGUSLCD_SCREEN_POPUP); } + #endif // SDSUPPORT void DGUSScreenHandler::ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr) { diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp index eba4b153f135..e7466bfe087f 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp @@ -42,7 +42,7 @@ #if ENABLED(SDSUPPORT) - static ExtUI::FileList filelist; + extern ExtUI::FileList filelist; void DGUSScreenHandler::DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr) { uint16_t touched_nr = (int16_t)swap16(*(uint16_t*)val_ptr) + top_file; diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h index d4fdf1d27e2a..0bdf06ed7d57 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h @@ -37,15 +37,15 @@ class DGUSScreenHandler { // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. - static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); // "M117" Message -- msg is a RAM ptr. static void setstatusmessage(const char *msg); diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp index 88b3255b66e2..d64ac143b031 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp @@ -42,7 +42,7 @@ #if ENABLED(SDSUPPORT) - static ExtUI::FileList filelist; + extern ExtUI::FileList filelist; void DGUSScreenHandler::DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr) { uint16_t touched_nr = (int16_t)swap16(*(uint16_t*)val_ptr) + top_file; diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h index d4fdf1d27e2a..0bdf06ed7d57 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h @@ -37,15 +37,15 @@ class DGUSScreenHandler { // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. - static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); // "M117" Message -- msg is a RAM ptr. static void setstatusmessage(const char *msg); diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index e729ecf44169..91746f69c4fc 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -48,7 +48,7 @@ #endif #if ENABLED(SDSUPPORT) - static ExtUI::FileList filelist; + extern ExtUI::FileList filelist; #endif bool DGUSAutoTurnOff = false; @@ -65,7 +65,7 @@ void DGUSScreenHandler::sendinfoscreen_ch_mks(const uint16_t *line1, const uint1 dgusdisplay.WriteVariable(VP_MSGSTR4, line4, 32, true); } -void DGUSScreenHandler::sendinfoscreen_en_mks(const char *line1, const char *line2, const char *line3, const char *line4) { +void DGUSScreenHandler::sendinfoscreen_en_mks(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4) { dgusdisplay.WriteVariable(VP_MSGSTR1, line1, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR2, line2, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR3, line3, 32, true); diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h index 2e6c8af9852b..f14604d01a2b 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h @@ -37,19 +37,19 @@ class DGUSScreenHandler { // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. - static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); #if 0 static void sendinfoscreen_ch_mks(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4); - static void sendinfoscreen_en_mks(const char *line1, const char *line2, const char *line3, const char *line4) ; + static void sendinfoscreen_en_mks(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4); static void sendinfoscreen_mks(const void *line1, const void *line2, const void *line3, const void *line4, uint16_t language); #endif diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp index fb08fbf84919..aaa8b72e1182 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp @@ -42,7 +42,7 @@ #if ENABLED(SDSUPPORT) - static ExtUI::FileList filelist; + extern ExtUI::FileList filelist; void DGUSScreenHandler::DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr) { uint16_t touched_nr = (int16_t)swap16(*(uint16_t*)val_ptr) + top_file; diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h index d4fdf1d27e2a..0bdf06ed7d57 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h @@ -37,15 +37,15 @@ class DGUSScreenHandler { // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. - static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); // "M117" Message -- msg is a RAM ptr. static void setstatusmessage(const char *msg); From cc1a48ad2d86c8e53684a066c17e033cb20615ad Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 11 Feb 2022 09:36:52 -0600 Subject: [PATCH 106/502] =?UTF-8?q?=F0=9F=92=A5=20Change=20'M42=20M'=20to?= =?UTF-8?q?=20'M42=20T'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/control/M42.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index 77c0ccc49b0f..8de3226924a6 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -52,7 +52,7 @@ void protected_pin_err() { * S Pin status from 0 - 255 * I Flag to ignore Marlin's pin protection * - * M Pin mode: 0=INPUT 1=OUTPUT 2=INPUT_PULLUP 3=INPUT_PULLDOWN + * T Pin mode: 0=INPUT 1=OUTPUT 2=INPUT_PULLUP 3=INPUT_PULLDOWN */ void GcodeSuite::M42() { const int pin_index = PARSED_PIN_INDEX('P', GET_PIN_MAP_INDEX(LED_PIN)); @@ -63,7 +63,7 @@ void GcodeSuite::M42() { if (!parser.boolval('I') && pin_is_protected(pin)) return protected_pin_err(); bool avoidWrite = false; - if (parser.seenval('M')) { + if (parser.seenval('T')) { switch (parser.value_byte()) { case 0: pinMode(pin, INPUT); avoidWrite = true; break; case 1: pinMode(pin, OUTPUT); break; From 3abf4de4ae696f3c234b0be6d7cce5efa60d111e Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 12 Feb 2022 08:39:34 +1300 Subject: [PATCH 107/502] =?UTF-8?q?=F0=9F=9A=B8=20Align=20MKS=20UI=20heate?= =?UTF-8?q?d=20bed=20status=20with=20HAS=5FMULTI=5FHOTEND=20(#23718)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp index 1596944bd899..39f270840be4 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp @@ -196,7 +196,7 @@ void lv_draw_ready_print() { buttonExt2 = lv_big_button_create(scr, "F:/bmp_ext2_state.bin", " ", 180, ICON_POS_Y, event_handler, ID_INFO_EXT); #endif #if HAS_HEATED_BED - buttonBedstate = lv_big_button_create(scr, "F:/bmp_bed_state.bin", " ", TERN(HAS_MULTI_HOTEND, 271, 210), ICON_POS_Y, event_handler, ID_INFO_BED); + buttonBedstate = lv_big_button_create(scr, "F:/bmp_bed_state.bin", " ", TERN(HAS_MULTI_HOTEND, 340, 210), ICON_POS_Y, event_handler, ID_INFO_BED); #endif TERN_(HAS_HOTEND, labelExt1 = lv_label_create_empty(scr)); From 5f0e1a15dfe63f250513e052b0de186a1ad805a1 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 12 Feb 2022 08:50:07 +1300 Subject: [PATCH 108/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20E3V2=20displ?= =?UTF-8?q?ay=20with=20BTT=20SKR=20Mini=20E3=20v3=20(#23719)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h index 7cbf9f9d58d1..2589a316b6b1 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h @@ -156,7 +156,7 @@ #define EXP1_09_PIN PA15 #define EXP1_03_PIN PD6 -#if EITHER(DWIN_CREALITY_LCD, IS_DWIN_MARLINUI) +#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI /** * ------ ------ ------ * (ENT) |10 9 | (BEEP) |10 9 | |10 9 | From 341113bcfb5e20d6587ebe44a746780b3b293867 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 13 Feb 2022 12:55:00 -0600 Subject: [PATCH 109/502] =?UTF-8?q?=F0=9F=94=A7=20HAS=5FLCDPRINT=20conditi?= =?UTF-8?q?onal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 4 ++++ Marlin/src/lcd/lcdprint.cpp | 4 ++-- ini/features.ini | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index d044a0e68126..cf41eb77b93b 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -539,6 +539,10 @@ #define HAS_DISPLAY 1 #endif +#if HAS_WIRED_LCD && !HAS_GRAPHICAL_TFT && !IS_DWIN_MARLINUI + #define HAS_LCDPRINT 1 +#endif + #if ANY(HAS_DISPLAY, HAS_DWIN_E3V2, GLOBAL_STATUS_MESSAGE) #define HAS_STATUS_MESSAGE 1 #endif diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 498b478b1258..8ca0c8ee9e3e 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -26,7 +26,7 @@ #include "../inc/MarlinConfigPre.h" -#if HAS_WIRED_LCD && !HAS_GRAPHICAL_TFT && !IS_DWIN_MARLINUI +#if HAS_LCDPRINT #include "marlinui.h" #include "lcdprint.h" @@ -103,4 +103,4 @@ int calculateWidth(PGM_P const pstr) { return n * MENU_FONT_WIDTH; } -#endif // HAS_WIRED_LCD +#endif // HAS_LCDPRINT diff --git a/ini/features.ini b/ini/features.ini index 564b4701e69d..c1ff3ef294fd 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -34,7 +34,7 @@ I2C_AMMETER = peterus/INA226Lib@1.1.2 USES_LIQUIDCRYSTAL = LiquidCrystal=https://github.com/MarlinFirmware/New-LiquidCrystal/archive/1.5.1.zip USES_LIQUIDCRYSTAL_I2C = marcoschwartz/LiquidCrystal_I2C@1.1.4 USES_LIQUIDTWI2 = LiquidTWI2@1.2.7 -HAS_WIRED_LCD = src_filter=+ +HAS_LCDPRINT = src_filter=+ HAS_MARLINUI_HD44780 = src_filter=+ HAS_MARLINUI_U8GLIB = U8glib-HAL@~0.5.0 src_filter=+ From 172cd2eefb803a2a171c66b2b2bb453944bd5e61 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 13 Feb 2022 13:12:38 -0600 Subject: [PATCH 110/502] =?UTF-8?q?=F0=9F=93=9D=20Update=20conditionals=20?= =?UTF-8?q?descriptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_adv.h | 2 +- Marlin/src/inc/Conditionals_post.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 9c3fe6bfd3a6..7df965890f04 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -23,7 +23,7 @@ /** * Conditionals_adv.h - * Defines that depend on advanced configuration. + * Conditionals set before pins.h and which depend on Configuration_adv.h. */ #ifndef AXIS_RELATIVE_MODES diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 37f0a5cbe5d6..b107ad03ae21 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -23,7 +23,7 @@ /** * Conditionals_post.h - * Defines that depend on configuration but are not editable. + * Internal defines that depend on Configurations and Pins but are not user-editable. */ #ifdef GITHUB_ACTIONS From 7da28768f7bd60c936b66edc85c5d830dd86811a Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sun, 13 Feb 2022 14:44:24 -0500 Subject: [PATCH 111/502] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20No=20ui.reinit=5Fl?= =?UTF-8?q?cd=20on=20any=20ExtUI=20(#23722)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_post.h | 4 ++-- Marlin/src/lcd/marlinui.cpp | 6 ++---- Marlin/src/lcd/marlinui.h | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index b107ad03ae21..fa273cd32eaf 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -459,8 +459,8 @@ #endif -#if ANY(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI) || !PIN_EXISTS(SD_DETECT) - #define NO_LCD_REINIT 1 // Suppress LCD re-initialization +#if PIN_EXISTS(SD_DETECT) && NONE(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI) + #define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion #endif /** diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 5c9f48a3f9c8..0f3840c24b9a 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -625,7 +625,7 @@ void MarlinUI::init() { next_filament_display = millis() + 5000UL; // Show status message for 5s #endif goto_screen(menu_main); - IF_DISABLED(NO_LCD_REINIT, init_lcd()); // May revive the LCD if static electricity killed it + reinit_lcd(); // Revive a noisy shared SPI LCD return; } @@ -1697,9 +1697,7 @@ void MarlinUI::init() { } } - #if PIN_EXISTS(SD_DETECT) && DISABLED(NO_LCD_REINIT) - init_lcd(); // Revive a noisy shared SPI LCD - #endif + reinit_lcd(); // Revive a noisy shared SPI LCD refresh(); diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 273abbe54a94..e08cf27dc5ee 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -209,6 +209,8 @@ class MarlinUI { static void init_lcd() {} #endif + static void reinit_lcd() { TERN_(REINIT_NOISY_LCD, init_lcd()); } + #if HAS_WIRED_LCD static bool detected(); #else From 4199191e999667e66cbaa4ff7844c520774304ed Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 15 Feb 2022 15:09:09 -0600 Subject: [PATCH 112/502] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Rename=20XATC=20z?= =?UTF-8?q?=5Fvalues=20=3D>=20z=5Foffset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/abl/x_twist.cpp | 10 +++++----- Marlin/src/feature/bedlevel/abl/x_twist.h | 4 ++-- Marlin/src/lcd/menu/menu_x_twist.cpp | 6 +++--- Marlin/src/module/settings.cpp | 5 +---- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Marlin/src/feature/bedlevel/abl/x_twist.cpp b/Marlin/src/feature/bedlevel/abl/x_twist.cpp index 000c1e229418..24fdbca95045 100644 --- a/Marlin/src/feature/bedlevel/abl/x_twist.cpp +++ b/Marlin/src/feature/bedlevel/abl/x_twist.cpp @@ -28,15 +28,15 @@ XATC xatc; float XATC::spacing, XATC::start; -xatc_points_t XATC::z_values; +xatc_array_t XATC::z_offset; void XATC::print_points() { SERIAL_ECHOLNPGM(" X-Twist Correction:"); LOOP_L_N(x, XATC_MAX_POINTS) { SERIAL_CHAR(' '); - if (!isnan(z_values[x])) { - if (z_values[x] >= 0) SERIAL_CHAR('+'); - SERIAL_ECHO_F(z_values[x], 3); + if (!isnan(z_offset[x])) { + if (z_offset[x] >= 0) SERIAL_CHAR('+'); + SERIAL_ECHO_F(z_offset[x], 3); } else { LOOP_L_N(i, 6) @@ -54,7 +54,7 @@ float XATC::compensation(const xy_pos_t &raw) { int i = FLOOR(t); LIMIT(i, 0, XATC_MAX_POINTS - 2); t -= i; - return lerp(t, z_values[i], z_values[i + 1]); + return lerp(t, z_offset[i], z_offset[i + 1]); } #endif // X_AXIS_TWIST_COMPENSATION diff --git a/Marlin/src/feature/bedlevel/abl/x_twist.h b/Marlin/src/feature/bedlevel/abl/x_twist.h index bbad9e73efac..9deb45a8b7c4 100644 --- a/Marlin/src/feature/bedlevel/abl/x_twist.h +++ b/Marlin/src/feature/bedlevel/abl/x_twist.h @@ -23,12 +23,12 @@ #include "../../../inc/MarlinConfigPre.h" -typedef float xatc_points_t[XATC_MAX_POINTS]; +typedef float xatc_array_t[XATC_MAX_POINTS]; class XATC { public: static float spacing, start; - static xatc_points_t z_values; + static xatc_array_t z_offset; static float compensation(const xy_pos_t &raw); static void print_points(); diff --git a/Marlin/src/lcd/menu/menu_x_twist.cpp b/Marlin/src/lcd/menu/menu_x_twist.cpp index 288f16603a88..fab3b5ae116c 100644 --- a/Marlin/src/lcd/menu/menu_x_twist.cpp +++ b/Marlin/src/lcd/menu/menu_x_twist.cpp @@ -77,7 +77,7 @@ void xatc_wizard_update_z_offset() { // void xatc_wizard_set_offset_and_go_to_next_point() { // Set Z-offset at probed point - xatc.z_values[manual_probe_index++] = probe.offset.z + current_position.z - measured_z; + xatc.z_offset[manual_probe_index++] = probe.offset.z + current_position.z - measured_z; // Go to next point ui.goto_screen(xatc_wizard_goto_next_point); } @@ -160,12 +160,12 @@ void xatc_wizard_goto_next_point() { else { // Compute the z-offset by averaging the values found with this wizard z_offset = 0; - LOOP_L_N(i, XATC_MAX_POINTS) z_offset += xatc.z_values[i]; + LOOP_L_N(i, XATC_MAX_POINTS) z_offset += xatc.z_offset[i]; z_offset /= XATC_MAX_POINTS; // Subtract the average from the values found with this wizard. // This way they are indipendent from the z-offset - LOOP_L_N(i, XATC_MAX_POINTS) xatc.z_values[i] -= z_offset; + LOOP_L_N(i, XATC_MAX_POINTS) xatc.z_offset[i] -= z_offset; ui.goto_screen(xatc_wizard_update_z_offset); } diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 17a6500b80c6..db9fc7eb2f65 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -863,10 +863,7 @@ void MarlinSettings::postprocess() { "Bilinear Z array is the wrong size." ); #if ENABLED(X_AXIS_TWIST_COMPENSATION) - static_assert( - sizeof(xatc.z_values) == (XATC_MAX_POINTS) * sizeof(xatc.z_values[0]), - "Z-offset mesh is the wrong size." - ); + static_assert(COUNT(xatc.z_offset) == XATC_MAX_POINTS, "XATC Z-offset mesh is the wrong size."); #endif #else const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0}; From 195383bc33e708e533ee7d7199184351d8f6e55b Mon Sep 17 00:00:00 2001 From: Simon Pilepich Date: Wed, 16 Feb 2022 13:46:09 +1100 Subject: [PATCH 113/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Upd?= =?UTF-8?q?ate=20MightyBoard=20FET=20pins=20(#23728)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h | 57 ++++++++------------ 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index eb92ab5cd010..f2a95baf011b 100644 --- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -144,56 +144,41 @@ //#define TEMP_1_MOSI_PIN TEMP_0_MOSI_PIN // -// Augmentation for auto-assigning plugs -// -// Two thermocouple connectors allows for either -// 2 extruders or 1 extruder and a heated bed. -// With no heated bed, an additional 24V fan is possible. +// FET Pin Mapping - FET 1 is closest to the input power connector // -#define MOSFET_A_PIN 6 // H3 EX1_HEAT_PIN -#define MOSFET_B_PIN 11 // B5 EX2_HEAT_PIN -#define MOSFET_C_PIN 45 // L4 HBP_PIN -#define MOSFET_D_PIN 44 // L5 EXTRA_FET_PIN +#define MOSFET_1_PIN 6 // Plug EX1 Pin 1-2 -> PH3 #15 -> Logical 06 +#define MOSFET_2_PIN 7 // Plug EX1 Pin 3-4 -> PH4 #16 -> Logical 07 +#define MOSFET_3_PIN 12 // Plug EX2 1-2 -> PB5 #25 -> Logical 12 +#define MOSFET_4_PIN 11 // Plug EX2 3-4 -> PB6 #24 -> Logical 11 +#define MOSFET_5_PIN 45 // Plug HBD 1-2 -> PL4 #39 -> Logical 45 +#define MOSFET_6_PIN 13 // Plug Extra 1-2 -> PL5 #40 -> Logical 44 (FET not soldered in all boards) // // Heaters / Fans (24V) // -#define HEATER_0_PIN MOSFET_A_PIN - -#if FET_ORDER_EFB // Hotend, Fan, Bed - #define HEATER_BED_PIN MOSFET_C_PIN -#elif FET_ORDER_EEF // Hotend, Hotend, Fan - #define HEATER_1_PIN MOSFET_B_PIN -#elif FET_ORDER_EEB // Hotend, Hotend, Bed - #define HEATER_1_PIN MOSFET_B_PIN - #define HEATER_BED_PIN MOSFET_C_PIN -#elif FET_ORDER_EFF // Hotend, Fan, Fan - #define FAN1_PIN MOSFET_C_PIN -#endif -#ifndef FAN_PIN - #if EITHER(FET_ORDER_EFB, FET_ORDER_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan - #define FAN_PIN MOSFET_B_PIN - #elif EITHER(FET_ORDER_EEF, FET_ORDER_SF) // Hotend, Hotend, Fan or Spindle, Fan - #define FAN_PIN MOSFET_C_PIN - #else - #define FAN_PIN MOSFET_D_PIN - #endif -#endif +#define HEATER_0_PIN MOSFET_1_PIN // EX1 +#define HEATER_1_PIN MOSFET_3_PIN // EX2 +#define HEATER_BED_PIN MOSFET_5_PIN // HBP -#ifndef FAN1_PIN - #define FAN1_PIN 7 // H4 EX1_FAN_PIN +// EX1 FAN (Automatic Fans are disabled by default in Configuration_adv.h - comment that out for auto fans) +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN MOSFET_2_PIN +#else + #define FAN_PIN MOSFET_2_PIN #endif - -#ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN 12 // B6 EX2_FAN_PIN +// EX2 FAN (Automatic Fans are disabled by default in Configuration_adv.h - comment that out for auto fans) +#ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN MOSFET_4_PIN +#else + #define FAN1_PIN MOSFET_4_PIN #endif // // Misc. Functions // -#define LED_PIN 13 // B7 +#define LED_PIN MOSFET_6_PIN // B7 #define CUTOFF_RESET_PIN 16 // H1 #define CUTOFF_TEST_PIN 17 // H0 #define CUTOFF_SR_CHECK_PIN 70 // G4 (TOSC1) From 0b4f5298f5022666fedcb873b2d6e9a573ae42ef Mon Sep 17 00:00:00 2001 From: jefflessard Date: Thu, 17 Feb 2022 19:44:41 -0500 Subject: [PATCH 114/502] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20TEMP=5FSENSOR=5FBO?= =?UTF-8?q?ARD=20warnings=20(#23754)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Warnings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 246e152ed4db..ac2fe9198121 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -59,9 +59,9 @@ #warning "Your Configuration provides no method to acquire user feedback!" #endif -#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) +#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_BOARD #warning "Onboard temperature sensor for BOARD_DUE3DOM_MINI has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)." -#elif MB(BTT_SKR_E3_TURBO) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) +#elif MB(BTT_SKR_E3_TURBO) && PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_BOARD #warning "Onboard temperature sensor for BOARD_BTT_SKR_E3_TURBO has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)." #endif From c0f6d2f78ca50852587d58cb3931d117baf0f5cc Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Fri, 18 Feb 2022 01:45:42 +0100 Subject: [PATCH 115/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20getLFNName?= =?UTF-8?q?=20parameter=20(#23752)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/sd/SdBaseFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 64d0ad68bd80..1c1e0c7d145a 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -1140,8 +1140,8 @@ bool SdBaseFile::openNext(SdBaseFile *dirFile, uint8_t oflag) { // We can't reconvert to UTF-8 here as UTF-8 is variable-size encoding, but joining LFN blocks // needs static bytes addressing. So here just store full UTF-16LE words to re-convert later. uint16_t idx = (startOffset + i) * 2; // This is fixed as FAT LFN always contain UTF-16LE encoding - longFilename[idx] = utf16_ch & 0xFF; - longFilename[idx + 1] = (utf16_ch >> 8) & 0xFF; + lname[idx] = utf16_ch & 0xFF; + lname[idx + 1] = (utf16_ch >> 8) & 0xFF; #else // Replace all multibyte characters to '_' lname[startOffset + i] = (utf16_ch > 0xFF) ? '_' : (utf16_ch & 0xFF); From 4ba4ab1c75bbf87c33b94bbb18b6cae4897fc226 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Tue, 22 Feb 2022 13:31:44 +1300 Subject: [PATCH 116/502] =?UTF-8?q?=F0=9F=93=8C=20Creality=20RAMPS=20optio?= =?UTF-8?q?nal=20SD=5FDETECT=5FPIN=20(#23740)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h index 21dadd60eeb6..679503e98268 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h @@ -39,7 +39,12 @@ #endif #ifndef SD_DETECT_PIN - #define SD_DETECT_PIN 49 // Always define onboard SD detect + #if SD_CONNECTION_IS(ONBOARD) + //#define HAS_ONBOARD_SD_DETECT // If the SD_DETECT_PIN is wired up + #endif + #if ENABLED(HAS_ONBOARD_SD_DETECT) || !SD_CONNECTION_IS(ONBOARD) + #define SD_DETECT_PIN 49 + #endif #endif #ifndef PS_ON_PIN From ac76ed7eceee1063c53ce88c4d3471552c0aa279 Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Wed, 2 Feb 2022 00:35:38 +0100 Subject: [PATCH 117/502] =?UTF-8?q?=F0=9F=9A=B8=20Case=20Light,=20LED=20me?= =?UTF-8?q?nus=20for=20E3V2=20DWIN=20Enhanced=20UI=20(#23590)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 5 +- Marlin/Configuration_adv.h | 54 ++++---- Marlin/src/feature/caselight.cpp | 12 +- Marlin/src/feature/caselight.h | 4 - Marlin/src/feature/leds/leds.cpp | 12 +- Marlin/src/feature/leds/leds.h | 4 +- Marlin/src/feature/leds/neopixel.h | 4 +- Marlin/src/inc/Conditionals_LCD.h | 41 ++---- Marlin/src/inc/Conditionals_adv.h | 10 +- Marlin/src/inc/SanityCheck.h | 39 +++--- Marlin/src/inc/Warnings.cpp | 17 +++ Marlin/src/lcd/e3v2/enhanced/dwin.cpp | 131 +++++++++++++++++++- Marlin/src/lcd/e3v2/enhanced/dwin.h | 6 + Marlin/src/lcd/e3v2/enhanced/dwin_defines.h | 28 ++++- Marlin/src/lcd/e3v2/enhanced/dwinui.h | 2 + Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/lcd/marlinui.cpp | 14 +-- buildroot/tests/DUE | 2 +- buildroot/tests/LPC1768 | 4 +- 19 files changed, 278 insertions(+), 112 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 51665804443d..d3c36ad4850d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -371,8 +371,9 @@ //#define PS_OFF_SOUND // Beep 1s when power off #define PSU_ACTIVE_STATE LOW // Set 'LOW' for ATX, 'HIGH' for X-Box - //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 - //#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power + //#define LED_POWEROFF_TIMEOUT 10000 // (ms) Turn off LEDs after power-off, with this amount of delay //#define POWER_OFF_TIMER // Enable M81 D to power off after a delay //#define POWER_OFF_WAIT_FOR_COOLDOWN // Enable M81 S to power off only after cooldown diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 7ea1faabb45d..f2676828fffb 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1294,7 +1294,6 @@ #if HAS_MARLINUI_MENU - // Add Probe Z Offset calibration to the Z Probe Offsets menu #if BOTH(HAS_BED_PROBE, AUTO_BED_LEVELING_BILINEAR) // Add calibration in the Probe Offsets menu to compensate for X-axis twist. //#define X_AXIS_TWIST_COMPENSATION @@ -1319,32 +1318,6 @@ // BACK menu items keep the highlight at the top //#define TURBO_BACK_MENU_ITEM - /** - * LED Control Menu - * Add LED Control to the LCD menu - */ - //#define LED_CONTROL_MENU - #if ENABLED(LED_CONTROL_MENU) - #define LED_COLOR_PRESETS // Enable the Preset Color menu option - //#define NEO2_COLOR_PRESETS // Enable a second NeoPixel Preset Color menu option - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif - #if ENABLED(NEO2_COLOR_PRESETS) - #define NEO2_USER_PRESET_RED 255 // User defined RED value - #define NEO2_USER_PRESET_GREEN 128 // User defined GREEN value - #define NEO2_USER_PRESET_BLUE 0 // User defined BLUE value - #define NEO2_USER_PRESET_WHITE 255 // User defined WHITE value - #define NEO2_USER_PRESET_BRIGHTNESS 255 // User defined intensity - //#define NEO2_USER_PRESET_STARTUP // Have the printer display the user preset color on startup for the second strip - #endif - #endif - // Insert a menu for preheating at the top level to allow for quick access //#define PREHEAT_SHORTCUT_MENU_ITEM @@ -1376,6 +1349,33 @@ // Show the E position (filament used) during printing //#define LCD_SHOW_E_TOTAL + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + //#define NEO2_COLOR_PRESETS // Enable a second NeoPixel Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #if ENABLED(NEO2_COLOR_PRESETS) + #define NEO2_USER_PRESET_RED 255 // User defined RED value + #define NEO2_USER_PRESET_GREEN 128 // User defined GREEN value + #define NEO2_USER_PRESET_BLUE 0 // User defined BLUE value + #define NEO2_USER_PRESET_WHITE 255 // User defined WHITE value + #define NEO2_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define NEO2_USER_PRESET_STARTUP // Have the printer display the user preset color on startup for the second strip + #endif + #endif + #endif // LCD Print Progress options diff --git a/Marlin/src/feature/caselight.cpp b/Marlin/src/feature/caselight.cpp index 59832fd6edd7..57b2d0f83c61 100644 --- a/Marlin/src/feature/caselight.cpp +++ b/Marlin/src/feature/caselight.cpp @@ -64,7 +64,17 @@ void CaseLight::update(const bool sflag) { #endif #if CASE_LIGHT_IS_COLOR_LED - leds.set_color(LEDColor(color.r, color.g, color.b OPTARG(HAS_WHITE_LED, color.w) OPTARG(NEOPIXEL_LED, n10ct))); + #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) + if (on) + // Use current color of (NeoPixel) leds and new brightness level + leds.set_color(LEDColor(leds.color.r, leds.color.g, leds.color.b OPTARG(HAS_WHITE_LED, leds.color.w) OPTARG(NEOPIXEL_LED, n10ct))); + else + // Switch off leds + leds.set_off(); + #else + // Use CaseLight color (CASE_LIGHT_DEFAULT_COLOR) and new brightness level + leds.set_color(LEDColor(color.r, color.g, color.b OPTARG(HAS_WHITE_LED, color.w) OPTARG(NEOPIXEL_LED, n10ct))); + #endif #else // !CASE_LIGHT_IS_COLOR_LED #if CASELIGHT_USES_BRIGHTNESS diff --git a/Marlin/src/feature/caselight.h b/Marlin/src/feature/caselight.h index 2e85b59ef938..17e1222acbfa 100644 --- a/Marlin/src/feature/caselight.h +++ b/Marlin/src/feature/caselight.h @@ -27,10 +27,6 @@ #include "leds/leds.h" // for LEDColor #endif -#if NONE(CASE_LIGHT_NO_BRIGHTNESS, CASE_LIGHT_IS_COLOR_LED) || ENABLED(CASE_LIGHT_USE_NEOPIXEL) - #define CASELIGHT_USES_BRIGHTNESS 1 -#endif - class CaseLight { public: static bool on; diff --git a/Marlin/src/feature/leds/leds.cpp b/Marlin/src/feature/leds/leds.cpp index 17d790b8cc9a..715f51f442c8 100644 --- a/Marlin/src/feature/leds/leds.cpp +++ b/Marlin/src/feature/leds/leds.cpp @@ -42,7 +42,7 @@ #include "pca9533.h" #endif -#if ENABLED(CASE_LIGHT_USE_RGB_LED) +#if EITHER(CASE_LIGHT_USE_RGB_LED, CASE_LIGHT_USE_NEOPIXEL) #include "../../feature/caselight.h" #endif @@ -95,6 +95,10 @@ void LEDLights::set_color(const LEDColor &incol #endif #endif + #if BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) + // Update brightness only if caselight is ON or switching leds off + if (caselight.on || incol.is_off()) + #endif neo.set_brightness(incol.i); #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) @@ -106,6 +110,10 @@ void LEDLights::set_color(const LEDColor &incol } #endif + #if BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) + // Update color only if caselight is ON or switching leds off + if (caselight.on || incol.is_off()) + #endif neo.set_color(neocolor); #endif @@ -150,7 +158,7 @@ void LEDLights::set_color(const LEDColor &incol void LEDLights::toggle() { if (lights_on) set_off(); else update(); } #endif -#ifdef LED_BACKLIGHT_TIMEOUT +#if LED_POWEROFF_TIMEOUT > 0 millis_t LEDLights::led_off_time; // = 0 diff --git a/Marlin/src/feature/leds/leds.h b/Marlin/src/feature/leds/leds.h index 7110a9ba8255..bce9052424a8 100644 --- a/Marlin/src/feature/leds/leds.h +++ b/Marlin/src/feature/leds/leds.h @@ -157,12 +157,12 @@ class LEDLights { static void update() { set_color(color); } #endif - #ifdef LED_BACKLIGHT_TIMEOUT + #if LED_POWEROFF_TIMEOUT > 0 private: static millis_t led_off_time; public: static void reset_timeout(const millis_t &ms) { - led_off_time = ms + LED_BACKLIGHT_TIMEOUT; + led_off_time = ms + LED_POWEROFF_TIMEOUT; if (!lights_on) update(); } static void update_timeout(const bool power_on); diff --git a/Marlin/src/feature/leds/neopixel.h b/Marlin/src/feature/leds/neopixel.h index ae75316b8ffc..1a38ed1a196d 100644 --- a/Marlin/src/feature/leds/neopixel.h +++ b/Marlin/src/feature/leds/neopixel.h @@ -25,8 +25,6 @@ * NeoPixel support */ -#define MAX_NEOPIXELS 127 - #ifndef _NEOPIXEL_INCLUDE_ #error "Always include 'leds.h' and not 'neopixel.h' directly." #endif @@ -68,7 +66,7 @@ // Types // ------------------------ -typedef IF<(MAX_NEOPIXELS > 127), int16_t, int8_t>::type pixel_index_t; +typedef IF<(TERN0(NEOPIXEL_LED, NEOPIXEL_PIXELS > 127)), int16_t, int8_t>::type pixel_index_t; // ------------------------ // Classes diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index cf41eb77b93b..7bc64d169be1 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -78,8 +78,8 @@ // This helps to implement HAS_ADC_BUTTONS menus #define REVERSE_MENU_DIRECTION - #define ENCODER_PULSES_PER_STEP 1 - #define ENCODER_STEPS_PER_MENU_ITEM 1 + #define STD_ENCODER_PULSES_PER_STEP 1 + #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 #define ENCODER_FEEDRATE_DEADZONE 2 #elif ENABLED(ZONESTAR_12864LCD) @@ -97,7 +97,7 @@ #elif ENABLED(RADDS_DISPLAY) #define IS_ULTIPANEL 1 - #define ENCODER_PULSES_PER_STEP 2 + #define STD_ENCODER_PULSES_PER_STEP 2 #elif ANY(miniVIKI, VIKI2, WYH_L12864, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864) @@ -158,44 +158,19 @@ #define IS_RRD_SC 1 #define U8GLIB_SH1106 - #define LED_CONTROL_MENU - #define NEOPIXEL_LED - #undef NEOPIXEL_TYPE - #define NEOPIXEL_TYPE NEO_RGB - #if NEOPIXEL_PIXELS < 3 - #undef NEOPIXELS_PIXELS - #define NEOPIXEL_PIXELS 3 - #endif #ifndef NEOPIXEL_BRIGHTNESS #define NEOPIXEL_BRIGHTNESS 127 #endif - #if ENABLED(PSU_CONTROL) - #define LED_BACKLIGHT_TIMEOUT 10000 - #endif - #elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) #define FYSETC_MINI_12864 #define DOGLCD #define IS_ULTIPANEL 1 #define LED_COLORS_REDUCE_GREEN - #if ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) - #define LED_BACKLIGHT_TIMEOUT 10000 - #endif // Require LED backlighting enabled - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #define RGB_LED - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define LED_CONTROL_MENU - #define NEOPIXEL_LED - #undef NEOPIXEL_TYPE - #define NEOPIXEL_TYPE NEO_RGB - #if NEOPIXEL_PIXELS < 3 - #undef NEOPIXELS_PIXELS - #define NEOPIXEL_PIXELS 3 - #endif + #if ENABLED(FYSETC_MINI_12864_2_1) #ifndef NEOPIXEL_BRIGHTNESS #define NEOPIXEL_BRIGHTNESS 127 #endif @@ -207,8 +182,8 @@ #define IS_ULTIPANEL 1 #define U8GLIB_SSD1309 #define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin - #define ENCODER_PULSES_PER_STEP 4 - #define ENCODER_STEPS_PER_MENU_ITEM 1 + #define STD_ENCODER_PULSES_PER_STEP 4 + #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 #ifndef PCA9632 #define PCA9632 #endif @@ -305,8 +280,8 @@ #define PCA9632_BUZZER #define PCA9632_BUZZER_DATA { 0x09, 0x02 } - #define ENCODER_PULSES_PER_STEP 1 // Overlord uses buttons - #define ENCODER_STEPS_PER_MENU_ITEM 1 + #define STD_ENCODER_PULSES_PER_STEP 1 // Overlord uses buttons + #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 #endif // 128x64 I2C OLED LCDs - SSD1306/SSD1309/SH1106 diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 7df965890f04..82b32ba0031f 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -618,6 +618,8 @@ #if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) #define HAS_COLOR_LEDS 1 +#else + #undef LED_POWEROFF_TIMEOUT #endif #if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, SDSUPPORT) #define HAS_LEDS_OFF_FLAG 1 @@ -738,9 +740,6 @@ #endif #if EITHER(FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864) - #define LED_CONTROL_MENU - #define LED_USER_PRESET_STARTUP - #define LED_COLOR_PRESETS #ifndef LED_USER_PRESET_GREEN #define LED_USER_PRESET_GREEN 128 #endif @@ -981,6 +980,11 @@ #endif #endif +// Flags for Case Light having a brightness property +#if ENABLED(CASE_LIGHT_ENABLE) && (NONE(CASE_LIGHT_NO_BRIGHTNESS, CASE_LIGHT_IS_COLOR_LED) || ENABLED(CASE_LIGHT_USE_NEOPIXEL)) + #define CASELIGHT_USES_BRIGHTNESS 1 +#endif + // Flag whether least_squares_fit.cpp is used #if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR, Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) #define NEED_LSF 1 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 37508b9d27c9..8e1a5a55d869 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2330,17 +2330,31 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif /** - * LED Control Menu + * FYSETC LCD Requirements */ -#if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS - #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED." +#if EITHER(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1) + #ifndef NEO_RGB + #define NEO_RGB 123 + #define FAUX_RGB 1 + #endif + #if defined(NEOPIXEL_TYPE) && NEOPIXEL_TYPE != NEO_RGB + #error "Your FYSETC Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB." + #elif defined(NEOPIXEL_PIXELS) && NEOPIXEL_PIXELS < 3 + #error "Your FYSETC Mini Panel requires NEOPIXEL_PIXELS >= 3." + #endif + #if FAUX_RGB + #undef NEO_RGB + #undef FAUX_RGB + #endif +#elif EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && !DISABLED(RGB_LED) + #error "Your FYSETC Mini Panel requires RGB_LED." #endif /** - * LED Backlight Timeout + * LED Control Menu requirements */ -#if defined(LED_BACKLIGHT_TIMEOUT) && !(ENABLED(PSU_CONTROL) && ANY(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864)) - #error "LED_BACKLIGHT_TIMEOUT requires a FYSETC Mini Panel and a Power Switch." +#if ENABLED(LED_CONTROL_MENU) && !HAS_COLOR_LEDS + #error "LED_CONTROL_MENU requires BLINKM, RGB_LED, RGBW_LED, PCA9533, PCA9632, or NEOPIXEL_LED." #endif /** @@ -2883,15 +2897,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif -/** - * FYSETC Mini 12864 RGB backlighting required - */ -#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED) - #error "RGB_LED is required for FYSETC_MINI_12864 1.2 and 2.0." -#elif EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP) - #error "LED_USER_PRESET_STARTUP is required for FYSETC_MINI_12864 2.x displays." -#endif - /** * Check existing CS pins against enabled TMC SPI drivers. */ @@ -3411,8 +3416,8 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "A very large BLOCK_BUFFER_SIZE is not needed and takes longer to drain the buffer on pause / cancel." #endif -#if ENABLED(LED_CONTROL_MENU) && !IS_ULTIPANEL - #error "LED_CONTROL_MENU requires an LCD controller." +#if ENABLED(LED_CONTROL_MENU) && NONE(HAS_MARLINUI_MENU, DWIN_CREALITY_LCD_ENHANCED) + #error "LED_CONTROL_MENU requires an LCD controller that implements the menu." #endif #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) && DISABLED(NEOPIXEL_LED) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index ac2fe9198121..dcdc12f45e8d 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -574,6 +574,23 @@ #warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX." #endif +/** + * FYSETC backlighting + */ +#if EITHER(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1) && !ALL(NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, LED_COLOR_PRESETS) + #warning "Your FYSETC Mini Panel works best with NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, and LED_COLOR_PRESETS." +#endif + +#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED) + #warning "Your FYSETC Mini Panel works best with RGB_LED." +#elif EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP) + #warning "Your FYSETC Mini Panel works best with LED_USER_PRESET_STARTUP." +#endif + +#if EITHER(FYSETC_242_OLED_12864, FYSETC_MINI_12864) && BOTH(PSU_CONTROL, HAS_COLOR_LEDS) && !LED_POWEROFF_TIMEOUT + #warning "Your FYSETC display with PSU_CONTROL works best with LED_POWEROFF_TIMEOUT." +#endif + /** * Maple environment */ diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp index 64e90c361edd..58885e1c21b6 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp @@ -95,6 +95,14 @@ #include "printstats.h" #endif +#if ENABLED(CASE_LIGHT_MENU) + #include "../../../feature/caselight.h" +#endif + +#if ENABLED(LED_CONTROL_MENU) + #include "../../../feature/leds/leds.h" +#endif + #include #include #include @@ -249,6 +257,12 @@ MenuClass *MaxJerkMenu = nullptr; MenuClass *StepsMenu = nullptr; MenuClass *HotendPIDMenu = nullptr; MenuClass *BedPIDMenu = nullptr; +#if ENABLED(CASELIGHT_USES_BRIGHTNESS) + MenuClass *CaseLightMenu = nullptr; +#endif +#if ENABLED(LED_CONTROL_MENU) + MenuClass *LedControlMenu = nullptr; +#endif #if HAS_BED_PROBE MenuClass *ZOffsetWizMenu = nullptr; #endif @@ -991,7 +1005,7 @@ void Redraw_SD_List() { } else { DWIN_Draw_Rectangle(1, HMI_data.AlertBg_Color, 10, MBASE(3) - 10, DWIN_WIDTH - 10, MBASE(4)); - DWINUI::Draw_CenteredString(font16x32, HMI_data.AlertTxt_Color, MBASE(3), GET_TEXT_F(MSG_MEDIA_NOT_INSERTED)); + DWINUI::Draw_CenteredString(font12x24, HMI_data.AlertTxt_Color, MBASE(3), GET_TEXT_F(MSG_MEDIA_NOT_INSERTED)); } } @@ -1891,12 +1905,22 @@ void DWIN_StoreSettings(char *buff) { } void DWIN_LoadSettings(const char *buff) { - memcpy(&HMI_data, buff, _MIN(sizeof(HMI_data), eeprom_data_size)); + // (void *)-> Avoid Warning when save data different from uintX_t in HMI_data_t struct + memcpy((void *)&HMI_data, buff, _MIN(sizeof(HMI_data), eeprom_data_size)); dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); if (HMI_data.Text_Color == HMI_data.Background_Color) DWIN_SetColorDefaults(); DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color); TERN_(PREVENT_COLD_EXTRUSION, ApplyExtMinT()); feedrate_percentage = 100; + #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) + // Apply Case light brightness + caselight.brightness = HMI_data.CaseLight_Brightness; + caselight.update_brightness(); + #endif + #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) + // Apply Led Color + leds.set_color(HMI_data.Led_Color); + #endif } void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) { @@ -2288,6 +2312,41 @@ void SetPID(celsius_t t, heater_id_t h) { void SetBrightness() { SetIntOnClick(LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.brightness, nullptr, LiveBrightness); } #endif +#if ENABLED(CASE_LIGHT_MENU) + void SetCaseLight() { + caselight.on = !caselight.on; + caselight.update_enabled(); + Draw_Chkb_Line(CurrentMenu->line(), caselight.on); + DWIN_UpdateLCD(); + } + #if ENABLED(CASELIGHT_USES_BRIGHTNESS) + void LiveCaseLightBrightness() { HMI_data.CaseLight_Brightness = caselight.brightness = HMI_value.Value; caselight.update_brightness(); } + void SetCaseLightBrightness() { SetIntOnClick(0, 255, caselight.brightness, nullptr, LiveCaseLightBrightness); } + #endif +#endif + +#if ENABLED(LED_CONTROL_MENU) + #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) + void SetLedStatus() { + leds.toggle(); + Draw_Chkb_Line(CurrentMenu->line(), leds.lights_on); + DWIN_UpdateLCD(); + } + #endif + #if ENABLED(HAS_COLOR_LEDS) + void LiveLedColorR() { leds.color.r = HMI_value.Value; HMI_data.Led_Color = leds.color; leds.update(); } + void SetLedColorR() { SetIntOnClick(0, 255, leds.color.r, nullptr, LiveLedColorR); } + void LiveLedColorG() { leds.color.g = HMI_value.Value; HMI_data.Led_Color = leds.color; leds.update(); } + void SetLedColorG() { SetIntOnClick(0, 255, leds.color.g, nullptr, LiveLedColorG); } + void LiveLedColorB() { leds.color.b = HMI_value.Value; HMI_data.Led_Color = leds.color; leds.update(); } + void SetLedColorB() { SetIntOnClick(0, 255, leds.color.b, nullptr, LiveLedColorB); } + #if HAS_WHITE_LED + void LiveLedColorW() { leds.color.w = HMI_value.Value; HMI_data.Led_Color = leds.color; leds.update(); } + void SetLedColorW() { SetIntOnClick(0, 255, leds.color.w, nullptr, LiveLedColorW); } + #endif + #endif +#endif + #if ENABLED(SOUND_MENU_ITEM) void SetEnableSound() { ui.buzzer_enabled = !ui.buzzer_enabled; @@ -2774,6 +2833,16 @@ void onDrawLanguage(MenuItemClass* menuitem, int8_t line) { void onDrawPwrLossR(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, recovery.enabled); } #endif +#if ENABLED(CASE_LIGHT_MENU) + void onDrawCaseLight(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, caselight.on); } +#endif + +#if ENABLED(LED_CONTROL_MENU) + #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) + void onDrawLedStatus(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, leds.lights_on); } + #endif +#endif + #if ENABLED(SOUND_MENU_ITEM) void onDrawEnableSound(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, ui.buzzer_enabled); } #endif @@ -3265,8 +3334,18 @@ void Draw_Control_Menu() { if (CurrentMenu != ControlMenu) { CurrentMenu = ControlMenu; SetMenuTitle({103, 1, 28, 14}, GET_TEXT_F(MSG_CONTROL)); - DWINUI::MenuItemsPrepare(9); + DWINUI::MenuItemsPrepare(11); MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); + #if ENABLED(CASE_LIGHT_MENU) + #if ENABLED(CASELIGHT_USES_BRIGHTNESS) + MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawSubMenu, Draw_CaseLight_Menu); + #else + MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); + #endif + #endif + #if ENABLED(LED_CONTROL_MENU) + MENU_ITEM(ICON_LedControl, GET_TEXT_F(MSG_LED_CONTROL), onDrawSubMenu, Draw_LedControl_Menu); + #endif MENU_ITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawTempSubMenu, Draw_Temperature_Menu); MENU_ITEM(ICON_Motion, GET_TEXT_F(MSG_MOTION), onDrawMotionSubMenu, Draw_Motion_Menu); #if ENABLED(EEPROM_SETTINGS) @@ -3469,6 +3548,47 @@ void Draw_GetColor_Menu() { DWIN_Draw_Rectangle(1, *HMI_value.P_Int, 20, 315, DWIN_WIDTH - 20, 335); } +#if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) + void Draw_CaseLight_Menu() { + checkkey = Menu; + if (!CaseLightMenu) CaseLightMenu = new MenuClass(); + if (CurrentMenu != CaseLightMenu) { + CurrentMenu = CaseLightMenu; + SetMenuTitle({0}, GET_TEXT_F(MSG_CASE_LIGHT)); // TODO: Chinese, English "Case Light" JPG + DWINUI::MenuItemsPrepare(3); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); + MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); + EDIT_ITEM(ICON_Brightness, GET_TEXT_F(MSG_CASE_LIGHT_BRIGHTNESS), onDrawPInt8Menu, SetCaseLightBrightness, &caselight.brightness); + } + CurrentMenu->draw(); + } +#endif + +#if ENABLED(LED_CONTROL_MENU) + void Draw_LedControl_Menu() { + checkkey = Menu; + if (!LedControlMenu) LedControlMenu = new MenuClass(); + if (CurrentMenu != LedControlMenu) { + CurrentMenu = LedControlMenu; + SetMenuTitle({0}, GET_TEXT_F(MSG_LED_CONTROL)); // TODO: Chinese, English "LED Control" JPG + DWINUI::MenuItemsPrepare(6); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); + #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) + MENU_ITEM(ICON_LedControl, GET_TEXT_F(MSG_LEDS), onDrawLedStatus, SetLedStatus); + #endif + #if (HAS_COLOR_LEDS) + EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_RED), onDrawPInt8Menu, SetLedColorR, &leds.color.r); + EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_GREEN), onDrawPInt8Menu, SetLedColorG, &leds.color.g); + EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_BLUE), onDrawPInt8Menu, SetLedColorB, &leds.color.b); + #if ENABLED(HAS_WHITE_LED) + EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_WHITE), onDrawPInt8Menu, SetLedColorW, &leds.color.w); + #endif + #endif + } + CurrentMenu->draw(); + } +#endif + void Draw_Tune_Menu() { checkkey = Menu; if (!TuneMenu) TuneMenu = new MenuClass(); @@ -3477,6 +3597,11 @@ void Draw_Tune_Menu() { SetMenuTitle({73, 2, 28, 12}, GET_TEXT_F(MSG_TUNE)); // TODO: Chinese, English "Tune" JPG DWINUI::MenuItemsPrepare(14); MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_PrintProcess); + #if ENABLED(CASE_LIGHT_MENU) + MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); + #elif ENABLED(LED_CONTROL_MENU) && DISABLED(CASE_LIGHT_USE_NEOPIXEL) + MENU_ITEM(ICON_LedControl, GET_TEXT_F(MSG_LEDS), onDrawLedStatus, SetLedStatus); + #endif EDIT_ITEM(ICON_Speed, GET_TEXT_F(MSG_SPEED), onDrawSpeedItem, SetSpeed, &feedrate_percentage); #if HAS_HOTEND HotendTargetItem = EDIT_ITEM(ICON_HotendTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.h b/Marlin/src/lcd/e3v2/enhanced/dwin.h index f377732b4139..bbbe00aa9fb6 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.h @@ -223,6 +223,12 @@ void Draw_Tramming_Menu(); #endif void Draw_SelectColors_Menu(); void Draw_GetColor_Menu(); +#if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) + void Draw_CaseLight_Menu(); +#endif +#if ENABLED(LED_CONTROL_MENU) + void Draw_LedControl_Menu(); +#endif void Draw_Tune_Menu(); void Draw_Motion_Menu(); #if ENABLED(ADVANCED_PAUSE_FEATURE) diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h b/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h index b92d3d3b85e9..907177ab32f6 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h @@ -30,6 +30,9 @@ #include "../../../core/types.h" #include "../common/dwin_color.h" +#if ENABLED(LED_CONTROL_MENU) + #include "../../../feature/leds/leds.h" +#endif #define Def_Background_Color RGB( 1, 12, 8) #define Def_Cursor_color RGB(20, 49, 31) @@ -53,8 +56,15 @@ #define HAS_ESDIAG 1 #define DEFAULT_LCD_BRIGHTNESS 127 +#if ENABLED(LED_CONTROL_MENU, HAS_COLOR_LEDS) + #define Def_Leds_Color LEDColorWhite() +#endif +#if ENABLED(CASELIGHT_USES_BRIGHTNESS) + #define Def_CaseLight_Brightness 255 +#endif + typedef struct { -// Color settings + // Color settings uint16_t Background_Color = Def_Background_Color; uint16_t Cursor_color = Def_Cursor_color; uint16_t TitleBg_color = Def_TitleBg_color; @@ -73,19 +83,27 @@ typedef struct { uint16_t Barfill_Color = Def_Barfill_Color; uint16_t Indicator_Color = Def_Indicator_Color; uint16_t Coordinate_Color = Def_Coordinate_Color; -// - #if defined(PREHEAT_1_TEMP_HOTEND) && HAS_HOTEND + // Temperatures + #if HAS_HOTEND && defined(PREHEAT_1_TEMP_HOTEND) int16_t HotendPidT = PREHEAT_1_TEMP_HOTEND; #endif - #if defined(PREHEAT_1_TEMP_BED) && HAS_HEATED_BED + #if HAS_HEATED_BED && defined(PREHEAT_1_TEMP_BED) int16_t BedPidT = PREHEAT_1_TEMP_BED; #endif - #if ANY(HAS_HOTEND, HAS_HEATED_BED) + #if HAS_HOTEND || HAS_HEATED_BED int16_t PidCycles = 10; #endif #if ENABLED(PREVENT_COLD_EXTRUSION) int16_t ExtMinT = EXTRUDE_MINTEMP; #endif + // Led + #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) + LEDColor Led_Color = Def_Leds_Color; + #endif + // Case Light + #if ENABLED(CASELIGHT_USES_BRIGHTNESS) + uint8_t CaseLight_Brightness = Def_CaseLight_Brightness; + #endif } HMI_data_t; static constexpr size_t eeprom_data_size = 64; diff --git a/Marlin/src/lcd/e3v2/enhanced/dwinui.h b/Marlin/src/lcd/e3v2/enhanced/dwinui.h index cb7720834c2c..4f0dadc90959 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwinui.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwinui.h @@ -76,6 +76,8 @@ #define ICON_Scolor ICON_MaxSpeed #define ICON_SetCustomPreheat ICON_SetEndTemp #define ICON_Sound ICON_Cool +#define ICON_CaseLight ICON_Motion +#define ICON_LedControl ICON_Motion // Extended and default UI Colors #define Color_Black 0 diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index bb69aad432cb..d8d161701fdb 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -609,6 +609,7 @@ namespace Language_en { LSTR MSG_COLORS_RED = _UxGT("Red"); LSTR MSG_COLORS_GREEN = _UxGT("Green"); LSTR MSG_COLORS_BLUE = _UxGT("Blue"); + LSTR MSG_COLORS_WHITE = _UxGT("White"); LSTR MSG_UI_LANGUAGE = _UxGT("UI Language"); LSTR MSG_SOUND_ENABLE = _UxGT("Enable sound"); LSTR MSG_LOCKSCREEN = _UxGT("Lock Screen"); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 0f3840c24b9a..fcd9357ef7a0 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -24,7 +24,7 @@ #include "../MarlinCore.h" // for printingIsPaused -#ifdef LED_BACKLIGHT_TIMEOUT +#if LED_POWEROFF_TIMEOUT > 0 || BOTH(HAS_WIRED_LCD, PRINTER_EVENT_LEDS) #include "../feature/leds/leds.h" #endif @@ -277,7 +277,7 @@ void MarlinUI::init() { #include "../feature/power_monitor.h" #endif - #if ENABLED(PSU_CONTROL) && defined(LED_BACKLIGHT_TIMEOUT) + #if LED_POWEROFF_TIMEOUT > 0 #include "../feature/power.h" #endif @@ -676,7 +676,7 @@ void MarlinUI::init() { TERN_(HAS_MARLINUI_MENU, return_to_status()); // RED ALERT. RED ALERT. - #ifdef LED_BACKLIGHT_TIMEOUT + #if ENABLED(PRINTER_EVENT_LEDS) leds.set_color(LEDColorRed()); #ifdef NEOPIXEL_BKGD_INDEX_FIRST neo.set_background_color(255, 0, 0, 0); @@ -884,7 +884,7 @@ void MarlinUI::init() { static uint16_t max_display_update_time = 0; millis_t ms = millis(); - #if ENABLED(PSU_CONTROL) && defined(LED_BACKLIGHT_TIMEOUT) + #if LED_POWEROFF_TIMEOUT > 0 leds.update_timeout(powerManager.psu_on); #endif @@ -1035,7 +1035,7 @@ void MarlinUI::init() { refresh(LCDVIEW_REDRAW_NOW); - #if ENABLED(PSU_CONTROL) && defined(LED_BACKLIGHT_TIMEOUT) + #if LED_POWEROFF_TIMEOUT > 0 if (!powerManager.psu_on) leds.reset_timeout(ms); #endif } @@ -1701,13 +1701,13 @@ void MarlinUI::init() { refresh(); - #if HAS_WIRED_LCD || defined(LED_BACKLIGHT_TIMEOUT) + #if HAS_WIRED_LCD || LED_POWEROFF_TIMEOUT > 0 const millis_t ms = millis(); #endif TERN_(HAS_WIRED_LCD, next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL); // Delay LCD update for SD activity - #ifdef LED_BACKLIGHT_TIMEOUT + #if LED_POWEROFF_TIMEOUT > 0 leds.reset_timeout(ms); #endif } diff --git a/buildroot/tests/DUE b/buildroot/tests/DUE index 37678501e431..5810b73bdca8 100755 --- a/buildroot/tests/DUE +++ b/buildroot/tests/DUE @@ -17,7 +17,7 @@ opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \ FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING \ ASSISTED_TRAMMING REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \ EEPROM_SETTINGS SDSUPPORT BINARY_FILE_TRANSFER \ - BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ + BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN \ NEOPIXEL_LED NEOPIXEL_PIN CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_USE_RGB_LED CASE_LIGHT_MENU \ NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_DISTANCE_MM FILAMENT_RUNOUT_SENSOR \ AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ diff --git a/buildroot/tests/LPC1768 b/buildroot/tests/LPC1768 index 92ba286693e8..9fb7479d9921 100755 --- a/buildroot/tests/LPC1768 +++ b/buildroot/tests/LPC1768 @@ -14,8 +14,8 @@ set -e #exec_test $1 $2 "Default Configuration" "$3" restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB SERIAL_PORT_3 3 \ - NEOPIXEL_TYPE NEO_GRB RGB_LED_R_PIN P2_12 RGB_LED_G_PIN P1_23 RGB_LED_B_PIN P1_22 RGB_LED_W_PIN P1_24 +opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB SERIAL_PORT_3 3 \ + NEOPIXEL_TYPE NEO_RGB RGB_LED_R_PIN P2_12 RGB_LED_G_PIN P1_23 RGB_LED_B_PIN P1_22 RGB_LED_W_PIN P1_24 opt_enable FYSETC_MINI_12864_2_1 SDSUPPORT SDCARD_READONLY SERIAL_PORT_2 RGBW_LED E_DUAL_STEPPER_DRIVERS \ NEOPIXEL_LED NEOPIXEL_IS_SEQUENTIAL NEOPIXEL_STARTUP_TEST NEOPIXEL_BKGD_INDEX_FIRST NEOPIXEL_BKGD_INDEX_LAST NEOPIXEL_BKGD_COLOR NEOPIXEL_BKGD_ALWAYS_ON exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), NeoPixel" "$3" From 1b2715ccf2722182ef787fa4639619b282647b1b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 5 Feb 2022 10:30:17 -0600 Subject: [PATCH 118/502] =?UTF-8?q?=F0=9F=9A=B8=20Enhanced=20UI=20=3D>=20P?= =?UTF-8?q?rofessional=20UI=20-=20with=20updates=20(#23624)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/feature/pause.cpp | 2 +- Marlin/src/feature/runout.cpp | 2 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 2 +- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 2 +- Marlin/src/gcode/bedlevel/ubl/M421.cpp | 2 +- Marlin/src/gcode/calibrate/G28.cpp | 2 +- Marlin/src/gcode/control/M997.cpp | 2 +- Marlin/src/gcode/feature/powerloss/M1000.cpp | 2 +- Marlin/src/gcode/lcd/M0_M1.cpp | 4 +- Marlin/src/gcode/lcd/M73.cpp | 2 +- Marlin/src/gcode/sd/M1001.cpp | 2 +- Marlin/src/gcode/stats/M75-M78.cpp | 2 +- Marlin/src/gcode/temp/M303.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 3 + Marlin/src/inc/SanityCheck.h | 2 + Marlin/src/lcd/e3v2/common/dwin_set.h | 11 +- Marlin/src/lcd/e3v2/creality/dwin.cpp | 3 - Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 4 - .../src/lcd/e3v2/{enhanced => proui}/dwin.cpp | 247 +++++++++++------- .../src/lcd/e3v2/{enhanced => proui}/dwin.h | 21 +- .../e3v2/{enhanced => proui}/dwin_defines.h | 11 +- .../lcd/e3v2/{enhanced => proui}/dwin_lcd.cpp | 4 +- .../lcd/e3v2/{enhanced => proui}/dwin_lcd.h | 4 +- .../e3v2/{enhanced => proui}/dwin_popup.cpp | 12 +- .../lcd/e3v2/{enhanced => proui}/dwin_popup.h | 16 +- .../lcd/e3v2/{enhanced => proui}/dwinui.cpp | 6 +- .../src/lcd/e3v2/{enhanced => proui}/dwinui.h | 41 ++- .../e3v2/{enhanced => proui}/endstop_diag.cpp | 8 +- .../e3v2/{enhanced => proui}/endstop_diag.h | 4 +- .../e3v2/{enhanced => proui}/lockscreen.cpp | 4 +- .../lcd/e3v2/{enhanced => proui}/lockscreen.h | 4 +- .../e3v2/{enhanced => proui}/meshviewer.cpp | 10 +- .../lcd/e3v2/{enhanced => proui}/meshviewer.h | 8 +- .../e3v2/{enhanced => proui}/printstats.cpp | 8 +- .../lcd/e3v2/{enhanced => proui}/printstats.h | 8 +- Marlin/src/lcd/marlinui.cpp | 4 +- Marlin/src/lcd/marlinui.h | 6 +- Marlin/src/module/probe.cpp | 2 +- Marlin/src/module/settings.cpp | 4 +- Marlin/src/module/temperature.cpp | 2 +- Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h | 2 +- Marlin/src/sd/cardreader.cpp | 2 +- buildroot/tests/STM32F103RE_creality | 2 +- ini/features.ini | 2 +- platformio.ini | 2 +- 46 files changed, 319 insertions(+), 178 deletions(-) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin.cpp (95%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin.h (93%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin_defines.h (94%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin_lcd.cpp (98%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin_lcd.h (96%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin_popup.cpp (88%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwin_popup.h (83%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwinui.cpp (99%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/dwinui.h (92%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/endstop_diag.cpp (93%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/endstop_diag.h (90%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/lockscreen.cpp (95%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/lockscreen.h (92%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/meshviewer.cpp (94%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/meshviewer.h (87%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/printstats.cpp (94%) rename Marlin/src/lcd/e3v2/{enhanced => proui}/printstats.h (87%) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 302e94494e1a..02cf6d28d311 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -75,7 +75,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "lcd/e3v2/enhanced/dwin.h" + #include "lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "lcd/e3v2/jyersui/dwin.h" #endif diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 147164c16623..69c25cbe3319 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -58,7 +58,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #endif #include "../lcd/marlinui.h" diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index 9317e3489a83..8b78b53848f3 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -69,7 +69,7 @@ bool FilamentMonitorBase::enabled = true, #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #endif void event_filament_runout(const uint8_t extruder) { diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 51d658b20e57..9ec43fe49ddf 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -61,7 +61,7 @@ #elif ENABLED(DWIN_CREALITY_LCD) #include "../../../lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../../lcd/e3v2/enhanced/dwin.h" + #include "../../../lcd/e3v2/proui/dwin.h" #endif #if HAS_MULTI_HOTEND diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index eec89f73acff..090c15b0578c 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -41,7 +41,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../../lcd/e3v2/enhanced/dwin.h" + #include "../../../lcd/e3v2/proui/dwin.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index e6f0ef1f8907..ac6f97b00acb 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -34,7 +34,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../../lcd/e3v2/enhanced/dwin.h" + #include "../../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index df58992519e4..a38c5679395e 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -52,7 +52,7 @@ #elif ENABLED(DWIN_CREALITY_LCD) #include "../../lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif #if HAS_L64XX // set L6470 absolute position registers to counts diff --git a/Marlin/src/gcode/control/M997.cpp b/Marlin/src/gcode/control/M997.cpp index 73d795bcefc8..359172faad7c 100644 --- a/Marlin/src/gcode/control/M997.cpp +++ b/Marlin/src/gcode/control/M997.cpp @@ -25,7 +25,7 @@ #if ENABLED(PLATFORM_M997_SUPPORT) #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index b7fa45e2d063..6fb99226ce20 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -34,7 +34,7 @@ #elif ENABLED(DWIN_CREALITY_LCD) #include "../../../lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../../lcd/e3v2/enhanced/dwin.h" + #include "../../../lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "../../../lcd/e3v2/jyersui/dwin.h" // Temporary fix until it can be better implemented #endif diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index 2bf3c94f1cc2..a9223dda47f2 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -36,8 +36,8 @@ #elif ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin_popup.h" - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin_popup.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(HOST_PROMPT_SUPPORT) diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index b7a9b3459e52..c2c5485072e5 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -29,7 +29,7 @@ #include "../../sd/cardreader.h" #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index ad549946f06c..1579efd55557 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -50,7 +50,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(HOST_ACTION_COMMANDS) diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index 7d16899fd34e..368edb65d912 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -30,7 +30,7 @@ #include "../../MarlinCore.h" // for startOrResumeJob #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index a43575933b9d..7b56eb2d6ba9 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -31,7 +31,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../../lcd/e3v2/enhanced/dwin.h" + #include "../../lcd/e3v2/proui/dwin.h" #endif /** diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 7bc64d169be1..34a160fc5c86 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -494,6 +494,9 @@ #endif #define HAS_LCD_BRIGHTNESS 1 #define LCD_BRIGHTNESS_MAX 250 + #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #define LCD_BRIGHTNESS_DEFAULT 127 + #endif #endif #if IS_ULTRA_LCD diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 8e1a5a55d869..38c2866ca1f3 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -607,6 +607,8 @@ #error "LCD_SCREEN_ROT_180 is now LCD_SCREEN_ROTATE with a value of 180." #elif defined(LCD_SCREEN_ROT_270) #error "LCD_SCREEN_ROT_270 is now LCD_SCREEN_ROTATE with a value of 270." +#elif defined(DEFAULT_LCD_BRIGHTNESS) + #error "DEFAULT_LCD_BRIGHTNESS is now LCD_BRIGHTNESS_DEFAULT." #endif constexpr float arm[] = AXIS_RELATIVE_MODES; diff --git a/Marlin/src/lcd/e3v2/common/dwin_set.h b/Marlin/src/lcd/e3v2/common/dwin_set.h index 4fedd7a5843b..7f4438695478 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_set.h +++ b/Marlin/src/lcd/e3v2/common/dwin_set.h @@ -25,7 +25,16 @@ #define Language_English 1 #define Language_Chinese 2 -#define ICON 7 // Icon set file 7.ICO +//#define USE_STOCK_DWIN_SET // Use the Creality stock DWIN_SET instead of Marlin's unified DWIN_SET by The-EG & thinkyhead +#ifdef USE_STOCK_DWIN_SET + #define ICON 9 // 9.ICO +#else + #define ICON 7 // 7.ICO +#endif + +#ifndef CORP_WEBSITE + #define CORP_WEBSITE WEBSITE_URL +#endif #define ICON_LOGO 0 #define ICON_Print_0 1 diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index f17d97cc7c4c..f20260e43d51 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -91,9 +91,6 @@ #ifndef MACHINE_SIZE #define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS) #endif -#ifndef CORP_WEBSITE - #define CORP_WEBSITE WEBSITE_URL -#endif #define PAUSE_HEAT diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 1356c0e47552..0eedddb50099 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -82,10 +82,6 @@ #define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS) -#ifndef CORP_WEBSITE - #define CORP_WEBSITE WEBSITE_URL - #endif - #define DWIN_FONT_MENU font8x16 #define DWIN_FONT_STAT font10x20 #define DWIN_FONT_HEAD font10x20 diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp similarity index 95% rename from Marlin/src/lcd/e3v2/enhanced/dwin.cpp rename to Marlin/src/lcd/e3v2/proui/dwin.cpp index 58885e1c21b6..4d7f38171d0a 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -21,10 +21,12 @@ */ /** - * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.9.1 - * Date: 2021/11/21 + * Enhanced DWIN implementation + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.11.2 + * date: 2022/01/19 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" @@ -83,6 +85,10 @@ #include "../../../feature/powerloss.h" #endif +#if HAS_GCODE_PREVIEW + #include "gcode_preview.h" +#endif + #if HAS_ESDIAG #include "endstop_diag.h" #endif @@ -113,10 +119,6 @@ #include "lockscreen.h" -#ifndef CORP_WEBSITE - #define CORP_WEBSITE WEBSITE_URL -#endif - #define PAUSE_HEAT #define MENU_CHAR_LIMIT 24 @@ -169,7 +171,7 @@ enum SelectItem : uint8_t { PAGE_PRINT = 0, PAGE_PREPARE, PAGE_CONTROL, - PAGE_INFO_LEVELING, + PAGE_INFO_LEV_ADV, PAGE_COUNT, PRINT_SETUP = 0, @@ -310,11 +312,11 @@ void ICON_Button(const bool selected, const int iconid, const frame_rect_t &ico, DWIN_ICON_Show(true, false, false, ICON, iconid + selected, ico.x, ico.y); if (selected) DWINUI::Draw_Box(0, HMI_data.Highlight_Color, ico); if (HMI_IsChinese()) { - DWIN_Frame_AreaCopy(1, txt.x, txt.y[selected], txt.x + txt.w - 1, txt.y[selected] + txt.h - 1, ico.x + (ico.w - txt.w) / 2, (ico.y + ico.h - 28) - txt.h/2); + DWIN_Frame_AreaCopy(1, txt.x, txt.y[selected], txt.x + txt.w - 1, txt.y[selected] + txt.h - 1, ico.x + (ico.w - txt.w) / 2, (ico.y + ico.h - 25) - txt.h/2); } else { const uint16_t x = ico.x + (ico.w - strlen_P(FTOP(caption)) * DWINUI::fontWidth()) / 2, - y = (ico.y + ico.h - 28) - DWINUI::fontHeight() / 2; + y = (ico.y + ico.h - 20) - DWINUI::fontHeight() / 2; DWINUI::Draw_String(x, y, caption); } } @@ -324,7 +326,7 @@ void ICON_Button(const bool selected, const int iconid, const frame_rect_t &ico, // void ICON_Print() { constexpr frame_rect_t ico = { 17, 110, 110, 100 }; - constexpr text_info_t txt = { 1, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 1, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_page.now == PAGE_PRINT, ICON_Print_0, ico, txt, GET_TEXT_F(MSG_BUTTON_PRINT)); } @@ -333,7 +335,7 @@ void ICON_Print() { // void ICON_Prepare() { constexpr frame_rect_t ico = { 145, 110, 110, 100 }; - constexpr text_info_t txt = { 31, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 31, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_page.now == PAGE_PREPARE, ICON_Prepare_0, ico, txt, GET_TEXT_F(MSG_PREPARE)); } @@ -342,7 +344,7 @@ void ICON_Prepare() { // void ICON_Control() { constexpr frame_rect_t ico = { 17, 226, 110, 100 }; - constexpr text_info_t txt = { 61, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 61, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_page.now == PAGE_CONTROL, ICON_Control_0, ico, txt, GET_TEXT_F(MSG_CONTROL)); } @@ -351,8 +353,8 @@ void ICON_Control() { // void ICON_StartInfo() { constexpr frame_rect_t ico = { 145, 226, 110, 100 }; - constexpr text_info_t txt = { 91, { 405, 447 }, 27, 15 }; - ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_INFO)); + constexpr text_info_t txt = { 91, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; + ICON_Button(select_page.now == PAGE_INFO_LEV_ADV, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_INFO)); } // @@ -360,8 +362,17 @@ void ICON_StartInfo() { // void ICON_Leveling() { constexpr frame_rect_t ico = { 145, 226, 110, 100 }; - constexpr text_info_t txt = { 211, { 405, 447 }, 27, 15 }; - ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Leveling_0, ico, txt, GET_TEXT_F(MSG_BUTTON_LEVEL)); + constexpr text_info_t txt = { 211, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; + ICON_Button(select_page.now == PAGE_INFO_LEV_ADV, ICON_Leveling_0, ico, txt, GET_TEXT_F(MSG_BUTTON_LEVEL)); +} + +// +// Main Menu: "Advanced Settings" +// +void ICON_AdvSettings() { + constexpr frame_rect_t ico = { 145, 226, 110, 100 }; + constexpr text_info_t txt = { 91, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; + ICON_Button(select_page.now == PAGE_INFO_LEV_ADV, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_ADVANCED)); } // @@ -369,7 +380,7 @@ void ICON_Leveling() { // void ICON_Tune() { constexpr frame_rect_t ico = { 8, 232, 80, 100 }; - constexpr text_info_t txt = { 121, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 121, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_print.now == PRINT_SETUP, ICON_Setup_0, ico, txt, GET_TEXT_F(MSG_TUNE)); } @@ -378,7 +389,7 @@ void ICON_Tune() { // void ICON_Pause() { constexpr frame_rect_t ico = { 96, 232, 80, 100 }; - constexpr text_info_t txt = { 181, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 181, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_print.now == PRINT_PAUSE_RESUME, ICON_Pause_0, ico, txt, GET_TEXT_F(MSG_BUTTON_PAUSE)); } @@ -387,7 +398,7 @@ void ICON_Pause() { // void ICON_Resume() { constexpr frame_rect_t ico = { 96, 232, 80, 100 }; - constexpr text_info_t txt = { 1, { 405, 447 }, 27, 15 }; + constexpr text_info_t txt = { 1, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; ICON_Button(select_print.now == PRINT_PAUSE_RESUME, ICON_Continue_0, ico, txt, GET_TEXT_F(MSG_BUTTON_RESUME)); } @@ -396,7 +407,7 @@ void ICON_Resume() { // void ICON_Stop() { constexpr frame_rect_t ico = { 184, 232, 80, 100 }; - constexpr text_info_t txt = { 151, { 405, 447 }, 27, 12 }; + constexpr text_info_t txt = { 151, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 12 }; ICON_Button(select_print.now == PRINT_STOP, ICON_Stop_0, ico, txt, GET_TEXT_F(MSG_BUTTON_STOP)); } @@ -453,18 +464,13 @@ void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const DWINUI::Draw_Int(HMI_data.Text_Color, bcolor, iNum , VALX, MBASE(line) - 1, value); } -// The "Back" label is always on the first line -void Draw_Back_Label() { - if (HMI_IsChinese()) - DWIN_Frame_AreaCopy(1, 129, 72, 156, 84, LBLX, MBASE(0)); - else - DWIN_Frame_AreaCopy(1, 223, 179, 254, 189, LBLX, MBASE(0)); -} - // Draw "Back" line at the top void Draw_Back_First(const bool is_sel=true) { Draw_Menu_Line(0, ICON_Back); - Draw_Back_Label(); + if (HMI_IsChinese()) + DWIN_Frame_AreaCopy(1, 129, 72, 156, 84, LBLX, MBASE(0)); + else + DWINUI::Draw_String(LBLX, MBASE(0), GET_TEXT_F(MSG_BACK)); if (is_sel) Draw_Menu_Cursor(0); } @@ -489,15 +495,15 @@ inline bool Apply_Encoder(const EncoderState &encoder_diffState, T &valref) { //PopUps void Popup_window_PauseOrStop() { if (HMI_IsChinese()) { - DWINUI::ClearMenuArea(); + DWINUI::ClearMenuArea(); Draw_Popup_Bkgd(); if (select_print.now == PRINT_PAUSE_RESUME) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150); else if (select_print.now == PRINT_STOP) DWIN_Frame_AreaCopy(1, 221, 320, 253, 336, 98, 150); DWIN_Frame_AreaCopy(1, 220, 304, 264, 319, 130, 150); - DWINUI::Draw_Icon(ICON_Confirm_C, 26, 280); - DWINUI::Draw_Icon(ICON_Cancel_C, 146, 280); + DWINUI::Draw_IconWB(ICON_Confirm_C, 26, 280); + DWINUI::Draw_IconWB(ICON_Cancel_C, 146, 280); Draw_Select_Highlight(true); - DWIN_UpdateLCD(); + DWIN_UpdateLCD(); } else DWIN_Popup_ConfirmCancel(ICON_BLTouch, select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT_F(MSG_PAUSE_PRINT) : GET_TEXT_F(MSG_STOP_PRINT)); @@ -513,7 +519,7 @@ void Popup_window_PauseOrStop() { DWINUI::Draw_Icon(ICON_TempTooLow, 102, 105); DWIN_Frame_AreaCopy(1, 103, 371, 136, 386, 69, 240); DWIN_Frame_AreaCopy(1, 170, 371, 270, 386, 102, 240); - DWINUI::Draw_Icon(ICON_Confirm_C, 86, 280); + DWINUI::Draw_IconWB(ICON_Confirm_C, 86, 280); DWIN_UpdateLCD(); } else @@ -527,8 +533,8 @@ void Popup_window_PauseOrStop() { DWINUI::ClearMenuArea(); Draw_Popup_Bkgd(); if (HMI_IsChinese()) { - if (toohigh) { - DWINUI::Draw_Icon(ICON_TempTooHigh, 102, 165); + if (toohigh) { + DWINUI::Draw_Icon(ICON_TempTooHigh, 102, 165); DWIN_Frame_AreaCopy(1, 103, 371, 237, 386, 52, 285); DWIN_Frame_AreaCopy(1, 151, 389, 185, 402, 187, 285); DWIN_Frame_AreaCopy(1, 189, 389, 271, 402, 95, 310); @@ -637,7 +643,7 @@ void Draw_Print_Labels() { } void Draw_Print_ProgressBar() { - DWINUI::Draw_Icon(ICON_Bar, 15, 93); + DWINUI::Draw_IconWB(ICON_Bar, 15, 93); DWIN_Draw_Rectangle(1, HMI_data.Barfill_Color, 16 + _percent_done * 240 / 100, 93, 256, 113); DWINUI::Draw_Int(HMI_data.PercentTxt_Color, HMI_data.Background_Color, 3, 117, 133, _percent_done); DWINUI::Draw_String(HMI_data.PercentTxt_Color, 142, 133, F("%")); @@ -707,7 +713,7 @@ void Draw_PrintDone() { Draw_Print_ProgressElapsed(); Draw_Print_ProgressRemain(); // show print done confirm - DWINUI::Draw_Icon(HMI_IsChinese() ? ICON_Confirm_C : ICON_Confirm_E, 86, 273); + DWINUI::Draw_IconWB(HMI_IsChinese() ? ICON_Confirm_C : ICON_Confirm_E, 86, 273); DWIN_UpdateLCD(); } @@ -721,7 +727,7 @@ void Draw_Main_Menu() { ICON_Print(); ICON_Prepare(); ICON_Control(); - TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); + ICON_AdvSettings(); DWIN_UpdateLCD(); } @@ -745,11 +751,11 @@ void _update_axis_value(const AxisEnum axis, const uint16_t x, const uint16_t y, if (force || changed || draw_qmark || draw_empty) { if (blink && draw_qmark) - DWINUI::Draw_String(HMI_data.Coordinate_Color, HMI_data.Background_Color, x, y, F("--?--")); + DWINUI::Draw_String(HMI_data.Coordinate_Color, HMI_data.Background_Color, x, y, F(" - ? -")); else if (blink && draw_empty) DWINUI::Draw_String(HMI_data.Coordinate_Color, HMI_data.Background_Color, x, y, F(" ")); else - DWINUI::Draw_Signed_Float(HMI_data.Coordinate_Color, HMI_data.Background_Color, 3, 1, x, y, p); + DWINUI::Draw_Signed_Float(HMI_data.Coordinate_Color, HMI_data.Background_Color, 3, 2, x, y, p); } } @@ -911,8 +917,6 @@ void MarlinUI::refresh() { /* Nothing to see here */ } void MarlinUI::_set_brightness() { DWIN_LCD_Brightness(backlight ? brightness : 0); } #endif -#define ICON_Folder ICON_More - #if ENABLED(SCROLL_LONG_FILENAMES) char shift_name[LONG_FILENAME_LENGTH + 1]; @@ -1115,25 +1119,25 @@ void HMI_StartFrame(const bool with_update) { void Draw_Info_Menu() { DWINUI::ClearMenuArea(); Draw_Back_First(); - - DWINUI::Draw_CenteredString(122, F(MACHINE_SIZE)); - DWINUI::Draw_CenteredString(195, F(SHORT_BUILD_VERSION)); - - if (HMI_IsChinese()) { + if (HMI_IsChinese()) Title.FrameCopy(30, 17, 28, 13); // "Info" + else + Title.ShowCaption(GET_TEXT_F(MSG_INFO_SCREEN)); + if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 197, 149, 252, 161, 108, 102); // "Size" DWIN_Frame_AreaCopy(1, 1, 164, 56, 176, 108, 175); // "Firmware Version" DWIN_Frame_AreaCopy(1, 58, 164, 113, 176, 105, 248); // "Contact Details" + DWINUI::Draw_CenteredString(268, F(CORP_WEBSITE)); } else { - Title.ShowCaption(GET_TEXT_F(MSG_INFO_SCREEN)); - - DWIN_Frame_AreaCopy(1, 120, 150, 146, 161, 124, 102); // "Size" - DWIN_Frame_AreaCopy(1, 146, 151, 254, 161, 82, 175); // "Firmware Version" - DWIN_Frame_AreaCopy(1, 1, 164, 96, 175, 89, 248); // "Contact details" + DWINUI::Draw_CenteredString(102, F("Size")); + DWINUI::Draw_CenteredString(175, F("Firmware version")); + DWINUI::Draw_CenteredString(248, F("Build Datetime")); + DWINUI::Draw_CenteredString(268, F(STRING_DISTRIBUTION_DATE)); } - DWINUI::Draw_CenteredString(268, F(CORP_WEBSITE)); + DWINUI::Draw_CenteredString(122, F(MACHINE_SIZE)); + DWINUI::Draw_CenteredString(195, F(SHORT_BUILD_VERSION)); LOOP_L_N(i, 3) { DWINUI::Draw_Icon(ICON_PrintSize + i, ICOX, 99 + i * 73); @@ -1162,7 +1166,7 @@ void HMI_MainMenu() { case PAGE_PRINT: ICON_Print(); break; case PAGE_PREPARE: ICON_Print(); ICON_Prepare(); break; case PAGE_CONTROL: ICON_Prepare(); ICON_Control(); break; - case PAGE_INFO_LEVELING: ICON_Control(); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; + case PAGE_INFO_LEV_ADV: ICON_Control(); ICON_AdvSettings(); break; } } } @@ -1171,8 +1175,8 @@ void HMI_MainMenu() { switch (select_page.now) { case PAGE_PRINT: ICON_Print(); ICON_Prepare(); break; case PAGE_PREPARE: ICON_Prepare(); ICON_Control(); break; - case PAGE_CONTROL: ICON_Control(); TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; - case PAGE_INFO_LEVELING: TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); break; + case PAGE_CONTROL: ICON_Control(); ICON_AdvSettings(); break; + case PAGE_INFO_LEV_ADV: ICON_AdvSettings(); break; } } } @@ -1180,6 +1184,7 @@ void HMI_MainMenu() { switch (select_page.now) { case PAGE_PRINT: checkkey = SelectFile; + card.mount(); Draw_Print_File_Menu(); break; @@ -1187,14 +1192,7 @@ void HMI_MainMenu() { case PAGE_CONTROL: Draw_Control_Menu(); break; - case PAGE_INFO_LEVELING: - #if HAS_ONESTEP_LEVELING - queue.inject(F("G28Z\nG29")); // Force to get the current Z home position - #else - last_checkkey = MainMenu; - Goto_Info_Menu(); - #endif - break; + case PAGE_INFO_LEV_ADV: Draw_AdvancedSettings_Menu(); break; } } DWIN_UpdateLCD(); @@ -1469,6 +1467,9 @@ void Draw_Main_Area() { case FilamentPurge: Draw_Popup_FilamentPurge(); break; #endif case Locked: lockScreen.draw(); break; + #if HAS_GCODE_PREVIEW + case ConfirmToPrint: Draw_PreviewFromSD(); break; + #endif case Menu: case SetInt: case SetPInt: @@ -1496,14 +1497,12 @@ void HMI_Popup() { void HMI_Init() { HMI_SDCardInit(); - for (uint16_t t = 0; t <= 100; t += 2) { DWINUI::Draw_Icon(ICON_Bar, 15, 260); DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 15 + t * 242 / 100, 260, 257, 280); DWIN_UpdateLCD(); delay(20); } - HMI_SetLanguage(); } @@ -1623,15 +1622,15 @@ void EachMomentUpdate() { if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 160, 338, 235, 354, 98, 115); DWIN_Frame_AreaCopy(1, 103, 321, 271, 335, 52, 167); - DWINUI::Draw_Icon(ICON_Cancel_C, 26, 280); - DWINUI::Draw_Icon(ICON_Continue_C, 146, 280); + DWINUI::Draw_IconWB(ICON_Cancel_C, 26, 280); + DWINUI::Draw_IconWB(ICON_Continue_C, 146, 280); } else { DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 70, GET_TEXT_F(MSG_OUTAGE_RECOVERY)); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 147, F("It looks like the last")); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 167, F("file was interrupted.")); - DWINUI::Draw_Icon(ICON_Cancel_E, 26, 280); - DWINUI::Draw_Icon(ICON_Continue_E, 146, 280); + DWINUI::Draw_IconWB(ICON_Cancel_E, 26, 280); + DWINUI::Draw_IconWB(ICON_Continue_E, 146, 280); } SdFile *dir = nullptr; const char * const filename = card.diveToFile(true, dir, recovery.info.sd_filename); @@ -1698,6 +1697,9 @@ void DWIN_HandleScreen() { #if ENABLED(POWER_LOSS_RECOVERY) case PwrlossRec: HMI_PowerlossRecovery(); break; #endif + #if HAS_GCODE_PREVIEW + case ConfirmToPrint: HMI_ConfirmToPrint(); break; + #endif #if HAS_ESDIAG case ESDiagProcess: HMI_Popup(); break; #endif @@ -1747,7 +1749,7 @@ void DWIN_MeshLevelingStart() { #if HAS_ONESTEP_LEVELING HMI_SaveProcessID(Leveling); Title.ShowCaption(GET_TEXT_F(MSG_BED_LEVELING)); - DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT)); + DWIN_Show_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT), ICON_Cancel_E); #elif ENABLED(MESH_BED_LEVELING) Draw_ManualMesh_Menu(); #endif @@ -1924,7 +1926,8 @@ void DWIN_LoadSettings(const char *buff) { } void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) { - DWIN_Draw_Popup(ICON_BLTouch, lcd_error, lcd_component); + DWIN_Draw_Popup(ICON_BLTouch, F("Printer killed:"), lcd_error); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 270, F("Turn off the printer")); DWIN_UpdateLCD(); } @@ -1969,8 +1972,8 @@ void DWIN_Redraw_screen() { void Draw_Popup_FilamentPurge() { DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), F("Purge or Continue?")); - DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); - DWINUI::Draw_Icon(ICON_Continue_E, 146, 280); + DWINUI::Draw_IconWB(ICON_Confirm_E, 26, 280); + DWINUI::Draw_IconWB(ICON_Continue_E, 146, 280); Draw_Select_Highlight(true); DWIN_UpdateLCD(); } @@ -2037,6 +2040,41 @@ void HMI_LockScreen() { if (lockScreen.isUnlocked()) DWIN_UnLockScreen(); } +#if HAS_GCODE_PREVIEW + + void HMI_ConfirmToPrint() { + EncoderState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + if (encoder_diffState == ENCODER_DIFF_CW) + Draw_Select_Highlight(false); + else if (encoder_diffState == ENCODER_DIFF_CCW) + Draw_Select_Highlight(true); + else if (encoder_diffState == ENCODER_DIFF_ENTER) { + if (HMI_flag.select_flag) { // Confirm + card.openAndPrintFile(card.filename); + DWIN_Print_Started(true); + } + else { // Cancel + DWIN_ResetStatusLine(); + checkkey = SelectFile; + Draw_Print_File_Menu(); + } + } + DWIN_UpdateLCD(); + } + +#endif + +void Goto_ConfirmToPrint() { + #if HAS_GCODE_PREVIEW + HMI_SaveProcessID(ConfirmToPrint); + Draw_PreviewFromSD(); + #else + card.openAndPrintFile(card.filename); + DWIN_Print_Started(true); + #endif +} + #if HAS_ESDIAG void Draw_EndStopDiag() { HMI_SaveProcessID(ESDiagProcess); @@ -2308,8 +2346,9 @@ void SetPID(celsius_t t, heater_id_t h) { #endif #if HAS_LCD_BRIGHTNESS - void LiveBrightness() { ui.set_brightness(HMI_value.Value); } - void SetBrightness() { SetIntOnClick(LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.brightness, nullptr, LiveBrightness); } + void ApplyBrightness() { ui.set_brightness(HMI_value.Value); } + void LiveBrightness() { DWIN_LCD_Brightness(HMI_value.Value); } + void SetBrightness() { SetIntOnClick(LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.brightness, ApplyBrightness, LiveBrightness); } #endif #if ENABLED(CASE_LIGHT_MENU) @@ -2382,6 +2421,12 @@ void SetPID(celsius_t t, heater_id_t h) { #endif #endif +#if ENABLED(NOZZLE_PARK_FEATURE) + void SetParkPosX() { SetPIntOnClick(0, X_MAX_POS); } + void SetParkPosY() { SetPIntOnClick(0, Y_MAX_POS); } + void SetParkZRaise() { SetPIntOnClick(0, 50); } +#endif + #if HAS_FILAMENT_SENSOR void SetRunoutEnable() { runout.reset(); @@ -2490,9 +2535,11 @@ void Tram(uint8_t point) { static bool inLev = false; if (inLev) return; char str_1[6] = "", str_2[6] = "", str_3[6] = ""; + #define fmt "X:%s, Y:%s, Z:%s" float xpos = 0, ypos = 0, zval = 0; float margin = PROBING_MARGIN; #else + #define fmt "M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300" int16_t xpos = 0, ypos = 0; int16_t margin = 30; #endif @@ -2527,7 +2574,7 @@ void Tram(uint8_t point) { planner.synchronize(); inLev = true; zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW); - sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"), + sprintf_P(cmd, PSTR(fmt), dtostrf(xpos, 1, 1, str_1), dtostrf(ypos, 1, 1, str_2), dtostrf(zval, 1, 2, str_3) @@ -2536,7 +2583,7 @@ void Tram(uint8_t point) { inLev = false; #else planner.synchronize(); - sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"), xpos, ypos); + sprintf_P(cmd, PSTR(fmt), xpos, ypos); queue.inject(cmd); #endif } @@ -2957,7 +3004,7 @@ void onDrawSpeed(MenuItemClass* menuitem, int8_t line) { void onDrawMaxSpeedX(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 228, 147); - DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 58, MBASE(line)); // X + DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 58, MBASE(line)); // X } onDrawPFloatMenu(menuitem, line); } @@ -2965,7 +3012,7 @@ void onDrawMaxSpeedX(MenuItemClass* menuitem, int8_t line) { void onDrawMaxSpeedY(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 228, 147); - DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 58, MBASE(line)); // Y + DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 58, MBASE(line)); // Y } onDrawPFloatMenu(menuitem, line); } @@ -2973,7 +3020,7 @@ void onDrawMaxSpeedY(MenuItemClass* menuitem, int8_t line) { void onDrawMaxSpeedZ(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 228, 147); - DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 58, MBASE(line) + 3); // Z + DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 58, MBASE(line) + 3); // Z } onDrawPFloatMenu(menuitem, line); } @@ -2982,7 +3029,7 @@ void onDrawMaxSpeedZ(MenuItemClass* menuitem, int8_t line) { void onDrawMaxSpeedE(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 228, 147); - DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 58, MBASE(line)); // E + DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 58, MBASE(line)); // E } onDrawPFloatMenu(menuitem, line); } @@ -2991,7 +3038,7 @@ void onDrawMaxSpeedZ(MenuItemClass* menuitem, int8_t line) { void onDrawAcc(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); - DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line) + 1); // ...Acceleration + DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line) + 1); // ...Acceleration } onDrawSubMenu(menuitem, line); } @@ -3000,7 +3047,7 @@ void onDrawMaxAccelX(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); - DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 71, MBASE(line)); // X + DWIN_Frame_AreaCopy(1, 229, 133, 236, 147, LBLX + 71, MBASE(line)); // X } onDrawPInt32Menu(menuitem, line); } @@ -3008,8 +3055,8 @@ void onDrawMaxAccelX(MenuItemClass* menuitem, int8_t line) { void onDrawMaxAccelY(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); - DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); - DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 71, MBASE(line)); // Y + DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); + DWIN_Frame_AreaCopy(1, 1, 150, 7, 160, LBLX + 71, MBASE(line)); // Y } onDrawPInt32Menu(menuitem, line); } @@ -3017,8 +3064,8 @@ void onDrawMaxAccelY(MenuItemClass* menuitem, int8_t line) { void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); - DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); - DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 71, MBASE(line)); // Z + DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); + DWIN_Frame_AreaCopy(1, 9, 150, 16, 160, LBLX + 71, MBASE(line)); // Z } onDrawPInt32Menu(menuitem, line); } @@ -3027,8 +3074,8 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { void onDrawMaxAccelE(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); - DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); - DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 71, MBASE(line)); // E + DWIN_Frame_AreaCopy(1, 28, 149, 69, 161, LBLX + 27, MBASE(line)); + DWIN_Frame_AreaCopy(1, 18, 150, 25, 160, LBLX + 71, MBASE(line)); // E } onDrawPInt32Menu(menuitem, line); } @@ -3039,7 +3086,7 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { void onDrawJerk(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); - DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(line) + 1); // ... + DWIN_Frame_AreaCopy(1, 1, 180, 28, 192, LBLX + 27, MBASE(line) + 1); // ... DWIN_Frame_AreaCopy(1, 202, 133, 228, 147, LBLX + 54, MBASE(line)); // ...Jerk } onDrawSubMenu(menuitem, line); @@ -3286,6 +3333,9 @@ void Draw_Prepare_Menu() { #if ENABLED(MESH_BED_LEVELING) MENU_ITEM(ICON_ManualMesh, GET_TEXT_F(MSG_MANUAL_MESH), onDrawSubMenu, Draw_ManualMesh_Menu); #endif + #if HAS_ONESTEP_LEVELING + MENU_ITEM(ICON_Level, GET_TEXT_F(MSG_AUTO_MESH), onDrawMenuItem, AutoLev); + #endif #if HAS_ZOFFSET_ITEM #if HAS_BED_PROBE MENU_ITEM(ICON_SetZOffset, GET_TEXT_F(MSG_PROBE_WIZARD), onDrawSubMenu, Draw_ZOffsetWiz_Menu); @@ -3334,12 +3384,12 @@ void Draw_Control_Menu() { if (CurrentMenu != ControlMenu) { CurrentMenu = ControlMenu; SetMenuTitle({103, 1, 28, 14}, GET_TEXT_F(MSG_CONTROL)); - DWINUI::MenuItemsPrepare(11); + DWINUI::MenuItemsPrepare(8); MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); #if ENABLED(CASE_LIGHT_MENU) #if ENABLED(CASELIGHT_USES_BRIGHTNESS) MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawSubMenu, Draw_CaseLight_Menu); - #else + #else MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); #endif #endif @@ -3354,7 +3404,6 @@ void Draw_Control_Menu() { MENU_ITEM(ICON_ResumeEEPROM, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawResetEeprom, ResetEeprom); #endif MENU_ITEM(ICON_Reboot, GET_TEXT_F(MSG_RESET_PRINTER), onDrawMenuItem, RebootPrinter); - MENU_ITEM(ICON_AdvSet, GET_TEXT_F(MSG_ADVANCED_SETTINGS), onDrawSubMenu, Draw_AdvancedSettings_Menu); MENU_ITEM(ICON_Info, GET_TEXT_F(MSG_INFO_SCREEN), onDrawInfoSubMenu, Goto_Info_Menu); } CurrentMenu->draw(); @@ -3367,7 +3416,7 @@ void Draw_AdvancedSettings_Menu() { CurrentMenu = AdvancedSettings; SetMenuTitle({0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG DWINUI::MenuItemsPrepare(15); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); #if HAS_HOME_OFFSET MENU_ITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu); #endif @@ -3601,7 +3650,7 @@ void Draw_Tune_Menu() { MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); #elif ENABLED(LED_CONTROL_MENU) && DISABLED(CASE_LIGHT_USE_NEOPIXEL) MENU_ITEM(ICON_LedControl, GET_TEXT_F(MSG_LEDS), onDrawLedStatus, SetLedStatus); - #endif + #endif EDIT_ITEM(ICON_Speed, GET_TEXT_F(MSG_SPEED), onDrawSpeedItem, SetSpeed, &feedrate_percentage); #if HAS_HOTEND HotendTargetItem = EDIT_ITEM(ICON_HotendTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h similarity index 93% rename from Marlin/src/lcd/e3v2/enhanced/dwin.h rename to Marlin/src/lcd/e3v2/proui/dwin.h index bbbe00aa9fb6..04ac1590ebf1 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -22,10 +22,12 @@ #pragma once /** - * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.9.1 - * Date: 2021/11/21 + * Enhanced DWIN implementation + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.9.2 + * date: 2021/11/21 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" @@ -62,6 +64,7 @@ enum processID : uint8_t { PwrlossRec, Reboot, Info, + ConfirmToPrint, // Popup Windows Homing, @@ -90,6 +93,8 @@ enum pidresult_t : uint8_t { typedef struct { int8_t Color[3]; // Color components + uint16_t pidgrphpoints = 0; + pidresult_t pidresult = PID_DONE; int8_t Preheat = 0; // Material Select 0: PLA, 1: ABS, 2: Custom AxisEnum axis = X_AXIS; // Axis Select int32_t MaxValue = 0; // Auxiliar max integer/scaled float value @@ -137,6 +142,7 @@ void Goto_PrintProcess(); void Goto_Main_Menu(); void Goto_Info_Menu(); void Goto_PowerLossRecovery(); +void Goto_ConfirmToPrint(); void Draw_Status_Area(const bool with_update); // Status Area void Draw_Main_Area(); // Redraw main area; void DWIN_Redraw_screen(); // Redraw all screen elements @@ -191,6 +197,9 @@ void HMI_LockScreen(); #if HAS_MESH void DWIN_MeshViewer(); #endif +#if HAS_GCODE_PREVIEW + void HMI_ConfirmToPrint(); +#endif #if HAS_ESDIAG void Draw_EndStopDiag(); #endif @@ -221,6 +230,10 @@ void Draw_Tramming_Menu(); #if HAS_FILAMENT_SENSOR void Draw_FilSet_Menu(); #endif +#if ENABLED(NOZZLE_PARK_FEATURE) + void Draw_ParkPos_Menu(); +#endif +void Draw_PhySet_Menu(); void Draw_SelectColors_Menu(); void Draw_GetColor_Menu(); #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h similarity index 94% rename from Marlin/src/lcd/e3v2/enhanced/dwin_defines.h rename to Marlin/src/lcd/e3v2/proui/dwin_defines.h index 907177ab32f6..3dc2408f4a00 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -23,11 +23,16 @@ /** * DWIN general defines and data structs - * Author: Miguel A. Risco-Castillo - * Version: 3.9.1 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.9.2 * Date: 2021/11/21 + * + * Based on the original code provided by Creality under GPL */ +//#define NEED_HEX_PRINT 1 +//#define DEBUG_DWIN 1 + #include "../../../core/types.h" #include "../common/dwin_color.h" #if ENABLED(LED_CONTROL_MENU) @@ -53,8 +58,8 @@ #define Def_Indicator_Color Color_White #define Def_Coordinate_Color Color_White +//#define HAS_GCODE_PREVIEW 1 #define HAS_ESDIAG 1 -#define DEFAULT_LCD_BRIGHTNESS 127 #if ENABLED(LED_CONTROL_MENU, HAS_COLOR_LEDS) #define Def_Leds_Color LEDColorWhite() diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp similarity index 98% rename from Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp rename to Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp index 83cbc207183d..105f1aaf1cd4 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp @@ -22,9 +22,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo + * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 3.8.1 * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h b/Marlin/src/lcd/e3v2/proui/dwin_lcd.h similarity index 96% rename from Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h rename to Marlin/src/lcd/e3v2/proui/dwin_lcd.h index fc1b6d675609..623a94f09e17 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.h @@ -23,9 +23,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo + * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 3.8.1 * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../common/dwin_api.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp similarity index 88% rename from Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp rename to Marlin/src/lcd/e3v2/proui/dwin_popup.cpp index cf1ab8c0adaa..34b05328d7e9 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp @@ -22,9 +22,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 - * Date: 2021/11/06 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.10.1 + * Date: 2022/01/21 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" @@ -52,8 +54,8 @@ void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fm void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2) { DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), fmsg2); - DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); - DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280); + DWINUI::Draw_IconWB(ICON_Confirm_E, 26, 280); + DWINUI::Draw_IconWB(ICON_Cancel_E, 146, 280); Draw_Select_Highlight(true); DWIN_UpdateLCD(); } diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_popup.h b/Marlin/src/lcd/e3v2/proui/dwin_popup.h similarity index 83% rename from Marlin/src/lcd/e3v2/enhanced/dwin_popup.h rename to Marlin/src/lcd/e3v2/proui/dwin_popup.h index 65784a8c9f56..2e952cc1b99b 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_popup.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.h @@ -23,9 +23,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 - * Date: 2021/11/06 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.10.1 + * Date: 2022/01/21 + * + * Based on the original code provided by Creality under GPL */ #include "dwinui.h" @@ -47,7 +49,13 @@ void DWIN_Draw_Popup(const uint8_t icon, T amsg1=nullptr, U amsg2=nullptr, uint8 if (icon) DWINUI::Draw_Icon(icon, 101, 105); if (amsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, amsg1); if (amsg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, amsg2); - if (button) DWINUI::Draw_Icon(button, 86, 280); + if (button) DWINUI::Draw_IconWB(button, 86, 280); +} + +template +void DWIN_Show_Popup(const uint8_t icon, T amsg1=nullptr, U amsg2=nullptr, uint8_t button=0) { + DWIN_Draw_Popup(icon, amsg1, amsg2, button); + DWIN_UpdateLCD(); } template diff --git a/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp similarity index 99% rename from Marlin/src/lcd/e3v2/enhanced/dwinui.cpp rename to Marlin/src/lcd/e3v2/proui/dwinui.cpp index 501725374006..d3cfc9a3e472 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -22,9 +22,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.8.2 * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h similarity index 92% rename from Marlin/src/lcd/e3v2/enhanced/dwinui.h rename to Marlin/src/lcd/e3v2/proui/dwinui.h index 4f0dadc90959..595c534356d4 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -23,9 +23,11 @@ /** * DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo - * Version: 3.9.1 - * Date: 2021/11/21 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.11.1 + * Date: 2022/01/19 + * + * Based on the original code provided by Creality under GPL */ #include "dwin_lcd.h" @@ -34,6 +36,10 @@ #include "../common/dwin_color.h" // Extra Icons +#define ICON_AdvSet ICON_Language +#define ICON_BedSizeX ICON_PrintSize +#define ICON_BedSizeY ICON_PrintSize +#define ICON_Binary ICON_Contact #define ICON_Brightness ICON_Motion #define ICON_Cancel ICON_StockConfiguration #define ICON_CustomPreheat ICON_SetEndTemp @@ -45,6 +51,7 @@ #define ICON_FilSet ICON_ResumeEEPROM #define ICON_FilUnload ICON_ReadEEPROM #define ICON_Flow ICON_StepE +#define ICON_Folder ICON_More #define ICON_FWRetLength ICON_StepE #define ICON_FWRetSpeed ICON_Setspeed #define ICON_FWRetZRaise ICON_MoveZ @@ -52,28 +59,49 @@ #define ICON_HomeX ICON_MoveX #define ICON_HomeY ICON_MoveY #define ICON_HomeZ ICON_MoveZ +#define ICON_HomeOffset ICON_AdvSet +#define ICON_HomeOffsetX ICON_StepX +#define ICON_HomeOffsetY ICON_StepY +#define ICON_HomeOffsetZ ICON_StepZ #define ICON_HSMode ICON_StockConfiguration +#define ICON_InvertE0 ICON_StepE #define ICON_Tram ICON_SetEndTemp +#define ICON_Level ICON_HotendTemp #define ICON_Lock ICON_Cool #define ICON_ManualMesh ICON_HotendTemp +#define ICON_MaxPosX ICON_MoveX +#define ICON_MaxPosY ICON_MoveY +#define ICON_MaxPosZ ICON_MoveZ #define ICON_MeshNext ICON_Axis +#define ICON_MeshPoints ICON_SetEndTemp #define ICON_MeshSave ICON_WriteEEPROM #define ICON_MeshViewer ICON_HotendTemp #define ICON_MoveZ0 ICON_HotendTemp #define ICON_Park ICON_Motion +#define ICON_ParkPos ICON_AdvSet +#define ICON_ParkPosX ICON_StepX +#define ICON_ParkPosY ICON_StepY +#define ICON_ParkPosZ ICON_StepZ +#define ICON_PhySet ICON_PrintSize #define ICON_PIDbed ICON_SetBedTemp #define ICON_PIDcycles ICON_ResumeEEPROM #define ICON_PIDValue ICON_Contact #define ICON_PrintStats ICON_PrintTime #define ICON_PrintStatsReset ICON_RemainTime #define ICON_ProbeDeploy ICON_SetEndTemp +#define ICON_ProbeMargin ICON_PrintSize +#define ICON_ProbeOffsetX ICON_StepX +#define ICON_ProbeOffsetY ICON_StepY +#define ICON_ProbeOffsetZ ICON_StepZ #define ICON_ProbeSet ICON_SetEndTemp #define ICON_ProbeStow ICON_SetEndTemp #define ICON_ProbeTest ICON_SetEndTemp +#define ICON_ProbeZSpeed ICON_MaxSpeedZ #define ICON_Pwrlossr ICON_Motion #define ICON_Reboot ICON_ResumeEEPROM #define ICON_Runout ICON_MaxAccE #define ICON_Scolor ICON_MaxSpeed +#define ICON_SetBaudRate ICON_Setspeed #define ICON_SetCustomPreheat ICON_SetEndTemp #define ICON_Sound ICON_Cool #define ICON_CaseLight ICON_Motion @@ -247,6 +275,13 @@ namespace DWINUI { DWIN_ICON_Show(ICON, icon, x, y); } + // Draw an Icon from the library ICON with its background + // icon: Icon ID + // x/y: Upper-left point + inline void Draw_IconWB(uint8_t icon, uint16_t x, uint16_t y) { + DWIN_ICON_Show(true, false, false, ICON, icon, x, y); + } + // Draw a positive integer // bShow: true=display background color; false=don't display background color // zeroFill: true=zero fill; false=no zero fill diff --git a/Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp similarity index 93% rename from Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp rename to Marlin/src/lcd/e3v2/proui/endstop_diag.cpp index 0f982c3a36c5..6232c89534b3 100644 --- a/Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp @@ -22,9 +22,11 @@ /** * DWIN End Stops diagnostic page - * Author: Miguel A. Risco-Castillo - * Version: 1.0 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 1.0.2 * Date: 2021/11/06 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" @@ -106,4 +108,4 @@ void ESDiagClass::Update() { DWIN_UpdateLCD(); } -#endif // DWIN_CREALITY_LCD_ENHANCED && HAS_MESH +#endif // DWIN_CREALITY_LCD_ENHANCED && HAS_ESDIAG diff --git a/Marlin/src/lcd/e3v2/enhanced/endstop_diag.h b/Marlin/src/lcd/e3v2/proui/endstop_diag.h similarity index 90% rename from Marlin/src/lcd/e3v2/enhanced/endstop_diag.h rename to Marlin/src/lcd/e3v2/proui/endstop_diag.h index 1864b9572386..4694ddb14172 100644 --- a/Marlin/src/lcd/e3v2/enhanced/endstop_diag.h +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.h @@ -23,9 +23,11 @@ /** * DWIN End Stops diagnostic page - * Author: Miguel A. Risco-Castillo + * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 1.0 * Date: 2021/11/06 + * + * Based on the original code provided by Creality under GPL */ class ESDiagClass { diff --git a/Marlin/src/lcd/e3v2/enhanced/lockscreen.cpp b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp similarity index 95% rename from Marlin/src/lcd/e3v2/enhanced/lockscreen.cpp rename to Marlin/src/lcd/e3v2/proui/lockscreen.cpp index 8dc84dcc46c1..3f8339ad48bc 100644 --- a/Marlin/src/lcd/e3v2/enhanced/lockscreen.cpp +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp @@ -22,9 +22,11 @@ /** * Lock screen implementation for DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo + * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 2.1 * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/lockscreen.h b/Marlin/src/lcd/e3v2/proui/lockscreen.h similarity index 92% rename from Marlin/src/lcd/e3v2/enhanced/lockscreen.h rename to Marlin/src/lcd/e3v2/proui/lockscreen.h index a51c82f34e5c..bf2fdb3f4b0b 100644 --- a/Marlin/src/lcd/e3v2/enhanced/lockscreen.h +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.h @@ -23,9 +23,11 @@ /** * Lock screen implementation for DWIN UI Enhanced implementation - * Author: Miguel A. Risco-Castillo + * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 2.1 * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../common/encoder.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp similarity index 94% rename from Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp rename to Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 1ecbbff0aa4c..0f63f77b9930 100644 --- a/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -22,9 +22,11 @@ /** * DWIN Mesh Viewer - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 - * Date: 2021/11/06 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.9.1 + * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" @@ -56,7 +58,7 @@ void MeshViewerClass::Draw() { #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) GRID_LOOP(x, y) { - const float v = Z_VALUES(x,y) * 100; + const float v = isnan(Z_VALUES(x,y)) ? 0 : round(Z_VALUES(x,y) * 100); zmesh[x][y] = v; NOLESS(maxz, v); NOMORE(minz, v); diff --git a/Marlin/src/lcd/e3v2/enhanced/meshviewer.h b/Marlin/src/lcd/e3v2/proui/meshviewer.h similarity index 87% rename from Marlin/src/lcd/e3v2/enhanced/meshviewer.h rename to Marlin/src/lcd/e3v2/proui/meshviewer.h index 6e7fe6fd827c..acd5f0d5c465 100644 --- a/Marlin/src/lcd/e3v2/enhanced/meshviewer.h +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.h @@ -23,9 +23,11 @@ /** * DWIN Mesh Viewer - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 - * Date: 2021/11/06 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 3.9.1 + * Date: 2021/11/09 + * + * Based on the original code provided by Creality under GPL */ class MeshViewerClass { diff --git a/Marlin/src/lcd/e3v2/enhanced/printstats.cpp b/Marlin/src/lcd/e3v2/proui/printstats.cpp similarity index 94% rename from Marlin/src/lcd/e3v2/enhanced/printstats.cpp rename to Marlin/src/lcd/e3v2/proui/printstats.cpp index a32d698b961a..ec14ebb8bf6e 100644 --- a/Marlin/src/lcd/e3v2/enhanced/printstats.cpp +++ b/Marlin/src/lcd/e3v2/proui/printstats.cpp @@ -22,9 +22,11 @@ /** * DWIN Print Stats page - * Author: Miguel A. Risco-Castillo - * Version: 1.0 - * Date: 2021/11/21 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 1.1 + * Date: 2022/01/09 + * + * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/printstats.h b/Marlin/src/lcd/e3v2/proui/printstats.h similarity index 87% rename from Marlin/src/lcd/e3v2/enhanced/printstats.h rename to Marlin/src/lcd/e3v2/proui/printstats.h index 5f62a4c2688c..f17e4dc9dd60 100644 --- a/Marlin/src/lcd/e3v2/enhanced/printstats.h +++ b/Marlin/src/lcd/e3v2/proui/printstats.h @@ -23,9 +23,11 @@ /** * DWIN Print Stats page - * Author: Miguel A. Risco-Castillo - * Version: 1.0 - * Date: 2021/11/21 + * Author: Miguel A. Risco-Castillo (MRISCOC) + * Version: 1.1 + * Date: 2022/01/09 + * + * Based on the original code provided by Creality under GPL */ class PrintStatsClass { diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index fcd9357ef7a0..d0cc2a25b8a3 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -49,7 +49,7 @@ MarlinUI ui; #include "e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) #include "fontutils.h" - #include "e3v2/enhanced/dwin.h" + #include "e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "e3v2/jyersui/dwin.h" #endif @@ -104,7 +104,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif #if HAS_LCD_BRIGHTNESS - uint8_t MarlinUI::brightness = DEFAULT_LCD_BRIGHTNESS; + uint8_t MarlinUI::brightness = LCD_BRIGHTNESS_DEFAULT; bool MarlinUI::backlight = true; void MarlinUI::set_brightness(const uint8_t value) { diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index e08cf27dc5ee..17c246873788 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -58,7 +58,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "e3v2/enhanced/dwin.h" + #include "e3v2/proui/dwin.h" #endif #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U) @@ -265,8 +265,8 @@ class MarlinUI { #ifndef LCD_BRIGHTNESS_MAX #define LCD_BRIGHTNESS_MAX 255 #endif - #ifndef DEFAULT_LCD_BRIGHTNESS - #define DEFAULT_LCD_BRIGHTNESS LCD_BRIGHTNESS_MAX + #ifndef LCD_BRIGHTNESS_DEFAULT + #define LCD_BRIGHTNESS_DEFAULT LCD_BRIGHTNESS_MAX #endif static uint8_t brightness; static bool backlight; diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index cc3851597bdf..fdd6897192a2 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -80,7 +80,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index db9fc7eb2f65..bcbe8fa985ee 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -75,7 +75,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "../lcd/e3v2/jyersui/dwin.h" #endif @@ -3038,7 +3038,7 @@ void MarlinSettings::reset() { // // LCD Brightness // - TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = DEFAULT_LCD_BRIGHTNESS); + TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = LCD_BRIGHTNESS_DEFAULT); // // Controller Fan diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 34ea7c2f3a58..4ccd984b0d36 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -52,7 +52,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(EXTENSIBLE_UI) diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index 59fdc4a3c914..ac11bd8b38b8 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -157,7 +157,7 @@ #if defined(TFT_BACKLIGHT_PWM) && !defined(MAPLE_STM32F1) #define HAS_LCD_BRIGHTNESS 1 - #define DEFAULT_LCD_BRIGHTNESS TFT_BACKLIGHT_PWM + #define LCD_BRIGHTNESS_DEFAULT TFT_BACKLIGHT_PWM #endif #if ENABLED(SDIO_SUPPORT) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 8c1d08a4605d..996677341894 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -34,7 +34,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/e3v2/creality/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) - #include "../lcd/e3v2/enhanced/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" #endif #include "../module/planner.h" // for synchronize diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index 27fc26f0a09c..257616ddd172 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -15,7 +15,7 @@ exec_test $1 $2 "Ender 3 v2 with CrealityUI" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_disable DWIN_CREALITY_LCD -opt_enable DWIN_CREALITY_LCD_ENHANCED BLTOUCH AUTO_BED_LEVELING_UBL Z_SAFE_HOMING +opt_enable DWIN_CREALITY_LCD_ENHANCED BLTOUCH AUTO_BED_LEVELING_UBL Z_SAFE_HOMING INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING BAUD_RATE_GCODE exec_test $1 $2 "Ender 3 v2 with Enhanced UI" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" diff --git a/ini/features.ini b/ini/features.ini index c1ff3ef294fd..7f9fd1c338d3 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -46,7 +46,7 @@ SOFT_I2C_EEPROM = SlowSoftI2CMaster, SlowSoftWire=https:/ SPI_EEPROM = src_filter=+ HAS_DWIN_E3V2|IS_DWIN_MARLINUI = src_filter=+ DWIN_CREALITY_LCD = src_filter=+ -DWIN_CREALITY_LCD_ENHANCED = src_filter=+ +DWIN_CREALITY_LCD_ENHANCED = src_filter=+ DWIN_CREALITY_LCD_JYERSUI = src_filter=+ IS_DWIN_MARLINUI = src_filter=+ HAS_GRAPHICAL_TFT = src_filter=+ diff --git a/platformio.ini b/platformio.ini index 43c7e2be6bf4..3a02b5ab185b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -52,7 +52,7 @@ lib_deps = default_src_filter = + - - + - - - - - - - - - - - - - + - - - - - - - - - - - From 428b67db316ceb11e41152270a97844c897feb39 Mon Sep 17 00:00:00 2001 From: John Robertson Date: Fri, 11 Feb 2022 21:04:47 +0000 Subject: [PATCH 119/502] =?UTF-8?q?=E2=9C=A8=20More=20Nozzle=20Park=20move?= =?UTF-8?q?=20options=20(#23158)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 3 +-- Marlin/src/inc/SanityCheck.h | 4 ++++ Marlin/src/libs/nozzle.cpp | 17 ++++++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d3c36ad4850d..752fd1370a8b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1913,8 +1913,7 @@ #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z_raise } #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } - //#define NOZZLE_PARK_X_ONLY // X move only is required to park - //#define NOZZLE_PARK_Y_ONLY // Y move only is required to park + #define NOZZLE_PARK_MOVE 0 // Park motion: 0 = XY Move, 1 = X Only, 2 = Y Only, 3 = X before Y, 4 = Y before X #define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 38c2866ca1f3..8f6843eee989 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -609,6 +609,10 @@ #error "LCD_SCREEN_ROT_270 is now LCD_SCREEN_ROTATE with a value of 270." #elif defined(DEFAULT_LCD_BRIGHTNESS) #error "DEFAULT_LCD_BRIGHTNESS is now LCD_BRIGHTNESS_DEFAULT." +#elif defined(NOZZLE_PARK_X_ONLY) + #error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 1." +#elif defined(NOZZLE_PARK_Y_ONLY) + #error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 2." #endif constexpr float arm[] = AXIS_RELATIVE_MODES; diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index e277216ab4e5..5cd2014d7f86 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -254,11 +254,18 @@ Nozzle nozzle; break; } - do_blocking_move_to_xy( - TERN(NOZZLE_PARK_Y_ONLY, current_position, park).x, - TERN(NOZZLE_PARK_X_ONLY, current_position, park).y, - fr_xy - ); + #ifndef NOZZLE_PARK_MOVE + #define NOZZLE_PARK_MOVE 0 + #endif + switch (NOZZLE_PARK_MOVE) { + case 0: do_blocking_move_to_xy(park, fr_xy); break; + case 1: do_blocking_move_to_x(park.x, fr_xy); break; + case 2: do_blocking_move_to_y(park.y, fr_xy); break; + case 3: do_blocking_move_to_x(park.x, fr_xy); + do_blocking_move_to_y(park.y, fr_xy); break; + case 4: do_blocking_move_to_y(park.y, fr_xy); + do_blocking_move_to_x(park.x, fr_xy); break; + } report_current_position(); } From 56cec9690a3717ce9ed2803b7c8f6486d532eae9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 17 Feb 2022 18:50:31 -0600 Subject: [PATCH 120/502] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20HAL=20a?= =?UTF-8?q?s=20singleton=20(#23357,=20#23871,=20#23897)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/HAL.cpp | 40 ++--- Marlin/src/HAL/AVR/HAL.h | 184 +++++++++++-------- Marlin/src/HAL/AVR/MarlinSerial.cpp | 4 +- Marlin/src/HAL/AVR/MarlinSerial.h | 6 +- Marlin/src/HAL/AVR/fast_pwm.cpp | 6 +- Marlin/src/HAL/AVR/math.h | 4 +- Marlin/src/HAL/AVR/timers.h | 6 +- Marlin/src/HAL/DUE/HAL.cpp | 43 +---- Marlin/src/HAL/DUE/HAL.h | 135 +++++++++----- Marlin/src/HAL/DUE/MarlinSerial.cpp | 4 +- Marlin/src/HAL/DUE/Tone.cpp | 2 +- Marlin/src/HAL/DUE/timers.h | 2 +- Marlin/src/HAL/ESP32/HAL.cpp | 35 ++-- Marlin/src/HAL/ESP32/HAL.h | 144 +++++++++------ Marlin/src/HAL/ESP32/Tone.cpp | 2 +- Marlin/src/HAL/ESP32/timers.cpp | 2 +- Marlin/src/HAL/ESP32/timers.h | 6 +- Marlin/src/HAL/LINUX/HAL.cpp | 37 ++-- Marlin/src/HAL/LINUX/HAL.h | 143 ++++++++++----- Marlin/src/HAL/LINUX/arduino.cpp | 4 +- Marlin/src/HAL/LINUX/include/Arduino.h | 7 +- Marlin/src/HAL/LINUX/timers.h | 4 +- Marlin/src/HAL/LPC1768/HAL.cpp | 42 +++-- Marlin/src/HAL/LPC1768/HAL.h | 157 ++++++++++------ Marlin/src/HAL/LPC1768/Servo.h | 3 +- Marlin/src/HAL/LPC1768/fast_pwm.cpp | 6 +- Marlin/src/HAL/LPC1768/main.cpp | 6 +- Marlin/src/HAL/LPC1768/timers.h | 2 +- Marlin/src/HAL/NATIVE_SIM/HAL.h | 173 +++++++++++------- Marlin/src/HAL/NATIVE_SIM/timers.h | 4 +- Marlin/src/HAL/SAMD51/HAL.cpp | 229 +++++++++++++++++++----- Marlin/src/HAL/SAMD51/HAL.h | 129 ++++++++----- Marlin/src/HAL/STM32/HAL.cpp | 28 ++- Marlin/src/HAL/STM32/HAL.h | 176 ++++++++++-------- Marlin/src/HAL/STM32/HAL_SPI.cpp | 8 +- Marlin/src/HAL/STM32/eeprom_flash.cpp | 8 +- Marlin/src/HAL/STM32/fast_pwm.cpp | 4 +- Marlin/src/HAL/STM32/pinsDebug.h | 6 +- Marlin/src/HAL/STM32/timers.h | 4 +- Marlin/src/HAL/STM32F1/HAL.cpp | 185 +++++++++---------- Marlin/src/HAL/STM32F1/HAL.h | 180 ++++++++++--------- Marlin/src/HAL/STM32F1/SPI.cpp | 8 + Marlin/src/HAL/STM32F1/SPI.h | 8 - Marlin/src/HAL/STM32F1/Servo.h | 3 +- Marlin/src/HAL/STM32F1/fast_pwm.cpp | 8 +- Marlin/src/HAL/STM32F1/timers.h | 2 +- Marlin/src/HAL/TEENSY31_32/HAL.cpp | 79 ++++---- Marlin/src/HAL/TEENSY31_32/HAL.h | 130 ++++++++++---- Marlin/src/HAL/TEENSY31_32/timers.h | 2 +- Marlin/src/HAL/TEENSY35_36/HAL.cpp | 110 ++++++------ Marlin/src/HAL/TEENSY35_36/HAL.h | 132 ++++++++++---- Marlin/src/HAL/TEENSY35_36/timers.h | 2 +- Marlin/src/HAL/TEENSY40_41/HAL.cpp | 194 ++++++++++---------- Marlin/src/HAL/TEENSY40_41/HAL.h | 147 ++++++++++----- Marlin/src/HAL/TEENSY40_41/timers.h | 2 +- Marlin/src/HAL/shared/HAL.cpp | 36 ++++ Marlin/src/HAL/shared/HAL_spi_L6470.cpp | 8 +- Marlin/src/HAL/shared/math_32bit.h | 2 +- Marlin/src/MarlinCore.cpp | 48 +++-- Marlin/src/feature/caselight.cpp | 2 +- Marlin/src/feature/controllerfan.cpp | 2 +- Marlin/src/feature/e_parser.h | 4 +- Marlin/src/feature/leds/leds.cpp | 10 +- Marlin/src/feature/spindle_laser.cpp | 8 +- Marlin/src/feature/spindle_laser.h | 2 +- Marlin/src/gcode/control/M42.cpp | 4 +- Marlin/src/gcode/gcode_d.cpp | 10 +- Marlin/src/inc/MarlinConfig.h | 1 + Marlin/src/inc/SanityCheck.h | 7 + Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 4 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 2 +- Marlin/src/module/endstops.cpp | 2 +- Marlin/src/module/planner.cpp | 8 +- Marlin/src/module/servo.cpp | 2 +- Marlin/src/module/servo.h | 2 +- Marlin/src/module/stepper.cpp | 26 +-- Marlin/src/module/temperature.cpp | 155 ++++++---------- ini/features.ini | 2 +- ini/native.ini | 4 +- ini/stm32-common.ini | 1 + ini/stm32g0.ini | 1 - 81 files changed, 1954 insertions(+), 1396 deletions(-) create mode 100644 Marlin/src/HAL/shared/HAL.cpp diff --git a/Marlin/src/HAL/AVR/HAL.cpp b/Marlin/src/HAL/AVR/HAL.cpp index 666802725bc0..7c39c5200b4d 100644 --- a/Marlin/src/HAL/AVR/HAL.cpp +++ b/Marlin/src/HAL/AVR/HAL.cpp @@ -36,7 +36,7 @@ // ------------------------ // Don't initialize/override variable (which would happen in .init4) -uint8_t reset_reason __attribute__((section(".noinit"))); +uint8_t MarlinHAL::reset_reason __attribute__((section(".noinit"))); // ------------------------ // Public functions @@ -45,22 +45,22 @@ uint8_t reset_reason __attribute__((section(".noinit"))); __attribute__((naked)) // Don't output function pro- and epilogue __attribute__((used)) // Output the function, even if "not used" __attribute__((section(".init3"))) // Put in an early user definable section -void HAL_save_reset_reason() { +void save_reset_reason() { #if ENABLED(OPTIBOOT_RESET_REASON) __asm__ __volatile__( A("STS %0, r2") - : "=m"(reset_reason) + : "=m"(hal.reset_reason) ); #else - reset_reason = MCUSR; + hal.reset_reason = MCUSR; #endif // Clear within 16ms since WDRF bit enables a 16ms watchdog timer -> Boot loop - MCUSR = 0; + hal.clear_reset_source(); wdt_disable(); } -void HAL_init() { +void MarlinHAL::init() { // Init Servo Pins #define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW) #if HAS_SERVO_0 @@ -79,7 +79,7 @@ void HAL_init() { init_pwm_timers(); // Init user timers to default frequency - 1000HZ } -void HAL_reboot() { +void MarlinHAL::reboot() { #if ENABLED(USE_WATCHDOG) while (1) { /* run out the watchdog */ } #else @@ -95,20 +95,20 @@ void HAL_reboot() { #else // !SDSUPPORT -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; - - int freeMemory() { - int free_memory; - if ((int)__brkval == 0) - free_memory = ((int)&free_memory) - ((int)&__bss_end); - else - free_memory = ((int)&free_memory) - ((int)__brkval); - return free_memory; + extern "C" { + extern char __bss_end; + extern char __heap_start; + extern void* __brkval; + + int freeMemory() { + int free_memory; + if ((int)__brkval == 0) + free_memory = ((int)&free_memory) - ((int)&__bss_end); + else + free_memory = ((int)&free_memory) - ((int)__brkval); + return free_memory; + } } -} #endif // !SDSUPPORT diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index f5cbcc9d51e1..e825b4def3af 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -74,9 +74,9 @@ #define CRITICAL_SECTION_START() unsigned char _sreg = SREG; cli() #define CRITICAL_SECTION_END() SREG = _sreg #endif -#define ISRS_ENABLED() TEST(SREG, SREG_I) -#define ENABLE_ISRS() sei() -#define DISABLE_ISRS() cli() + +#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment +#define PWM_FREQUENCY 1000 // Default PWM frequency when set_pwm_duty() is called without set_pwm_frequency() // ------------------------ // Types @@ -84,16 +84,15 @@ typedef int8_t pin_t; -#define SHARED_SERVOS HAS_SERVOS -#define HAL_SERVO_LIB Servo +#define SHARED_SERVOS HAS_SERVOS // Use shared/servos.cpp + +class Servo; +typedef Servo hal_servo_t; // ------------------------ -// Public Variables +// Serial ports // ------------------------ -extern uint8_t reset_reason; - -// Serial ports #ifdef USBCON #include "../../core/serial_hook.h" typedef ForwardSerial1Class< decltype(Serial) > DefaultSerial1; @@ -142,20 +141,31 @@ extern uint8_t reset_reason; #endif #endif -// ------------------------ -// Public functions -// ------------------------ +// +// ADC +// +#define HAL_ADC_VREF 5.0 +#define HAL_ADC_RESOLUTION 10 -void HAL_init(); +// +// Pin Mapping for M42, M43, M226 +// +#define GET_PIN_MAP_PIN(index) index +#define GET_PIN_MAP_INDEX(pin) pin +#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) -//void cli(); +#define HAL_SENSITIVE_PINS 0, 1, -//void _delay_ms(const int delay); +#ifdef __AVR_AT90USB1286__ + #define JTAG_DISABLE() do{ MCUCR = 0x80; MCUCR = 0x80; }while(0) +#endif -inline void HAL_clear_reset_source() { } -inline uint8_t HAL_get_reset_source() { return reset_reason; } +// AVR compatibility +#define strtof strtod -void HAL_reboot(); +// ------------------------ +// Class Utilities +// ------------------------ #pragma GCC diagnostic push #if GCC_VERSION <= 50000 @@ -166,70 +176,96 @@ extern "C" int freeMemory(); #pragma GCC diagnostic pop -// ADC -#ifdef DIDR2 - #define HAL_ANALOG_SELECT(ind) do{ if (ind < 8) SBI(DIDR0, ind); else SBI(DIDR2, ind & 0x07); }while(0) -#else - #define HAL_ANALOG_SELECT(ind) SBI(DIDR0, ind); -#endif +// ------------------------ +// MarlinHAL Class +// ------------------------ -inline void HAL_adc_init() { - ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07; - DIDR0 = 0; - #ifdef DIDR2 - DIDR2 = 0; - #endif -} +class MarlinHAL { +public: -#define SET_ADMUX_ADCSRA(ch) ADMUX = _BV(REFS0) | (ch & 0x07); SBI(ADCSRA, ADSC) -#ifdef MUX5 - #define HAL_START_ADC(ch) if (ch > 7) ADCSRB = _BV(MUX5); else ADCSRB = 0; SET_ADMUX_ADCSRA(ch) -#else - #define HAL_START_ADC(ch) ADCSRB = 0; SET_ADMUX_ADCSRA(ch) -#endif + // Earliest possible init, before setup() + MarlinHAL() {} -#define HAL_ADC_VREF 5.0 -#define HAL_ADC_RESOLUTION 10 -#define HAL_READ_ADC() ADC -#define HAL_ADC_READY() !TEST(ADCSRA, ADSC) + static void init(); // Called early in setup() + static void init_board() {} // Called less early in setup() + static void reboot(); // Restart the firmware from 0x0 -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) + // Interrupts + static bool isr_state() { return TEST(SREG, SREG_I); } + static void isr_on() { sei(); } + static void isr_off() { cli(); } -#define HAL_SENSITIVE_PINS 0, 1, + static void delay_ms(const int ms) { _delay_ms(ms); } -#ifdef __AVR_AT90USB1286__ - #define JTAG_DISABLE() do{ MCUCR = 0x80; MCUCR = 0x80; }while(0) -#endif + // Tasks, called from idle() + static void idletask() {} -// AVR compatibility -#define strtof strtod + // Reset + static uint8_t reset_reason; + static uint8_t get_reset_source() { return reset_reason; } + static void clear_reset_source() { MCUSR = 0; } -#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment -#define PWM_FREQUENCY 1000 // Default PWM frequency when set_pwm_duty() is called without set_pwm_frequency() + // Free SRAM + static int freeMemory() { return ::freeMemory(); } -/** - * set_pwm_frequency - * Sets the frequency of the timer corresponding to the provided pin - * as close as possible to the provided desired frequency. Internally - * calculates the required waveform generation mode, prescaler and - * resolution values required and sets the timer registers accordingly. - * NOTE that the frequency is applied to all pins on the timer (Ex OC3A, OC3B and OC3B) - * NOTE that there are limitations, particularly if using TIMER2. (see Configuration_adv.h -> FAST FAN PWM Settings) - */ -void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); + // + // ADC Methods + // -/** - * set_pwm_duty - * Set the PWM duty cycle of the provided pin to the provided value - * Optionally allows inverting the duty cycle [default = false] - * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255] - */ -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); + // Called by Temperature::init once at startup + static void adc_init() { + ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07; + DIDR0 = 0; + #ifdef DIDR2 + DIDR2 = 0; + #endif + } -/* - * init_pwm_timers - * sets the default frequency for timers 2-5 to 1000HZ - */ -void init_pwm_timers(); + // Called by Temperature::init for each sensor at startup + static void adc_enable(const uint8_t ch) { + #ifdef DIDR2 + if (ch > 7) { SBI(DIDR2, ch & 0x07); return; } + #endif + SBI(DIDR0, ch); + } + + // Begin ADC sampling on the given channel + static void adc_start(const uint8_t ch) { + #ifdef MUX5 + ADCSRB = ch > 7 ? _BV(MUX5) : 0; + #else + ADCSRB = 0; + #endif + ADMUX = _BV(REFS0) | (ch & 0x07); + SBI(ADCSRA, ADSC); + } + + // Is the ADC ready for reading? + static bool adc_ready() { return !TEST(ADCSRA, ADSC); } + + // The current value of the ADC register + static __typeof__(ADC) adc_value() { return ADC; } + + /** + * init_pwm_timers + * Set the default frequency for timers 2-5 to 1000HZ + */ + static void init_pwm_timers(); + + /** + * Set the PWM duty cycle for the pin to the given value. + * Optionally invert the duty cycle [default = false] + * Optionally change the scale of the provided value to enable finer PWM duty control [default = 255] + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); + + /** + * Set the frequency of the timer for the given pin as close as + * possible to the provided desired frequency. Internally calculate + * the required waveform generation mode, prescaler, and resolution + * values and set timer registers accordingly. + * NOTE that the frequency is applied to all pins on the timer (Ex OC3A, OC3B and OC3B) + * NOTE that there are limitations, particularly if using TIMER2. (see Configuration_adv.h -> FAST_PWM_FAN Settings) + */ + static void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); +}; diff --git a/Marlin/src/HAL/AVR/MarlinSerial.cpp b/Marlin/src/HAL/AVR/MarlinSerial.cpp index cd8bf5e6903b..986462437c8f 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.cpp +++ b/Marlin/src/HAL/AVR/MarlinSerial.cpp @@ -486,7 +486,7 @@ void MarlinSerial::write(const uint8_t c) { const uint8_t i = (tx_buffer.head + 1) & (Cfg::TX_SIZE - 1); // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { + if (!hal.isr_state()) { // Make room by polling if it is possible to transmit, and do so! while (i == tx_buffer.tail) { @@ -534,7 +534,7 @@ void MarlinSerial::flushTX() { if (!_written) return; // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { + if (!hal.isr_state()) { // Wait until everything was transmitted - We must do polling, as interrupts are disabled while (tx_buffer.head != tx_buffer.tail || !B_TXC) { diff --git a/Marlin/src/HAL/AVR/MarlinSerial.h b/Marlin/src/HAL/AVR/MarlinSerial.h index 84c5ddd2978e..7eb76000d66e 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.h +++ b/Marlin/src/HAL/AVR/MarlinSerial.h @@ -191,13 +191,13 @@ rx_framing_errors; static ring_buffer_pos_t rx_max_enqueued; - static FORCE_INLINE ring_buffer_pos_t atomic_read_rx_head(); + FORCE_INLINE static ring_buffer_pos_t atomic_read_rx_head(); static volatile bool rx_tail_value_not_stable; static volatile uint16_t rx_tail_value_backup; - static FORCE_INLINE void atomic_set_rx_tail(ring_buffer_pos_t value); - static FORCE_INLINE ring_buffer_pos_t atomic_read_rx_tail(); + FORCE_INLINE static void atomic_set_rx_tail(ring_buffer_pos_t value); + FORCE_INLINE static ring_buffer_pos_t atomic_read_rx_tail(); public: FORCE_INLINE static void store_rxd_char(); diff --git a/Marlin/src/HAL/AVR/fast_pwm.cpp b/Marlin/src/HAL/AVR/fast_pwm.cpp index f8201d028ebd..0a384172c32a 100644 --- a/Marlin/src/HAL/AVR/fast_pwm.cpp +++ b/Marlin/src/HAL/AVR/fast_pwm.cpp @@ -107,7 +107,7 @@ const Timer get_pwm_timer(const pin_t pin) { return Timer(); } -void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { +void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { const Timer timer = get_pwm_timer(pin); if (timer.isProtected || !timer.isPWM) return; // Don't proceed if protected timer or not recognized @@ -176,7 +176,7 @@ void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { _SET_ICRn(timer, res); // Set ICRn value (TOP) = res } -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { +void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { // If v is 0 or v_size (max), digitalWrite to LOW or HIGH. // Note that digitalWrite also disables PWM output for us (sets COM bit to 0) if (v == 0) @@ -201,7 +201,7 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 } } -void init_pwm_timers() { +void MarlinHAL::init_pwm_timers() { // Init some timer frequencies to a default 1KHz const pin_t pwm_pin[] = { #ifdef __AVR_ATmega2560__ diff --git a/Marlin/src/HAL/AVR/math.h b/Marlin/src/HAL/AVR/math.h index 7ede4accc09e..7dd1018ff199 100644 --- a/Marlin/src/HAL/AVR/math.h +++ b/Marlin/src/HAL/AVR/math.h @@ -35,7 +35,7 @@ // C B A is longIn1 // D C B A is longIn2 // -static FORCE_INLINE uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2) { +FORCE_INLINE static uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2) { uint8_t tmp1; uint8_t tmp2; uint16_t intRes; @@ -89,7 +89,7 @@ static FORCE_INLINE uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2 // uses: // r26 to store 0 // r27 to store the byte 1 of the 24 bit result -static FORCE_INLINE uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) { +FORCE_INLINE static uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) { uint8_t tmp; uint16_t intRes; __asm__ __volatile__ ( diff --git a/Marlin/src/HAL/AVR/timers.h b/Marlin/src/HAL/AVR/timers.h index ba3c4acd29ea..33c3880b6b99 100644 --- a/Marlin/src/HAL/AVR/timers.h +++ b/Marlin/src/HAL/AVR/timers.h @@ -109,12 +109,12 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) { * (otherwise, characters will be lost due to UART overflow). * Then: Stepper, Endstops, Temperature, and -finally- all others. */ -#define HAL_timer_isr_prologue(T) -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_prologue(T) NOOP +#define HAL_timer_isr_epilogue(T) NOOP -/* 18 cycles maximum latency */ #ifndef HAL_STEP_TIMER_ISR +/* 18 cycles maximum latency */ #define HAL_STEP_TIMER_ISR() \ extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \ extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \ diff --git a/Marlin/src/HAL/DUE/HAL.cpp b/Marlin/src/HAL/DUE/HAL.cpp index a3985652e71d..bbd13dc05aac 100644 --- a/Marlin/src/HAL/DUE/HAL.cpp +++ b/Marlin/src/HAL/DUE/HAL.cpp @@ -34,7 +34,7 @@ // Public Variables // ------------------------ -uint16_t HAL_adc_result; +uint16_t MarlinHAL::adc_result; // ------------------------ // Public functions @@ -42,8 +42,7 @@ uint16_t HAL_adc_result; TERN_(POSTMORTEM_DEBUGGING, extern void install_min_serial()); -// HAL initialization task -void HAL_init() { +void MarlinHAL::init() { // Initialize the USB stack #if ENABLED(SDSUPPORT) OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up @@ -52,21 +51,15 @@ void HAL_init() { TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the min serial handler } -// HAL idle task -void HAL_idletask() { - // Perform USB stack housekeeping - usb_task_idle(); +void MarlinHAL::init_board() { + #ifdef BOARD_INIT + BOARD_INIT(); + #endif } -// Disable interrupts -void cli() { noInterrupts(); } - -// Enable interrupts -void sei() { interrupts(); } - -void HAL_clear_reset_source() { } +void MarlinHAL::idletask() { usb_task_idle(); } // Perform USB stack housekeeping -uint8_t HAL_get_reset_source() { +uint8_t MarlinHAL::get_reset_source() { switch ((RSTC->RSTC_SR >> 8) & 0x07) { case 0: return RST_POWER_ON; case 1: return RST_BACKUP; @@ -77,12 +70,7 @@ uint8_t HAL_get_reset_source() { } } -void HAL_reboot() { rstc_start_software_reset(RSTC); } - -void _delay_ms(const int delay_ms) { - // Todo: port for Due? - delay(delay_ms); -} +void MarlinHAL::reboot() { rstc_start_software_reset(RSTC); } extern "C" { extern unsigned int _ebss; // end of bss section @@ -94,19 +82,6 @@ int freeMemory() { return (int)&free_memory - (heap_end ?: (int)&_ebss); } -// ------------------------ -// ADC -// ------------------------ - -void HAL_adc_start_conversion(const uint8_t ch) { - HAL_adc_result = analogRead(ch); -} - -uint16_t HAL_adc_get_result() { - // nop - return HAL_adc_result; -} - // Forward the default serial ports #if USING_HW_SERIAL0 DefaultSerial1 MSerial0(false, Serial); diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index 96ab5d9808ac..9a02c9a0dcf5 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -38,6 +38,10 @@ #include "../../core/serial_hook.h" +// ------------------------ +// Serial ports +// ------------------------ + typedef ForwardSerial1Class< decltype(Serial) > DefaultSerial1; typedef ForwardSerial1Class< decltype(Serial1) > DefaultSerial2; typedef ForwardSerial1Class< decltype(Serial2) > DefaultSerial3; @@ -97,60 +101,38 @@ extern DefaultSerial4 MSerial3; #include "MarlinSerial.h" #include "MarlinSerialUSB.h" -// On AVR this is in math.h? -#define square(x) ((x)*(x)) +// ------------------------ +// Types +// ------------------------ typedef int8_t pin_t; -#define SHARED_SERVOS HAS_SERVOS -#define HAL_SERVO_LIB Servo +#define SHARED_SERVOS HAS_SERVOS // Use shared/servos.cpp + +class Servo; +typedef Servo hal_servo_t; // // Interrupts // -#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END() if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() - -void cli(); // Disable interrupts -void sei(); // Enable interrupts +#define sei() noInterrupts() +#define cli() interrupts() -void HAL_clear_reset_source(); // clear reset reason -uint8_t HAL_get_reset_source(); // get reset reason - -void HAL_reboot(); +#define CRITICAL_SECTION_START() const bool _irqon = hal.isr_state(); hal.isr_off() +#define CRITICAL_SECTION_END() if (_irqon) hal.isr_on() // // ADC // -extern uint16_t HAL_adc_result; // result of last ADC conversion +#define HAL_ADC_VREF 3.3 +#define HAL_ADC_RESOLUTION 10 #ifndef analogInputToDigitalPin #define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1) #endif -#define HAL_ANALOG_SELECT(ch) - -inline void HAL_adc_init() {}//todo - -#define HAL_ADC_VREF 3.3 -#define HAL_ADC_RESOLUTION 10 -#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch) -#define HAL_READ_ADC() HAL_adc_result -#define HAL_ADC_READY() true - -void HAL_adc_start_conversion(const uint8_t ch); -uint16_t HAL_adc_get_result(); - -// -// PWM // -inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); } - -// -// Pin Map +// Pin Mapping for M42, M43, M226 // #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin @@ -159,27 +141,18 @@ inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, // // Tone // -void toneInit(); void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0); void noTone(const pin_t _pin); -// Enable hooks into idle and setup for HAL -#define HAL_IDLETASK 1 -void HAL_idletask(); -void HAL_init(); - -// -// Utility functions -// -void _delay_ms(const int delay); +// ------------------------ +// Class Utilities +// ------------------------ #pragma GCC diagnostic push #if GCC_VERSION <= 50000 #pragma GCC diagnostic ignored "-Wunused-function" #endif -int freeMemory(); - #pragma GCC diagnostic pop #ifdef __cplusplus @@ -189,3 +162,69 @@ char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s #ifdef __cplusplus } #endif + +// Return free RAM between end of heap (or end bss) and whatever is current +int freeMemory(); + +// ------------------------ +// MarlinHAL Class +// ------------------------ + +class MarlinHAL { +public: + + // Earliest possible init, before setup() + MarlinHAL() {} + + static void init(); // Called early in setup() + static void init_board(); // Called less early in setup() + static void reboot(); // Software reset + + // Interrupts + static bool isr_state() { return !__get_PRIMASK(); } + static void isr_on() { __enable_irq(); } + static void isr_off() { __disable_irq(); } + + static void delay_ms(const int ms) { delay(ms); } + + // Tasks, called from idle() + static void idletask(); + + // Reset + static uint8_t get_reset_source(); + static void clear_reset_source() {} + + // Free SRAM + static int freeMemory() { return ::freeMemory(); } + + // + // ADC Methods + // + + static uint16_t adc_result; + + // Called by Temperature::init once at startup + static void adc_init() {} + + // Called by Temperature::init for each sensor at startup + static void adc_enable(const uint8_t ch) {} + + // Begin ADC sampling on the given channel + static void adc_start(const uint8_t ch) { adc_result = analogRead(ch); } + + // Is the ADC ready for reading? + static bool adc_ready() { return true; } + + // The current value of the ADC register + static uint16_t adc_value() { return adc_result; } + + /** + * Set the PWM duty cycle for the pin to the given value. + * No inverting the duty cycle in this HAL. + * No changing the maximum size of the provided value to enable finer PWM duty control in this HAL. + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { + analogWrite(pin, v); + } + +}; diff --git a/Marlin/src/HAL/DUE/MarlinSerial.cpp b/Marlin/src/HAL/DUE/MarlinSerial.cpp index fe62ff5607d5..638f7a100722 100644 --- a/Marlin/src/HAL/DUE/MarlinSerial.cpp +++ b/Marlin/src/HAL/DUE/MarlinSerial.cpp @@ -406,7 +406,7 @@ size_t MarlinSerial::write(const uint8_t c) { const uint8_t i = (tx_buffer.head + 1) & (Cfg::TX_SIZE - 1); // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { + if (!hal.isr_state()) { // Make room by polling if it is possible to transmit, and do so! while (i == tx_buffer.tail) { @@ -454,7 +454,7 @@ void MarlinSerial::flushTX() { if (!_written) return; // If global interrupts are disabled (as the result of being called from an ISR)... - if (!ISRS_ENABLED()) { + if (!hal.isr_state()) { // Wait until everything was transmitted - We must do polling, as interrupts are disabled while (tx_buffer.head != tx_buffer.tail || !(HWUART->UART_SR & UART_SR_TXEMPTY)) { diff --git a/Marlin/src/HAL/DUE/Tone.cpp b/Marlin/src/HAL/DUE/Tone.cpp index 1ac81faaf0e1..4bc8142aba27 100644 --- a/Marlin/src/HAL/DUE/Tone.cpp +++ b/Marlin/src/HAL/DUE/Tone.cpp @@ -35,7 +35,7 @@ static pin_t tone_pin; volatile static int32_t toggles; -void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration) { +void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration/*=0*/) { tone_pin = _pin; toggles = 2 * frequency * duration / 1000; HAL_timer_start(MF_TIMER_TONE, 2 * frequency); diff --git a/Marlin/src/HAL/DUE/timers.h b/Marlin/src/HAL/DUE/timers.h index e2932ff36f91..bcfd07e268c5 100644 --- a/Marlin/src/HAL/DUE/timers.h +++ b/Marlin/src/HAL/DUE/timers.h @@ -125,4 +125,4 @@ FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) { pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_SR; } -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_epilogue(T) NOOP diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index 499582b8c194..adf5cecabe41 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -52,7 +52,7 @@ // Externs // ------------------------ -portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED; +portMUX_TYPE MarlinHAL::spinlock = portMUX_INITIALIZER_UNLOCKED; // ------------------------ // Local defines @@ -64,7 +64,7 @@ portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED; // Public Variables // ------------------------ -uint16_t HAL_adc_result; +uint16_t MarlinHAL::adc_result; // ------------------------ // Private Variables @@ -95,20 +95,22 @@ volatile int numPWMUsed = 0, #endif #if ENABLED(USE_ESP32_EXIO) + HardwareSerial YSerial2(2); void Write_EXIO(uint8_t IO, uint8_t v) { - if (ISRS_ENABLED()) { - DISABLE_ISRS(); + if (hal.isr_state()) { + hal.isr_off(); YSerial2.write(0x80 | (((char)v) << 5) | (IO - 100)); - ENABLE_ISRS(); + hal.isr_on(); } else YSerial2.write(0x80 | (((char)v) << 5) | (IO - 100)); } + #endif -void HAL_init_board() { +void MarlinHAL::init_board() { #if ENABLED(USE_ESP32_TASK_WDT) esp_task_wdt_init(10, true); #endif @@ -154,27 +156,24 @@ void HAL_init_board() { #endif } -void HAL_idletask() { +void MarlinHAL::idletask() { #if BOTH(WIFISUPPORT, OTASUPPORT) OTA_handle(); #endif TERN_(ESP3D_WIFISUPPORT, esp3dlib.idletask()); } -void HAL_clear_reset_source() { } - -uint8_t HAL_get_reset_source() { return rtc_get_reset_reason(1); } +uint8_t MarlinHAL::get_reset_source() { return rtc_get_reset_reason(1); } -void HAL_reboot() { ESP.restart(); } - -void _delay_ms(int delay_ms) { delay(delay_ms); } +void MarlinHAL::reboot() { ESP.restart(); } // return free memory between end of heap (or end bss) and whatever is current -int freeMemory() { return ESP.getFreeHeap(); } +int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); } // ------------------------ // ADC // ------------------------ + #define ADC1_CHANNEL(pin) ADC1_GPIO ## pin ## _CHANNEL adc1_channel_t get_channel(int pin) { @@ -196,7 +195,7 @@ void adc1_set_attenuation(adc1_channel_t chan, adc_atten_t atten) { } } -void HAL_adc_init() { +void MarlinHAL::adc_init() { // Configure ADC adc1_config_width(ADC_WIDTH_12Bit); @@ -228,11 +227,11 @@ void HAL_adc_init() { } } -void HAL_adc_start_conversion(const uint8_t adc_pin) { - const adc1_channel_t chan = get_channel(adc_pin); +void MarlinHAL::adc_start(const pin_t pin) { + const adc1_channel_t chan = get_channel(pin); uint32_t mv; esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv); - HAL_adc_result = mv * 1023.0 / 3300.0; + adc_result = mv * 1023.0 / 3300.0; // Change the attenuation level based on the new reading adc_atten_t atten; diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index 8473e3c4e469..df52e2186cbd 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -49,8 +49,6 @@ // Defines // ------------------------ -extern portMUX_TYPE spinlock; - #define MYSERIAL1 flushableSerial #if EITHER(WIFISUPPORT, ESP3D_WIFISUPPORT) @@ -65,9 +63,6 @@ extern portMUX_TYPE spinlock; #define CRITICAL_SECTION_START() portENTER_CRITICAL(&spinlock) #define CRITICAL_SECTION_END() portEXIT_CRITICAL(&spinlock) -#define ISRS_ENABLED() (spinlock.owner == portMUX_FREE_VAL) -#define ENABLE_ISRS() if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock) -#define DISABLE_ISRS() portENTER_CRITICAL(&spinlock) // ------------------------ // Types @@ -75,14 +70,8 @@ extern portMUX_TYPE spinlock; typedef int16_t pin_t; -#define HAL_SERVO_LIB Servo - -// ------------------------ -// Public Variables -// ------------------------ - -/** result of last ADC conversion */ -extern uint16_t HAL_adc_result; +class Servo; +typedef Servo hal_servo_t; // ------------------------ // Public functions @@ -91,59 +80,18 @@ extern uint16_t HAL_adc_result; // // Tone // -void toneInit(); void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0); void noTone(const pin_t _pin); -// clear reset reason -void HAL_clear_reset_source(); - -// reset reason -uint8_t HAL_get_reset_source(); - -void HAL_reboot(); - -void _delay_ms(int delay); - -#pragma GCC diagnostic push -#if GCC_VERSION <= 50000 - #pragma GCC diagnostic ignored "-Wunused-function" -#endif - -int freeMemory(); - -#pragma GCC diagnostic pop - void analogWrite(pin_t pin, int value); -// ADC -#define HAL_ANALOG_SELECT(pin) - -void HAL_adc_init(); - -#define HAL_ADC_VREF 3.3 -#define HAL_ADC_RESOLUTION 10 -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_result -#define HAL_ADC_READY() true - -void HAL_adc_start_conversion(const uint8_t adc_pin); - -// PWM -inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); } - -// Pin Map +// +// Pin Mapping for M42, M43, M226 +// #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) -// Enable hooks into idle and setup for HAL -#define HAL_IDLETASK 1 -#define BOARD_INIT() HAL_init_board(); -void HAL_idletask(); -inline void HAL_init() {} -void HAL_init_board(); - #if ENABLED(USE_ESP32_EXIO) void Write_EXIO(uint8_t IO, uint8_t v); #endif @@ -188,3 +136,85 @@ FORCE_INLINE static void DELAY_CYCLES(uint32_t x) { } } + +// ------------------------ +// Class Utilities +// ------------------------ + +#pragma GCC diagnostic push +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + +int freeMemory(); + +#pragma GCC diagnostic pop + +void _delay_ms(const int ms); + +// ------------------------ +// MarlinHAL Class +// ------------------------ + +#define HAL_ADC_VREF 3.3 +#define HAL_ADC_RESOLUTION 10 + +class MarlinHAL { +public: + + // Earliest possible init, before setup() + MarlinHAL() {} + + static void init() {} // Called early in setup() + static void init_board(); // Called less early in setup() + static void reboot(); // Restart the firmware + + // Interrupts + static portMUX_TYPE spinlock; + static bool isr_state() { return spinlock.owner == portMUX_FREE_VAL; } + static void isr_on() { if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock); } + static void isr_off() { portENTER_CRITICAL(&spinlock); } + + static void delay_ms(const int ms) { _delay_ms(ms); } + + // Tasks, called from idle() + static void idletask(); + + // Reset + static uint8_t get_reset_source(); + static void clear_reset_source() {} + + // Free SRAM + static int freeMemory(); + + // + // ADC Methods + // + + static uint16_t adc_result; + + // Called by Temperature::init once at startup + static void adc_init(); + + // Called by Temperature::init for each sensor at startup + static void adc_enable(const pin_t pin) {} + + // Begin ADC sampling on the given channel + static void adc_start(const pin_t pin); + + // Is the ADC ready for reading? + static bool adc_ready() { return true; } + + // The current value of the ADC register + static uint16_t adc_value() { return adc_result; } + + /** + * Set the PWM duty cycle for the pin to the given value. + * No inverting the duty cycle in this HAL. + * No changing the maximum size of the provided value to enable finer PWM duty control in this HAL. + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { + analogWrite(pin, v); + } + +}; diff --git a/Marlin/src/HAL/ESP32/Tone.cpp b/Marlin/src/HAL/ESP32/Tone.cpp index 9c16cdde800a..839c612b6a87 100644 --- a/Marlin/src/HAL/ESP32/Tone.cpp +++ b/Marlin/src/HAL/ESP32/Tone.cpp @@ -35,7 +35,7 @@ static pin_t tone_pin; volatile static int32_t toggles; -void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration) { +void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration/*=0*/) { tone_pin = _pin; toggles = 2 * frequency * duration / 1000; HAL_timer_start(MF_TIMER_TONE, 2 * frequency); diff --git a/Marlin/src/HAL/ESP32/timers.cpp b/Marlin/src/HAL/ESP32/timers.cpp index df0065f45396..c37ad2430cb2 100644 --- a/Marlin/src/HAL/ESP32/timers.cpp +++ b/Marlin/src/HAL/ESP32/timers.cpp @@ -81,7 +81,7 @@ void IRAM_ATTR timer_isr(void *para) { * @param timer_num timer number to initialize * @param frequency frequency of the timer */ -void HAL_timer_start(const uint8_t timer_num, uint32_t frequency) { +void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { const tTimerConfig timer = timer_config[timer_num]; timer_config_t config; diff --git a/Marlin/src/HAL/ESP32/timers.h b/Marlin/src/HAL/ESP32/timers.h index 266169848daf..aa4e1551f066 100644 --- a/Marlin/src/HAL/ESP32/timers.h +++ b/Marlin/src/HAL/ESP32/timers.h @@ -127,7 +127,7 @@ extern const tTimerConfig timer_config[]; // Public functions // ------------------------ -void HAL_timer_start (const uint8_t timer_num, uint32_t frequency); +void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t count); hal_timer_t HAL_timer_get_compare(const uint8_t timer_num); hal_timer_t HAL_timer_get_count(const uint8_t timer_num); @@ -136,5 +136,5 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num); void HAL_timer_disable_interrupt(const uint8_t timer_num); bool HAL_timer_interrupt_enabled(const uint8_t timer_num); -#define HAL_timer_isr_prologue(T) -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_prologue(T) NOOP +#define HAL_timer_isr_epilogue(T) NOOP diff --git a/Marlin/src/HAL/LINUX/HAL.cpp b/Marlin/src/HAL/LINUX/HAL.cpp index 0b679170ef17..db43f42eaafd 100644 --- a/Marlin/src/HAL/LINUX/HAL.cpp +++ b/Marlin/src/HAL/LINUX/HAL.cpp @@ -24,6 +24,10 @@ #include "../../inc/MarlinConfig.h" #include "../shared/Delay.h" +// ------------------------ +// Serial ports +// ------------------------ + MSerialT usb_serial(TERN0(EMERGENCY_PARSER, true)); // U8glib required functions @@ -37,42 +41,21 @@ extern "C" { //************************// // return free heap space -int freeMemory() { - return 0; -} +int freeMemory() { return 0; } // ------------------------ // ADC // ------------------------ -void HAL_adc_init() { - -} - -void HAL_adc_enable_channel(const uint8_t ch) { - -} - -uint8_t active_ch = 0; -void HAL_adc_start_conversion(const uint8_t ch) { - active_ch = ch; -} - -bool HAL_adc_finished() { - return true; -} +uint8_t MarlinHAL::active_ch = 0; -uint16_t HAL_adc_get_result() { - pin_t pin = analogInputToDigitalPin(active_ch); +uint16_t MarlinHAL::adc_value() { + const pin_t pin = analogInputToDigitalPin(active_ch); if (!VALID_PIN(pin)) return 0; - uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF); + const uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF); return data; // return 10bit value as Marlin expects } -void HAL_pwm_init() { - -} - -void HAL_reboot() { /* Reset the application state and GPIO */ } +void MarlinHAL::reboot() { /* Reset the application state and GPIO */ } #endif // __PLAT_LINUX__ diff --git a/Marlin/src/HAL/LINUX/HAL.h b/Marlin/src/HAL/LINUX/HAL.h index d7d3a92b73b9..43899c632de5 100644 --- a/Marlin/src/HAL/LINUX/HAL.h +++ b/Marlin/src/HAL/LINUX/HAL.h @@ -21,25 +21,42 @@ */ #pragma once -#define CPU_32_BIT - -#define F_CPU 100000000UL -#define SystemCoreClock F_CPU #include #include #include - #undef min #undef max - #include -void _printf (const char *format, ...); +#include "hardware/Clock.h" + +#include "../shared/Marduino.h" +#include "../shared/math_32bit.h" +#include "../shared/HAL_SPI.h" +#include "fastio.h" +#include "watchdog.h" +#include "serial.h" + +// ------------------------ +// Defines +// ------------------------ + +#define CPU_32_BIT +#define SHARED_SERVOS HAS_SERVOS // Use shared/servos.cpp + +#define F_CPU 100000000UL +#define SystemCoreClock F_CPU + +#define DELAY_CYCLES(x) Clock::delayCycles(x) + +#define CPU_ST7920_DELAY_1 600 +#define CPU_ST7920_DELAY_2 750 +#define CPU_ST7920_DELAY_3 750 + +void _printf(const char *format, ...); void _putc(uint8_t c); uint8_t _getc(); -//extern "C" volatile uint32_t _millis; - //arduino: Print.h #define DEC 10 #define HEX 16 @@ -49,36 +66,27 @@ uint8_t _getc(); #define B01 1 #define B10 2 -#include "hardware/Clock.h" - -#include "../shared/Marduino.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" -#include "fastio.h" -#include "watchdog.h" -#include "serial.h" - -#define SHARED_SERVOS HAS_SERVOS +// ------------------------ +// Serial ports +// ------------------------ extern MSerialT usb_serial; #define MYSERIAL1 usb_serial -#define CPU_ST7920_DELAY_1 600 -#define CPU_ST7920_DELAY_2 750 -#define CPU_ST7920_DELAY_3 750 - // // Interrupts // #define CRITICAL_SECTION_START() #define CRITICAL_SECTION_END() -#define ISRS_ENABLED() -#define ENABLE_ISRS() -#define DISABLE_ISRS() -inline void HAL_init() {} +// ADC +#define HAL_ADC_VREF 5.0 +#define HAL_ADC_RESOLUTION 10 + +// ------------------------ +// Class Utilities +// ------------------------ -// Utility functions #pragma GCC diagnostic push #if GCC_VERSION <= 50000 #pragma GCC diagnostic ignored "-Wunused-function" @@ -88,29 +96,66 @@ int freeMemory(); #pragma GCC diagnostic pop -// ADC -#define HAL_ADC_VREF 5.0 -#define HAL_ADC_RESOLUTION 10 -#define HAL_ANALOG_SELECT(ch) HAL_adc_enable_channel(ch) -#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch) -#define HAL_READ_ADC() HAL_adc_get_result() -#define HAL_ADC_READY() true +// ------------------------ +// MarlinHAL Class +// ------------------------ + +class MarlinHAL { +public: + + // Earliest possible init, before setup() + MarlinHAL() {} + + static void init() {} // Called early in setup() + static void init_board() {} // Called less early in setup() + static void reboot(); // Reset the application state and GPIO + + // Interrupts + static bool isr_state() { return true; } + static void isr_on() {} + static void isr_off() {} + + static void delay_ms(const int ms) { _delay_ms(ms); } + + // Tasks, called from idle() + static void idletask() {} + + // Reset + static constexpr uint8_t reset_reason = RST_POWER_ON; + static uint8_t get_reset_source() { return reset_reason; } + static void clear_reset_source() {} + + // Free SRAM + static int freeMemory() { return ::freeMemory(); } + + // + // ADC Methods + // + + static uint8_t active_ch; + + // Called by Temperature::init once at startup + static void adc_init() {} + + // Called by Temperature::init for each sensor at startup + static void adc_enable(const uint8_t) {} -void HAL_adc_init(); -void HAL_adc_enable_channel(const uint8_t ch); -void HAL_adc_start_conversion(const uint8_t ch); -uint16_t HAL_adc_get_result(); + // Begin ADC sampling on the given channel + static void adc_start(const uint8_t ch) { active_ch = ch; } -// PWM -inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); } + // Is the ADC ready for reading? + static bool adc_ready() { return true; } -// Reset source -inline void HAL_clear_reset_source(void) {} -inline uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; } + // The current value of the ADC register + static uint16_t adc_value(); -void HAL_reboot(); // Reset the application state and GPIO + /** + * Set the PWM duty cycle for the pin to the given value. + * No option to change the resolution or invert the duty cycle. + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { + analogWrite(pin, v); + } -/* ---------------- Delay in cycles */ -FORCE_INLINE static void DELAY_CYCLES(uint64_t x) { - Clock::delayCycles(x); -} + static void set_pwm_frequency(const pin_t, int) {} +}; diff --git a/Marlin/src/HAL/LINUX/arduino.cpp b/Marlin/src/HAL/LINUX/arduino.cpp index 4b56d02a389c..075b4ccde2f4 100644 --- a/Marlin/src/HAL/LINUX/arduino.cpp +++ b/Marlin/src/HAL/LINUX/arduino.cpp @@ -31,9 +31,7 @@ void cli() { } // Disable void sei() { } // Enable // Time functions -void _delay_ms(const int delay_ms) { - delay(delay_ms); -} +void _delay_ms(const int ms) { delay(ms); } uint32_t millis() { return (uint32_t)Clock::millis(); diff --git a/Marlin/src/HAL/LINUX/include/Arduino.h b/Marlin/src/HAL/LINUX/include/Arduino.h index d4086e259a2f..f05aaed88083 100644 --- a/Marlin/src/HAL/LINUX/include/Arduino.h +++ b/Marlin/src/HAL/LINUX/include/Arduino.h @@ -59,10 +59,9 @@ typedef uint8_t byte; #endif #define sq(v) ((v) * (v)) -#define square(v) sq(v) #define constrain(value, arg_min, arg_max) ((value) < (arg_min) ? (arg_min) :((value) > (arg_max) ? (arg_max) : (value))) -//Interrupts +// Interrupts void cli(); // Disable void sei(); // Enable void attachInterrupt(uint32_t pin, void (*callback)(), uint32_t mode); @@ -74,8 +73,8 @@ extern "C" { } // Time functions -extern "C" void delay(const int milis); -void _delay_ms(const int delay); +extern "C" void delay(const int ms); +void _delay_ms(const int ms); void delayMicroseconds(unsigned long); uint32_t millis(); diff --git a/Marlin/src/HAL/LINUX/timers.h b/Marlin/src/HAL/LINUX/timers.h index a98ceb6f391d..2d2a95774c1b 100644 --- a/Marlin/src/HAL/LINUX/timers.h +++ b/Marlin/src/HAL/LINUX/timers.h @@ -92,5 +92,5 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num); void HAL_timer_disable_interrupt(const uint8_t timer_num); bool HAL_timer_interrupt_enabled(const uint8_t timer_num); -#define HAL_timer_isr_prologue(T) -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_prologue(T) NOOP +#define HAL_timer_isr_epilogue(T) NOOP diff --git a/Marlin/src/HAL/LPC1768/HAL.cpp b/Marlin/src/HAL/LPC1768/HAL.cpp index cee9cfc5f744..541848b08acc 100644 --- a/Marlin/src/HAL/LPC1768/HAL.cpp +++ b/Marlin/src/HAL/LPC1768/HAL.cpp @@ -31,7 +31,7 @@ DefaultSerial1 USBSerial(false, UsbSerial); -uint32_t HAL_adc_reading = 0; +uint32_t MarlinHAL::adc_result = 0; // U8glib required functions extern "C" { @@ -41,8 +41,6 @@ extern "C" { void u8g_Delay(uint16_t val) { delay(val); } } -//************************// - // return free heap space int freeMemory() { char stack_end; @@ -54,33 +52,33 @@ int freeMemory() { return result; } -// scan command line for code -// return index into pin map array if found and the pin is valid. -// return dval if not found or not a valid pin. -int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) { - const uint16_t val = (uint16_t)parser.intval(code, -1), port = val / 100, pin = val % 100; - const int16_t ind = (port < ((NUM_DIGITAL_PINS) >> 5) && pin < 32) ? ((port << 5) | pin) : -2; - return ind > -1 ? ind : dval; +void MarlinHAL::reboot() { NVIC_SystemReset(); } + +uint8_t MarlinHAL::get_reset_source() { + #if ENABLED(USE_WATCHDOG) + if (watchdog_timed_out()) return RST_WATCHDOG; + #endif + return RST_POWER_ON; +} + +void MarlinHAL::clear_reset_source() { + TERN_(USE_WATCHDOG, watchdog_clear_timeout_flag()); } void flashFirmware(const int16_t) { delay(500); // Give OS time to disconnect USB_Connect(false); // USB clear connection delay(1000); // Give OS time to notice - HAL_reboot(); + hal.reboot(); } -void HAL_clear_reset_source(void) { - TERN_(USE_WATCHDOG, watchdog_clear_timeout_flag()); -} - -uint8_t HAL_get_reset_source(void) { - #if ENABLED(USE_WATCHDOG) - if (watchdog_timed_out()) return RST_WATCHDOG; - #endif - return RST_POWER_ON; +// For M42/M43, scan command line for pin code +// return index into pin map array if found and the pin is valid. +// return dval if not found or not a valid pin. +int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) { + const uint16_t val = (uint16_t)parser.intval(code, -1), port = val / 100, pin = val % 100; + const int16_t ind = (port < ((NUM_DIGITAL_PINS) >> 5) && pin < 32) ? ((port << 5) | pin) : -2; + return ind > -1 ? ind : dval; } -void HAL_reboot() { NVIC_SystemReset(); } - #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index f5e432698317..eefacae99549 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -28,8 +28,6 @@ #define CPU_32_BIT -void HAL_init(); - #include #include #include @@ -47,12 +45,9 @@ extern "C" volatile uint32_t _millis; #include #include -// -// Default graphical display delays -// -#define CPU_ST7920_DELAY_1 600 -#define CPU_ST7920_DELAY_2 750 -#define CPU_ST7920_DELAY_3 750 +// ------------------------ +// Serial ports +// ------------------------ typedef ForwardSerial1Class< decltype(UsbSerial) > DefaultSerial1; extern DefaultSerial1 USBSerial; @@ -114,26 +109,12 @@ extern DefaultSerial1 USBSerial; // // Interrupts // -#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END() if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() - -// -// Utility functions -// -#pragma GCC diagnostic push -#if GCC_VERSION <= 50000 - #pragma GCC diagnostic ignored "-Wunused-function" -#endif -int freeMemory(); - -#pragma GCC diagnostic pop +#define CRITICAL_SECTION_START() const bool irqon = !__get_PRIMASK(); __disable_irq() +#define CRITICAL_SECTION_END() if (irqon) __enable_irq() // -// ADC API +// ADC // #define ADC_MEDIAN_FILTER_SIZE (23) // Higher values increase step delay (phase shift), @@ -152,20 +133,9 @@ int freeMemory(); #define HAL_ADC_RESOLUTION 12 // 15 bit maximum, raw temperature is stored as int16_t #define HAL_ADC_FILTERED // Disable oversampling done in Marlin as ADC values already filtered in HAL -using FilteredADC = LPC176x::ADC; -extern uint32_t HAL_adc_reading; -[[gnu::always_inline]] inline void HAL_adc_start_conversion(const pin_t pin) { - HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits -} -[[gnu::always_inline]] inline uint16_t HAL_adc_get_result() { - return HAL_adc_reading; -} - -#define HAL_adc_init() -#define HAL_ANALOG_SELECT(pin) FilteredADC::enable_channel(pin) -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_get_result() -#define HAL_ADC_READY() (true) +// +// Pin Mapping for M42, M43, M226 +// // Test whether the pin is valid constexpr bool VALID_PIN(const pin_t pin) { @@ -192,32 +162,101 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval); // P0.6 thru P0.9 are for the onboard SD card #define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09, -#define HAL_IDLETASK 1 -void HAL_idletask(); +// ------------------------ +// Defines +// ------------------------ #define PLATFORM_M997_SUPPORT void flashFirmware(const int16_t); #define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment -/** - * set_pwm_frequency - * Set the frequency of the timer corresponding to the provided pin - * All Hardware PWM pins run at the same frequency and all - * Software PWM pins run at the same frequency - */ -void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); +// Default graphical display delays +#define CPU_ST7920_DELAY_1 600 +#define CPU_ST7920_DELAY_2 750 +#define CPU_ST7920_DELAY_3 750 -/** - * set_pwm_duty - * Set the PWM duty cycle of the provided pin to the provided value - * Optionally allows inverting the duty cycle [default = false] - * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255] - */ -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); +// ------------------------ +// Class Utilities +// ------------------------ + +#pragma GCC diagnostic push +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + +int freeMemory(); + +#pragma GCC diagnostic pop + +// ------------------------ +// MarlinHAL Class +// ------------------------ + +class MarlinHAL { +public: + + // Earliest possible init, before setup() + MarlinHAL() {} + + static void init(); // Called early in setup() + static void init_board() {} // Called less early in setup() + static void reboot(); // Restart the firmware from 0x0 + + // Interrupts + static bool isr_state() { return !__get_PRIMASK(); } + static void isr_on() { __enable_irq(); } + static void isr_off() { __disable_irq(); } + + static void delay_ms(const int ms) { _delay_ms(ms); } + + // Tasks, called from idle() + static void idletask(); + + // Reset + static uint8_t get_reset_source(); + static void clear_reset_source(); + + // Free SRAM + static int freeMemory() { return ::freeMemory(); } + + // + // ADC Methods + // + + using FilteredADC = LPC176x::ADC; + + // Called by Temperature::init once at startup + static void adc_init() {} + + // Called by Temperature::init for each sensor at startup + static void adc_enable(const pin_t pin) { + FilteredADC::enable_channel(pin); + } + + // Begin ADC sampling on the given pin + static uint32_t adc_result; + static void adc_start(const pin_t pin) { + adc_result = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits + } + + // Is the ADC ready for reading? + static bool adc_ready() { return true; } + + // The current value of the ADC register + static uint16_t adc_value() { return uint16_t(adc_result); } -// Reset source -void HAL_clear_reset_source(void); -uint8_t HAL_get_reset_source(void); + /** + * Set the PWM duty cycle for the pin to the given value. + * Optionally invert the duty cycle [default = false] + * Optionally change the scale of the provided value to enable finer PWM duty control [default = 255] + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); -void HAL_reboot(); + /** + * Set the frequency of the timer corresponding to the provided pin + * All Hardware PWM pins will run at the same frequency and + * All Software PWM pins will run at the same frequency + */ + static void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); +}; diff --git a/Marlin/src/HAL/LPC1768/Servo.h b/Marlin/src/HAL/LPC1768/Servo.h index eb12fd20f4d8..f02f503a67da 100644 --- a/Marlin/src/HAL/LPC1768/Servo.h +++ b/Marlin/src/HAL/LPC1768/Servo.h @@ -65,4 +65,5 @@ class libServo: public Servo { } }; -#define HAL_SERVO_LIB libServo +class libServo; +typedef libServo hal_servo_t; diff --git a/Marlin/src/HAL/LPC1768/fast_pwm.cpp b/Marlin/src/HAL/LPC1768/fast_pwm.cpp index ece115aa01ae..6d2b1a9002c1 100644 --- a/Marlin/src/HAL/LPC1768/fast_pwm.cpp +++ b/Marlin/src/HAL/LPC1768/fast_pwm.cpp @@ -21,16 +21,16 @@ */ #ifdef TARGET_LPC1768 -#include "../../inc/MarlinConfigPre.h" +#include "../../inc/MarlinConfig.h" #include -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { +void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { if (!LPC176x::pin_is_valid(pin)) return; if (LPC176x::pwm_attach_pin(pin)) LPC176x::pwm_write_ratio(pin, invert ? 1.0f - (float)v / v_size : (float)v / v_size); // map 1-254 onto PWM range } -void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { +void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { LPC176x::pwm_set_frequency(pin, f_desired); } diff --git a/Marlin/src/HAL/LPC1768/main.cpp b/Marlin/src/HAL/LPC1768/main.cpp index ef0dc42c78ca..419c99793fb8 100644 --- a/Marlin/src/HAL/LPC1768/main.cpp +++ b/Marlin/src/HAL/LPC1768/main.cpp @@ -48,7 +48,7 @@ void SysTick_Callback() { disk_timerproc(); } TERN_(POSTMORTEM_DEBUGGING, extern void install_min_serial()); -void HAL_init() { +void MarlinHAL::init() { // Init LEDs #if PIN_EXISTS(LED) @@ -130,7 +130,7 @@ void HAL_init() { const millis_t usb_timeout = millis() + 2000; while (!USB_Configuration && PENDING(millis(), usb_timeout)) { delay(50); - HAL_idletask(); + idletask(); #if PIN_EXISTS(LED) TOGGLE(LED_PIN); // Flash quickly during USB initialization #endif @@ -142,7 +142,7 @@ void HAL_init() { } // HAL idle task -void HAL_idletask() { +void MarlinHAL::idletask() { #if HAS_SHARED_MEDIA // If Marlin is using the SD card we need to lock it to prevent access from // a PC via USB. diff --git a/Marlin/src/HAL/LPC1768/timers.h b/Marlin/src/HAL/LPC1768/timers.h index 78e856db2857..c6d7bc632e2e 100644 --- a/Marlin/src/HAL/LPC1768/timers.h +++ b/Marlin/src/HAL/LPC1768/timers.h @@ -170,4 +170,4 @@ FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) { } } -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_epilogue(T) NOOP diff --git a/Marlin/src/HAL/NATIVE_SIM/HAL.h b/Marlin/src/HAL/NATIVE_SIM/HAL.h index 436b4b4daa26..ee2e31fc7fa4 100644 --- a/Marlin/src/HAL/NATIVE_SIM/HAL.h +++ b/Marlin/src/HAL/NATIVE_SIM/HAL.h @@ -21,18 +21,10 @@ */ #pragma once -#define CPU_32_BIT -#define HAL_IDLETASK -void HAL_idletask(); - -#define F_CPU 100000000 -#define SystemCoreClock F_CPU #include #include - #undef min #undef max - #include #include "pinmapping.h" @@ -40,8 +32,6 @@ void _printf (const char *format, ...); void _putc(uint8_t c); uint8_t _getc(); -//extern "C" volatile uint32_t _millis; - //arduino: Print.h #define DEC 10 #define HEX 16 @@ -58,7 +48,23 @@ uint8_t _getc(); #include "watchdog.h" #include "serial.h" -#define SHARED_SERVOS HAS_SERVOS +// ------------------------ +// Defines +// ------------------------ + +#define CPU_32_BIT +#define SHARED_SERVOS HAS_SERVOS // Use shared/servos.cpp + +#define F_CPU 100000000 +#define SystemCoreClock F_CPU + +#define CPU_ST7920_DELAY_1 600 +#define CPU_ST7920_DELAY_2 750 +#define CPU_ST7920_DELAY_3 750 + +// ------------------------ +// Serial ports +// ------------------------ extern MSerialT serial_stream_0; extern MSerialT serial_stream_1; @@ -98,49 +104,19 @@ extern MSerialT serial_stream_3; #endif #endif - -#define CPU_ST7920_DELAY_1 600 -#define CPU_ST7920_DELAY_2 750 -#define CPU_ST7920_DELAY_3 750 - -// +// ------------------------ // Interrupts -// +// ------------------------ + #define CRITICAL_SECTION_START() #define CRITICAL_SECTION_END() -#define ISRS_ENABLED() -#define ENABLE_ISRS() -#define DISABLE_ISRS() - -inline void HAL_init() {} - -// Utility functions -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -int freeMemory(); -#pragma GCC diagnostic pop +// ------------------------ // ADC +// ------------------------ + #define HAL_ADC_VREF 5.0 #define HAL_ADC_RESOLUTION 10 -#define HAL_ANALOG_SELECT(ch) HAL_adc_enable_channel(ch) -#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch) -#define HAL_READ_ADC() HAL_adc_get_result() -#define HAL_ADC_READY() true - -void HAL_adc_init(); -void HAL_adc_enable_channel(const uint8_t ch); -void HAL_adc_start_conversion(const uint8_t ch); -uint16_t HAL_adc_get_result(); - -// PWM -inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); } - -// Reset source -inline void HAL_clear_reset_source(void) {} -inline uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; } - -void HAL_reboot(); /* ---------------- Delay in cycles */ @@ -159,29 +135,22 @@ constexpr inline std::size_t strlen_constexpr(const char* str) { // https://github.com/gcc-mirror/gcc/blob/5c7634a0e5f202935aa6c11b6ea953b8bf80a00a/libstdc%2B%2B-v3/include/bits/char_traits.h#L329 if (str != nullptr) { std::size_t i = 0; - while (str[i] != '\0') { - ++i; - } - + while (str[i] != '\0') ++i; return i; } - return 0; } constexpr inline int strncmp_constexpr(const char* lhs, const char* rhs, std::size_t count) { // https://github.com/gcc-mirror/gcc/blob/13b9cbfc32fe3ac4c81c4dd9c42d141c8fb95db4/libstdc%2B%2B-v3/include/bits/char_traits.h#L655 - if (lhs == nullptr || rhs == nullptr) { + if (lhs == nullptr || rhs == nullptr) return rhs != nullptr ? -1 : 1; - } - for (std::size_t i = 0; i < count; ++i) { - if (lhs[i] != rhs[i]) { + for (std::size_t i = 0; i < count; ++i) + if (lhs[i] != rhs[i]) return lhs[i] < rhs[i] ? -1 : 1; - } else if (lhs[i] == '\0') { + else if (lhs[i] == '\0') return 0; - } - } return 0; } @@ -193,14 +162,11 @@ constexpr inline const char* strstr_constexpr(const char* str, const char* targe do { char sc = {}; do { - if ((sc = *str++) == '\0') { - return nullptr; - } + if ((sc = *str++) == '\0') return nullptr; } while (sc != c); } while (strncmp_constexpr(str, target, len) != 0); --str; } - return str; } @@ -211,12 +177,87 @@ constexpr inline char* strstr_constexpr(char* str, const char* target) { do { char sc = {}; do { - if ((sc = *str++) == '\0') { - return nullptr; - } + if ((sc = *str++) == '\0') return nullptr; } while (sc != c); } while (strncmp_constexpr(str, target, len) != 0); --str; } return str; } + +// ------------------------ +// Class Utilities +// ------------------------ + +#pragma GCC diagnostic push +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + +int freeMemory(); + +#pragma GCC diagnostic pop + +// ------------------------ +// MarlinHAL Class +// ------------------------ + +class MarlinHAL { +public: + + // Earliest possible init, before setup() + MarlinHAL() {} + + static void init() {} // Called early in setup() + static void init_board() {} // Called less early in setup() + static void reboot(); // Restart the firmware from 0x0 + + // Interrupts + static bool isr_state() { return true; } + static void isr_on() {} + static void isr_off() {} + + static void delay_ms(const int ms) { _delay_ms(ms); } + + // Tasks, called from idle() + static void idletask(); + + // Reset + static constexpr uint8_t reset_reason = RST_POWER_ON; + static uint8_t get_reset_source() { return reset_reason; } + static void clear_reset_source() {} + + // Free SRAM + static int freeMemory() { return ::freeMemory(); } + + // + // ADC Methods + // + + static uint8_t active_ch; + + // Called by Temperature::init once at startup + static void adc_init(); + + // Called by Temperature::init for each sensor at startup + static void adc_enable(const uint8_t ch); + + // Begin ADC sampling on the given channel + static void adc_start(const uint8_t ch); + + // Is the ADC ready for reading? + static bool adc_ready(); + + // The current value of the ADC register + static uint16_t adc_value(); + + /** + * Set the PWM duty cycle for the pin to the given value. + * No option to invert the duty cycle [default = false] + * No option to change the scale of the provided value to enable finer PWM duty control [default = 255] + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { + analogWrite(pin, v); + } + +}; diff --git a/Marlin/src/HAL/NATIVE_SIM/timers.h b/Marlin/src/HAL/NATIVE_SIM/timers.h index cedfdb62d631..be38d583b686 100644 --- a/Marlin/src/HAL/NATIVE_SIM/timers.h +++ b/Marlin/src/HAL/NATIVE_SIM/timers.h @@ -87,5 +87,5 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num); void HAL_timer_disable_interrupt(const uint8_t timer_num); bool HAL_timer_interrupt_enabled(const uint8_t timer_num); -#define HAL_timer_isr_prologue(T) -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_prologue(T) NOOP +#define HAL_timer_isr_epilogue(T) NOOP diff --git a/Marlin/src/HAL/SAMD51/HAL.cpp b/Marlin/src/HAL/SAMD51/HAL.cpp index a5febad83be1..14b6a437dccc 100644 --- a/Marlin/src/HAL/SAMD51/HAL.cpp +++ b/Marlin/src/HAL/SAMD51/HAL.cpp @@ -42,10 +42,6 @@ #endif #endif -// ------------------------ -// Local defines -// ------------------------ - #define GET_TEMP_0_ADC() TERN(HAS_TEMP_ADC_0, PIN_TO_ADC(TEMP_0_PIN), -1) #define GET_TEMP_1_ADC() TERN(HAS_TEMP_ADC_1, PIN_TO_ADC(TEMP_1_PIN), -1) #define GET_TEMP_2_ADC() TERN(HAS_TEMP_ADC_2, PIN_TO_ADC(TEMP_2_PIN), -1) @@ -61,17 +57,21 @@ #define GET_BOARD_ADC() TERN(HAS_TEMP_ADC_BOARD, PIN_TO_ADC(TEMP_BOARD_PIN), -1) #define GET_FILAMENT_WIDTH_ADC() TERN(FILAMENT_WIDTH_SENSOR, PIN_TO_ADC(FILWIDTH_PIN), -1) #define GET_BUTTONS_ADC() TERN(HAS_ADC_BUTTONS, PIN_TO_ADC(ADC_KEYPAD_PIN), -1) +#define GET_JOY_ADC_X() TERN(HAS_JOY_ADC_X, PIN_TO_ADC(JOY_X_PIN), -1) +#define GET_JOY_ADC_Y() TERN(HAS_JOY_ADC_Y, PIN_TO_ADC(JOY_Y_PIN), -1) +#define GET_JOY_ADC_Z() TERN(HAS_JOY_ADC_Z, PIN_TO_ADC(JOY_Z_PIN), -1) #define IS_ADC_REQUIRED(n) ( \ GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n || GET_TEMP_3_ADC() == n \ || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n || GET_TEMP_6_ADC() == n || GET_TEMP_7_ADC() == n \ - || GET_BED_ADC() == n \ - || GET_CHAMBER_ADC() == n \ - || GET_PROBE_ADC() == n \ - || GET_COOLER_ADC() == n \ - || GET_BOARD_ADC() == n \ + || GET_BED_ADC() == n \ + || GET_CHAMBER_ADC() == n \ + || GET_PROBE_ADC() == n \ + || GET_COOLER_ADC() == n \ + || GET_BOARD_ADC() == n \ || GET_FILAMENT_WIDTH_ADC() == n \ - || GET_BUTTONS_ADC() == n \ + || GET_BUTTONS_ADC() == n \ + || GET_JOY_ADC_X() == n || GET_JOY_ADC_Y() == n || GET_JOY_ADC_Z() == n \ ) #if IS_ADC_REQUIRED(0) @@ -91,6 +91,118 @@ #define DMA_IS_REQUIRED 1 #endif +enum ADCIndex { + #if GET_TEMP_0_ADC() == 0 + TEMP_0, + #endif + #if GET_TEMP_1_ADC() == 0 + TEMP_1, + #endif + #if GET_TEMP_2_ADC() == 0 + TEMP_2, + #endif + #if GET_TEMP_3_ADC() == 0 + TEMP_3, + #endif + #if GET_TEMP_4_ADC() == 0 + TEMP_4, + #endif + #if GET_TEMP_5_ADC() == 0 + TEMP_5, + #endif + #if GET_TEMP_6_ADC() == 0 + TEMP_6, + #endif + #if GET_TEMP_7_ADC() == 0 + TEMP_7, + #endif + #if GET_BED_ADC() == 0 + TEMP_BED, + #endif + #if GET_CHAMBER_ADC() == 0 + TEMP_CHAMBER, + #endif + #if GET_PROBE_ADC() == 0 + TEMP_PROBE, + #endif + #if GET_COOLER_ADC() == 0 + TEMP_COOLER, + #endif + #if GET_BOARD_ADC() == 0 + TEMP_BOARD, + #endif + #if GET_FILAMENT_WIDTH_ADC() == 0 + FILWIDTH, + #endif + #if GET_BUTTONS_ADC() == 0 + ADC_KEY, + #endif + #if GET_JOY_ADC_X() == 0 + JOY_X, + #endif + #if GET_JOY_ADC_Y() == 0 + JOY_Y, + #endif + #if GET_JOY_ADC_Z() == 0 + JOY_Z, + #endif + #if GET_TEMP_0_ADC() == 1 + TEMP_0, + #endif + #if GET_TEMP_1_ADC() == 1 + TEMP_1, + #endif + #if GET_TEMP_2_ADC() == 1 + TEMP_2, + #endif + #if GET_TEMP_3_ADC() == 1 + TEMP_3, + #endif + #if GET_TEMP_4_ADC() == 1 + TEMP_4, + #endif + #if GET_TEMP_5_ADC() == 1 + TEMP_5, + #endif + #if GET_TEMP_6_ADC() == 1 + TEMP_6, + #endif + #if GET_TEMP_7_ADC() == 1 + TEMP_7, + #endif + #if GET_BED_ADC() == 1 + TEMP_BED, + #endif + #if GET_CHAMBER_ADC() == 1 + TEMP_CHAMBER, + #endif + #if GET_PROBE_ADC() == 1 + TEMP_PROBE, + #endif + #if GET_COOLER_ADC() == 1 + TEMP_COOLER, + #endif + #if GET_BOARD_ADC() == 1 + TEMP_BOARD, + #endif + #if GET_FILAMENT_WIDTH_ADC() == 1 + FILWIDTH, + #endif + #if GET_BUTTONS_ADC() == 1 + ADC_KEY, + #endif + #if GET_JOY_ADC_X() == 1 + JOY_X, + #endif + #if GET_JOY_ADC_Y() == 1 + JOY_Y, + #endif + #if GET_JOY_ADC_Z() == 1 + JOY_Z, + #endif + ADC_COUNT +}; + // ------------------------ // Types // ------------------------ @@ -108,12 +220,10 @@ // Private Variables // ------------------------ -uint16_t HAL_adc_result; - #if ADC_IS_REQUIRED // Pins used by ADC inputs. Order must be ADC0 inputs first then ADC1 - const uint8_t adc_pins[] = { + static constexpr uint8_t adc_pins[ADC_COUNT] = { // ADC0 pins #if GET_TEMP_0_ADC() == 0 TEMP_0_PIN, @@ -160,6 +270,15 @@ uint16_t HAL_adc_result; #if GET_BUTTONS_ADC() == 0 ADC_KEYPAD_PIN, #endif + #if GET_JOY_ADC_X() == 0 + JOY_X_PIN, + #endif + #if GET_JOY_ADC_Y() == 0 + JOY_Y_PIN, + #endif + #if GET_JOY_ADC_Z() == 0 + JOY_Z_PIN, + #endif // ADC1 pins #if GET_TEMP_0_ADC() == 1 TEMP_0_PIN, @@ -206,15 +325,23 @@ uint16_t HAL_adc_result; #if GET_BUTTONS_ADC() == 1 ADC_KEYPAD_PIN, #endif + #if GET_JOY_ADC_X() == 1 + JOY_X_PIN, + #endif + #if GET_JOY_ADC_Y() == 1 + JOY_Y_PIN, + #endif + #if GET_JOY_ADC_Z() == 1 + JOY_Z_PIN, + #endif }; - uint16_t HAL_adc_results[COUNT(adc_pins)]; + static uint16_t adc_results[ADC_COUNT]; #if ADC0_IS_REQUIRED - Adafruit_ZeroDMA adc0DMAProgram, - adc0DMARead; + Adafruit_ZeroDMA adc0DMAProgram, adc0DMARead; - const HAL_DMA_DAC_Registers adc0_dma_regs_list[] = { + static constexpr HAL_DMA_DAC_Registers adc0_dma_regs_list[ADC_COUNT] = { #if GET_TEMP_0_ADC() == 0 { PIN_TO_INPUTCTRL(TEMP_0_PIN) }, #endif @@ -260,16 +387,24 @@ uint16_t HAL_adc_result; #if GET_BUTTONS_ADC() == 0 { PIN_TO_INPUTCTRL(ADC_KEYPAD_PIN) }, #endif + #if GET_JOY_ADC_X() == 0 + { PIN_TO_INPUTCTRL(JOY_X_PIN) }, + #endif + #if GET_JOY_ADC_Y() == 0 + { PIN_TO_INPUTCTRL(JOY_Y_PIN) }, + #endif + #if GET_JOY_ADC_Z() == 0 + { PIN_TO_INPUTCTRL(JOY_Z_PIN) }, + #endif }; #define ADC0_AINCOUNT COUNT(adc0_dma_regs_list) #endif // ADC0_IS_REQUIRED #if ADC1_IS_REQUIRED - Adafruit_ZeroDMA adc1DMAProgram, - adc1DMARead; + Adafruit_ZeroDMA adc1DMAProgram, adc1DMARead; - const HAL_DMA_DAC_Registers adc1_dma_regs_list[] = { + static constexpr HAL_DMA_DAC_Registers adc1_dma_regs_list[ADC_COUNT] = { #if GET_TEMP_0_ADC() == 1 { PIN_TO_INPUTCTRL(TEMP_0_PIN) }, #endif @@ -315,6 +450,15 @@ uint16_t HAL_adc_result; #if GET_BUTTONS_ADC() == 1 { PIN_TO_INPUTCTRL(ADC_KEYPAD_PIN) }, #endif + #if GET_JOY_ADC_X() == 1 + { PIN_TO_INPUTCTRL(JOY_X_PIN) }, + #endif + #if GET_JOY_ADC_Y() == 1 + { PIN_TO_INPUTCTRL(JOY_Y_PIN) }, + #endif + #if GET_JOY_ADC_Z() == 1 + { PIN_TO_INPUTCTRL(JOY_Z_PIN) }, + #endif }; #define ADC1_AINCOUNT COUNT(adc1_dma_regs_list) @@ -326,9 +470,10 @@ uint16_t HAL_adc_result; // Private functions // ------------------------ -#if DMA_IS_REQUIRED +void MarlinHAL::dma_init() { + + #if DMA_IS_REQUIRED - void dma_init() { DmacDescriptor *descriptor; #if ADC0_IS_REQUIRED @@ -357,7 +502,7 @@ uint16_t HAL_adc_result; if (adc0DMARead.allocate() == DMA_STATUS_OK) { adc0DMARead.addDescriptor( (void *)&ADC0->RESULT.reg, // SRC - &HAL_adc_results, // DEST + &adc_results, // DEST ADC0_AINCOUNT, // CNT DMA_BEAT_SIZE_HWORD, false, // SRCINC @@ -394,7 +539,7 @@ uint16_t HAL_adc_result; if (adc1DMARead.allocate() == DMA_STATUS_OK) { adc1DMARead.addDescriptor( (void *)&ADC1->RESULT.reg, // SRC - &HAL_adc_results[ADC0_AINCOUNT], // DEST + &adc_results[ADC0_AINCOUNT], // DEST ADC1_AINCOUNT, // CNT DMA_BEAT_SIZE_HWORD, false, // SRCINC @@ -407,16 +552,16 @@ uint16_t HAL_adc_result; #endif DMAC->PRICTRL0.bit.RRLVLEN0 = true; // Activate round robin for DMA channels required by ADCs - } -#endif // DMA_IS_REQUIRED + #endif // DMA_IS_REQUIRED +} // ------------------------ // Public functions // ------------------------ // HAL initialization task -void HAL_init() { +void MarlinHAL::init() { TERN_(DMA_IS_REQUIRED, dma_init()); #if ENABLED(SDSUPPORT) #if SD_CONNECTION_IS(ONBOARD) && PIN_EXISTS(SD_DETECT) @@ -426,17 +571,9 @@ void HAL_init() { #endif } -// HAL idle task -/* -void HAL_idletask() { -} -*/ - -void HAL_clear_reset_source() { } - #pragma push_macro("WDT") #undef WDT // Required to be able to use '.bit.WDT'. Compiler wrongly replace struct field with WDT define -uint8_t HAL_get_reset_source() { +uint8_t MarlinHAL::get_reset_source() { RSTC_RCAUSE_Type resetCause; resetCause.reg = REG_RSTC_RCAUSE; @@ -450,7 +587,7 @@ uint8_t HAL_get_reset_source() { } #pragma pop_macro("WDT") -void HAL_reboot() { NVIC_SystemReset(); } +void MarlinHAL::reboot() { NVIC_SystemReset(); } extern "C" { void * _sbrk(int incr); @@ -468,9 +605,11 @@ int freeMemory() { // ADC // ------------------------ -void HAL_adc_init() { +uint16_t MarlinHAL::adc_result; + +void MarlinHAL::adc_init() { #if ADC_IS_REQUIRED - memset(HAL_adc_results, 0xFF, sizeof(HAL_adc_results)); // Fill result with invalid values + memset(adc_results, 0xFF, sizeof(adc_results)); // Fill result with invalid values LOOP_L_N(pi, COUNT(adc_pins)) pinPeripheral(adc_pins[pi], PIO_ANALOG); @@ -505,17 +644,13 @@ void HAL_adc_init() { #endif // ADC_IS_REQUIRED } -void HAL_adc_start_conversion(const uint8_t adc_pin) { +void MarlinHAL::adc_start(const pin_t pin) { #if ADC_IS_REQUIRED - LOOP_L_N(pi, COUNT(adc_pins)) { - if (adc_pin == adc_pins[pi]) { - HAL_adc_result = HAL_adc_results[pi]; - return; - } - } + LOOP_L_N(pi, COUNT(adc_pins)) + if (pin == adc_pins[pi]) { adc_result = adc_results[pi]; return; } #endif - HAL_adc_result = 0xFFFF; + adc_result = 0xFFFF; } #endif // __SAMD51__ diff --git a/Marlin/src/HAL/SAMD51/HAL.h b/Marlin/src/HAL/SAMD51/HAL.h index c262752a8d66..3b09a885a53b 100644 --- a/Marlin/src/HAL/SAMD51/HAL.h +++ b/Marlin/src/HAL/SAMD51/HAL.h @@ -89,51 +89,30 @@ typedef int8_t pin_t; -#define SHARED_SERVOS HAS_SERVOS -#define HAL_SERVO_LIB Servo +#define SHARED_SERVOS HAS_SERVOS // Use shared/servos.cpp + +class Servo; +typedef Servo hal_servo_t; // // Interrupts // -#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END() if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() - -#define cli() __disable_irq() // Disable interrupts -#define sei() __enable_irq() // Enable interrupts - -void HAL_clear_reset_source(); // clear reset reason -uint8_t HAL_get_reset_source(); // get reset reason +#define CRITICAL_SECTION_START() const bool irqon = !__get_PRIMASK(); __disable_irq() +#define CRITICAL_SECTION_END() if (irqon) __enable_irq() -void HAL_reboot(); +#define cli() __disable_irq() // Disable interrupts +#define sei() __enable_irq() // Enable interrupts // // ADC // -extern uint16_t HAL_adc_result; // Most recent ADC conversion - -#define HAL_ANALOG_SELECT(pin) - -void HAL_adc_init(); //#define HAL_ADC_FILTERED // Disable Marlin's oversampling. The HAL filters ADC values. #define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 // ... 12 -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_result -#define HAL_ADC_READY() true -void HAL_adc_start_conversion(const uint8_t adc_pin); - -// -// PWM // -inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); } - -// -// Pin Map +// Pin Mapping for M42, M43, M226 // #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin @@ -142,35 +121,93 @@ inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, // // Tone // -void toneInit(); void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0); void noTone(const pin_t _pin); -// Enable hooks into idle and setup for HAL -void HAL_init(); -/* -#define HAL_IDLETASK 1 -void HAL_idletask(); -*/ - -// -// Utility functions -// -FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } +// ------------------------ +// Class Utilities +// ------------------------ #pragma GCC diagnostic push #if GCC_VERSION <= 50000 #pragma GCC diagnostic ignored "-Wunused-function" #endif -int freeMemory(); - -#pragma GCC diagnostic pop - #ifdef __cplusplus extern "C" { #endif + char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s); + +extern "C" int freeMemory(); + #ifdef __cplusplus } #endif + +#pragma GCC diagnostic pop + +// ------------------------ +// MarlinHAL Class +// ------------------------ + +class MarlinHAL { +public: + + // Earliest possible init, before setup() + MarlinHAL() {} + + static void init(); // Called early in setup() + static void init_board() {} // Called less early in setup() + static void reboot(); // Restart the firmware from 0x0 + + // Interrupts + static bool isr_state() { return !__get_PRIMASK(); } + static void isr_on() { sei(); } + static void isr_off() { cli(); } + + static void delay_ms(const int ms) { delay(ms); } + + // Tasks, called from idle() + static void idletask() {} + + // Reset + static uint8_t get_reset_source(); + static void clear_reset_source() {} + + // Free SRAM + static int freeMemory() { return ::freeMemory(); } + + // + // ADC Methods + // + + static uint16_t adc_result; + + // Called by Temperature::init once at startup + static void adc_init(); + + // Called by Temperature::init for each sensor at startup + static void adc_enable(const uint8_t ch) {} + + // Begin ADC sampling on the given channel + static void adc_start(const pin_t pin); + + // Is the ADC ready for reading? + static bool adc_ready() { return true; } + + // The current value of the ADC register + static uint16_t adc_value() { return adc_result; } + + /** + * Set the PWM duty cycle for the pin to the given value. + * No option to invert the duty cycle [default = false] + * No option to change the scale of the provided value to enable finer PWM duty control [default = 255] + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { + analogWrite(pin, v); + } + +private: + static void dma_init(); +}; diff --git a/Marlin/src/HAL/STM32/HAL.cpp b/Marlin/src/HAL/STM32/HAL.cpp index 0920a72ec1bc..324a78316a2d 100644 --- a/Marlin/src/HAL/STM32/HAL.cpp +++ b/Marlin/src/HAL/STM32/HAL.cpp @@ -53,16 +53,18 @@ // Public Variables // ------------------------ -uint16_t HAL_adc_result; +uint16_t MarlinHAL::adc_result; // ------------------------ // Public functions // ------------------------ -TERN_(POSTMORTEM_DEBUGGING, extern void install_min_serial()); +#if ENABLED(POSTMORTEM_DEBUGGING) + extern void install_min_serial(); +#endif // HAL initialization task -void HAL_init() { +void MarlinHAL::init() { // Ensure F_CPU is a constant expression. // If the compiler breaks here, it means that delay code that should compute at compile time will not work. // So better safe than sorry here. @@ -103,7 +105,7 @@ void HAL_init() { } // HAL idle task -void HAL_idletask() { +void MarlinHAL::idletask() { #if HAS_SHARED_MEDIA // Stm32duino currently doesn't have a "loop/idle" method CDC_resume_receive(); @@ -111,9 +113,9 @@ void HAL_idletask() { #endif } -void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } +void MarlinHAL::reboot() { NVIC_SystemReset(); } -uint8_t HAL_get_reset_source() { +uint8_t MarlinHAL::get_reset_source() { return #ifdef RCC_FLAG_IWDGRST // Some sources may not exist... RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) ? RST_WATCHDOG : @@ -137,24 +139,14 @@ uint8_t HAL_get_reset_source() { ; } -void HAL_reboot() { NVIC_SystemReset(); } - -void _delay_ms(const int delay_ms) { delay(delay_ms); } +void MarlinHAL::clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } extern "C" { extern unsigned int _ebss; // end of bss section } -// ------------------------ -// ADC -// ------------------------ - -// TODO: Make sure this doesn't cause any delay -void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); } -uint16_t HAL_adc_get_result() { return HAL_adc_result; } - // Reset the system to initiate a firmware flash -WEAK void flashFirmware(const int16_t) { HAL_reboot(); } +WEAK void flashFirmware(const int16_t) { hal.reboot(); } // Maple Compatibility volatile uint32_t systick_uptime_millis = 0; diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index 9429bb7e7ca7..f5e8c1187da7 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -44,9 +44,9 @@ #define CPU_ST7920_DELAY_2 40 #define CPU_ST7920_DELAY_3 340 -// -// Serial Ports -// +// ------------------------ +// Serial ports +// ------------------------ #ifdef USBCON #include #include "../../core/serial_hook.h" @@ -115,17 +115,14 @@ #define analogInputToDigitalPin(p) (p) #endif -#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END() if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() +// +// Interrupts +// +#define CRITICAL_SECTION_START() const bool irqon = !__get_PRIMASK(); __disable_irq() +#define CRITICAL_SECTION_END() if (irqon) __enable_irq() #define cli() __disable_irq() #define sei() __enable_irq() -// On AVR this is in math.h? -#define square(x) ((x)*(x)) - // ------------------------ // Types // ------------------------ @@ -136,43 +133,61 @@ typedef int16_t pin_t; #endif -#define HAL_SERVO_LIB libServo +class libServo; +typedef libServo hal_servo_t; #define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos() #define RESUME_SERVO_OUTPUT() libServo::resume_all_servos() // ------------------------ -// Public Variables +// ADC // ------------------------ -// result of last ADC conversion -extern uint16_t HAL_adc_result; +#ifdef ADC_RESOLUTION + #define HAL_ADC_RESOLUTION ADC_RESOLUTION +#else + #define HAL_ADC_RESOLUTION 12 +#endif -// ------------------------ -// Public functions -// ------------------------ +#define HAL_ADC_VREF 3.3 -// Memory related -#define __bss_end __bss_end__ +// +// Pin Mapping for M42, M43, M226 +// +#define GET_PIN_MAP_PIN(index) index +#define GET_PIN_MAP_INDEX(pin) pin +#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) -// Enable hooks into setup for HAL -void HAL_init(); -#define HAL_IDLETASK 1 -void HAL_idletask(); +#ifdef STM32F1xx + #define JTAG_DISABLE() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_JTAGDISABLE) + #define JTAGSWD_DISABLE() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_DISABLE) + #define JTAGSWD_RESET() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_RESET); // Reset: FULL SWD+JTAG +#endif -// Clear reset reason -void HAL_clear_reset_source(); +#define PLATFORM_M997_SUPPORT +void flashFirmware(const int16_t); -// Reset reason -uint8_t HAL_get_reset_source(); +// Maple Compatibility +typedef void (*systickCallback_t)(void); +void systick_attach_callback(systickCallback_t cb); +void HAL_SYSTICK_Callback(); -void HAL_reboot(); +extern volatile uint32_t systick_uptime_millis; + +#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment + +// ------------------------ +// Class Utilities +// ------------------------ -void _delay_ms(const int delay); +// Memory related +#define __bss_end __bss_end__ extern "C" char* _sbrk(int incr); #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic ignored "-Wunused-function" +#endif static inline int freeMemory() { volatile char top; @@ -181,62 +196,71 @@ static inline int freeMemory() { #pragma GCC diagnostic pop -// -// ADC -// +// ------------------------ +// MarlinHAL Class +// ------------------------ -#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) +class MarlinHAL { +public: -#ifdef ADC_RESOLUTION - #define HAL_ADC_RESOLUTION ADC_RESOLUTION -#else - #define HAL_ADC_RESOLUTION 12 -#endif + // Earliest possible init, before setup() + MarlinHAL() {} -#define HAL_ADC_VREF 3.3 -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_result -#define HAL_ADC_READY() true + static void init(); // Called early in setup() + static void init_board() {} // Called less early in setup() + static void reboot(); // Restart the firmware from 0x0 -inline void HAL_adc_init() { analogReadResolution(HAL_ADC_RESOLUTION); } + // Interrupts + static bool isr_state() { return !__get_PRIMASK(); } + static void isr_on() { sei(); } + static void isr_off() { cli(); } -void HAL_adc_start_conversion(const uint8_t adc_pin); + static void delay_ms(const int ms) { delay(ms); } -uint16_t HAL_adc_get_result(); + // Tasks, called from idle() + static void idletask(); -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) + // Reset + static uint8_t get_reset_source(); + static void clear_reset_source(); -#ifdef STM32F1xx - #define JTAG_DISABLE() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_JTAGDISABLE) - #define JTAGSWD_DISABLE() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_DISABLE) - #define JTAGSWD_RESET() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_RESET); // Reset: FULL SWD+JTAG -#endif + // Free SRAM + static int freeMemory() { return ::freeMemory(); } -#define PLATFORM_M997_SUPPORT -void flashFirmware(const int16_t); + // + // ADC Methods + // -// Maple Compatibility -typedef void (*systickCallback_t)(void); -void systick_attach_callback(systickCallback_t cb); -void HAL_SYSTICK_Callback(); + static uint16_t adc_result; -extern volatile uint32_t systick_uptime_millis; + // Called by Temperature::init once at startup + static void adc_init() { + analogReadResolution(HAL_ADC_RESOLUTION); + } -#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment + // Called by Temperature::init for each sensor at startup + static void adc_enable(const pin_t pin) { pinMode(pin, INPUT); } -/** - * set_pwm_frequency - * Set the frequency of the timer corresponding to the provided pin - * All Timer PWM pins run at the same frequency - */ -void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); + // Begin ADC sampling on the given channel + static void adc_start(const pin_t pin) { adc_result = analogRead(pin); } -/** - * set_pwm_duty - * Set the PWM duty cycle of the provided pin to the provided value - * Optionally allows inverting the duty cycle [default = false] - * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255] - */ -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); + // Is the ADC ready for reading? + static bool adc_ready() { return true; } + + // The current value of the ADC register + static uint16_t adc_value() { return adc_result; } + + /** + * Set the PWM duty cycle for the pin to the given value. + * Optionally invert the duty cycle [default = false] + * Optionally change the maximum size of the provided value to enable finer PWM duty control [default = 255] + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); + + /** + * Set the frequency of the timer for the given pin. + * All Timer PWM pins run at the same frequency. + */ + static void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); + +}; diff --git a/Marlin/src/HAL/STM32/HAL_SPI.cpp b/Marlin/src/HAL/STM32/HAL_SPI.cpp index 8ee476164785..40d320d5e822 100644 --- a/Marlin/src/HAL/STM32/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32/HAL_SPI.cpp @@ -102,9 +102,9 @@ static SPISettings spiConfig; // Soft SPI receive byte uint8_t spiRec() { - DISABLE_ISRS(); // No interrupts during byte receive + hal.isr_off(); // No interrupts during byte receive const uint8_t data = HAL_SPI_STM32_SpiTransfer_Mode_3(0xFF); - ENABLE_ISRS(); // Enable interrupts + hal.isr_on(); // Enable interrupts return data; } @@ -116,9 +116,9 @@ static SPISettings spiConfig; // Soft SPI send byte void spiSend(uint8_t data) { - DISABLE_ISRS(); // No interrupts during byte send + hal.isr_off(); // No interrupts during byte send HAL_SPI_STM32_SpiTransfer_Mode_3(data); // Don't care what is received - ENABLE_ISRS(); // Enable interrupts + hal.isr_on(); // Enable interrupts } // Soft SPI send block diff --git a/Marlin/src/HAL/STM32/eeprom_flash.cpp b/Marlin/src/HAL/STM32/eeprom_flash.cpp index 252b057362c9..7c8cc8dd21e1 100644 --- a/Marlin/src/HAL/STM32/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32/eeprom_flash.cpp @@ -174,9 +174,9 @@ bool PersistentStore::access_finish() { UNLOCK_FLASH(); TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT()); - DISABLE_ISRS(); + hal.isr_off(); status = HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError); - ENABLE_ISRS(); + hal.isr_on(); TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT()); if (status != HAL_OK) { DEBUG_ECHOLNPGM("HAL_FLASHEx_Erase=", status); @@ -229,9 +229,9 @@ bool PersistentStore::access_finish() { // output. Servo output still glitches with interrupts disabled, but recovers after the // erase. TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT()); - DISABLE_ISRS(); + hal.isr_off(); eeprom_buffer_flush(); - ENABLE_ISRS(); + hal.isr_on(); TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT()); eeprom_data_written = false; diff --git a/Marlin/src/HAL/STM32/fast_pwm.cpp b/Marlin/src/HAL/STM32/fast_pwm.cpp index 590c9dbe3da6..a0d8ecc612c2 100644 --- a/Marlin/src/HAL/STM32/fast_pwm.cpp +++ b/Marlin/src/HAL/STM32/fast_pwm.cpp @@ -29,7 +29,7 @@ // Array to support sticky frequency sets per timer static uint16_t timer_freq[TIMER_NUM]; -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { +void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { const uint16_t duty = invert ? v_size - v : v; if (PWM_PIN(pin)) { const PinName pin_name = digitalPinToPinName(pin); @@ -61,7 +61,7 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 } } -void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { +void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer const PinName pin_name = digitalPinToPinName(pin); TIM_TypeDef * const Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance diff --git a/Marlin/src/HAL/STM32/pinsDebug.h b/Marlin/src/HAL/STM32/pinsDebug.h index 73d850fc4313..a7f022a0b62d 100644 --- a/Marlin/src/HAL/STM32/pinsDebug.h +++ b/Marlin/src/HAL/STM32/pinsDebug.h @@ -115,7 +115,6 @@ const XrefInfo pin_xref[] PROGMEM = { #define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0) #define PRINT_PORT(ANUM) port_print(ANUM) #define DIGITAL_PIN_TO_ANALOG_PIN(ANUM) -1 // will report analog pin number in the print port routine -#define GET_PIN_MAP_PIN_M43(Index) pin_xref[Index].Ard_num // x is a variable used to search pin_array #define GET_ARRAY_IS_DIGITAL(x) ((bool) pin_array[x].is_digital) @@ -123,6 +122,11 @@ const XrefInfo pin_xref[] PROGMEM = { #define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0) #define MULTI_NAME_PAD 33 // space needed to be pretty if not first name assigned to a pin +// +// Pin Mapping for M43 +// +#define GET_PIN_MAP_PIN_M43(Index) pin_xref[Index].Ard_num + #ifndef M43_NEVER_TOUCH #define _M43_NEVER_TOUCH(Index) (Index >= 9 && Index <= 12) // SERIAL/USB pins: PA9(TX) PA10(RX) PA11(USB_DM) PA12(USB_DP) #ifdef KILL_PIN diff --git a/Marlin/src/HAL/STM32/timers.h b/Marlin/src/HAL/STM32/timers.h index aad543229e16..6828998198af 100644 --- a/Marlin/src/HAL/STM32/timers.h +++ b/Marlin/src/HAL/STM32/timers.h @@ -116,5 +116,5 @@ FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const ha } } -#define HAL_timer_isr_prologue(T) -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_prologue(T) NOOP +#define HAL_timer_isr_epilogue(T) NOOP diff --git a/Marlin/src/HAL/STM32F1/HAL.cpp b/Marlin/src/HAL/STM32F1/HAL.cpp index a0486da5b0b8..636dc742fcf5 100644 --- a/Marlin/src/HAL/STM32F1/HAL.cpp +++ b/Marlin/src/HAL/STM32F1/HAL.cpp @@ -79,7 +79,7 @@ #define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ // ------------------------ -// Public Variables +// Serial ports // ------------------------ #if defined(SERIAL_USB) && !HAS_SD_HOST_DRIVE @@ -112,74 +112,37 @@ #endif #endif -uint16_t HAL_adc_result; - // ------------------------ -// Private Variables +// ADC // ------------------------ -STM32ADC adc(ADC1); - -const uint8_t adc_pins[] = { - OPTITEM(HAS_TEMP_ADC_0, TEMP_0_PIN) - OPTITEM(HAS_TEMP_ADC_1, TEMP_1_PIN) - OPTITEM(HAS_TEMP_ADC_2, TEMP_2_PIN) - OPTITEM(HAS_TEMP_ADC_3, TEMP_3_PIN) - OPTITEM(HAS_TEMP_ADC_4, TEMP_4_PIN) - OPTITEM(HAS_TEMP_ADC_5, TEMP_5_PIN) - OPTITEM(HAS_TEMP_ADC_6, TEMP_6_PIN) - OPTITEM(HAS_TEMP_ADC_7, TEMP_7_PIN) - OPTITEM(HAS_HEATED_BED, TEMP_BED_PIN) - OPTITEM(HAS_TEMP_CHAMBER, TEMP_CHAMBER_PIN) - OPTITEM(HAS_TEMP_ADC_PROBE, TEMP_PROBE_PIN) - OPTITEM(HAS_TEMP_COOLER, TEMP_COOLER_PIN) - OPTITEM(HAS_TEMP_BOARD, TEMP_BOARD_PIN) - OPTITEM(FILAMENT_WIDTH_SENSOR, FILWIDTH_PIN) - OPTITEM(HAS_ADC_BUTTONS, ADC_KEYPAD_PIN) - OPTITEM(HAS_JOY_ADC_X, JOY_X_PIN) - OPTITEM(HAS_JOY_ADC_Y, JOY_Y_PIN) - OPTITEM(HAS_JOY_ADC_Z, JOY_Z_PIN) - OPTITEM(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN) - OPTITEM(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN) -}; -enum TempPinIndex : char { - OPTITEM(HAS_TEMP_ADC_0, TEMP_0) - OPTITEM(HAS_TEMP_ADC_1, TEMP_1) - OPTITEM(HAS_TEMP_ADC_2, TEMP_2) - OPTITEM(HAS_TEMP_ADC_3, TEMP_3) - OPTITEM(HAS_TEMP_ADC_4, TEMP_4) - OPTITEM(HAS_TEMP_ADC_5, TEMP_5) - OPTITEM(HAS_TEMP_ADC_6, TEMP_6) - OPTITEM(HAS_TEMP_ADC_7, TEMP_7) - OPTITEM(HAS_HEATED_BED, TEMP_BED) - OPTITEM(HAS_TEMP_CHAMBER, TEMP_CHAMBER) - OPTITEM(HAS_TEMP_ADC_PROBE, TEMP_PROBE) - OPTITEM(HAS_TEMP_COOLER, TEMP_COOLER) - OPTITEM(HAS_TEMP_BOARD, TEMP_BOARD) - OPTITEM(FILAMENT_WIDTH_SENSOR, FILWIDTH) - OPTITEM(HAS_ADC_BUTTONS, ADC_KEY) - OPTITEM(HAS_JOY_ADC_X, JOY_X) - OPTITEM(HAS_JOY_ADC_Y, JOY_Y) - OPTITEM(HAS_JOY_ADC_Z, JOY_Z) - OPTITEM(POWER_MONITOR_CURRENT, POWERMON_CURRENT) - OPTITEM(POWER_MONITOR_VOLTAGE, POWERMON_VOLTS) - ADC_PIN_COUNT -}; +// Watch out for recursion here! Our pin_t is signed, so pass through to Arduino -> analogRead(uint8_t) + +uint16_t analogRead(const pin_t pin) { + const bool is_analog = _GET_MODE(pin) == GPIO_INPUT_ANALOG; + return is_analog ? analogRead(uint8_t(pin)) : 0; +} + +// Wrapper to maple unprotected analogWrite +void analogWrite(const pin_t pin, int pwm_val8) { + if (PWM_PIN(pin)) analogWrite(uint8_t(pin), pwm_val8); +} -uint16_t HAL_adc_results[ADC_PIN_COUNT]; +uint16_t MarlinHAL::adc_result; // ------------------------ // Private functions // ------------------------ + static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); // only values 0..7 are used - reg_value = SCB->AIRCR; /* read old register configuration */ - reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); /* clear bits to change */ + reg_value = SCB->AIRCR; // read old register configuration + reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); // clear bits to change reg_value = (reg_value | ((uint32_t)0x5FA << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8)); /* Insert write key & priority group */ + (PriorityGroupTmp << 8)); // Insert write key & priority group SCB->AIRCR = reg_value; } @@ -187,6 +150,8 @@ static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { // Public functions // ------------------------ +void flashFirmware(const int16_t) { hal.reboot(); } + // // Leave PA11/PA12 intact if USBSerial is not used // @@ -206,7 +171,11 @@ static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { TERN_(POSTMORTEM_DEBUGGING, extern void install_min_serial()); -void HAL_init() { +// ------------------------ +// MarlinHAL class +// ------------------------ + +void MarlinHAL::init() { NVIC_SetPriorityGrouping(0x3); #if PIN_EXISTS(LED) OUT_WRITE(LED_PIN, LOW); @@ -225,7 +194,7 @@ void HAL_init() { } // HAL idle task -void HAL_idletask() { +void MarlinHAL::idletask() { #if HAS_SHARED_MEDIA // If Marlin is using the SD card we need to lock it to prevent access from // a PC via USB. @@ -240,14 +209,7 @@ void HAL_idletask() { #endif } -void HAL_clear_reset_source() { } - -/** - * TODO: Check this and change or remove. - */ -uint8_t HAL_get_reset_source() { return RST_POWER_ON; } - -void _delay_ms(const int delay_ms) { delay(delay_ms); } +void MarlinHAL::reboot() { nvic_sys_reset(); } extern "C" { extern unsigned int _ebss; // end of bss section @@ -281,31 +243,76 @@ extern "C" { } */ -// ------------------------ +// // ADC -// ------------------------ +// + +enum ADCIndex : uint8_t { + OPTITEM(HAS_TEMP_ADC_0, TEMP_0) + OPTITEM(HAS_TEMP_ADC_1, TEMP_1) + OPTITEM(HAS_TEMP_ADC_2, TEMP_2) + OPTITEM(HAS_TEMP_ADC_3, TEMP_3) + OPTITEM(HAS_TEMP_ADC_4, TEMP_4) + OPTITEM(HAS_TEMP_ADC_5, TEMP_5) + OPTITEM(HAS_TEMP_ADC_6, TEMP_6) + OPTITEM(HAS_TEMP_ADC_7, TEMP_7) + OPTITEM(HAS_HEATED_BED, TEMP_BED) + OPTITEM(HAS_TEMP_CHAMBER, TEMP_CHAMBER) + OPTITEM(HAS_TEMP_ADC_PROBE, TEMP_PROBE) + OPTITEM(HAS_TEMP_COOLER, TEMP_COOLER) + OPTITEM(HAS_TEMP_BOARD, TEMP_BOARD) + OPTITEM(FILAMENT_WIDTH_SENSOR, FILWIDTH) + OPTITEM(HAS_ADC_BUTTONS, ADC_KEY) + OPTITEM(HAS_JOY_ADC_X, JOY_X) + OPTITEM(HAS_JOY_ADC_Y, JOY_Y) + OPTITEM(HAS_JOY_ADC_Z, JOY_Z) + OPTITEM(POWER_MONITOR_CURRENT, POWERMON_CURRENT) + OPTITEM(POWER_MONITOR_VOLTAGE, POWERMON_VOLTS) + ADC_COUNT +}; + +static uint16_t adc_results[ADC_COUNT]; + // Init the AD in continuous capture mode -void HAL_adc_init() { +void MarlinHAL::adc_init() { + static const uint8_t adc_pins[] = { + OPTITEM(HAS_TEMP_ADC_0, TEMP_0_PIN) + OPTITEM(HAS_TEMP_ADC_1, TEMP_1_PIN) + OPTITEM(HAS_TEMP_ADC_2, TEMP_2_PIN) + OPTITEM(HAS_TEMP_ADC_3, TEMP_3_PIN) + OPTITEM(HAS_TEMP_ADC_4, TEMP_4_PIN) + OPTITEM(HAS_TEMP_ADC_5, TEMP_5_PIN) + OPTITEM(HAS_TEMP_ADC_6, TEMP_6_PIN) + OPTITEM(HAS_TEMP_ADC_7, TEMP_7_PIN) + OPTITEM(HAS_HEATED_BED, TEMP_BED_PIN) + OPTITEM(HAS_TEMP_CHAMBER, TEMP_CHAMBER_PIN) + OPTITEM(HAS_TEMP_ADC_PROBE, TEMP_PROBE_PIN) + OPTITEM(HAS_TEMP_COOLER, TEMP_COOLER_PIN) + OPTITEM(HAS_TEMP_BOARD, TEMP_BOARD_PIN) + OPTITEM(FILAMENT_WIDTH_SENSOR, FILWIDTH_PIN) + OPTITEM(HAS_ADC_BUTTONS, ADC_KEYPAD_PIN) + OPTITEM(HAS_JOY_ADC_X, JOY_X_PIN) + OPTITEM(HAS_JOY_ADC_Y, JOY_Y_PIN) + OPTITEM(HAS_JOY_ADC_Z, JOY_Z_PIN) + OPTITEM(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN) + OPTITEM(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN) + }; + static STM32ADC adc(ADC1); // configure the ADC adc.calibrate(); - #if F_CPU > 72000000 - adc.setSampleRate(ADC_SMPR_71_5); // 71.5 ADC cycles - #else - adc.setSampleRate(ADC_SMPR_41_5); // 41.5 ADC cycles - #endif - adc.setPins((uint8_t *)adc_pins, ADC_PIN_COUNT); - adc.setDMA(HAL_adc_results, (uint16_t)ADC_PIN_COUNT, (uint32_t)(DMA_MINC_MODE | DMA_CIRC_MODE), nullptr); + adc.setSampleRate((F_CPU > 72000000) ? ADC_SMPR_71_5 : ADC_SMPR_41_5); // 71.5 or 41.5 ADC cycles + adc.setPins((uint8_t *)adc_pins, ADC_COUNT); + adc.setDMA(adc_results, uint16_t(ADC_COUNT), uint32_t(DMA_MINC_MODE | DMA_CIRC_MODE), nullptr); adc.setScanMode(); adc.setContinuous(); adc.startConversion(); } -void HAL_adc_start_conversion(const uint8_t adc_pin) { +void MarlinHAL::adc_start(const pin_t pin) { #define __TCASE(N,I) case N: pin_index = I; break; #define _TCASE(C,N,I) TERN_(C, __TCASE(N, I)) - //TEMP_PINS pin_index; - TempPinIndex pin_index; - switch (adc_pin) { + ADCIndex pin_index; + switch (pin) { default: return; _TCASE(HAS_TEMP_ADC_0, TEMP_0_PIN, TEMP_0) _TCASE(HAS_TEMP_ADC_1, TEMP_1_PIN, TEMP_1) @@ -328,23 +335,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { _TCASE(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN, POWERMON_CURRENT) _TCASE(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN, POWERMON_VOLTS) } - HAL_adc_result = HAL_adc_results[(int)pin_index] >> (12 - HAL_ADC_RESOLUTION); // shift out unused bits -} - -uint16_t HAL_adc_get_result() { return HAL_adc_result; } - -uint16_t analogRead(pin_t pin) { - const bool is_analog = _GET_MODE(pin) == GPIO_INPUT_ANALOG; - return is_analog ? analogRead(uint8_t(pin)) : 0; -} - -// Wrapper to maple unprotected analogWrite -void analogWrite(pin_t pin, int pwm_val8) { - if (PWM_PIN(pin)) analogWrite(uint8_t(pin), pwm_val8); + adc_result = (adc_results[(int)pin_index] & 0xFFF) >> (12 - HAL_ADC_RESOLUTION); // shift out unused bits } -void HAL_reboot() { nvic_sys_reset(); } - -void flashFirmware(const int16_t) { HAL_reboot(); } - #endif // __STM32F1__ diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index a766babe155b..ceb17b48848b 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -66,6 +66,10 @@ #endif #endif +// ------------------------ +// Serial ports +// ------------------------ + #ifdef SERIAL_USB typedef ForwardSerial1Class< USBSerial > DefaultSerial1; extern DefaultSerial1 MSerial0; @@ -141,11 +145,6 @@ #endif #endif -// Set interrupt grouping for this MCU -void HAL_init(); -#define HAL_IDLETASK 1 -void HAL_idletask(); - /** * TODO: review this to return 1 for pins that are not analog input */ @@ -158,15 +157,7 @@ void HAL_idletask(); #define NO_COMPILE_TIME_PWM #endif -#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); (void)__iCliRetVal() -#define CRITICAL_SECTION_END() if (!primask) (void)__iSeiRetVal() -#define ISRS_ENABLED() (!__get_primask()) -#define ENABLE_ISRS() ((void)__iSeiRetVal()) -#define DISABLE_ISRS() ((void)__iCliRetVal()) - -// On AVR this is in math.h? -#define square(x) ((x)*(x)) - +// Reset Reason #define RST_POWER_ON 1 #define RST_EXTERNAL 2 #define RST_BROWN_OUT 4 @@ -182,46 +173,63 @@ void HAL_idletask(); typedef int8_t pin_t; // ------------------------ -// Public Variables +// Interrupts // ------------------------ -// Result of last ADC conversion -extern uint16_t HAL_adc_result; +#define CRITICAL_SECTION_START() const bool irqon = !__get_primask(); (void)__iCliRetVal() +#define CRITICAL_SECTION_END() if (!irqon) (void)__iSeiRetVal() +#define cli() noInterrupts() +#define sei() interrupts() // ------------------------ -// Public functions +// ADC // ------------------------ -// Disable interrupts -#define cli() noInterrupts() +#ifdef ADC_RESOLUTION + #define HAL_ADC_RESOLUTION ADC_RESOLUTION +#else + #define HAL_ADC_RESOLUTION 12 +#endif -// Enable interrupts -#define sei() interrupts() +#define HAL_ADC_VREF 3.3 -// Memory related -#define __bss_end __bss_end__ +uint16_t analogRead(const pin_t pin); // need hal.adc_enable() first +void analogWrite(const pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!? -// Clear reset reason -void HAL_clear_reset_source(); +// +// Pin Mapping for M42, M43, M226 +// +#define GET_PIN_MAP_PIN(index) index +#define GET_PIN_MAP_INDEX(pin) pin +#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) -// Reset reason -uint8_t HAL_get_reset_source(); +#define JTAG_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY) +#define JTAGSWD_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_NONE) -void HAL_reboot(); +#define PLATFORM_M997_SUPPORT +void flashFirmware(const int16_t); -void _delay_ms(const int delay); +#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment +#ifndef PWM_FREQUENCY + #define PWM_FREQUENCY 1000 // Default PWM Frequency +#endif -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" +// ------------------------ +// Class Utilities +// ------------------------ -/* -extern "C" { - int freeMemory(); -} -*/ +// Memory related +#define __bss_end __bss_end__ + +void _delay_ms(const int ms); extern "C" char* _sbrk(int incr); +#pragma GCC diagnostic push +#if GCC_VERSION <= 50000 + #pragma GCC diagnostic ignored "-Wunused-function" +#endif + static inline int freeMemory() { volatile char top; return &top - _sbrk(0); @@ -229,58 +237,70 @@ static inline int freeMemory() { #pragma GCC diagnostic pop -// -// ADC -// +// ------------------------ +// MarlinHAL Class +// ------------------------ -#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT_ANALOG); +class MarlinHAL { +public: -void HAL_adc_init(); + // Earliest possible init, before setup() + MarlinHAL() {} -#ifdef ADC_RESOLUTION - #define HAL_ADC_RESOLUTION ADC_RESOLUTION -#else - #define HAL_ADC_RESOLUTION 12 -#endif + static void init(); // Called early in setup() + static void init_board() {} // Called less early in setup() + static void reboot(); // Restart the firmware from 0x0 -#define HAL_ADC_VREF 3.3 -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_result -#define HAL_ADC_READY() true + // Interrupts + static bool isr_state() { return !__get_primask(); } + static void isr_on() { ((void)__iSeiRetVal()); } + static void isr_off() { ((void)__iCliRetVal()); } -void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(); + static void delay_ms(const int ms) { delay(ms); } -uint16_t analogRead(pin_t pin); // need HAL_ANALOG_SELECT() first -void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!? + // Tasks, called from idle() + static void idletask(); -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) + // Reset + static uint8_t get_reset_source() { return RST_POWER_ON; } + static void clear_reset_source() {} -#define JTAG_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY) -#define JTAGSWD_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_NONE) + // Free SRAM + static int freeMemory() { return ::freeMemory(); } -#define PLATFORM_M997_SUPPORT -void flashFirmware(const int16_t); + // + // ADC Methods + // -#ifndef PWM_FREQUENCY - #define PWM_FREQUENCY 1000 // Default PWM Frequency -#endif -#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment + static uint16_t adc_result; -/** - * set_pwm_frequency - * Set the frequency of the timer corresponding to the provided pin - * All Timer PWM pins run at the same frequency - */ -void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); + // Called by Temperature::init once at startup + static void adc_init(); -/** - * set_pwm_duty - * Set the PWM duty cycle of the provided pin to the provided value - * Optionally allows inverting the duty cycle [default = false] - * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255] - * The timer must be pre-configured with set_pwm_frequency() if the default frequency is not desired. - */ -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); + // Called by Temperature::init for each sensor at startup + static void adc_enable(const pin_t pin) { pinMode(pin, INPUT_ANALOG); } + + // Begin ADC sampling on the given channel + static void adc_start(const pin_t pin); + + // Is the ADC ready for reading? + static bool adc_ready() { return true; } + + // The current value of the ADC register + static uint16_t adc_value() { return adc_result; } + + /** + * Set the PWM duty cycle for the pin to the given value. + * Optionally invert the duty cycle [default = false] + * Optionally change the maximum size of the provided value to enable finer PWM duty control [default = 255] + * The timer must be pre-configured with set_pwm_frequency() if the default frequency is not desired. + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false); + + /** + * Set the frequency of the timer for the given pin. + * All Timer PWM pins run at the same frequency. + */ + static void set_pwm_frequency(const pin_t pin, const uint16_t f_desired); + +}; diff --git a/Marlin/src/HAL/STM32F1/SPI.cpp b/Marlin/src/HAL/STM32F1/SPI.cpp index 8bfa3d236a7c..1ce2c7d3fd5d 100644 --- a/Marlin/src/HAL/STM32F1/SPI.cpp +++ b/Marlin/src/HAL/STM32F1/SPI.cpp @@ -91,6 +91,14 @@ static const spi_pins board_spi_pins[] __FLASH__ = { static void *_spi3_this; #endif +/** + * @brief Wait until TXE (tx empty) flag is set and BSY (busy) flag unset. + */ +static inline void waitSpiTxEnd(spi_dev *spi_d) { + while (spi_is_tx_empty(spi_d) == 0) { /* nada */ } // wait until TXE=1 + while (spi_is_busy(spi_d) != 0) { /* nada */ } // wait until BSY=0 +} + /** * Constructor */ diff --git a/Marlin/src/HAL/STM32F1/SPI.h b/Marlin/src/HAL/STM32F1/SPI.h index 92f42263014a..13f4d5ed6cfe 100644 --- a/Marlin/src/HAL/STM32F1/SPI.h +++ b/Marlin/src/HAL/STM32F1/SPI.h @@ -414,12 +414,4 @@ class SPIClass { */ }; -/** - * @brief Wait until TXE (tx empty) flag is set and BSY (busy) flag unset. - */ -static void waitSpiTxEnd(spi_dev *spi_d) { - while (spi_is_tx_empty(spi_d) == 0) { /* nada */ } // wait until TXE=1 - while (spi_is_busy(spi_d) != 0) { /* nada */ } // wait until BSY=0 -} - extern SPIClass SPI; diff --git a/Marlin/src/HAL/STM32F1/Servo.h b/Marlin/src/HAL/STM32F1/Servo.h index b6143de81d62..745a1c93f07d 100644 --- a/Marlin/src/HAL/STM32F1/Servo.h +++ b/Marlin/src/HAL/STM32F1/Servo.h @@ -35,7 +35,8 @@ #define SERVO_DEFAULT_MIN_ANGLE 0 #define SERVO_DEFAULT_MAX_ANGLE 180 -#define HAL_SERVO_LIB libServo +class libServo; +typedef libServo hal_servo_t; class libServo { public: diff --git a/Marlin/src/HAL/STM32F1/fast_pwm.cpp b/Marlin/src/HAL/STM32F1/fast_pwm.cpp index 13411d9af084..297804a3ac42 100644 --- a/Marlin/src/HAL/STM32F1/fast_pwm.cpp +++ b/Marlin/src/HAL/STM32F1/fast_pwm.cpp @@ -21,11 +21,9 @@ */ #ifdef __STM32F1__ -#include "../../inc/MarlinConfigPre.h" +#include "../../inc/MarlinConfig.h" #include -#include "HAL.h" -#include "timers.h" #define NR_TIMERS TERN(STM32_XL_DENSITY, 14, 8) // Maple timers, 14 for STM32_XL_DENSITY (F/G chips), 8 for HIGH density (C D E) @@ -38,7 +36,7 @@ inline uint8_t timer_and_index_for_pin(const pin_t pin, timer_dev **timer_ptr) { return 0; } -void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { +void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) { const uint16_t duty = invert ? v_size - v : v; if (PWM_PIN(pin)) { timer_dev *timer; UNUSED(timer); @@ -54,7 +52,7 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255 } } -void set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { +void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) { if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer timer_dev *timer; UNUSED(timer); diff --git a/Marlin/src/HAL/STM32F1/timers.h b/Marlin/src/HAL/STM32F1/timers.h index f9ab6d13d374..0cd807fc8479 100644 --- a/Marlin/src/HAL/STM32F1/timers.h +++ b/Marlin/src/HAL/STM32F1/timers.h @@ -188,7 +188,7 @@ FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) { } } -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_epilogue(T) NOOP // No command is available in framework to turn off ARPE bit, which is turned on by default in libmaple. // Needed here to reset ARPE=0 for stepper timer diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.cpp b/Marlin/src/HAL/TEENSY31_32/HAL.cpp index f08cf799e9e8..b923ab77b1f1 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL.cpp @@ -31,6 +31,10 @@ #include +// ------------------------ +// Serial ports +// ------------------------ + #define _IMPLEMENT_SERIAL(X) DefaultSerial##X MSerial##X(false, Serial##X) #define IMPLEMENT_SERIAL(X) _IMPLEMENT_SERIAL(X) #if WITHIN(SERIAL_PORT, 0, 3) @@ -40,33 +44,32 @@ #endif USBSerialType USBSerial(false, SerialUSB); -uint16_t HAL_adc_result; - -static const uint8_t pin2sc1a[] = { - 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 0, 19, 3, 31, // 0-13, we treat them as A0-A13 - 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, // 14-23 (A0-A9) - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, // 24-33 - 0+64, 19+64, 3+64, 31+64, // 34-37 (A10-A13) - 26, 22, 23, 27, 29, 30 // 38-43: temp. sensor, VREF_OUT, A14, bandgap, VREFH, VREFL. A14 isn't connected to anything in Teensy 3.0. -}; - -/* - // disable interrupts - void cli() { noInterrupts(); } +// ------------------------ +// Class Utilities +// ------------------------ - // enable interrupts - void sei() { interrupts(); } -*/ +extern "C" { + extern char __bss_end; + extern char __heap_start; + extern void* __brkval; -void HAL_adc_init() { - analog_init(); - while (ADC0_SC3 & ADC_SC3_CAL) {}; // Wait for calibration to finish - NVIC_ENABLE_IRQ(IRQ_FTM1); + int freeMemory() { + int free_memory; + if ((int)__brkval == 0) + free_memory = ((int)&free_memory) - ((int)&__bss_end); + else + free_memory = ((int)&free_memory) - ((int)__brkval); + return free_memory; + } } -void HAL_clear_reset_source() { } +// ------------------------ +// MarlinHAL Class +// ------------------------ -uint8_t HAL_get_reset_source() { +void MarlinHAL::reboot() { _reboot_Teensyduino_(); } + +uint8_t MarlinHAL::get_reset_source() { switch (RCM_SRS0) { case 128: return RST_POWER_ON; break; case 64: return RST_EXTERNAL; break; @@ -78,25 +81,25 @@ uint8_t HAL_get_reset_source() { return 0; } -void HAL_reboot() { _reboot_Teensyduino_(); } +// ADC -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; - - int freeMemory() { - int free_memory; - if ((int)__brkval == 0) - free_memory = ((int)&free_memory) - ((int)&__bss_end); - else - free_memory = ((int)&free_memory) - ((int)__brkval); - return free_memory; - } +void MarlinHAL::adc_init() { + analog_init(); + while (ADC0_SC3 & ADC_SC3_CAL) {}; // Wait for calibration to finish + NVIC_ENABLE_IRQ(IRQ_FTM1); } -void HAL_adc_start_conversion(const uint8_t adc_pin) { ADC0_SC1A = pin2sc1a[adc_pin]; } +void MarlinHAL::adc_start(const pin_t pin) { + static const uint8_t pin2sc1a[] = { + 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 0, 19, 3, 31, // 0-13, we treat them as A0-A13 + 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, // 14-23 (A0-A9) + 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, // 24-33 + 0+64, 19+64, 3+64, 31+64, // 34-37 (A10-A13) + 26, 22, 23, 27, 29, 30 // 38-43: temp. sensor, VREF_OUT, A14, bandgap, VREFH, VREFL. A14 isn't connected to anything in Teensy 3.0. + }; + ADC0_SC1A = pin2sc1a[pin]; +} -uint16_t HAL_adc_get_result() { return ADC0_RA; } +uint16_t MarlinHAL::adc_value() { return ADC0_RA; } #endif // __MK20DX256__ diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.h b/Marlin/src/HAL/TEENSY31_32/HAL.h index 61d8b34604c5..50c0f411cf92 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/TEENSY31_32/HAL.h @@ -36,12 +36,9 @@ #include -#define CPU_ST7920_DELAY_1 600 -#define CPU_ST7920_DELAY_2 750 -#define CPU_ST7920_DELAY_3 750 - -//#undef MOTHERBOARD -//#define MOTHERBOARD BOARD_TEENSY31_32 +// ------------------------ +// Defines +// ------------------------ #define IS_32BIT_TEENSY 1 #define IS_TEENSY_31_32 1 @@ -49,6 +46,14 @@ #define IS_TEENSY32 1 #endif +#define CPU_ST7920_DELAY_1 600 +#define CPU_ST7920_DELAY_2 750 +#define CPU_ST7920_DELAY_3 750 + +// ------------------------ +// Serial ports +// ------------------------ + #include "../../core/serial_hook.h" #define Serial0 Serial @@ -72,31 +77,44 @@ extern USBSerialType USBSerial; #error "The required SERIAL_PORT must be from 0 to 3, or -1 for Native USB." #endif -#define HAL_SERVO_LIB libServo +// ------------------------ +// Types +// ------------------------ + +class libServo; +typedef libServo hal_servo_t; typedef int8_t pin_t; -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1) -#endif +// ------------------------ +// Interrupts +// ------------------------ -#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END() if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() +uint32_t __get_PRIMASK(void); // CMSIS +#define CRITICAL_SECTION_START() const bool irqon = !__get_PRIMASK(); __disable_irq() +#define CRITICAL_SECTION_END() if (irqon) __enable_irq() -inline void HAL_init() {} +// ------------------------ +// ADC +// ------------------------ -// Clear the reset reason -void HAL_clear_reset_source(); +#ifndef analogInputToDigitalPin + #define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1) +#endif -// Get the reason for the reset -uint8_t HAL_get_reset_source(); +#define HAL_ADC_VREF 3.3 +#define HAL_ADC_RESOLUTION 10 -void HAL_reboot(); +// +// Pin Mapping for M42, M43, M226 +// +#define GET_PIN_MAP_PIN(index) index +#define GET_PIN_MAP_INDEX(pin) pin +#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) -FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } +// ------------------------ +// Class Utilities +// ------------------------ #pragma GCC diagnostic push #if GCC_VERSION <= 50000 @@ -107,27 +125,63 @@ extern "C" int freeMemory(); #pragma GCC diagnostic pop -// ADC +// ------------------------ +// MarlinHAL Class +// ------------------------ -void HAL_adc_init(); +class MarlinHAL { +public: -#define HAL_ADC_VREF 3.3 -#define HAL_ADC_RESOLUTION 10 -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_get_result() -#define HAL_ADC_READY() true + // Earliest possible init, before setup() + MarlinHAL() {} -#define HAL_ANALOG_SELECT(pin) + static void init() {} // Called early in setup() + static void init_board() {} // Called less early in setup() + static void reboot(); // Restart the firmware from 0x0 -void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(); + // Interrupts + static bool isr_state() { return !__get_PRIMASK(); } + static void isr_on() { __enable_irq(); } + static void isr_off() { __disable_irq(); } -// PWM + static void delay_ms(const int ms) { delay(ms); } -inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); } + // Tasks, called from idle() + static void idletask() {} -// Pin Map + // Reset + static uint8_t get_reset_source(); + static void clear_reset_source() {} -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) + // Free SRAM + static int freeMemory() { return ::freeMemory(); } + + // + // ADC Methods + // + + // Called by Temperature::init once at startup + static void adc_init(); + + // Called by Temperature::init for each sensor at startup + static void adc_enable(const pin_t ch) {} + + // Begin ADC sampling on the given channel + static void adc_start(const pin_t ch); + + // Is the ADC ready for reading? + static bool adc_ready() { return true; } + + // The current value of the ADC register + static uint16_t adc_value(); + + /** + * Set the PWM duty cycle for the pin to the given value. + * No option to invert the duty cycle [default = false] + * No option to change the scale of the provided value to enable finer PWM duty control [default = 255] + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { + analogWrite(pin, v); + } + +}; diff --git a/Marlin/src/HAL/TEENSY31_32/timers.h b/Marlin/src/HAL/TEENSY31_32/timers.h index 3b073d63ab29..9fcbb6f232c9 100644 --- a/Marlin/src/HAL/TEENSY31_32/timers.h +++ b/Marlin/src/HAL/TEENSY31_32/timers.h @@ -110,4 +110,4 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num); bool HAL_timer_interrupt_enabled(const uint8_t timer_num); void HAL_timer_isr_prologue(const uint8_t timer_num); -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_epilogue(T) NOOP diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.cpp b/Marlin/src/HAL/TEENSY35_36/HAL.cpp index 046c00b56ed5..54a5ad385536 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL.cpp @@ -31,6 +31,10 @@ #include +// ------------------------ +// Serial ports +// ------------------------ + #define _IMPLEMENT_SERIAL(X) DefaultSerial##X MSerial##X(false, Serial##X) #define IMPLEMENT_SERIAL(X) _IMPLEMENT_SERIAL(X) #if WITHIN(SERIAL_PORT, 0, 3) @@ -39,42 +43,34 @@ USBSerialType USBSerial(false, SerialUSB); -uint16_t HAL_adc_result, HAL_adc_select; - -static const uint8_t pin2sc1a[] = { - 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 3, 19+128, 14+128, 15+128, // 0-13 -> A0-A13 - 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, // 14-23 are A0-A9 - 255, 255, 255, 255, 255, 255, 255, // 24-30 are digital only - 14+128, 15+128, 17, 18, 4+128, 5+128, 6+128, 7+128, 17+128, // 31-39 are A12-A20 - 255, 255, 255, 255, 255, 255, 255, 255, 255, // 40-48 are digital only - 10+128, 11+128, // 49-50 are A23-A24 - 255, 255, 255, 255, 255, 255, 255, // 51-57 are digital only - 255, 255, 255, 255, 255, 255, // 58-63 (sd card pins) are digital only - 3, 19+128, // 64-65 are A10-A11 - 23, 23+128,// 66-67 are A21-A22 (DAC pins) - 1, 1+128, // 68-69 are A25-A26 (unused USB host port on Teensy 3.5) - 26, // 70 is Temperature Sensor - 18+128 // 71 is Vref -}; - -/* - // disable interrupts - void cli() { noInterrupts(); } - - // enable interrupts - void sei() { interrupts(); } -*/ - -void HAL_adc_init() { - analog_init(); - while (ADC0_SC3 & ADC_SC3_CAL) {}; // Wait for calibration to finish - while (ADC1_SC3 & ADC_SC3_CAL) {}; // Wait for calibration to finish - NVIC_ENABLE_IRQ(IRQ_FTM1); +// ------------------------ +// Class Utilities +// ------------------------ + +extern "C" { + extern char __bss_end; + extern char __heap_start; + extern void* __brkval; + + int freeMemory() { + int free_memory; + if ((int)__brkval == 0) + free_memory = ((int)&free_memory) - ((int)&__bss_end); + else + free_memory = ((int)&free_memory) - ((int)__brkval); + return free_memory; + } } -void HAL_clear_reset_source() { } +// ------------------------ +// MarlinHAL Class +// ------------------------ -uint8_t HAL_get_reset_source() { +void MarlinHAL::reboot() { _reboot_Teensyduino_(); } + +// Reset + +uint8_t MarlinHAL::get_reset_source() { switch (RCM_SRS0) { case 128: return RST_POWER_ON; break; case 64: return RST_EXTERNAL; break; @@ -86,41 +82,49 @@ uint8_t HAL_get_reset_source() { return 0; } -void HAL_reboot() { _reboot_Teensyduino_(); } +// ADC -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; +int8_t MarlinHAL::adc_select; - int freeMemory() { - int free_memory; - if ((int)__brkval == 0) - free_memory = ((int)&free_memory) - ((int)&__bss_end); - else - free_memory = ((int)&free_memory) - ((int)__brkval); - return free_memory; - } +void MarlinHAL::adc_init() { + analog_init(); + while (ADC0_SC3 & ADC_SC3_CAL) { /* Wait for calibration to finish */ } + while (ADC1_SC3 & ADC_SC3_CAL) { /* Wait for calibration to finish */ } + NVIC_ENABLE_IRQ(IRQ_FTM1); } -void HAL_adc_start_conversion(const uint8_t adc_pin) { +void MarlinHAL::adc_start(const pin_t adc_pin) { + static const uint8_t pin2sc1a[] = { + 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 3, 19+128, 14+128, 15+128, // 0-13 -> A0-A13 + 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, // 14-23 are A0-A9 + 255, 255, 255, 255, 255, 255, 255, // 24-30 are digital only + 14+128, 15+128, 17, 18, 4+128, 5+128, 6+128, 7+128, 17+128, // 31-39 are A12-A20 + 255, 255, 255, 255, 255, 255, 255, 255, 255, // 40-48 are digital only + 10+128, 11+128, // 49-50 are A23-A24 + 255, 255, 255, 255, 255, 255, 255, // 51-57 are digital only + 255, 255, 255, 255, 255, 255, // 58-63 (sd card pins) are digital only + 3, 19+128, // 64-65 are A10-A11 + 23, 23+128,// 66-67 are A21-A22 (DAC pins) + 1, 1+128, // 68-69 are A25-A26 (unused USB host port on Teensy 3.5) + 26, // 70 is Temperature Sensor + 18+128 // 71 is Vref + }; const uint16_t pin = pin2sc1a[adc_pin]; if (pin == 0xFF) { - // Digital only - HAL_adc_select = -1; + adc_select = -1; // Digital only } else if (pin & 0x80) { - HAL_adc_select = 1; + adc_select = 1; ADC1_SC1A = pin & 0x7F; } else { - HAL_adc_select = 0; + adc_select = 0; ADC0_SC1A = pin; } } -uint16_t HAL_adc_get_result() { - switch (HAL_adc_select) { +uint16_t MarlinHAL::adc_value() { + switch (adc_select) { case 0: return ADC0_RA; case 1: return ADC1_RA; } diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.h b/Marlin/src/HAL/TEENSY35_36/HAL.h index 892eb2d3c5b8..e4c57f8d1e10 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/TEENSY35_36/HAL.h @@ -37,10 +37,6 @@ #include #include -#define CPU_ST7920_DELAY_1 600 -#define CPU_ST7920_DELAY_2 750 -#define CPU_ST7920_DELAY_3 750 - // ------------------------ // Defines // ------------------------ @@ -53,6 +49,17 @@ #define IS_TEENSY35 1 #endif +#define CPU_ST7920_DELAY_1 600 +#define CPU_ST7920_DELAY_2 750 +#define CPU_ST7920_DELAY_3 750 + +#undef sq +#define sq(x) ((x)*(x)) + +// ------------------------ +// Serial ports +// ------------------------ + #include "../../core/serial_hook.h" #define Serial0 Serial @@ -76,34 +83,43 @@ extern USBSerialType USBSerial; #error "SERIAL_PORT must be from 0 to 3, or -1 for Native USB." #endif -#define HAL_SERVO_LIB libServo +// ------------------------ +// Types +// ------------------------ -typedef int8_t pin_t; +class libServo; +typedef libServo hal_servo_t; -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1) -#endif +typedef int8_t pin_t; -#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); __disable_irq() -#define CRITICAL_SECTION_END() if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_primask()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() +// ------------------------ +// Interrupts +// ------------------------ -#undef sq -#define sq(x) ((x)*(x)) +#define CRITICAL_SECTION_START() const bool irqon = !__get_primask(); __disable_irq() +#define CRITICAL_SECTION_END() if (irqon) __enable_irq() -inline void HAL_init() {} +// ------------------------ +// ADC +// ------------------------ -// Clear reset reason -void HAL_clear_reset_source(); +#ifndef analogInputToDigitalPin + #define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1) +#endif -// Reset reason -uint8_t HAL_get_reset_source(); +#define HAL_ADC_VREF 3.3 +#define HAL_ADC_RESOLUTION 10 -void HAL_reboot(); +// +// Pin Mapping for M42, M43, M226 +// +#define GET_PIN_MAP_PIN(index) index +#define GET_PIN_MAP_INDEX(pin) pin +#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) -FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } +// ------------------------ +// Class Utilities +// ------------------------ #pragma GCC diagnostic push #if GCC_VERSION <= 50000 @@ -114,27 +130,65 @@ extern "C" int freeMemory(); #pragma GCC diagnostic pop -// ADC +// ------------------------ +// MarlinHAL Class +// ------------------------ -void HAL_adc_init(); +class MarlinHAL { +public: -#define HAL_ADC_VREF 3.3 -#define HAL_ADC_RESOLUTION 10 -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_get_result() -#define HAL_ADC_READY() true + // Earliest possible init, before setup() + MarlinHAL() {} -#define HAL_ANALOG_SELECT(pin) + static void init() {} // Called early in setup() + static void init_board() {} // Called less early in setup() + static void reboot(); // Restart the firmware from 0x0 -void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(); + // Interrupts + static bool isr_state() { return true; } + static void isr_on() { __enable_irq(); } + static void isr_off() { __disable_irq(); } -// PWM + static void delay_ms(const int ms) { delay(ms); } -inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); } + // Tasks, called from idle() + static void idletask() {} -// Pin Map + // Reset + static uint8_t get_reset_source(); + static void clear_reset_source() {} -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) + // Free SRAM + static int freeMemory() { return ::freeMemory(); } + + // + // ADC Methods + // + + static int8_t adc_select; + + // Called by Temperature::init once at startup + static void adc_init(); + + // Called by Temperature::init for each sensor at startup + static void adc_enable(const pin_t) {} + + // Begin ADC sampling on the given channel + static void adc_start(const pin_t pin); + + // Is the ADC ready for reading? + static bool adc_ready() { return true; } + + // The current value of the ADC register + static uint16_t adc_value(); + + /** + * Set the PWM duty cycle for the pin to the given value. + * No option to invert the duty cycle [default = false] + * No option to change the scale of the provided value to enable finer PWM duty control [default = 255] + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { + analogWrite(pin, v); + } + +}; diff --git a/Marlin/src/HAL/TEENSY35_36/timers.h b/Marlin/src/HAL/TEENSY35_36/timers.h index 6c342bbe0d25..8af79d73928e 100644 --- a/Marlin/src/HAL/TEENSY35_36/timers.h +++ b/Marlin/src/HAL/TEENSY35_36/timers.h @@ -109,4 +109,4 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num); bool HAL_timer_interrupt_enabled(const uint8_t timer_num); void HAL_timer_isr_prologue(const uint8_t timer_num); -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_epilogue(T) NOOP diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.cpp b/Marlin/src/HAL/TEENSY40_41/HAL.cpp index 270bee0dc9d4..68bd38f72ff8 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.cpp +++ b/Marlin/src/HAL/TEENSY40_41/HAL.cpp @@ -33,6 +33,10 @@ #include "timers.h" #include +// ------------------------ +// Serial ports +// ------------------------ + #define _IMPLEMENT_SERIAL(X) DefaultSerial##X MSerial##X(false, Serial##X) #define IMPLEMENT_SERIAL(X) _IMPLEMENT_SERIAL(X) #if WITHIN(SERIAL_PORT, 0, 3) @@ -40,75 +44,42 @@ #endif USBSerialType USBSerial(false, SerialUSB); -uint16_t HAL_adc_result, HAL_adc_select; - -static const uint8_t pin2sc1a[] = { - 0x07, // 0/A0 AD_B1_02 - 0x08, // 1/A1 AD_B1_03 - 0x0C, // 2/A2 AD_B1_07 - 0x0B, // 3/A3 AD_B1_06 - 0x06, // 4/A4 AD_B1_01 - 0x05, // 5/A5 AD_B1_00 - 0x0F, // 6/A6 AD_B1_10 - 0x00, // 7/A7 AD_B1_11 - 0x0D, // 8/A8 AD_B1_08 - 0x0E, // 9/A9 AD_B1_09 - 0x01, // 24/A10 AD_B0_12 - 0x02, // 25/A11 AD_B0_13 - 0x83, // 26/A12 AD_B1_14 - only on ADC2, 3 - 0x84, // 27/A13 AD_B1_15 - only on ADC2, 4 - 0x07, // 14/A0 AD_B1_02 - 0x08, // 15/A1 AD_B1_03 - 0x0C, // 16/A2 AD_B1_07 - 0x0B, // 17/A3 AD_B1_06 - 0x06, // 18/A4 AD_B1_01 - 0x05, // 19/A5 AD_B1_00 - 0x0F, // 20/A6 AD_B1_10 - 0x00, // 21/A7 AD_B1_11 - 0x0D, // 22/A8 AD_B1_08 - 0x0E, // 23/A9 AD_B1_09 - 0x01, // 24/A10 AD_B0_12 - 0x02, // 25/A11 AD_B0_13 - 0x83, // 26/A12 AD_B1_14 - only on ADC2, 3 - 0x84, // 27/A13 AD_B1_15 - only on ADC2, 4 - #ifdef ARDUINO_TEENSY41 - 0xFF, // 28 - 0xFF, // 29 - 0xFF, // 30 - 0xFF, // 31 - 0xFF, // 32 - 0xFF, // 33 - 0xFF, // 34 - 0xFF, // 35 - 0xFF, // 36 - 0xFF, // 37 - 0x81, // 38/A14 AD_B1_12 - only on ADC2, 1 - 0x82, // 39/A15 AD_B1_13 - only on ADC2, 2 - 0x09, // 40/A16 AD_B1_04 - 0x0A, // 41/A17 AD_B1_05 - #endif -}; - -/* -// disable interrupts -void cli() { noInterrupts(); } - -// enable interrupts -void sei() { interrupts(); } -*/ - -void HAL_adc_init() { - analog_init(); - while (ADC1_GC & ADC_GC_CAL) ; - while (ADC2_GC & ADC_GC_CAL) ; +// ------------------------ +// Class Utilities +// ------------------------ + +#define __bss_end _ebss + +extern "C" { + extern char __bss_end; + extern char __heap_start; + extern void* __brkval; + + // Doesn't work on Teensy 4.x + uint32_t freeMemory() { + uint32_t free_memory; + free_memory = ((uint32_t)&free_memory) - (((uint32_t)__brkval) ?: ((uint32_t)&__bss_end)); + return free_memory; + } } -void HAL_clear_reset_source() { - uint32_t reset_source = SRC_SRSR; - SRC_SRSR = reset_source; +// ------------------------ +// FastIO +// ------------------------ + +bool is_output(pin_t pin) { + const struct digital_pin_bitband_and_config_table_struct *p; + p = digital_pin_to_info_PGM + pin; + return (*(p->reg + 1) & p->mask); } -uint8_t HAL_get_reset_source() { +// ------------------------ +// MarlinHAL Class +// ------------------------ + +void MarlinHAL::reboot() { _reboot_Teensyduino_(); } + +uint8_t MarlinHAL::get_reset_source() { switch (SRC_SRSR & 0xFF) { case 1: return RST_POWER_ON; break; case 2: return RST_SOFTWARE; break; @@ -121,57 +92,92 @@ uint8_t HAL_get_reset_source() { return 0; } -void HAL_reboot() { _reboot_Teensyduino_(); } +void MarlinHAL::clear_reset_source() { + uint32_t reset_source = SRC_SRSR; + SRC_SRSR = reset_source; +} -#define __bss_end _ebss +// ADC -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; +int8_t MarlinHAL::adc_select; - // Doesn't work on Teensy 4.x - uint32_t freeMemory() { - uint32_t free_memory; - if ((uint32_t)__brkval == 0) - free_memory = ((uint32_t)&free_memory) - ((uint32_t)&__bss_end); - else - free_memory = ((uint32_t)&free_memory) - ((uint32_t)__brkval); - return free_memory; - } +void MarlinHAL::adc_init() { + analog_init(); + while (ADC1_GC & ADC_GC_CAL) { /* wait */ } + while (ADC2_GC & ADC_GC_CAL) { /* wait */ } } -void HAL_adc_start_conversion(const uint8_t adc_pin) { +void MarlinHAL::adc_start(const pin_t adc_pin) { + static const uint8_t pin2sc1a[] = { + 0x07, // 0/A0 AD_B1_02 + 0x08, // 1/A1 AD_B1_03 + 0x0C, // 2/A2 AD_B1_07 + 0x0B, // 3/A3 AD_B1_06 + 0x06, // 4/A4 AD_B1_01 + 0x05, // 5/A5 AD_B1_00 + 0x0F, // 6/A6 AD_B1_10 + 0x00, // 7/A7 AD_B1_11 + 0x0D, // 8/A8 AD_B1_08 + 0x0E, // 9/A9 AD_B1_09 + 0x01, // 24/A10 AD_B0_12 + 0x02, // 25/A11 AD_B0_13 + 0x83, // 26/A12 AD_B1_14 - only on ADC2, 3 + 0x84, // 27/A13 AD_B1_15 - only on ADC2, 4 + 0x07, // 14/A0 AD_B1_02 + 0x08, // 15/A1 AD_B1_03 + 0x0C, // 16/A2 AD_B1_07 + 0x0B, // 17/A3 AD_B1_06 + 0x06, // 18/A4 AD_B1_01 + 0x05, // 19/A5 AD_B1_00 + 0x0F, // 20/A6 AD_B1_10 + 0x00, // 21/A7 AD_B1_11 + 0x0D, // 22/A8 AD_B1_08 + 0x0E, // 23/A9 AD_B1_09 + 0x01, // 24/A10 AD_B0_12 + 0x02, // 25/A11 AD_B0_13 + 0x83, // 26/A12 AD_B1_14 - only on ADC2, 3 + 0x84, // 27/A13 AD_B1_15 - only on ADC2, 4 + #ifdef ARDUINO_TEENSY41 + 0xFF, // 28 + 0xFF, // 29 + 0xFF, // 30 + 0xFF, // 31 + 0xFF, // 32 + 0xFF, // 33 + 0xFF, // 34 + 0xFF, // 35 + 0xFF, // 36 + 0xFF, // 37 + 0x81, // 38/A14 AD_B1_12 - only on ADC2, 1 + 0x82, // 39/A15 AD_B1_13 - only on ADC2, 2 + 0x09, // 40/A16 AD_B1_04 + 0x0A, // 41/A17 AD_B1_05 + #endif + }; const uint16_t pin = pin2sc1a[adc_pin]; if (pin == 0xFF) { - HAL_adc_select = -1; // Digital only + adc_select = -1; // Digital only } else if (pin & 0x80) { - HAL_adc_select = 1; + adc_select = 1; ADC2_HC0 = pin & 0x7F; } else { - HAL_adc_select = 0; + adc_select = 0; ADC1_HC0 = pin; } } -uint16_t HAL_adc_get_result() { - switch (HAL_adc_select) { +uint16_t MarlinHAL::adc_value() { + switch (adc_select) { case 0: - while (!(ADC1_HS & ADC_HS_COCO0)) ; // wait + while (!(ADC1_HS & ADC_HS_COCO0)) { /* wait */ } return ADC1_R0; case 1: - while (!(ADC2_HS & ADC_HS_COCO0)) ; // wait + while (!(ADC2_HS & ADC_HS_COCO0)) { /* wait */ } return ADC2_R0; } return 0; } -bool is_output(pin_t pin) { - const struct digital_pin_bitband_and_config_table_struct *p; - p = digital_pin_to_info_PGM + pin; - return (*(p->reg + 1) & p->mask); -} - #endif // __IMXRT1062__ diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index 2b730768a802..a21e65285409 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -41,10 +41,6 @@ #include "../../feature/ethernet.h" #endif -#define CPU_ST7920_DELAY_1 600 -#define CPU_ST7920_DELAY_2 750 -#define CPU_ST7920_DELAY_3 750 - // ------------------------ // Defines // ------------------------ @@ -55,7 +51,23 @@ #define IS_TEENSY41 1 #endif +#define CPU_ST7920_DELAY_1 600 +#define CPU_ST7920_DELAY_2 750 +#define CPU_ST7920_DELAY_3 750 + +#undef sq +#define sq(x) ((x)*(x)) + +// Don't place string constants in PROGMEM +#undef PSTR +#define PSTR(str) ({static const char *data = (str); &data[0];}) + +// ------------------------ +// Serial ports +// ------------------------ + #include "../../core/serial_hook.h" + #define Serial0 Serial #define _DECLARE_SERIAL(X) \ typedef ForwardSerial1Class DefaultSerial##X; \ @@ -89,41 +101,47 @@ extern USBSerialType USBSerial; #endif #endif -#define HAL_SERVO_LIB libServo +// ------------------------ +// Types +// ------------------------ -typedef int8_t pin_t; +class libServo; +typedef libServo hal_servo_t; -#ifndef analogInputToDigitalPin - #define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1) -#endif +typedef int8_t pin_t; -#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); __disable_irq() -#define CRITICAL_SECTION_END() if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_primask()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() +// ------------------------ +// Interrupts +// ------------------------ -#undef sq -#define sq(x) ((x)*(x)) +#define CRITICAL_SECTION_START() const bool irqon = !__get_primask(); __disable_irq() +#define CRITICAL_SECTION_END() if (irqon) __enable_irq() -// Don't place string constants in PROGMEM -#undef PSTR -#define PSTR(str) ({static const char *data = (str); &data[0];}) +// ------------------------ +// ADC +// ------------------------ -// Enable hooks into idle and setup for HAL -#define HAL_IDLETASK 1 -FORCE_INLINE void HAL_idletask() {} -FORCE_INLINE void HAL_init() {} +#ifndef analogInputToDigitalPin + #define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1) +#endif -// Clear reset reason -void HAL_clear_reset_source(); +#define HAL_ADC_VREF 3.3 +#define HAL_ADC_RESOLUTION 10 +#define HAL_ADC_FILTERED // turn off ADC oversampling -// Reset reason -uint8_t HAL_get_reset_source(); +// +// Pin Mapping for M42, M43, M226 +// +#define GET_PIN_MAP_PIN(index) index +#define GET_PIN_MAP_INDEX(pin) pin +#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) -void HAL_reboot(); +// FastIO +bool is_output(pin_t pin); -FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } +// ------------------------ +// Class Utilities +// ------------------------ #pragma GCC diagnostic push #if GCC_VERSION <= 50000 @@ -134,30 +152,65 @@ extern "C" uint32_t freeMemory(); #pragma GCC diagnostic pop -// ADC +// ------------------------ +// MarlinHAL Class +// ------------------------ -void HAL_adc_init(); +class MarlinHAL { +public: -#define HAL_ADC_VREF 3.3 -#define HAL_ADC_RESOLUTION 10 -#define HAL_ADC_FILTERED // turn off ADC oversampling -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_get_result() -#define HAL_ADC_READY() true + // Earliest possible init, before setup() + MarlinHAL() {} -#define HAL_ANALOG_SELECT(pin) + static void init() {} // Called early in setup() + static void init_board() {} // Called less early in setup() + static void reboot(); // Restart the firmware from 0x0 -void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(); + // Interrupts + static bool isr_state() { return !__get_primask(); } + static void isr_on() { __enable_irq(); } + static void isr_off() { __disable_irq(); } -// PWM + static void delay_ms(const int ms) { delay(ms); } -inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); } + // Tasks, called from idle() + static void idletask() {} -// Pin Map + // Reset + static uint8_t get_reset_source(); + static void clear_reset_source(); -#define GET_PIN_MAP_PIN(index) index -#define GET_PIN_MAP_INDEX(pin) pin -#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) + // Free SRAM + static int freeMemory() { return ::freeMemory(); } -bool is_output(pin_t pin); + // + // ADC Methods + // + + static int8_t adc_select; + + // Called by Temperature::init once at startup + static void adc_init(); + + // Called by Temperature::init for each sensor at startup + static void adc_enable(const pin_t pin) {} + + // Begin ADC sampling on the given channel + static void adc_start(const pin_t pin); + + // Is the ADC ready for reading? + static bool adc_ready() { return true; } + + // The current value of the ADC register + static uint16_t adc_value(); + + /** + * Set the PWM duty cycle for the pin to the given value. + * No option to invert the duty cycle [default = false] + * No option to change the scale of the provided value to enable finer PWM duty control [default = 255] + */ + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { + analogWrite(pin, v); + } + +}; diff --git a/Marlin/src/HAL/TEENSY40_41/timers.h b/Marlin/src/HAL/TEENSY40_41/timers.h index 81cf67f7bc08..77fe0953d3bd 100644 --- a/Marlin/src/HAL/TEENSY40_41/timers.h +++ b/Marlin/src/HAL/TEENSY40_41/timers.h @@ -114,4 +114,4 @@ bool HAL_timer_interrupt_enabled(const uint8_t timer_num); void HAL_timer_isr_prologue(const uint8_t timer_num); //void HAL_timer_isr_epilogue(const uint8_t timer_num) {} -#define HAL_timer_isr_epilogue(T) +#define HAL_timer_isr_epilogue(T) NOOP diff --git a/Marlin/src/HAL/shared/HAL.cpp b/Marlin/src/HAL/shared/HAL.cpp new file mode 100644 index 000000000000..4d92aedd9a1f --- /dev/null +++ b/Marlin/src/HAL/shared/HAL.cpp @@ -0,0 +1,36 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * HAL/shared/HAL.cpp + */ + +#include "../../inc/MarlinConfig.h" + +MarlinHAL hal; + +#if ENABLED(SOFT_RESET_VIA_SERIAL) + + // Global for use by e_parser.h + void HAL_reboot() { hal.reboot(); } + +#endif diff --git a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp index bd85dbe7bd7e..5d4ce89b2748 100644 --- a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp +++ b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp @@ -92,9 +92,9 @@ uint8_t L64XX_Marlin::transfer_single(uint8_t data, int16_t ss_pin) { // First device in chain has data sent last extDigitalWrite(ss_pin, LOW); - DISABLE_ISRS(); // Disable interrupts during SPI transfer (can't allow partial command to chips) + hal.isr_off(); // Disable interrupts during SPI transfer (can't allow partial command to chips) const uint8_t data_out = L6470_SpiTransfer_Mode_3(data); - ENABLE_ISRS(); // Enable interrupts + hal.isr_on(); // Enable interrupts extDigitalWrite(ss_pin, HIGH); return data_out; @@ -107,9 +107,9 @@ uint8_t L64XX_Marlin::transfer_chain(uint8_t data, int16_t ss_pin, uint8_t chain extDigitalWrite(ss_pin, LOW); for (uint8_t i = L64XX::chain[0]; !L64xxManager.spi_abort && i >= 1; i--) { // Send data unless aborted - DISABLE_ISRS(); // Disable interrupts during SPI transfer (can't allow partial command to chips) + hal.isr_off(); // Disable interrupts during SPI transfer (can't allow partial command to chips) const uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP)); - ENABLE_ISRS(); // Enable interrupts + hal.isr_on(); // Enable interrupts if (i == chain_position) data_out = temp; } diff --git a/Marlin/src/HAL/shared/math_32bit.h b/Marlin/src/HAL/shared/math_32bit.h index 87e9e6406ee4..1fb233e3e896 100644 --- a/Marlin/src/HAL/shared/math_32bit.h +++ b/Marlin/src/HAL/shared/math_32bit.h @@ -26,6 +26,6 @@ /** * Math helper functions for 32 bit CPUs */ -static FORCE_INLINE uint32_t MultiU32X24toH32(uint32_t longIn1, uint32_t longIn2) { +FORCE_INLINE static uint32_t MultiU32X24toH32(uint32_t longIn1, uint32_t longIn2) { return ((uint64_t)longIn1 * longIn2 + 0x00800000) >> 24; } diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 02cf6d28d311..482ad95cac5a 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -790,7 +790,7 @@ void idle(bool no_stepper_sleep/*=false*/) { #endif // Run HAL idle tasks - TERN_(HAL_IDLETASK, HAL_idletask()); + hal.idletask(); // Check network connection TERN_(HAS_ETHERNET, ethernet.check()); @@ -929,7 +929,7 @@ void minkill(const bool steppers_off/*=false*/) { watchdog_refresh(); // Reboot the board - HAL_reboot(); + hal.reboot(); #else @@ -1041,7 +1041,7 @@ inline void tmc_standby_setup() { * • L64XX Stepper Drivers (SPI) * • Stepper Driver Reset: DISABLE * • TMC Stepper Drivers (SPI) - * • Run BOARD_INIT if defined + * • Run hal.init_board() for additional pins setup * • ESP WiFi * - Get the Reset Reason and report it * - Print startup messages and diagnostics @@ -1119,8 +1119,8 @@ void setup() { tmc_standby_setup(); // TMC Low Power Standby pins must be set early or they're not usable // Check startup - does nothing if bootloader sets MCUSR to 0 - const byte mcu = HAL_get_reset_source(); - HAL_clear_reset_source(); + const byte mcu = hal.get_reset_source(); + hal.clear_reset_source(); #if ENABLED(MARLIN_DEV_MODE) auto log_current_ms = [&](PGM_P const msg) { @@ -1181,23 +1181,20 @@ void setup() { JTAGSWD_RESET(); #endif - #if EITHER(DISABLE_DEBUG, DISABLE_JTAG) + // Disable any hardware debug to free up pins for IO + #if ENABLED(DISABLE_DEBUG) && defined(JTAGSWD_DISABLE) delay(10); - // Disable any hardware debug to free up pins for IO - #if ENABLED(DISABLE_DEBUG) && defined(JTAGSWD_DISABLE) - SETUP_LOG("JTAGSWD_DISABLE"); - JTAGSWD_DISABLE(); - #elif defined(JTAG_DISABLE) - SETUP_LOG("JTAG_DISABLE"); - JTAG_DISABLE(); - #else - #error "DISABLE_(DEBUG|JTAG) is not supported for the selected MCU/Board." - #endif + SETUP_LOG("JTAGSWD_DISABLE"); + JTAGSWD_DISABLE(); + #elif ENABLED(DISABLE_JTAG) && defined(JTAG_DISABLE) + delay(10); + SETUP_LOG("JTAG_DISABLE"); + JTAG_DISABLE(); #endif TERN_(DYNAMIC_VECTORTABLE, hook_cpu_exceptions()); // If supported, install Marlin exception handlers at runtime - SETUP_RUN(HAL_init()); + SETUP_RUN(hal.init()); // Init and disable SPI thermocouples; this is still needed #if TEMP_SENSOR_0_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E0)) @@ -1243,19 +1240,16 @@ void setup() { SETUP_RUN(tmc_init_cs_pins()); #endif - #ifdef BOARD_INIT - SETUP_LOG("BOARD_INIT"); - BOARD_INIT(); - #endif + SETUP_RUN(hal.init_board()); SETUP_RUN(esp_wifi_init()); // Report Reset Reason - if (mcu & RST_POWER_ON) SERIAL_ECHOLNPGM(STR_POWERUP); - if (mcu & RST_EXTERNAL) SERIAL_ECHOLNPGM(STR_EXTERNAL_RESET); + if (mcu & RST_POWER_ON) SERIAL_ECHOLNPGM(STR_POWERUP); + if (mcu & RST_EXTERNAL) SERIAL_ECHOLNPGM(STR_EXTERNAL_RESET); if (mcu & RST_BROWN_OUT) SERIAL_ECHOLNPGM(STR_BROWNOUT_RESET); - if (mcu & RST_WATCHDOG) SERIAL_ECHOLNPGM(STR_WATCHDOG_RESET); - if (mcu & RST_SOFTWARE) SERIAL_ECHOLNPGM(STR_SOFTWARE_RESET); + if (mcu & RST_WATCHDOG) SERIAL_ECHOLNPGM(STR_WATCHDOG_RESET); + if (mcu & RST_SOFTWARE) SERIAL_ECHOLNPGM(STR_SOFTWARE_RESET); // Identify myself as Marlin x.x.x SERIAL_ECHOLNPGM("Marlin " SHORT_BUILD_VERSION); @@ -1266,7 +1260,7 @@ void setup() { ); #endif SERIAL_ECHO_MSG(" Compiled: " __DATE__); - SERIAL_ECHO_MSG(STR_FREE_MEMORY, freeMemory(), STR_PLANNER_BUFFER_BYTES, sizeof(block_t) * (BLOCK_BUFFER_SIZE)); + SERIAL_ECHO_MSG(STR_FREE_MEMORY, hal.freeMemory(), STR_PLANNER_BUFFER_BYTES, sizeof(block_t) * (BLOCK_BUFFER_SIZE)); // Some HAL need precise delay adjustment calibrate_delay_loop(); @@ -1542,7 +1536,7 @@ void setup() { #endif #if ENABLED(USE_WATCHDOG) - SETUP_RUN(watchdog_init()); // Reinit watchdog after HAL_get_reset_source call + SETUP_RUN(watchdog_init()); // Reinit watchdog after hal.get_reset_source call #endif #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) diff --git a/Marlin/src/feature/caselight.cpp b/Marlin/src/feature/caselight.cpp index 57b2d0f83c61..eb580a6d6269 100644 --- a/Marlin/src/feature/caselight.cpp +++ b/Marlin/src/feature/caselight.cpp @@ -79,7 +79,7 @@ void CaseLight::update(const bool sflag) { #if CASELIGHT_USES_BRIGHTNESS if (pin_is_pwm()) - set_pwm_duty(pin_t(CASE_LIGHT_PIN), ( + hal.set_pwm_duty(pin_t(CASE_LIGHT_PIN), ( #if CASE_LIGHT_MAX_PWM == 255 n10ct #else diff --git a/Marlin/src/feature/controllerfan.cpp b/Marlin/src/feature/controllerfan.cpp index 59ba665e1114..f42bf52ae40a 100644 --- a/Marlin/src/feature/controllerfan.cpp +++ b/Marlin/src/feature/controllerfan.cpp @@ -76,7 +76,7 @@ void ControllerFan::update() { thermalManager.soft_pwm_controller_speed = speed; #else if (PWM_PIN(CONTROLLER_FAN_PIN)) - set_pwm_duty(pin_t(CONTROLLER_FAN_PIN), speed); + hal.set_pwm_duty(pin_t(CONTROLLER_FAN_PIN), speed); else WRITE(CONTROLLER_FAN_PIN, speed > 0); #endif diff --git a/Marlin/src/feature/e_parser.h b/Marlin/src/feature/e_parser.h index 1dee0cf7550c..fda1ba144bc4 100644 --- a/Marlin/src/feature/e_parser.h +++ b/Marlin/src/feature/e_parser.h @@ -41,7 +41,9 @@ extern bool wait_for_user, wait_for_heatup; void quickresume_stepper(); #endif -void HAL_reboot(); +#if ENABLED(SOFT_RESET_VIA_SERIAL) + void HAL_reboot(); +#endif class EmergencyParser { diff --git a/Marlin/src/feature/leds/leds.cpp b/Marlin/src/feature/leds/leds.cpp index 715f51f442c8..2a53a7c884e6 100644 --- a/Marlin/src/feature/leds/leds.cpp +++ b/Marlin/src/feature/leds/leds.cpp @@ -129,11 +129,11 @@ void LEDLights::set_color(const LEDColor &incol // This variant uses 3-4 separate pins for the RGB(W) components. // If the pins can do PWM then their intensity will be set. - #define _UPDATE_RGBW(C,c) do { \ - if (PWM_PIN(RGB_LED_##C##_PIN)) \ - set_pwm_duty(pin_t(RGB_LED_##C##_PIN), c); \ - else \ - WRITE(RGB_LED_##C##_PIN, c ? HIGH : LOW); \ + #define _UPDATE_RGBW(C,c) do { \ + if (PWM_PIN(RGB_LED_##C##_PIN)) \ + hal.set_pwm_duty(pin_t(RGB_LED_##C##_PIN), c); \ + else \ + WRITE(RGB_LED_##C##_PIN, c ? HIGH : LOW); \ }while(0) #define UPDATE_RGBW(C,c) _UPDATE_RGBW(C, TERN1(CASE_LIGHT_USE_RGB_LED, caselight.on) ? incol.c : 0) UPDATE_RGBW(R,r); UPDATE_RGBW(G,g); UPDATE_RGBW(B,b); diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index 9ca7cb948e69..52bb471b0f7e 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -66,10 +66,10 @@ void SpindleLaser::init() { #endif #if ENABLED(SPINDLE_LASER_USE_PWM) SET_PWM(SPINDLE_LASER_PWM_PIN); - set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Set to lowest speed + hal.set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Set to lowest speed #endif #if ENABLED(HAL_CAN_SET_PWM_FREQ) && SPINDLE_LASER_FREQUENCY - set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_FREQUENCY); + hal.set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_FREQUENCY); TERN_(MARLIN_DEV_MODE, frequency = SPINDLE_LASER_FREQUENCY); #endif #if ENABLED(AIR_EVACUATION) @@ -89,9 +89,9 @@ void SpindleLaser::init() { */ void SpindleLaser::_set_ocr(const uint8_t ocr) { #if ENABLED(HAL_CAN_SET_PWM_FREQ) && SPINDLE_LASER_FREQUENCY - set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), TERN(MARLIN_DEV_MODE, frequency, SPINDLE_LASER_FREQUENCY)); + hal.set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), TERN(MARLIN_DEV_MODE, frequency, SPINDLE_LASER_FREQUENCY)); #endif - set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); + hal.set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); } void SpindleLaser::set_ocr(const uint8_t ocr) { diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 89e11fca0851..e948d2d37b73 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -103,7 +103,7 @@ class SpindleLaser { static void init(); #if ENABLED(MARLIN_DEV_MODE) - static void refresh_frequency() { set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), frequency); } + static void refresh_frequency() { hal.set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), frequency); } #endif // Modifying this function should update everywhere diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index 8de3226924a6..1b3a29d10056 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -126,10 +126,10 @@ void GcodeSuite::M42() { extDigitalWrite(pin, pin_status); #ifdef ARDUINO_ARCH_STM32 - // A simple I/O will be set to 0 by set_pwm_duty() + // A simple I/O will be set to 0 by hal.set_pwm_duty() if (pin_status <= 1 && !PWM_PIN(pin)) return; #endif - set_pwm_duty(pin, pin_status); + hal.set_pwm_duty(pin, pin_status); } #endif // DIRECT_PIN_CONTROL diff --git a/Marlin/src/gcode/gcode_d.cpp b/Marlin/src/gcode/gcode_d.cpp index 204455e65ec6..2dd1de00013b 100644 --- a/Marlin/src/gcode/gcode_d.cpp +++ b/Marlin/src/gcode/gcode_d.cpp @@ -38,7 +38,7 @@ #include "../sd/cardreader.h" #include "../MarlinCore.h" // for kill -extern void dump_delay_accuracy_check(); +void dump_delay_accuracy_check(); /** * Dn: G-code for development and testing @@ -54,7 +54,7 @@ void GcodeSuite::D(const int16_t dcode) { for (;;) { /* loop forever (watchdog reset) */ } case 0: - HAL_reboot(); + hal.reboot(); break; case 10: @@ -74,7 +74,7 @@ void GcodeSuite::D(const int16_t dcode) { settings.reset(); settings.save(); #endif - HAL_reboot(); + hal.reboot(); } break; case 2: { // D2 Read / Write SRAM @@ -189,12 +189,12 @@ void GcodeSuite::D(const int16_t dcode) { SERIAL_ECHOLNPGM("(USE_WATCHDOG " TERN(USE_WATCHDOG, "ENABLED", "DISABLED") ")"); thermalManager.disable_all_heaters(); delay(1000); // Allow time to print - DISABLE_ISRS(); + hal.isr_off(); // Use a low-level delay that does not rely on interrupts to function // Do not spin forever, to avoid thermal risks if heaters are enabled and // watchdog does not work. for (int i = 10000; i--;) DELAY_US(1000UL); - ENABLE_ISRS(); + hal.isr_on(); SERIAL_ECHOLNPGM("FAILURE: Watchdog did not trigger board reset."); } break; diff --git a/Marlin/src/inc/MarlinConfig.h b/Marlin/src/inc/MarlinConfig.h index 8fdb4b9baeae..505a0682ebaa 100644 --- a/Marlin/src/inc/MarlinConfig.h +++ b/Marlin/src/inc/MarlinConfig.h @@ -29,6 +29,7 @@ #ifndef __MARLIN_DEPS__ #include "../HAL/HAL.h" + extern MarlinHAL hal; #endif #include "../pins/pins.h" diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 8f6843eee989..9c74ce32db82 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3891,3 +3891,10 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #undef _TEST_PWM #undef _LINEAR_AXES_STR #undef _LOGICAL_AXES_STR + +// JTAG support in the HAL +#if ENABLED(DISABLE_DEBUG) && !defined(JTAGSWD_DISABLE) + #error "DISABLE_DEBUG is not supported for the selected MCU/Board." +#elif ENABLED(DISABLE_JTAG) && !defined(JTAG_DISABLE) + #error "DISABLE_JTAG is not supported for the selected MCU/Board." +#endif diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index aafc4d880318..fc862e54398b 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -282,9 +282,9 @@ void MarlinUI::init_lcd() { #if PIN_EXISTS(LCD_RESET) // Perform a clean hardware reset with needed delays OUT_WRITE(LCD_RESET_PIN, LOW); - _delay_ms(5); + hal.delay_ms(5); WRITE(LCD_RESET_PIN, HIGH); - _delay_ms(5); + hal.delay_ms(5); u8g.begin(); #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 4d7f38171d0a..d65fa9ec7997 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -2206,7 +2206,7 @@ void RebootPrinter() { thermalManager.disable_all_heaters(); planner.finish_and_disable(); DWIN_RebootScreen(); - HAL_reboot(); + hal.reboot(); } void Goto_Info_Menu(){ diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index bce27dc88a15..3dd6d8aeb685 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -1348,7 +1348,7 @@ void Endstops::update() { ES_REPORT_CHANGE(K_MAX); #endif SERIAL_ECHOLNPGM("\n"); - set_pwm_duty(pin_t(LED_PIN), local_LED_status); + hal.set_pwm_duty(pin_t(LED_PIN), local_LED_status); local_LED_status ^= 255; old_live_state_local = live_state_local; } diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index f9ddcf8f13b5..d2e11f62fefe 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -703,7 +703,7 @@ void Planner::init() { // All other 32-bit MPUs can easily do inverse using hardware division, // so we don't need to reduce precision or to use assembly language at all. // This routine, for all other archs, returns 0x100000000 / d ~= 0xFFFFFFFF / d - static FORCE_INLINE uint32_t get_period_inverse(const uint32_t d) { + FORCE_INLINE static uint32_t get_period_inverse(const uint32_t d) { return d ? 0xFFFFFFFF / d : 0xFFFFFFFF; } #endif @@ -1260,7 +1260,7 @@ void Planner::recalculate() { #if ENABLED(FAN_SOFT_PWM) #define _FAN_SET(F) thermalManager.soft_pwm_amount_fan[F] = CALC_FAN_SPEED(F); #else - #define _FAN_SET(F) set_pwm_duty(pin_t(FAN##F##_PIN), CALC_FAN_SPEED(F)); + #define _FAN_SET(F) hal.set_pwm_duty(pin_t(FAN##F##_PIN), CALC_FAN_SPEED(F)); #endif #define FAN_SET(F) do{ kickstart_fan(fan_speed, ms, F); _FAN_SET(F); }while(0) @@ -1397,8 +1397,8 @@ void Planner::check_axes_activity() { TERN_(AUTOTEMP, autotemp_task()); #if ENABLED(BARICUDA) - TERN_(HAS_HEATER_1, set_pwm_duty(pin_t(HEATER_1_PIN), tail_valve_pressure)); - TERN_(HAS_HEATER_2, set_pwm_duty(pin_t(HEATER_2_PIN), tail_e_to_p_pressure)); + TERN_(HAS_HEATER_1, hal.set_pwm_duty(pin_t(HEATER_1_PIN), tail_valve_pressure)); + TERN_(HAS_HEATER_2, hal.set_pwm_duty(pin_t(HEATER_2_PIN), tail_e_to_p_pressure)); #endif } diff --git a/Marlin/src/module/servo.cpp b/Marlin/src/module/servo.cpp index 231efe84e1f2..96d5ba9da837 100644 --- a/Marlin/src/module/servo.cpp +++ b/Marlin/src/module/servo.cpp @@ -30,7 +30,7 @@ #include "servo.h" -HAL_SERVO_LIB servo[NUM_SERVOS]; +hal_servo_t servo[NUM_SERVOS]; #if ENABLED(EDITABLE_SERVO_ANGLES) uint16_t servo_angles[NUM_SERVOS][2]; diff --git a/Marlin/src/module/servo.h b/Marlin/src/module/servo.h index 73dbbdddb729..cd55a317a275 100644 --- a/Marlin/src/module/servo.h +++ b/Marlin/src/module/servo.h @@ -112,5 +112,5 @@ #define MOVE_SERVO(I, P) servo[I].move(P) #define DETACH_SERVO(I) servo[I].detach() -extern HAL_SERVO_LIB servo[NUM_SERVOS]; +extern hal_servo_t servo[NUM_SERVOS]; void servo_init(); diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 5da06a5e5078..a96ed3a6512b 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -1474,7 +1474,7 @@ void Stepper::isr() { #ifndef __AVR__ // Disable interrupts, to avoid ISR preemption while we reprogram the period // (AVR enters the ISR with global interrupts disabled, so no need to do it here) - DISABLE_ISRS(); + hal.isr_off(); #endif // Program timer compare for the maximum period, so it does NOT @@ -1492,7 +1492,7 @@ void Stepper::isr() { hal_timer_t min_ticks; do { // Enable ISRs to reduce USART processing latency - ENABLE_ISRS(); + hal.isr_on(); if (!nextMainISR) pulse_phase_isr(); // 0 = Do coordinated axes Stepper pulses @@ -1576,7 +1576,7 @@ void Stepper::isr() { * is less than the current count due to something preempting between the * read and the write of the new period value). */ - DISABLE_ISRS(); + hal.isr_off(); /** * Get the current tick value + margin @@ -1611,7 +1611,7 @@ void Stepper::isr() { HAL_timer_set_compare(MF_TIMER_STEP, hal_timer_t(next_isr_ticks)); // Don't forget to finally reenable interrupts - ENABLE_ISRS(); + hal.isr_on(); } #if MINIMUM_STEPPER_PULSE || MAXIMUM_STEPPER_RATE @@ -3260,33 +3260,33 @@ void Stepper::report_positions() { #elif HAS_MOTOR_CURRENT_PWM - #define _WRITE_CURRENT_PWM_DUTY(P) set_pwm_duty(pin_t(MOTOR_CURRENT_PWM_## P ##_PIN), 255L * current / (MOTOR_CURRENT_PWM_RANGE)) + #define _WRITE_CURRENT_PWM(P) hal.set_pwm_duty(pin_t(MOTOR_CURRENT_PWM_## P ##_PIN), 255L * current / (MOTOR_CURRENT_PWM_RANGE)) switch (driver) { case 0: #if PIN_EXISTS(MOTOR_CURRENT_PWM_X) - _WRITE_CURRENT_PWM_DUTY(X); + _WRITE_CURRENT_PWM(X); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_Y) - _WRITE_CURRENT_PWM_DUTY(Y); + _WRITE_CURRENT_PWM(Y); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - _WRITE_CURRENT_PWM_DUTY(XY); + _WRITE_CURRENT_PWM(XY); #endif break; case 1: #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - _WRITE_CURRENT_PWM_DUTY(Z); + _WRITE_CURRENT_PWM(Z); #endif break; case 2: #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - _WRITE_CURRENT_PWM_DUTY(E); + _WRITE_CURRENT_PWM(E); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E0) - _WRITE_CURRENT_PWM_DUTY(E0); + _WRITE_CURRENT_PWM(E0); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E1) - _WRITE_CURRENT_PWM_DUTY(E1); + _WRITE_CURRENT_PWM(E1); #endif break; } @@ -3308,7 +3308,7 @@ void Stepper::report_positions() { #ifdef __SAM3X8E__ #define _RESET_CURRENT_PWM_FREQ(P) NOOP #else - #define _RESET_CURRENT_PWM_FREQ(P) set_pwm_frequency(pin_t(P), MOTOR_CURRENT_PWM_FREQUENCY) + #define _RESET_CURRENT_PWM_FREQ(P) hal.set_pwm_frequency(pin_t(P), MOTOR_CURRENT_PWM_FREQUENCY) #endif #define INIT_CURRENT_PWM(P) do{ SET_PWM(MOTOR_CURRENT_PWM_## P ##_PIN); _RESET_CURRENT_PWM_FREQ(MOTOR_CURRENT_PWM_## P ##_PIN); }while(0) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 4ccd984b0d36..19501bce6e81 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -327,7 +327,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); #define _INIT_FAN_PIN(P) do{ if (PWM_PIN(P)) SET_PWM(P); else _INIT_SOFT_FAN(P); }while(0) #endif #if ENABLED(FAST_PWM_FAN) - #define SET_FAST_PWM_FREQ(P) set_pwm_frequency(P, FAST_PWM_FAN_FREQUENCY) + #define SET_FAST_PWM_FREQ(P) hal.set_pwm_frequency(pin_t(P), FAST_PWM_FAN_FREQUENCY) #else #define SET_FAST_PWM_FREQ(P) NOOP #endif @@ -818,7 +818,7 @@ volatile bool Temperature::raw_temps_ready = false; } // Run HAL idle tasks - TERN_(HAL_IDLETASK, HAL_idletask()); + hal.idletask(); // Run UI update TERN(HAS_DWIN_E3V2_BASIC, DWIN_Update(), ui.update()); @@ -907,7 +907,7 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) { #define _UPDATE_AUTO_FAN(P,D,A) do{ \ if (PWM_PIN(P##_AUTO_FAN_PIN) && A < 255) \ - set_pwm_duty(pin_t(P##_AUTO_FAN_PIN), D ? A : 0); \ + hal.set_pwm_duty(pin_t(P##_AUTO_FAN_PIN), D ? A : 0); \ else \ WRITE(P##_AUTO_FAN_PIN, D); \ }while(0) @@ -2321,74 +2321,33 @@ void Temperature::init() { TERN_(HAS_MAXTC_SW_SPI, max_tc_spi.init()); - HAL_adc_init(); + hal.adc_init(); + + TERN_(HAS_TEMP_ADC_0, hal.adc_enable(TEMP_0_PIN)); + TERN_(HAS_TEMP_ADC_1, hal.adc_enable(TEMP_1_PIN)); + TERN_(HAS_TEMP_ADC_2, hal.adc_enable(TEMP_2_PIN)); + TERN_(HAS_TEMP_ADC_3, hal.adc_enable(TEMP_3_PIN)); + TERN_(HAS_TEMP_ADC_4, hal.adc_enable(TEMP_4_PIN)); + TERN_(HAS_TEMP_ADC_5, hal.adc_enable(TEMP_5_PIN)); + TERN_(HAS_TEMP_ADC_6, hal.adc_enable(TEMP_6_PIN)); + TERN_(HAS_TEMP_ADC_7, hal.adc_enable(TEMP_7_PIN)); + TERN_(HAS_JOY_ADC_X, hal.adc_enable(JOY_X_PIN)); + TERN_(HAS_JOY_ADC_Y, hal.adc_enable(JOY_Y_PIN)); + TERN_(HAS_JOY_ADC_Z, hal.adc_enable(JOY_Z_PIN)); + TERN_(HAS_TEMP_ADC_BED, hal.adc_enable(TEMP_BED_PIN)); + TERN_(HAS_TEMP_ADC_CHAMBER, hal.adc_enable(TEMP_CHAMBER_PIN)); + TERN_(HAS_TEMP_ADC_PROBE, hal.adc_enable(TEMP_PROBE_PIN)); + TERN_(HAS_TEMP_ADC_COOLER, hal.adc_enable(TEMP_COOLER_PIN)); + TERN_(HAS_TEMP_ADC_BOARD, hal.adc_enable(TEMP_BOARD_PIN)); + TERN_(HAS_TEMP_ADC_REDUNDANT, hal.adc_enable(TEMP_REDUNDANT_PIN)); + TERN_(FILAMENT_WIDTH_SENSOR, hal.adc_enable(FILWIDTH_PIN)); + TERN_(HAS_ADC_BUTTONS, hal.adc_enable(ADC_KEYPAD_PIN)); + TERN_(POWER_MONITOR_CURRENT, hal.adc_enable(POWER_MONITOR_CURRENT_PIN)); + TERN_(POWER_MONITOR_VOLTAGE, hal.adc_enable(POWER_MONITOR_VOLTAGE_PIN)); - #if HAS_TEMP_ADC_0 - HAL_ANALOG_SELECT(TEMP_0_PIN); - #endif - #if HAS_TEMP_ADC_1 - HAL_ANALOG_SELECT(TEMP_1_PIN); - #endif - #if HAS_TEMP_ADC_2 - HAL_ANALOG_SELECT(TEMP_2_PIN); - #endif - #if HAS_TEMP_ADC_3 - HAL_ANALOG_SELECT(TEMP_3_PIN); - #endif - #if HAS_TEMP_ADC_4 - HAL_ANALOG_SELECT(TEMP_4_PIN); - #endif - #if HAS_TEMP_ADC_5 - HAL_ANALOG_SELECT(TEMP_5_PIN); - #endif - #if HAS_TEMP_ADC_6 - HAL_ANALOG_SELECT(TEMP_6_PIN); - #endif - #if HAS_TEMP_ADC_7 - HAL_ANALOG_SELECT(TEMP_7_PIN); - #endif - #if HAS_JOY_ADC_X - HAL_ANALOG_SELECT(JOY_X_PIN); - #endif - #if HAS_JOY_ADC_Y - HAL_ANALOG_SELECT(JOY_Y_PIN); - #endif - #if HAS_JOY_ADC_Z - HAL_ANALOG_SELECT(JOY_Z_PIN); - #endif #if HAS_JOY_ADC_EN SET_INPUT_PULLUP(JOY_EN_PIN); #endif - #if HAS_TEMP_ADC_BED - HAL_ANALOG_SELECT(TEMP_BED_PIN); - #endif - #if HAS_TEMP_ADC_CHAMBER - HAL_ANALOG_SELECT(TEMP_CHAMBER_PIN); - #endif - #if HAS_TEMP_ADC_PROBE - HAL_ANALOG_SELECT(TEMP_PROBE_PIN); - #endif - #if HAS_TEMP_ADC_COOLER - HAL_ANALOG_SELECT(TEMP_COOLER_PIN); - #endif - #if HAS_TEMP_ADC_BOARD - HAL_ANALOG_SELECT(TEMP_BOARD_PIN); - #endif - #if HAS_TEMP_ADC_REDUNDANT - HAL_ANALOG_SELECT(TEMP_REDUNDANT_PIN); - #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - HAL_ANALOG_SELECT(FILWIDTH_PIN); - #endif - #if HAS_ADC_BUTTONS - HAL_ANALOG_SELECT(ADC_KEYPAD_PIN); - #endif - #if ENABLED(POWER_MONITOR_CURRENT) - HAL_ANALOG_SELECT(POWER_MONITOR_CURRENT_PIN); - #endif - #if ENABLED(POWER_MONITOR_VOLTAGE) - HAL_ANALOG_SELECT(POWER_MONITOR_VOLTAGE_PIN); - #endif HAL_timer_start(MF_TIMER_TEMP, TEMP_TIMER_FREQUENCY); ENABLE_TEMPERATURE_INTERRUPT(); @@ -3364,8 +3323,8 @@ void Temperature::isr() { * This gives each ADC 0.9765ms to charge up. */ #define ACCUMULATE_ADC(obj) do{ \ - if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; \ - else obj.sample(HAL_READ_ADC()); \ + if (!hal.adc_ready()) next_sensor_state = adc_sensor_state; \ + else obj.sample(hal.adc_value()); \ }while(0) ADCSensorState next_sensor_state = adc_sensor_state < SensorsReady ? (ADCSensorState)(int(adc_sensor_state) + 1) : StartSampling; @@ -3397,115 +3356,115 @@ void Temperature::isr() { break; #if HAS_TEMP_ADC_0 - case PrepareTemp_0: HAL_START_ADC(TEMP_0_PIN); break; + case PrepareTemp_0: hal.adc_start(TEMP_0_PIN); break; case MeasureTemp_0: ACCUMULATE_ADC(temp_hotend[0]); break; #endif #if HAS_TEMP_ADC_BED - case PrepareTemp_BED: HAL_START_ADC(TEMP_BED_PIN); break; + case PrepareTemp_BED: hal.adc_start(TEMP_BED_PIN); break; case MeasureTemp_BED: ACCUMULATE_ADC(temp_bed); break; #endif #if HAS_TEMP_ADC_CHAMBER - case PrepareTemp_CHAMBER: HAL_START_ADC(TEMP_CHAMBER_PIN); break; + case PrepareTemp_CHAMBER: hal.adc_start(TEMP_CHAMBER_PIN); break; case MeasureTemp_CHAMBER: ACCUMULATE_ADC(temp_chamber); break; #endif #if HAS_TEMP_ADC_COOLER - case PrepareTemp_COOLER: HAL_START_ADC(TEMP_COOLER_PIN); break; + case PrepareTemp_COOLER: hal.adc_start(TEMP_COOLER_PIN); break; case MeasureTemp_COOLER: ACCUMULATE_ADC(temp_cooler); break; #endif #if HAS_TEMP_ADC_PROBE - case PrepareTemp_PROBE: HAL_START_ADC(TEMP_PROBE_PIN); break; + case PrepareTemp_PROBE: hal.adc_start(TEMP_PROBE_PIN); break; case MeasureTemp_PROBE: ACCUMULATE_ADC(temp_probe); break; #endif #if HAS_TEMP_ADC_BOARD - case PrepareTemp_BOARD: HAL_START_ADC(TEMP_BOARD_PIN); break; + case PrepareTemp_BOARD: hal.adc_start(TEMP_BOARD_PIN); break; case MeasureTemp_BOARD: ACCUMULATE_ADC(temp_board); break; #endif #if HAS_TEMP_ADC_REDUNDANT - case PrepareTemp_REDUNDANT: HAL_START_ADC(TEMP_REDUNDANT_PIN); break; + case PrepareTemp_REDUNDANT: hal.adc_start(TEMP_REDUNDANT_PIN); break; case MeasureTemp_REDUNDANT: ACCUMULATE_ADC(temp_redundant); break; #endif #if HAS_TEMP_ADC_1 - case PrepareTemp_1: HAL_START_ADC(TEMP_1_PIN); break; + case PrepareTemp_1: hal.adc_start(TEMP_1_PIN); break; case MeasureTemp_1: ACCUMULATE_ADC(temp_hotend[1]); break; #endif #if HAS_TEMP_ADC_2 - case PrepareTemp_2: HAL_START_ADC(TEMP_2_PIN); break; + case PrepareTemp_2: hal.adc_start(TEMP_2_PIN); break; case MeasureTemp_2: ACCUMULATE_ADC(temp_hotend[2]); break; #endif #if HAS_TEMP_ADC_3 - case PrepareTemp_3: HAL_START_ADC(TEMP_3_PIN); break; + case PrepareTemp_3: hal.adc_start(TEMP_3_PIN); break; case MeasureTemp_3: ACCUMULATE_ADC(temp_hotend[3]); break; #endif #if HAS_TEMP_ADC_4 - case PrepareTemp_4: HAL_START_ADC(TEMP_4_PIN); break; + case PrepareTemp_4: hal.adc_start(TEMP_4_PIN); break; case MeasureTemp_4: ACCUMULATE_ADC(temp_hotend[4]); break; #endif #if HAS_TEMP_ADC_5 - case PrepareTemp_5: HAL_START_ADC(TEMP_5_PIN); break; + case PrepareTemp_5: hal.adc_start(TEMP_5_PIN); break; case MeasureTemp_5: ACCUMULATE_ADC(temp_hotend[5]); break; #endif #if HAS_TEMP_ADC_6 - case PrepareTemp_6: HAL_START_ADC(TEMP_6_PIN); break; + case PrepareTemp_6: hal.adc_start(TEMP_6_PIN); break; case MeasureTemp_6: ACCUMULATE_ADC(temp_hotend[6]); break; #endif #if HAS_TEMP_ADC_7 - case PrepareTemp_7: HAL_START_ADC(TEMP_7_PIN); break; + case PrepareTemp_7: hal.adc_start(TEMP_7_PIN); break; case MeasureTemp_7: ACCUMULATE_ADC(temp_hotend[7]); break; #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - case Prepare_FILWIDTH: HAL_START_ADC(FILWIDTH_PIN); break; + case Prepare_FILWIDTH: hal.adc_start(FILWIDTH_PIN); break; case Measure_FILWIDTH: - if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; // Redo this state - else filwidth.accumulate(HAL_READ_ADC()); + if (!hal.adc_ready()) next_sensor_state = adc_sensor_state; // Redo this state + else filwidth.accumulate(hal.adc_value()); break; #endif #if ENABLED(POWER_MONITOR_CURRENT) case Prepare_POWER_MONITOR_CURRENT: - HAL_START_ADC(POWER_MONITOR_CURRENT_PIN); + hal.adc_start(POWER_MONITOR_CURRENT_PIN); break; case Measure_POWER_MONITOR_CURRENT: - if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; // Redo this state - else power_monitor.add_current_sample(HAL_READ_ADC()); + if (!hal.adc_ready()) next_sensor_state = adc_sensor_state; // Redo this state + else power_monitor.add_current_sample(hal.adc_value()); break; #endif #if ENABLED(POWER_MONITOR_VOLTAGE) case Prepare_POWER_MONITOR_VOLTAGE: - HAL_START_ADC(POWER_MONITOR_VOLTAGE_PIN); + hal.adc_start(POWER_MONITOR_VOLTAGE_PIN); break; case Measure_POWER_MONITOR_VOLTAGE: - if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; // Redo this state - else power_monitor.add_voltage_sample(HAL_READ_ADC()); + if (!hal.adc_ready()) next_sensor_state = adc_sensor_state; // Redo this state + else power_monitor.add_voltage_sample(hal.adc_value()); break; #endif #if HAS_JOY_ADC_X - case PrepareJoy_X: HAL_START_ADC(JOY_X_PIN); break; + case PrepareJoy_X: hal.adc_start(JOY_X_PIN); break; case MeasureJoy_X: ACCUMULATE_ADC(joystick.x); break; #endif #if HAS_JOY_ADC_Y - case PrepareJoy_Y: HAL_START_ADC(JOY_Y_PIN); break; + case PrepareJoy_Y: hal.adc_start(JOY_Y_PIN); break; case MeasureJoy_Y: ACCUMULATE_ADC(joystick.y); break; #endif #if HAS_JOY_ADC_Z - case PrepareJoy_Z: HAL_START_ADC(JOY_Z_PIN); break; + case PrepareJoy_Z: hal.adc_start(JOY_Z_PIN); break; case MeasureJoy_Z: ACCUMULATE_ADC(joystick.z); break; #endif @@ -3513,12 +3472,12 @@ void Temperature::isr() { #ifndef ADC_BUTTON_DEBOUNCE_DELAY #define ADC_BUTTON_DEBOUNCE_DELAY 16 #endif - case Prepare_ADC_KEY: HAL_START_ADC(ADC_KEYPAD_PIN); break; + case Prepare_ADC_KEY: hal.adc_start(ADC_KEYPAD_PIN); break; case Measure_ADC_KEY: - if (!HAL_ADC_READY()) + if (!hal.adc_ready()) next_sensor_state = adc_sensor_state; // redo this state else if (ADCKey_count < ADC_BUTTON_DEBOUNCE_DELAY) { - raw_ADCKey_value = HAL_READ_ADC(); + raw_ADCKey_value = hal.adc_value(); if (raw_ADCKey_value <= 900UL * HAL_ADC_RANGE / 1024UL) { NOMORE(current_ADCKey_raw, raw_ADCKey_value); ADCKey_count++; diff --git a/ini/features.ini b/ini/features.ini index 7f9fd1c338d3..90d1d0e102cb 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -233,7 +233,7 @@ HAS_SERVOS = src_filter=+ + HAS_MICROSTEPS = src_filter=+ (ESP3D_)?WIFISUPPORT = AsyncTCP, ESP Async WebServer - ESP3DLib=https://github.com/luc-github/ESP3DLib/archive/master.zip + ESP3DLib=https://github.com/luc-github/ESP3DLib/archive/master-2.0.7.zip arduinoWebSockets=links2004/WebSockets@2.3.4 luc-github/ESP32SSDP@^1.1.1 lib_ignore=ESPAsyncTCP diff --git a/ini/native.ini b/ini/native.ini index 5355284992cb..3d196f343649 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -34,14 +34,14 @@ src_filter = ${common.default_src_filter} + [simulator_common] platform = native framework = -build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS -I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/include -IMarlin/src/HAL/NATIVE_SIM/u8g +build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS -I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/u8g src_build_flags = -Wall -Wno-expansion-to-defined -Wcast-align release_flags = -g0 -O3 -flto debug_build_flags = -fstack-protector-strong -g -g3 -ggdb lib_compat_mode = off src_filter = ${common.default_src_filter} + lib_deps = ${common.lib_deps} - MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/master.zip + MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/0.0.2.zip Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/marlin_sim_native.zip LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/master.zip extra_scripts = ${common.extra_scripts} diff --git a/ini/stm32-common.ini b/ini/stm32-common.ini index 54bc746ff4ff..1d3f858bf8e9 100644 --- a/ini/stm32-common.ini +++ b/ini/stm32-common.ini @@ -16,6 +16,7 @@ build_flags = ${common.build_flags} -std=gnu++14 -DHAL_STM32 -DUSBCON -DUSBD_USE_CDC -DTIM_IRQ_PRIO=13 + -DADC_RESOLUTION=12 build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} + + extra_scripts = ${common.extra_scripts} diff --git a/ini/stm32g0.ini b/ini/stm32g0.ini index 171945ffe2f0..e6094c1e312d 100644 --- a/ini/stm32g0.ini +++ b/ini/stm32g0.ini @@ -30,7 +30,6 @@ board = marlin_STM32G0B1RE board_build.offset = 0x2000 board_upload.offset_address = 0x08002000 build_flags = ${stm32_variant.build_flags} - -DADC_RESOLUTION=12 -DPIN_SERIAL4_RX=PC_11 -DPIN_SERIAL4_TX=PC_10 -DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024 -DTIMER_SERVO=TIM3 -DTIMER_TONE=TIM4 From 7ec2167a73d630e1408911bc172ede11189da27f Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Tue, 22 Feb 2022 01:15:52 +0000 Subject: [PATCH 121/502] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Apply=20PTC=20on?= =?UTF-8?q?=20all=20probing=20(#23764)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/feature/probe_temp_comp.cpp | 9 +++++++++ Marlin/src/feature/probe_temp_comp.h | 11 +++++++++-- Marlin/src/gcode/bedlevel/abl/G29.cpp | 9 --------- Marlin/src/gcode/calibrate/G76_M871.cpp | 2 ++ Marlin/src/gcode/calibrate/M48.cpp | 12 +++++++++++- Marlin/src/gcode/probe/G30.cpp | 8 ++++++++ Marlin/src/lcd/menu/menu_probe_offset.cpp | 2 +- Marlin/src/module/probe.cpp | 9 ++++++++- 8 files changed, 48 insertions(+), 14 deletions(-) diff --git a/Marlin/src/feature/probe_temp_comp.cpp b/Marlin/src/feature/probe_temp_comp.cpp index 9a975d6763fa..b5f636e698c9 100644 --- a/Marlin/src/feature/probe_temp_comp.cpp +++ b/Marlin/src/feature/probe_temp_comp.cpp @@ -28,6 +28,7 @@ #include "probe_temp_comp.h" #include +#include "../module/temperature.h" ProbeTempComp ptc; @@ -62,6 +63,7 @@ constexpr temp_calib_t ProbeTempComp::cali_info[TSI_COUNT]; uint8_t ProbeTempComp::calib_idx; // = 0 float ProbeTempComp::init_measurement; // = 0.0 +bool ProbeTempComp::enabled = true; void ProbeTempComp::reset() { TERN_(PTC_PROBE, LOOP_L_N(i, PTC_PROBE_COUNT) z_offsets_probe[i] = z_offsets_probe_default[i]); @@ -169,6 +171,13 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) { return true; } +void ProbeTempComp::apply_compensation(float &meas_z) { + if (!enabled) return; + TERN_(PTC_BED, compensate_measurement(TSI_BED, thermalManager.degBed(), meas_z)); + TERN_(PTC_PROBE, compensate_measurement(TSI_PROBE, thermalManager.degProbe(), meas_z)); + TERN_(PTC_HOTEND, compensate_measurement(TSI_EXT, thermalManager.degHotend(0), meas_z)); +} + void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const celsius_t temp, float &meas_z) { const uint8_t measurements = cali_info[tsi].measurements; const celsius_t start_temp = cali_info[tsi].start_temp, diff --git a/Marlin/src/feature/probe_temp_comp.h b/Marlin/src/feature/probe_temp_comp.h index 1db7d04e89dc..42348db68473 100644 --- a/Marlin/src/feature/probe_temp_comp.h +++ b/Marlin/src/feature/probe_temp_comp.h @@ -77,7 +77,6 @@ class ProbeTempComp { static void reset_index() { calib_idx = 0; }; static uint8_t get_index() { return calib_idx; } static void reset(); - static void clear_offsets(const TempSensorID tsi); static void clear_all_offsets() { TERN_(PTC_PROBE, clear_offsets(TSI_PROBE)); TERN_(PTC_BED, clear_offsets(TSI_BED)); @@ -88,10 +87,16 @@ class ProbeTempComp { static void prepare_new_calibration(const_float_t init_meas_z); static void push_back_new_measurement(const TempSensorID tsi, const_float_t meas_z); static bool finish_calibration(const TempSensorID tsi); - static void compensate_measurement(const TempSensorID tsi, const celsius_t temp, float &meas_z); + static void set_enabled(const bool ena) { enabled = ena; } + + // Apply all temperature compensation adjustments + static void apply_compensation(float &meas_z); private: static uint8_t calib_idx; + static bool enabled; + + static void clear_offsets(const TempSensorID tsi); /** * Base value. Temperature compensation values will be deltas @@ -104,6 +109,8 @@ class ProbeTempComp { * to allow generating values of higher temperatures. */ static bool linear_regression(const TempSensorID tsi, float &k, float &d); + + static void compensate_measurement(const TempSensorID tsi, const celsius_t temp, float &meas_z); }; extern ProbeTempComp ptc; diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 9ec43fe49ddf..24c0268b9f75 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -36,11 +36,6 @@ #include "../../../module/probe.h" #include "../../queue.h" -#if HAS_PTC - #include "../../../feature/probe_temp_comp.h" - #include "../../../module/temperature.h" -#endif - #if HAS_STATUS_MESSAGE #include "../../../lcd/marlinui.h" #endif @@ -658,10 +653,6 @@ G29_TYPE GcodeSuite::G29() { break; // Breaks out of both loops } - TERN_(PTC_BED, ptc.compensate_measurement(TSI_BED, thermalManager.degBed(), abl.measured_z)); - TERN_(PTC_PROBE, ptc.compensate_measurement(TSI_PROBE, thermalManager.degProbe(), abl.measured_z)); - TERN_(PTC_HOTEND, ptc.compensate_measurement(TSI_EXT, thermalManager.degHotend(0), abl.measured_z)); - #if ENABLED(AUTO_BED_LEVELING_LINEAR) abl.mean += abl.measured_z; diff --git a/Marlin/src/gcode/calibrate/G76_M871.cpp b/Marlin/src/gcode/calibrate/G76_M871.cpp index 21bb2c759006..ad13b20306ae 100644 --- a/Marlin/src/gcode/calibrate/G76_M871.cpp +++ b/Marlin/src/gcode/calibrate/G76_M871.cpp @@ -109,7 +109,9 @@ static void say_failed_to_calibrate() { SERIAL_ECHOPGM("!Failed to calibra auto g76_probe = [](const TempSensorID sid, celsius_t &targ, const xy_pos_t &nozpos) { do_z_clearance(5.0); // Raise nozzle before probing + ptc.set_enabled(false); const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false); // verbose=0, probe_relative=false + ptc.set_enabled(true); if (isnan(measured_z)) SERIAL_ECHOLNPGM("!Received NAN. Aborting."); else { diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index 913ffe30d478..8b6ea0bf1fae 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -35,11 +35,15 @@ #include "../../module/planner.h" #endif +#if HAS_PTC + #include "../../feature/probe_temp_comp.h" +#endif + /** * M48: Z probe repeatability measurement function. * * Usage: - * M48 + * M48 * P = Number of sampled points (4-50, default 10) * X = Sample X position * Y = Sample Y position @@ -47,6 +51,7 @@ * E = Engage Z probe for each reading * L = Number of legs of movement before probe * S = Schizoid (Or Star if you prefer) + * C = Enable probe temperature compensation (0 or 1, default 1) * * This function requires the machine to be homed before invocation. */ @@ -107,6 +112,8 @@ void GcodeSuite::M48() { set_bed_leveling_enabled(false); #endif + TERN_(HAS_PTC, ptc.set_enabled(!parser.seen('C') || parser.value_bool())); + // Work with reasonable feedrates remember_feedrate_scaling_off(); @@ -269,6 +276,9 @@ void GcodeSuite::M48() { // Re-enable bed level correction if it had been on TERN_(HAS_LEVELING, set_bed_leveling_enabled(was_enabled)); + // Re-enable probe temperature correction + TERN_(HAS_PTC, ptc.set_enabled(true)); + report_current_position(); } diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index f4152c76e9e5..474f1f252a04 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -29,6 +29,10 @@ #include "../../module/probe.h" #include "../../feature/bedlevel/bedlevel.h" +#if HAS_PTC + #include "../../feature/probe_temp_comp.h" +#endif + /** * G30: Do a single Z probe at the current XY * @@ -37,6 +41,7 @@ * X Probe X position (default current X) * Y Probe Y position (default current Y) * E Engage the probe for each probe (default 1) + * C Enable probe temperature compensation (0 or 1, default 1) */ void GcodeSuite::G30() { @@ -51,7 +56,10 @@ void GcodeSuite::G30() { remember_feedrate_scaling_off(); const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; + + TERN_(HAS_PTC, ptc.set_enabled(!parser.seen('C') || parser.value_bool())); const float measured_z = probe.probe_at_point(pos, raise_after, 1); + TERN_(HAS_PTC, ptc.set_enabled(true)); if (!isnan(measured_z)) SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z); diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index ae785fa641cb..79db47005d0a 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -62,7 +62,7 @@ void probe_offset_wizard_menu() { if (LCD_HEIGHT >= 4) STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT); - STATIC_ITEM_P(PSTR("Z="), SS_CENTER, ftostr42_52(current_position.z)); + STATIC_ITEM_P(PSTR("Z"), SS_CENTER, ftostr42_52(current_position.z)); STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset)); SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); }); diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index fdd6897192a2..95776ffda1af 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -77,6 +77,10 @@ #include "servo.h" #endif +#if HAS_PTC + #include "../feature/probe_temp_comp.h" +#endif + #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) @@ -801,7 +805,10 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai do_blocking_move_to(npos, feedRate_t(XY_PROBE_FEEDRATE_MM_S)); float measured_z = NAN; - if (!deploy()) measured_z = run_z_probe(sanity_check) + offset.z; + if (!deploy()) { + measured_z = run_z_probe(sanity_check) + offset.z; + TERN_(HAS_PTC, ptc.apply_compensation(measured_z)); + } if (!isnan(measured_z)) { const bool big_raise = raise_after == PROBE_PT_BIG_RAISE; if (big_raise || raise_after == PROBE_PT_RAISE) From 8a02646f5244a67cfdae32ba6a8b4dd68467f149 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 21 Feb 2022 19:54:03 -0600 Subject: [PATCH 122/502] =?UTF-8?q?=F0=9F=93=9D=20Update=20Toolchange=20FS?= =?UTF-8?q?=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 8 ++++---- Marlin/src/libs/nozzle.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index f2676828fffb..2d1b14107dcb 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2417,7 +2417,7 @@ #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) // Load / Unload #define TOOLCHANGE_FS_LENGTH 12 // (mm) Load / Unload length - #define TOOLCHANGE_FS_EXTRA_RESUME_LENGTH 0 // (mm) Extra length for better restart, fine tune by LCD/Gcode) + #define TOOLCHANGE_FS_EXTRA_RESUME_LENGTH 0 // (mm) Extra length for better restart. Adjust with LCD or M217 B. #define TOOLCHANGE_FS_RETRACT_SPEED (50*60) // (mm/min) (Unloading) #define TOOLCHANGE_FS_UNRETRACT_SPEED (25*60) // (mm/min) (On SINGLENOZZLE or Bowden loading must be slowed down) @@ -2431,12 +2431,12 @@ #define TOOLCHANGE_FS_FAN_SPEED 255 // 0-255 #define TOOLCHANGE_FS_FAN_TIME 10 // (seconds) - // Swap uninitialized extruder with TOOLCHANGE_FS_PRIME_SPEED for all lengths (recover + prime) + // Swap uninitialized extruder (using TOOLCHANGE_FS_PRIME_SPEED feedrate) // (May break filament if not retracted beforehand.) //#define TOOLCHANGE_FS_INIT_BEFORE_SWAP - // Prime on the first T0 (If other, TOOLCHANGE_FS_INIT_BEFORE_SWAP applied) - // Enable it (M217 V[0/1]) before printing, to avoid unwanted priming on host connect + // Prime on the first T0 (For other tools use TOOLCHANGE_FS_INIT_BEFORE_SWAP) + // Enable with M217 V1 before printing to avoid unwanted priming on host connect //#define TOOLCHANGE_FS_PRIME_FIRST_USED /** diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index 5cd2014d7f86..4ca8fa2cae1e 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -263,7 +263,7 @@ Nozzle nozzle; case 2: do_blocking_move_to_y(park.y, fr_xy); break; case 3: do_blocking_move_to_x(park.x, fr_xy); do_blocking_move_to_y(park.y, fr_xy); break; - case 4: do_blocking_move_to_y(park.y, fr_xy); + case 4: do_blocking_move_to_y(park.y, fr_xy); do_blocking_move_to_x(park.x, fr_xy); break; } From 980c009fc7ff8ec07d37a1d936cf5711cb50cbdd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 21 Feb 2022 19:55:19 -0600 Subject: [PATCH 123/502] =?UTF-8?q?=E2=9C=A8=20Dyze=20Design=20PT100=20Amp?= =?UTF-8?q?lifier=20Board=20(#23760)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 1 + Marlin/src/module/thermistor/thermistor_68.h | 54 ++++++++++++++++++++ Marlin/src/module/thermistor/thermistors.h | 3 ++ 3 files changed, 58 insertions(+) create mode 100644 Marlin/src/module/thermistor/thermistor_68.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 752fd1370a8b..6f7b1bdf4a30 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -459,6 +459,7 @@ * 61 : 100kΩ Formbot/Vivedino 350°C Thermistor - beta 3950 * 66 : 4.7MΩ Dyze Design High Temperature Thermistor * 67 : 500kΩ SliceEngineering 450°C Thermistor + * 68 : PT100 amplifier board from Dyze Design * 70 : 100kΩ bq Hephestos 2 * 75 : 100kΩ Generic Silicon Heat Pad with NTC100K MGB18-104F39050L32 * 2000 : 100kΩ Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor diff --git a/Marlin/src/module/thermistor/thermistor_68.h b/Marlin/src/module/thermistor/thermistor_68.h new file mode 100644 index 000000000000..270456dcb59c --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_68.h @@ -0,0 +1,54 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#define REVERSE_TEMP_SENSOR_RANGE_68 1 + +// PT100 amplifier board from Dyze Design +const temp_entry_t temptable_68[] PROGMEM = { + { OV(273), 0 }, + { OV(294), 20 }, + { OV(315), 40 }, + { OV(336), 60 }, + { OV(356), 80 }, + { OV(376), 100 }, + { OV(396), 120 }, + { OV(416), 140 }, + { OV(436), 160 }, + { OV(455), 180 }, + { OV(474), 200 }, + { OV(494), 220 }, + { OV(513), 240 }, + { OV(531), 260 }, + { OV(550), 280 }, + { OV(568), 300 }, + { OV(587), 320 }, + { OV(605), 340 }, + { OV(623), 360 }, + { OV(641), 380 }, + { OV(658), 400 }, + { OV(676), 420 }, + { OV(693), 440 }, + { OV(710), 460 }, + { OV(727), 480 }, + { OV(744), 500 } +}; diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 3d9ef5062d50..9f2ebce49a32 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -156,6 +156,9 @@ typedef struct { int16_t value; celsius_t celsius; } temp_entry_t; #if ANY_THERMISTOR_IS(67) // R25 = 500 KOhm, beta25 = 3800 K, 4.7 kOhm pull-up, SliceEngineering 450 °C Thermistor #include "thermistor_67.h" #endif +#if ANY_THERMISTOR_IS(68) // PT-100 with Dyze amplifier board + #include "thermistor_68.h" +#endif #if ANY_THERMISTOR_IS(12) // beta25 = 4700 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Personal calibration for Makibox hot bed" #include "thermistor_12.h" #endif From be703522036250c4753d5ae1100c78bf01e8a124 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Mon, 21 Feb 2022 18:47:53 -0800 Subject: [PATCH 124/502] =?UTF-8?q?=F0=9F=94=A7=20Warning=20for=20MK3=5FFA?= =?UTF-8?q?N=5FPINS=20(#23727)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Warnings.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index dcdc12f45e8d..c4716cd3769a 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -597,3 +597,10 @@ #ifdef __STM32F1__ #warning "Maple build environments are deprecated. Please use a non-Maple build environment. Report issues to the Marlin Firmware project." #endif + +/** + * Průša MK3/S/+ fan pin reassignment + */ +#if MB(BTT_BTT002_V1_0, EINSY_RAMBO) && DISABLED(NO_MK3_FAN_PINS_WARNING) + #warning "Define MK3_FAN_PINS to swap hotend and part cooling fan pins. (Define NO_MK3_FAN_PINS_WARNING to suppress this warning.)" +#endif From 80e569015bcd97cb9da43e4cecf20f0d0a8bd5f6 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Tue, 22 Feb 2022 16:16:57 +1300 Subject: [PATCH 125/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20TMC26X=20CS=20pins?= =?UTF-8?q?=20init=20(#23778)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/core/drivers.h | 2 +- Marlin/src/feature/tmc_util.cpp | 126 ++++++++++++++++---------------- Marlin/src/feature/tmc_util.h | 4 +- ini/features.ini | 3 +- 5 files changed, 69 insertions(+), 68 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 482ad95cac5a..81dc7db4cc91 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -145,7 +145,7 @@ #include "feature/encoder_i2c.h" #endif -#if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF) +#if (HAS_TRINAMIC_CONFIG || HAS_TMC_SPI) && DISABLED(PSU_DEFAULT_OFF) #include "feature/tmc_util.h" #endif diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index 0a76410274bb..2e66cc920119 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -128,7 +128,7 @@ // Test for a driver that uses SPI - this allows checking whether a _CS_ pin // is considered sensitive #define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \ - || AXIS_DRIVER_TYPE(A,TMC2660) \ + || AXIS_DRIVER_TYPE(A,TMC26X) || AXIS_DRIVER_TYPE(A,TMC2660) \ || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) ) #define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) ) diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index cf3fa3b7b0b7..c69772bebcaf 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -1178,69 +1178,6 @@ #endif // USE_SENSORLESS -#if HAS_TMC_SPI - #define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH) - void tmc_init_cs_pins() { - #if AXIS_HAS_SPI(X) - SET_CS_PIN(X); - #endif - #if AXIS_HAS_SPI(Y) - SET_CS_PIN(Y); - #endif - #if AXIS_HAS_SPI(Z) - SET_CS_PIN(Z); - #endif - #if AXIS_HAS_SPI(X2) - SET_CS_PIN(X2); - #endif - #if AXIS_HAS_SPI(Y2) - SET_CS_PIN(Y2); - #endif - #if AXIS_HAS_SPI(Z2) - SET_CS_PIN(Z2); - #endif - #if AXIS_HAS_SPI(Z3) - SET_CS_PIN(Z3); - #endif - #if AXIS_HAS_SPI(Z4) - SET_CS_PIN(Z4); - #endif - #if AXIS_HAS_SPI(I) - SET_CS_PIN(I); - #endif - #if AXIS_HAS_SPI(J) - SET_CS_PIN(J); - #endif - #if AXIS_HAS_SPI(K) - SET_CS_PIN(K); - #endif - #if AXIS_HAS_SPI(E0) - SET_CS_PIN(E0); - #endif - #if AXIS_HAS_SPI(E1) - SET_CS_PIN(E1); - #endif - #if AXIS_HAS_SPI(E2) - SET_CS_PIN(E2); - #endif - #if AXIS_HAS_SPI(E3) - SET_CS_PIN(E3); - #endif - #if AXIS_HAS_SPI(E4) - SET_CS_PIN(E4); - #endif - #if AXIS_HAS_SPI(E5) - SET_CS_PIN(E5); - #endif - #if AXIS_HAS_SPI(E6) - SET_CS_PIN(E6); - #endif - #if AXIS_HAS_SPI(E7) - SET_CS_PIN(E7); - #endif - } -#endif // HAS_TMC_SPI - template static bool test_connection(TMC &st) { SERIAL_ECHOPGM("Testing "); @@ -1339,3 +1276,66 @@ void test_tmc_connection(LOGICAL_AXIS_ARGS(const bool)) { } #endif // HAS_TRINAMIC_CONFIG + +#if HAS_TMC_SPI + #define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH) + void tmc_init_cs_pins() { + #if AXIS_HAS_SPI(X) + SET_CS_PIN(X); + #endif + #if AXIS_HAS_SPI(Y) + SET_CS_PIN(Y); + #endif + #if AXIS_HAS_SPI(Z) + SET_CS_PIN(Z); + #endif + #if AXIS_HAS_SPI(X2) + SET_CS_PIN(X2); + #endif + #if AXIS_HAS_SPI(Y2) + SET_CS_PIN(Y2); + #endif + #if AXIS_HAS_SPI(Z2) + SET_CS_PIN(Z2); + #endif + #if AXIS_HAS_SPI(Z3) + SET_CS_PIN(Z3); + #endif + #if AXIS_HAS_SPI(Z4) + SET_CS_PIN(Z4); + #endif + #if AXIS_HAS_SPI(I) + SET_CS_PIN(I); + #endif + #if AXIS_HAS_SPI(J) + SET_CS_PIN(J); + #endif + #if AXIS_HAS_SPI(K) + SET_CS_PIN(K); + #endif + #if AXIS_HAS_SPI(E0) + SET_CS_PIN(E0); + #endif + #if AXIS_HAS_SPI(E1) + SET_CS_PIN(E1); + #endif + #if AXIS_HAS_SPI(E2) + SET_CS_PIN(E2); + #endif + #if AXIS_HAS_SPI(E3) + SET_CS_PIN(E3); + #endif + #if AXIS_HAS_SPI(E4) + SET_CS_PIN(E4); + #endif + #if AXIS_HAS_SPI(E5) + SET_CS_PIN(E5); + #endif + #if AXIS_HAS_SPI(E6) + SET_CS_PIN(E6); + #endif + #if AXIS_HAS_SPI(E7) + SET_CS_PIN(E7); + #endif + } +#endif // HAS_TMC_SPI diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index 892d33768b6f..fc333b09dd99 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -382,8 +382,8 @@ void test_tmc_connection(LOGICAL_AXIS_DECL(const bool, true)); #endif // USE_SENSORLESS +#endif // HAS_TRINAMIC_CONFIG + #if HAS_TMC_SPI void tmc_init_cs_pins(); #endif - -#endif // HAS_TRINAMIC_CONFIG diff --git a/ini/features.ini b/ini/features.ini index 90d1d0e102cb..d9d35d9a5419 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -18,7 +18,8 @@ POSTMORTEM_DEBUGGING = src_filter=+ + + + + + + src_filter=+ + + + + +HAS_T(RINAMIC_CONFIG|MC_SPI) = src_filter=+ HAS_STEALTHCHOP = src_filter=+ SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip HAS_MOTOR_CURRENT_I2C = SlowSoftI2CMaster From 9588f21d2e8b91ab9061efdbb2d43df9c81e239e Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Thu, 24 Feb 2022 05:36:39 +1300 Subject: [PATCH 126/502] =?UTF-8?q?=F0=9F=94=A8=20More=20renamed.ini=20env?= =?UTF-8?q?s=20(#23786)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/renamed.ini | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/ini/renamed.ini b/ini/renamed.ini index bc1e438d60c1..abc8ee5c28b3 100644 --- a/ini/renamed.ini +++ b/ini/renamed.ini @@ -9,17 +9,41 @@ # # ################################# +# +# A platform that doesn't match anything in pins.h +# + +[renamed] +platform = native + # # List of environment names that are no longer used # [env:STM32F103RET6_creality_maple] -extends = env:STM32F103RE_maple +# Renamed to STM32F103RE_creality_maple +extends = renamed [env:STM32F103RET6_creality] -extends = STM32F103Rx_creality -board = genericSTM32F103RE +# Renamed to STM32F103RE_creality +extends = renamed [env:STM32F103RET6_creality_xfer] -extends = STM32F103Rx_creality_xfer -board = genericSTM32F103RE +# Renamed to STM32F103RE_creality_xfer +extends = renamed + +[env:STM32F103RC_btt_512K] +# Renamed to STM32F103RE_btt +extends = renamed + +[env:STM32F103RC_btt_512K_USB] +# Renamed to STM32F103RE_btt_USB +extends = renamed + +[env:STM32F103RC_btt_512K_maple] +# Renamed to STM32F103RE_btt_maple +extends = renamed + +[env:STM32F103RC_btt_512K_USB_maple] +# Renamed to STM32F103RE_btt_USB_maple +extends = renamed From 8e11a2bb8393c84a43a8c19a2f8ab499123cccb4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 24 Feb 2022 18:47:57 -0600 Subject: [PATCH 127/502] =?UTF-8?q?=F0=9F=8E=A8=20=20Move=20PROPORTIONAL?= =?UTF-8?q?=5FFONT=5FRATIO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 2d1b14107dcb..910e779b2a54 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2337,6 +2337,15 @@ // For serial echo, the number of digits after the decimal point //#define SERIAL_FLOAT_PRECISION 4 +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + // @section extras /** @@ -3780,15 +3789,6 @@ //#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others) -/** - * Set the number of proportional font spaces required to fill up a typical character space. - * This can help to better align the output of commands like `G29 O` Mesh Output. - * - * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. - * Otherwise, adjust according to your client and font. - */ -#define PROPORTIONAL_FONT_RATIO 1.0 - /** * Spend 28 bytes of SRAM to optimize the G-code parser */ From b0fdbede9c98e8b807dd4a7a291b1b668c1a8e15 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Sat, 26 Feb 2022 20:30:33 +0000 Subject: [PATCH 128/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20steps-to-mm=20with?= =?UTF-8?q?=20backlash=20(#23814)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/feature/backlash.cpp | 31 ++++++++++++++++++++++++++----- Marlin/src/feature/backlash.h | 9 ++++++++- Marlin/src/module/planner.cpp | 27 ++++++++++++++++++++------- 3 files changed, 54 insertions(+), 13 deletions(-) diff --git a/Marlin/src/feature/backlash.cpp b/Marlin/src/feature/backlash.cpp index 24c0f2ca0c15..23458cf86cb9 100644 --- a/Marlin/src/feature/backlash.cpp +++ b/Marlin/src/feature/backlash.cpp @@ -29,6 +29,11 @@ #include "../module/motion.h" #include "../module/planner.h" +axis_bits_t Backlash::last_direction_bits; +#ifdef BACKLASH_SMOOTHING_MM + xyz_long_t Backlash::residual_error{0}; +#endif + #ifdef BACKLASH_DISTANCE_MM #if ENABLED(BACKLASH_GCODE) xyz_float_t Backlash::distance_mm = BACKLASH_DISTANCE_MM; @@ -61,7 +66,6 @@ Backlash backlash; */ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const axis_bits_t dm, block_t * const block) { - static axis_bits_t last_direction_bits; axis_bits_t changed_dir = last_direction_bits ^ dm; // Ignore direction change unless steps are taken in that direction #if DISABLED(CORE_BACKLASH) || EITHER(MARKFORGED_XY, MARKFORGED_YX) @@ -91,10 +95,6 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const // smoothing distance. Since the computation of this proportion involves a floating point // division, defer computation until needed. float segment_proportion = 0; - - // Residual error carried forward across multiple segments, so correction can be applied - // to segments where there is no direction change. - static xyz_long_t residual_error{0}; #else // No direction change, no correction. if (!changed_dir) return; @@ -153,6 +153,27 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const } } +int32_t Backlash::applied_steps(const AxisEnum axis) { + if (axis >= LINEAR_AXES) return 0; + + const bool reversing = TEST(last_direction_bits, axis); + + #ifdef BACKLASH_SMOOTHING_MM + const int32_t residual_error_axis = residual_error[axis]; + #else + constexpr int32_t residual_error_axis = 0; + #endif + + // At startup it is assumed the last move was forwards. So the applied + // steps will always be a non-positive number. + + if (!reversing) return -residual_error_axis; + + const float f_corr = float(correction) / 255.0f; + const int32_t full_error_axis = -f_corr * distance_mm[axis] * planner.settings.axis_steps_per_mm[axis]; + return full_error_axis - residual_error_axis; +} + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) #include "../module/probe.h" diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index 17504cc78181..ef29012cb146 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -27,6 +27,12 @@ constexpr uint8_t all_on = 0xFF, all_off = 0x00; class Backlash { +private: + static axis_bits_t last_direction_bits; + #ifdef BACKLASH_SMOOTHING_MM + static xyz_long_t residual_error; + #endif + public: #if ENABLED(BACKLASH_GCODE) static xyz_float_t distance_mm; @@ -71,7 +77,8 @@ class Backlash { return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS); } - void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const axis_bits_t dm, block_t * const block); + static void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const axis_bits_t dm, block_t * const block); + static int32_t applied_steps(const AxisEnum axis); }; extern Backlash backlash; diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index d2e11f62fefe..37b264a3c55e 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1706,7 +1706,8 @@ void Planner::endstop_triggered(const AxisEnum axis) { } float Planner::triggered_position_mm(const AxisEnum axis) { - return stepper.triggered_position(axis) * mm_per_step[axis]; + const float result = DIFF_TERN(BACKLASH_COMPENSATION, stepper.triggered_position(axis), backlash.applied_steps(axis)); + return result * mm_per_step[axis]; } void Planner::finish_and_disable() { @@ -1728,8 +1729,8 @@ float Planner::get_axis_position_mm(const AxisEnum axis) { // Protect the access to the position. const bool was_enabled = stepper.suspend(); - const int32_t p1 = stepper.position(CORE_AXIS_1), - p2 = stepper.position(CORE_AXIS_2); + const int32_t p1 = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(CORE_AXIS_1), backlash.applied_steps(CORE_AXIS_1)), + p2 = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(CORE_AXIS_2), backlash.applied_steps(CORE_AXIS_2)); if (was_enabled) stepper.wake_up(); @@ -1738,7 +1739,7 @@ float Planner::get_axis_position_mm(const AxisEnum axis) { axis_steps = (axis == CORE_AXIS_2 ? CORESIGN(p1 - p2) : p1 + p2) * 0.5f; } else - axis_steps = stepper.position(axis); + axis_steps = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(axis), backlash.applied_steps(axis)); #elif EITHER(MARKFORGED_XY, MARKFORGED_YX) @@ -1755,11 +1756,12 @@ float Planner::get_axis_position_mm(const AxisEnum axis) { axis_steps = ((axis == CORE_AXIS_1) ? p1 - p2 : p2); } else - axis_steps = stepper.position(axis); + axis_steps = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(axis), backlash.applied_steps(axis)); #else axis_steps = stepper.position(axis); + TERN_(BACKLASH_COMPENSATION, axis_steps -= backlash.applied_steps(axis)); #endif @@ -2841,6 +2843,9 @@ void Planner::buffer_sync_block(TERN_(LASER_SYNCHRONOUS_M106_M107, uint8_t sync_ block->flag = sync_flag; block->position = position; + #if ENABLED(BACKLASH_COMPENSATION) + LOOP_LINEAR_AXES(axis) block->position[axis] += backlash.applied_steps((AxisEnum)axis); + #endif #if BOTH(HAS_FAN, LASER_SYNCHRONOUS_M106_M107) FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i]; @@ -3108,13 +3113,21 @@ void Planner::set_machine_position_mm(const abce_pos_t &abce) { LROUND(abce.k * settings.axis_steps_per_mm[K_AXIS]) ) ); + if (has_blocks_queued()) { //previous_nominal_speed_sqr = 0.0; // Reset planner junction speeds. Assume start from rest. //previous_speed.reset(); buffer_sync_block(); } - else - stepper.set_position(position); + else { + #if ENABLED(BACKLASH_COMPENSATION) + abce_long_t stepper_pos = position; + LOOP_LINEAR_AXES(axis) stepper_pos[axis] += backlash.applied_steps((AxisEnum)axis); + stepper.set_position(stepper_pos); + #else + stepper.set_position(position); + #endif + } } void Planner::set_position_mm(const xyze_pos_t &xyze) { From 893c6624384d68f7c6da7a383380fa13ccfc1ad0 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 27 Feb 2022 09:34:44 +1300 Subject: [PATCH 129/502] =?UTF-8?q?=F0=9F=90=9B=20ESP32=20=5Fdelay=5Fms,?= =?UTF-8?q?=20fix=20u8g=5Fesp32=5Fspi.cpp=20(#23810)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/ESP32/HAL.cpp | 2 ++ Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index adf5cecabe41..4000dcc90853 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -167,6 +167,8 @@ uint8_t MarlinHAL::get_reset_source() { return rtc_get_reset_reason(1); } void MarlinHAL::reboot() { ESP.restart(); } +void _delay_ms(int delay_ms) { delay(delay_ms); } + // return free memory between end of heap (or end bss) and whatever is current int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); } diff --git a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp index e454130d43f3..0aa66ed2cf0d 100644 --- a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp +++ b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp @@ -30,6 +30,7 @@ #include #include "Arduino.h" #include "../shared/HAL_SPI.h" +#include "HAL.h" #include "SPI.h" static SPISettings spiConfig; From d2cd3f2e6830f10846871e6ce83342593c6cd67e Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 27 Feb 2022 11:45:33 +1300 Subject: [PATCH 130/502] =?UTF-8?q?=E2=9C=A8=20MKS=20Robin=20Nano=203.1=20?= =?UTF-8?q?(#23795)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 21 +++---- Marlin/src/pins/pins.h | 2 + .../boards/marlin_STM32F407VET6_CCM.json | 56 +++++++++++++++++++ ini/stm32f4.ini | 23 ++++++++ 4 files changed, 92 insertions(+), 10 deletions(-) create mode 100644 buildroot/share/PlatformIO/boards/marlin_STM32F407VET6_CCM.json diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 4435452005ba..5ee99b533f62 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -404,16 +404,17 @@ #define BOARD_MKS_ROBIN2 4226 // MKS_ROBIN2 (STM32F407ZE) #define BOARD_MKS_ROBIN_PRO_V2 4227 // MKS Robin Pro V2 (STM32F407VE) #define BOARD_MKS_ROBIN_NANO_V3 4228 // MKS Robin Nano V3 (STM32F407VG) -#define BOARD_MKS_MONSTER8 4229 // MKS Monster8 (STM32F407VG) -#define BOARD_ANET_ET4 4230 // ANET ET4 V1.x (STM32F407VG) -#define BOARD_ANET_ET4P 4231 // ANET ET4P V1.x (STM32F407VG) -#define BOARD_FYSETC_CHEETAH_V20 4232 // FYSETC Cheetah V2.0 -#define BOARD_TH3D_EZBOARD_V2 4233 // TH3D EZBoard v2.0 -#define BOARD_INDEX_REV03 4234 // Index PnP Controller REV03 (STM32F407VE/VG) -#define BOARD_MKS_ROBIN_NANO_V1_3_F4 4235 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VE) -#define BOARD_MKS_EAGLE 4236 // MKS Eagle (STM32F407VE) -#define BOARD_ARTILLERY_RUBY 4237 // Artillery Ruby (STM32F401RC) -#define BOARD_FYSETC_SPIDER_V2_2 4238 // FYSETC Spider V2.2 (STM32F446VE) +#define BOARD_MKS_ROBIN_NANO_V3_1 4229 // MKS Robin Nano V3.1 (STM32F407VE) +#define BOARD_MKS_MONSTER8 4230 // MKS Monster8 (STM32F407VG) +#define BOARD_ANET_ET4 4231 // ANET ET4 V1.x (STM32F407VG) +#define BOARD_ANET_ET4P 4232 // ANET ET4P V1.x (STM32F407VG) +#define BOARD_FYSETC_CHEETAH_V20 4233 // FYSETC Cheetah V2.0 +#define BOARD_TH3D_EZBOARD_V2 4234 // TH3D EZBoard v2.0 +#define BOARD_INDEX_REV03 4235 // Index PnP Controller REV03 (STM32F407VE/VG) +#define BOARD_MKS_ROBIN_NANO_V1_3_F4 4236 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VE) +#define BOARD_MKS_EAGLE 4237 // MKS Eagle (STM32F407VE) +#define BOARD_ARTILLERY_RUBY 4238 // Artillery Ruby (STM32F401RC) +#define BOARD_FYSETC_SPIDER_V2_2 4239 // FYSETC Spider V2.2 (STM32F446VE) // // ARM Cortex M7 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 0afff4bd42a9..88e7946edc41 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -669,6 +669,8 @@ #include "stm32f4/pins_MKS_ROBIN_PRO_V2.h" // STM32F4 env:mks_robin_pro2 #elif MB(MKS_ROBIN_NANO_V3) #include "stm32f4/pins_MKS_ROBIN_NANO_V3.h" // STM32F4 env:mks_robin_nano_v3 env:mks_robin_nano_v3_usb_flash_drive env:mks_robin_nano_v3_usb_flash_drive_msc +#elif MB(MKS_ROBIN_NANO_V3_1) + #include "stm32f4/pins_MKS_ROBIN_NANO_V3.h" // STM32F4 env:mks_robin_nano_v3_1 env:mks_robin_nano_v3_1_usb_flash_drive env:mks_robin_nano_v3_1_usb_flash_drive_msc #elif MB(ANET_ET4) #include "stm32f4/pins_ANET_ET4.h" // STM32F4 env:Anet_ET4_OpenBLT #elif MB(ANET_ET4P) diff --git a/buildroot/share/PlatformIO/boards/marlin_STM32F407VET6_CCM.json b/buildroot/share/PlatformIO/boards/marlin_STM32F407VET6_CCM.json new file mode 100644 index 000000000000..faf32c200e47 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/marlin_STM32F407VET6_CCM.json @@ -0,0 +1,56 @@ +{ + "build": { + "core": "stm32", + "cpu": "cortex-m4", + "extra_flags": "-DSTM32F407xx -DSTM32F4", + "f_cpu": "168000000L", + "hwids": [ + [ + "0x1EAF", + "0x0003" + ], + [ + "0x0483", + "0x3748" + ] + ], + "mcu": "stm32f407vet6", + "product_line": "STM32F407xx", + "variant": "Generic_F4x7Vx" + }, + "debug": { + "default_tools": [ + "stlink" + ], + "jlink_device": "STM32F407VE", + "openocd_extra_args": [ + "-c", + "reset_config none" + ], + "openocd_target": "stm32f4x", + "svd_path": "STM32F40x.svd" + }, + "frameworks": [ + "arduino", + "cmsis", + "stm32cube", + "libopencm3" + ], + "name": "STM32F407VE (128k RAM, 64k CCM RAM, 512k Flash", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 131072, + "maximum_size": 524288, + "protocol": "stlink", + "protocols": [ + "stlink", + "dfu", + "jlink" + ], + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32f4-series/stm32f407-417/stm32f407vg.html", + "vendor": "Generic" +} diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index c7d70dd01de2..9e6e21342730 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -440,6 +440,29 @@ build_flags = ${env:mks_robin_nano_v3_usb_flash_drive.build_flags} -DUSBD_USE_CDC_MSC build_unflags = -DUSBD_USE_CDC +# +# MKS Robin Nano V3_1 +# +[env:mks_robin_nano_v3_1] +extends = env:mks_robin_nano_v3 +board = marlin_STM32F407VET6_CCM + +# +# MKS Robin Nano V3.1 with USB Flash Drive Support +# Currently, using a STM32duino fork, until USB Host get merged +# +[env:mks_robin_nano_v3_1_usb_flash_drive] +extends = env:mks_robin_nano_v3_usb_flash_drive +board = marlin_STM32F407VET6_CCM + +# +# MKS Robin Nano V3.1 with USB Flash Drive Support and Shared Media +# Currently, using a STM32duino fork, until USB Host and USB Device MSC get merged +# +[env:mks_robin_nano_v3_1_usb_flash_drive_msc] +extends = env:mks_robin_nano_v3_usb_flash_drive_msc +board = marlin_STM32F407VET6_CCM + # # MKS Eagle # 5 TMC2209 uart mode on board From c0288590b3319dd0a7afffbd52587b6071596cbb Mon Sep 17 00:00:00 2001 From: sam <8531653+minteyay@users.noreply.github.com> Date: Sun, 27 Feb 2022 00:48:59 +0200 Subject: [PATCH 131/502] =?UTF-8?q?=F0=9F=93=BA=20BTT=20SKR=20Mini=20E3=20?= =?UTF-8?q?with=20Fysetc=20V2.1=20/=20MKS=20V3=20/=20BTT=20V1=20Mini=20128?= =?UTF-8?q?64=20(#23793)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stm32f1/pins_BTT_SKR_MINI_E3_common.h | 66 ++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index a8ba9049efee..92d65babfa70 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -235,9 +235,73 @@ #define TFTGLCD_CS PA9 #endif + + #elif ENABLED(FYSETC_MINI_12864_2_1) + + #error "CAUTION! FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864_V1 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue." + + /** + * FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864_V1 display pinout + * + * Board Display + * ------ ------ + * PB5 |10 9 | PA15 (BEEP) |10 9 | BTN_ENC + * PA9 | 8 7 | RESET LCD_CS | 8 7 | LCD A0 + * PA10 | 6 5 | PB9 LCD_RST | 6 5 | RED + * PB8 | 4 3 | PB15 (GREEN) | 4 3 | (BLUE) + * GND | 2 1 | 5V GND | 2 1 | 5V + * ------ ------ + * EXP1 EXP1 + * + * --- ------ + * RST | 1 | (MISO) |10 9 | SCK + * (RX2) PA2 | 2 | BTN_EN1 | 8 7 | (SS) + * (TX2) PA3 | 3 | BTN_EN2 | 6 5 | MOSI + * GND | 4 | (CD) | 4 3 | (RST) + * 5V | 5 | (GND) | 2 1 | (KILL) + * --- ------ + * TFT EXP2 + * + * Needs custom cable: + * + * Board Display + * + * EXP1-1 ----------- EXP1-1 + * EXP1-2 ----------- EXP1-2 + * EXP1-3 ----------- EXP2-6 + * EXP1-4 ----------- EXP1-5 + * EXP1-5 ----------- EXP2-8 + * EXP1-6 ----------- EXP1-6 + * EXP1-8 ----------- EXP1-8 + * EXP1-9 ----------- EXP1-9 + * EXP1-10 ----------- EXP1-7 + * + * TFT-2 ----------- EXP2-9 + * TFT-3 ----------- EXP2-5 + * + * for backlight configuration see steps 2 (V2.1) and 3 in https://wiki.fysetc.com/Mini12864_Panel/ + */ + + #define LCD_PINS_RS PA9 // CS + #define LCD_PINS_ENABLE PA3 // MOSI + #define LCD_BACKLIGHT_PIN -1 + #define NEOPIXEL_PIN PB8 + #define LCD_CONTRAST 255 + #define LCD_RESET_PIN PA10 + + #define DOGLCD_CS PA9 + #define DOGLCD_A0 PB5 + #define DOGLCD_SCK PA2 + #define DOGLCD_MOSI PA3 + + #define BTN_ENC PA15 + #define BTN_EN1 PB9 + #define BTN_EN2 PB15 + + #define FORCE_SOFT_SPI #else - #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BIGTREE_SKR_MINI_E3." + #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, TFTGLCD_PANEL_(SPI|I2C), FYSETC_MINI_12864_2_1, MKS_MINI_12864_V3, and BTT_MINI_12864_V1 are currently supported on the BIGTREE_SKR_MINI_E3." #endif #endif // HAS_WIRED_LCD From 3db2fecaa443634f80203b0762d503b7c706951e Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 27 Feb 2022 11:50:17 +1300 Subject: [PATCH 132/502] =?UTF-8?q?=F0=9F=94=A7=20SHOW=5FCUSTOM=5FBOOTSCRE?= =?UTF-8?q?EN=20sanity-check=20(#23807)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 9c74ce32db82..7b335dc9295c 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -860,6 +860,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS */ #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE) #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE." +#elif ENABLED(SHOW_CUSTOM_BOOTSCREEN) && DISABLED(SHOW_BOOTSCREEN) + #error "SHOW_CUSTOM_BOOTSCREEN requires SHOW_BOOTSCREEN." #elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB #error "CUSTOM_STATUS_SCREEN_IMAGE requires a 128x64 DOGM B/W Graphical LCD." #endif From 39001bd8d22f8a6f3b36b4b923b3ace359416c0a Mon Sep 17 00:00:00 2001 From: "M. FURIC Franck" Date: Sat, 26 Feb 2022 23:54:04 +0100 Subject: [PATCH 133/502] =?UTF-8?q?=E2=9C=A8=20LCD=20Backlight=20Timer=20(?= =?UTF-8?q?#23768)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 2 +- Marlin/Configuration_adv.h | 5 ++++ Marlin/src/inc/SanityCheck.h | 8 ++++++ Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/lcd/language/language_fr.h | 1 + Marlin/src/lcd/marlinui.cpp | 24 ++++++++++++++-- Marlin/src/lcd/marlinui.h | 8 ++++++ Marlin/src/lcd/menu/menu_configuration.cpp | 4 +++ Marlin/src/module/settings.cpp | 32 ++++++++++++++++++++++ 9 files changed, 82 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6f7b1bdf4a30..7162e74acbcf 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2820,7 +2820,7 @@ #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus - //#define TOUCH_IDLE_SLEEP 300 // (secs) Turn off the TFT backlight if set (5mn) + //#define TOUCH_IDLE_SLEEP 300 // (s) Turn off the TFT backlight if set (5mn) #define TOUCH_SCREEN_CALIBRATION diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 910e779b2a54..4a9cb77b8bc1 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1277,6 +1277,11 @@ #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 #endif +// +// LCD Backlight Timeout +// +//#define LCD_BACKLIGHT_TIMEOUT 30 // (s) Timeout before turning off the backlight + #if HAS_BED_PROBE && EITHER(HAS_MARLINUI_MENU, HAS_TFT_LVGL_UI) //#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu #if ENABLED(PROBE_OFFSET_WIZARD) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 7b335dc9295c..e847339e2aff 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2857,6 +2857,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif +#if LCD_BACKLIGHT_TIMEOUT + #if !HAS_ENCODER_ACTION + #error "LCD_BACKLIGHT_TIMEOUT requires an LCD with encoder or keypad." + #elif !PIN_EXISTS(LCD_BACKLIGHT) + #error "LCD_BACKLIGHT_TIMEOUT requires LCD_BACKLIGHT_PIN." + #endif +#endif + /** * Some boards forbid the use of -1 Native USB */ diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index d8d161701fdb..9925f225e381 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -402,6 +402,7 @@ namespace Language_en { LSTR MSG_ADVANCE_K_E = _UxGT("Advance K *"); LSTR MSG_CONTRAST = _UxGT("LCD Contrast"); LSTR MSG_BRIGHTNESS = _UxGT("LCD Brightness"); + LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD Sleep (s)"); LSTR MSG_STORE_EEPROM = _UxGT("Store Settings"); LSTR MSG_LOAD_EEPROM = _UxGT("Load Settings"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Restore Defaults"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 2eb64fc2c228..02f9d2f54994 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -335,6 +335,7 @@ namespace Language_fr { LSTR MSG_ADVANCE_K_E = _UxGT("Avance K *"); LSTR MSG_BRIGHTNESS = _UxGT("Luminosité LCD"); LSTR MSG_CONTRAST = _UxGT("Contraste LCD"); + LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("Veille LCD (s)"); LSTR MSG_STORE_EEPROM = _UxGT("Enregistrer config."); LSTR MSG_LOAD_EEPROM = _UxGT("Charger config."); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Restaurer défauts"); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index d0cc2a25b8a3..d2884cc3f16f 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -180,6 +180,15 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update #endif +#if LCD_BACKLIGHT_TIMEOUT + uint16_t MarlinUI::lcd_backlight_timeout; // Initialized by settings.load() + millis_t MarlinUI::backlight_off_ms = 0; + void MarlinUI::refresh_backlight_timeout() { + backlight_off_ms = lcd_backlight_timeout ? millis() + lcd_backlight_timeout * 1000UL : 0; + WRITE(LCD_BACKLIGHT_PIN, HIGH); + } +#endif + void MarlinUI::init() { init_lcd(); @@ -1033,14 +1042,18 @@ void MarlinUI::init() { reset_status_timeout(ms); + #if LCD_BACKLIGHT_TIMEOUT + refresh_backlight_timeout(); + #endif + refresh(LCDVIEW_REDRAW_NOW); #if LED_POWEROFF_TIMEOUT > 0 if (!powerManager.psu_on) leds.reset_timeout(ms); #endif - } + } // encoder activity - #endif + #endif // HAS_ENCODER_ACTION // This runs every ~100ms when idling often enough. // Instead of tracking changes just redraw the Status Screen once per second. @@ -1137,6 +1150,13 @@ void MarlinUI::init() { return_to_status(); #endif + #if LCD_BACKLIGHT_TIMEOUT + if (backlight_off_ms && ELAPSED(ms, backlight_off_ms)) { + WRITE(LCD_BACKLIGHT_PIN, LOW); // Backlight off + backlight_off_ms = 0; + } + #endif + // Change state of drawing flag between screen updates if (!drawing_screen) switch (lcdDrawUpdate) { case LCDVIEW_CLEAR_CALL_REDRAW: diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 17c246873788..15e9f73d653b 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -275,6 +275,14 @@ class MarlinUI { FORCE_INLINE static void refresh_brightness() { set_brightness(brightness); } #endif + #if LCD_BACKLIGHT_TIMEOUT + #define LCD_BKL_TIMEOUT_MIN 1 + #define LCD_BKL_TIMEOUT_MAX (60*60*18) // 18 hours max within uint16_t + static uint16_t lcd_backlight_timeout; + static millis_t backlight_off_ms; + static void refresh_backlight_timeout(); + #endif + #if HAS_DWIN_E3V2_BASIC static void refresh(); #else diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 33e43b08ebda..b4e9287bd4a3 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -541,6 +541,10 @@ void menu_configuration() { #if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN < LCD_CONTRAST_MAX EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true); #endif + #if LCD_BACKLIGHT_TIMEOUT && LCD_BKL_TIMEOUT_MIN < LCD_BKL_TIMEOUT_MAX + EDIT_ITEM(uint16_4, MSG_LCD_BKL_TIMEOUT, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout); + #endif + #if ENABLED(FWRETRACT) SUBMENU(MSG_RETRACT, menu_config_retract); #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index bcbe8fa985ee..66316edbbb32 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -391,6 +391,13 @@ typedef struct SettingsDataStruct { // uint8_t lcd_brightness; // M256 B + // + // LCD_BACKLIGHT_TIMEOUT + // + #if LCD_BACKLIGHT_TIMEOUT + uint16_t lcd_backlight_timeout; // (G-code needed) + #endif + // // Controller fan settings // @@ -607,6 +614,10 @@ void MarlinSettings::postprocess() { // Moved as last update due to interference with Neopixel init TERN_(HAS_LCD_CONTRAST, ui.refresh_contrast()); TERN_(HAS_LCD_BRIGHTNESS, ui.refresh_brightness()); + + #if LCD_BACKLIGHT_TIMEOUT + ui.refresh_backlight_timeout(); + #endif } #if BOTH(PRINTCOUNTER, EEPROM_SETTINGS) @@ -1108,6 +1119,13 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(lcd_brightness); } + // + // LCD Backlight Timeout + // + #if LCD_BACKLIGHT_TIMEOUT + EEPROM_WRITE(ui.lcd_backlight_timeout); + #endif + // // Controller Fan // @@ -2015,6 +2033,13 @@ void MarlinSettings::postprocess() { TERN_(HAS_LCD_BRIGHTNESS, if (!validating) ui.brightness = lcd_brightness); } + // + // LCD Backlight Timeout + // + #if LCD_BACKLIGHT_TIMEOUT + EEPROM_READ(ui.lcd_backlight_timeout); + #endif + // // Controller Fan // @@ -3040,6 +3065,13 @@ void MarlinSettings::reset() { // TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = LCD_BRIGHTNESS_DEFAULT); + // + // LCD Backlight Timeout + // + #if LCD_BACKLIGHT_TIMEOUT + ui.lcd_backlight_timeout = LCD_BACKLIGHT_TIMEOUT; + #endif + // // Controller Fan // From feafb7d49af67dd11172baf883d307eaea1e1b26 Mon Sep 17 00:00:00 2001 From: kisslorand <50251547+kisslorand@users.noreply.github.com> Date: Mon, 28 Feb 2022 04:38:11 +0200 Subject: [PATCH 134/502] =?UTF-8?q?=E2=9C=A8=20M21=20P=20/=20S=20/=20U=20-?= =?UTF-8?q?=20Select=20Volume=20(#23780)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 5 ++++- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/gcode/host/M115.cpp | 5 +++++ Marlin/src/gcode/sd/M21_M22.cpp | 15 ++++++++++++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 4a9cb77b8bc1..e5379ed84fc5 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1631,7 +1631,10 @@ // Enable if SD detect is rendered useless (e.g., by using an SD extender) //#define NO_SD_DETECT - // Multiple volume support - EXPERIMENTAL. + /** + * Multiple volume support - EXPERIMENTAL. + * Adds 'M21 Pm' / 'M21 S' / 'M21 U' to mount SD Card / USB Drive. + */ //#define MULTI_VOLUME #if ENABLED(MULTI_VOLUME) #define VOLUME_SD_ONBOARD diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 78dd0bc68007..a150aca41d62 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -91,7 +91,7 @@ * *** Print from Media (SDSUPPORT) *** * M20 - List SD card. (Requires SDSUPPORT) - * M21 - Init SD card. (Requires SDSUPPORT) + * M21 - Init SD card. (Requires SDSUPPORT) With MULTI_VOLUME select a drive with `M21 Pn` / 'M21 S' / 'M21 U'. * M22 - Release SD card. (Requires SDSUPPORT) * M23 - Select SD file: "M23 /path/file.gco". (Requires SDSUPPORT) * M24 - Start/resume SD print. (Requires SDSUPPORT) diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index 45e0061a5b84..36731c23da16 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -142,6 +142,11 @@ void GcodeSuite::M115() { // SDCARD (M20, M23, M24, etc.) cap_line(F("SDCARD"), ENABLED(SDSUPPORT)); + // MULTI_VOLUME (M21 S/M21 U) + #if ENABLED(SDSUPPORT) + cap_line(F("MULTI_VOLUME"), ENABLED(MULTI_VOLUME)); + #endif + // REPEAT (M808) cap_line(F("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS)); diff --git a/Marlin/src/gcode/sd/M21_M22.cpp b/Marlin/src/gcode/sd/M21_M22.cpp index c7f41f9c817e..aec0de27ca5c 100644 --- a/Marlin/src/gcode/sd/M21_M22.cpp +++ b/Marlin/src/gcode/sd/M21_M22.cpp @@ -29,8 +29,21 @@ /** * M21: Init SD Card + * + * With MULTI_VOLUME: + * P0 or S - Change to the SD Card and mount it + * P1 or U - Change to the USB Drive and mount it */ -void GcodeSuite::M21() { card.mount(); } +void GcodeSuite::M21() { + #if ENABLED(MULTI_VOLUME) + const int8_t vol = parser.intval('P', -1); + if (vol == 0 || parser.seen_test('S')) // "S" for SD Card + card.changeMedia(&card.media_driver_sdcard); + else if (vol == 1 || parser.seen_test('U')) // "U" for USB + card.changeMedia(&card.media_driver_usbFlash); + #endif + card.mount(); +} /** * M22: Release SD Card From 35d11070b493a03e0011f96ec5af0ba72662dbe7 Mon Sep 17 00:00:00 2001 From: Ludy Date: Tue, 1 Mar 2022 23:09:11 +0100 Subject: [PATCH 135/502] =?UTF-8?q?=F0=9F=8C=90=20Update=20German=20langua?= =?UTF-8?q?ge=20(#23832)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_de.h | 150 ++++++++++++++++++++- Marlin/src/lcd/language/language_jp_kana.h | 1 - 2 files changed, 143 insertions(+), 8 deletions(-) diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 6a5f504e911d..bf408d436f12 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -56,19 +56,42 @@ namespace Language_de { LSTR MSG_DISABLE_STEPPERS = _UxGT("Motoren deaktivieren"); // M84 :: Max length 19 characters LSTR MSG_DEBUG_MENU = _UxGT("Debug-Menü"); LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Statusbalken-Test"); + LSTR MSG_HOMING = _UxGT("Homing"); LSTR MSG_AUTO_HOME = _UxGT("Auto Home"); + LSTR MSG_AUTO_HOME_A = _UxGT("Home @"); LSTR MSG_AUTO_HOME_X = _UxGT("Home X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Home Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Home Z"); + LSTR MSG_FILAMENT_SET = _UxGT("Fila. Einstellungen"); + LSTR MSG_FILAMENT_MAN = _UxGT("Filament Management"); + LSTR MSG_LEVBED_FL = _UxGT("Vorne Links"); + LSTR MSG_LEVBED_FR = _UxGT("Vorne Rechts"); + LSTR MSG_LEVBED_C = _UxGT("Mitte"); + LSTR MSG_LEVBED_BL = _UxGT("Hinten Links"); + LSTR MSG_LEVBED_BR = _UxGT("Hinten Rechts"); + LSTR MSG_MANUAL_MESH = _UxGT("manuelles Netz"); + LSTR MSG_AUTO_MESH = _UxGT("Netz auto. erstellen"); LSTR MSG_AUTO_Z_ALIGN = _UxGT("Z-Achsen ausgleichen"); + LSTR MSG_ITERATION = _UxGT("G34 Iteration: %i"); + LSTR MSG_DECREASING_ACCURACY = _UxGT("Genauigkeit sinkt!"); + LSTR MSG_ACCURACY_ACHIEVED = _UxGT("Genauigkeit erreicht"); LSTR MSG_LEVEL_BED_HOMING = _UxGT("XYZ homen"); LSTR MSG_LEVEL_BED_WAITING = _UxGT("Klick zum Starten"); LSTR MSG_LEVEL_BED_NEXT_POINT = _UxGT("Nächste Koordinate"); LSTR MSG_LEVEL_BED_DONE = _UxGT("Nivellieren fertig!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Ausblendhöhe"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Setze Homeversatz"); + LSTR MSG_HOME_OFFSET_X = _UxGT("Homeversatz X"); + LSTR MSG_HOME_OFFSET_Y = _UxGT("Homeversatz Y"); + LSTR MSG_HOME_OFFSET_Z = _UxGT("Homeversatz Z"); + LSTR MSG_HOME_OFFSET_I = _UxGT("Homeversatz ") STR_I; + LSTR MSG_HOME_OFFSET_J = _UxGT("Homeversatz ") STR_J; + LSTR MSG_HOME_OFFSET_K = _UxGT("Homeversatz ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Homeversatz aktiv"); LSTR MSG_SET_ORIGIN = _UxGT("Setze Nullpunkte"); //"G92 X0 Y0 Z0" commented out in marlinui.cpp + LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Assistent"); + LSTR MSG_SELECT_ORIGIN = _UxGT("Wählen Sie Ursprung"); + LSTR MSG_LAST_VALUE_SP = _UxGT("Letzter Wert "); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" Vorwärmen"); LSTR MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" Vorwärmen ~"); @@ -88,11 +111,21 @@ namespace Language_de { #endif LSTR MSG_PREHEAT_CUSTOM = _UxGT("benutzerdef. Heizen"); LSTR MSG_COOLDOWN = _UxGT("Abkühlen"); + LSTR MSG_CUTTER_FREQUENCY = _UxGT("Frequenz"); LSTR MSG_LASER_MENU = _UxGT("Laser"); - LSTR MSG_LASER_POWER = _UxGT("Laserleistung"); LSTR MSG_SPINDLE_MENU = _UxGT("Spindel-Steuerung"); + LSTR MSG_LASER_POWER = _UxGT("Laserleistung"); LSTR MSG_SPINDLE_POWER = _UxGT("Spindelleistung"); + LSTR MSG_LASER_TOGGLE = _UxGT("Laser umschalten"); + LSTR MSG_LASER_EVAC_TOGGLE = _UxGT("Gebläse umschalten"); + LSTR MSG_LASER_ASSIST_TOGGLE = _UxGT("Luftunterstützung"); + LSTR MSG_LASER_PULSE_MS = _UxGT("Test Impuls ms"); + LSTR MSG_LASER_FIRE_PULSE = _UxGT("Fire Impuls"); + LSTR MSG_FLOWMETER_FAULT = _UxGT("Feh. Kühlmittelfluss"); + LSTR MSG_SPINDLE_TOGGLE = _UxGT("Spindel umschalten"); + LSTR MSG_SPINDLE_EVAC_TOGGLE = _UxGT("Vakuum umschalten"); + LSTR MSG_SPINDLE_FORWARD = _UxGT("Spindel vorwärts"); LSTR MSG_SPINDLE_REVERSE = _UxGT("Spindelrichtung"); LSTR MSG_SWITCH_PS_ON = _UxGT("Netzteil ein"); LSTR MSG_SWITCH_PS_OFF = _UxGT("Netzteil aus"); @@ -102,10 +135,17 @@ namespace Language_de { LSTR MSG_BED_LEVELING = _UxGT("Bett-Nivellierung"); LSTR MSG_LEVEL_BED = _UxGT("Bett nivellieren"); LSTR MSG_BED_TRAMMING = _UxGT("Bett ausrichten"); + LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Das Bett anpassen, bis zum auslösen."); + LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Ecken in der Toleranz. Bett ausger."); + LSTR MSG_BED_TRAMMING_GOOD_POINTS = _UxGT("Gute Punkte: "); + LSTR MSG_BED_TRAMMING_LAST_Z = _UxGT("Letztes Z: "); LSTR MSG_NEXT_CORNER = _UxGT("Nächste Ecke"); LSTR MSG_MESH_EDITOR = _UxGT("Netz Editor"); + LSTR MSG_MESH_VIEWER = _UxGT("Netzbetrachter"); LSTR MSG_EDIT_MESH = _UxGT("Netz bearbeiten"); + LSTR MSG_MESH_VIEW = _UxGT("Netz ansehen"); LSTR MSG_EDITING_STOPPED = _UxGT("Netzbearb. angeh."); + LSTR MSG_NO_VALID_MESH = _UxGT("Kein gültiges Netz"); LSTR MSG_PROBING_POINT = _UxGT("Messpunkt"); LSTR MSG_MESH_X = _UxGT("Index X"); LSTR MSG_MESH_Y = _UxGT("Index Y"); @@ -121,6 +161,7 @@ namespace Language_de { LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplizieren"); LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Spiegelkopie"); LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("vollstä. Kontrolle"); + LSTR MSG_IDEX_DUPE_GAP = _UxGT("X-Lücke duplizieren"); LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2. Düse Z"); LSTR MSG_HOTEND_OFFSET_A = _UxGT("2. Düse @"); LSTR MSG_UBL_DOING_G29 = _UxGT("G29 ausführen"); @@ -128,6 +169,7 @@ namespace Language_de { LSTR MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); LSTR MSG_LCD_TILTING_MESH = _UxGT("Berührungspunkt"); LSTR MSG_UBL_MANUAL_MESH = _UxGT("Netz manuell erst."); + LSTR MSG_UBL_MESH_WIZARD = _UxGT("UBL Netz Assistent"); LSTR MSG_UBL_BC_INSERT = _UxGT("Unterlegen & messen"); LSTR MSG_UBL_BC_INSERT2 = _UxGT("Messen"); LSTR MSG_UBL_BC_REMOVE = _UxGT("Entfernen & messen"); @@ -212,6 +254,10 @@ namespace Language_de { LSTR MSG_SET_LEDS_VIOLET = _UxGT("Violett"); LSTR MSG_SET_LEDS_WHITE = _UxGT("Weiß"); LSTR MSG_SET_LEDS_DEFAULT = _UxGT("Standard"); + LSTR MSG_LED_CHANNEL_N = _UxGT("Kanal ="); + LSTR MSG_LEDS2 = _UxGT("Lichter #2"); + LSTR MSG_NEO2_PRESETS = _UxGT("Licht #2 Voreinst."); + LSTR MSG_NEO2_BRIGHTNESS = _UxGT("Helligkeit"); LSTR MSG_CUSTOM_LEDS = _UxGT("Benutzerdefiniert"); LSTR MSG_INTENSITY_R = _UxGT("Intensität Rot"); LSTR MSG_INTENSITY_G = _UxGT("Intensität Grün"); @@ -224,6 +270,9 @@ namespace Language_de { LSTR MSG_MOVE_X = _UxGT("Bewege X"); LSTR MSG_MOVE_Y = _UxGT("Bewege Y"); LSTR MSG_MOVE_Z = _UxGT("Bewege Z"); + LSTR MSG_MOVE_I = _UxGT("Bewege ") STR_I; + LSTR MSG_MOVE_J = _UxGT("Bewege ") STR_J; + LSTR MSG_MOVE_K = _UxGT("Bewege ") STR_K; LSTR MSG_MOVE_E = _UxGT("Bewege Extruder"); LSTR MSG_MOVE_EN = _UxGT("Bewege Extruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend zu kalt"); @@ -232,7 +281,17 @@ namespace Language_de { LSTR MSG_MOVE_1MM = _UxGT(" 1,0 mm"); LSTR MSG_MOVE_10MM = _UxGT(" 10,0 mm"); LSTR MSG_MOVE_100MM = _UxGT("100,0 mm"); + LSTR MSG_MOVE_0001IN = _UxGT("0.001 in"); + LSTR MSG_MOVE_001IN = _UxGT("0.010 in"); + LSTR MSG_MOVE_01IN = _UxGT("0.100 in"); + LSTR MSG_MOVE_1IN = _UxGT("1.000 in"); LSTR MSG_SPEED = _UxGT("Geschw."); + LSTR MSG_MAXSPEED = _UxGT("Max Geschw. (mm/s)"); + LSTR MSG_MAXSPEED_X = _UxGT("Max ") STR_A _UxGT(" Geschw."); + LSTR MSG_MAXSPEED_Y = _UxGT("Max ") STR_B _UxGT(" Geschw."); + LSTR MSG_MAXSPEED_Z = _UxGT("Max ") STR_C _UxGT(" Geschw."); + LSTR MSG_MAXSPEED_E = _UxGT("Max ") STR_E _UxGT(" Geschw."); + LSTR MSG_MAXSPEED_A = _UxGT("Max @ Geschw."); LSTR MSG_BED_Z = _UxGT("Bett Z"); LSTR MSG_NOZZLE = _UxGT("Düse"); LSTR MSG_NOZZLE_N = _UxGT("Düse ~"); @@ -240,6 +299,10 @@ namespace Language_de { LSTR MSG_NOZZLE_STANDBY = _UxGT("Düse bereit"); LSTR MSG_BED = _UxGT("Bett"); LSTR MSG_CHAMBER = _UxGT("Gehäuse"); + LSTR MSG_COOLER = _UxGT("Laser-Kühlmittel"); + LSTR MSG_COOLER_TOGGLE = _UxGT("Kühler umschalten"); + LSTR MSG_FLOWMETER_SAFETY = _UxGT("Durchflusssicherheit"); + LSTR MSG_LASER = _UxGT("Laser"); LSTR MSG_FAN_SPEED = _UxGT("Lüfter"); LSTR MSG_FAN_SPEED_N = _UxGT("Lüfter ~"); LSTR MSG_STORED_FAN_N = _UxGT("Gespeich. Lüfter ~"); @@ -261,6 +324,7 @@ namespace Language_de { LSTR MSG_LCD_OFF = _UxGT("aus"); LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); + LSTR MSG_PID_CYCLE = _UxGT("PID Zyklus"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID Tuning fertig"); LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune fehlge. Falscher Extruder"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune fehlge. Temperatur zu hoch."); @@ -289,7 +353,6 @@ namespace Language_de { LSTR MSG_VMIN = _UxGT("V min "); LSTR MSG_VTRAV_MIN = _UxGT("V min Leerfahrt"); LSTR MSG_ACCELERATION = _UxGT("Beschleunigung"); - LSTR MSG_AMAX = _UxGT("A max "); // space intentional LSTR MSG_AMAX_A = _UxGT("A max ") STR_A; LSTR MSG_AMAX_B = _UxGT("A max ") STR_B; LSTR MSG_AMAX_C = _UxGT("A max ") STR_C; @@ -324,6 +387,8 @@ namespace Language_de { LSTR MSG_ADVANCE_K = _UxGT("Vorschubfaktor"); LSTR MSG_ADVANCE_K_E = _UxGT("Vorschubfaktor *"); LSTR MSG_CONTRAST = _UxGT("LCD-Kontrast"); + LSTR MSG_BRIGHTNESS = _UxGT("LCD Helligkeit"); + LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD-Ruhezustand (s)"); LSTR MSG_STORE_EEPROM = _UxGT("Konfig. speichern"); LSTR MSG_LOAD_EEPROM = _UxGT("Konfig. laden"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Standardwerte laden"); @@ -353,20 +418,32 @@ namespace Language_de { LSTR MSG_BUTTON_DONE = _UxGT("Fertig"); LSTR MSG_BUTTON_BACK = _UxGT("Zurück"); LSTR MSG_BUTTON_PROCEED = _UxGT("Weiter"); + LSTR MSG_BUTTON_SKIP = _UxGT("Überspringen"); + LSTR MSG_BUTTON_INFO = _UxGT("Info"); + LSTR MSG_BUTTON_LEVEL = _UxGT("Level"); + LSTR MSG_BUTTON_PAUSE = _UxGT("Pause"); + LSTR MSG_BUTTON_RESUME = _UxGT("Fortsetzen"); + LSTR MSG_BUTTON_ADVANCED = _UxGT("Erweitert"); LSTR MSG_PAUSING = _UxGT("Pause..."); LSTR MSG_PAUSE_PRINT = _UxGT("SD-Druck pausieren"); + LSTR MSG_ADVANCED_PAUSE = _UxGT("Erweiterte Pause"); LSTR MSG_RESUME_PRINT = _UxGT("SD-Druck fortsetzen"); + LSTR MSG_HOST_START_PRINT = _UxGT("Host-Druck starten"); LSTR MSG_STOP_PRINT = _UxGT("SD-Druck abbrechen"); + LSTR MSG_END_LOOPS = _UxGT("Wiederholung beenden"); LSTR MSG_PRINTING_OBJECT = _UxGT("Objekt drucken"); LSTR MSG_CANCEL_OBJECT = _UxGT("Objekt abbrechen"); LSTR MSG_CANCEL_OBJECT_N = _UxGT("Objekt abbrechen ="); LSTR MSG_OUTAGE_RECOVERY = _UxGT("Wiederh. n. Stroma."); + LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Druckauftrag fortset."); LSTR MSG_MEDIA_MENU = _UxGT("Druck vom Medium"); LSTR MSG_NO_MEDIA = _UxGT("Kein Medium"); LSTR MSG_DWELL = _UxGT("Warten..."); LSTR MSG_USERWAIT = _UxGT("Klick zum Fortsetzen"); LSTR MSG_PRINT_PAUSED = _UxGT("Druck pausiert..."); LSTR MSG_PRINTING = _UxGT("Druckt..."); + LSTR MSG_STOPPING = _UxGT("Stoppen..."); + LSTR MSG_REMAINING_TIME = _UxGT("Verbleiben"); LSTR MSG_PRINT_ABORTED = _UxGT("Druck abgebrochen"); LSTR MSG_PRINT_DONE = _UxGT("Druck fertig"); LSTR MSG_NO_MOVE = _UxGT("Motoren angeschaltet"); @@ -416,6 +493,7 @@ namespace Language_de { LSTR MSG_BLTOUCH_STOW = _UxGT("Einfahren"); LSTR MSG_BLTOUCH_DEPLOY = _UxGT("Ausfahren"); LSTR MSG_BLTOUCH_SW_MODE = _UxGT("SW-Modus"); + LSTR MSG_BLTOUCH_SPEED_MODE = _UxGT("High Speed"); LSTR MSG_BLTOUCH_5V_MODE = _UxGT("5V-Modus"); LSTR MSG_BLTOUCH_OD_MODE = _UxGT("OD-Modus"); LSTR MSG_BLTOUCH_MODE_STORE = _UxGT("Mode-Store"); @@ -431,33 +509,43 @@ namespace Language_de { LSTR MSG_MANUAL_DEPLOY = _UxGT("Z-Sonde ausfahren"); LSTR MSG_MANUAL_STOW = _UxGT("Z-Sonde einfahren"); LSTR MSG_HOME_FIRST = _UxGT("Vorher %s%s%s homen"); + LSTR MSG_ZPROBE_SETTINGS = _UxGT("Sondeneinstellungen"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Sondenversatz"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Sondenversatz X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Sondenversatz Y"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Sondenversatz Z"); + LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Bewege Düse zum Bett"); LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; + LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; + LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Abbr. mit Endstopp"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("HEIZEN ERFOLGLOS"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("REDUND. TEMP-ABWEI."); LSTR MSG_THERMAL_RUNAWAY = " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); + LSTR MSG_TEMP_MALFUNCTION = _UxGT("TEMP-FEHLER"); LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("BETT") " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("GEH.") " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); + LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("Kühler Runaway"); + LSTR MSG_COOLING_FAILED = _UxGT("Kühlung fehlgeschla."); LSTR MSG_ERR_MAXTEMP = " " LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN"); LSTR MSG_ERR_MINTEMP = " " LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN"); LSTR MSG_HALTED = _UxGT("DRUCKER GESTOPPT"); + LSTR MSG_PLEASE_WAIT = _UxGT("Bitte warten..."); LSTR MSG_PLEASE_RESET = _UxGT("Bitte neustarten"); - LSTR MSG_SHORT_DAY = _UxGT("t"); // One character only - LSTR MSG_SHORT_HOUR = _UxGT("h"); // One character only - LSTR MSG_SHORT_MINUTE = _UxGT("m"); // One character only + LSTR MSG_PREHEATING = _UxGT("vorheizen..."); LSTR MSG_HEATING = _UxGT("heizt..."); LSTR MSG_COOLING = _UxGT("kühlt..."); LSTR MSG_BED_HEATING = _UxGT("Bett heizt..."); LSTR MSG_BED_COOLING = _UxGT("Bett kühlt..."); + LSTR MSG_PROBE_HEATING = _UxGT("Sonde heizt..."); + LSTR MSG_PROBE_COOLING = _UxGT("Sonde kühlt..."); LSTR MSG_CHAMBER_HEATING = _UxGT("Gehäuse heizt..."); LSTR MSG_CHAMBER_COOLING = _UxGT("Gehäuse kühlt..."); + LSTR MSG_LASER_COOLING = _UxGT("Laser kühlt..."); LSTR MSG_DELTA_CALIBRATE = _UxGT("Delta kalibrieren"); LSTR MSG_DELTA_CALIBRATE_X = _UxGT("Kalibriere X"); LSTR MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibriere Y"); @@ -475,8 +563,9 @@ namespace Language_de { LSTR MSG_3POINT_LEVELING = _UxGT("3-Punkt-Nivellierung"); LSTR MSG_LINEAR_LEVELING = _UxGT("Lineare Nivellierung"); LSTR MSG_BILINEAR_LEVELING = _UxGT("Bilineare Nivell."); - LSTR MSG_UBL_LEVELING = _UxGT("Unified Bed Leveling"); + LSTR MSG_UBL_LEVELING = _UxGT("Einheit. Bettnivell."); LSTR MSG_MESH_LEVELING = _UxGT("Netz-Nivellierung"); + LSTR MSG_MESH_DONE = _UxGT("Nivellierung fertig"); LSTR MSG_INFO_STATS_MENU = _UxGT("Drucker-Statistik"); LSTR MSG_INFO_BOARD_MENU = _UxGT("Board-Info"); LSTR MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistoren"); @@ -486,23 +575,39 @@ namespace Language_de { LSTR MSG_INFO_RUNAWAY_OFF = _UxGT("Runaway Watch: AUS"); LSTR MSG_INFO_RUNAWAY_ON = _UxGT("Runaway Watch: AN"); LSTR MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Hotend Idle Timeout"); + LSTR MSG_FAN_SPEED_FAULT = _UxGT("Fehler Lüftergeschw."); + LSTR MSG_CASE_LIGHT = _UxGT("Beleuchtung"); LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Helligkeit"); - LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Falscher Drucker"); #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Kein Medium eingelegt."); + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Bitte auf Neustart warten. "); + LSTR MSG_PLEASE_PREHEAT = _UxGT("Bitte das Hot-End vorheizen."); + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Druckzähler zurücksetzen"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Gesamte Drucke"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Komplette Drucke"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Gesamte Druckzeit"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Längste Druckzeit"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Gesamt Extrudiert"); + LSTR MSG_COLORS_GET = _UxGT("Farbe"); + LSTR MSG_COLORS_SELECT = _UxGT("Farben auswählen"); + LSTR MSG_COLORS_APPLIED = _UxGT("Farben verwenden"); + LSTR MSG_COLORS_RED = _UxGT("Rot"); + LSTR MSG_COLORS_GREEN = _UxGT("Grün"); + LSTR MSG_COLORS_BLUE = _UxGT("Blau"); + LSTR MSG_COLORS_WHITE = _UxGT("Weiß"); + LSTR MSG_UI_LANGUAGE = _UxGT("UI Sprache"); + LSTR MSG_SOUND_ENABLE = _UxGT("Ton aktivieren"); + LSTR MSG_LOCKSCREEN = _UxGT("Bildschirm sperren"); #else LSTR MSG_INFO_PRINT_COUNT = _UxGT("Drucke"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Komplette"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Gesamte"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Längste"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Extrud."); + LSTR MSG_PLEASE_PREHEAT = _UxGT("Bitte vorheizen"); #endif LSTR MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); @@ -528,6 +633,8 @@ namespace Language_de { LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Düse: "); LSTR MSG_RUNOUT_SENSOR = _UxGT("Runout-Sensor"); LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Runout-Weg mm"); + LSTR MSG_RUNOUT_ENABLE = _UxGT("Runout aktivieren"); + LSTR MSG_FANCHECK = _UxGT("Lüftergeschw. prüfen"); LSTR MSG_KILL_HOMING_FAILED = _UxGT("Homing gescheitert"); LSTR MSG_LCD_PROBING_FAILED = _UxGT("Probing gescheitert"); @@ -639,4 +746,33 @@ namespace Language_de { #endif LSTR MSG_REHEAT = _UxGT("Erneut aufheizen"); LSTR MSG_REHEATING = _UxGT("Erneut aufhei. ..."); + LSTR MSG_REHEATDONE = _UxGT("Aufwärmen fertig"); + + LSTR MSG_PROBE_WIZARD = _UxGT("Sonden-Assistent"); + LSTR MSG_PROBE_WIZARD_PROBING = _UxGT("Sonden-Bezug"); + LSTR MSG_PROBE_WIZARD_MOVING = _UxGT("Bewege zur Position"); + + LSTR MSG_XATC = _UxGT("X-Verdreh-Assistent"); + LSTR MSG_XATC_DONE = _UxGT("X-Verdreh-Assi fertig!"); + LSTR MSG_XATC_UPDATE_Z_OFFSET = _UxGT("Z-Versatz Sonde akt. auf "); + + LSTR MSG_SOUND = _UxGT("Ton"); + + LSTR MSG_TOP_LEFT = _UxGT("Oben Links"); + LSTR MSG_BOTTOM_LEFT = _UxGT("Unten Links"); + LSTR MSG_TOP_RIGHT = _UxGT("Oben Rechts"); + LSTR MSG_BOTTOM_RIGHT = _UxGT("Unten Rechts"); + LSTR MSG_CALIBRATION_COMPLETED = _UxGT("Kalibrierung beendet"); + LSTR MSG_CALIBRATION_FAILED = _UxGT("Kalibrierung geschei."); + + LSTR MSG_DRIVER_BACKWARD = _UxGT(" Driver zurück"); + + LSTR MSG_SD_CARD = _UxGT("SD Karte"); + LSTR MSG_USB_DISK = _UxGT("USB Disk"); + + LSTR MSG_HOST_SHUTDOWN = _UxGT("Host abschalten"); + + LSTR MSG_SHORT_DAY = _UxGT("t"); // One character only + LSTR MSG_SHORT_HOUR = _UxGT("h"); // One character only + LSTR MSG_SHORT_MINUTE = _UxGT("m"); // One character only } diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 3a876a07e383..164dca8fcfe2 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -137,7 +137,6 @@ namespace Language_jp_kana { LSTR MSG_VMIN = _UxGT("サイショウオクリソクド"); // "Vmin" LSTR MSG_VTRAV_MIN = _UxGT("サイショウイドウソクド"); // "VTrav min" LSTR MSG_ACCELERATION = _UxGT("カソクド mm/s") SUPERSCRIPT_TWO; // "Accel" - LSTR MSG_AMAX = _UxGT("サイダイカソクド "); // "Amax " LSTR MSG_A_RETRACT = _UxGT("ヒキコミカソクド"); // "A-retract" LSTR MSG_A_TRAVEL = _UxGT("イドウカソクド"); // "A-travel" LSTR MSG_TEMPERATURE = _UxGT("オンド"); // "Temperature" From 2d648e4dd94fd93ed0df9390dafe3e23335b5c29 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 2 Mar 2022 11:11:26 +1300 Subject: [PATCH 136/502] =?UTF-8?q?=F0=9F=94=A8=20Fix=20'renamed'=20env=20?= =?UTF-8?q?(platform=20=3D=20ststm32)=20(#23831)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/renamed.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ini/renamed.ini b/ini/renamed.ini index abc8ee5c28b3..b325476d2f9e 100644 --- a/ini/renamed.ini +++ b/ini/renamed.ini @@ -14,7 +14,8 @@ # [renamed] -platform = native +platform = ststm32 +board = genericSTM32F103RE # # List of environment names that are no longer used From 41a51e952792653059019e9e6064f6cd7a0beadb Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Tue, 1 Mar 2022 22:14:52 +0000 Subject: [PATCH 137/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20backlash=20applied?= =?UTF-8?q?=20steps=20when=20config=20changes=20(#23826)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #23814 --- Marlin/src/feature/backlash.cpp | 76 ++++++++++++++++----------- Marlin/src/feature/backlash.h | 46 ++++++++++------ Marlin/src/gcode/calibrate/G425.cpp | 60 +++++++++++++-------- Marlin/src/gcode/calibrate/M425.cpp | 24 ++++----- Marlin/src/lcd/extui/ui_api.cpp | 12 ++--- Marlin/src/lcd/menu/menu_backlash.cpp | 13 +++-- Marlin/src/module/planner.cpp | 16 +++--- Marlin/src/module/settings.cpp | 37 ++++++------- 8 files changed, 167 insertions(+), 117 deletions(-) diff --git a/Marlin/src/feature/backlash.cpp b/Marlin/src/feature/backlash.cpp index 23458cf86cb9..84382cf85680 100644 --- a/Marlin/src/feature/backlash.cpp +++ b/Marlin/src/feature/backlash.cpp @@ -30,9 +30,7 @@ #include "../module/planner.h" axis_bits_t Backlash::last_direction_bits; -#ifdef BACKLASH_SMOOTHING_MM - xyz_long_t Backlash::residual_error{0}; -#endif +xyz_long_t Backlash::residual_error{0}; #ifdef BACKLASH_DISTANCE_MM #if ENABLED(BACKLASH_GCODE) @@ -43,7 +41,7 @@ axis_bits_t Backlash::last_direction_bits; #endif #if ENABLED(BACKLASH_GCODE) - uint8_t Backlash::correction = (BACKLASH_CORRECTION) * 0xFF; + uint8_t Backlash::correction = (BACKLASH_CORRECTION) * all_on; #ifdef BACKLASH_SMOOTHING_MM float Backlash::smoothing_mm = BACKLASH_SMOOTHING_MM; #endif @@ -87,7 +85,7 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const #endif last_direction_bits ^= changed_dir; - if (correction == 0) return; + if (!correction && !residual_error) return; #ifdef BACKLASH_SMOOTHING_MM // The segment proportion is a value greater than 0.0 indicating how much residual_error @@ -95,35 +93,28 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const // smoothing distance. Since the computation of this proportion involves a floating point // division, defer computation until needed. float segment_proportion = 0; - #else - // No direction change, no correction. - if (!changed_dir) return; - // No leftover residual error from segment to segment - xyz_long_t residual_error{0}; #endif - const float f_corr = float(correction) / 255.0f; + const float f_corr = float(correction) / all_on; LOOP_LINEAR_AXES(axis) { if (distance_mm[axis]) { - const bool reversing = TEST(dm,axis); + const bool reverse = TEST(dm, axis); // When an axis changes direction, add axis backlash to the residual error if (TEST(changed_dir, axis)) - residual_error[axis] += (reversing ? -f_corr : f_corr) * distance_mm[axis] * planner.settings.axis_steps_per_mm[axis]; + residual_error[axis] += (reverse ? -f_corr : f_corr) * distance_mm[axis] * planner.settings.axis_steps_per_mm[axis]; // Decide how much of the residual error to correct in this segment int32_t error_correction = residual_error[axis]; + if (reverse != (error_correction < 0)) + error_correction = 0; // Don't take up any backlash in this segment, as it would subtract steps + #ifdef BACKLASH_SMOOTHING_MM if (error_correction && smoothing_mm != 0) { - // Take up a portion of the residual_error in this segment, but only when - // the current segment travels in the same direction as the correction - if (reversing == (error_correction < 0)) { - if (segment_proportion == 0) segment_proportion = _MIN(1.0f, block->millimeters / smoothing_mm); - error_correction = CEIL(segment_proportion * error_correction); - } - else - error_correction = 0; // Don't take up any backlash in this segment, as it would subtract steps + // Take up a portion of the residual_error in this segment + if (segment_proportion == 0) segment_proportion = _MIN(1.0f, block->millimeters / smoothing_mm); + error_correction = CEIL(segment_proportion * error_correction); } #endif @@ -153,27 +144,52 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const } } -int32_t Backlash::applied_steps(const AxisEnum axis) { +int32_t Backlash::get_applied_steps(const AxisEnum axis) { if (axis >= LINEAR_AXES) return 0; - const bool reversing = TEST(last_direction_bits, axis); + const bool reverse = TEST(last_direction_bits, axis); - #ifdef BACKLASH_SMOOTHING_MM - const int32_t residual_error_axis = residual_error[axis]; - #else - constexpr int32_t residual_error_axis = 0; - #endif + const int32_t residual_error_axis = residual_error[axis]; // At startup it is assumed the last move was forwards. So the applied // steps will always be a non-positive number. - if (!reversing) return -residual_error_axis; + if (!reverse) return -residual_error_axis; - const float f_corr = float(correction) / 255.0f; + const float f_corr = float(correction) / all_on; const int32_t full_error_axis = -f_corr * distance_mm[axis] * planner.settings.axis_steps_per_mm[axis]; return full_error_axis - residual_error_axis; } +class Backlash::StepAdjuster { + xyz_long_t applied_steps; +public: + StepAdjuster() { + LOOP_LINEAR_AXES(axis) applied_steps[axis] = backlash.get_applied_steps((AxisEnum)axis); + } + ~StepAdjuster() { + // after backlash compensation parameter changes, ensure applied step count does not change + LOOP_LINEAR_AXES(axis) residual_error[axis] += backlash.get_applied_steps((AxisEnum)axis) - applied_steps[axis]; + } +}; + +void Backlash::set_correction_uint8(const uint8_t v) { + StepAdjuster adjuster; + correction = v; +} + +void Backlash::set_distance_mm(const AxisEnum axis, const float v) { + StepAdjuster adjuster; + distance_mm[axis] = v; +} + +#ifdef BACKLASH_SMOOTHING_MM + void Backlash::set_smoothing_mm(const float v) { + StepAdjuster adjuster; + smoothing_mm = v; + } +#endif + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) #include "../module/probe.h" diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index ef29012cb146..0bace526e53f 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -24,27 +24,22 @@ #include "../inc/MarlinConfigPre.h" #include "../module/planner.h" -constexpr uint8_t all_on = 0xFF, all_off = 0x00; - class Backlash { +public: + static constexpr uint8_t all_on = 0xFF, all_off = 0x00; + private: static axis_bits_t last_direction_bits; - #ifdef BACKLASH_SMOOTHING_MM - static xyz_long_t residual_error; - #endif + static xyz_long_t residual_error; -public: #if ENABLED(BACKLASH_GCODE) - static xyz_float_t distance_mm; static uint8_t correction; + static xyz_float_t distance_mm; #ifdef BACKLASH_SMOOTHING_MM static float smoothing_mm; #endif - - static void set_correction(const_float_t v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; } - static float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; } #else - static constexpr uint8_t correction = (BACKLASH_CORRECTION) * 0xFF; + static constexpr uint8_t correction = (BACKLASH_CORRECTION) * all_on; static const xyz_float_t distance_mm; #ifdef BACKLASH_SMOOTHING_MM static constexpr float smoothing_mm = BACKLASH_SMOOTHING_MM; @@ -52,13 +47,13 @@ class Backlash { #endif #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - private: - static xyz_float_t measured_mm; - static xyz_uint8_t measured_count; - public: - static void measure_with_probe(); + static xyz_float_t measured_mm; + static xyz_uint8_t measured_count; #endif + class StepAdjuster; + +public: static float get_measurement(const AxisEnum a) { UNUSED(a); // Return the measurement averaged over all readings @@ -78,7 +73,24 @@ class Backlash { } static void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const axis_bits_t dm, block_t * const block); - static int32_t applied_steps(const AxisEnum axis); + static int32_t get_applied_steps(const AxisEnum axis); + + #if ENABLED(BACKLASH_GCODE) + static void set_correction_uint8(const uint8_t v); + static uint8_t get_correction_uint8() { return correction; } + static void set_correction(const float v) { set_correction_uint8(_MAX(0, _MIN(1.0, v)) * all_on + 0.5f); } + static float get_correction() { return float(get_correction_uint8()) / all_on; } + static void set_distance_mm(const AxisEnum axis, const float v); + static float get_distance_mm(const AxisEnum axis) {return distance_mm[axis];} + #ifdef BACKLASH_SMOOTHING_MM + static void set_smoothing_mm(const float v); + static float get_smoothing_mm() {return smoothing_mm;} + #endif + #endif + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + static void measure_with_probe(); + #endif }; extern Backlash backlash; diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index 906f8cc4194a..a2dec64bc3a8 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -105,13 +105,27 @@ struct measurements_t { }; #if ENABLED(BACKLASH_GCODE) - #define TEMPORARY_BACKLASH_CORRECTION(value) REMEMBER(tbst, backlash.correction, value) + class restorer_correction { + const uint8_t val_; + public: + restorer_correction(const uint8_t temp_val) : val_(backlash.get_correction_uint8()) { backlash.set_correction_uint8(temp_val); } + ~restorer_correction() { backlash.set_correction_uint8(val_); } + }; + + #define TEMPORARY_BACKLASH_CORRECTION(value) restorer_correction restorer_tbst(value) #else #define TEMPORARY_BACKLASH_CORRECTION(value) #endif #if ENABLED(BACKLASH_GCODE) && defined(BACKLASH_SMOOTHING_MM) - #define TEMPORARY_BACKLASH_SMOOTHING(value) REMEMBER(tbsm, backlash.smoothing_mm, value) + class restorer_smoothing { + const float val_; + public: + restorer_smoothing(const float temp_val) : val_(backlash.get_smoothing_mm()) { backlash.set_smoothing_mm(temp_val); } + ~restorer_smoothing() { backlash.set_smoothing_mm(val_); } + }; + + #define TEMPORARY_BACKLASH_SMOOTHING(value) restorer_smoothing restorer_tbsm(value) #else #define TEMPORARY_BACKLASH_SMOOTHING(value) #endif @@ -524,7 +538,7 @@ inline void calibrate_backlash(measurements_t &m, const float uncertainty) { { // New scope for TEMPORARY_BACKLASH_CORRECTION - TEMPORARY_BACKLASH_CORRECTION(all_off); + TEMPORARY_BACKLASH_CORRECTION(backlash.all_off); TEMPORARY_BACKLASH_SMOOTHING(0.0f); probe_sides(m, uncertainty); @@ -532,45 +546,45 @@ inline void calibrate_backlash(measurements_t &m, const float uncertainty) { #if ENABLED(BACKLASH_GCODE) #if HAS_X_CENTER - backlash.distance_mm.x = (m.backlash[LEFT] + m.backlash[RIGHT]) / 2; + backlash.set_distance_mm(X_AXIS, (m.backlash[LEFT] + m.backlash[RIGHT]) / 2); #elif ENABLED(CALIBRATION_MEASURE_LEFT) - backlash.distance_mm.x = m.backlash[LEFT]; + backlash.set_distance_mm(X_AXIS, m.backlash[LEFT]); #elif ENABLED(CALIBRATION_MEASURE_RIGHT) - backlash.distance_mm.x = m.backlash[RIGHT]; + backlash.set_distance_mm(X_AXIS, m.backlash[RIGHT]); #endif #if HAS_Y_CENTER - backlash.distance_mm.y = (m.backlash[FRONT] + m.backlash[BACK]) / 2; + backlash.set_distance_mm(Y_AXIS, (m.backlash[FRONT] + m.backlash[BACK]) / 2); #elif ENABLED(CALIBRATION_MEASURE_FRONT) - backlash.distance_mm.y = m.backlash[FRONT]; + backlash.set_distance_mm(Y_AXIS, m.backlash[FRONT]); #elif ENABLED(CALIBRATION_MEASURE_BACK) - backlash.distance_mm.y = m.backlash[BACK]; + backlash.set_distance_mm(Y_AXIS, m.backlash[BACK]); #endif - TERN_(HAS_Z_AXIS, if (AXIS_CAN_CALIBRATE(Z)) backlash.distance_mm.z = m.backlash[TOP]); + TERN_(HAS_Z_AXIS, if (AXIS_CAN_CALIBRATE(Z)) backlash.set_distance_mm(Z_AXIS, m.backlash[TOP])); #if HAS_I_CENTER - backlash.distance_mm.i = (m.backlash[IMINIMUM] + m.backlash[IMAXIMUM]) / 2; + backlash.set_distance_mm(I_AXIS, (m.backlash[IMINIMUM] + m.backlash[IMAXIMUM]) / 2); #elif ENABLED(CALIBRATION_MEASURE_IMIN) - backlash.distance_mm.i = m.backlash[IMINIMUM]; + backlash.set_distance_mm(I_AXIS, m.backlash[IMINIMUM]); #elif ENABLED(CALIBRATION_MEASURE_IMAX) - backlash.distance_mm.i = m.backlash[IMAXIMUM]; + backlash.set_distance_mm(I_AXIS, m.backlash[IMAXIMUM]); #endif #if HAS_J_CENTER - backlash.distance_mm.j = (m.backlash[JMINIMUM] + m.backlash[JMAXIMUM]) / 2; + backlash.set_distance_mm(J_AXIS, (m.backlash[JMINIMUM] + m.backlash[JMAXIMUM]) / 2); #elif ENABLED(CALIBRATION_MEASURE_JMIN) - backlash.distance_mm.j = m.backlash[JMINIMUM]; + backlash.set_distance_mm(J_AXIS, m.backlash[JMINIMUM]); #elif ENABLED(CALIBRATION_MEASURE_JMAX) - backlash.distance_mm.j = m.backlash[JMAXIMUM]; + backlash.set_distance_mm(J_AXIS, m.backlash[JMAXIMUM]); #endif #if HAS_K_CENTER - backlash.distance_mm.k = (m.backlash[KMINIMUM] + m.backlash[KMAXIMUM]) / 2; + backlash.set_distance_mm(K_AXIS, (m.backlash[KMINIMUM] + m.backlash[KMAXIMUM]) / 2); #elif ENABLED(CALIBRATION_MEASURE_KMIN) - backlash.distance_mm.k = m.backlash[KMINIMUM]; + backlash.set_distance_mm(K_AXIS, m.backlash[KMINIMUM]); #elif ENABLED(CALIBRATION_MEASURE_KMAX) - backlash.distance_mm.k = m.backlash[KMAXIMUM]; + backlash.set_distance_mm(K_AXIS, m.backlash[KMAXIMUM]); #endif #endif // BACKLASH_GCODE @@ -581,7 +595,7 @@ inline void calibrate_backlash(measurements_t &m, const float uncertainty) { // allowed directions to take up any backlash { // New scope for TEMPORARY_BACKLASH_CORRECTION - TEMPORARY_BACKLASH_CORRECTION(all_on); + TEMPORARY_BACKLASH_CORRECTION(backlash.all_on); TEMPORARY_BACKLASH_SMOOTHING(0.0f); const xyz_float_t move = LINEAR_AXIS_ARRAY( AXIS_CAN_CALIBRATE(X) * 3, AXIS_CAN_CALIBRATE(Y) * 3, AXIS_CAN_CALIBRATE(Z) * 3, @@ -611,7 +625,7 @@ inline void update_measurements(measurements_t &m, const AxisEnum axis) { * - Call calibrate_backlash() beforehand for best accuracy */ inline void calibrate_toolhead(measurements_t &m, const float uncertainty, const uint8_t extruder) { - TEMPORARY_BACKLASH_CORRECTION(all_on); + TEMPORARY_BACKLASH_CORRECTION(backlash.all_on); TEMPORARY_BACKLASH_SMOOTHING(0.0f); TERN(HAS_MULTI_HOTEND, set_nozzle(m, extruder), UNUSED(extruder)); @@ -648,7 +662,7 @@ inline void calibrate_toolhead(measurements_t &m, const float uncertainty, const * uncertainty in - How far away from the object to begin probing */ inline void calibrate_all_toolheads(measurements_t &m, const float uncertainty) { - TEMPORARY_BACKLASH_CORRECTION(all_on); + TEMPORARY_BACKLASH_CORRECTION(backlash.all_on); TEMPORARY_BACKLASH_SMOOTHING(0.0f); HOTEND_LOOP() calibrate_toolhead(m, uncertainty, e); @@ -674,7 +688,7 @@ inline void calibrate_all() { TERN_(HAS_HOTEND_OFFSET, reset_hotend_offsets()); - TEMPORARY_BACKLASH_CORRECTION(all_on); + TEMPORARY_BACKLASH_CORRECTION(backlash.all_on); TEMPORARY_BACKLASH_SMOOTHING(0.0f); // Do a fast and rough calibration of the toolheads diff --git a/Marlin/src/gcode/calibrate/M425.cpp b/Marlin/src/gcode/calibrate/M425.cpp index 2d36e0d410d5..6b1f56fcf658 100644 --- a/Marlin/src/gcode/calibrate/M425.cpp +++ b/Marlin/src/gcode/calibrate/M425.cpp @@ -63,7 +63,7 @@ void GcodeSuite::M425() { LOOP_LINEAR_AXES(a) { if (axis_can_calibrate(a) && parser.seen(AXIS_CHAR(a))) { planner.synchronize(); - backlash.distance_mm[a] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(AxisEnum(a)); + backlash.set_distance_mm(AxisEnum(a), parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(AxisEnum(a))); noArgs = false; } } @@ -77,25 +77,25 @@ void GcodeSuite::M425() { #ifdef BACKLASH_SMOOTHING_MM if (parser.seen('S')) { planner.synchronize(); - backlash.smoothing_mm = parser.value_linear_units(); + backlash.set_smoothing_mm(parser.value_linear_units()); noArgs = false; } #endif if (noArgs) { SERIAL_ECHOPGM("Backlash Correction "); - if (!backlash.correction) SERIAL_ECHOPGM("in"); + if (!backlash.get_correction_uint8()) SERIAL_ECHOPGM("in"); SERIAL_ECHOLNPGM("active:"); SERIAL_ECHOLNPGM(" Correction Amount/Fade-out: F", backlash.get_correction(), " (F1.0 = full, F0.0 = none)"); SERIAL_ECHOPGM(" Backlash Distance (mm): "); LOOP_LINEAR_AXES(a) if (axis_can_calibrate(a)) { SERIAL_CHAR(' ', AXIS_CHAR(a)); - SERIAL_ECHO(backlash.distance_mm[a]); + SERIAL_ECHO(backlash.get_distance_mm(AxisEnum(a))); SERIAL_EOL(); } #ifdef BACKLASH_SMOOTHING_MM - SERIAL_ECHOLNPGM(" Smoothing (mm): S", backlash.smoothing_mm); + SERIAL_ECHOLNPGM(" Smoothing (mm): S", backlash.get_smoothing_mm()); #endif #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) @@ -118,15 +118,15 @@ void GcodeSuite::M425_report(const bool forReplay/*=true*/) { SERIAL_ECHOLNPGM_P( PSTR(" M425 F"), backlash.get_correction() #ifdef BACKLASH_SMOOTHING_MM - , PSTR(" S"), LINEAR_UNIT(backlash.smoothing_mm) + , PSTR(" S"), LINEAR_UNIT(backlash.get_smoothing_mm()) #endif , LIST_N(DOUBLE(LINEAR_AXES), - SP_X_STR, LINEAR_UNIT(backlash.distance_mm.x), - SP_Y_STR, LINEAR_UNIT(backlash.distance_mm.y), - SP_Z_STR, LINEAR_UNIT(backlash.distance_mm.z), - SP_I_STR, LINEAR_UNIT(backlash.distance_mm.i), - SP_J_STR, LINEAR_UNIT(backlash.distance_mm.j), - SP_K_STR, LINEAR_UNIT(backlash.distance_mm.k) + SP_X_STR, LINEAR_UNIT(backlash.get_distance_mm(X_AXIS)), + SP_Y_STR, LINEAR_UNIT(backlash.get_distance_mm(Y_AXIS)), + SP_Z_STR, LINEAR_UNIT(backlash.get_distance_mm(Z_AXIS)), + SP_I_STR, LINEAR_UNIT(backlash.get_distance_mm(I_AXIS)), + SP_J_STR, LINEAR_UNIT(backlash.get_distance_mm(J_AXIS)), + SP_K_STR, LINEAR_UNIT(backlash.get_distance_mm(K_AXIS)) ) ); } diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index f44e8bf72032..bfcbc39d7bf0 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -861,16 +861,16 @@ namespace ExtUI { #endif #if ENABLED(BACKLASH_GCODE) - float getAxisBacklash_mm(const axis_t axis) { return backlash.distance_mm[axis]; } + float getAxisBacklash_mm(const axis_t axis) { return backlash.get_distance_mm((AxisEnum)axis); } void setAxisBacklash_mm(const_float_t value, const axis_t axis) - { backlash.distance_mm[axis] = constrain(value,0,5); } + { backlash.set_distance_mm((AxisEnum)axis, constrain(value,0,5)); } - float getBacklashCorrection_percent() { return ui8_to_percent(backlash.correction); } - void setBacklashCorrection_percent(const_float_t value) { backlash.correction = map(constrain(value, 0, 100), 0, 100, 0, 255); } + float getBacklashCorrection_percent() { return backlash.get_correction() * 100.0f; } + void setBacklashCorrection_percent(const_float_t value) { backlash.set_correction(constrain(value, 0, 100) / 100.0f); } #ifdef BACKLASH_SMOOTHING_MM - float getBacklashSmoothing_mm() { return backlash.smoothing_mm; } - void setBacklashSmoothing_mm(const_float_t value) { backlash.smoothing_mm = constrain(value, 0, 999); } + float getBacklashSmoothing_mm() { return backlash.get_smoothing_mm(); } + void setBacklashSmoothing_mm(const_float_t value) { backlash.set_smoothing_mm(constrain(value, 0, 999)); } #endif #endif diff --git a/Marlin/src/lcd/menu/menu_backlash.cpp b/Marlin/src/lcd/menu/menu_backlash.cpp index 5776234f72dc..faed8cf77763 100644 --- a/Marlin/src/lcd/menu/menu_backlash.cpp +++ b/Marlin/src/lcd/menu/menu_backlash.cpp @@ -36,14 +36,20 @@ void menu_backlash() { START_MENU(); BACK_ITEM(MSG_MAIN); - EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &backlash.correction, all_off, all_on); + editable.uint8 = backlash.get_correction_uint8(); + EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &editable.uint8, backlash.all_off, backlash.all_on, []{ backlash.set_correction_uint8(editable.uint8); }); #if DISABLED(CORE_BACKLASH) || EITHER(MARKFORGED_XY, MARKFORGED_YX) #define _CAN_CALI AXIS_CAN_CALIBRATE #else #define _CAN_CALI(A) true #endif - #define EDIT_BACKLASH_DISTANCE(N) EDIT_ITEM_FAST(float43, MSG_BACKLASH_##N, &backlash.distance_mm[_AXIS(N)], 0.0f, 9.9f); + + #define EDIT_BACKLASH_DISTANCE(N) do { \ + editable.decimal = backlash.get_distance_mm(_AXIS(N)); \ + EDIT_ITEM_FAST(float43, MSG_BACKLASH_##N, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_distance_mm(_AXIS(N), editable.decimal); }); \ + } while (0); + if (_CAN_CALI(A)) EDIT_BACKLASH_DISTANCE(A); #if HAS_Y_AXIS && _CAN_CALI(B) EDIT_BACKLASH_DISTANCE(B); @@ -62,7 +68,8 @@ void menu_backlash() { #endif #ifdef BACKLASH_SMOOTHING_MM - EDIT_ITEM_FAST(float43, MSG_BACKLASH_SMOOTHING, &backlash.smoothing_mm, 0.0f, 9.9f); + editable.decimal = backlash.get_smoothing_mm(); + EDIT_ITEM_FAST(float43, MSG_BACKLASH_SMOOTHING, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_smoothing_mm(editable.decimal); }); #endif END_MENU(); diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 37b264a3c55e..51440aac262e 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1706,7 +1706,7 @@ void Planner::endstop_triggered(const AxisEnum axis) { } float Planner::triggered_position_mm(const AxisEnum axis) { - const float result = DIFF_TERN(BACKLASH_COMPENSATION, stepper.triggered_position(axis), backlash.applied_steps(axis)); + const float result = DIFF_TERN(BACKLASH_COMPENSATION, stepper.triggered_position(axis), backlash.get_applied_steps(axis)); return result * mm_per_step[axis]; } @@ -1729,8 +1729,8 @@ float Planner::get_axis_position_mm(const AxisEnum axis) { // Protect the access to the position. const bool was_enabled = stepper.suspend(); - const int32_t p1 = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(CORE_AXIS_1), backlash.applied_steps(CORE_AXIS_1)), - p2 = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(CORE_AXIS_2), backlash.applied_steps(CORE_AXIS_2)); + const int32_t p1 = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(CORE_AXIS_1), backlash.get_applied_steps(CORE_AXIS_1)), + p2 = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(CORE_AXIS_2), backlash.get_applied_steps(CORE_AXIS_2)); if (was_enabled) stepper.wake_up(); @@ -1739,7 +1739,7 @@ float Planner::get_axis_position_mm(const AxisEnum axis) { axis_steps = (axis == CORE_AXIS_2 ? CORESIGN(p1 - p2) : p1 + p2) * 0.5f; } else - axis_steps = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(axis), backlash.applied_steps(axis)); + axis_steps = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(axis), backlash.get_applied_steps(axis)); #elif EITHER(MARKFORGED_XY, MARKFORGED_YX) @@ -1756,12 +1756,12 @@ float Planner::get_axis_position_mm(const AxisEnum axis) { axis_steps = ((axis == CORE_AXIS_1) ? p1 - p2 : p2); } else - axis_steps = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(axis), backlash.applied_steps(axis)); + axis_steps = DIFF_TERN(BACKLASH_COMPENSATION, stepper.position(axis), backlash.get_applied_steps(axis)); #else axis_steps = stepper.position(axis); - TERN_(BACKLASH_COMPENSATION, axis_steps -= backlash.applied_steps(axis)); + TERN_(BACKLASH_COMPENSATION, axis_steps -= backlash.get_applied_steps(axis)); #endif @@ -2844,7 +2844,7 @@ void Planner::buffer_sync_block(TERN_(LASER_SYNCHRONOUS_M106_M107, uint8_t sync_ block->position = position; #if ENABLED(BACKLASH_COMPENSATION) - LOOP_LINEAR_AXES(axis) block->position[axis] += backlash.applied_steps((AxisEnum)axis); + LOOP_LINEAR_AXES(axis) block->position[axis] += backlash.get_applied_steps((AxisEnum)axis); #endif #if BOTH(HAS_FAN, LASER_SYNCHRONOUS_M106_M107) @@ -3122,7 +3122,7 @@ void Planner::set_machine_position_mm(const abce_pos_t &abce) { else { #if ENABLED(BACKLASH_COMPENSATION) abce_long_t stepper_pos = position; - LOOP_LINEAR_AXES(axis) stepper_pos[axis] += backlash.applied_steps((AxisEnum)axis); + LOOP_LINEAR_AXES(axis) stepper_pos[axis] += backlash.get_applied_steps((AxisEnum)axis); stepper.set_position(stepper_pos); #else stepper.set_position(position); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 66316edbbb32..f512d87b997f 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1426,14 +1426,15 @@ void MarlinSettings::postprocess() { // { #if ENABLED(BACKLASH_GCODE) - const xyz_float_t &backlash_distance_mm = backlash.distance_mm; - const uint8_t &backlash_correction = backlash.correction; + xyz_float_t backlash_distance_mm; + LOOP_LINEAR_AXES(axis) backlash_distance_mm[axis] = backlash.get_distance_mm((AxisEnum)axis); + const uint8_t backlash_correction = backlash.get_correction_uint8(); #else const xyz_float_t backlash_distance_mm{0}; const uint8_t backlash_correction = 0; #endif #if ENABLED(BACKLASH_GCODE) && defined(BACKLASH_SMOOTHING_MM) - const float &backlash_smoothing_mm = backlash.smoothing_mm; + const float backlash_smoothing_mm = backlash.get_smoothing_mm(); #else const float backlash_smoothing_mm = 3; #endif @@ -2364,22 +2365,22 @@ void MarlinSettings::postprocess() { // Backlash Compensation // { - #if ENABLED(BACKLASH_GCODE) - const xyz_float_t &backlash_distance_mm = backlash.distance_mm; - const uint8_t &backlash_correction = backlash.correction; - #else - xyz_float_t backlash_distance_mm; - uint8_t backlash_correction; - #endif - #if ENABLED(BACKLASH_GCODE) && defined(BACKLASH_SMOOTHING_MM) - const float &backlash_smoothing_mm = backlash.smoothing_mm; - #else - float backlash_smoothing_mm; - #endif + xyz_float_t backlash_distance_mm; + uint8_t backlash_correction; + float backlash_smoothing_mm; + _FIELD_TEST(backlash_distance_mm); EEPROM_READ(backlash_distance_mm); EEPROM_READ(backlash_correction); EEPROM_READ(backlash_smoothing_mm); + + #if ENABLED(BACKLASH_GCODE) + LOOP_LINEAR_AXES(axis) backlash.set_distance_mm((AxisEnum)axis, backlash_distance_mm[axis]); + backlash.set_correction_uint8(backlash_correction); + #ifdef BACKLASH_SMOOTHING_MM + backlash.set_smoothing_mm(backlash_smoothing_mm); + #endif + #endif } // @@ -2811,11 +2812,11 @@ void MarlinSettings::reset() { #endif #if ENABLED(BACKLASH_GCODE) - backlash.correction = (BACKLASH_CORRECTION) * 255; + backlash.set_correction(BACKLASH_CORRECTION); constexpr xyz_float_t tmp = BACKLASH_DISTANCE_MM; - backlash.distance_mm = tmp; + LOOP_LINEAR_AXES(axis) backlash.set_distance_mm((AxisEnum)axis, tmp[axis]); #ifdef BACKLASH_SMOOTHING_MM - backlash.smoothing_mm = BACKLASH_SMOOTHING_MM; + backlash.set_smoothing_mm(BACKLASH_SMOOTHING_MM); #endif #endif From fbfe0642b6411d12340d6d53338af0cd386b4ab8 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 2 Mar 2022 11:22:36 +1300 Subject: [PATCH 138/502] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20BLTouch=205V=20pin?= =?UTF-8?q?=20tolerance=20checks=20(#23823)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index e847339e2aff..b34d982e75e4 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1574,10 +1574,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #else #define _IS_5V_TOLERANT(P) 1 // Assume 5V tolerance #endif - #if USES_Z_MIN_PROBE_PIN && !_IS_5V_TOLERANT(Z_MIN_PROBE_PIN) - #error "BLTOUCH_SET_5V_MODE is not compatible with the Z_MIN_PROBE_PIN." + #if USES_Z_MIN_PROBE_PIN + #if !_IS_5V_TOLERANT(Z_MIN_PROBE_PIN) + #error "BLTOUCH_SET_5V_MODE is not compatible with the Z_MIN_PROBE_PIN." + #endif #elif !_IS_5V_TOLERANT(Z_MIN_PIN) - #error "BLTOUCH_SET_5V_MODE is not compatible with the Z_MIN_PIN." + #if !MB(CHITU3D_V6) + #error "BLTOUCH_SET_5V_MODE is not compatible with the Z_MIN_PIN." + #endif #endif #undef _IS_5V_TOLERANT #undef _5V From 0337602bbe289b72167a8ee49e996f799b281edc Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Tue, 1 Mar 2022 17:25:30 -0500 Subject: [PATCH 139/502] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20E3V2=20blank=20bg?= =?UTF-8?q?=20for=20S1=20compatibility=20(#23822)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/creality/dwin_lcd.cpp | 1 + Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 ++ Marlin/src/lcd/e3v2/marlinui/dwin_lcd.cpp | 1 + Marlin/src/lcd/e3v2/proui/dwin.cpp | 2 ++ 4 files changed, 6 insertions(+) diff --git a/Marlin/src/lcd/e3v2/creality/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/creality/dwin_lcd.cpp index fee22932d2e5..3d60e32a7908 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin_lcd.cpp @@ -49,6 +49,7 @@ void DWIN_Startup() { #if DISABLED(SHOW_BOOTSCREEN) DWIN_Frame_Clear(Color_Bg_Black); // MarlinUI handles the bootscreen so just clear here #endif + DWIN_JPG_ShowAndCache(3); DWIN_UpdateLCD(); } diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 0eedddb50099..d384bae3e33c 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4989,6 +4989,8 @@ void MarlinUI::init_lcd() { DWIN_UpdateLCD(); delay(20); } + + DWIN_JPG_ShowAndCache(3); DWIN_JPG_CacheTo1(Language_English); CrealityDWIN.Redraw_Screen(); } diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.cpp index ef390ac9dc04..a4cefe4ab99a 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.cpp @@ -45,6 +45,7 @@ void DWIN_Startup() { const bool success = DWIN_Handshake(); if (success) DEBUG_ECHOLNPGM("ok."); else DEBUG_ECHOLNPGM("error."); DWIN_Frame_SetDir(TERN(DWIN_MARLINUI_LANDSCAPE, 0, 1)); + DWIN_JPG_ShowAndCache(3); DWIN_Frame_Clear(Color_Bg_Black); // MarlinUI handles the bootscreen so just clear here DWIN_UpdateLCD(); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index d65fa9ec7997..5af7fc294dc6 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1836,6 +1836,7 @@ void DWIN_Startup() { DWINUI::onCursorErase = Erase_Menu_Cursor; DWINUI::onTitleDraw = Draw_Title; DWINUI::onMenuDraw = Draw_Menu; + DWIN_JPG_ShowAndCache(3); HMI_SetLanguage(); } @@ -1937,6 +1938,7 @@ void DWIN_RebootScreen() { DWINUI::Draw_CenteredString(Color_White, 220, GET_TEXT_F(MSG_PLEASE_WAIT_REBOOT)); DWIN_UpdateLCD(); delay(500); + DWIN_JPG_ShowAndCache(3); } void DWIN_Redraw_screen() { From 9b17699b9b371a88d7e5d79b60721e652c56c173 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Tue, 1 Mar 2022 23:42:20 +0100 Subject: [PATCH 140/502] =?UTF-8?q?=E2=9C=A8=20Weedo=2062A=20Tina2=20/=20M?= =?UTF-8?q?onoprice=20Cadet=20(#23817)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/mega/pins_PICA.h | 1 + Marlin/src/pins/mega/pins_WEEDO_62A.h | 106 ++++++++++++++++++++++++++ Marlin/src/pins/pins.h | 2 + 4 files changed, 110 insertions(+) create mode 100644 Marlin/src/pins/mega/pins_WEEDO_62A.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 5ee99b533f62..3ec24e776022 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -164,6 +164,7 @@ #define BOARD_MALYAN_M180 1327 // Malyan M180 Mainboard Version 2 (no display function, direct gcode only) #define BOARD_GT2560_V4_A20 1328 // Geeetech GT2560 Rev B for A20(M/T/D) #define BOARD_PROTONEER_CNC_SHIELD_V3 1329 // Mega controller & Protoneer CNC Shield V3.00 +#define BOARD_WEEDO_62A 1330 // WEEDO 62A board (TINA2, Monoprice Cadet, etc.) // // ATmega1281, ATmega2561 diff --git a/Marlin/src/pins/mega/pins_PICA.h b/Marlin/src/pins/mega/pins_PICA.h index 47c101711c4f..0e29d8dffe75 100644 --- a/Marlin/src/pins/mega/pins_PICA.h +++ b/Marlin/src/pins/mega/pins_PICA.h @@ -51,6 +51,7 @@ #define SERVO0_PIN 3 #define SERVO1_PIN 4 #define SERVO2_PIN 5 + // // Limit Switches // diff --git a/Marlin/src/pins/mega/pins_WEEDO_62A.h b/Marlin/src/pins/mega/pins_WEEDO_62A.h new file mode 100644 index 000000000000..4b3bf6a43bee --- /dev/null +++ b/Marlin/src/pins/mega/pins_WEEDO_62A.h @@ -0,0 +1,106 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Based on WEEDO 62A pin configuration + * Copyright (c) 2019 WEEDO3D Perron + */ + +#pragma once + +#include "env_validate.h" + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "WEEDO 62A" +#endif + +// +// Limit Switches +// +#define X_MIN_PIN 3 +#define X_MAX_PIN 2 +#define Y_MIN_PIN 40 +#define Y_MAX_PIN 41 +#define Z_MIN_PIN 18 +#define Z_MAX_PIN 19 + +// +// Steppers +// +#define X_STEP_PIN 26 +#define X_DIR_PIN 28 +#define X_ENABLE_PIN 24 + +#define Y_STEP_PIN 60 +#define Y_DIR_PIN 61 +#define Y_ENABLE_PIN 56 + +#define Z_STEP_PIN 46 +#define Z_DIR_PIN 48 +#define Z_ENABLE_PIN 62 + +#define E0_STEP_PIN 54 +#define E0_DIR_PIN 55 +#define E0_ENABLE_PIN 38 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 13 // ANALOG NUMBERING +#define TEMP_BED_PIN 14 // ANALOG NUMBERING + +// +// Heaters / Fans +// +#define HEATER_0_PIN 10 // EXTRUDER 1 +#define HEATER_BED_PIN 8 // BED +#define FAN_PIN 4 // IO pin. Buffer needed + +// +// Misc. Functions +// +#define PS_ON_PIN 12 +#define LED_PIN 13 + +// +// SD Support +// +#if ENABLED(SDSUPPORT) + #define SDSS 53 + #define SD_DETECT_PIN 49 +#endif + +// +// LCD / Controller +// +#if HAS_WIRED_LCD + #define BEEPER_PIN 37 + + #define DOGLCD_A0 27 + #define DOGLCD_CS 29 + #define LCD_RESET_PIN 25 + #define LCD_CONTRAST_INIT 255 + + #define BTN_EN1 33 + #define BTN_EN2 31 + #define BTN_ENC 35 +#endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 88e7946edc41..7f0eac8c88fb 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -287,6 +287,8 @@ #include "mega/pins_MALYAN_M180.h" // ATmega2560 env:mega2560 #elif MB(PROTONEER_CNC_SHIELD_V3) #include "mega/pins_PROTONEER_CNC_SHIELD_V3.h"// ATmega2560 env:mega2560 +#elif MB(WEEDO_62A) + #include "mega/pins_WEEDO_62A.h" // ATmega2560 env:mega2560 // // ATmega1281, ATmega2561 From 43d4e306680d0a006f431b4ab29246450c6ee5e2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 2 Mar 2022 16:04:17 -0600 Subject: [PATCH 141/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20M=5FState=5Fgrbl?= =?UTF-8?q?=20when=20G29=20calls=20G28?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 33 +++++++++++++++++++-------- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 4 ++-- Marlin/src/gcode/calibrate/G28.cpp | 9 +++++--- Marlin/src/module/motion.h | 8 ++++--- 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 24c0268b9f75..a6ef6d2729f0 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -77,7 +77,12 @@ #endif #endif -#define G29_RETURN(b) return TERN_(G29_RETRY_AND_RECOVER, b) +#define G29_RETURN(retry) do{ \ + if (TERN(G29_RETRY_AND_RECOVER, !retry, true)) { \ + TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false)); \ + } \ + return TERN_(G29_RETRY_AND_RECOVER, retry); \ +}while(0) // For manual probing values persist over multiple G29 class G29_State { @@ -218,12 +223,13 @@ class G29_State { G29_TYPE GcodeSuite::G29() { DEBUG_SECTION(log_G29, "G29", DEBUGGING(LEVELING)); + // Leveling state is persistent when done manually with multiple G29 commands TERN_(PROBE_MANUALLY, static) G29_State abl; - TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_PROBE)); - + // Keep powered steppers from timing out reset_stepper_timeout(); + // Q = Query leveling and G29 state const bool seenQ = EITHER(DEBUG_LEVELING_FEATURE, PROBE_MANUALLY) && parser.seen_test('Q'); // G29 Q is also available if debugging @@ -232,11 +238,14 @@ G29_TYPE GcodeSuite::G29() { if (DISABLED(PROBE_MANUALLY) && seenQ) G29_RETURN(false); #endif + // A = Abort manual probing + // C = Generate fake probe points (DEBUG_LEVELING_FEATURE) const bool seenA = TERN0(PROBE_MANUALLY, parser.seen_test('A')), no_action = seenA || seenQ, faux = ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) ? parser.boolval('C') : no_action; - if (!no_action && planner.leveling_active && parser.boolval('O')) { // Auto-level only if needed + // O = Don't level if leveling is already active + if (!no_action && planner.leveling_active && parser.boolval('O')) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> Auto-level not needed, skip"); G29_RETURN(false); } @@ -248,15 +257,20 @@ G29_TYPE GcodeSuite::G29() { // Don't allow auto-leveling without homing first if (homing_needed_error()) G29_RETURN(false); + // 3-point leveling gets points from the probe class #if ENABLED(AUTO_BED_LEVELING_3POINT) vector_3 points[3]; probe.get_three_points(points); #endif + // Storage for ABL Linear results #if ENABLED(AUTO_BED_LEVELING_LINEAR) struct linear_fit_data lsf_results; #endif + // Set and report "probing" state to host + TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_PROBE, false)); + /** * On the initial G29 fetch command parameters. */ @@ -429,10 +443,10 @@ G29_TYPE GcodeSuite::G29() { if (!no_action) set_bed_leveling_enabled(false); // Deploy certain probes before starting probing - #if HAS_BED_PROBE - if (ENABLED(BLTOUCH)) - do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE); - else if (probe.deploy()) { + #if ENABLED(BLTOUCH) + do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE); + #elif HAS_BED_PROBE + if (probe.deploy()) { // (returns true on deploy failure) set_bed_leveling_enabled(abl.reenable); G29_RETURN(false); } @@ -483,6 +497,7 @@ G29_TYPE GcodeSuite::G29() { SERIAL_ECHOLNPGM("idle"); } + // For 'A' or 'Q' exit with success state if (no_action) G29_RETURN(false); if (abl.abl_probe_index == 0) { @@ -893,8 +908,6 @@ G29_TYPE GcodeSuite::G29() { report_current_position(); - TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE)); - G29_RETURN(isnan(abl.measured_z)); } diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 090c15b0578c..4ffeec6eec4b 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -75,8 +75,6 @@ void GcodeSuite::G29() { } #endif - TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_PROBE)); - static int mbl_probe_index = -1; MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport); @@ -85,6 +83,8 @@ void GcodeSuite::G29() { return; } + TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_PROBE)); + int8_t ix, iy; ix = iy = 0; diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index a38c5679395e..4d8891d55b7e 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -213,8 +213,6 @@ void GcodeSuite::G28() { TERN_(LASER_MOVE_G28_OFF, cutter.set_inline_enabled(false)); // turn off laser - TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_HOMING)); - #if ENABLED(DUAL_X_CARRIAGE) bool IDEX_saved_duplication_state = extruder_duplication_enabled; DualXMode IDEX_saved_mode = dual_x_carriage_mode; @@ -236,6 +234,11 @@ void GcodeSuite::G28() { return; } + #if ENABLED(FULL_REPORT_TO_HOST_FEATURE) + const M_StateEnum old_grblstate = M_State_grbl; + set_and_report_grblstate(M_HOMING); + #endif + TERN_(HAS_DWIN_E3V2_BASIC, DWIN_StartHoming()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart()); @@ -557,7 +560,7 @@ void GcodeSuite::G28() { if (ENABLED(NANODLP_Z_SYNC) && (doZ || ENABLED(NANODLP_ALL_AXIS))) SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP); - TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE)); + TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(old_grblstate)); #if HAS_L64XX // Set L6470 absolute position registers to counts diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 9fe61aad3349..2fbb4ce11479 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -265,9 +265,11 @@ void report_current_position_projected(); void report_current_position_moving(); #if ENABLED(FULL_REPORT_TO_HOST_FEATURE) - inline void set_and_report_grblstate(const M_StateEnum state) { - M_State_grbl = state; - report_current_grblstate_moving(); + inline void set_and_report_grblstate(const M_StateEnum state, const bool force=true) { + if (force || M_State_grbl != state) { + M_State_grbl = state; + report_current_grblstate_moving(); + } } #endif From 575c3150f96a7d43d93d092c9f0dd7f395ef6a78 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Wed, 2 Mar 2022 22:13:46 +0000 Subject: [PATCH 142/502] =?UTF-8?q?=F0=9F=9A=B8=20Universal=20X=5FAXIS=5FT?= =?UTF-8?q?WIST=5FCOMPENSATION=20(#23828)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 3 +- Marlin/src/feature/bedlevel/bedlevel.h | 3 - .../feature/{bedlevel/abl => }/x_twist.cpp | 15 ++++- .../src/feature/{bedlevel/abl => }/x_twist.h | 5 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 2 +- Marlin/src/lcd/menu/menu_x_twist.cpp | 3 + Marlin/src/module/probe.cpp | 5 ++ Marlin/src/module/settings.cpp | 58 ++++++++++++------- ini/features.ini | 2 +- platformio.ini | 2 +- 10 files changed, 67 insertions(+), 31 deletions(-) rename Marlin/src/feature/{bedlevel/abl => }/x_twist.cpp (82%) rename Marlin/src/feature/{bedlevel/abl => }/x_twist.h (88%) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index e5379ed84fc5..970be386672c 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1299,7 +1299,7 @@ #if HAS_MARLINUI_MENU - #if BOTH(HAS_BED_PROBE, AUTO_BED_LEVELING_BILINEAR) + #if HAS_BED_PROBE // Add calibration in the Probe Offsets menu to compensate for X-axis twist. //#define X_AXIS_TWIST_COMPENSATION #if ENABLED(X_AXIS_TWIST_COMPENSATION) @@ -1311,6 +1311,7 @@ #define XATC_START_Z 0.0 #define XATC_MAX_POINTS 3 // Number of points to probe in the wizard #define XATC_Y_POSITION Y_CENTER // (mm) Y position to probe + #define XATC_Z_OFFSETS { 0, 0, 0 } // Z offsets for X axis sample points #endif #endif diff --git a/Marlin/src/feature/bedlevel/bedlevel.h b/Marlin/src/feature/bedlevel/bedlevel.h index c623c99b5c52..63f032eee87b 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.h +++ b/Marlin/src/feature/bedlevel/bedlevel.h @@ -63,9 +63,6 @@ class TemporaryBedLevelingState { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) #include "abl/abl.h" - #if ENABLED(X_AXIS_TWIST_COMPENSATION) - #include "abl/x_twist.h" - #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) #include "ubl/ubl.h" #elif ENABLED(MESH_BED_LEVELING) diff --git a/Marlin/src/feature/bedlevel/abl/x_twist.cpp b/Marlin/src/feature/x_twist.cpp similarity index 82% rename from Marlin/src/feature/bedlevel/abl/x_twist.cpp rename to Marlin/src/feature/x_twist.cpp index 24fdbca95045..deac1bcebac6 100644 --- a/Marlin/src/feature/bedlevel/abl/x_twist.cpp +++ b/Marlin/src/feature/x_twist.cpp @@ -19,16 +19,24 @@ * along with this program. If not, see . * */ -#include "../../../inc/MarlinConfig.h" +#include "../inc/MarlinConfig.h" #if ENABLED(X_AXIS_TWIST_COMPENSATION) -#include "../bedlevel.h" +#include "x_twist.h" XATC xatc; +bool XATC::enabled = true; float XATC::spacing, XATC::start; -xatc_array_t XATC::z_offset; +xatc_array_t XATC::z_offset; // Initialized by settings.load() + +void XATC::reset() { + constexpr float xzo[] = XATC_Z_OFFSETS; + static_assert(COUNT(xzo) == XATC_MAX_POINTS, "XATC_Z_OFFSETS is the wrong size."); + enabled = false; + COPY(z_offset, xzo); +} void XATC::print_points() { SERIAL_ECHOLNPGM(" X-Twist Correction:"); @@ -49,6 +57,7 @@ void XATC::print_points() { float lerp(const_float_t t, const_float_t a, const_float_t b) { return a + t * (b - a); } float XATC::compensation(const xy_pos_t &raw) { + if (!enabled) return 0; if (NEAR_ZERO(spacing)) return 0; float t = (raw.x - start) / spacing; int i = FLOOR(t); diff --git a/Marlin/src/feature/bedlevel/abl/x_twist.h b/Marlin/src/feature/x_twist.h similarity index 88% rename from Marlin/src/feature/bedlevel/abl/x_twist.h rename to Marlin/src/feature/x_twist.h index 9deb45a8b7c4..6a2ff279013a 100644 --- a/Marlin/src/feature/bedlevel/abl/x_twist.h +++ b/Marlin/src/feature/x_twist.h @@ -21,15 +21,18 @@ */ #pragma once -#include "../../../inc/MarlinConfigPre.h" +#include "../inc/MarlinConfigPre.h" typedef float xatc_array_t[XATC_MAX_POINTS]; class XATC { + static bool enabled; public: static float spacing, start; static xatc_array_t z_offset; + static void reset(); + static void set_enabled(const bool ena) { enabled = ena; } static float compensation(const xy_pos_t &raw); static void print_points(); }; diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index a6ef6d2729f0..20f2369b03cc 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -681,7 +681,7 @@ G29_TYPE GcodeSuite::G29() { #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) const float z = abl.measured_z + abl.Z_offset; - z_values[abl.meshCount.x][abl.meshCount.y] = z PLUS_TERN0(X_AXIS_TWIST_COMPENSATION, xatc.compensation(abl.probePos)); + z_values[abl.meshCount.x][abl.meshCount.y] = z; TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(abl.meshCount, z)); #endif diff --git a/Marlin/src/lcd/menu/menu_x_twist.cpp b/Marlin/src/lcd/menu/menu_x_twist.cpp index fab3b5ae116c..ca385ebfeb6f 100644 --- a/Marlin/src/lcd/menu/menu_x_twist.cpp +++ b/Marlin/src/lcd/menu/menu_x_twist.cpp @@ -27,6 +27,7 @@ #include "menu_addon.h" #include "../../module/planner.h" #include "../../feature/bedlevel/bedlevel.h" +#include "../../feature/x_twist.h" #include "../../module/motion.h" #include "../../gcode/queue.h" #include "../../module/probe.h" @@ -148,7 +149,9 @@ void xatc_wizard_goto_next_point() { // Deploy certain probes before starting probing TERN_(BLTOUCH, do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE)); + xatc.set_enabled(false); measured_z = probe.probe_at_point(x, XATC_Y_POSITION, PROBE_PT_STOW); + xatc.set_enabled(true); current_position += probe.offset_xy; current_position.z = XATC_START_Z - probe.offset.z + measured_z; line_to_current_position(MMM_TO_MMS(XY_PROBE_FEEDRATE)); diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 95776ffda1af..89d2769247eb 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -81,6 +81,10 @@ #include "../feature/probe_temp_comp.h" #endif +#if ENABLED(X_AXIS_TWIST_COMPENSATION) + #include "../feature/x_twist.h" +#endif + #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) @@ -808,6 +812,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai if (!deploy()) { measured_z = run_z_probe(sanity_check) + offset.z; TERN_(HAS_PTC, ptc.apply_compensation(measured_z)); + TERN_(X_AXIS_TWIST_COMPENSATION, measured_z += xatc.compensation(npos + offset_xy)); } if (!isnan(measured_z)) { const bool big_raise = raise_after == PROBE_PT_BIG_RAISE; diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index f512d87b997f..2c103b89b4ff 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -64,7 +64,7 @@ #if HAS_LEVELING #include "../feature/bedlevel/bedlevel.h" #if ENABLED(X_AXIS_TWIST_COMPENSATION) - #include "../feature/bedlevel/abl/x_twist.h" + #include "../feature/x_twist.h" #endif #endif @@ -269,13 +269,17 @@ typedef struct SettingsDataStruct { xy_pos_t bilinear_grid_spacing, bilinear_start; // G29 L F #if ENABLED(AUTO_BED_LEVELING_BILINEAR) bed_mesh_t z_values; // G29 - #if ENABLED(X_AXIS_TWIST_COMPENSATION) - XATC xatc; // TBD - #endif #else float z_values[3][3]; #endif + // + // X_AXIS_TWIST_COMPENSATION + // + #if ENABLED(X_AXIS_TWIST_COMPENSATION) + XATC xatc; // TBD + #endif + // // AUTO_BED_LEVELING_UBL // @@ -298,7 +302,7 @@ typedef struct SettingsDataStruct { int16_t z_offsets_bed[COUNT(ptc.z_offsets_bed)]; // M871 B I V #endif #if ENABLED(PTC_HOTEND) - int16_t z_offsets_hotend[COUNT(ptc.z_offsets_hotend)]; // M871 E I V + int16_t z_offsets_hotend[COUNT(ptc.z_offsets_hotend)]; // M871 E I V #endif #endif @@ -873,9 +877,6 @@ void MarlinSettings::postprocess() { sizeof(z_values) == (GRID_MAX_POINTS) * sizeof(z_values[0][0]), "Bilinear Z array is the wrong size." ); - #if ENABLED(X_AXIS_TWIST_COMPENSATION) - static_assert(COUNT(xatc.z_offset) == XATC_MAX_POINTS, "XATC Z-offset mesh is the wrong size."); - #endif #else const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0}; #endif @@ -889,15 +890,20 @@ void MarlinSettings::postprocess() { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) EEPROM_WRITE(z_values); // 9-256 floats - #if ENABLED(X_AXIS_TWIST_COMPENSATION) - EEPROM_WRITE(xatc); - #endif #else dummyf = 0; for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_WRITE(dummyf); #endif } + // + // X Axis Twist Compensation + // + #if ENABLED(X_AXIS_TWIST_COMPENSATION) + _FIELD_TEST(xatc); + EEPROM_WRITE(xatc); + #endif + // // Unified Bed Leveling // @@ -1785,9 +1791,6 @@ void MarlinSettings::postprocess() { EEPROM_READ(bilinear_grid_spacing); // 2 ints EEPROM_READ(bilinear_start); // 2 ints EEPROM_READ(z_values); // 9 to 256 floats - #if ENABLED(X_AXIS_TWIST_COMPENSATION) - EEPROM_READ(xatc); - #endif } else // EEPROM data is stale #endif // AUTO_BED_LEVELING_BILINEAR @@ -1800,6 +1803,13 @@ void MarlinSettings::postprocess() { } } + // + // X Axis Twist Compensation + // + #if ENABLED(X_AXIS_TWIST_COMPENSATION) + EEPROM_READ(xatc); + #endif + // // Unified Bed Leveling active state // @@ -2849,6 +2859,14 @@ void MarlinSettings::reset() { TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = (DEFAULT_LEVELING_FADE_HEIGHT)); TERN_(HAS_LEVELING, reset_bed_level()); + // + // X Axis Twist Compensation + // + TERN_(X_AXIS_TWIST_COMPENSATION, xatc.reset()); + + // + // Nozzle-to-probe Offset + // #if HAS_BED_PROBE constexpr float dpo[] = NOZZLE_TO_PROBE_OFFSET; static_assert(COUNT(dpo) == LINEAR_AXES, "NOZZLE_TO_PROBE_OFFSET must contain offsets for each linear axis X, Y, Z...."); @@ -3313,14 +3331,14 @@ void MarlinSettings::reset() { } } - // TODO: Create G-code for settings - //#if ENABLED(X_AXIS_TWIST_COMPENSATION) - // CONFIG_ECHO_START(); - // xatc.print_points(); - //#endif - #endif + // TODO: Create G-code for settings + //#if ENABLED(X_AXIS_TWIST_COMPENSATION) + // CONFIG_ECHO_START(); + // xatc.print_points(); + //#endif + #endif // HAS_LEVELING // diff --git a/ini/features.ini b/ini/features.ini index d9d35d9a5419..ad32934f42b5 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -98,7 +98,7 @@ USB_FLASH_DRIVE_SUPPORT = src_filter=+ + AUTO_BED_LEVELING_BILINEAR = src_filter=+ AUTO_BED_LEVELING_(3POINT|(BI)?LINEAR) = src_filter=+ -X_AXIS_TWIST_COMPENSATION = src_filter=+ + +X_AXIS_TWIST_COMPENSATION = src_filter=+ + MESH_BED_LEVELING = src_filter=+ + AUTO_BED_LEVELING_UBL = src_filter=+ + UBL_HILBERT_CURVE = src_filter=+ diff --git a/platformio.ini b/platformio.ini index 3a02b5ab185b..9b64bdd377d5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -100,7 +100,6 @@ default_src_filter = + - - + - - - - - - - - - - - - @@ -151,6 +150,7 @@ default_src_filter = + - - + - - - - + - - - - From e082a141f63e7af1d301a994c0ee796946bcb3a8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 2 Mar 2022 17:50:55 -0600 Subject: [PATCH 143/502] =?UTF-8?q?=F0=9F=9A=B8=20Use=20Z=5FSTEPPER=5FALIG?= =?UTF-8?q?N=5FSTEPPER=5FXY=20to=20enable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 20 +++++++++-------- Marlin/src/feature/z_stepper_align.cpp | 4 ++-- Marlin/src/feature/z_stepper_align.h | 2 +- Marlin/src/gcode/calibrate/G34_M422.cpp | 30 ++++++++++++------------- Marlin/src/inc/Conditionals_adv.h | 5 +++-- Marlin/src/inc/SanityCheck.h | 6 +++-- Marlin/src/module/settings.cpp | 8 +++---- buildroot/tests/DUE | 2 +- 8 files changed, 41 insertions(+), 36 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 970be386672c..55857f5dec4d 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -959,15 +959,17 @@ //#define Z_STEPPERS_ORIENTATION 0 #endif - // Provide Z stepper positions for more rapid convergence in bed alignment. - // Requires triple stepper drivers (i.e., set NUM_Z_STEPPER_DRIVERS to 3) - //#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) - // Define Stepper XY positions for Z1, Z2, Z3 corresponding to - // the Z screw positions in the bed carriage. - // Define one position per Z stepper in stepper driver order. - #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } - #else + /** + * Z Stepper positions for more rapid convergence in bed alignment. + * Requires NUM_Z_STEPPER_DRIVERS to be 3 or 4. + * + * Define Stepper XY positions for Z1, Z2, Z3... corresponding to the screw + * positions in the bed carriage, with one position per Z stepper in stepper + * driver order. + */ + //#define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } + + #ifndef Z_STEPPER_ALIGN_STEPPER_XY // Amplification factor. Used to scale the correction step up or down in case // the stepper (spindle) position is farther out than the test point. #define Z_STEPPER_ALIGN_AMP 1.0 // Use a value > 1.0 NOTE: This may cause instability! diff --git a/Marlin/src/feature/z_stepper_align.cpp b/Marlin/src/feature/z_stepper_align.cpp index 1b4eb4474903..fdbd464ea1b4 100644 --- a/Marlin/src/feature/z_stepper_align.cpp +++ b/Marlin/src/feature/z_stepper_align.cpp @@ -35,7 +35,7 @@ ZStepperAlign z_stepper_align; xy_pos_t ZStepperAlign::xy[NUM_Z_STEPPER_DRIVERS]; -#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) +#if HAS_Z_STEPPER_ALIGN_STEPPER_XY xy_pos_t ZStepperAlign::stepper_xy[NUM_Z_STEPPER_DRIVERS]; #endif @@ -103,7 +103,7 @@ void ZStepperAlign::reset_to_default() { COPY(xy, xy_init); - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if HAS_Z_STEPPER_ALIGN_STEPPER_XY constexpr xy_pos_t stepper_xy_init[] = Z_STEPPER_ALIGN_STEPPER_XY; static_assert( COUNT(stepper_xy_init) == NUM_Z_STEPPER_DRIVERS, diff --git a/Marlin/src/feature/z_stepper_align.h b/Marlin/src/feature/z_stepper_align.h index e1b235b52cb3..8a12cd18b0bd 100644 --- a/Marlin/src/feature/z_stepper_align.h +++ b/Marlin/src/feature/z_stepper_align.h @@ -31,7 +31,7 @@ class ZStepperAlign { public: static xy_pos_t xy[NUM_Z_STEPPER_DRIVERS]; - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if HAS_Z_STEPPER_ALIGN_STEPPER_XY static xy_pos_t stepper_xy[NUM_Z_STEPPER_DRIVERS]; #endif diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 328a40dbb46a..fc4430885ecb 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -41,7 +41,7 @@ #include "../../module/tool_change.h" #endif -#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) +#if HAS_Z_STEPPER_ALIGN_STEPPER_XY #include "../../libs/least_squares_fit.h" #endif @@ -122,7 +122,7 @@ void GcodeSuite::G34() { break; } - const float z_auto_align_amplification = TERN(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, Z_STEPPER_ALIGN_AMP, parser.floatval('A', Z_STEPPER_ALIGN_AMP)); + const float z_auto_align_amplification = TERN(HAS_Z_STEPPER_ALIGN_STEPPER_XY, Z_STEPPER_ALIGN_AMP, parser.floatval('A', Z_STEPPER_ALIGN_AMP)); if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) { SERIAL_ECHOLNPGM("?(A)mplification out of bounds (0.5-2.0)."); break; @@ -179,7 +179,7 @@ void GcodeSuite::G34() { // Now, the Z origin lies below the build plate. That allows to probe deeper, before run_z_probe throws an error. // This hack is un-done at the end of G34 - either by re-homing, or by using the probed heights of the last iteration. - #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if !HAS_Z_STEPPER_ALIGN_STEPPER_XY float last_z_align_move[NUM_Z_STEPPER_DRIVERS] = ARRAY_N_1(NUM_Z_STEPPER_DRIVERS, 10000.0f); #else float last_z_align_level_indicator = 10000.0f; @@ -188,7 +188,7 @@ void GcodeSuite::G34() { z_maxdiff = 0.0f, amplification = z_auto_align_amplification; - #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if !HAS_Z_STEPPER_ALIGN_STEPPER_XY bool adjustment_reverse = false; #endif @@ -256,7 +256,7 @@ void GcodeSuite::G34() { z_maxdiff = z_measured_max - z_measured_min; z_probe = Z_BASIC_CLEARANCE + z_measured_max + z_maxdiff; - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if HAS_Z_STEPPER_ALIGN_STEPPER_XY // Replace the initial values in z_measured with calculated heights at // each stepper position. This allows the adjustment algorithm to be // shared between both possible probing mechanisms. @@ -338,7 +338,7 @@ void GcodeSuite::G34() { return false; }; - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if HAS_Z_STEPPER_ALIGN_STEPPER_XY // Check if the applied corrections go in the correct direction. // Calculate the sum of the absolute deviations from the mean of the probe measurements. // Compare to the last iteration to ensure it's getting better. @@ -370,7 +370,7 @@ void GcodeSuite::G34() { float z_align_move = z_measured[zstepper] - z_measured_min; const float z_align_abs = ABS(z_align_move); - #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if !HAS_Z_STEPPER_ALIGN_STEPPER_XY // Optimize one iteration's correction based on the first measurements if (z_align_abs) amplification = (iteration == 1) ? _MIN(last_z_align_move[zstepper] / z_align_abs, 2.0f) : z_auto_align_amplification; @@ -394,7 +394,7 @@ void GcodeSuite::G34() { // Lock all steppers except one stepper.set_all_z_lock(true, zstepper); - #if DISABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if !HAS_Z_STEPPER_ALIGN_STEPPER_XY // Decreasing accuracy was detected so move was inverted. // Will match reversed Z steppers on dual steppers. Triple will need more work to map. if (adjustment_reverse) { @@ -467,7 +467,7 @@ void GcodeSuite::G34() { * * S : Index of the probe point to set * - * With Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS: + * With Z_STEPPER_ALIGN_STEPPER_XY: * W : Index of the Z stepper position to set * The W and S parameters may not be combined. * @@ -488,18 +488,18 @@ void GcodeSuite::M422() { const bool is_probe_point = parser.seen('S'); - if (TERN0(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, is_probe_point && parser.seen('W'))) { + if (TERN0(HAS_Z_STEPPER_ALIGN_STEPPER_XY, is_probe_point && parser.seen('W'))) { SERIAL_ECHOLNPGM("?(S) and (W) may not be combined."); return; } xy_pos_t *pos_dest = ( - TERN_(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, !is_probe_point ? z_stepper_align.stepper_xy :) + TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !is_probe_point ? z_stepper_align.stepper_xy :) z_stepper_align.xy ); - if (!is_probe_point && TERN1(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, !parser.seen('W'))) { - SERIAL_ECHOLNPGM("?(S)" TERN_(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS, " or (W)") " is required."); + if (!is_probe_point && TERN1(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !parser.seen('W'))) { + SERIAL_ECHOLNPGM("?(S)" TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, " or (W)") " is required."); return; } @@ -513,7 +513,7 @@ void GcodeSuite::M422() { } } else { - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if HAS_Z_STEPPER_ALIGN_STEPPER_XY position_index = parser.intval('W') - 1; if (!WITHIN(position_index, 0, NUM_Z_STEPPER_DRIVERS - 1)) { SERIAL_ECHOLNPGM("?(W) Z-stepper index invalid."); @@ -551,7 +551,7 @@ void GcodeSuite::M422_report(const bool forReplay/*=true*/) { SP_Y_STR, z_stepper_align.xy[i].y ); } - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if HAS_Z_STEPPER_ALIGN_STEPPER_XY LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { report_echo_start(forReplay); SERIAL_ECHOLNPGM_P( diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 82b32ba0031f..d63395a7199f 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -630,7 +630,8 @@ #endif #if ENABLED(Z_STEPPER_AUTO_ALIGN) - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #ifdef Z_STEPPER_ALIGN_STEPPER_XY + #define HAS_Z_STEPPER_ALIGN_STEPPER_XY 1 #undef Z_STEPPER_ALIGN_AMP #endif #ifndef Z_STEPPER_ALIGN_AMP @@ -986,7 +987,7 @@ #endif // Flag whether least_squares_fit.cpp is used -#if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR, Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) +#if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR, HAS_Z_STEPPER_ALIGN_STEPPER_XY) #define NEED_LSF 1 #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b34d982e75e4..e8abf1b286c5 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -613,6 +613,8 @@ #error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 1." #elif defined(NOZZLE_PARK_Y_ONLY) #error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 2." +#elif defined(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS is now just Z_STEPPER_ALIGN_STEPPER_XY." #endif constexpr float arm[] = AXIS_RELATIVE_MODES; @@ -3479,10 +3481,10 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "Z_STEPPER_AUTO_ALIGN requires NUM_Z_STEPPER_DRIVERS greater than 1." #elif !HAS_BED_PROBE #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe." - #elif ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #elif HAS_Z_STEPPER_ALIGN_STEPPER_XY static_assert(WITHIN(Z_STEPPER_ALIGN_AMP, 0.5, 2.0), "Z_STEPPER_ALIGN_AMP must be between 0.5 and 2.0."); #if NUM_Z_STEPPER_DRIVERS < 3 - #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS requires NUM_Z_STEPPER_DRIVERS to be 3 or 4." + #error "Z_STEPPER_ALIGN_STEPPER_XY requires NUM_Z_STEPPER_DRIVERS to be 3 or 4." #endif #endif #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 2c103b89b4ff..fed1f67755b7 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -341,11 +341,11 @@ typedef struct SettingsDataStruct { #endif // - // Z_STEPPER_AUTO_ALIGN, Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS + // Z_STEPPER_AUTO_ALIGN, HAS_Z_STEPPER_ALIGN_STEPPER_XY // #if ENABLED(Z_STEPPER_AUTO_ALIGN) xy_pos_t z_stepper_align_xy[NUM_Z_STEPPER_DRIVERS]; // M422 S X Y - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if HAS_Z_STEPPER_ALIGN_STEPPER_XY xy_pos_t z_stepper_align_stepper_xy[NUM_Z_STEPPER_DRIVERS]; // M422 W X Y #endif #endif @@ -1005,7 +1005,7 @@ void MarlinSettings::postprocess() { #if ENABLED(Z_STEPPER_AUTO_ALIGN) EEPROM_WRITE(z_stepper_align.xy); - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if HAS_Z_STEPPER_ALIGN_STEPPER_XY EEPROM_WRITE(z_stepper_align.stepper_xy); #endif #endif @@ -1924,7 +1924,7 @@ void MarlinSettings::postprocess() { #if ENABLED(Z_STEPPER_AUTO_ALIGN) EEPROM_READ(z_stepper_align.xy); - #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #if HAS_Z_STEPPER_ALIGN_STEPPER_XY EEPROM_READ(z_stepper_align.stepper_xy); #endif #endif diff --git a/buildroot/tests/DUE b/buildroot/tests/DUE index 5810b73bdca8..9b968cbd8d4d 100755 --- a/buildroot/tests/DUE +++ b/buildroot/tests/DUE @@ -37,7 +37,7 @@ exec_test $1 $2 "RAMPS4DUE_EFB with ABL (Bilinear), ExtUI, S-Curve, many options restore_configs opt_set MOTHERBOARD BOARD_RADDS NUM_Z_STEPPER_DRIVERS 3 opt_enable USE_XMAX_PLUG USE_YMAX_PLUG ENDSTOPPULLUPS BLTOUCH AUTO_BED_LEVELING_BILINEAR \ - Z_STEPPER_AUTO_ALIGN Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS Z_SAFE_HOMING + Z_STEPPER_AUTO_ALIGN Z_STEPPER_ALIGN_STEPPER_XY Z_SAFE_HOMING pins_set ramps/RAMPS X_MAX_PIN -1 pins_set ramps/RAMPS Y_MAX_PIN -1 exec_test $1 $2 "RADDS with ABL (Bilinear), Triple Z Axis, Z_STEPPER_AUTO_ALIGN, E_DUAL_STEPPER_DRIVERS" "$3" From 2986bc3b768e047fb333d35633900d512dbff439 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 2 Mar 2022 17:58:23 -0600 Subject: [PATCH 144/502] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Use=20seen=5Ftest?= =?UTF-8?q?=20in=20`M422`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/calibrate/G34_M422.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index fc4430885ecb..61e817fe9424 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -486,9 +486,9 @@ void GcodeSuite::M422() { return; } - const bool is_probe_point = parser.seen('S'); + const bool is_probe_point = parser.seen_test('S'); - if (TERN0(HAS_Z_STEPPER_ALIGN_STEPPER_XY, is_probe_point && parser.seen('W'))) { + if (TERN0(HAS_Z_STEPPER_ALIGN_STEPPER_XY, is_probe_point && parser.seen_test('W'))) { SERIAL_ECHOLNPGM("?(S) and (W) may not be combined."); return; } @@ -498,7 +498,7 @@ void GcodeSuite::M422() { z_stepper_align.xy ); - if (!is_probe_point && TERN1(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !parser.seen('W'))) { + if (!is_probe_point && TERN1(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !parser.seen_test('W'))) { SERIAL_ECHOLNPGM("?(S)" TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, " or (W)") " is required."); return; } From fd582dc863785b53048834d0c9789f1d264603b2 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Fri, 4 Mar 2022 21:57:51 +0000 Subject: [PATCH 145/502] =?UTF-8?q?=F0=9F=A9=B9=20Improve=20and=20apply=20?= =?UTF-8?q?XATC=20reset()=20(#23840)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/x_twist.cpp | 7 +++++-- Marlin/src/lcd/menu/menu_x_twist.cpp | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/src/feature/x_twist.cpp b/Marlin/src/feature/x_twist.cpp index deac1bcebac6..891009123986 100644 --- a/Marlin/src/feature/x_twist.cpp +++ b/Marlin/src/feature/x_twist.cpp @@ -24,18 +24,21 @@ #if ENABLED(X_AXIS_TWIST_COMPENSATION) #include "x_twist.h" +#include "../module/probe.h" XATC xatc; -bool XATC::enabled = true; +bool XATC::enabled; float XATC::spacing, XATC::start; xatc_array_t XATC::z_offset; // Initialized by settings.load() void XATC::reset() { constexpr float xzo[] = XATC_Z_OFFSETS; static_assert(COUNT(xzo) == XATC_MAX_POINTS, "XATC_Z_OFFSETS is the wrong size."); - enabled = false; COPY(z_offset, xzo); + xatc.spacing = (probe.max_x() - probe.min_x()) / (XATC_MAX_POINTS - 1); + xatc.start = probe.min_x(); + enabled = true; } void XATC::print_points() { diff --git a/Marlin/src/lcd/menu/menu_x_twist.cpp b/Marlin/src/lcd/menu/menu_x_twist.cpp index ca385ebfeb6f..93f8de07ad46 100644 --- a/Marlin/src/lcd/menu/menu_x_twist.cpp +++ b/Marlin/src/lcd/menu/menu_x_twist.cpp @@ -189,8 +189,7 @@ void xatc_wizard_homing_done() { } if (ui.use_click()) { - xatc.spacing = (probe.max_x() - probe.min_x()) / (XATC_MAX_POINTS - 1); - xatc.start = probe.min_x(); + xatc.reset(); SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement From bd72df3bb6387af9421b1503ab74e29b8a1e705c Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Fri, 4 Mar 2022 21:59:38 +0000 Subject: [PATCH 146/502] =?UTF-8?q?=F0=9F=90=9B=20Emergency=20Parser=20wit?= =?UTF-8?q?h=20STM32=20Mass=20Storage=20(#23827)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32/HAL.cpp | 2 +- Marlin/src/HAL/STM32/usb_serial.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/STM32/HAL.cpp b/Marlin/src/HAL/STM32/HAL.cpp index 324a78316a2d..d28f506db9d3 100644 --- a/Marlin/src/HAL/STM32/HAL.cpp +++ b/Marlin/src/HAL/STM32/HAL.cpp @@ -89,7 +89,7 @@ void MarlinHAL::init() { SetTimerInterruptPriorities(); - #if ENABLED(EMERGENCY_PARSER) && USBD_USE_CDC + #if ENABLED(EMERGENCY_PARSER) && (USBD_USE_CDC || USBD_USE_CDC_MSC) USB_Hook_init(); #endif diff --git a/Marlin/src/HAL/STM32/usb_serial.cpp b/Marlin/src/HAL/STM32/usb_serial.cpp index b607275db5bb..0b2372f3a79d 100644 --- a/Marlin/src/HAL/STM32/usb_serial.cpp +++ b/Marlin/src/HAL/STM32/usb_serial.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(EMERGENCY_PARSER) && USBD_USE_CDC +#if ENABLED(EMERGENCY_PARSER) && (USBD_USE_CDC || USBD_USE_CDC_MSC) #include "usb_serial.h" #include "../../feature/e_parser.h" From 0fafcd20cddc0e76003454d7c292430f367f1106 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 4 Mar 2022 16:07:38 -0600 Subject: [PATCH 147/502] =?UTF-8?q?=F0=9F=94=A7=20Mark=20Thermal=20Varianc?= =?UTF-8?q?e=20Monitor=20EXPERIMENTAL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 55857f5dec4d..2cccfce054de 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -347,7 +347,11 @@ #endif #if ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_COOLER) - #define THERMAL_PROTECTION_VARIANCE_MONITOR // Detect a sensor malfunction preventing temperature updates + /** + * Thermal Protection Variance Monitor - EXPERIMENTAL. + * Kill the machine on a stuck temperature sensor. Disable if you get false positives. + */ + //#define THERMAL_PROTECTION_VARIANCE_MONITOR // Detect a sensor malfunction preventing temperature updates #endif #if ENABLED(PIDTEMP) From e4ca822dcf62c5a38b30472bd51ab40212ee2eb5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 10 Mar 2022 17:25:09 -0600 Subject: [PATCH 148/502] =?UTF-8?q?=F0=9F=9A=B8=20Improve=20M422=20error?= =?UTF-8?q?=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/calibrate/G34_M422.cpp | 29 +++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 61e817fe9424..d1f82e7e9874 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -493,7 +493,7 @@ void GcodeSuite::M422() { return; } - xy_pos_t *pos_dest = ( + xy_pos_t * const pos_dest = ( TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !is_probe_point ? z_stepper_align.stepper_xy :) z_stepper_align.xy ); @@ -504,24 +504,25 @@ void GcodeSuite::M422() { } // Get the Probe Position Index or Z Stepper Index - int8_t position_index; - if (is_probe_point) { - position_index = parser.intval('S') - 1; - if (!WITHIN(position_index, 0, int8_t(NUM_Z_STEPPER_DRIVERS) - 1)) { - SERIAL_ECHOLNPGM("?(S) Probe-position index invalid."); - return; - } - } + int8_t position_index = 1; + FSTR_P err_string = F("?(S) Probe-position"); + if (is_probe_point) + position_index = parser.intval('S'); else { #if HAS_Z_STEPPER_ALIGN_STEPPER_XY - position_index = parser.intval('W') - 1; - if (!WITHIN(position_index, 0, NUM_Z_STEPPER_DRIVERS - 1)) { - SERIAL_ECHOLNPGM("?(W) Z-stepper index invalid."); - return; - } + err_string = F("?(W) Z-stepper"); + position_index = parser.intval('W'); #endif } + if (!WITHIN(position_index, 1, NUM_Z_STEPPER_DRIVERS)) { + SERIAL_ECHOF(err_string); + SERIAL_ECHOLNPGM(" index invalid (1.." STRINGIFY(NUM_Z_STEPPER_DRIVERS) ")."); + return; + } + + --position_index; + const xy_pos_t pos = { parser.floatval('X', pos_dest[position_index].x), parser.floatval('Y', pos_dest[position_index].y) From 152ec49b8b43e40a9cceaaa90f3ebf1c194dfe11 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 10 Mar 2022 17:35:03 -0600 Subject: [PATCH 149/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20'hdsl'=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/settings.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index fed1f67755b7..cd71344389c9 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -3203,9 +3203,11 @@ void MarlinSettings::reset() { postprocess(); - FSTR_P const hdsl = F("Hardcoded Default Settings Loaded"); - TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(hdsl)); - DEBUG_ECHO_START(); DEBUG_ECHOLNF(hdsl); + #if EITHER(EEPROM_CHITCHAT, DEBUG_LEVELING_FEATURE) + FSTR_P const hdsl = F("Hardcoded Default Settings Loaded"); + TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(hdsl)); + DEBUG_ECHO_START(); DEBUG_ECHOLNF(hdsl); + #endif TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset()); } From b669aa49cccf4ceb41b99dfdbb88dac5945bed01 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 10 Mar 2022 22:07:47 -0600 Subject: [PATCH 150/502] =?UTF-8?q?=F0=9F=94=A7=20DWIN=5FCREALITY=5FLCD=5F?= =?UTF-8?q?ENHANCED=20=3D>=20DWIN=5FLCD=5FPROUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #23624 --- Marlin/Configuration.h | 2 +- Marlin/Configuration_adv.h | 4 ++-- Marlin/src/MarlinCore.cpp | 4 ++-- Marlin/src/feature/pause.cpp | 10 ++++----- Marlin/src/feature/runout.cpp | 4 ++-- Marlin/src/gcode/bedlevel/abl/G29.cpp | 6 +++--- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 4 ++-- Marlin/src/gcode/bedlevel/ubl/M421.cpp | 4 ++-- Marlin/src/gcode/calibrate/G28.cpp | 2 +- Marlin/src/gcode/control/M997.cpp | 4 ++-- Marlin/src/gcode/feature/powerloss/M1000.cpp | 2 +- Marlin/src/gcode/lcd/M0_M1.cpp | 4 ++-- Marlin/src/gcode/lcd/M73.cpp | 4 ++-- Marlin/src/gcode/sd/M1001.cpp | 4 ++-- Marlin/src/gcode/stats/M75-M78.cpp | 6 +++--- Marlin/src/gcode/temp/M303.cpp | 6 +++--- Marlin/src/inc/Conditionals_LCD.h | 4 ++-- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/inc/SanityCheck.h | 22 +++++++++++--------- Marlin/src/lcd/e3v2/proui/dwin.cpp | 4 ++-- Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp | 4 ++-- Marlin/src/lcd/e3v2/proui/dwin_popup.cpp | 4 ++-- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 4 ++-- Marlin/src/lcd/e3v2/proui/endstop_diag.cpp | 4 ++-- Marlin/src/lcd/e3v2/proui/lockscreen.cpp | 4 ++-- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 4 ++-- Marlin/src/lcd/e3v2/proui/printstats.cpp | 4 ++-- Marlin/src/lcd/marlinui.cpp | 8 +++---- Marlin/src/lcd/marlinui.h | 8 +++---- Marlin/src/module/probe.cpp | 4 ++-- Marlin/src/module/settings.cpp | 14 ++++++------- Marlin/src/module/temperature.cpp | 14 ++++++------- Marlin/src/sd/cardreader.cpp | 2 +- buildroot/tests/STM32F103RE_creality | 4 ++-- ini/features.ini | 2 +- 35 files changed, 94 insertions(+), 92 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 7162e74acbcf..c2d5dced283b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2807,7 +2807,7 @@ // Ender-3 v2 OEM display. A DWIN display with Rotary Encoder. // //#define DWIN_CREALITY_LCD // Creality UI -//#define DWIN_CREALITY_LCD_ENHANCED // Enhanced UI +//#define DWIN_LCD_PROUI // Pro UI by MRiscoC //#define DWIN_CREALITY_LCD_JYERSUI // Jyers UI by Jacob Myers //#define DWIN_MARLINUI_PORTRAIT // MarlinUI (portrait orientation) //#define DWIN_MARLINUI_LANDSCAPE // MarlinUI (landscape orientation) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 2cccfce054de..04a8d63ef7b5 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1335,11 +1335,11 @@ #endif // HAS_MARLINUI_MENU -#if ANY(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI) +#if ANY(HAS_DISPLAY, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) //#define SOUND_MENU_ITEM // Add a mute option to the LCD menu #endif -#if EITHER(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED) +#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI) // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 81dc7db4cc91..cc928baff942 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -74,7 +74,7 @@ #include "lcd/e3v2/common/encoder.h" #if ENABLED(DWIN_CREALITY_LCD) #include "lcd/e3v2/creality/dwin.h" - #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #elif ENABLED(DWIN_LCD_PROUI) #include "lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "lcd/e3v2/jyersui/dwin.h" @@ -878,7 +878,7 @@ void kill(FSTR_P const lcd_error/*=nullptr*/, FSTR_P const lcd_component/*=nullp // Echo the LCD message to serial for extra context if (lcd_error) { SERIAL_ECHO_START(); SERIAL_ECHOLNF(lcd_error); } - #if EITHER(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED) + #if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI) ui.kill_screen(lcd_error ?: GET_TEXT_F(MSG_KILLED), lcd_component ?: FPSTR(NUL_STR)); #else UNUSED(lcd_error); UNUSED(lcd_component); diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 69c25cbe3319..79780021cfb4 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -57,7 +57,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../lcd/e3v2/proui/dwin.h" #endif @@ -281,7 +281,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load // Show "Purge More" / "Resume" menu and wait for reply KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = false; - #if EITHER(HAS_MARLINUI_MENU, DWIN_CREALITY_LCD_ENHANCED) + #if EITHER(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR #else pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; @@ -549,7 +549,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(GET_TEXT_F(MSG_REHEATING))); - TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATING)); + TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATING)); // Re-enable the heaters if they timed out HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e); @@ -567,7 +567,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE))); - TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATDONE)); + TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATDONE)); IF_DISABLED(PAUSE_REHEAT_FAST_RESUME, wait_for_user = true); @@ -711,7 +711,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_ TERN_(HAS_STATUS_MESSAGE, ui.reset_status()); TERN_(HAS_MARLINUI_MENU, ui.return_to_status()); - TERN_(DWIN_CREALITY_LCD_ENHANCED, HMI_ReturnScreen()); + TERN_(DWIN_LCD_PROUI, HMI_ReturnScreen()); } #endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index 8b78b53848f3..98b6bd051061 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -68,7 +68,7 @@ bool FilamentMonitorBase::enabled = true, #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../lcd/e3v2/proui/dwin.h" #endif @@ -88,7 +88,7 @@ void event_filament_runout(const uint8_t extruder) { #endif TERN_(EXTENSIBLE_UI, ExtUI::onFilamentRunout(ExtUI::getTool(extruder))); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_FilamentRunout(extruder)); + TERN_(DWIN_LCD_PROUI, DWIN_FilamentRunout(extruder)); #if ANY(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS, MULTI_FILAMENT_SENSOR) const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, extruder); diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 20f2369b03cc..a65d84477148 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -55,7 +55,7 @@ #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD) #include "../../../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../../../lcd/e3v2/proui/dwin.h" #endif @@ -427,7 +427,7 @@ G29_TYPE GcodeSuite::G29() { points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) TERN_(EXTENSIBLE_UI, ExtUI::onMeshLevelingStart()); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_MeshLevelingStart()); + TERN_(DWIN_LCD_PROUI, DWIN_MeshLevelingStart()); #endif if (!faux) { @@ -721,7 +721,7 @@ G29_TYPE GcodeSuite::G29() { #endif // AUTO_BED_LEVELING_3POINT - TERN_(HAS_STATUS_MESSAGE, ui.reset_status()); + ui.reset_status(); // Stow the probe. No raise for FIX_MOUNTED_PROBE. if (probe.stow()) { diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 4ffeec6eec4b..309d21fe53f7 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -40,7 +40,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../../../lcd/e3v2/proui/dwin.h" #endif @@ -193,7 +193,7 @@ void GcodeSuite::G29() { if (parser.seenval('Z')) { mbl.z_values[ix][iy] = parser.value_linear_units(); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, mbl.z_values[ix][iy])); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_MeshUpdate(ix, iy, mbl.z_values[ix][iy])); + TERN_(DWIN_LCD_PROUI, DWIN_MeshUpdate(ix, iy, mbl.z_values[ix][iy])); } else return echo_not_entered('Z'); diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index ac6f97b00acb..c11a20ebf33c 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -33,7 +33,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../../../lcd/e3v2/proui/dwin.h" #endif @@ -69,7 +69,7 @@ void GcodeSuite::M421() { float &zval = ubl.z_values[ij.x][ij.y]; // Altering this Mesh Point zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); // N=NAN, Z=NEWVAL, or Q=ADDVAL TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); // Ping ExtUI in case it's showing the mesh - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_MeshUpdate(ij.x, ij.y, zval)); + TERN_(DWIN_LCD_PROUI, DWIN_MeshUpdate(ij.x, ij.y, zval)); } } diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 4d8891d55b7e..dbbea79353a5 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -51,7 +51,7 @@ #include "../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD) #include "../../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../../lcd/e3v2/proui/dwin.h" #endif diff --git a/Marlin/src/gcode/control/M997.cpp b/Marlin/src/gcode/control/M997.cpp index 359172faad7c..74ed8b0d073e 100644 --- a/Marlin/src/gcode/control/M997.cpp +++ b/Marlin/src/gcode/control/M997.cpp @@ -24,7 +24,7 @@ #if ENABLED(PLATFORM_M997_SUPPORT) -#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#if ENABLED(DWIN_LCD_PROUI) #include "../../lcd/e3v2/proui/dwin.h" #endif @@ -33,7 +33,7 @@ */ void GcodeSuite::M997() { - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_RebootScreen()); + TERN_(DWIN_LCD_PROUI, DWIN_RebootScreen()); flashFirmware(parser.intval('S')); diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index 6fb99226ce20..1629a154bce3 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -33,7 +33,7 @@ #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD) #include "../../../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../../../lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "../../../lcd/e3v2/jyersui/dwin.h" // Temporary fix until it can be better implemented diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index a9223dda47f2..af03fcb0b1a1 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -35,7 +35,7 @@ #include "../../lcd/marlinui.h" #elif ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../../lcd/e3v2/proui/dwin_popup.h" #include "../../lcd/e3v2/proui/dwin.h" #endif @@ -71,7 +71,7 @@ void GcodeSuite::M0_M1() { ExtUI::onUserConfirmRequired(parser.string_arg); // String in an SRAM buffer else ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_USERWAIT)); - #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #elif ENABLED(DWIN_LCD_PROUI) if (parser.string_arg) DWIN_Popup_Confirm(ICON_BLTouch, parser.string_arg, GET_TEXT_F(MSG_USERWAIT)); else diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index c2c5485072e5..355445c573b9 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -28,7 +28,7 @@ #include "../../lcd/marlinui.h" #include "../../sd/cardreader.h" -#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#if ENABLED(DWIN_LCD_PROUI) #include "../../lcd/e3v2/proui/dwin.h" #endif @@ -40,7 +40,7 @@ */ void GcodeSuite::M73() { - #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #if ENABLED(DWIN_LCD_PROUI) DWIN_Progress_Update(); diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 1579efd55557..87de89a68207 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -49,7 +49,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../../lcd/e3v2/proui/dwin.h" #endif @@ -109,7 +109,7 @@ void GcodeSuite::M1001() { #endif TERN_(EXTENSIBLE_UI, ExtUI::onPrintFinished()); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Print_Finished()); + TERN_(DWIN_LCD_PROUI, DWIN_Print_Finished()); // Re-select the last printed file in the UI TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file()); diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index 368edb65d912..01630adc5078 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -29,7 +29,7 @@ #include "../../MarlinCore.h" // for startOrResumeJob -#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#if ENABLED(DWIN_LCD_PROUI) #include "../../lcd/e3v2/proui/dwin.h" #endif @@ -38,7 +38,7 @@ */ void GcodeSuite::M75() { startOrResumeJob(); - #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #if ENABLED(DWIN_LCD_PROUI) DWIN_Print_Header(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT)); DWIN_Print_Started(false); #endif @@ -57,7 +57,7 @@ void GcodeSuite::M76() { */ void GcodeSuite::M77() { print_job_timer.stop(); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Print_Finished()); + TERN_(DWIN_LCD_PROUI, DWIN_Print_Finished()); } #if ENABLED(PRINTCOUNTER) diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index 7b56eb2d6ba9..c1e400511c91 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -30,7 +30,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../../lcd/e3v2/proui/dwin.h" #endif @@ -73,7 +73,7 @@ void GcodeSuite::M303() { default: SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM)); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_BAD_EXTRUDER_NUM)); + TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_BAD_EXTRUDER_NUM)); return; } @@ -83,7 +83,7 @@ void GcodeSuite::M303() { const celsius_t temp = seenS ? parser.value_celsius() : default_temp; const bool u = parser.boolval('U'); - #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #if ENABLED(DWIN_LCD_PROUI) if (seenC) HMI_data.PidCycles = c; if (seenS) { if (hid == H_BED) HMI_data.BedPidT = temp; else HMI_data.HotendPidT = temp; } #endif diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 34a160fc5c86..9d9fddc8c1b4 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -473,7 +473,7 @@ #endif // Aliases for LCD features -#if EITHER(DWIN_CREALITY_LCD, DWIN_CREALITY_LCD_ENHANCED) +#if EITHER(DWIN_CREALITY_LCD, DWIN_LCD_PROUI) #define HAS_DWIN_E3V2_BASIC 1 #endif #if EITHER(HAS_DWIN_E3V2_BASIC, DWIN_CREALITY_LCD_JYERSUI) @@ -494,7 +494,7 @@ #endif #define HAS_LCD_BRIGHTNESS 1 #define LCD_BRIGHTNESS_MAX 250 - #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #if ENABLED(DWIN_LCD_PROUI) #define LCD_BRIGHTNESS_DEFAULT 127 #endif #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index fa273cd32eaf..547ca36e92d3 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -3177,7 +3177,7 @@ * Advanced Pause - Filament Change */ #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI) || BOTH(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT) + #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) || BOTH(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT) #define M600_PURGE_MORE_RESUMABLE 1 #endif #ifndef FILAMENT_CHANGE_SLOW_LOAD_LENGTH diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index e8abf1b286c5..83d37f22df5a 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -615,6 +615,8 @@ #error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 2." #elif defined(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS is now just Z_STEPPER_ALIGN_STEPPER_XY." +#elif defined(DWIN_CREALITY_LCD_ENHANCED) + #error "DWIN_CREALITY_LCD_ENHANCED is now DWIN_LCD_PROUI." #endif constexpr float arm[] = AXIS_RELATIVE_MODES; @@ -846,7 +848,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0." #endif #elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && NONE(HAS_MARLINUI_U8GLIB, HAS_GRAPHICAL_TFT, HAS_MARLINUI_HD44780, EXTENSIBLE_UI, HAS_DWIN_E3V2, IS_DWIN_MARLINUI) - #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, DWIN_CREALITY_LCD, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_*, OR EXTENSIBLE_UI." + #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_*, OR EXTENSIBLE_UI." #endif #if ENABLED(USE_M73_REMAINING_TIME) && DISABLED(LCD_SET_PROGRESS_MANUALLY) @@ -1830,7 +1832,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * LCD_BED_LEVELING requirements */ #if ENABLED(LCD_BED_LEVELING) - #if NONE(HAS_MARLINUI_MENU, DWIN_CREALITY_LCD, DWIN_CREALITY_LCD_ENHANCED) + #if NONE(HAS_MARLINUI_MENU, DWIN_CREALITY_LCD, DWIN_LCD_PROUI) #error "LCD_BED_LEVELING is not supported by the selected LCD controller." #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL) #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING." @@ -2719,7 +2721,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \ + COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) \ + COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY) \ - + COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE) \ + + COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE) \ + COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_GENERIC_12864_1_1) \ + COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \ + COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \ @@ -2849,17 +2851,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) #error "DWIN_CREALITY_LCD does not support LCD_BED_LEVELING with PROBE_MANUALLY." #endif -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #if DISABLED(SDSUPPORT) - #error "DWIN_CREALITY_LCD_ENHANCED requires SDSUPPORT to be enabled." + #error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled." #elif ENABLED(PID_EDIT_MENU) - #error "DWIN_CREALITY_LCD_ENHANCED does not support PID_EDIT_MENU." + #error "DWIN_LCD_PROUI does not support PID_EDIT_MENU." #elif ENABLED(PID_AUTOTUNE_MENU) - #error "DWIN_CREALITY_LCD_ENHANCED does not support PID_AUTOTUNE_MENU." + #error "DWIN_LCD_PROUI does not support PID_AUTOTUNE_MENU." #elif ENABLED(LEVEL_BED_CORNERS) - #error "DWIN_CREALITY_LCD_ENHANCED does not support LEVEL_BED_CORNERS." + #error "DWIN_LCD_PROUI does not support LEVEL_BED_CORNERS." #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) - #error "DWIN_CREALITY_LCD_ENHANCED does not support LCD_BED_LEVELING with PROBE_MANUALLY." + #error "DWIN_LCD_PROUI does not support LCD_BED_LEVELING with PROBE_MANUALLY." #endif #endif @@ -3438,7 +3440,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "A very large BLOCK_BUFFER_SIZE is not needed and takes longer to drain the buffer on pause / cancel." #endif -#if ENABLED(LED_CONTROL_MENU) && NONE(HAS_MARLINUI_MENU, DWIN_CREALITY_LCD_ENHANCED) +#if ENABLED(LED_CONTROL_MENU) && NONE(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) #error "LED_CONTROL_MENU requires an LCD controller that implements the menu." #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 5af7fc294dc6..9e08854aeddd 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -31,7 +31,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#if ENABLED(DWIN_LCD_PROUI) #include "dwin.h" #include "dwin_popup.h" @@ -3974,4 +3974,4 @@ void Draw_Steps_Menu() { } #endif -#endif // DWIN_CREALITY_LCD_ENHANCED +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp index 105f1aaf1cd4..b8bff3515959 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp @@ -31,7 +31,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#if ENABLED(DWIN_LCD_PROUI) #include "../../../inc/MarlinConfig.h" @@ -159,4 +159,4 @@ void DWIN_SRAMToPic(uint8_t picID) { // DWIN_Send(i); //} -#endif // DWIN_CREALITY_LCD_ENHANCED +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp index 34b05328d7e9..33f216fde6ef 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp @@ -31,7 +31,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#if ENABLED(DWIN_LCD_PROUI) #include "dwin.h" #include "dwin_popup.h" @@ -60,4 +60,4 @@ void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2) { DWIN_UpdateLCD(); } -#endif // DWIN_CREALITY_LCD_ENHANCED +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index d3cfc9a3e472..1dbd53139061 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -31,7 +31,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#if ENABLED(DWIN_LCD_PROUI) #include "../../../inc/MarlinConfig.h" #include "dwin_lcd.h" @@ -453,4 +453,4 @@ MenuItemPtrClass::MenuItemPtrClass(uint8_t cicon, const char * const text, void value = val; }; -#endif // DWIN_CREALITY_LCD_ENHANCED +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp index 6232c89534b3..f04c079017b3 100644 --- a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp @@ -32,7 +32,7 @@ #include "../../../inc/MarlinConfigPre.h" #include "dwin_defines.h" -#if BOTH(DWIN_CREALITY_LCD_ENHANCED, HAS_ESDIAG) +#if BOTH(DWIN_LCD_PROUI, HAS_ESDIAG) #include "endstop_diag.h" @@ -108,4 +108,4 @@ void ESDiagClass::Update() { DWIN_UpdateLCD(); } -#endif // DWIN_CREALITY_LCD_ENHANCED && HAS_ESDIAG +#endif // DWIN_LCD_PROUI && HAS_ESDIAG diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp index 3f8339ad48bc..2ccdcc12073d 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp @@ -31,7 +31,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#if ENABLED(DWIN_LCD_PROUI) #include "../../../core/types.h" #include "dwin_lcd.h" @@ -75,4 +75,4 @@ void LockScreenClass::onEncoder(EncoderState encoder_diffState) { DWIN_UpdateLCD(); } -#endif // DWIN_CREALITY_LCD_ENHANCED +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 0f63f77b9930..275a29cd3850 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -31,7 +31,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if BOTH(DWIN_CREALITY_LCD_ENHANCED, HAS_MESH) +#if BOTH(DWIN_LCD_PROUI, HAS_MESH) #include "meshviewer.h" @@ -109,4 +109,4 @@ void MeshViewerClass::Draw() { ); } -#endif // DWIN_CREALITY_LCD_ENHANCED && HAS_MESH +#endif // DWIN_LCD_PROUI && HAS_MESH diff --git a/Marlin/src/lcd/e3v2/proui/printstats.cpp b/Marlin/src/lcd/e3v2/proui/printstats.cpp index ec14ebb8bf6e..54c87f4be102 100644 --- a/Marlin/src/lcd/e3v2/proui/printstats.cpp +++ b/Marlin/src/lcd/e3v2/proui/printstats.cpp @@ -31,7 +31,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if BOTH(DWIN_CREALITY_LCD_ENHANCED, PRINTCOUNTER) +#if BOTH(DWIN_LCD_PROUI, PRINTCOUNTER) #include "printstats.h" @@ -75,4 +75,4 @@ void PrintStatsClass::Reset() { HMI_AudioFeedback(); } -#endif // DWIN_CREALITY_LCD_ENHANCED && PRINTCOUNTER +#endif // DWIN_LCD_PROUI && PRINTCOUNTER diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index d2884cc3f16f..810d0db52789 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -47,7 +47,7 @@ MarlinUI ui; #if ENABLED(DWIN_CREALITY_LCD) #include "e3v2/creality/dwin.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "fontutils.h" #include "e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) @@ -69,7 +69,7 @@ MarlinUI ui; constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #if HAS_STATUS_MESSAGE - #if ENABLED(STATUS_MESSAGE_SCROLLING) && EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_ENHANCED) + #if ENABLED(STATUS_MESSAGE_SCROLLING) && EITHER(HAS_WIRED_LCD, DWIN_LCD_PROUI) uint8_t MarlinUI::status_scroll_offset; // = 0 #endif char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1]; @@ -1522,13 +1522,13 @@ void MarlinUI::init() { #endif - #if ENABLED(STATUS_MESSAGE_SCROLLING) && EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_ENHANCED) + #if ENABLED(STATUS_MESSAGE_SCROLLING) && EITHER(HAS_WIRED_LCD, DWIN_LCD_PROUI) status_scroll_offset = 0; #endif TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message)); TERN_(DWIN_CREALITY_LCD, DWIN_StatusChanged(status_message)); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_CheckStatusMessage()); + TERN_(DWIN_LCD_PROUI, 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 15e9f73d653b..36cbb14c5ccc 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -57,7 +57,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "e3v2/creality/dwin.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "e3v2/proui/dwin.h" #endif @@ -333,7 +333,7 @@ class MarlinUI { #if HAS_STATUS_MESSAGE - #if EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_ENHANCED) + #if EITHER(HAS_WIRED_LCD, DWIN_LCD_PROUI) #if ENABLED(STATUS_MESSAGE_SCROLLING) #define MAX_MESSAGE_LENGTH _MAX(LONG_FILENAME_LENGTH, MAX_LANG_CHARSIZE * 2 * (LCD_WIDTH)) #else @@ -367,7 +367,7 @@ class MarlinUI { static void set_status(FSTR_P const fstr, const int8_t level=0); static void status_printf(const uint8_t level, FSTR_P const fmt, ...); - #if EITHER(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED) + #if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI) 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); @@ -619,7 +619,7 @@ class MarlinUI { static bool use_click() { return false; } #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI) + #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); #else static void _pause_show_message() {} diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 89d2769247eb..8793ea49dcf1 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -87,7 +87,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../lcd/e3v2/proui/dwin.h" #endif @@ -316,7 +316,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Stow Probe"))); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_Popup_Confirm(ICON_BLTouch, F("Stow Probe"), FPSTR(CONTINUE_STR))); + TERN_(DWIN_LCD_PROUI, DWIN_Popup_Confirm(ICON_BLTouch, F("Stow Probe"), FPSTR(CONTINUE_STR))); TERN_(HAS_RESUME_CONTINUE, wait_for_user_response()); ui.reset_status(); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index cd71344389c9..e0b2eccbbd34 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -74,7 +74,7 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "../lcd/e3v2/jyersui/dwin.h" @@ -487,7 +487,7 @@ typedef struct SettingsDataStruct { // // Ender-3 V2 DWIN // - #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #if ENABLED(DWIN_LCD_PROUI) uint8_t dwin_data[eeprom_data_size]; #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) uint8_t dwin_settings[CrealityDWIN.eeprom_data_size]; @@ -1465,7 +1465,7 @@ void MarlinSettings::postprocess() { // // Creality DWIN User Data // - #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #if ENABLED(DWIN_LCD_PROUI) { char dwin_data[eeprom_data_size] = { 0 }; DWIN_StoreSettings(dwin_data); @@ -1610,7 +1610,7 @@ void MarlinSettings::postprocess() { stored_ver[1] = '\0'; } DEBUG_ECHO_MSG("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")"); - TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_ERR_EEPROM_VERSION)); + TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_ERR_EEPROM_VERSION)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_VERSION))); IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_version()); @@ -2408,7 +2408,7 @@ void MarlinSettings::postprocess() { // // Creality DWIN User Data // - #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #if ENABLED(DWIN_LCD_PROUI) { const char dwin_data[eeprom_data_size] = { 0 }; _FIELD_TEST(dwin_data); @@ -2512,7 +2512,7 @@ void MarlinSettings::postprocess() { else if (working_crc != stored_crc) { eeprom_error = true; DEBUG_ERROR_MSG("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!"); - TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_ERR_EEPROM_CRC)); + TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_ERR_EEPROM_CRC)); TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_CRC))); IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_crc()); } @@ -2830,7 +2830,7 @@ void MarlinSettings::reset() { #endif #endif - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_SetDataDefaults()); + TERN_(DWIN_LCD_PROUI, DWIN_SetDataDefaults()); TERN_(DWIN_CREALITY_LCD_JYERSUI, CrealityDWIN.Reset_Settings()); // diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 19501bce6e81..4adf96891982 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -51,7 +51,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../lcd/e3v2/proui/dwin.h" #endif @@ -623,12 +623,12 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(HAS_FAN_LOGIC, fan_update_ms = next_temp_ms + fan_update_interval_ms); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_STARTED)); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(isbed ? PID_BED_START : PID_EXTR_START)); + TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(isbed ? PID_BED_START : PID_EXTR_START)); if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - (HOTEND_OVERSHOOT))) { SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); + TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); return; } @@ -719,7 +719,7 @@ volatile bool Temperature::raw_temps_ready = false; if (current_temp > target + MAX_OVERSHOOT_PID_AUTOTUNE) { SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); + TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); break; } @@ -756,7 +756,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif if ((ms - _MIN(t1, t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { TERN_(DWIN_CREALITY_LCD, DWIN_Popup_Temperature(0)); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TUNING_TIMEOUT)); + TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TUNING_TIMEOUT)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TIMEOUT))); SERIAL_ECHOLNPGM(STR_PID_TIMEOUT); @@ -812,7 +812,7 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(color)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE)); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_DONE)); + TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_DONE)); goto EXIT_M303; } @@ -830,7 +830,7 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(color)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE)); - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_DONE)); + TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_DONE)); EXIT_M303: TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = true); diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 996677341894..41ec44d4b7b0 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -33,7 +33,7 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) +#elif ENABLED(DWIN_LCD_PROUI) #include "../lcd/e3v2/proui/dwin.h" #endif diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index 257616ddd172..6a15ec122179 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -15,8 +15,8 @@ exec_test $1 $2 "Ender 3 v2 with CrealityUI" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_disable DWIN_CREALITY_LCD -opt_enable DWIN_CREALITY_LCD_ENHANCED BLTOUCH AUTO_BED_LEVELING_UBL Z_SAFE_HOMING INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING BAUD_RATE_GCODE -exec_test $1 $2 "Ender 3 v2 with Enhanced UI" "$3" +opt_enable DWIN_LCD_PROUI BLTOUCH AUTO_BED_LEVELING_UBL Z_SAFE_HOMING INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING BAUD_RATE_GCODE +exec_test $1 $2 "Ender 3 v2 with Pro UI" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_disable DWIN_CREALITY_LCD diff --git a/ini/features.ini b/ini/features.ini index ad32934f42b5..48b6a2c47af4 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -47,7 +47,7 @@ SOFT_I2C_EEPROM = SlowSoftI2CMaster, SlowSoftWire=https:/ SPI_EEPROM = src_filter=+ HAS_DWIN_E3V2|IS_DWIN_MARLINUI = src_filter=+ DWIN_CREALITY_LCD = src_filter=+ -DWIN_CREALITY_LCD_ENHANCED = src_filter=+ +DWIN_LCD_PROUI = src_filter=+ DWIN_CREALITY_LCD_JYERSUI = src_filter=+ IS_DWIN_MARLINUI = src_filter=+ HAS_GRAPHICAL_TFT = src_filter=+ From 4eb1326355aaa022e1a9d41625851876b20b5aa3 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 11 Mar 2022 21:52:35 +1300 Subject: [PATCH 151/502] =?UTF-8?q?=F0=9F=93=9D=20Update=20laser/spindle?= =?UTF-8?q?=20docs=20link=20(#23886)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 04a8d63ef7b5..83a8eaa0fb87 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3455,7 +3455,7 @@ * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V * hardware PWM pin for the speed control and a pin for the rotation direction. * - * See https://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + * See https://marlinfw.org/docs/configuration/2.0.9/laser_spindle.html for more config details. */ //#define SPINDLE_FEATURE //#define LASER_FEATURE From 56955c179d1fb6991f6267a344e712b1caeae154 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 11 Mar 2022 02:56:24 -0600 Subject: [PATCH 152/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20UI=20include?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to ~2 --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index a65d84477148..68d8ecc26b72 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -36,10 +36,6 @@ #include "../../../module/probe.h" #include "../../queue.h" -#if HAS_STATUS_MESSAGE - #include "../../../lcd/marlinui.h" -#endif - #if ENABLED(AUTO_BED_LEVELING_LINEAR) #include "../../../libs/least_squares_fit.h" #endif @@ -48,9 +44,7 @@ #include "../../../libs/vector_3.h" #endif -#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) -#include "../../../core/debug_out.h" - +#include "../../../lcd/marlinui.h" #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD) @@ -63,6 +57,9 @@ #include "../../../module/tool_change.h" #endif +#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) +#include "../../../core/debug_out.h" + #if ABL_USES_GRID #if ENABLED(PROBE_Y_FIRST) #define PR_OUTER_VAR abl.meshCount.x From b045c91f266d222f5851d76fb9723552c1f00313 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 12 Mar 2022 03:51:25 +1300 Subject: [PATCH 153/502] fix g29 (#23887) --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 68d8ecc26b72..33f45e1c9f26 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -718,7 +718,7 @@ G29_TYPE GcodeSuite::G29() { #endif // AUTO_BED_LEVELING_3POINT - ui.reset_status(); + TERN_(HAS_STATUS_MESSAGE, ui.reset_status()); // Stow the probe. No raise for FIX_MOUNTED_PROBE. if (probe.stow()) { From eabeac29fd311dc09799ce8a0db742048b07a2a9 Mon Sep 17 00:00:00 2001 From: Miguel Risco-Castillo Date: Fri, 11 Mar 2022 15:06:49 -0500 Subject: [PATCH 154/502] =?UTF-8?q?=F0=9F=9A=B8=20Update=20Ender3=20V2/S1?= =?UTF-8?q?=20Pro=20UI=20(#23878)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 8 +- Marlin/src/feature/pause.cpp | 3 +- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 2 + Marlin/src/gcode/config/M302.cpp | 5 + Marlin/src/gcode/sd/M524.cpp | 20 +- Marlin/src/gcode/stats/M75-M78.cpp | 3 +- Marlin/src/inc/Conditionals_LCD.h | 5 +- Marlin/src/lcd/e3v2/common/encoder.h | 20 + Marlin/src/lcd/e3v2/creality/dwin.cpp | 25 +- Marlin/src/lcd/e3v2/creality/dwin.h | 1 + Marlin/src/lcd/e3v2/proui/dwin.cpp | 1440 +++++++---------- Marlin/src/lcd/e3v2/proui/dwin.h | 98 +- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 43 +- Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp | 56 +- Marlin/src/lcd/e3v2/proui/dwin_lcd.h | 26 +- Marlin/src/lcd/e3v2/proui/dwin_popup.cpp | 60 +- Marlin/src/lcd/e3v2/proui/dwin_popup.h | 27 +- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 119 +- Marlin/src/lcd/e3v2/proui/dwinui.h | 126 +- Marlin/src/lcd/e3v2/proui/endstop_diag.cpp | 11 +- Marlin/src/lcd/e3v2/proui/endstop_diag.h | 8 +- Marlin/src/lcd/e3v2/proui/lockscreen.cpp | 4 +- Marlin/src/lcd/e3v2/proui/lockscreen.h | 4 +- Marlin/src/lcd/e3v2/proui/menus.cpp | 370 +++++ Marlin/src/lcd/e3v2/proui/menus.h | 94 ++ Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 68 +- Marlin/src/lcd/e3v2/proui/meshviewer.h | 17 +- Marlin/src/lcd/e3v2/proui/printstats.cpp | 16 +- Marlin/src/lcd/e3v2/proui/printstats.h | 12 +- Marlin/src/lcd/language/language_en.h | 6 +- Marlin/src/lcd/marlinui.cpp | 7 +- Marlin/src/lcd/marlinui.h | 14 +- Marlin/src/module/settings.cpp | 8 +- Marlin/src/module/stepper.cpp | 3 + Marlin/src/module/temperature.cpp | 2 +- .../stm32f1/pins_BTT_SKR_MINI_E3_common.h | 2 +- .../pins/stm32f1/pins_CREALITY_V24S1_301.h | 26 +- Marlin/src/sd/cardreader.cpp | 11 +- Marlin/src/sd/cardreader.h | 7 + buildroot/tests/STM32F103RE_creality | 5 +- 40 files changed, 1574 insertions(+), 1208 deletions(-) create mode 100644 Marlin/src/lcd/e3v2/proui/menus.cpp create mode 100644 Marlin/src/lcd/e3v2/proui/menus.h diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index cc928baff942..4117d3f382a1 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -822,7 +822,7 @@ void idle(bool no_stepper_sleep/*=false*/) { TERN_(USE_BEEPER, buzzer.tick()); // Handle UI input / draw events - TERN(HAS_DWIN_E3V2_BASIC, DWIN_Update(), ui.update()); + TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update()); // Run i2c Position Encoders #if ENABLED(I2C_POSITION_ENCODERS) @@ -1571,11 +1571,7 @@ void setup() { #endif #if HAS_DWIN_E3V2_BASIC - SETUP_LOG("E3V2 Init"); - Encoder_Configuration(); - HMI_Init(); - HMI_SetLanguageCache(); - HMI_StartFrame(true); + SETUP_RUN(DWIN_InitScreen()); #endif #if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 79780021cfb4..636ac32042b6 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -407,6 +407,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool #endif TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR))); + TERN_(DWIN_LCD_PROUI, DWIN_Print_Pause()); // Indicate that the printer is paused ++did_pause_print; @@ -709,7 +710,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_ TERN_(HAS_FILAMENT_SENSOR, runout.reset()); - TERN_(HAS_STATUS_MESSAGE, ui.reset_status()); + TERN(DWIN_LCD_PROUI, DWIN_Print_Resume(), ui.reset_status()); TERN_(HAS_MARLINUI_MENU, ui.return_to_status()); TERN_(DWIN_LCD_PROUI, HMI_ReturnScreen()); } diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 309d21fe53f7..3767cef3cfbf 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -105,6 +105,7 @@ void GcodeSuite::G29() { if (!ui.wait_for_move) { queue.inject(parser.seen_test('N') ? F("G28" TERN(CAN_SET_LEVELING_AFTER_G28, "L0", "") "\nG29S2") : F("G29S2")); TERN_(EXTENSIBLE_UI, ExtUI::onMeshLevelingStart()); + TERN_(DWIN_LCD_PROUI, DWIN_MeshLevelingStart()); return; } state = MeshNext; @@ -127,6 +128,7 @@ void GcodeSuite::G29() { // Save Z for the previous mesh position mbl.set_zigzag_z(mbl_probe_index - 1, current_position.z); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z)); + TERN_(DWIN_LCD_PROUI, DWIN_MeshUpdate(_MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS), current_position.z)); SET_SOFT_ENDSTOP_LOOSE(false); } // If there's another point to sample, move there with optional lift. diff --git a/Marlin/src/gcode/config/M302.cpp b/Marlin/src/gcode/config/M302.cpp index e271dcd469ee..9f4d569d7b2e 100644 --- a/Marlin/src/gcode/config/M302.cpp +++ b/Marlin/src/gcode/config/M302.cpp @@ -27,6 +27,10 @@ #include "../gcode.h" #include "../../module/temperature.h" +#if ENABLED(DWIN_LCD_PROUI) + #include "../../lcd/e3v2/proui/dwin_defines.h" +#endif + /** * M302: Allow cold extrudes, or set the minimum extrude temperature * @@ -47,6 +51,7 @@ void GcodeSuite::M302() { if (seen_S) { thermalManager.extrude_min_temp = parser.value_celsius(); thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0); + TERN_(DWIN_LCD_PROUI, HMI_data.ExtMinT = thermalManager.extrude_min_temp); } if (parser.seen('P')) diff --git a/Marlin/src/gcode/sd/M524.cpp b/Marlin/src/gcode/sd/M524.cpp index e7159155655c..001a1e184263 100644 --- a/Marlin/src/gcode/sd/M524.cpp +++ b/Marlin/src/gcode/sd/M524.cpp @@ -27,15 +27,27 @@ #include "../gcode.h" #include "../../sd/cardreader.h" +#if ENABLED(DWIN_LCD_PROUI) + #include "../../lcd/e3v2/proui/dwin.h" +#endif + /** * M524: Abort the current SD print job (started with M24) */ void GcodeSuite::M524() { - if (IS_SD_PRINTING()) - card.abortFilePrintSoon(); - else if (card.isMounted()) - card.closefile(); + #if ENABLED(DWIN_LCD_PROUI) + + HMI_flag.abort_flag = true; // The LCD will handle it + + #else + + if (IS_SD_PRINTING()) + card.abortFilePrintSoon(); + else if (card.isMounted()) + card.closefile(); + + #endif } diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index 01630adc5078..0ed1e6693013 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -39,8 +39,8 @@ void GcodeSuite::M75() { startOrResumeJob(); #if ENABLED(DWIN_LCD_PROUI) - DWIN_Print_Header(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT)); DWIN_Print_Started(false); + if (!IS_SD_PRINTING()) DWIN_Print_Header(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT)); #endif } @@ -50,6 +50,7 @@ void GcodeSuite::M75() { void GcodeSuite::M76() { print_job_timer.pause(); TERN_(HOST_PAUSE_M76, hostui.pause()); + TERN_(DWIN_LCD_PROUI, DWIN_Print_Pause()); } /** diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 9d9fddc8c1b4..33d9e462209d 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -479,6 +479,9 @@ #if EITHER(HAS_DWIN_E3V2_BASIC, DWIN_CREALITY_LCD_JYERSUI) #define HAS_DWIN_E3V2 1 #endif +#if ENABLED(DWIN_LCD_PROUI) + #define DO_LIST_BIN_FILES 1 +#endif // E3V2 extras #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI @@ -513,7 +516,7 @@ #endif #endif -#if ANY(HAS_WIRED_LCD, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) +#if ANY(HAS_WIRED_LCD, EXTENSIBLE_UI, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) #define HAS_DISPLAY 1 #endif diff --git a/Marlin/src/lcd/e3v2/common/encoder.h b/Marlin/src/lcd/e3v2/common/encoder.h index e5d9645ed43b..3ab8c3bf422b 100644 --- a/Marlin/src/lcd/e3v2/common/encoder.h +++ b/Marlin/src/lcd/e3v2/common/encoder.h @@ -45,12 +45,32 @@ typedef enum { ENCODER_DIFF_ENTER = 3 // click } EncoderState; +#define ENCODER_WAIT_MS 20 + // Encoder initialization void Encoder_Configuration(); // Analyze encoder value and return state EncoderState Encoder_ReceiveAnalyze(); +inline EncoderState get_encoder_state() { + static millis_t Encoder_ms = 0; + const millis_t ms = millis(); + if (PENDING(ms, Encoder_ms)) return ENCODER_DIFF_NO; + const EncoderState state = Encoder_ReceiveAnalyze(); + if (state != ENCODER_DIFF_NO) Encoder_ms = ms + ENCODER_WAIT_MS; + return state; +} + +template +inline bool Apply_Encoder(const EncoderState &encoder_diffState, T &valref) { + if (encoder_diffState == ENCODER_DIFF_CW) + valref += EncoderRate.encoderMoveValue; + else if (encoder_diffState == ENCODER_DIFF_CCW) + valref -= EncoderRate.encoderMoveValue; + return encoder_diffState == ENCODER_DIFF_ENTER; +} + /*********************** Encoder LED ***********************/ #if PIN_EXISTS(LCD_LED) diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index f20260e43d51..7dc06d00f2aa 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -471,15 +471,6 @@ void Draw_Back_First(const bool is_sel=true) { if (is_sel) Draw_Menu_Cursor(0); } -template -inline bool Apply_Encoder(const EncoderState &encoder_diffState, T &valref) { - if (encoder_diffState == ENCODER_DIFF_CW) - valref += EncoderRate.encoderMoveValue; - else if (encoder_diffState == ENCODER_DIFF_CCW) - valref -= EncoderRate.encoderMoveValue; - return encoder_diffState == ENCODER_DIFF_ENTER; -} - // // Draw Menus // @@ -1296,15 +1287,6 @@ void Goto_MainMenu() { TERN(HAS_ONESTEP_LEVELING, ICON_Leveling, ICON_StartInfo)(); } -inline EncoderState get_encoder_state() { - static millis_t Encoder_ms = 0; - const millis_t ms = millis(); - if (PENDING(ms, Encoder_ms)) return ENCODER_DIFF_NO; - const EncoderState state = Encoder_ReceiveAnalyze(); - if (state != ENCODER_DIFF_NO) Encoder_ms = ms + ENCODER_WAIT_MS; - return state; -} - void HMI_Plan_Move(const feedRate_t fr_mm_s) { if (!planner.is_full()) { planner.synchronize(); @@ -4086,6 +4068,13 @@ void HMI_Init() { HMI_SetLanguage(); } +void DWIN_InitScreen() { + Encoder_Configuration(); + HMI_Init(); + HMI_SetLanguageCache(); + HMI_StartFrame(true); +} + void DWIN_Update() { EachMomentUpdate(); // Status update HMI_SDCardUpdate(); // SD card update diff --git a/Marlin/src/lcd/e3v2/creality/dwin.h b/Marlin/src/lcd/e3v2/creality/dwin.h index 3122a6fcbae1..3ccb70e52f7a 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.h +++ b/Marlin/src/lcd/e3v2/creality/dwin.h @@ -236,6 +236,7 @@ void HMI_MaxJerk(); // Maximum jerk speed submenu void HMI_Step(); // Transmission ratio void HMI_Init(); +void DWIN_InitScreen(); void DWIN_Update(); void EachMomentUpdate(); void DWIN_HandleScreen(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 9e08854aeddd..0a392cd5636d 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -21,19 +21,18 @@ */ /** - * Enhanced DWIN implementation + * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.11.2 - * date: 2022/01/19 - * - * Based on the original code provided by Creality under GPL + * Version: 3.15.2 + * Date: 2022/03/01 */ -#include "../../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfig.h" #if ENABLED(DWIN_LCD_PROUI) #include "dwin.h" +#include "menus.h" #include "dwin_popup.h" #include "../../fontutils.h" @@ -65,6 +64,10 @@ #include "../../../feature/host_actions.h" #endif +#if ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) && DISABLED(PROBE_MANUALLY) + #define HAS_ONESTEP_LEVELING 1 +#endif + #if HAS_MESH || HAS_ONESTEP_LEVELING #include "../../../feature/bedlevel/bedlevel.h" #endif @@ -77,8 +80,14 @@ #include "../../../feature/bltouch.h" #endif -#if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) - #include "../../../feature/babystep.h" +#if ANY(BABYSTEPPING, HAS_BED_PROBE, HAS_WORKSPACE_OFFSET) + #define HAS_ZOFFSET_ITEM 1 + #if !HAS_BED_PROBE && ENABLED(BABYSTEPPING) + #define JUST_BABYSTEP 1 + #endif + #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) + #include "../../../feature/babystep.h" + #endif #endif #if ENABLED(POWER_LOSS_RECOVERY) @@ -171,7 +180,7 @@ enum SelectItem : uint8_t { PAGE_PRINT = 0, PAGE_PREPARE, PAGE_CONTROL, - PAGE_INFO_LEV_ADV, + PAGE_ADVANCE, PAGE_COUNT, PRINT_SETUP = 0, @@ -192,14 +201,13 @@ typedef struct { 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; +constexpr float max_feedrate_edit_values[] = DEFAULT_MAX_FEEDRATE; +constexpr float max_acceleration_edit_values[] = DEFAULT_MAX_ACCELERATION; #if HAS_CLASSIC_JERK - constexpr float default_max_jerk[] = { DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK, DEFAULT_EJERK }; + constexpr float max_jerk_edit_values[] = { DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK, DEFAULT_EJERK }; #endif static uint8_t _percent_done = 0; @@ -208,18 +216,6 @@ static uint32_t _remain_time = 0; // Additional Aux Host Support static bool sdprint = false; -#if ENABLED(PAUSE_HEAT) - #if HAS_HOTEND - celsius_t resume_hotend_temp = 0; - #endif - #if HAS_HEATED_BED - celsius_t resume_bed_temp = 0; - #endif - #if HAS_FAN - uint16_t resume_fan = 0; - #endif -#endif - #if HAS_ZOFFSET_ITEM float dwin_zoffset = 0, last_zoffset = 0; #endif @@ -348,31 +344,13 @@ void ICON_Control() { ICON_Button(select_page.now == PAGE_CONTROL, ICON_Control_0, ico, txt, GET_TEXT_F(MSG_CONTROL)); } -// -// Main Menu: "Info" -// -void ICON_StartInfo() { - constexpr frame_rect_t ico = { 145, 226, 110, 100 }; - constexpr text_info_t txt = { 91, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; - ICON_Button(select_page.now == PAGE_INFO_LEV_ADV, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_INFO)); -} - -// -// Main Menu: "Level" -// -void ICON_Leveling() { - constexpr frame_rect_t ico = { 145, 226, 110, 100 }; - constexpr text_info_t txt = { 211, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; - ICON_Button(select_page.now == PAGE_INFO_LEV_ADV, ICON_Leveling_0, ico, txt, GET_TEXT_F(MSG_BUTTON_LEVEL)); -} - // // Main Menu: "Advanced Settings" // void ICON_AdvSettings() { constexpr frame_rect_t ico = { 145, 226, 110, 100 }; constexpr text_info_t txt = { 91, { 405, TERN(USE_STOCK_DWIN_SET, 446, 447) }, 27, 15 }; - ICON_Button(select_page.now == PAGE_INFO_LEV_ADV, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_ADVANCED)); + ICON_Button(select_page.now == PAGE_ADVANCE, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_ADVANCED)); } // @@ -415,14 +393,6 @@ void ICON_Stop() { // Drawing routines //----------------------------------------------------------------------------- -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 int8_t line) { - DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, MBASE(line) - 18, 14, MBASE(line + 1) - 20); -} - void Move_Highlight(const int8_t from, const int8_t newline) { Erase_Menu_Cursor(newline - from); Draw_Menu_Cursor(newline); @@ -430,7 +400,7 @@ void Move_Highlight(const int8_t from, const int8_t newline) { void Add_Menu_Line() { Move_Highlight(1, MROWS); - DWIN_Draw_Line(HMI_data.SplitLine_Color, 16, MBASE(MROWS + 1) - 20, 256, MBASE(MROWS + 1) - 19); + DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(MROWS + 1), 240); } void Scroll_Menu(const uint8_t dir) { @@ -449,21 +419,6 @@ void Erase_Menu_Text(const uint8_t line) { DWIN_Draw_Rectangle(1, HMI_data.Background_Color, LBLX, MBASE(line) - 14, 271, MBASE(line) + 28); } -void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false) { - if (icon) DWINUI::Draw_Icon(icon, ICOX, MBASE(line) - 3); - if (label) DWINUI::Draw_String(LBLX, MBASE(line) - 1, (char*)label); - if (more) DWINUI::Draw_Icon(ICON_More, VALX + 16, MBASE(line) - 3); - DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); -} - -void Draw_Chkb_Line(const uint8_t line, const bool checked) { - DWINUI::Draw_Checkbox(HMI_data.Text_Color, HMI_data.Background_Color, VALX + 16, MBASE(line) - 1, checked); -} - -void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const uint16_t value=0) { - DWINUI::Draw_Int(HMI_data.Text_Color, bcolor, iNum , VALX, MBASE(line) - 1, value); -} - // Draw "Back" line at the top void Draw_Back_First(const bool is_sel=true) { Draw_Menu_Line(0, ICON_Back); @@ -474,24 +429,6 @@ void Draw_Back_First(const bool is_sel=true) { if (is_sel) Draw_Menu_Cursor(0); } -inline EncoderState get_encoder_state() { - static millis_t Encoder_ms = 0; - const millis_t ms = millis(); - if (PENDING(ms, Encoder_ms)) return ENCODER_DIFF_NO; - const EncoderState state = Encoder_ReceiveAnalyze(); - if (state != ENCODER_DIFF_NO) Encoder_ms = ms + ENCODER_WAIT_MS; - return state; -} - -template -inline bool Apply_Encoder(const EncoderState &encoder_diffState, T &valref) { - if (encoder_diffState == ENCODER_DIFF_CW) - valref += EncoderRate.encoderMoveValue; - else if (encoder_diffState == ENCODER_DIFF_CCW) - valref -= EncoderRate.encoderMoveValue; - return encoder_diffState == ENCODER_DIFF_ENTER; -} - //PopUps void Popup_window_PauseOrStop() { if (HMI_IsChinese()) { @@ -530,9 +467,10 @@ void Popup_window_PauseOrStop() { #if HAS_HOTEND || HAS_HEATED_BED void DWIN_Popup_Temperature(const bool toohigh) { - DWINUI::ClearMenuArea(); - Draw_Popup_Bkgd(); + HMI_SaveProcessID(WaitResponse); if (HMI_IsChinese()) { + DWINUI::ClearMenuArea(); + Draw_Popup_Bkgd(); if (toohigh) { DWINUI::Draw_Icon(ICON_TempTooHigh, 102, 165); DWIN_Frame_AreaCopy(1, 103, 371, 237, 386, 52, 285); @@ -545,23 +483,14 @@ void Popup_window_PauseOrStop() { DWIN_Frame_AreaCopy(1, 189, 389, 271, 402, 95, 310); } } - else { - DWIN_Draw_Popup(toohigh ? ICON_TempTooHigh : ICON_TempTooLow, F("Nozzle or Bed temperature"), toohigh ? F("is too high") : F("is too low")); - } + else DWIN_Show_Popup(toohigh ? ICON_TempTooHigh : ICON_TempTooLow, F("Nozzle or Bed temperature"), toohigh ? F("is too high") : F("is too low"), BTN_Continue); } #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); +void DWIN_DrawStatusLine(const char *text) { + DWIN_Draw_Rectangle(1, HMI_data.StatusBg_Color, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20); + if (text) DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, text); } // Clear & reset status line @@ -582,17 +511,15 @@ void DWIN_CheckStatusMessage() { }; void DWIN_DrawStatusMessage() { - const uint8_t max_status_chars = DWIN_WIDTH / DWINUI::fontWidth(); - #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 (slen <= LCD_WIDTH) { if (hash_changed) { - DWIN_DrawStatusLine(HMI_data.StatusTxt_Color, HMI_data.StatusBg_Color, ui.status_message); + DWIN_DrawStatusLine(ui.status_message); hash_changed = false; } } @@ -605,16 +532,16 @@ void DWIN_DrawStatusMessage() { 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); + DWINUI::Draw_String(HMI_data.StatusTxt_Color, stat, LCD_WIDTH); // 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 (rlen < LCD_WIDTH) { + DWINUI::Draw_Char(HMI_data.StatusTxt_Color, '.'); // Always at 1+ spaces left, draw a dot + uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters if (--chars) { // Draw a second dot if there's space - DWINUI::Draw_Char('.'); + DWINUI::Draw_Char(HMI_data.StatusTxt_Color, '.'); if (--chars) - DWINUI::Draw_String(ui.status_message, chars); // Print a second copy of the message + DWINUI::Draw_String(HMI_data.StatusTxt_Color, ui.status_message, chars); // Print a second copy of the message } } MarlinUI::advance_status_scroll(); @@ -623,8 +550,8 @@ void DWIN_DrawStatusMessage() { #else if (hash_changed) { - ui.status_message[max_status_chars] = 0; - DWIN_DrawStatusLine(HMI_data.StatusTxt_Color, HMI_data.StatusBg_Color, ui.status_message); + ui.status_message[LCD_WIDTH] = 0; + DWIN_DrawStatusLine(ui.status_message); hash_changed = false; } @@ -643,7 +570,7 @@ void Draw_Print_Labels() { } void Draw_Print_ProgressBar() { - DWINUI::Draw_IconWB(ICON_Bar, 15, 93); + DWIN_ICON_Show(true, false, false, ICON, ICON_Bar, 15, 93); DWIN_Draw_Rectangle(1, HMI_data.Barfill_Color, 16 + _percent_done * 240 / 100, 93, 256, 113); DWINUI::Draw_Int(HMI_data.PercentTxt_Color, HMI_data.Background_Color, 3, 117, 133, _percent_done); DWINUI::Draw_String(HMI_data.PercentTxt_Color, 142, 133, F("%")); @@ -663,10 +590,21 @@ void Draw_Print_ProgressRemain() { } void ICON_ResumeOrPause() { - if (printingIsPaused() || HMI_flag.pause_flag || HMI_flag.pause_action) - ICON_Resume(); - else - ICON_Pause(); + if (checkkey == PrintProcess) printingIsPaused() ? ICON_Resume() : ICON_Pause(); +} + +// Update filename on print +void DWIN_Print_Header(const char *text = nullptr) { + static char headertxt[31] = ""; // Print header text + if (text) { + const int8_t size = _MIN(30U, strlen_P(text)); + LOOP_L_N(i, size) headertxt[i] = text[i]; + headertxt[size] = '\0'; + } + if (checkkey == PrintProcess || checkkey == PrintDone) { + DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 60, DWIN_WIDTH, 60+16); + DWINUI::Draw_CenteredString(60, headertxt); + } } void Draw_PrintProcess() { @@ -685,17 +623,16 @@ void Draw_PrintProcess() { ICON_Tune(); ICON_ResumeOrPause(); ICON_Stop(); - DWIN_UpdateLCD(); } void Goto_PrintProcess() { - if (checkkey == PrintProcess) { + if (checkkey == PrintProcess) ICON_ResumeOrPause(); - DWIN_UpdateLCD(); - return; + else { + checkkey = PrintProcess; + Draw_PrintProcess(); } - checkkey = PrintProcess; - Draw_PrintProcess(); + DWIN_UpdateLCD(); } void Draw_PrintDone() { @@ -713,8 +650,16 @@ void Draw_PrintDone() { Draw_Print_ProgressElapsed(); Draw_Print_ProgressRemain(); // show print done confirm - DWINUI::Draw_IconWB(HMI_IsChinese() ? ICON_Confirm_C : ICON_Confirm_E, 86, 273); - DWIN_UpdateLCD(); + DWINUI::Draw_Button(BTN_Confirm, 86, 273); +} + +void Goto_PrintDone() { + wait_for_user = true; + if (checkkey != PrintDone) { + checkkey = PrintDone; + Draw_PrintDone(); + DWIN_UpdateLCD(); + } } void Draw_Main_Menu() { @@ -724,18 +669,18 @@ void Draw_Main_Menu() { else Title.ShowCaption(MACHINE_NAME); DWINUI::Draw_Icon(ICON_LOGO, 71, 52); // CREALITY logo + DWIN_ResetStatusLine(); ICON_Print(); ICON_Prepare(); ICON_Control(); ICON_AdvSettings(); - DWIN_UpdateLCD(); } void Goto_Main_Menu() { if (checkkey == MainMenu) return; checkkey = MainMenu; - ui.reset_status(true); Draw_Main_Menu(); + DWIN_UpdateLCD(); } // Draw X, Y, Z and blink if in an un-homed or un-trusted state @@ -751,9 +696,9 @@ void _update_axis_value(const AxisEnum axis, const uint16_t x, const uint16_t y, if (force || changed || draw_qmark || draw_empty) { if (blink && draw_qmark) - DWINUI::Draw_String(HMI_data.Coordinate_Color, HMI_data.Background_Color, x, y, F(" - ? -")); + DWINUI::Draw_String(HMI_data.Coordinate_Color, HMI_data.Background_Color, x, y, F(" - ? -")); else if (blink && draw_empty) - DWINUI::Draw_String(HMI_data.Coordinate_Color, HMI_data.Background_Color, x, y, F(" ")); + DWINUI::Draw_String(HMI_data.Coordinate_Color, HMI_data.Background_Color, x, y, F(" ")); else DWINUI::Draw_Signed_Float(HMI_data.Coordinate_Color, HMI_data.Background_Color, 3, 2, x, y, p); } @@ -766,9 +711,9 @@ void _draw_xyz_position(const bool force) { if (force || blink != _blink) { _blink = blink; //SERIAL_ECHOPGM(" (blink)"); - _update_axis_value(X_AXIS, 35, 459, blink, true); - _update_axis_value(Y_AXIS, 120, 459, blink, true); - _update_axis_value(Z_AXIS, 205, 459, blink, true); + _update_axis_value(X_AXIS, 27, 459, blink, true); + _update_axis_value(Y_AXIS, 112, 459, blink, true); + _update_axis_value(Z_AXIS, 197, 459, blink, true); } //SERIAL_EOL(); } @@ -852,7 +797,7 @@ void update_variable() { static float _offset = 0; if (BABY_Z_VAR != _offset) { _offset = BABY_Z_VAR; - DWINUI::Draw_Signed_Float(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 2, 2, 210, 417, _offset); + DWINUI::Draw_Signed_Float(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 2, 2, 204, 417, _offset); } #if HAS_MESH @@ -908,15 +853,6 @@ void make_name_without_ext(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT) void HMI_SDCardInit() { card.cdroot(); } -// Initialize or re-initialize the LCD -void MarlinUI::init_lcd() { DWIN_Startup(); } - -void MarlinUI::refresh() { /* Nothing to see here */ } - -#if HAS_LCD_BRIGHTNESS - void MarlinUI::_set_brightness() { DWIN_LCD_Brightness(backlight ? brightness : 0); } -#endif - #if ENABLED(SCROLL_LONG_FILENAMES) char shift_name[LONG_FILENAME_LENGTH + 1]; @@ -966,7 +902,8 @@ void Draw_SDItem(const uint16_t item, int16_t row=-1) { // Draw the file/folder with name aligned left char str[strlen(name) + 1]; make_name_without_ext(str, name); - Draw_Menu_Line(row, card.flag.filenameIsDir ? ICON_Folder : ICON_File, str); + const uint8_t icon = card.flag.filenameIsDir ? ICON_Folder : card.fileIsBinary() ? ICON_Binary : ICON_File; + Draw_Menu_Line(row, icon, str); } #if ENABLED(SCROLL_LONG_FILENAMES) @@ -1045,11 +982,8 @@ void HMI_SDCardUpdate() { Redraw_SD_List(); } else if (sdprint && card.isPrinting() && printingIsActive()) { - // TODO: Move card removed abort handling - // to CardReader::manage_media. - card.abortFilePrintSoon(); wait_for_heatup = wait_for_user = false; - dwin_abort_flag = true; // Reset feedrate, return to Home + HMI_flag.abort_flag = true; // Abort print } } DWIN_UpdateLCD(); @@ -1057,10 +991,10 @@ void HMI_SDCardUpdate() { } // -// The status area is always on-screen, except during -// full-screen modal dialogs. (TODO: Keep alive during dialogs) +// The Dashboard is always on-screen, except during +// full-screen modal dialogs. // -void Draw_Status_Area(const bool with_update) { +void DWIN_Draw_Dashboard() { DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, STATUS_Y + 21, DWIN_WIDTH, DWIN_HEIGHT - 1); @@ -1095,7 +1029,7 @@ void Draw_Status_Area(const bool with_update) { DWINUI::Draw_Icon(planner.leveling_active ? ICON_SetZOffset : ICON_Zoffset, 187, 416); #endif - DWINUI::Draw_Signed_Float(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 2, 2, 210, 417, BABY_Z_VAR); + DWINUI::Draw_Signed_Float(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 2, 2, 204, 417, BABY_Z_VAR); DWIN_Draw_Rectangle(1, HMI_data.SplitLine_Color, 0, 449, DWIN_WIDTH, 451); @@ -1104,16 +1038,6 @@ void Draw_Status_Area(const bool with_update) { DWINUI::Draw_Icon(ICON_MaxSpeedZ, 180, 456); _draw_xyz_position(true); - if (with_update) { - DWIN_UpdateLCD(); - delay(5); - } -} - -void HMI_StartFrame(const bool with_update) { - Goto_Main_Menu(); - DWIN_DrawStatusLine(nullptr); - Draw_Status_Area(with_update); } void Draw_Info_Menu() { @@ -1143,8 +1067,6 @@ void Draw_Info_Menu() { DWINUI::Draw_Icon(ICON_PrintSize + i, ICOX, 99 + i * 73); DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MBASE(2) + i * 73, 240); } - - DWIN_UpdateLCD(); } void Draw_Print_File_Menu() { @@ -1166,7 +1088,7 @@ void HMI_MainMenu() { case PAGE_PRINT: ICON_Print(); break; case PAGE_PREPARE: ICON_Print(); ICON_Prepare(); break; case PAGE_CONTROL: ICON_Prepare(); ICON_Control(); break; - case PAGE_INFO_LEV_ADV: ICON_Control(); ICON_AdvSettings(); break; + case PAGE_ADVANCE: ICON_Control(); ICON_AdvSettings(); break; } } } @@ -1176,7 +1098,7 @@ void HMI_MainMenu() { case PAGE_PRINT: ICON_Print(); ICON_Prepare(); break; case PAGE_PREPARE: ICON_Prepare(); ICON_Control(); break; case PAGE_CONTROL: ICON_Control(); ICON_AdvSettings(); break; - case PAGE_INFO_LEV_ADV: ICON_AdvSettings(); break; + case PAGE_ADVANCE: ICON_AdvSettings(); break; } } } @@ -1185,14 +1107,12 @@ void HMI_MainMenu() { case PAGE_PRINT: checkkey = SelectFile; card.mount(); + delay(300); Draw_Print_File_Menu(); break; - case PAGE_PREPARE: Draw_Prepare_Menu(); break; - case PAGE_CONTROL: Draw_Control_Menu(); break; - - case PAGE_INFO_LEV_ADV: Draw_AdvancedSettings_Menu(); break; + case PAGE_ADVANCE: Draw_AdvancedSettings_Menu(); break; } } DWIN_UpdateLCD(); @@ -1277,7 +1197,7 @@ void HMI_SelectFile() { else if (encoder_diffState == ENCODER_DIFF_ENTER) { if (select_file.now == 0) { // Back select_page.set(PAGE_PRINT); - Goto_Main_Menu(); + return Goto_Main_Menu(); } else if (hasUpDir && select_file.now == 1) { // CD-Up SDCard_Up(); @@ -1301,16 +1221,10 @@ void HMI_SelectFile() { HMI_flag.heat_flag = true; HMI_flag.print_finish = false; - card.openAndPrintFile(card.filename); - - #if HAS_FAN - // All fans on for Ender 3 v2 ? - // The slicer should manage this for us. - //for (uint8_t i = 0; i < FAN_COUNT; i++) - // thermalManager.fan_speed[i] = 255; - #endif - - DWIN_Print_Started(true); + if (card.fileIsBinary()) + return DWIN_Popup_Confirm(ICON_Error, F("Please check filenames"), F("Only G-code can be printed")); + else + return Goto_ConfirmToPrint(); } } @@ -1318,6 +1232,16 @@ void HMI_SelectFile() { DWIN_UpdateLCD(); } +// Pause or Stop popup +void onClick_PauseOrStop() { + switch (select_print.now) { + case PRINT_PAUSE_RESUME: if (HMI_flag.select_flag) HMI_flag.pause_flag = true; break; // confirm pause + case PRINT_STOP: if (HMI_flag.select_flag) HMI_flag.abort_flag = true; break; // stop confirmed then abort print + default: break; + } + return Goto_PrintProcess(); +} + // Printing void HMI_Printing() { EncoderState encoder_diffState = get_encoder_state(); @@ -1345,93 +1269,20 @@ void HMI_Printing() { switch (select_print.now) { case PRINT_SETUP: Draw_Tune_Menu(); break; case PRINT_PAUSE_RESUME: - if (HMI_flag.pause_flag) { - ICON_Pause(); - #if DISABLED(ADVANCED_PAUSE_FEATURE) - char cmd[40]; - cmd[0] = '\0'; - #if BOTH(HAS_HEATED_BED, PAUSE_HEAT) - if (resume_bed_temp) sprintf_P(cmd, PSTR("M190 S%i\n"), resume_bed_temp); - #endif - #if BOTH(HAS_HOTEND, PAUSE_HEAT) - if (resume_hotend_temp) sprintf_P(&cmd[strlen(cmd)], PSTR("M109 S%i\n"), resume_hotend_temp); - #endif - #if HAS_FAN - if (resume_fan) thermalManager.fan_speed[0] = resume_fan; - #endif - strcat_P(cmd, M24_STR); - queue.inject(cmd); - #endif - } - else { - HMI_flag.select_flag = true; - checkkey = PauseOrStop; - Popup_window_PauseOrStop(); + if (printingIsPaused()) { // if printer is already in pause + ui.resume_print(); + break; } - break; - + else + return Goto_Popup(Popup_window_PauseOrStop, onClick_PauseOrStop); case PRINT_STOP: - HMI_flag.select_flag = true; - checkkey = PauseOrStop; - Popup_window_PauseOrStop(); - break; - + return Goto_Popup(Popup_window_PauseOrStop, onClick_PauseOrStop); default: break; } } DWIN_UpdateLCD(); } -// Print done -void HMI_PrintDone() { - EncoderState encoder_diffState = get_encoder_state(); - if (encoder_diffState == ENCODER_DIFF_NO) return; - if (encoder_diffState == ENCODER_DIFF_ENTER) { - dwin_abort_flag = true; // Reset feedrate, return to Home - Goto_Main_Menu(); // Return to Main menu after print done - } -} - -// Pause or Stop popup -void HMI_PauseOrStop() { - EncoderState encoder_diffState = get_encoder_state(); - if (encoder_diffState == ENCODER_DIFF_NO) return; - - if (encoder_diffState == ENCODER_DIFF_CW) - Draw_Select_Highlight(false); - else if (encoder_diffState == ENCODER_DIFF_CCW) - Draw_Select_Highlight(true); - else if (encoder_diffState == ENCODER_DIFF_ENTER) { - if (select_print.now == PRINT_PAUSE_RESUME) { - if (HMI_flag.select_flag) { - HMI_flag.pause_action = true; - ICON_Resume(); - queue.inject(F("M25")); - } - else { - // cancel pause - } - Goto_PrintProcess(); - } - else if (select_print.now == PRINT_STOP) { - if (HMI_flag.select_flag) { - checkkey = MainMenu; - if (HMI_flag.home_flag) planner.synchronize(); // Wait for planner moves to finish! - wait_for_heatup = wait_for_user = false; // Stop waiting for heating/user - card.abortFilePrintSoon(); // Let the main loop handle SD abort - dwin_abort_flag = true; // Reset feedrate, return to Home - #ifdef ACTION_ON_CANCEL - hostui.cancel(); - #endif - DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_STOPPING), GET_TEXT_F(MSG_PLEASE_WAIT)); - } - else - Goto_PrintProcess(); // cancel stop - } - } - DWIN_UpdateLCD(); -} - #include "../../../libs/buzzer.h" void HMI_AudioFeedback(const bool success/*=true*/) { @@ -1452,24 +1303,11 @@ void Draw_Main_Area() { case SelectFile: Draw_Print_File_Menu(); break; case PrintProcess: Draw_PrintProcess(); break; case PrintDone: Draw_PrintDone(); break; - case Info: Draw_Info_Menu(); break; #if HAS_ESDIAG case ESDiagProcess: Draw_EndStopDiag(); break; #endif - #if ENABLED(PRINTCOUNTER) - case PrintStatsProcess: Draw_PrintStats(); break; - #endif - case PauseOrStop: Popup_window_PauseOrStop(); break; - #if ENABLED(POWER_LOSS_RECOVERY) - case PwrlossRec: Popup_PowerLossRecovery(); break; - #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) - case FilamentPurge: Draw_Popup_FilamentPurge(); break; - #endif + case Popup: popupDraw(); break; case Locked: lockScreen.draw(); break; - #if HAS_GCODE_PREVIEW - case ConfirmToPrint: Draw_PreviewFromSD(); break; - #endif case Menu: case SetInt: case SetPInt: @@ -1484,19 +1322,32 @@ void HMI_ReturnScreen() { checkkey = last_checkkey; wait_for_user = false; Draw_Main_Area(); - return; } -void HMI_Popup() { - EncoderState encoder_diffState = get_encoder_state(); - if (encoder_diffState == ENCODER_DIFF_NO) return; - if (encoder_diffState == ENCODER_DIFF_ENTER) { - HMI_ReturnScreen(); +void HMI_WaitForUser() { + get_encoder_state(); + if (!wait_for_user) { + switch (checkkey) { + case PrintDone: + select_page.reset(); + Goto_Main_Menu(); + break; + #if HAS_ONESTEP_LEVELING + case Leveling: + //TERN_(ProUI, ProEx.StopLeveling()); + HMI_ReturnScreen(); + break; + #endif + default: + HMI_ReturnScreen(); + break; + } } } void HMI_Init() { - HMI_SDCardInit(); + DWINUI::Draw_Box(1, Color_Black, {5, 220, DWIN_WIDTH-5, DWINUI::fontHeight()}); + DWINUI::Draw_CenteredString(Color_White, 220, F("Professional Firmware ")); for (uint16_t t = 0; t <= 100; t += 2) { DWINUI::Draw_Icon(ICON_Bar, 15, 260); DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 15 + t * 242 / 100, 260, 257, 280); @@ -1506,12 +1357,6 @@ void HMI_Init() { HMI_SetLanguage(); } -void DWIN_Update() { - EachMomentUpdate(); // Status update - HMI_SDCardUpdate(); // SD card update - DWIN_HandleScreen(); // Rotary encoder update -} - void EachMomentUpdate() { static millis_t next_var_update_ms = 0, next_rts_update_ms = 0, next_status_update_ms = 0; @@ -1538,52 +1383,45 @@ void EachMomentUpdate() { if (PENDING(ms, next_rts_update_ms)) return; next_rts_update_ms = ms + DWIN_SCROLL_UPDATE_INTERVAL; - if (checkkey == PrintProcess) { + if (checkkey == PrintProcess) { // print process + + // Print pause + if (HMI_flag.pause_flag && !HMI_flag.home_flag) { + HMI_flag.pause_flag = false; + if (!HMI_flag.pause_action) { + HMI_flag.pause_action = true; + return ui.pause_print(); + } + } + // if print done - if (HMI_flag.print_finish) { + if (HMI_flag.print_finish && !HMI_flag.home_flag) { HMI_flag.print_finish = false; - TERN_(POWER_LOSS_RECOVERY, recovery.cancel()); - planner.finish_and_disable(); - checkkey = PrintDone; - Draw_PrintDone(); - } - else if (HMI_flag.pause_flag != printingIsPaused()) { - // print status update - HMI_flag.pause_flag = printingIsPaused(); - ICON_ResumeOrPause(); + return DWIN_Print_Finished(); } - } - // pause after homing - if (HMI_flag.pause_action && printingIsPaused() && !planner.has_blocks_queued()) { - HMI_flag.pause_action = false; - #if ENABLED(PAUSE_HEAT) - TERN_(HAS_HOTEND, resume_hotend_temp = sdprint ? thermalManager.degTargetHotend(0) : thermalManager.wholeDegHotend(0)); - TERN_(HAS_HEATED_BED, resume_bed_temp = sdprint ? thermalManager.degTargetBed() : thermalManager.wholeDegBed()); - TERN_(HAS_FAN, resume_fan = thermalManager.fan_speed[0]); - #endif - IF_DISABLED(ADVANCED_PAUSE_FEATURE, thermalManager.disable_all_heaters()); - IF_DISABLED(PARK_HEAD_ON_PAUSE, queue.inject(F("G1 F1200 X0 Y0"))); - } - - if (checkkey == PrintProcess) { // print process + // if print was aborted + if (HMI_flag.abort_flag && !HMI_flag.home_flag) { // Print Stop + HMI_flag.abort_flag = false; + if (!HMI_flag.abort_action) { + HMI_flag.abort_action = true; + ui.abort_print(); + return Goto_PrintDone(); + } + } duration_t elapsed = print_job_timer.duration(); // print timer if (sdprint && card.isPrinting()) { uint8_t percentDone = card.percentDone(); - static uint8_t last_percentValue = 101; - if (last_percentValue != percentDone) { // print percent - last_percentValue = percentDone; - if (percentDone) { + if (_percent_done != percentDone) { // print percent _percent_done = percentDone; Draw_Print_ProgressBar(); } - } // Estimate remaining time every 20 seconds static millis_t next_remain_time_update = 0; - if (_percent_done > 1 && ELAPSED(ms, next_remain_time_update) && !HMI_flag.heat_flag) { + if (_percent_done > 1 && ELAPSED(ms, next_remain_time_update) && !HMI_flag.heat_flag && !HMI_flag.remain_flag) { _remain_time = (elapsed.value - dwin_heat_time) / (_percent_done * 0.01f) - (elapsed.value - dwin_heat_time); next_remain_time_update += DWIN_REMAIN_TIME_UPDATE_INTERVAL; Draw_Print_ProgressRemain(); @@ -1599,12 +1437,6 @@ void EachMomentUpdate() { } } - else if (dwin_abort_flag && !HMI_flag.home_flag) { // Print Stop - dwin_abort_flag = false; - dwin_zoffset = BABY_Z_VAR; - select_page.set(PAGE_PRINT); - Goto_Main_Menu(); - } #if ENABLED(POWER_LOSS_RECOVERY) else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // resume print before power off @@ -1629,8 +1461,8 @@ void EachMomentUpdate() { DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 70, GET_TEXT_F(MSG_OUTAGE_RECOVERY)); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 147, F("It looks like the last")); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 167, F("file was interrupted.")); - DWINUI::Draw_IconWB(ICON_Cancel_E, 26, 280); - DWINUI::Draw_IconWB(ICON_Continue_E, 146, 280); + DWINUI::Draw_Button(BTN_Cancel, 26, 280); + DWINUI::Draw_Button(BTN_Continue, 146, 280); } SdFile *dir = nullptr; const char * const filename = card.diveToFile(true, dir, recovery.info.sd_filename); @@ -1640,35 +1472,26 @@ void EachMomentUpdate() { DWIN_UpdateLCD(); } + void onClick_PowerLossRecovery() { + if (HMI_flag.select_flag) { + queue.inject(F("M1000C")); + select_page.reset(); + return Goto_Main_Menu(); + } + else { + select_print.set(PRINT_SETUP); + queue.inject(F("M1000")); + sdprint = true; + return Goto_PrintProcess(); + } + } + void Goto_PowerLossRecovery() { recovery.dwin_flag = false; LCD_MESSAGE_F(GET_TEXT_F(MSG_CONTINUE_PRINT_JOB)); - HMI_flag.select_flag = false; - Popup_PowerLossRecovery(); - last_checkkey = MainMenu; - checkkey = PwrlossRec; - } - - void HMI_PowerlossRecovery() { - EncoderState encoder_diffState = get_encoder_state(); - if (encoder_diffState == ENCODER_DIFF_NO) return; - if (encoder_diffState == ENCODER_DIFF_ENTER) { - if (HMI_flag.select_flag) { - queue.inject(F("M1000C")); - select_page.reset(); - Goto_Main_Menu(); - } - else { - select_print.set(PRINT_SETUP); - queue.inject(F("M1000")); - sdprint = true; - Goto_PrintProcess(); - } - } - else - Draw_Select_Highlight(encoder_diffState != ENCODER_DIFF_CW); - DWIN_UpdateLCD(); + Goto_Popup(Popup_PowerLossRecovery, onClick_PowerLossRecovery); } + #endif // POWER_LOSS_RECOVERY @@ -1682,49 +1505,39 @@ void DWIN_HandleScreen() { case SetFloat: HMI_SetFloat(); break; case SetPFloat: HMI_SetPFloat(); break; case SelectFile: HMI_SelectFile(); break; - case Homing: break; - case Leveling: break; case PrintProcess: HMI_Printing(); break; - case PrintDone: HMI_PrintDone(); break; - case PauseOrStop: HMI_PauseOrStop(); break; - case Info: HMI_Popup(); break; - case WaitResponse: HMI_Popup(); break; - #if ENABLED(ADVANCED_PAUSE_FEATURE) - case FilamentPurge: HMI_FilamentPurge(); break; - #endif - case NothingToDo: break; + case Popup: HMI_Popup(); break; + case Leveling: //TERN_(ProUI, HMI_WaitForUser()); + break; case Locked: HMI_LockScreen(); break; - #if ENABLED(POWER_LOSS_RECOVERY) - case PwrlossRec: HMI_PowerlossRecovery(); break; - #endif - #if HAS_GCODE_PREVIEW - case ConfirmToPrint: HMI_ConfirmToPrint(); break; - #endif - #if HAS_ESDIAG - case ESDiagProcess: HMI_Popup(); break; - #endif - #if ENABLED(PRINTCOUNTER) - case PrintStatsProcess: HMI_Popup(); break; - #endif + case PrintDone: + TERN_(HAS_ESDIAG, case ESDiagProcess:) + case WaitResponse: HMI_WaitForUser(); break; + case Homing: + case PidProcess: + case NothingToDo: break; default: break; } } bool IDisPopUp() { // If ID is popup... - return (checkkey == NothingToDo) || - (checkkey == WaitResponse) || - (checkkey == Info) || - (checkkey == Homing) || - (checkkey == Leveling) || - TERN_(HAS_ESDIAG, (checkkey == ESDiagProcess) ||) - TERN_(PRINTCOUNTER, (checkkey == PrintStatsProcess) ||) - (checkkey == PauseOrStop) || - (checkkey == FilamentPurge); + return (checkkey == NothingToDo) + || (checkkey == WaitResponse) + || (checkkey == Homing) + || (checkkey == Leveling) + || (checkkey == PidProcess) + || TERN0(HAS_ESDIAG, (checkkey == ESDiagProcess)) + || (checkkey == Popup); } void HMI_SaveProcessID(const uint8_t id) { if (checkkey != id) { if (!IDisPopUp()) last_checkkey = checkkey; // if previous is not a popup + if ((id == Popup) + || TERN0(HAS_ESDIAG, (id == ESDiagProcess)) + || (id == PrintDone) + || (id == Leveling) + || (id == WaitResponse)) wait_for_user = true; checkkey = id; } } @@ -1732,37 +1545,35 @@ void HMI_SaveProcessID(const uint8_t id) { void DWIN_StartHoming() { HMI_flag.home_flag = true; HMI_SaveProcessID(Homing); - Title.ShowCaption(GET_TEXT_F(MSG_LEVEL_BED_HOMING)); - DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_LEVEL_BED_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); + Title.ShowCaption(GET_TEXT_F(MSG_HOMING)); + DWIN_Show_Popup(ICON_BLTouch, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); } void DWIN_CompletedHoming() { HMI_flag.home_flag = false; dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); - if (dwin_abort_flag) { - planner.finish_and_disable(); - } - HMI_ReturnScreen(); + if (HMI_flag.abort_action) DWIN_Print_Aborted(); else HMI_ReturnScreen(); } void DWIN_MeshLevelingStart() { #if HAS_ONESTEP_LEVELING HMI_SaveProcessID(Leveling); Title.ShowCaption(GET_TEXT_F(MSG_BED_LEVELING)); - DWIN_Show_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT), ICON_Cancel_E); + DWIN_Show_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT)); #elif ENABLED(MESH_BED_LEVELING) Draw_ManualMesh_Menu(); #endif } -void DWIN_CompletedLeveling() { TERN_(HAS_MESH, DWIN_MeshViewer()); } +void DWIN_CompletedLeveling() { + TERN_(HAS_ONESTEP_LEVELING, if (planner.leveling_active) Goto_MeshViewer()); +} #if HAS_MESH - void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { + void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { char msg[33] = ""; char str_1[6] = ""; - sprintf_P(msg, PSTR(S_FMT " %i/%i Z=%s"), GET_TEXT(MSG_PROBING_POINT), xpos, ypos, - dtostrf(zval, 1, 2, str_1)); + sprintf_P(msg, PSTR(S_FMT " %i/%i Z=%s"), GET_TEXT(MSG_PROBING_POINT), xpos, ypos, dtostrf(zval, 1, 2, str_1)); ui.set_status(msg); } #endif @@ -1800,67 +1611,63 @@ void DWIN_PidTuning(pidresult_t result) { } } -// Update filename on print -void DWIN_Print_Header(const char *text = nullptr) { - static char headertxt[31] = ""; // Print header text - - if (text) { - const int8_t size = _MIN((unsigned) 30, strlen_P(text)); - LOOP_L_N(i, size) headertxt[i] = text[i]; - headertxt[size] = '\0'; - } - if (checkkey == PrintProcess || checkkey == PrintDone) { - DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 60, DWIN_WIDTH, 60+16); - DWINUI::Draw_CenteredString(60, headertxt); - } -} - -void Draw_Title(TitleClass* title) { - DWIN_Draw_Rectangle(1, HMI_data.TitleBg_color, 0, 0, DWIN_WIDTH - 1, TITLE_HEIGHT - 1); - if (title->frameid) - DWIN_Frame_AreaCopy(title->frameid, title->frame.left, title->frame.top, title->frame.right, title->frame.bottom, 14, (TITLE_HEIGHT - (title->frame.bottom - title->frame.top)) / 2 - 1); - else - DWIN_Draw_String(false, DWIN_FONT_HEAD, HMI_data.TitleTxt_color, HMI_data.TitleBg_color, 14, (TITLE_HEIGHT - DWINUI::fontHeight(DWIN_FONT_HEAD)) / 2 - 1, title->caption); -} - -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); - DWIN_ResetStatusLine(); -} - -// Startup routines -void DWIN_Startup() { - DWINUI::init(); - DWINUI::onCursorDraw = Draw_Menu_Cursor; - DWINUI::onCursorErase = Erase_Menu_Cursor; - DWINUI::onTitleDraw = Draw_Title; - DWINUI::onMenuDraw = Draw_Menu; - DWIN_JPG_ShowAndCache(3); - HMI_SetLanguage(); -} - // Started a Print Job void DWIN_Print_Started(const bool sd) { - sdprint = card.isPrinting() || sd; + sdprint = IS_SD_PRINTING() || sd; _percent_done = 0; _remain_time = 0; + HMI_flag.remain_flag = false; + HMI_flag.pause_flag = false; + HMI_flag.pause_action = false; + HMI_flag.abort_flag = false; + HMI_flag.abort_action = false; HMI_flag.print_finish = false; Goto_PrintProcess(); } +// Pause a print job +void DWIN_Print_Pause() { + ICON_ResumeOrPause(); +} + +// Resume print job +void DWIN_Print_Resume() { + HMI_flag.pause_action = false; + ICON_ResumeOrPause(); + if (printJobOngoing()) { + LCD_MESSAGE(MSG_RESUME_PRINT); + Goto_PrintProcess(); + } +} + // Ended print job void DWIN_Print_Finished() { - if (checkkey == PrintProcess || printingIsActive()) { + if (HMI_flag.abort_flag || checkkey == PrintDone) return; + TERN_(POWER_LOSS_RECOVERY, if (card.isPrinting()) recovery.cancel()); + HMI_flag.pause_flag = false; + wait_for_heatup = false; + planner.finish_and_disable(); thermalManager.cooldown(); - HMI_flag.print_finish = true; - } + Goto_PrintDone(); +} + +// Print was aborted +void DWIN_Print_Aborted() { + TERN_(DEBUG_DWIN, SERIAL_ECHOLNPGM("DWIN_Print_Aborted")); + HMI_flag.abort_action = false; + wait_for_heatup = false; + planner.finish_and_disable(); + thermalManager.cooldown(); + Goto_PrintDone(); } // Progress Bar update void DWIN_Progress_Update() { if (parser.seenval('P')) _percent_done = parser.byteval('P'); - if (parser.seenval('R')) _remain_time = parser.ulongval('R') * 60; + if (parser.seenval('R')) { + _remain_time = parser.ulongval('R') * 60; + HMI_flag.remain_flag = true; + } if (checkkey == PrintProcess) { Draw_Print_ProgressBar(); Draw_Print_ProgressRemain(); @@ -1896,11 +1703,18 @@ void DWIN_SetColorDefaults() { void DWIN_SetDataDefaults() { DWIN_SetColorDefaults(); - DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color); - TERN_(HAS_HOTEND, HMI_data.HotendPidT = PREHEAT_1_TEMP_HOTEND); - TERN_(HAS_HEATED_BED, HMI_data.BedPidT = PREHEAT_1_TEMP_BED); - TERN_(HAS_HOTEND, HMI_data.PidCycles = 5); - TERN_(PREVENT_COLD_EXTRUSION, HMI_data.ExtMinT = EXTRUDE_MINTEMP); + DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); + TERN_(HAS_HOTEND, HMI_data.HotendPidT = PREHEAT_1_TEMP_HOTEND); + TERN_(HAS_HEATED_BED, HMI_data.BedPidT = PREHEAT_1_TEMP_BED); + TERN_(HAS_HOTEND, HMI_data.PidCycles = 5); + #if ENABLED(PREVENT_COLD_EXTRUSION) + HMI_data.ExtMinT = EXTRUDE_MINTEMP; + ApplyExtMinT(); + #endif + #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) + HMI_data.BedLevT = PREHEAT_1_TEMP_BED; + #endif + TERN_(BAUD_RATE_GCODE, SetBaud250K()); } void DWIN_StoreSettings(char *buff) { @@ -1912,9 +1726,10 @@ void DWIN_LoadSettings(const char *buff) { memcpy((void *)&HMI_data, buff, _MIN(sizeof(HMI_data), eeprom_data_size)); dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); if (HMI_data.Text_Color == HMI_data.Background_Color) DWIN_SetColorDefaults(); - DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color); + DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); TERN_(PREVENT_COLD_EXTRUSION, ApplyExtMinT()); feedrate_percentage = 100; + TERN_(BAUD_RATE_GCODE, HMI_SetBaudRate()); #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) // Apply Case light brightness caselight.brightness = HMI_data.CaseLight_Brightness; @@ -1926,6 +1741,37 @@ void DWIN_LoadSettings(const char *buff) { #endif } +// Initialize or re-initialize the LCD +void MarlinUI::init_lcd() { + TERN_(DEBUG_DWIN, SERIAL_ECHOLNPGM("DWIN_Startup")); + DWINUI::init(); + DWIN_JPG_CacheTo1(Language_English); + Encoder_Configuration(); +} + +void DWIN_InitScreen() { + HMI_Init(); // draws boot screen + DWINUI::onCursorDraw = Draw_Menu_Cursor; + DWINUI::onCursorErase = Erase_Menu_Cursor; + DWINUI::onTitleDraw = Draw_Title; + DWINUI::onMenuDraw = Draw_Menu; + DWIN_DrawStatusLine(nullptr); + DWIN_Draw_Dashboard(); + Goto_Main_Menu(); +} + +void MarlinUI::update() { + EachMomentUpdate(); // Status update + HMI_SDCardUpdate(); // SD card update + DWIN_HandleScreen(); // Rotary encoder update +} + +void MarlinUI::refresh() { /* Nothing to see here */ } + +#if HAS_LCD_BRIGHTNESS + void MarlinUI::_set_brightness() { DWIN_LCD_Brightness(backlight ? brightness : 0); } +#endif + void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) { DWIN_Draw_Popup(ICON_BLTouch, F("Printer killed:"), lcd_error); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 270, F("Turn off the printer")); @@ -1938,65 +1784,55 @@ void DWIN_RebootScreen() { DWINUI::Draw_CenteredString(Color_White, 220, GET_TEXT_F(MSG_PLEASE_WAIT_REBOOT)); DWIN_UpdateLCD(); delay(500); - DWIN_JPG_ShowAndCache(3); } void DWIN_Redraw_screen() { Draw_Main_Area(); - Draw_Status_Area(false); + hash_changed = true; + DWIN_DrawStatusMessage(); + DWIN_Draw_Dashboard(); } #if ENABLED(ADVANCED_PAUSE_FEATURE) - - void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button = 0) { + void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button /*= 0*/) { HMI_SaveProcessID(button ? WaitResponse : NothingToDo); - DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), fmsg, button); - ui.reset_status(true); + DWIN_Show_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), fmsg, button); } void MarlinUI::pause_show_message(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) { + //if (mode == PAUSE_MODE_SAME) return; + pause_mode = mode; switch (message) { - case PAUSE_MESSAGE_PARKING: DWIN_Popup_Pause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; - case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; - case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; - case PAUSE_MESSAGE_WAITING: DWIN_Popup_Pause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), ICON_Continue_E); break; + case PAUSE_MESSAGE_PARKING: DWIN_Popup_Pause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; // M125 + case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; // pause_print (M125, M600) + case PAUSE_MESSAGE_WAITING: DWIN_Popup_Pause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), BTN_Continue); break; case PAUSE_MESSAGE_INSERT: DWIN_Popup_Continue(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; case PAUSE_MESSAGE_LOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; - case PAUSE_MESSAGE_PURGE: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)); break; - case PAUSE_MESSAGE_OPTION: DWIN_Popup_FilamentPurge(); break; + case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; // Unload of pause and Unload of M702 + case PAUSE_MESSAGE_PURGE: + #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) + DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_CONT_PURGE)); + #else + DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)); + #endif + break; + case PAUSE_MESSAGE_OPTION: Goto_FilamentPurge(); break; case PAUSE_MESSAGE_RESUME: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; - case PAUSE_MESSAGE_HEAT: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), ICON_Continue_E); break; + case PAUSE_MESSAGE_HEAT: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), BTN_Continue); break; case PAUSE_MESSAGE_HEATING: LCD_MESSAGE(MSG_FILAMENT_CHANGE_HEATING); break; - case PAUSE_MESSAGE_STATUS: HMI_ReturnScreen(); break; + case PAUSE_MESSAGE_STATUS: HMI_ReturnScreen(); break; // Exit from Pause, Load and Unload default: break; } } void Draw_Popup_FilamentPurge() { DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), F("Purge or Continue?")); - DWINUI::Draw_IconWB(ICON_Confirm_E, 26, 280); - DWINUI::Draw_IconWB(ICON_Continue_E, 146, 280); + DWINUI::Draw_Button(BTN_Confirm, 26, 280); + DWINUI::Draw_Button(BTN_Continue, 146, 280); Draw_Select_Highlight(true); - DWIN_UpdateLCD(); - } - - // Handle responses such as: - // - Purge More, Continue - // - General "Continue" response - void DWIN_Popup_FilamentPurge() { - HMI_SaveProcessID(FilamentPurge); - pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; - Draw_Popup_FilamentPurge(); } - void HMI_FilamentPurge() { - EncoderState encoder_diffState = get_encoder_state(); - if (encoder_diffState == ENCODER_DIFF_NO) return; - if (encoder_diffState == ENCODER_DIFF_CW) - Draw_Select_Highlight(false); - else if (encoder_diffState == ENCODER_DIFF_CCW) - Draw_Select_Highlight(true); - else if (encoder_diffState == ENCODER_DIFF_ENTER) { + void onClick_FilamentPurge() { if (HMI_flag.select_flag) pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // "Purge More" button else { @@ -2004,7 +1840,10 @@ void DWIN_Redraw_screen() { pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // "Continue" button } } - DWIN_UpdateLCD(); + + void Goto_FilamentPurge() { + pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; + Goto_Popup(Draw_Popup_FilamentPurge, onClick_FilamentPurge); } #endif // ADVANCED_PAUSE_FEATURE @@ -2042,39 +1881,10 @@ void HMI_LockScreen() { if (lockScreen.isUnlocked()) DWIN_UnLockScreen(); } -#if HAS_GCODE_PREVIEW - - void HMI_ConfirmToPrint() { - EncoderState encoder_diffState = get_encoder_state(); - if (encoder_diffState == ENCODER_DIFF_NO) return; - if (encoder_diffState == ENCODER_DIFF_CW) - Draw_Select_Highlight(false); - else if (encoder_diffState == ENCODER_DIFF_CCW) - Draw_Select_Highlight(true); - else if (encoder_diffState == ENCODER_DIFF_ENTER) { - if (HMI_flag.select_flag) { // Confirm - card.openAndPrintFile(card.filename); - DWIN_Print_Started(true); - } - else { // Cancel - DWIN_ResetStatusLine(); - checkkey = SelectFile; - Draw_Print_File_Menu(); - } - } - DWIN_UpdateLCD(); - } - -#endif void Goto_ConfirmToPrint() { - #if HAS_GCODE_PREVIEW - HMI_SaveProcessID(ConfirmToPrint); - Draw_PreviewFromSD(); - #else - card.openAndPrintFile(card.filename); - DWIN_Print_Started(true); - #endif + card.openAndPrintFile(card.filename); + DWIN_Print_Started(true); } #if HAS_ESDIAG @@ -2084,103 +1894,11 @@ void Goto_ConfirmToPrint() { } #endif -#if ENABLED(PRINTCOUNTER) - void Draw_PrintStats() { - HMI_SaveProcessID(PrintStatsProcess); - PrintStats.Draw(); - } -#endif - //============================================================================= // NEW MENU SUBSYSTEM //============================================================================= -// On click functions - -// Generic onclick event without draw anything -// process: process id HMI destiny -// lo: low limit -// hi: high limit -// dp: decimal places, 0 for integers -// val: value / scaled value -// LiveUpdate: live update function when the encoder changes -// Apply: update function when the encoder is pressed -void SetOnClick(uint8_t process, const int32_t lo, const int32_t hi, uint8_t dp, const int32_t val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr) { - checkkey = process; - HMI_value.MinValue = lo; - HMI_value.MaxValue = hi; - HMI_value.dp = dp; - HMI_value.Apply = Apply; - HMI_value.LiveUpdate = LiveUpdate; - HMI_value.Value = val; - EncoderRate.enabled = true; -} - -// Generic onclick event for integer values -// process: process id HMI destiny -// lo: scaled low limit -// hi: scaled high limit -// val: value -// LiveUpdate: live update function when the encoder changes -// Apply: update function when the encoder is pressed -void SetValueOnClick(uint8_t process, const int32_t lo, const int32_t hi, const int32_t val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr) { - SetOnClick(process, lo, hi, 0, val, Apply, LiveUpdate); - Draw_Menu_IntValue(HMI_data.Selected_Color, CurrentMenu->line(), 4, HMI_value.Value); -} - -// Generic onclick event for float values -// process: process id HMI destiny -// lo: scaled low limit -// hi: scaled high limit -// val: value -// LiveUpdate: live update function when the encoder changes -// Apply: update function when the encoder is pressed -void SetValueOnClick(uint8_t process, const float lo, const float hi, uint8_t dp, const float val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr) { - const int32_t value = round(val * POW(10, dp)); - SetOnClick(process, lo * POW(10, dp), hi * POW(10, dp), dp, value, Apply, LiveUpdate); - DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), val); -} - -// Generic onclick event for integer values -// lo: scaled low limit -// hi: scaled high limit -// val: value -// LiveUpdate: live update function when the encoder changes -// Apply: update function when the encoder is pressed -inline void SetIntOnClick(const int32_t lo, const int32_t hi, const int32_t val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr) { - SetValueOnClick(SetInt, lo, hi, val, Apply, LiveUpdate); -} - -// Generic onclick event for set pointer to 16 bit uinteger values -// lo: low limit -// hi: high limit -// LiveUpdate: live update function when the encoder changes -// Apply: update function when the encoder is pressed -void SetPIntOnClick(const int32_t lo, const int32_t hi, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr) { - HMI_value.P_Int = (int16_t*)static_cast(CurrentMenu->SelectedItem())->value; - const int32_t value = *HMI_value.P_Int; - SetValueOnClick(SetPInt, lo, hi, value, Apply, LiveUpdate); -} - -// Generic onclick event for float values -// process: process id HMI destiny -// lo: low limit -// hi: high limit -// dp: decimal places -// val: value -inline void SetFloatOnClick(const float lo, const float hi, uint8_t dp, const float val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr) { - SetValueOnClick(SetFloat, lo, hi, dp, val, Apply, LiveUpdate); -} - -// Generic onclick event for set pointer to float values -// lo: low limit -// hi: high limit -// LiveUpdate: live update function when the encoder changes -// Apply: update function when the encoder is pressed -void SetPFloatOnClick(const float lo, const float hi, uint8_t dp, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr) { - HMI_value.P_Float = (float*)static_cast(CurrentMenu->SelectedItem())->value; - SetValueOnClick(SetPFloat, lo, hi, dp, *HMI_value.P_Float, Apply, LiveUpdate); -} +// Tool functions #if ENABLED(EEPROM_SETTINGS) void WriteEeprom() { @@ -2203,7 +1921,6 @@ void SetPFloatOnClick(const float lo, const float hi, uint8_t dp, void (*Apply)( // Reset Printer void RebootPrinter() { - dwin_abort_flag = true; wait_for_heatup = wait_for_user = false; // Stop waiting for heating/user thermalManager.disable_all_heaters(); planner.finish_and_disable(); @@ -2212,8 +1929,8 @@ void RebootPrinter() { } void Goto_Info_Menu(){ - HMI_SaveProcessID(Info); Draw_Info_Menu(); + HMI_SaveProcessID(WaitResponse); } void Goto_Move_Menu() { @@ -2226,14 +1943,11 @@ void Goto_Move_Menu() { void DisableMotors() { queue.inject(F("M84")); } -void AutoLev() { queue.inject(F("G28Z\nG29")); } // Force to get the current Z home position +void AutoLev() { queue.inject(F("G28XYO\nG28Z\nG29")); } // Force to get the current Z home position void AutoHome() { queue.inject_P(G28_STR); } - void HomeX() { queue.inject(F("G28X")); } - void HomeY() { queue.inject(F("G28Y")); } - void HomeZ() { queue.inject(F("G28Z")); } void SetHome() { @@ -2247,7 +1961,7 @@ void SetHome() { void ApplyZOffset() { TERN_(EEPROM_SETTINGS, settings.save()); } void LiveZOffset() { last_zoffset = dwin_zoffset; - dwin_zoffset = HMI_value.Value / 100.0f; + dwin_zoffset = MenuData.Value / 100.0f; #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) if (BABYSTEP_ALLOWED()) babystep.add_mm(Z_AXIS, dwin_zoffset - last_zoffset); #endif @@ -2257,6 +1971,24 @@ void SetHome() { SetPFloatOnClick(Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, 2, ApplyZOffset, LiveZOffset); } #endif + + void SetMoveZto0() { + char cmd[48] = ""; + char str_1[5] = "", str_2[5] = ""; + sprintf_P(cmd, PSTR("G28XYO\nG28Z\nG0X%sY%sF5000\nM420S0\nG0Z0F300"), + #if ENABLED(MESH_BED_LEVELING) + dtostrf(0, 1, 1, str_1), + dtostrf(0, 1, 1, str_2) + #else + dtostrf(X_CENTER, 1, 1, str_1), + dtostrf(Y_CENTER, 1, 1, str_2) + #endif + ); + gcode.process_subcommands_now(cmd); + planner.synchronize(); + LCD_MESSAGE_F("Now adjust Z Offset"); + HMI_AudioFeedback(true); + } #endif #if HAS_PREHEAT @@ -2274,14 +2006,14 @@ void SetLanguage() { } void LiveMove() { - *HMI_value.P_Float = HMI_value.Value / MINUNITMULT; + *MenuData.P_Float = MenuData.Value / MINUNITMULT; if (!planner.is_full()) { planner.synchronize(); planner.buffer_line(current_position, homing_feedrate(HMI_value.axis)); } } void ApplyMoveE() { - last_E = HMI_value.Value / MINUNITMULT; + last_E = MenuData.Value / MINUNITMULT; if (!planner.is_full()) { planner.synchronize(); planner.buffer_line(current_position, MMM_TO_MMS(FEEDRATE_E)); @@ -2294,33 +2026,13 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if HAS_HOTEND void SetMoveE() { #if ENABLED(PREVENT_COLD_EXTRUSION) - if (thermalManager.tooColdToExtrude(0)) { - Popup_Window_ETempTooLow(); - return; - } + if (thermalManager.tooColdToExtrude(0)) + return DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_HOTEND_TOO_COLD), GET_TEXT_F(MSG_PLEASE_PREHEAT)); #endif SetPFloatOnClick(last_E - (EXTRUDE_MAXLENGTH), last_E + (EXTRUDE_MAXLENGTH), UNITFDIGITS, ApplyMoveE); } #endif -void SetMoveZto0() { - char cmd[48] = ""; - char str_1[5] = "", str_2[5] = ""; - 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) - #else - dtostrf(X_CENTER, 1, 1, str_1), - dtostrf(Y_CENTER, 1, 1, str_2) - #endif - ); - gcode.process_subcommands_now(cmd); - planner.synchronize(); - LCD_MESSAGE_F("Now adjust Z Offset"); - HMI_AudioFeedback(true); -} - void SetPID(celsius_t t, heater_id_t h) { char cmd[48] = ""; char str_1[5] = "", str_2[5] = ""; @@ -2347,10 +2059,24 @@ void SetPID(celsius_t t, heater_id_t h) { } #endif +#if ENABLED(BAUD_RATE_GCODE) + void HMI_SetBaudRate() { + if (HMI_data.Baud115K) SetBaud115K(); else SetBaud250K(); + } + void SetBaudRate() { + HMI_SetBaudRate(); + Draw_Chkb_Line(CurrentMenu->line(), HMI_data.Baud115K); + DWIN_UpdateLCD(); + } + void SetBaud115K() { queue.inject(F("M575 P0 B115200")); HMI_data.Baud115K = true; } + void SetBaud250K() { queue.inject(F("M575 P0 B250000")); HMI_data.Baud115K = false; } +#endif + #if HAS_LCD_BRIGHTNESS - void ApplyBrightness() { ui.set_brightness(HMI_value.Value); } - void LiveBrightness() { DWIN_LCD_Brightness(HMI_value.Value); } + void ApplyBrightness() { ui.set_brightness(MenuData.Value); } + void LiveBrightness() { DWIN_LCD_Brightness(MenuData.Value); } void SetBrightness() { SetIntOnClick(LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.brightness, ApplyBrightness, LiveBrightness); } + void TurnOffBacklight() { HMI_SaveProcessID(WaitResponse); ui.set_brightness(0); DWIN_Redraw_screen(); } #endif #if ENABLED(CASE_LIGHT_MENU) @@ -2361,7 +2087,7 @@ void SetPID(celsius_t t, heater_id_t h) { DWIN_UpdateLCD(); } #if ENABLED(CASELIGHT_USES_BRIGHTNESS) - void LiveCaseLightBrightness() { HMI_data.CaseLight_Brightness = caselight.brightness = HMI_value.Value; caselight.update_brightness(); } + void LiveCaseLightBrightness() { HMI_data.CaseLight_Brightness = caselight.brightness = MenuData.Value; caselight.update_brightness(); } void SetCaseLightBrightness() { SetIntOnClick(0, 255, caselight.brightness, nullptr, LiveCaseLightBrightness); } #endif #endif @@ -2375,14 +2101,14 @@ void SetPID(celsius_t t, heater_id_t h) { } #endif #if ENABLED(HAS_COLOR_LEDS) - void LiveLedColorR() { leds.color.r = HMI_value.Value; HMI_data.Led_Color = leds.color; leds.update(); } + void LiveLedColorR() { leds.color.r = MenuData.Value; HMI_data.Led_Color = leds.color; leds.update(); } void SetLedColorR() { SetIntOnClick(0, 255, leds.color.r, nullptr, LiveLedColorR); } - void LiveLedColorG() { leds.color.g = HMI_value.Value; HMI_data.Led_Color = leds.color; leds.update(); } + void LiveLedColorG() { leds.color.g = MenuData.Value; HMI_data.Led_Color = leds.color; leds.update(); } void SetLedColorG() { SetIntOnClick(0, 255, leds.color.g, nullptr, LiveLedColorG); } - void LiveLedColorB() { leds.color.b = HMI_value.Value; HMI_data.Led_Color = leds.color; leds.update(); } + void LiveLedColorB() { leds.color.b = MenuData.Value; HMI_data.Led_Color = leds.color; leds.update(); } void SetLedColorB() { SetIntOnClick(0, 255, leds.color.b, nullptr, LiveLedColorB); } #if HAS_WHITE_LED - void LiveLedColorW() { leds.color.w = HMI_value.Value; HMI_data.Led_Color = leds.color; leds.update(); } + void LiveLedColorW() { leds.color.w = MenuData.Value; HMI_data.Led_Color = leds.color; leds.update(); } void SetLedColorW() { SetIntOnClick(0, 255, leds.color.w, nullptr, LiveLedColorW); } #endif #endif @@ -2397,7 +2123,7 @@ void SetPID(celsius_t t, heater_id_t h) { #endif #if HAS_HOME_OFFSET - void ApplyHomeOffset() { set_home_offset(HMI_value.axis, HMI_value.Value / MINUNITMULT); } + void ApplyHomeOffset() { set_home_offset(HMI_value.axis, MenuData.Value / MINUNITMULT); } void SetHomeOffsetX() { HMI_value.axis = X_AXIS; SetPFloatOnClick(-50, 50, UNITFDIGITS, ApplyHomeOffset); } void SetHomeOffsetY() { HMI_value.axis = Y_AXIS; SetPFloatOnClick(-50, 50, UNITFDIGITS, ApplyHomeOffset); } void SetHomeOffsetZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick( -2, 2, UNITFDIGITS, ApplyHomeOffset); } @@ -2421,12 +2147,11 @@ void SetPID(celsius_t t, heater_id_t h) { DWIN_UpdateLCD(); } #endif -#endif -#if ENABLED(NOZZLE_PARK_FEATURE) - void SetParkPosX() { SetPIntOnClick(0, X_MAX_POS); } - void SetParkPosY() { SetPIntOnClick(0, Y_MAX_POS); } - void SetParkZRaise() { SetPIntOnClick(0, 50); } + #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) + void SetBedLevT() { SetPIntOnClick(BED_MINTEMP, BED_MAX_TARGET); } + #endif + #endif #if HAS_FILAMENT_SENSOR @@ -2437,7 +2162,7 @@ void SetPID(celsius_t t, heater_id_t h) { DWIN_UpdateLCD(); } #if HAS_FILAMENT_RUNOUT_DISTANCE - void ApplyRunoutDistance() { runout.set_runout_distance(HMI_value.Value / MINUNITMULT); } + void ApplyRunoutDistance() { runout.set_runout_distance(MenuData.Value / MINUNITMULT); } void SetRunoutDistance() { SetFloatOnClick(0, 999, UNITFDIGITS, runout.runout_distance(), ApplyRunoutDistance); } #endif #endif @@ -2454,20 +2179,20 @@ void SetPID(celsius_t t, heater_id_t h) { void RestoreDefaultsColors() { DWIN_SetColorDefaults(); - DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color); + DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); DWIN_Redraw_screen(); } void SelColor() { - HMI_value.P_Int = (int16_t*)static_cast(CurrentMenu->SelectedItem())->value; - HMI_value.Color[0] = GetRColor(*HMI_value.P_Int); // Red - HMI_value.Color[1] = GetGColor(*HMI_value.P_Int); // Green - HMI_value.Color[2] = GetBColor(*HMI_value.P_Int); // Blue + MenuData.P_Int = (int16_t*)static_cast(CurrentMenu->SelectedItem())->value; + HMI_value.Color[0] = GetRColor(*MenuData.P_Int); // Red + HMI_value.Color[1] = GetGColor(*MenuData.P_Int); // Green + HMI_value.Color[2] = GetBColor(*MenuData.P_Int); // Blue Draw_GetColor_Menu(); } void LiveRGBColor() { - HMI_value.Color[CurrentMenu->line() - 2] = HMI_value.Value; + HMI_value.Color[CurrentMenu->line() - 2] = MenuData.Value; uint16_t color = RGB(HMI_value.Color[0], HMI_value.Color[1], HMI_value.Color[2]); DWIN_Draw_Rectangle(1, color, 20, 315, DWIN_WIDTH - 20, 335); } @@ -2477,27 +2202,28 @@ void SetRGBColor() { } void DWIN_ApplyColor() { - *HMI_value.P_Int = RGB(HMI_value.Color[0], HMI_value.Color[1], HMI_value.Color[2]); - DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color); - Draw_Status_Area(false); + *MenuData.P_Int = RGB(HMI_value.Color[0], HMI_value.Color[1], HMI_value.Color[2]); + DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); Draw_SelectColors_Menu(); + hash_changed = true; LCD_MESSAGE_F(GET_TEXT_F(MSG_COLORS_APPLIED)); + DWIN_Draw_Dashboard(); } void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } #if HAS_HOTEND - void ApplyHotendTemp() { thermalManager.setTargetHotend(HMI_value.Value, 0); } + void ApplyHotendTemp() { thermalManager.setTargetHotend(MenuData.Value, 0); } void SetHotendTemp() { SetIntOnClick(MIN_ETEMP, MAX_ETEMP, thermalManager.degTargetHotend(0), ApplyHotendTemp); } #endif #if HAS_HEATED_BED - void ApplyBedTemp() { thermalManager.setTargetBed(HMI_value.Value); } + void ApplyBedTemp() { thermalManager.setTargetBed(MenuData.Value); } void SetBedTemp() { SetIntOnClick(BED_MINTEMP, BED_MAX_TARGET, thermalManager.degTargetBed(), ApplyBedTemp); } #endif #if HAS_FAN - void ApplyFanSpeed() { thermalManager.set_fan_speed(0, HMI_value.Value); } + void ApplyFanSpeed() { thermalManager.set_fan_speed(0, MenuData.Value); } void SetFanSpeed() { SetIntOnClick(0, 255, thermalManager.fan_speed[0], ApplyFanSpeed); } #endif @@ -2531,17 +2257,15 @@ void ApplyFlow() { planner.refresh_e_factor(0); } void SetFlow() { SetPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW, ApplyFlow); } // Bed Tramming -void Tram(uint8_t point) { +TERN(HAS_ONESTEP_LEVELING, float, void) Tram(uint8_t point) { char cmd[100] = ""; #if HAS_ONESTEP_LEVELING static bool inLev = false; - if (inLev) return; + float xpos = 0, ypos = 0, zval = 0, margin = 0; char str_1[6] = "", str_2[6] = "", str_3[6] = ""; - #define fmt "X:%s, Y:%s, Z:%s" - float xpos = 0, ypos = 0, zval = 0; - float margin = PROBING_MARGIN; + if (inLev) return NAN; + margin = HMI_data.FullManualTramming ? 30 : PROBING_MARGIN; #else - #define fmt "M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300" int16_t xpos = 0, ypos = 0; int16_t margin = 30; #endif @@ -2569,24 +2293,45 @@ void Tram(uint8_t point) { break; } + planner.synchronize(); + #if HAS_ONESTEP_LEVELING - planner.synchronize(); - probe.stow(); - gcode.process_subcommands_now(F("M420S0\nG28O")); - planner.synchronize(); - inLev = true; - zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW); - sprintf_P(cmd, PSTR(fmt), - dtostrf(xpos, 1, 1, str_1), - dtostrf(ypos, 1, 1, str_2), - dtostrf(zval, 1, 2, str_3) - ); - ui.set_status(cmd); - inLev = false; + + if (HMI_data.FullManualTramming) { + planner.synchronize(); + sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%sY%sF5000\nG0Z0F300"), + dtostrf(xpos, 1, 1, str_1), + dtostrf(ypos, 1, 1, str_2) + ); + queue.inject(cmd); + } + else { + LIMIT(xpos, X_MIN_POS, (X_MAX_POS + probe.offset.x)); + LIMIT(ypos, Y_MIN_POS, (Y_MAX_POS + probe.offset.y)); + probe.stow(); + gcode.process_subcommands_now(F("M420S0\nG28O")); + planner.synchronize(); + inLev = true; + zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW); + if (isnan(zval)) + ui.set_status(F("Position Not Reachable, check offsets")); + else { + sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"), + dtostrf(xpos, 1, 1, str_1), + dtostrf(ypos, 1, 1, str_2), + dtostrf(zval, 1, 2, str_3) + ); + ui.set_status(cmd); + } + inLev = false; + } + return zval; + #else - planner.synchronize(); - sprintf_P(cmd, PSTR(fmt), xpos, ypos); + + sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"), xpos, ypos); queue.inject(cmd); + #endif } @@ -2596,11 +2341,72 @@ void TramBR() { Tram(2); } void TramBL() { Tram(3); } void TramC () { Tram(4); } +#if HAS_ONESTEP_LEVELING + + void Trammingwizard() { + bed_mesh_t zval = {0}; + if (HMI_data.FullManualTramming) { + ui.set_status(F("Disable manual tramming")); + return; + } + zval[0][0] = Tram(0); + checkkey = NothingToDo; + MeshViewer.DrawMesh(zval, 2, 2); + zval[1][0] = Tram(1); + MeshViewer.DrawMesh(zval, 2, 2); + zval[1][1] = Tram(2); + MeshViewer.DrawMesh(zval, 2, 2); + zval[0][1] = Tram(3); + MeshViewer.DrawMesh(zval, 2, 2); + char str_1[6] = "", str_2[6] = ""; + ui.status_printf(0, F("Limits minZ: %s, maxZ: %s"), + dtostrf(MeshViewer.min, 1, 2, str_1), + dtostrf(MeshViewer.max, 1, 2, str_2) + ); + if (ABS(MeshViewer.max - MeshViewer.min) < 0.05) { + DWINUI::Draw_CenteredString(140,F("Corners leveled")); + DWINUI::Draw_CenteredString(160,F("Tolerance achieved!")); + } + else { + uint8_t p = 0; + float d, max = 0; + FSTR_P plabel; + LOOP_L_N(x,2) LOOP_L_N(y,2) { + d = ABS(zval[x][y] - MeshViewer.avg); + if (max < d) { + max = d; + p = x + 2 * y; + } + } + switch (p) { + case 0b00 : plabel = GET_TEXT_F(MSG_LEVBED_FL); break; + case 0b01 : plabel = GET_TEXT_F(MSG_LEVBED_FR); break; + case 0b10 : plabel = GET_TEXT_F(MSG_LEVBED_BL); break; + case 0b11 : plabel = GET_TEXT_F(MSG_LEVBED_BR); break; + default : plabel = F(""); break; + } + DWINUI::Draw_CenteredString(130, F("Corners not leveled")); + DWINUI::Draw_CenteredString(150, F("Knob adjustment required")); + DWINUI::Draw_CenteredString(Color_Green, 170, plabel); + } + DWINUI::Draw_Button(BTN_Continue, 86, 305); + checkkey = Menu; + HMI_SaveProcessID(WaitResponse); + } + + void SetManualTramming() { + HMI_data.FullManualTramming = !HMI_data.FullManualTramming; + Draw_Chkb_Line(CurrentMenu->line(), HMI_data.FullManualTramming); + DWIN_UpdateLCD(); + } + +#endif // HAS_ONESTEP_LEVELING + #if ENABLED(MESH_BED_LEVELING) void ManualMeshStart(){ LCD_MESSAGE(MSG_UBL_BUILD_MESH_MENU); - gcode.process_subcommands_now(F("G28Z\nM211S0\nG29S1")); + gcode.process_subcommands_now(F("G28XYO\nG28Z\nM211S0\nG29S1")); planner.synchronize(); #ifdef MANUAL_PROBE_START_Z const uint8_t line = CurrentMenu->line(MMeshMoveZItem->pos); @@ -2609,7 +2415,7 @@ void TramC () { Tram(4); } } void LiveMeshMoveZ() { - *HMI_value.P_Float = HMI_value.Value / POW(10, 2); + *MenuData.P_Float = MenuData.Value / POW(10, 2); if (!planner.is_full()) { planner.synchronize(); planner.buffer_line(current_position, homing_feedrate(Z_AXIS)); @@ -2642,29 +2448,29 @@ void TramC () { Tram(4); } #endif #endif -void ApplyMaxSpeed() { planner.set_max_feedrate(HMI_value.axis, HMI_value.Value / MINUNITMULT); } -void SetMaxSpeedX() { HMI_value.axis = X_AXIS, SetFloatOnClick(MIN_MAXFEEDSPEED, default_max_feedrate[X_AXIS] * 2, UNITFDIGITS, planner.settings.max_feedrate_mm_s[X_AXIS], ApplyMaxSpeed); } -void SetMaxSpeedY() { HMI_value.axis = Y_AXIS, SetFloatOnClick(MIN_MAXFEEDSPEED, default_max_feedrate[Y_AXIS] * 2, UNITFDIGITS, planner.settings.max_feedrate_mm_s[Y_AXIS], ApplyMaxSpeed); } -void SetMaxSpeedZ() { HMI_value.axis = Z_AXIS, SetFloatOnClick(MIN_MAXFEEDSPEED, default_max_feedrate[Z_AXIS] * 2, UNITFDIGITS, planner.settings.max_feedrate_mm_s[Z_AXIS], ApplyMaxSpeed); } +void ApplyMaxSpeed() { planner.set_max_feedrate(HMI_value.axis, MenuData.Value / MINUNITMULT); } +void SetMaxSpeedX() { HMI_value.axis = X_AXIS, SetFloatOnClick(MIN_MAXFEEDSPEED, max_feedrate_edit_values[X_AXIS], UNITFDIGITS, planner.settings.max_feedrate_mm_s[X_AXIS], ApplyMaxSpeed); } +void SetMaxSpeedY() { HMI_value.axis = Y_AXIS, SetFloatOnClick(MIN_MAXFEEDSPEED, max_feedrate_edit_values[Y_AXIS], UNITFDIGITS, planner.settings.max_feedrate_mm_s[Y_AXIS], ApplyMaxSpeed); } +void SetMaxSpeedZ() { HMI_value.axis = Z_AXIS, SetFloatOnClick(MIN_MAXFEEDSPEED, max_feedrate_edit_values[Z_AXIS], UNITFDIGITS, planner.settings.max_feedrate_mm_s[Z_AXIS], ApplyMaxSpeed); } #if HAS_HOTEND - void SetMaxSpeedE() { HMI_value.axis = E_AXIS; SetFloatOnClick(MIN_MAXFEEDSPEED, default_max_feedrate[E_AXIS] * 2, UNITFDIGITS, planner.settings.max_feedrate_mm_s[E_AXIS], ApplyMaxSpeed); } + void SetMaxSpeedE() { HMI_value.axis = E_AXIS; SetFloatOnClick(MIN_MAXFEEDSPEED, max_feedrate_edit_values[E_AXIS], UNITFDIGITS, planner.settings.max_feedrate_mm_s[E_AXIS], ApplyMaxSpeed); } #endif -void ApplyMaxAccel() { planner.set_max_acceleration(HMI_value.axis, HMI_value.Value); } -void SetMaxAccelX() { HMI_value.axis = X_AXIS, SetIntOnClick(MIN_MAXACCELERATION, default_max_acceleration[X_AXIS] * 2, planner.settings.max_acceleration_mm_per_s2[X_AXIS], ApplyMaxAccel); } -void SetMaxAccelY() { HMI_value.axis = Y_AXIS, SetIntOnClick(MIN_MAXACCELERATION, default_max_acceleration[Y_AXIS] * 2, planner.settings.max_acceleration_mm_per_s2[Y_AXIS], ApplyMaxAccel); } -void SetMaxAccelZ() { HMI_value.axis = Z_AXIS, SetIntOnClick(MIN_MAXACCELERATION, default_max_acceleration[Z_AXIS] * 2, planner.settings.max_acceleration_mm_per_s2[Z_AXIS], ApplyMaxAccel); } +void ApplyMaxAccel() { planner.set_max_acceleration(HMI_value.axis, MenuData.Value); } +void SetMaxAccelX() { HMI_value.axis = X_AXIS, SetIntOnClick(MIN_MAXACCELERATION, max_acceleration_edit_values[X_AXIS], planner.settings.max_acceleration_mm_per_s2[X_AXIS], ApplyMaxAccel); } +void SetMaxAccelY() { HMI_value.axis = Y_AXIS, SetIntOnClick(MIN_MAXACCELERATION, max_acceleration_edit_values[Y_AXIS], planner.settings.max_acceleration_mm_per_s2[Y_AXIS], ApplyMaxAccel); } +void SetMaxAccelZ() { HMI_value.axis = Z_AXIS, SetIntOnClick(MIN_MAXACCELERATION, max_acceleration_edit_values[Z_AXIS], planner.settings.max_acceleration_mm_per_s2[Z_AXIS], ApplyMaxAccel); } #if HAS_HOTEND - void SetMaxAccelE() { HMI_value.axis = E_AXIS; SetIntOnClick(MIN_MAXACCELERATION, default_max_acceleration[E_AXIS] * 2, planner.settings.max_acceleration_mm_per_s2[E_AXIS], ApplyMaxAccel); } + void SetMaxAccelE() { HMI_value.axis = E_AXIS; SetIntOnClick(MIN_MAXACCELERATION, max_acceleration_edit_values[E_AXIS], planner.settings.max_acceleration_mm_per_s2[E_AXIS], ApplyMaxAccel); } #endif #if HAS_CLASSIC_JERK - void ApplyMaxJerk() { planner.set_max_jerk(HMI_value.axis, HMI_value.Value / MINUNITMULT); } - void SetMaxJerkX() { HMI_value.axis = X_AXIS, SetFloatOnClick(MIN_MAXJERK, default_max_jerk[X_AXIS] * 2, UNITFDIGITS, planner.max_jerk[X_AXIS], ApplyMaxJerk); } - void SetMaxJerkY() { HMI_value.axis = Y_AXIS, SetFloatOnClick(MIN_MAXJERK, default_max_jerk[Y_AXIS] * 2, UNITFDIGITS, planner.max_jerk[Y_AXIS], ApplyMaxJerk); } - void SetMaxJerkZ() { HMI_value.axis = Z_AXIS, SetFloatOnClick(MIN_MAXJERK, default_max_jerk[Z_AXIS] * 2, UNITFDIGITS, planner.max_jerk[Z_AXIS], ApplyMaxJerk); } + void ApplyMaxJerk() { planner.set_max_jerk(HMI_value.axis, MenuData.Value / MINUNITMULT); } + void SetMaxJerkX() { HMI_value.axis = X_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[X_AXIS], UNITFDIGITS, planner.max_jerk[X_AXIS], ApplyMaxJerk); } + void SetMaxJerkY() { HMI_value.axis = Y_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[Y_AXIS], UNITFDIGITS, planner.max_jerk[Y_AXIS], ApplyMaxJerk); } + void SetMaxJerkZ() { HMI_value.axis = Z_AXIS, SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[Z_AXIS], UNITFDIGITS, planner.max_jerk[Z_AXIS], ApplyMaxJerk); } #if HAS_HOTEND - void SetMaxJerkE() { HMI_value.axis = E_AXIS; SetFloatOnClick(MIN_MAXJERK, default_max_jerk[E_AXIS] * 2, UNITFDIGITS, planner.max_jerk[E_AXIS], ApplyMaxJerk); } + void SetMaxJerkE() { HMI_value.axis = E_AXIS; SetFloatOnClick(MIN_MAXJERK, max_jerk_edit_values[E_AXIS], UNITFDIGITS, planner.max_jerk[E_AXIS], ApplyMaxJerk); } #endif #endif @@ -2683,21 +2489,21 @@ void SetStepsZ() { HMI_value.axis = Z_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP void SetPidCycles() { SetPIntOnClick(3, 50); } void SetKp() { SetPFloatOnClick(0, 1000, 2); } void ApplyPIDi() { - *HMI_value.P_Float = scalePID_i(HMI_value.Value / POW(10, 2)); + *MenuData.P_Float = scalePID_i(MenuData.Value / POW(10, 2)); thermalManager.updatePID(); } void ApplyPIDd() { - *HMI_value.P_Float = scalePID_d(HMI_value.Value / POW(10, 2)); + *MenuData.P_Float = scalePID_d(MenuData.Value / POW(10, 2)); thermalManager.updatePID(); } void SetKi() { - HMI_value.P_Float = (float*)static_cast(CurrentMenu->SelectedItem())->value; - const float value = unscalePID_i(*HMI_value.P_Float); + MenuData.P_Float = (float*)static_cast(CurrentMenu->SelectedItem())->value; + const float value = unscalePID_i(*MenuData.P_Float); SetFloatOnClick(0, 1000, 2, value, ApplyPIDi); } void SetKd() { - HMI_value.P_Float = (float*)static_cast(CurrentMenu->SelectedItem())->value; - const float value = unscalePID_d(*HMI_value.P_Float); + MenuData.P_Float = (float*)static_cast(CurrentMenu->SelectedItem())->value; + const float value = unscalePID_d(*MenuData.P_Float); SetFloatOnClick(0, 1000, 2, value, ApplyPIDd); } #endif @@ -2709,62 +2515,7 @@ void SetStepsZ() { HMI_value.axis = Z_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP void SetRecoverSpeed() { SetPFloatOnClick( 1, 90, UNITFDIGITS); }; #endif -// Menuitem Drawing functions ================================================= - -void onDrawMenuItem(MenuItemClass* menuitem, int8_t line) { - if (menuitem->icon) DWINUI::Draw_Icon(menuitem->icon, ICOX, MBASE(line) - 3); - if (menuitem->frameid) - DWIN_Frame_AreaCopy(menuitem->frameid, menuitem->frame.left, menuitem->frame.top, menuitem->frame.right, menuitem->frame.bottom, LBLX, MBASE(line)); - else if (menuitem->caption) - DWINUI::Draw_String(LBLX, MBASE(line) - 1, menuitem->caption); - DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); -} - -void onDrawSubMenu(MenuItemClass* menuitem, int8_t line) { - onDrawMenuItem(menuitem, line); - DWINUI::Draw_Icon(ICON_More, VALX + 16, MBASE(line) - 3); -} - -void onDrawIntMenu(MenuItemClass* menuitem, int8_t line, uint16_t value) { - onDrawMenuItem(menuitem, line); - Draw_Menu_IntValue(HMI_data.Background_Color, line, 4, value); -} - -void onDrawPIntMenu(MenuItemClass* menuitem, int8_t line) { - const uint16_t value = *(uint16_t*)static_cast(menuitem)->value; - onDrawIntMenu(menuitem, line, value); -} - -void onDrawPInt8Menu(MenuItemClass* menuitem, int8_t line) { - const uint8_t value = *(uint8_t*)static_cast(menuitem)->value; - onDrawIntMenu(menuitem, line, value); -} - -void onDrawPInt32Menu(MenuItemClass* menuitem, int8_t line) { - const uint32_t value = *(uint32_t*)static_cast(menuitem)->value; - onDrawIntMenu(menuitem, line, value); -} - -void onDrawFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp, const float value) { - onDrawMenuItem(menuitem, line); - DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(line), value); -} - -void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line) { - const float value = *(float*)static_cast(menuitem)->value; - const int8_t dp = UNITFDIGITS; - onDrawFloatMenu(menuitem, line, dp, value); -} - -void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line) { - const float value = *(float*)static_cast(menuitem)->value; - onDrawFloatMenu(menuitem, line, 2, value); -} - -void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line, bool checked) { - onDrawMenuItem(menuitem, line); - Draw_Chkb_Line(line, checked); -} +// Special Menuitem Drawing functions ================================================= void onDrawBack(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) menuitem->SetFrame(1, 129, 72, 156, 84); @@ -2882,6 +2633,10 @@ void onDrawLanguage(MenuItemClass* menuitem, int8_t line) { void onDrawPwrLossR(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, recovery.enabled); } #endif +#if ENABLED(BAUD_RATE_GCODE) + void onDrawBaudrate(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, HMI_data.Baud115K); } +#endif + #if ENABLED(CASE_LIGHT_MENU) void onDrawCaseLight(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, caselight.on); } #endif @@ -3172,137 +2927,9 @@ void onDrawStepsZ(MenuItemClass* menuitem, int8_t line) { } #endif -// HMI Control functions ====================================================== - -// Generic menu control using the encoder -void HMI_Menu() { - EncoderState encoder_diffState = get_encoder_state(); - if (encoder_diffState == ENCODER_DIFF_NO) return; - if (CurrentMenu) { - if (encoder_diffState == ENCODER_DIFF_ENTER) - CurrentMenu->onClick(); - else - CurrentMenu->onScroll(encoder_diffState == ENCODER_DIFF_CW); - } -} - -// Get an integer value using the encoder without draw anything -// lo: low limit -// hi: high limit -// Return value: -// 0 : no change -// 1 : live change -// 2 : apply change -int8_t HMI_GetIntNoDraw(const int32_t lo, const int32_t hi) { - EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); - if (encoder_diffState != ENCODER_DIFF_NO) { - if (Apply_Encoder(encoder_diffState, HMI_value.Value)) { - EncoderRate.enabled = false; - checkkey = Menu; - return 2; - } - LIMIT(HMI_value.Value, lo, hi); - return 1; - } - return 0; -} - -// Get an integer value using the encoder -// lo: low limit -// hi: high limit -// Return value: -// 0 : no change -// 1 : live change -// 2 : apply change -int8_t HMI_GetInt(const int32_t lo, const int32_t hi) { - EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); - if (encoder_diffState != ENCODER_DIFF_NO) { - if (Apply_Encoder(encoder_diffState, HMI_value.Value)) { - EncoderRate.enabled = false; - DWINUI::Draw_Int(HMI_data.Text_Color, HMI_data.Background_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, HMI_value.Value); - checkkey = Menu; - return 2; - } - LIMIT(HMI_value.Value, lo, hi); - DWINUI::Draw_Int(HMI_data.Text_Color, HMI_data.Selected_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, HMI_value.Value); - return 1; - } - return 0; -} - -// Set an integer using the encoder -void HMI_SetInt() { - int8_t val = HMI_GetInt(HMI_value.MinValue, HMI_value.MaxValue); - switch (val) { - case 0: return; break; - case 1: if (HMI_value.LiveUpdate) HMI_value.LiveUpdate(); break; - case 2: if (HMI_value.Apply) HMI_value.Apply(); break; - } -} - -// Set an integer without drawing -void HMI_SetIntNoDraw() { - int8_t val = HMI_GetIntNoDraw(HMI_value.MinValue, HMI_value.MaxValue); - switch (val) { - case 0: return; break; - case 1: if (HMI_value.LiveUpdate) HMI_value.LiveUpdate(); break; - case 2: if (HMI_value.Apply) HMI_value.Apply(); break; - } -} - -// Set an integer pointer variable using the encoder -void HMI_SetPInt() { - int8_t val = HMI_GetInt(HMI_value.MinValue, HMI_value.MaxValue); - switch (val) { - case 0: return; - case 1: if (HMI_value.LiveUpdate) HMI_value.LiveUpdate(); break; - case 2: *HMI_value.P_Int = HMI_value.Value; if (HMI_value.Apply) HMI_value.Apply(); break; - } -} - -// Get a scaled float value using the encoder -// dp: decimal places -// lo: scaled low limit -// hi: scaled high limit -// Return value: -// 0 : no change -// 1 : live change -// 2 : apply change -int8_t HMI_GetFloat(uint8_t dp, int32_t lo, int32_t hi) { - EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); - if (encoder_diffState != ENCODER_DIFF_NO) { - if (Apply_Encoder(encoder_diffState, HMI_value.Value)) { - EncoderRate.enabled = false; - DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), HMI_value.Value / POW(10, dp)); - checkkey = Menu; - return 2; - } - LIMIT(HMI_value.Value, lo, hi); - DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), HMI_value.Value / POW(10, dp)); - return 1; - } - return 0; -} - -// Set a scaled float using the encoder -void HMI_SetFloat() { - const int8_t val = HMI_GetFloat(HMI_value.dp, HMI_value.MinValue, HMI_value.MaxValue); - switch (val) { - case 0: return; - case 1: if (HMI_value.LiveUpdate) HMI_value.LiveUpdate(); break; - case 2: if (HMI_value.Apply) HMI_value.Apply(); break; - } -} - -// 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); - switch (val) { - case 0: return; - case 1: if (HMI_value.LiveUpdate) HMI_value.LiveUpdate(); break; - case 2: *HMI_value.P_Float = HMI_value.Value / POW(10, HMI_value.dp); if (HMI_value.Apply) HMI_value.Apply(); break; - } -} +#if HAS_ONESTEP_LEVELING + void onDrawManualTramming(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, HMI_data.FullManualTramming); } +#endif // Menu Creation and Drawing functions ====================================================== @@ -3359,6 +2986,7 @@ void Draw_Prepare_Menu() { MENU_ITEM(ICON_Cool, GET_TEXT_F(MSG_COOLDOWN), onDrawCooldown, DoCoolDown); MENU_ITEM(ICON_Language, PSTR(GET_TEXT_F(MSG_UI_LANGUAGE)), onDrawLanguage, SetLanguage); } + ui.reset_status(true); CurrentMenu->draw(); } @@ -3369,13 +2997,17 @@ void Draw_Tramming_Menu() { if (CurrentMenu != TrammingMenu) { CurrentMenu = TrammingMenu; SetMenuTitle({0}, GET_TEXT_F(MSG_BED_TRAMMING)); // TODO: Chinese, English "Bed Tramming" JPG - DWINUI::MenuItemsPrepare(6); + DWINUI::MenuItemsPrepare(8); MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, TramFL); MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FR), onDrawMenuItem, TramFR); MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BR), onDrawMenuItem, TramBR); MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BL), onDrawMenuItem, TramBL); MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_C ), onDrawMenuItem, TramC ); + #if HAS_ONESTEP_LEVELING + MENU_ITEM(ICON_ProbeSet, F("Bed tramming wizard"), onDrawMenuItem, Trammingwizard); + MENU_ITEM(ICON_ProbeSet, GET_TEXT_F(MSG_BED_TRAMMING_MANUAL), onDrawManualTramming, SetManualTramming); + #endif } CurrentMenu->draw(); } @@ -3386,7 +3018,7 @@ void Draw_Control_Menu() { if (CurrentMenu != ControlMenu) { CurrentMenu = ControlMenu; SetMenuTitle({103, 1, 28, 14}, GET_TEXT_F(MSG_CONTROL)); - DWINUI::MenuItemsPrepare(8); + DWINUI::MenuItemsPrepare(10); MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); #if ENABLED(CASE_LIGHT_MENU) #if ENABLED(CASELIGHT_USES_BRIGHTNESS) @@ -3408,6 +3040,7 @@ void Draw_Control_Menu() { MENU_ITEM(ICON_Reboot, GET_TEXT_F(MSG_RESET_PRINTER), onDrawMenuItem, RebootPrinter); MENU_ITEM(ICON_Info, GET_TEXT_F(MSG_INFO_SCREEN), onDrawInfoSubMenu, Goto_Info_Menu); } + ui.reset_status(true); CurrentMenu->draw(); } @@ -3417,8 +3050,11 @@ void Draw_AdvancedSettings_Menu() { if (CurrentMenu != AdvancedSettings) { CurrentMenu = AdvancedSettings; SetMenuTitle({0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG - DWINUI::MenuItemsPrepare(15); + DWINUI::MenuItemsPrepare(17); MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawMenuItem, WriteEeprom); + #endif #if HAS_HOME_OFFSET MENU_ITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu); #endif @@ -3437,6 +3073,9 @@ void Draw_AdvancedSettings_Menu() { #if ENABLED(POWER_LOSS_RECOVERY) MENU_ITEM(ICON_Pwrlossr, GET_TEXT_F(MSG_OUTAGE_RECOVERY), onDrawPwrLossR, SetPwrLossr); #endif + #if ENABLED(BAUD_RATE_GCODE) + MENU_ITEM(ICON_SetBaudRate, F("115K baud"), onDrawBaudrate, SetBaudRate); + #endif #if HAS_LCD_BRIGHTNESS EDIT_ITEM(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS), onDrawPInt8Menu, SetBrightness, &ui.brightness); #endif @@ -3451,11 +3090,12 @@ void Draw_AdvancedSettings_Menu() { MENU_ITEM(ICON_ESDiag, F("End-stops diag."), onDrawSubMenu, Draw_EndStopDiag); #endif #if ENABLED(PRINTCOUNTER) - MENU_ITEM(ICON_PrintStats, GET_TEXT_F(MSG_INFO_STATS_MENU), onDrawSubMenu, Draw_PrintStats); + MENU_ITEM(ICON_PrintStats, GET_TEXT_F(MSG_INFO_STATS_MENU), onDrawSubMenu, Goto_PrintStats); MENU_ITEM(ICON_PrintStatsReset, GET_TEXT_F(MSG_INFO_PRINT_COUNT_RESET), onDrawSubMenu, PrintStats.Reset); #endif MENU_ITEM(ICON_Lock, GET_TEXT_F(MSG_LOCKSCREEN), onDrawMenuItem, DWIN_LockScreen); } + ui.reset_status(true); CurrentMenu->draw(); } @@ -3502,11 +3142,14 @@ void Draw_Move_Menu() { if (CurrentMenu != ProbeSetMenu) { CurrentMenu = ProbeSetMenu; SetMenuTitle({0}, GET_TEXT_F(MSG_ZPROBE_SETTINGS)); // TODO: Chinese, English "Probe Settings" JPG - DWINUI::MenuItemsPrepare(8); + DWINUI::MenuItemsPrepare(9); MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); EDIT_ITEM(ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET), onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x); EDIT_ITEM(ICON_ProbeOffsetY, GET_TEXT_F(MSG_ZPROBE_YOFFSET), onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y); EDIT_ITEM(ICON_ProbeOffsetZ, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z); + #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) + EDIT_ITEM(ICON_Temperature, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawPIntMenu, SetBedLevT, &HMI_data.BedLevT); + #endif #ifdef BLTOUCH_HS_MODE MENU_ITEM(ICON_HSMode, F("Enable HS mode"), onDrawHSMode, SetHSMode); #endif @@ -3596,7 +3239,7 @@ void Draw_GetColor_Menu() { MENU_ITEM(2, GET_TEXT_F(MSG_COLORS_BLUE), onDrawGetColorItem, SetRGBColor); } CurrentMenu->draw(); - DWIN_Draw_Rectangle(1, *HMI_value.P_Int, 20, 315, DWIN_WIDTH - 20, 335); + DWIN_Draw_Rectangle(1, *MenuData.P_Int, 20, 315, DWIN_WIDTH - 20, 335); } #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) @@ -3646,7 +3289,7 @@ void Draw_Tune_Menu() { if (CurrentMenu != TuneMenu) { CurrentMenu = TuneMenu; SetMenuTitle({73, 2, 28, 12}, GET_TEXT_F(MSG_TUNE)); // TODO: Chinese, English "Tune" JPG - DWINUI::MenuItemsPrepare(14); + DWINUI::MenuItemsPrepare(16); MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_PrintProcess); #if ENABLED(CASE_LIGHT_MENU) MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); @@ -3679,6 +3322,7 @@ void Draw_Tune_Menu() { MENU_ITEM(ICON_Lock, GET_TEXT_F(MSG_LOCKSCREEN), onDrawMenuItem, DWIN_LockScreen); #if HAS_LCD_BRIGHTNESS EDIT_ITEM(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS), onDrawPInt8Menu, SetBrightness, &ui.brightness); + MENU_ITEM(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS_OFF), onDrawMenuItem, TurnOffBacklight); #endif } CurrentMenu->draw(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 04ac1590ebf1..9f49fa1825b8 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -22,32 +22,18 @@ #pragma once /** - * Enhanced DWIN implementation + * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.9.2 - * date: 2021/11/21 - * - * Based on the original code provided by Creality under GPL + * Version: 3.15.2 + * Date: 2022/03/01 */ -#include "../../../inc/MarlinConfigPre.h" +#include "dwin_defines.h" #include "dwinui.h" #include "../common/encoder.h" #include "../../../libs/BL24CXX.h" -#if ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) && DISABLED(PROBE_MANUALLY) - #define HAS_ONESTEP_LEVELING 1 -#endif - -#if !HAS_BED_PROBE && ENABLED(BABYSTEPPING) - #define JUST_BABYSTEP 1 -#endif - -#if ANY(BABYSTEPPING, HAS_BED_PROBE, HAS_WORKSPACE_OFFSET) - #define HAS_ZOFFSET_ITEM 1 -#endif - -#include "dwin_defines.h" +#include "../../../inc/MarlinConfig.h" enum processID : uint8_t { // Process ID @@ -60,23 +46,16 @@ enum processID : uint8_t { SetPFloat, SelectFile, PrintProcess, - PrintDone, - PwrlossRec, - Reboot, - Info, - ConfirmToPrint, - - // Popup Windows - Homing, + Popup, Leveling, - PidProcess, + Locked, + Reboot, + PrintDone, ESDiagProcess, - PrintStatsProcess, - PauseOrStop, - FilamentPurge, WaitResponse, - Locked, - NothingToDo, + Homing, + PidProcess, + NothingToDo }; enum pidresult_t : uint8_t { @@ -93,24 +72,18 @@ enum pidresult_t : uint8_t { typedef struct { int8_t Color[3]; // Color components - uint16_t pidgrphpoints = 0; pidresult_t pidresult = PID_DONE; int8_t Preheat = 0; // Material Select 0: PLA, 1: ABS, 2: Custom AxisEnum axis = X_AXIS; // Axis Select - int32_t MaxValue = 0; // Auxiliar max integer/scaled float value - int32_t MinValue = 0; // Auxiliar min integer/scaled float value - int8_t dp = 0; // Auxiliar decimal places - int32_t Value = 0; // Auxiliar integer / scaled float value - int16_t *P_Int = nullptr; // Auxiliar pointer to 16 bit integer variable - float *P_Float = nullptr; // Auxiliar pointer to float variable - void (*Apply)() = nullptr; // Auxiliar apply function - void (*LiveUpdate)() = nullptr; // Auxiliar live update function } HMI_value_t; typedef struct { uint8_t language; + bool remain_flag:1; // remain was override by M73 bool pause_flag:1; // printing is paused bool pause_action:1; // flag a pause action + bool abort_flag:1; // printing is aborting + bool abort_action:1; // flag a aborting action bool print_finish:1; // print was finished bool select_flag:1; // Popup button selected bool home_flag:1; // homing in course @@ -126,9 +99,6 @@ extern millis_t dwin_heat_time; #if HAS_HOTEND || HAS_HEATED_BED void DWIN_Popup_Temperature(const bool toohigh); #endif -#if HAS_HOTEND - void Popup_Window_ETempTooLow(); -#endif #if ENABLED(POWER_LOSS_RECOVERY) void Popup_PowerLossRecovery(); #endif @@ -143,50 +113,64 @@ void Goto_Main_Menu(); void Goto_Info_Menu(); void Goto_PowerLossRecovery(); void Goto_ConfirmToPrint(); -void Draw_Status_Area(const bool with_update); // Status Area +void DWIN_Draw_Dashboard(const bool with_update); // Status Area void Draw_Main_Area(); // Redraw main area; void DWIN_Redraw_screen(); // Redraw all screen elements -void HMI_StartFrame(const bool with_update); // Prepare the menu view void HMI_MainMenu(); // Main process screen void HMI_SelectFile(); // File page void HMI_Printing(); // Print page void HMI_ReturnScreen(); // Return to previous screen before popups void ApplyExtMinT(); void HMI_SetLanguageCache(); // Set the languaje image cache +void RebootPrinter(); +#if ENABLED(BAUD_RATE_GCODE) + void HMI_SetBaudRate(); + void SetBaud115K(); + void SetBaud250K(); +#endif +#if ENABLED(EEPROM_SETTINGS) + void WriteEeprom(); + void ReadEeprom(); + void ResetEeprom(); +#endif -void HMI_Init(); -void HMI_Popup(); +void HMI_WaitForUser(); void HMI_SaveProcessID(const uint8_t id); void HMI_AudioFeedback(const bool success=true); void EachMomentUpdate(); void update_variable(); +void DWIN_InitScreen(); void DWIN_HandleScreen(); -void DWIN_Update(); void DWIN_CheckStatusMessage(); void DWIN_StartHoming(); void DWIN_CompletedHoming(); #if HAS_MESH - void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const float zval); + void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval); #endif void DWIN_MeshLevelingStart(); void DWIN_CompletedLeveling(); void DWIN_PidTuning(pidresult_t result); -void DWIN_Print_Started(const bool sd = false); +void DWIN_Print_Started(const bool sd=false); +void DWIN_Print_Pause(); +void DWIN_Print_Resume(); void DWIN_Print_Finished(); +void DWIN_Print_Aborted(); #if HAS_FILAMENT_SENSOR void DWIN_FilamentRunout(const uint8_t extruder); #endif void DWIN_Progress_Update(); void DWIN_Print_Header(const char *text); void DWIN_SetColorDefaults(); +void DWIN_ApplyColor(); void DWIN_StoreSettings(char *buff); void DWIN_LoadSettings(const char *buff); void DWIN_SetDataDefaults(); void DWIN_RebootScreen(); #if ENABLED(ADVANCED_PAUSE_FEATURE) + void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button=0); void Draw_Popup_FilamentPurge(); - void DWIN_Popup_FilamentPurge(); + void Goto_FilamentPurge(); void HMI_FilamentPurge(); #endif @@ -207,14 +191,6 @@ void HMI_LockScreen(); void Draw_PrintStats(); #endif -// HMI user control functions -void HMI_Menu(); -void HMI_SetInt(); -void HMI_SetPInt(); -void HMI_SetIntNoDraw(); -void HMI_SetFloat(); -void HMI_SetPFloat(); - // Menu drawing functions void Draw_Control_Menu(); void Draw_AdvancedSettings_Menu(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 3dc2408f4a00..5065bb94d75b 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -22,18 +22,37 @@ #pragma once /** - * DWIN general defines and data structs + * DWIN general defines and data structs for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.9.2 - * Date: 2021/11/21 - * - * Based on the original code provided by Creality under GPL + * Version: 3.11.2 + * Date: 2022/02/28 */ -//#define NEED_HEX_PRINT 1 //#define DEBUG_DWIN 1 +//#define NEED_HEX_PRINT 1 + +#include "../../../inc/MarlinConfigPre.h" +#include + +#if DISABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) + #error "INDIVIDUAL_AXIS_HOMING_SUBMENU is required with ProUI." +#endif +#if DISABLED(LCD_SET_PROGRESS_MANUALLY) + #error "LCD_SET_PROGRESS_MANUALLY is required with ProUI." +#endif +#if DISABLED(STATUS_MESSAGE_SCROLLING) + #error "STATUS_MESSAGE_SCROLLING is required with ProUI." +#endif +#if DISABLED(BAUD_RATE_GCODE) + #error "BAUD_RATE_GCODE is required with ProUI." +#endif +#if DISABLED(SOUND_MENU_ITEM) + #error "SOUND_MENU_ITEM is required with ProUI." +#endif +#if DISABLED(PRINTCOUNTER) + #error "PRINTCOUNTER is required with ProUI." +#endif -#include "../../../core/types.h" #include "../common/dwin_color.h" #if ENABLED(LED_CONTROL_MENU) #include "../../../feature/leds/leds.h" @@ -57,8 +76,8 @@ #define Def_Barfill_Color BarFill_Color #define Def_Indicator_Color Color_White #define Def_Coordinate_Color Color_White +#define Def_Button_Color RGB( 0, 23, 16) -//#define HAS_GCODE_PREVIEW 1 #define HAS_ESDIAG 1 #if ENABLED(LED_CONTROL_MENU, HAS_COLOR_LEDS) @@ -101,6 +120,9 @@ typedef struct { #if ENABLED(PREVENT_COLD_EXTRUSION) int16_t ExtMinT = EXTRUDE_MINTEMP; #endif + int16_t BedLevT = PREHEAT_1_TEMP_BED; + TERN_(BAUD_RATE_GCODE, bool Baud115K = false); + bool FullManualTramming = false; // Led #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) LEDColor Led_Color = Def_Leds_Color; @@ -113,3 +135,8 @@ typedef struct { static constexpr size_t eeprom_data_size = 64; extern HMI_data_t HMI_data; + +#if PREHEAT_1_TEMP_BED + #undef LEVELING_BED_TEMP + #define LEVELING_BED_TEMP HMI_data.BedLevT +#endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp index b8bff3515959..3da3fc808624 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp @@ -21,12 +21,10 @@ */ /** - * DWIN UI Enhanced implementation + * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.8.1 - * Date: 2021/11/09 - * - * Based on the original code provided by Creality under GPL + * Version: 3.9.1 + * Date: 2022/02/08 */ #include "../../../inc/MarlinConfigPre.h" @@ -37,6 +35,54 @@ #include "dwin_lcd.h" +/*---------------------------------------- Numeric related functions ----------------------------------------*/ + +// Draw a numeric value +// bShow: true=display background color; false=don't display background color +// zeroFill: true=zero fill; false=no zero fill +// signedMode: 1=signed; 0=unsigned +// zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space +// size: Font size +// color: Character color +// bColor: Background color +// iNum: Number of digits +// fNum: Number of decimal digits +// x/y: Upper-left coordinate +// value: Integer value +void DWIN_Draw_Value(uint8_t bShow, bool signedMode, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, + uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, int32_t value) { + size_t i = 0; + DWIN_Byte(i, 0x14); + // Bit 7: bshow + // Bit 6: 1 = signed; 0 = unsigned number; + // Bit 5: zeroFill + // Bit 4: zeroMode + // Bit 3-0: size + DWIN_Byte(i, (bShow * 0x80) | (signedMode * 0x40) | (zeroFill * 0x20) | (zeroMode * 0x10) | size); + DWIN_Word(i, color); + DWIN_Word(i, bColor); + DWIN_Byte(i, signedMode && (value >= 0) ? iNum + 1 : iNum); + DWIN_Byte(i, fNum); + DWIN_Word(i, x); + DWIN_Word(i, y); + // Write a big-endian 64 bit integer + const size_t p = i + 1; + for (size_t count = 8; count--;) { // 7..0 + ++i; + DWIN_SendBuf[p + count] = value; + value >>= 8; + } + DWIN_Send(i); +} + +// Draw a numeric value +// value: positive unscaled float value +void DWIN_Draw_Value(uint8_t bShow, bool signedMode, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, + uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + const int32_t val = round(value * POW(10, fNum)); + DWIN_Draw_Value(bShow, signedMode, zeroFill, zeroMode, size, color, bColor, iNum, fNum, x, y, val); +} + /*---------------------------------------- Picture related functions ----------------------------------------*/ // Display QR code diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.h b/Marlin/src/lcd/e3v2/proui/dwin_lcd.h index 623a94f09e17..cdffb96f2f30 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.h @@ -22,16 +22,32 @@ #pragma once /** - * DWIN UI Enhanced implementation + * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.8.1 - * Date: 2021/11/09 - * - * Based on the original code provided by Creality under GPL + * Version: 3.9.1 + * Date: 2022/02/08 */ #include "../common/dwin_api.h" +// Draw a numeric value +// bShow: true=display background color; false=don't display background color +// zeroFill: true=zero fill; false=no zero fill +// signedMode: 1=signed; 0=unsigned +// zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space +// size: Font size +// color: Character color +// bColor: Background color +// iNum: Number of digits +// fNum: Number of decimal digits +// x/y: Upper-left coordinate +// value: Integer value +void DWIN_Draw_Value(uint8_t bShow, bool signedMode, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, + uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, int32_t value); +// value: positive unscaled float value +void DWIN_Draw_Value(uint8_t bShow, bool signedMode, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, + uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value); + // Display QR code // The size of the QR code is (46*QR_Pixel)*(46*QR_Pixel) dot matrix // QR_Pixel: The pixel size occupied by each point of the QR code: 0x01-0x0F (1-16) diff --git a/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp index 33f216fde6ef..59b6c0d328ae 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp @@ -21,12 +21,10 @@ */ /** - * DWIN UI Enhanced implementation + * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.10.1 - * Date: 2022/01/21 - * - * Based on the original code provided by Creality under GPL + * Version: 3.11.1 + * Date: 2022/02/28 */ #include "../../../inc/MarlinConfigPre.h" @@ -34,30 +32,64 @@ #if ENABLED(DWIN_LCD_PROUI) #include "dwin.h" +#include "dwinui.h" #include "dwin_popup.h" -void Draw_Select_Highlight(const bool sel) { +#include "../../../MarlinCore.h" // for wait_for_user + +popupDrawFunc_t popupDraw = nullptr; +popupClickFunc_t popupClick = nullptr; +popupChangeFunc_t popupChange = nullptr; + +uint16_t HighlightYPos = 280; + +void Draw_Select_Highlight(const bool sel, const uint16_t ypos) { + HighlightYPos = ypos; HMI_flag.select_flag = sel; const uint16_t c1 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_color, c2 = sel ? HMI_data.PopupBg_color : HMI_data.Highlight_Color; - DWIN_Draw_Rectangle(0, c1, 25, 279, 126, 318); - DWIN_Draw_Rectangle(0, c1, 24, 278, 127, 319); - DWIN_Draw_Rectangle(0, c2, 145, 279, 246, 318); - DWIN_Draw_Rectangle(0, c2, 144, 278, 247, 319); + DWIN_Draw_Rectangle(0, c1, 25, ypos - 1, 126, ypos + 38); + DWIN_Draw_Rectangle(0, c1, 24, ypos - 2, 127, ypos + 39); + DWIN_Draw_Rectangle(0, c2, 145, ypos - 1, 246, ypos + 38); + DWIN_Draw_Rectangle(0, c2, 144, ypos - 2, 247, ypos + 39); } void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2) { HMI_SaveProcessID(WaitResponse); - DWIN_Draw_Popup(icon, fmsg1, fmsg2, ICON_Continue_E); // Button Continue + DWIN_Draw_Popup(icon, fmsg1, fmsg2, BTN_Continue); // Button Continue DWIN_UpdateLCD(); } void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2) { DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), fmsg2); - DWINUI::Draw_IconWB(ICON_Confirm_E, 26, 280); - DWINUI::Draw_IconWB(ICON_Cancel_E, 146, 280); - Draw_Select_Highlight(true); + DWINUI::Draw_Button(BTN_Confirm, 26, 280); + DWINUI::Draw_Button(BTN_Cancel, 146, 280); + Draw_Select_Highlight(HMI_flag.select_flag); DWIN_UpdateLCD(); } +void Goto_Popup(const popupDrawFunc_t fnDraw, const popupClickFunc_t fnClick/*=nullptr*/, const popupChangeFunc_t fnChange/*=nullptr*/) { + popupDraw = fnDraw; + popupClick = fnClick; + popupChange = fnChange; + HMI_SaveProcessID(Popup); + HMI_flag.select_flag = false; + popupDraw(); +} + +void HMI_Popup() { + if (!wait_for_user) { + if (popupClick) popupClick(); + return; + } + else { + EncoderState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_CW || encoder_diffState == ENCODER_DIFF_CCW) { + const bool change = encoder_diffState != ENCODER_DIFF_CW; + if (popupChange) popupChange(change); else Draw_Select_Highlight(change, HighlightYPos); + DWIN_UpdateLCD(); + } + } +} + #endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/dwin_popup.h b/Marlin/src/lcd/e3v2/proui/dwin_popup.h index 2e952cc1b99b..0d864994754b 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_popup.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.h @@ -22,20 +22,26 @@ #pragma once /** - * DWIN UI Enhanced implementation + * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.10.1 - * Date: 2022/01/21 - * - * Based on the original code provided by Creality under GPL + * Version: 3.11.1 + * Date: 2022/02/28 */ #include "dwinui.h" #include "dwin.h" -// Popup windows +typedef void (*popupDrawFunc_t)(); +typedef void (*popupClickFunc_t)(); +typedef void (*popupChangeFunc_t)(const bool state); +extern popupDrawFunc_t popupDraw; -void Draw_Select_Highlight(const bool sel); +void Draw_Select_Highlight(const bool sel, const uint16_t ypos); +inline void Draw_Select_Highlight(const bool sel) { Draw_Select_Highlight(sel, 280); }; +void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2); +void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2); +void Goto_Popup(const popupDrawFunc_t fnDraw, const popupClickFunc_t fnClick=nullptr, const popupChangeFunc_t fnChange=nullptr); +void HMI_Popup(); inline void Draw_Popup_Bkgd() { DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, 14, 60, 258, 330); @@ -49,7 +55,7 @@ void DWIN_Draw_Popup(const uint8_t icon, T amsg1=nullptr, U amsg2=nullptr, uint8 if (icon) DWINUI::Draw_Icon(icon, 101, 105); if (amsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, amsg1); if (amsg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, amsg2); - if (button) DWINUI::Draw_IconWB(button, 86, 280); + if (button) DWINUI::Draw_Button(button, 86, 280); } template @@ -61,10 +67,7 @@ void DWIN_Show_Popup(const uint8_t icon, T amsg1=nullptr, U amsg2=nullptr, uint8 template void DWIN_Popup_Confirm(const uint8_t icon, T amsg1, U amsg2) { HMI_SaveProcessID(WaitResponse); - DWIN_Draw_Popup(icon, amsg1, amsg2, ICON_Confirm_E); // Button Confirm + DWIN_Draw_Popup(icon, amsg1, amsg2, BTN_Confirm); // Button Confirm DWIN_UpdateLCD(); } -void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2); - -void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2); diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index 1dbd53139061..ddc494fc8492 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -21,12 +21,10 @@ */ /** - * DWIN UI Enhanced implementation + * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.8.2 - * Date: 2021/11/09 - * - * Based on the original code provided by Creality under GPL + * Version: 3.15.1 + * Date: 2022/02/25 */ #include "../../../inc/MarlinConfigPre.h" @@ -51,7 +49,9 @@ xy_int_t DWINUI::cursor = { 0 }; uint16_t DWINUI::pencolor = Color_White; uint16_t DWINUI::textcolor = Def_Text_Color; uint16_t DWINUI::backcolor = Def_Background_Color; +uint16_t DWINUI::buttoncolor = Def_Button_Color; uint8_t DWINUI::font = font8x16; +FSTR_P const DWINUI::Author = F(STRING_CONFIG_H_AUTHOR); void (*DWINUI::onCursorErase)(const int8_t line)=nullptr; void (*DWINUI::onCursorDraw)(const int8_t line)=nullptr; @@ -59,18 +59,16 @@ void (*DWINUI::onTitleDraw)(TitleClass* title)=nullptr; void (*DWINUI::onMenuDraw)(MenuClass* menu)=nullptr; void DWINUI::init() { - DEBUG_ECHOPGM("\r\nDWIN handshake "); - delay(750); // Delay here or init later in the boot process - const bool success = DWIN_Handshake(); - if (success) DEBUG_ECHOLNPGM("ok."); else DEBUG_ECHOLNPGM("error."); + TERN_(DEBUG_DWIN, SERIAL_ECHOPGM("\r\nDWIN handshake ")); + delay(750); // Delay for wait to wakeup screen + const bool hs = DWIN_Handshake(); + TERN(DEBUG_DWIN, SERIAL_ECHOLNF(hs ? F("ok.") : F("error.")), UNUSED(hs)); DWIN_Frame_SetDir(1); - TERN(SHOW_BOOTSCREEN,,DWIN_Frame_Clear(Color_Bg_Black)); - DWIN_UpdateLCD(); - cursor.x = 0; - cursor.y = 0; + cursor.reset(); pencolor = Color_White; textcolor = Def_Text_Color; backcolor = Def_Background_Color; + buttoncolor = Def_Button_Color; font = font8x16; } @@ -124,9 +122,10 @@ uint16_t DWINUI::RowToY(uint8_t row) { } // Set text/number color -void DWINUI::SetColors(uint16_t fgcolor, uint16_t bgcolor) { +void DWINUI::SetColors(uint16_t fgcolor, uint16_t bgcolor, uint16_t alcolor) { textcolor = fgcolor; backcolor = bgcolor; + buttoncolor = alcolor; } void DWINUI::SetTextColor(uint16_t fgcolor) { textcolor = fgcolor; @@ -159,16 +158,22 @@ void DWINUI::MoveBy(xy_int_t point) { cursor += point; } -// Draw a Centered string using DWIN_WIDTH -void DWINUI::Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, const char * const string) { - const int8_t x = _MAX(0U, DWIN_WIDTH - strlen_P(string) * fontWidth(size)) / 2 - 1; +// Draw a Centered string using arbitrary x1 and x2 margins +void DWINUI::Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string) { + const uint16_t x = _MAX(0U, x2 + x1 - strlen_P(string) * fontWidth(size)) / 2 - 1; DWIN_Draw_String(bShow, size, color, bColor, x, y, string); } +// // Draw a Centered string using DWIN_WIDTH +// void DWINUI::Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, const char * const string) { +// const int8_t x = _MAX(0U, DWIN_WIDTH - strlen_P(string) * fontWidth(size)) / 2 - 1; +// DWIN_Draw_String(bShow, size, color, bColor, x, y, string); +// } + // Draw a char at cursor position -void DWINUI::Draw_Char(const char c) { +void DWINUI::Draw_Char(uint16_t color, const char c) { const char string[2] = { c, 0}; - DWIN_Draw_String(false, font, textcolor, backcolor, cursor.x, cursor.y, string, 1); + DWIN_Draw_String(false, font, color, backcolor, cursor.x, cursor.y, string, 1); MoveBy(fontWidth(font), 0); } @@ -185,21 +190,26 @@ void DWINUI::Draw_String(uint16_t color, const char * const string, uint16_t rli MoveBy(strlen(string) * fontWidth(font), 0); } -// Draw a signed floating point number -// bShow: true=display background color; false=don't display background color -// zeroFill: true=zero fill; false=no zero fill -// zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space -// size: Font size -// bColor: Background color -// iNum: Number of whole digits -// fNum: Number of decimal digits -// x/y: Upper-left point -// value: Float value -void DWINUI::Draw_Signed_Float(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_FloatValue(bShow, zeroFill, zeroMode, size, color, bColor, iNum, fNum, x, y, value < 0 ? -value : value); - DWIN_Draw_String(bShow, size, color, bColor, x - 6, y, value < 0 ? F("-") : F(" ")); +// ------------------------- Buttons ------------------------------// + +void DWINUI::Draw_Button(uint16_t color, uint16_t bcolor, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, const char * const caption) { + DWIN_Draw_Rectangle(1, bcolor, x1, y1, x2, y2); + Draw_CenteredString(0, font, color, bcolor, x1, x2, (y2 + y1 - fontHeight())/2, caption); +} + +void DWINUI::Draw_Button(uint8_t id, uint16_t x, uint16_t y) { + switch (id) { + case BTN_Cancel : Draw_Button(GET_TEXT_F(MSG_BUTTON_CANCEL), x, y); break; + case BTN_Confirm : Draw_Button(GET_TEXT_F(MSG_BUTTON_CONFIRM), x, y); break; + case BTN_Continue: Draw_Button(GET_TEXT_F(MSG_BUTTON_CONTINUE), x, y); break; + case BTN_Print : Draw_Button(GET_TEXT_F(MSG_BUTTON_PRINT), x, y); break; + case BTN_Save : Draw_Button(GET_TEXT_F(MSG_BUTTON_SAVE), x, y); break; + default: break; + } } +// -------------------------- Extra -------------------------------// + // Draw a circle // color: circle color // x: the abscissa of the center of the circle @@ -247,13 +257,12 @@ void DWINUI::Draw_FillCircle(uint16_t bcolor, uint16_t x,uint16_t y,uint8_t r) { // color1 : Start color // color2 : End color uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2) { - uint8_t B,G,R; - float n; - n = (float)(val-minv)/(maxv-minv); - R = (1-n)*GetRColor(color1) + n*GetRColor(color2); - G = (1-n)*GetGColor(color1) + n*GetGColor(color2); - B = (1-n)*GetBColor(color1) + n*GetBColor(color2); - return RGB(R,G,B); + uint8_t B, G, R; + const float n = (float)(val - minv) / (maxv - minv); + R = (1 - n) * GetRColor(color1) + n * GetRColor(color2); + G = (1 - n) * GetGColor(color1) + n * GetGColor(color2); + B = (1 - n) * GetBColor(color1) + n * GetBColor(color2); + return RGB(R, G, B); } // Color Interpolator through Red->Yellow->Green->Blue @@ -261,33 +270,27 @@ uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t colo // minv : Minimum value // maxv : Maximum value uint16_t DWINUI::RainbowInt(int16_t val, int16_t minv, int16_t maxv) { - uint8_t B,G,R; - const uint8_t maxB = 28; - const uint8_t maxR = 28; - const uint8_t maxG = 38; + uint8_t B, G, R; + const uint8_t maxB = 28, maxR = 28, maxG = 38; const int16_t limv = _MAX(abs(minv), abs(maxv)); - float n; - if (minv>=0) { - n = (float)(val-minv)/(maxv-minv); - } else { - n = (float)val/limv; - } - n = _MIN(1, n); - n = _MAX(-1, n); + float n = minv >= 0 ? (float)(val - minv) / (maxv - minv) : (float)val / limv; + LIMIT(n, -1, 1); if (n < 0) { R = 0; - G = (1+n)*maxG; - B = (-n)*maxB; - } else if (n < 0.5) { - R = maxR*n*2; + G = (1 + n) * maxG; + B = (-n) * maxB; + } + else if (n < 0.5) { + R = maxR * n * 2; G = maxG; B = 0; - } else { + } + else { R = maxR; - G = maxG*(1-n); + G = maxG * (1 - n); B = 0; } - return RGB(R,G,B); + return RGB(R, G, B); } // Draw a checkbox diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index 595c534356d4..1504dcd30598 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -22,12 +22,10 @@ #pragma once /** - * DWIN UI Enhanced implementation + * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.11.1 - * Date: 2022/01/19 - * - * Based on the original code provided by Creality under GPL + * Version: 3.15.1 + * Date: 2022/02/25 */ #include "dwin_lcd.h" @@ -107,6 +105,13 @@ #define ICON_CaseLight ICON_Motion #define ICON_LedControl ICON_Motion +// Buttons +#define BTN_Continue 85 +#define BTN_Cancel 87 +#define BTN_Confirm 89 +#define BTN_Print 90 +#define BTN_Save 91 + // Extended and default UI Colors #define Color_Black 0 #define Color_Green RGB(0,63,0) @@ -119,7 +124,11 @@ #define DWIN_FONT_HEAD font10x20 #define DWIN_FONT_ALERT font10x20 #define STATUS_Y 354 -#define LCD_WIDTH (DWIN_WIDTH / 8) +#define LCD_WIDTH (DWIN_WIDTH / 8) // only if the default font is font8x16 + +// Minimum unit (0.1) : multiple (10) +#define UNITFDIGITS 1 +#define MINUNITMULT POW(10, UNITFDIGITS) constexpr uint16_t TITLE_HEIGHT = 30, // Title bar height MLINE = 53, // Menu line height @@ -212,7 +221,9 @@ namespace DWINUI { extern uint16_t pencolor; extern uint16_t textcolor; extern uint16_t backcolor; + extern uint16_t buttoncolor; extern uint8_t font; + extern FSTR_P const Author; extern void (*onCursorErase)(const int8_t line); extern void (*onCursorDraw)(const int8_t line); @@ -240,7 +251,7 @@ namespace DWINUI { uint16_t RowToY(uint8_t row); // Set text/number color - void SetColors(uint16_t fgcolor, uint16_t bgcolor); + void SetColors(uint16_t fgcolor, uint16_t bgcolor, uint16_t alcolor); void SetTextColor(uint16_t fgcolor); void SetBackgroundColor(uint16_t bgcolor); @@ -268,6 +279,17 @@ namespace DWINUI { DWIN_Draw_Line(pencolor, cursor.x, cursor.y, x, y); } + // Extend a frame box + // v: value to extend + inline frame_rect_t ExtendFrame(frame_rect_t frame, uint8_t v) { + frame_rect_t t; + t.x = frame.x - v; + t.y = frame.y - v; + t.w = frame.w + 2 * v; + t.h = frame.h + 2 * v; + return t; + } + // Draw an Icon with transparent background from the library ICON // icon: Icon ID // x/y: Upper-left point @@ -293,26 +315,56 @@ namespace DWINUI { // x/y: Upper-left coordinate // value: Integer value inline void Draw_Int(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_IntValue(bShow, zeroFill, zeroMode, size, color, bColor, iNum, x, y, value); + DWIN_Draw_Value(bShow, 0, zeroFill, zeroMode, size, color, bColor, iNum, 0, x, y, value); } inline void Draw_Int(uint8_t iNum, long value) { - DWIN_Draw_IntValue(false, true, 0, font, textcolor, backcolor, iNum, cursor.x, cursor.y, value); + DWIN_Draw_Value(false, 0, true, 0, font, textcolor, backcolor, iNum, 0, cursor.x, cursor.y, value); MoveBy(iNum * fontWidth(font), 0); } inline void Draw_Int(uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_IntValue(false, true, 0, font, textcolor, backcolor, iNum, x, y, value); + DWIN_Draw_Value(false, 0, true, 0, font, textcolor, backcolor, iNum, 0, x, y, value); } inline void Draw_Int(uint16_t color, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_IntValue(false, true, 0, font, color, backcolor, iNum, x, y, value); + DWIN_Draw_Value(false, 0, true, 0, font, color, backcolor, iNum, 0, x, y, value); } inline void Draw_Int(uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_IntValue(true, true, 0, font, color, bColor, iNum, x, y, value); + DWIN_Draw_Value(true, 0, true, 0, font, color, bColor, iNum, 0, x, y, value); } inline void Draw_Int(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_IntValue(true, true, 0, size, color, bColor, iNum, x, y, value); + DWIN_Draw_Value(true, 0, true, 0, size, color, bColor, iNum, 0, x, y, value); } - // Draw a floating point number + // Draw a signed integer + // bShow: true=display background color; false=don't display background color + // zeroFill: true=zero fill; false=no zero fill + // zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space + // size: Font size + // color: Character color + // bColor: Background color + // iNum: Number of digits + // x/y: Upper-left coordinate + // value: Integer value + inline void Draw_Signed_Int(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { + DWIN_Draw_Value(bShow, 1, zeroFill, zeroMode, size, color, bColor, iNum, 0, x, y, value); + } + inline void Draw_Signed_Int(uint8_t iNum, long value) { + DWIN_Draw_Value(false, 1, true, 0, font, textcolor, backcolor, iNum, 0, cursor.x, cursor.y, value); + MoveBy(iNum * fontWidth(font), 0); + } + inline void Draw_Signed_Int(uint8_t iNum, uint16_t x, uint16_t y, long value) { + DWIN_Draw_Value(false, 1, true, 0, font, textcolor, backcolor, iNum, 0, x, y, value); + } + inline void Draw_Signed_Int(uint16_t color, uint8_t iNum, uint16_t x, uint16_t y, long value) { + DWIN_Draw_Value(false, 1, true, 0, font, color, backcolor, iNum, 0, x, y, value); + } + inline void Draw_Signed_Int(uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { + DWIN_Draw_Value(true, 1, true, 0, font, color, bColor, iNum, 0, x, y, value); + } + inline void Draw_Signed_Int(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { + DWIN_Draw_Value(true, 1, true, 0, size, color, bColor, iNum, 0, x, y, value); + } + + // Draw a positive floating point number // bShow: true=display background color; false=don't display background color // zeroFill: true=zero fill; false=no zero fill // zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space @@ -324,23 +376,23 @@ namespace DWINUI { // x/y: Upper-left point // value: Float value inline void Draw_Float(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_FloatValue(bShow, zeroFill, zeroMode, size, color, bColor, iNum, fNum, x, y, value); + DWIN_Draw_Value(bShow, 0, zeroFill, zeroMode, size, color, bColor, iNum, fNum, x, y, value); } inline void Draw_Float(uint8_t iNum, uint8_t fNum, float value) { - DWIN_Draw_FloatValue(false, true, 0, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); + DWIN_Draw_Value(false, 0, true, 0, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); MoveBy((iNum + fNum + 1) * fontWidth(font), 0); } inline void Draw_Float(uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_FloatValue(false, true, 0, font, textcolor, backcolor, iNum, fNum, x, y, value); + DWIN_Draw_Value(false, 0, true, 0, font, textcolor, backcolor, iNum, fNum, x, y, value); } inline void Draw_Float(uint16_t color, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_FloatValue(false, true, 0, font, color, backcolor, iNum, fNum, x, y, value); + DWIN_Draw_Value(false, 0, true, 0, font, color, backcolor, iNum, fNum, x, y, value); } inline void Draw_Float(uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_FloatValue(true, true, 0, font, color, bColor, iNum, fNum, x, y, value); + DWIN_Draw_Value(true, 0, true, 0, font, color, bColor, iNum, fNum, x, y, value); } inline void Draw_Float(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_FloatValue(true, true, 0, size, color, bColor, iNum, fNum, x, y, value); + DWIN_Draw_Value(true, 0, true, 0, size, color, bColor, iNum, fNum, x, y, value); } // Draw a signed floating point number @@ -348,31 +400,35 @@ namespace DWINUI { // zeroFill: true=zero fill; false=no zero fill // zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space // size: Font size + // color: Character color // bColor: Background color // iNum: Number of whole digits // fNum: Number of decimal digits // x/y: Upper-left point // value: Float value - void Draw_Signed_Float(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value); + inline void Draw_Signed_Float(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + DWIN_Draw_Value(bShow, 1, zeroFill, zeroMode, size, color, bColor, iNum, fNum, x, y, value); + } inline void Draw_Signed_Float(uint8_t iNum, uint8_t fNum, float value) { - Draw_Signed_Float(false, true, 0, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); + DWIN_Draw_Value(false, 1, true, 0, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); MoveBy((iNum + fNum + 1) * fontWidth(font), 0); } inline void Draw_Signed_Float(uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Signed_Float(false, true, 0, font, textcolor, backcolor, iNum, fNum, x, y, value); + DWIN_Draw_Value(false, 1, true, 0, font, textcolor, backcolor, iNum, fNum, x, y, value); } inline void Draw_Signed_Float(uint8_t size, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Signed_Float(false, true, 0, size, textcolor, backcolor, iNum, fNum, x, y, value); + DWIN_Draw_Value(false, 1, true, 0, size, textcolor, backcolor, iNum, fNum, x, y, value); } inline void Draw_Signed_Float(uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Signed_Float(true, true, 0, font, color, bColor, iNum, fNum, x, y, value); + DWIN_Draw_Value(true, 1, true, 0, font, color, bColor, iNum, fNum, x, y, value); } inline void Draw_Signed_Float(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Signed_Float(true, true, 0, size, color, bColor, iNum, fNum, x, y, value); + DWIN_Draw_Value(true, 1, true, 0, size, color, bColor, iNum, fNum, x, y, value); } // Draw a char at cursor position - void Draw_Char(const char c); + void Draw_Char(uint16_t color, const char c); + inline void Draw_Char(const char c) { Draw_Char(textcolor, c); } // Draw a string at cursor position // color: Character color @@ -425,7 +481,10 @@ namespace DWINUI { // bColor: Background color // 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); + void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, 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, const char * const string) { + Draw_CenteredString(bShow, size, color, bColor, 0, DWIN_WIDTH, y, string); + } 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)); } @@ -487,6 +546,17 @@ namespace DWINUI { // color2 : End color uint16_t ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2); + // ------------------------- Buttons ------------------------------// + + void Draw_Button(uint16_t color, uint16_t bcolor, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, const char * const caption); + inline void Draw_Button(uint16_t color, uint16_t bcolor, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, FSTR_P caption) { + Draw_Button(color, bcolor, x1, y1, x2, y2, FTOP(caption)); + } + inline void Draw_Button(FSTR_P caption, uint16_t x, uint16_t y) { + Draw_Button(textcolor, buttoncolor, x, y, x + 99, y + 37, caption); + } + void Draw_Button(uint8_t id, uint16_t x, uint16_t y); + // -------------------------- Extra -------------------------------// // Draw a circle filled with color diff --git a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp index f04c079017b3..74eb94e751af 100644 --- a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp @@ -21,15 +21,12 @@ */ /** - * DWIN End Stops diagnostic page + * DWIN End Stops diagnostic page for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 1.0.2 - * Date: 2021/11/06 - * - * Based on the original code provided by Creality under GPL + * Version: 1.2.2 + * Date: 2022/02/24 */ -#include "../../../inc/MarlinConfigPre.h" #include "dwin_defines.h" #if BOTH(DWIN_LCD_PROUI, HAS_ESDIAG) @@ -72,7 +69,7 @@ void ESDiagClass::Draw() { Title.ShowCaption(F("End-stops Diagnostic")); DWINUI::ClearMenuArea(); Draw_Popup_Bkgd(); - DWINUI::Draw_Icon(ICON_Continue_E, 86, 250); + DWINUI::Draw_Button(BTN_Continue, 86, 250); DWINUI::cursor.y = 80; #define ES_LABEL(S) draw_es_label(F(STR_##S)) #if HAS_X_MIN diff --git a/Marlin/src/lcd/e3v2/proui/endstop_diag.h b/Marlin/src/lcd/e3v2/proui/endstop_diag.h index 4694ddb14172..316a1e1ed3d9 100644 --- a/Marlin/src/lcd/e3v2/proui/endstop_diag.h +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.h @@ -22,12 +22,10 @@ #pragma once /** - * DWIN End Stops diagnostic page + * DWIN End Stops diagnostic page for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 1.0 - * Date: 2021/11/06 - * - * Based on the original code provided by Creality under GPL + * Version: 1.2.3 + * Date: 2022/02/24 */ class ESDiagClass { diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp index 2ccdcc12073d..2895c01544b0 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp @@ -21,12 +21,10 @@ */ /** - * Lock screen implementation for DWIN UI Enhanced implementation + * Lock screen implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 2.1 * Date: 2021/11/09 - * - * Based on the original code provided by Creality under GPL */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.h b/Marlin/src/lcd/e3v2/proui/lockscreen.h index bf2fdb3f4b0b..ec967fe2db7c 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.h +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.h @@ -22,12 +22,10 @@ #pragma once /** - * Lock screen implementation for DWIN UI Enhanced implementation + * Lock screen implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 2.1 * Date: 2021/11/09 - * - * Based on the original code provided by Creality under GPL */ #include "../common/encoder.h" diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp new file mode 100644 index 000000000000..6dfcb8595c87 --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -0,0 +1,370 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Menu functions for ProUI + * Author: Miguel A. Risco-Castillo + * Version: 1.2.1 + * Date: 2022/02/25 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfigPre.h" + +#if ENABLED(DWIN_LCD_PROUI) + +#include "../common/encoder.h" +#include "dwin_lcd.h" +#include "dwinui.h" +#include "dwin.h" +#include "menus.h" + +MenuData_t MenuData; + +// Menuitem Drawing functions ================================================= + +void Draw_Title(TitleClass* title) { + DWIN_Draw_Rectangle(1, HMI_data.TitleBg_color, 0, 0, DWIN_WIDTH - 1, TITLE_HEIGHT - 1); + if (title->frameid) + DWIN_Frame_AreaCopy(title->frameid, title->frame.left, title->frame.top, title->frame.right, title->frame.bottom, 14, (TITLE_HEIGHT - (title->frame.bottom - title->frame.top)) / 2 - 1); + else + DWIN_Draw_String(false, DWIN_FONT_HEAD, HMI_data.TitleTxt_color, HMI_data.TitleBg_color, 14, (TITLE_HEIGHT - DWINUI::fontHeight(DWIN_FONT_HEAD)) / 2 - 1, title->caption); +} + +void Draw_Menu(MenuClass* menu) { + DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); + DWIN_Draw_Rectangle(1, DWINUI::backcolor, 0, TITLE_HEIGHT, DWIN_WIDTH - 1, STATUS_Y - 1); +} + +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 int8_t line) { + DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, MBASE(line) - 18, 14, MBASE(line + 1) - 20); +} + +void Draw_Menu_Line(const uint8_t line, const uint8_t icon /*=0*/, const char * const label /*=nullptr*/, bool more /*=false*/) { + if (icon) DWINUI::Draw_Icon(icon, ICOX, MBASE(line) - 3); + if (label) DWINUI::Draw_String(LBLX, MBASE(line) - 1, (char*)label); + if (more) DWINUI::Draw_Icon(ICON_More, VALX + 16, MBASE(line) - 3); + DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); +} + +void Draw_Chkb_Line(const uint8_t line, const bool checked) { + DWINUI::Draw_Checkbox(HMI_data.Text_Color, HMI_data.Background_Color, VALX + 16, MBASE(line) - 1, checked); +} + +void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const int32_t value /*=0*/) { + DWINUI::Draw_Signed_Int(HMI_data.Text_Color, bcolor, iNum , VALX, MBASE(line) - 1, value); +} + +void onDrawMenuItem(MenuItemClass* menuitem, int8_t line) { + if (menuitem->icon) DWINUI::Draw_Icon(menuitem->icon, ICOX, MBASE(line) - 3); + if (menuitem->frameid) + DWIN_Frame_AreaCopy(menuitem->frameid, menuitem->frame.left, menuitem->frame.top, menuitem->frame.right, menuitem->frame.bottom, LBLX, MBASE(line)); + else if (menuitem->caption) + DWINUI::Draw_String(LBLX, MBASE(line) - 1, menuitem->caption); + DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); +} + +void onDrawSubMenu(MenuItemClass* menuitem, int8_t line) { + onDrawMenuItem(menuitem, line); + DWINUI::Draw_Icon(ICON_More, VALX + 16, MBASE(line) - 3); +} + +void onDrawIntMenu(MenuItemClass* menuitem, int8_t line, int32_t value) { + onDrawMenuItem(menuitem, line); + Draw_Menu_IntValue(HMI_data.Background_Color, line, 4, value); +} + +void onDrawPIntMenu(MenuItemClass* menuitem, int8_t line) { + const int16_t value = *(int16_t*)static_cast(menuitem)->value; + onDrawIntMenu(menuitem, line, value); +} + +void onDrawPInt8Menu(MenuItemClass* menuitem, int8_t line) { + const uint8_t value = *(uint8_t*)static_cast(menuitem)->value; + onDrawIntMenu(menuitem, line, value); +} + +void onDrawPInt32Menu(MenuItemClass* menuitem, int8_t line) { + const uint32_t value = *(uint32_t*)static_cast(menuitem)->value; + onDrawIntMenu(menuitem, line, value); +} + +void onDrawFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp, const float value) { + onDrawMenuItem(menuitem, line); + DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(line), value); +} + +void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line) { + const float value = *(float*)static_cast(menuitem)->value; + const int8_t dp = UNITFDIGITS; + onDrawFloatMenu(menuitem, line, dp, value); +} + +void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line) { + const float value = *(float*)static_cast(menuitem)->value; + onDrawFloatMenu(menuitem, line, 2, value); +} + +void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line, bool checked) { + onDrawMenuItem(menuitem, line); + Draw_Chkb_Line(line, checked); +} + +//----------------------------------------------------------------------------- +// On click functions +//----------------------------------------------------------------------------- + +// Generic onclick event without draw +// process: process id HMI destiny +// lo: low limit +// hi: high limit +// dp: decimal places, 0 for integers +// val: value / scaled value +// LiveUpdate: live update function when the encoder changes +// Apply: update function when the encoder is pressed +void SetOnClick(uint8_t process, const int32_t lo, const int32_t hi, uint8_t dp, const int32_t val, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) { + checkkey = process; + MenuData.MinValue = lo; + MenuData.MaxValue = hi; + MenuData.dp = dp; + MenuData.Apply = Apply; + MenuData.LiveUpdate = LiveUpdate; + MenuData.Value = val; + EncoderRate.enabled = true; +} + +// Generic onclick event for integer values +// process: process id HMI destiny +// lo: scaled low limit +// hi: scaled high limit +// val: value +// LiveUpdate: live update function when the encoder changes +// Apply: update function when the encoder is pressed +void SetValueOnClick(uint8_t process, const int32_t lo, const int32_t hi, const int32_t val, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) { + SetOnClick(process, lo, hi, 0, val, Apply, LiveUpdate); + Draw_Menu_IntValue(HMI_data.Selected_Color, CurrentMenu->line(), 4, MenuData.Value); +} + +// Generic onclick event for float values +// process: process id HMI destiny +// lo: scaled low limit +// hi: scaled high limit +// val: value +// LiveUpdate: live update function when the encoder changes +// Apply: update function when the encoder is pressed +void SetValueOnClick(uint8_t process, const float lo, const float hi, uint8_t dp, const float val, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) { + const int32_t value = round(val * POW(10, dp)); + SetOnClick(process, lo * POW(10, dp), hi * POW(10, dp), dp, value, Apply, LiveUpdate); + DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), val); +} + +// Generic onclick event for integer values +// lo: scaled low limit +// hi: scaled high limit +// val: value +// LiveUpdate: live update function when the encoder changes +// Apply: update function when the encoder is pressed +void SetIntOnClick(const int32_t lo, const int32_t hi, const int32_t val, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) { + SetValueOnClick(SetInt, lo, hi, val, Apply, LiveUpdate); +} + +// Generic onclick event for set pointer to 16 bit uinteger values +// lo: low limit +// hi: high limit +// LiveUpdate: live update function when the encoder changes +// Apply: update function when the encoder is pressed +void SetPIntOnClick(const int32_t lo, const int32_t hi, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) { + MenuData.P_Int = (int16_t*)static_cast(CurrentMenu->SelectedItem())->value; + const int32_t value = *MenuData.P_Int; + SetValueOnClick(SetPInt, lo, hi, value, Apply, LiveUpdate); +} + +// Generic onclick event for float values +// process: process id HMI destiny +// lo: low limit +// hi: high limit +// dp: decimal places +// val: value +void SetFloatOnClick(const float lo, const float hi, uint8_t dp, const float val, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) { + SetValueOnClick(SetFloat, lo, hi, dp, val, Apply, LiveUpdate); +} + +// Generic onclick event for set pointer to float values +// lo: low limit +// hi: high limit +// LiveUpdate: live update function when the encoder changes +// Apply: update function when the encoder is pressed +void SetPFloatOnClick(const float lo, const float hi, uint8_t dp, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) { + MenuData.P_Float = (float*)static_cast(CurrentMenu->SelectedItem())->value; + SetValueOnClick(SetPFloat, lo, hi, dp, *MenuData.P_Float, Apply, LiveUpdate); +} + +// HMI Control functions ====================================================== + +// Generic menu control using the encoder +void HMI_Menu() { + EncoderState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + if (CurrentMenu) { + if (encoder_diffState == ENCODER_DIFF_ENTER) + CurrentMenu->onClick(); + else + CurrentMenu->onScroll(encoder_diffState == ENCODER_DIFF_CW); + } +} + +// Get an integer value using the encoder without draw anything +// lo: low limit +// hi: high limit +// Return value: +// 0 : no change +// 1 : live change +// 2 : apply change +int8_t HMI_GetIntNoDraw(const int32_t lo, const int32_t hi) { + EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (Apply_Encoder(encoder_diffState, MenuData.Value)) { + EncoderRate.enabled = false; + checkkey = Menu; + return 2; + } + LIMIT(MenuData.Value, lo, hi); + return 1; + } + return 0; +} + +// Get an integer value using the encoder +// lo: low limit +// hi: high limit +// Return value: +// 0 : no change +// 1 : live change +// 2 : apply change +int8_t HMI_GetInt(const int32_t lo, const int32_t hi) { + EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (Apply_Encoder(encoder_diffState, MenuData.Value)) { + EncoderRate.enabled = false; + DWINUI::Draw_Signed_Int(HMI_data.Text_Color, HMI_data.Background_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value); + checkkey = Menu; + return 2; + } + LIMIT(MenuData.Value, lo, hi); + DWINUI::Draw_Signed_Int(HMI_data.Text_Color, HMI_data.Selected_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value); + return 1; + } + return 0; +} + +// Set an integer using the encoder +void HMI_SetInt() { + int8_t val = HMI_GetInt(MenuData.MinValue, MenuData.MaxValue); + switch (val) { + case 0: return; break; + case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; + case 2: if (MenuData.Apply) MenuData.Apply(); break; + } +} + +// Set an integer without drawing +void HMI_SetIntNoDraw() { + int8_t val = HMI_GetIntNoDraw(MenuData.MinValue, MenuData.MaxValue); + switch (val) { + case 0: return; break; + case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; + case 2: if (MenuData.Apply) MenuData.Apply(); break; + } +} + +// Set an integer pointer variable using the encoder +void HMI_SetPInt() { + int8_t val = HMI_GetInt(MenuData.MinValue, MenuData.MaxValue); + switch (val) { + case 0: return; + case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; + case 2: *MenuData.P_Int = MenuData.Value; if (MenuData.Apply) MenuData.Apply(); break; + } +} + +// Get a scaled float value using the encoder +// dp: decimal places +// lo: scaled low limit +// hi: scaled high limit +// Return value: +// 0 : no change +// 1 : live change +// 2 : apply change +int8_t HMI_GetFloat(uint8_t dp, int32_t lo, int32_t hi) { + EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); + if (encoder_diffState != ENCODER_DIFF_NO) { + if (Apply_Encoder(encoder_diffState, MenuData.Value)) { + EncoderRate.enabled = false; + DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, dp)); + checkkey = Menu; + return 2; + } + LIMIT(MenuData.Value, lo, hi); + DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, dp)); + return 1; + } + return 0; +} + +// Set a scaled float using the encoder +void HMI_SetFloat() { + const int8_t val = HMI_GetFloat(MenuData.dp, MenuData.MinValue, MenuData.MaxValue); + switch (val) { + case 0: return; + case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; + case 2: if (MenuData.Apply) MenuData.Apply(); break; + } +} + +// Set a scaled float pointer variable using the encoder +void HMI_SetPFloat() { + const int8_t val = HMI_GetFloat(MenuData.dp, MenuData.MinValue, MenuData.MaxValue); + switch (val) { + case 0: return; + case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; + case 2: *MenuData.P_Float = MenuData.Value / POW(10, MenuData.dp); if (MenuData.Apply) MenuData.Apply(); break; + } +} + +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/menus.h b/Marlin/src/lcd/e3v2/proui/menus.h new file mode 100644 index 000000000000..0147c1616b31 --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/menus.h @@ -0,0 +1,94 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Menu functions for ProUI + * Author: Miguel A. Risco-Castillo + * Version: 1.2.1 + * Date: 2022/02/25 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "dwinui.h" + +typedef struct { + int32_t MaxValue = 0; // Auxiliar max integer/scaled float value + int32_t MinValue = 0; // Auxiliar min integer/scaled float value + int8_t dp = 0; // Auxiliar decimal places + int32_t Value = 0; // Auxiliar integer / scaled float value + int16_t *P_Int = nullptr; // Auxiliar pointer to 16 bit integer variable + float *P_Float = nullptr; // Auxiliar pointer to float variable + void (*Apply)() = nullptr; // Auxiliar apply function + void (*LiveUpdate)() = nullptr; // Auxiliar live update function +} MenuData_t; + +extern MenuData_t MenuData; + +// Menuitem Drawing functions ================================================= +void Draw_Title(TitleClass* title); +void Draw_Menu(MenuClass* menu); +void Draw_Menu_Cursor(const int8_t line); +void Erase_Menu_Cursor(const int8_t line); +void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false); +void Draw_Chkb_Line(const uint8_t line, const bool checked); +void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const int32_t value=0); +void onDrawMenuItem(MenuItemClass* menuitem, int8_t line); +void onDrawSubMenu(MenuItemClass* menuitem, int8_t line); +void onDrawIntMenu(MenuItemClass* menuitem, int8_t line, int32_t value); +void onDrawPIntMenu(MenuItemClass* menuitem, int8_t line); +void onDrawPInt8Menu(MenuItemClass* menuitem, int8_t line); +void onDrawPInt32Menu(MenuItemClass* menuitem, int8_t line); +void onDrawFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp, const float value); +void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line); +void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line); +void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line, bool checked); + +// On click functions ========================================================= +void SetOnClick(uint8_t process, const int32_t lo, const int32_t hi, uint8_t dp, const int32_t val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); +void SetValueOnClick(uint8_t process, const int32_t lo, const int32_t hi, const int32_t val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); +void SetValueOnClick(uint8_t process, const float lo, const float hi, uint8_t dp, const float val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); +void SetIntOnClick(const int32_t lo, const int32_t hi, const int32_t val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); +void SetPIntOnClick(const int32_t lo, const int32_t hi, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); +void SetFloatOnClick(const float lo, const float hi, uint8_t dp, const float val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); +void SetPFloatOnClick(const float lo, const float hi, uint8_t dp, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); + +// HMI user control functions ================================================= +void HMI_Menu(); +void HMI_SetInt(); +void HMI_SetPInt(); +void HMI_SetIntNoDraw(); +void HMI_SetFloat(); +void HMI_SetPFloat(); diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 275a29cd3850..0b22ae98d5ef 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -21,12 +21,10 @@ */ /** - * DWIN Mesh Viewer + * Mesh Viewer for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.9.1 - * Date: 2021/11/09 - * - * Based on the original code provided by Creality under GPL + * version: 3.12.1 + * Date: 2022/02/24 */ #include "../../../inc/MarlinConfigPre.h" @@ -40,49 +38,53 @@ #include "dwin_lcd.h" #include "dwinui.h" #include "dwin.h" +#include "dwin_popup.h" #include "../../../feature/bedlevel/bedlevel.h" MeshViewerClass MeshViewer; -void MeshViewerClass::Draw() { +void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8_t sizey) { 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); + const int16_t stx = (DWIN_WIDTH - 2 * mx) / (sizex - 1), // Steps + sty = (DWIN_WIDTH - 2 * my) / (sizey - 1); 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; + int16_t zmesh[sizex][sizey]; #define px(xp) (mx + (xp) * stx) #define py(yp) (30 + DWIN_WIDTH - my - (yp) * sty) #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 DrawMeshValue(xp, yp, zv) DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(xp) - 18, 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) - GRID_LOOP(x, y) { - const float v = isnan(Z_VALUES(x,y)) ? 0 : round(Z_VALUES(x,y) * 100); + #define DrawMeshVLine(xp) DWIN_Draw_VLine(HMI_data.SplitLine_Color, px(xp), py(sizey - 1), DWIN_WIDTH - 2 * my) + int16_t maxz =-32000; int16_t minz = 32000; avg = 0; + LOOP_L_N(y, sizey) LOOP_L_N(x, sizex) { + const float v = isnan(zval[x][y]) ? 0 : round(zval[x][y] * 100); zmesh[x][y] = v; + avg += v; NOLESS(maxz, v); NOMORE(minz, v); } - Title.ShowCaption(F("Mesh Viewer")); + max = (float)maxz / 100; + min = (float)minz / 100; + avg = avg / (100 * sizex * sizey); DWINUI::ClearMenuArea(); - DWINUI::Draw_Icon(ICON_Continue_E, 86, 305); - DWIN_Draw_Rectangle(0, HMI_data.SplitLine_Color, px(0), py(0), px(GRID_MAX_POINTS_X - 1), py(GRID_MAX_POINTS_Y - 1)); - LOOP_S_L_N(x, 1, GRID_MAX_POINTS_X - 1) DrawMeshVLine(x); - LOOP_S_L_N(y, 1, GRID_MAX_POINTS_Y - 1) DrawMeshHLine(y); - LOOP_L_N(y, GRID_MAX_POINTS_Y) { + DWIN_Draw_Rectangle(0, HMI_data.SplitLine_Color, px(0), py(0), px(sizex - 1), py(sizey - 1)); + LOOP_S_L_N(x, 1, sizex - 1) DrawMeshVLine(x); + LOOP_S_L_N(y, 1, sizey - 1) DrawMeshHLine(y); + LOOP_L_N(y, sizey) { watchdog_refresh(); - LOOP_L_N(x, GRID_MAX_POINTS_X) { + LOOP_L_N(x, sizex) { uint16_t color = DWINUI::RainbowInt(zmesh[x][y], _MIN(-5, minz), _MAX(5, maxz)); 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)); + if (sizex < 9) + DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(x) - 18, py(y) - 6, zval[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)); + DWINUI::Draw_Signed_Float(font6x12, 1, 1, px(x) - 18, py(y) - 6, zval[x][y]); break; case -99 ... -1: sprintf_P(str_1, PSTR("-.%02i"), -zmesh[x][y]); @@ -94,7 +96,7 @@ void MeshViewerClass::Draw() { 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)); + DWINUI::Draw_Signed_Float(font6x12, 1, 1, px(x) - 18, py(y) - 6, zval[x][y]); break; } if (str_1[0]) @@ -102,11 +104,25 @@ void MeshViewerClass::Draw() { } } } +} + +void MeshViewerClass::Draw(bool withsave /*= false*/) { + Title.ShowCaption(F("Mesh Viewer")); + DrawMesh(Z_VALUES_ARR, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y); + if (withsave) { + DWINUI::Draw_Button(BTN_Save, 26, 305); + DWINUI::Draw_Button(BTN_Continue, 146, 305); + Draw_Select_Highlight(HMI_flag.select_flag, 305); + } else DWINUI::Draw_Button(BTN_Continue, 86, 305); char str_1[6], str_2[6] = ""; ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"), - dtostrf((float)minz / 100, 1, 2, str_1), - dtostrf((float)maxz / 100, 1, 2, str_2) + dtostrf(min, 1, 2, str_1), + dtostrf(max, 1, 2, str_2) ); } +void Draw_MeshViewer() { MeshViewer.Draw(true); } +void onClick_MeshViewer() { if (HMI_flag.select_flag) WriteEeprom(); HMI_ReturnScreen(); } +void Goto_MeshViewer() { if (leveling_is_valid()) Goto_Popup(Draw_MeshViewer, onClick_MeshViewer); else HMI_ReturnScreen(); } + #endif // DWIN_LCD_PROUI && HAS_MESH diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.h b/Marlin/src/lcd/e3v2/proui/meshviewer.h index acd5f0d5c465..f914bab4ae23 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.h +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.h @@ -21,18 +21,23 @@ */ #pragma once +#include "../../../core/types.h" +#include "../../../feature/bedlevel/bedlevel.h" + /** - * DWIN Mesh Viewer + * Mesh Viewer for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.9.1 - * Date: 2021/11/09 - * - * Based on the original code provided by Creality under GPL + * version: 3.12.1 + * Date: 2022/02/24 */ class MeshViewerClass { public: - void Draw(); + float avg, max, min; + void Draw(bool withsave = false); + void DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8_t sizey); }; extern MeshViewerClass MeshViewer; + +void Goto_MeshViewer(); diff --git a/Marlin/src/lcd/e3v2/proui/printstats.cpp b/Marlin/src/lcd/e3v2/proui/printstats.cpp index 54c87f4be102..d4ca4ca2255f 100644 --- a/Marlin/src/lcd/e3v2/proui/printstats.cpp +++ b/Marlin/src/lcd/e3v2/proui/printstats.cpp @@ -21,12 +21,10 @@ */ /** - * DWIN Print Stats page + * Print Stats page for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 1.1 - * Date: 2022/01/09 - * - * Based on the original code provided by Creality under GPL + * Version: 1.3.0 + * Date: 2022/02/24 */ #include "../../../inc/MarlinConfigPre.h" @@ -36,6 +34,7 @@ #include "printstats.h" #include "../../../core/types.h" +#include "../../../MarlinCore.h" #include "../../marlinui.h" #include "../../../module/printcounter.h" #include "dwin_lcd.h" @@ -53,7 +52,7 @@ void PrintStatsClass::Draw() { Title.ShowCaption(GET_TEXT_F(MSG_INFO_STATS_MENU)); DWINUI::ClearMenuArea(); Draw_Popup_Bkgd(); - DWINUI::Draw_Icon(ICON_Continue_E, 86, 250); + DWINUI::Draw_Button(BTN_Continue, 86, 250); printStatistics ps = print_job_timer.getStats(); sprintf_P(buf, PSTR(S_FMT ": %i"), GET_TEXT(MSG_INFO_PRINT_COUNT), ps.totalPrints); @@ -75,4 +74,9 @@ void PrintStatsClass::Reset() { HMI_AudioFeedback(); } +void Goto_PrintStats() { + PrintStats.Draw(); + HMI_SaveProcessID(WaitResponse); +} + #endif // DWIN_LCD_PROUI && PRINTCOUNTER diff --git a/Marlin/src/lcd/e3v2/proui/printstats.h b/Marlin/src/lcd/e3v2/proui/printstats.h index f17e4dc9dd60..705c923da41b 100644 --- a/Marlin/src/lcd/e3v2/proui/printstats.h +++ b/Marlin/src/lcd/e3v2/proui/printstats.h @@ -22,18 +22,18 @@ #pragma once /** - * DWIN Print Stats page + * Print Stats page for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 1.1 - * Date: 2022/01/09 - * - * Based on the original code provided by Creality under GPL + * Version: 1.3.0 + * Date: 2022/02/24 */ class PrintStatsClass { public: - void Draw(); + static void Draw(); static void Reset(); }; extern PrintStatsClass PrintStats; + +void Goto_PrintStats(); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 9925f225e381..7fe5c2227158 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -151,6 +151,7 @@ namespace Language_en { LSTR MSG_BED_LEVELING = _UxGT("Bed Leveling"); LSTR MSG_LEVEL_BED = _UxGT("Level Bed"); LSTR MSG_BED_TRAMMING = _UxGT("Bed Tramming"); + LSTR MSG_BED_TRAMMING_MANUAL = _UxGT("Manual Tramming"); LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Adjust bed until the probe triggers."); LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Corners within tolerance. Bed trammed."); LSTR MSG_BED_TRAMMING_GOOD_POINTS = _UxGT("Good Points: "); @@ -402,7 +403,7 @@ namespace Language_en { LSTR MSG_ADVANCE_K_E = _UxGT("Advance K *"); LSTR MSG_CONTRAST = _UxGT("LCD Contrast"); LSTR MSG_BRIGHTNESS = _UxGT("LCD Brightness"); - LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD Sleep (s)"); + LSTR MSG_BRIGHTNESS_OFF = _UxGT("Turn Off LCD"); LSTR MSG_STORE_EEPROM = _UxGT("Store Settings"); LSTR MSG_LOAD_EEPROM = _UxGT("Load Settings"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Restore Defaults"); @@ -429,6 +430,8 @@ namespace Language_en { LSTR MSG_BUTTON_RESET = _UxGT("Reset"); LSTR MSG_BUTTON_IGNORE = _UxGT("Ignore"); LSTR MSG_BUTTON_CANCEL = _UxGT("Cancel"); + LSTR MSG_BUTTON_CONFIRM = _UxGT("Confirm"); + LSTR MSG_BUTTON_CONTINUE = _UxGT("Continue"); LSTR MSG_BUTTON_DONE = _UxGT("Done"); LSTR MSG_BUTTON_BACK = _UxGT("Back"); LSTR MSG_BUTTON_PROCEED = _UxGT("Proceed"); @@ -438,6 +441,7 @@ namespace Language_en { LSTR MSG_BUTTON_PAUSE = _UxGT("Pause"); LSTR MSG_BUTTON_RESUME = _UxGT("Resume"); LSTR MSG_BUTTON_ADVANCED = _UxGT("Advanced"); + LSTR MSG_BUTTON_SAVE = _UxGT("Save"); LSTR MSG_PAUSING = _UxGT("Pausing..."); LSTR MSG_PAUSE_PRINT = _UxGT("Pause Print"); LSTR MSG_ADVANCED_PAUSE = _UxGT("Advanced Pause"); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 810d0db52789..f0677afd2d1d 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -48,7 +48,6 @@ MarlinUI ui; #if ENABLED(DWIN_CREALITY_LCD) #include "e3v2/creality/dwin.h" #elif ENABLED(DWIN_LCD_PROUI) - #include "fontutils.h" #include "e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "e3v2/jyersui/dwin.h" @@ -1441,8 +1440,10 @@ void MarlinUI::init() { else if (print_job_timer.needsService(3)) msg = FPSTR(service3); #endif - else if (!no_welcome) - msg = GET_TEXT_F(WELCOME_MSG); + else if (!no_welcome) msg = GET_TEXT_F(WELCOME_MSG); + + else if (ENABLED(DWIN_LCD_PROUI)) + msg = F(""); else return; diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 36cbb14c5ccc..83eb332105d6 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -367,15 +367,6 @@ class MarlinUI { static void set_status(FSTR_P const fstr, const int8_t level=0); static void status_printf(const uint8_t level, FSTR_P const fmt, ...); - #if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI) - 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 void kill_screen(FSTR_P const, FSTR_P const) {} - #endif - #if HAS_DISPLAY static void update(); @@ -489,11 +480,16 @@ class MarlinUI { #endif static void draw_kill_screen(); + 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 // No LCD static void update() {} static void return_to_status() {} + static void kill_screen(FSTR_P const, FSTR_P const) {} #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index e0b2eccbbd34..2b2e33556523 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1467,16 +1467,18 @@ void MarlinSettings::postprocess() { // #if ENABLED(DWIN_LCD_PROUI) { + _FIELD_TEST(dwin_data); char dwin_data[eeprom_data_size] = { 0 }; DWIN_StoreSettings(dwin_data); - _FIELD_TEST(dwin_data); EEPROM_WRITE(dwin_data); } - #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) + #endif + + #if ENABLED(DWIN_CREALITY_LCD_JYERSUI) { + _FIELD_TEST(dwin_settings); char dwin_settings[CrealityDWIN.eeprom_data_size] = { 0 }; CrealityDWIN.Save_Settings(dwin_settings); - _FIELD_TEST(dwin_settings); EEPROM_WRITE(dwin_settings); } #endif diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index a96ed3a6512b..f83104fe9c47 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -497,6 +497,9 @@ void Stepper::enable_axis(const AxisEnum axis) { bool Stepper::disable_axis(const AxisEnum axis) { mark_axis_disabled(axis); + + TERN_(DWIN_LCD_PROUI, set_axis_untrusted(axis)); // MRISCOC workaround: https://github.com/MarlinFirmware/Marlin/issues/23095 + // If all the axes that share the enabled bit are disabled const bool can_disable = can_axis_disable(axis); if (can_disable) { diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 4adf96891982..653b3179b0c0 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -821,7 +821,7 @@ volatile bool Temperature::raw_temps_ready = false; hal.idletask(); // Run UI update - TERN(HAS_DWIN_E3V2_BASIC, DWIN_Update(), ui.update()); + TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update()); } wait_for_heatup = false; diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index 92d65babfa70..5b48d7cadbcf 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -235,7 +235,7 @@ #define TFTGLCD_CS PA9 #endif - + #elif ENABLED(FYSETC_MINI_12864_2_1) #error "CAUTION! FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864_V1 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue." diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h index 8616a8fb3406..fb7198e57c21 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h @@ -28,7 +28,11 @@ #include "env_validate.h" #if HAS_MULTI_HOTEND || E_STEPPERS > 1 - #error "Creality V4 only supports one hotend / E-stepper. Comment out this line to continue." + #error "Creality V24S1 only supports one hotend / E-stepper. Comment out this line to continue." +#endif + +#if BOTH(BLTOUCH, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #error "Disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN when using BLTOUCH with Creality V24S1-301." #endif #define BOARD_INFO_NAME "Creality V24S1-301" @@ -44,7 +48,7 @@ // // Limit Switches // -#define Z_STOP_PIN PC14 +#define Z_STOP_PIN PA15 #ifndef Z_MIN_PROBE_PIN #define Z_MIN_PROBE_PIN PC14 // BLTouch IN @@ -63,4 +67,22 @@ #define HEATER_BED_PIN PA7 // HOT BED #define FAN1_PIN PC0 // extruder fan +// +// SD Card +// +#define ONBOARD_SPI_DEVICE 1 +#define ONBOARD_SD_CS_PIN PA4 // SDSS + +// +// M3/M4/M5 - Spindle/Laser Control +// +#if HAS_CUTTER + //#define HEATER_0_PIN -1 + //#define HEATER_BED_PIN -1 + #define FAN_PIN -1 + #define SPINDLE_LASER_ENA_PIN PA0 // FET 1 + #define SPINDLE_LASER_PWM_PIN PA0 // Bed FET + #define SPINDLE_DIR_PIN PA0 // FET 4 +#endif + #include "pins_CREALITY_V4.h" diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 41ec44d4b7b0..724de8f82a2f 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -195,7 +195,7 @@ char *createFilename(char * const buffer, const dir_t &p) { } // -// Return 'true' if the item is something Marlin can read +// Return 'true' if the item is a folder, G-code file or Binary file // bool CardReader::is_visible_entity(const dir_t &p OPTARG(CUSTOM_FIRMWARE_UPLOAD, bool onlyBin/*=false*/)) { //uint8_t pn0 = p.name[0]; @@ -212,14 +212,15 @@ bool CardReader::is_visible_entity(const dir_t &p OPTARG(CUSTOM_FIRMWARE_UPLOAD, ) return false; flag.filenameIsDir = DIR_IS_SUBDIR(&p); // We know it's a File or Folder + setBinFlag(p.name[8] == 'B' && // List .bin files (a firmware file for flashing) + p.name[9] == 'I' && + p.name[10]== 'N'); return ( flag.filenameIsDir // All Directories are ok + || fileIsBinary() // BIN files are accepted || (!onlyBin && p.name[8] == 'G' && p.name[9] != '~') // Non-backup *.G* files are accepted - || ( onlyBin && p.name[8] == 'B' - && p.name[9] == 'I' - && p.name[10] == 'N') // BIN files are accepted ); } @@ -867,6 +868,7 @@ void CardReader::selectFileByIndex(const uint16_t nr) { strcpy(filename, sortshort[nr]); strcpy(longFilename, sortnames[nr]); flag.filenameIsDir = IS_DIR(nr); + setBinFlag(strcmp_P(strrchr(filename, '.'), PSTR(".BIN")) == 0); return; } #endif @@ -884,6 +886,7 @@ void CardReader::selectFileByName(const char * const match) { strcpy(filename, sortshort[nr]); strcpy(longFilename, sortnames[nr]); flag.filenameIsDir = IS_DIR(nr); + setBinFlag(strcmp_P(strrchr(filename, '.'), PSTR(".BIN")) == 0); return; } #endif diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 2b3dcd00fbfb..483ab8139584 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -80,6 +80,9 @@ typedef struct { filenameIsDir:1, workDirIsRoot:1, abort_sd_printing:1 + #if DO_LIST_BIN_FILES + , filenameIsBin:1 + #endif #if ENABLED(BINARY_FILE_TRANSFER) , binary_mode:1 #endif @@ -218,6 +221,10 @@ class CardReader { static void removeJobRecoveryFile(); #endif + // Binary flag for the current file + static bool fileIsBinary() { return TERN0(DO_LIST_BIN_FILES, flag.filenameIsBin); } + static void setBinFlag(const bool bin) { TERN(DO_LIST_BIN_FILES, flag.filenameIsBin = bin, UNUSED(bin)); } + // Current Working Dir - Set by cd, cdup, cdroot, and diveToFile(true, ...) static char* getWorkDirName() { workDir.getDosName(filename); return filename; } static SdFile& getWorkDir() { return workDir.isOpen() ? workDir : root; } diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index 6a15ec122179..6440c5679224 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -15,8 +15,9 @@ exec_test $1 $2 "Ender 3 v2 with CrealityUI" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_disable DWIN_CREALITY_LCD -opt_enable DWIN_LCD_PROUI BLTOUCH AUTO_BED_LEVELING_UBL Z_SAFE_HOMING INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING BAUD_RATE_GCODE -exec_test $1 $2 "Ender 3 v2 with Pro UI" "$3" +opt_enable BLTOUCH AUTO_BED_LEVELING_UBL Z_SAFE_HOMING INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING BAUD_RATE_GCODE \ + DWIN_LCD_PROUI SOUND_MENU_ITEM PRINTCOUNTER +exec_test $1 $2 "Ender 3 v2 with ProUI" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_disable DWIN_CREALITY_LCD From c6f4b38877d6ff5973c5273bf28c0fa1b60226a3 Mon Sep 17 00:00:00 2001 From: Giuseppe499 Date: Sat, 12 Mar 2022 00:12:03 +0100 Subject: [PATCH 155/502] =?UTF-8?q?=F0=9F=9A=B8=20Fix,=20extend=20X=20Axis?= =?UTF-8?q?=20Twist=20Compensation=20(#23745)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/core/serial.cpp | 8 ++ Marlin/src/core/serial.h | 1 + Marlin/src/core/utility.cpp | 4 +- Marlin/src/feature/bedlevel/ubl/ubl.cpp | 4 +- Marlin/src/feature/mixing.cpp | 2 +- Marlin/src/feature/x_twist.cpp | 19 ++--- Marlin/src/gcode/calibrate/G33.cpp | 3 +- Marlin/src/gcode/gcode.h | 5 ++ Marlin/src/gcode/probe/M423.cpp | 99 +++++++++++++++++++++++++ Marlin/src/lcd/menu/menu_x_twist.cpp | 2 +- Marlin/src/libs/vector_3.cpp | 3 +- Marlin/src/module/settings.cpp | 22 +++--- ini/features.ini | 2 +- platformio.ini | 2 +- 14 files changed, 142 insertions(+), 34 deletions(-) create mode 100644 Marlin/src/gcode/probe/M423.cpp diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 2b1ae1f1fe00..562cddbaa07a 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -78,6 +78,14 @@ void serial_error_start() { static PGMSTR(errormagic, "Error:"); serial_print_P( void serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); } +void serial_offset(const_float_t v, const uint8_t sp/*=0*/) { + if (v == 0 && sp == 1) + SERIAL_CHAR(' '); + else if (v > 0 || (v == 0 && sp == 2)) + SERIAL_CHAR('+'); + SERIAL_DECIMAL(v); +} + void serial_ternary(const bool onoff, FSTR_P const pre, FSTR_P const on, FSTR_P const off, FSTR_P const post/*=nullptr*/) { if (pre) serial_print(pre); serial_print(onoff ? on : off); diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index aee4d4d43db8..98e82b6d7281 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -345,6 +345,7 @@ void serialprint_onoff(const bool onoff); void serialprintln_onoff(const bool onoff); void serialprint_truefalse(const bool tf); void serial_spaces(uint8_t count); +void serial_offset(const_float_t v, const uint8_t sp=0); // For v==0 draw space (sp==1) or plus (sp==2) void print_bin(const uint16_t val); void print_pos(LINEAR_AXIS_ARGS(const_float_t), FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr); diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index 19e76267447d..59e59d4cb7ff 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -126,10 +126,8 @@ void safe_delay(millis_t ms) { #if ABL_PLANAR SERIAL_ECHOPGM("ABL Adjustment"); LOOP_LINEAR_AXES(a) { - const float v = planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]; SERIAL_CHAR(' ', AXIS_CHAR(a)); - if (v > 0) SERIAL_CHAR('+'); - SERIAL_DECIMAL(v); + serial_offset(planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]); } #else #if ENABLED(AUTO_BED_LEVELING_UBL) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp index 964f1123fe42..c162062f8609 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp @@ -213,8 +213,8 @@ void unified_bed_leveling::display_map(const uint8_t map_type) { else if (isnan(f)) SERIAL_ECHOF(human ? F(" . ") : F("NAN")); else if (human || csv) { - if (human && f >= 0.0) SERIAL_CHAR(f > 0 ? '+' : ' '); // Display sign also for positive numbers (' ' for 0) - SERIAL_ECHO_F(f, 3); // Positive: 5 digits, Negative: 6 digits + if (human && f >= 0) SERIAL_CHAR(f > 0 ? '+' : ' '); // Display sign also for positive numbers (' ' for 0) + SERIAL_DECIMAL(f); // Positive: 5 digits, Negative: 6 digits } if (csv && i < (GRID_MAX_POINTS_X) - 1) SERIAL_CHAR('\t'); diff --git a/Marlin/src/feature/mixing.cpp b/Marlin/src/feature/mixing.cpp index 9ebc90127f43..b1a069e3205e 100644 --- a/Marlin/src/feature/mixing.cpp +++ b/Marlin/src/feature/mixing.cpp @@ -63,7 +63,7 @@ void Mixer::normalize(const uint8_t tool_index) { #ifdef MIXER_NORMALIZER_DEBUG SERIAL_ECHOPGM("Mixer: Old relation : [ "); MIXER_STEPPER_LOOP(i) { - SERIAL_ECHO_F(collector[i] / csum, 3); + SERIAL_DECIMAL(collector[i] / csum); SERIAL_CHAR(' '); } SERIAL_ECHOLNPGM("]"); diff --git a/Marlin/src/feature/x_twist.cpp b/Marlin/src/feature/x_twist.cpp index 891009123986..b5ad25cba87d 100644 --- a/Marlin/src/feature/x_twist.cpp +++ b/Marlin/src/feature/x_twist.cpp @@ -36,8 +36,8 @@ void XATC::reset() { constexpr float xzo[] = XATC_Z_OFFSETS; static_assert(COUNT(xzo) == XATC_MAX_POINTS, "XATC_Z_OFFSETS is the wrong size."); COPY(z_offset, xzo); - xatc.spacing = (probe.max_x() - probe.min_x()) / (XATC_MAX_POINTS - 1); - xatc.start = probe.min_x(); + start = probe.min_x(); + spacing = (probe.max_x() - start) / (XATC_MAX_POINTS - 1); enabled = true; } @@ -45,14 +45,10 @@ void XATC::print_points() { SERIAL_ECHOLNPGM(" X-Twist Correction:"); LOOP_L_N(x, XATC_MAX_POINTS) { SERIAL_CHAR(' '); - if (!isnan(z_offset[x])) { - if (z_offset[x] >= 0) SERIAL_CHAR('+'); - SERIAL_ECHO_F(z_offset[x], 3); - } - else { - LOOP_L_N(i, 6) - SERIAL_CHAR(i ? '=' : ' '); - } + if (!isnan(z_offset[x])) + serial_offset(z_offset[x]); + else + LOOP_L_N(i, 6) SERIAL_CHAR(i ? '=' : ' '); } SERIAL_EOL(); } @@ -63,8 +59,7 @@ float XATC::compensation(const xy_pos_t &raw) { if (!enabled) return 0; if (NEAR_ZERO(spacing)) return 0; float t = (raw.x - start) / spacing; - int i = FLOOR(t); - LIMIT(i, 0, XATC_MAX_POINTS - 2); + const int i = constrain(FLOOR(t), 0, XATC_MAX_POINTS - 2); t -= i; return lerp(t, z_offset[i], z_offset[i + 1]); } diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index a4b9aec01b67..506f367947df 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -98,8 +98,7 @@ void ac_cleanup(TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index)) { void print_signed_float(FSTR_P const prefix, const_float_t f) { SERIAL_ECHOPGM(" "); SERIAL_ECHOF(prefix, AS_CHAR(':')); - if (f >= 0) SERIAL_CHAR('+'); - SERIAL_ECHO_F(f, 2); + serial_offset(f); } /** diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index a150aca41d62..6e331c127383 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -1195,6 +1195,11 @@ class GcodeSuite { static void M1000(); #endif + #if ENABLED(X_AXIS_TWIST_COMPENSATION) + static void M423(); + static void M423_report(const bool forReplay=true); + #endif + #if ENABLED(SDSUPPORT) static void M1001(); #endif diff --git a/Marlin/src/gcode/probe/M423.cpp b/Marlin/src/gcode/probe/M423.cpp new file mode 100644 index 000000000000..fde5aaaf87c9 --- /dev/null +++ b/Marlin/src/gcode/probe/M423.cpp @@ -0,0 +1,99 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * M423.cpp - X-Axis Twist Compensation + */ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(X_AXIS_TWIST_COMPENSATION) + +#include "../gcode.h" +#include "../../feature/x_twist.h" +#include "../../module/probe.h" + +/** + * M423: Set a Z offset for X-Twist (added to the mesh on future G29). + * M423 [R] [A] [I] [X Z] + * + * R - Reset the twist compensation data + * A - Set the X twist starting X position + * E - Set the X twist ending X position + * I - Set the X twist X-spacing directly + * X - Index of a Z value in the list + * Z - A Z value to set + */ +void GcodeSuite::M423() { + + bool do_report = true; + float new_spacing = 0; + + if (parser.seen_test('R')) { + do_report = false; + xatc.reset(); + } + if (parser.seenval('A')) { + do_report = false; + xatc.start = parser.value_float(); + new_spacing = (probe.max_x() - xatc.start) / (XATC_MAX_POINTS - 1); + } + if (parser.seenval('E')) { + do_report = false; + new_spacing = (parser.value_float() - xatc.start) / (XATC_MAX_POINTS - 1); + } + else if (parser.seenval('I')) { + do_report = false; + new_spacing = parser.value_float(); + } + + if (new_spacing) xatc.spacing = new_spacing; + + if (parser.seenval('X')) { + do_report = false; + const int8_t x = parser.value_int(); + if (!WITHIN(x, 0, XATC_MAX_POINTS - 1)) + SERIAL_ECHOLNPGM("?(X) out of range (0..", XATC_MAX_POINTS - 1, ")."); + else { + if (parser.seenval('Z')) + xatc.z_offset[x] = parser.value_linear_units(); + else + SERIAL_ECHOLNPGM("?(Z) required."); + } + } + + if (do_report) M423_report(); + +} + +void GcodeSuite::M423_report(const bool forReplay/*=true*/) { + report_heading(forReplay, F("X-Twist Correction")); + SERIAL_ECHOLNPGM(" M423 A", xatc.start, " I", xatc.spacing); + LOOP_L_N(x, XATC_MAX_POINTS) { + const float z = xatc.z_offset[x]; + SERIAL_ECHOPGM(" M423 X", x, " Z"); + serial_offset(isnan(z) ? 0 : z); + SERIAL_EOL(); + } +} + +#endif // X_AXIS_TWIST_COMPENSATION diff --git a/Marlin/src/lcd/menu/menu_x_twist.cpp b/Marlin/src/lcd/menu/menu_x_twist.cpp index 93f8de07ad46..ce46053dfc34 100644 --- a/Marlin/src/lcd/menu/menu_x_twist.cpp +++ b/Marlin/src/lcd/menu/menu_x_twist.cpp @@ -153,7 +153,7 @@ void xatc_wizard_goto_next_point() { measured_z = probe.probe_at_point(x, XATC_Y_POSITION, PROBE_PT_STOW); xatc.set_enabled(true); current_position += probe.offset_xy; - current_position.z = XATC_START_Z - probe.offset.z + measured_z; + current_position.z = (XATC_START_Z) - probe.offset.z + measured_z; line_to_current_position(MMM_TO_MMS(XY_PROBE_FEEDRATE)); ui.wait_for_move = false; } diff --git a/Marlin/src/libs/vector_3.cpp b/Marlin/src/libs/vector_3.cpp index 614d2121b893..02945fe6871a 100644 --- a/Marlin/src/libs/vector_3.cpp +++ b/Marlin/src/libs/vector_3.cpp @@ -141,8 +141,7 @@ void matrix_3x3::debug(FSTR_P const title) { if (title) SERIAL_ECHOLNF(title); LOOP_L_N(i, 3) { LOOP_L_N(j, 3) { - if (vectors[i][j] >= 0.0) SERIAL_CHAR('+'); - SERIAL_ECHO_F(vectors[i][j], 6); + serial_offset(vectors[i][j], 2); SERIAL_CHAR(' '); } SERIAL_EOL(); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 2b2e33556523..6eb17d5d2e84 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -277,7 +277,7 @@ typedef struct SettingsDataStruct { // X_AXIS_TWIST_COMPENSATION // #if ENABLED(X_AXIS_TWIST_COMPENSATION) - XATC xatc; // TBD + XATC xatc; // M423 X Z #endif // @@ -901,7 +901,9 @@ void MarlinSettings::postprocess() { // #if ENABLED(X_AXIS_TWIST_COMPENSATION) _FIELD_TEST(xatc); - EEPROM_WRITE(xatc); + EEPROM_WRITE(xatc.spacing); + EEPROM_WRITE(xatc.start); + EEPROM_WRITE(xatc.z_offset); #endif // @@ -1809,7 +1811,10 @@ void MarlinSettings::postprocess() { // X Axis Twist Compensation // #if ENABLED(X_AXIS_TWIST_COMPENSATION) - EEPROM_READ(xatc); + _FIELD_TEST(xatc); + EEPROM_READ(xatc.spacing); + EEPROM_READ(xatc.start); + EEPROM_READ(xatc.z_offset); #endif // @@ -3337,14 +3342,13 @@ void MarlinSettings::reset() { #endif - // TODO: Create G-code for settings - //#if ENABLED(X_AXIS_TWIST_COMPENSATION) - // CONFIG_ECHO_START(); - // xatc.print_points(); - //#endif - #endif // HAS_LEVELING + // + // X Axis Twist Compensation + // + TERN_(X_AXIS_TWIST_COMPENSATION, gcode.M423_report(forReplay)); + // // Editable Servo Angles // diff --git a/ini/features.ini b/ini/features.ini index 48b6a2c47af4..8e45b71e4218 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -98,7 +98,7 @@ USB_FLASH_DRIVE_SUPPORT = src_filter=+ + AUTO_BED_LEVELING_BILINEAR = src_filter=+ AUTO_BED_LEVELING_(3POINT|(BI)?LINEAR) = src_filter=+ -X_AXIS_TWIST_COMPENSATION = src_filter=+ + +X_AXIS_TWIST_COMPENSATION = src_filter=+ + + MESH_BED_LEVELING = src_filter=+ + AUTO_BED_LEVELING_UBL = src_filter=+ + UBL_HILBERT_CURVE = src_filter=+ diff --git a/platformio.ini b/platformio.ini index 9b64bdd377d5..0e50da2b7392 100644 --- a/platformio.ini +++ b/platformio.ini @@ -150,7 +150,7 @@ default_src_filter = + - - + - - - - - - + - - - - - From 7dae720de5c4fdea5fab657c09a2c8ba66f5a054 Mon Sep 17 00:00:00 2001 From: GatCode Date: Sat, 12 Mar 2022 00:56:31 +0100 Subject: [PATCH 156/502] =?UTF-8?q?=F0=9F=93=8C=20Fix,=20extend=20Index=20?= =?UTF-8?q?Rev03=20Mobo=20(#23851)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/SanityCheck.h | 4 +- Marlin/src/pins/stm32f4/pins_INDEX_REV03.h | 96 ++++++++++++++++------ 2 files changed, 72 insertions(+), 28 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 83d37f22df5a..a94846275e44 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2183,9 +2183,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Test Sensor & Heater pin combos. * Pins and Sensor IDs must be set for each heater */ -#if !ANY_PIN(TEMP_0, TEMP_0_CS) +#if HAS_EXTRUDERS && !ANY_PIN(TEMP_0, TEMP_0_CS) #error "TEMP_0_PIN or TEMP_0_CS_PIN not defined for this board." -#elif !HAS_HEATER_0 && EXTRUDERS +#elif HAS_EXTRUDERS && !HAS_HEATER_0 #error "HEATER_0_PIN not defined for this board." #elif TEMP_SENSOR_0_IS_MAX_TC && !PIN_EXISTS(TEMP_0_CS) #error "TEMP_SENSOR_0 MAX thermocouple requires TEMP_0_CS_PIN." diff --git a/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h b/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h index a9828c5bdaef..977f4763437c 100644 --- a/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h +++ b/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h @@ -60,12 +60,12 @@ // None of these require limit switches by default, so we leave these commented // here for your reference. -// #define I_MIN_PIN PA8 -// #define I_MAX_PIN PA8 -// #define J_MIN_PIN PD13 -// #define J_MAX_PIN PD13 -// #define K_MIN_PIN PC9 -// #define K_MAX_PIN PC9 +//#define I_MIN_PIN PA8 +//#define I_MAX_PIN PA8 +//#define J_MIN_PIN PD13 +//#define J_MAX_PIN PD13 +//#define K_MIN_PIN PC9 +//#define K_MAX_PIN PC9 // // Steppers @@ -73,47 +73,81 @@ #define X_STEP_PIN PB15 #define X_DIR_PIN PB14 #define X_ENABLE_PIN PD9 -#define X_SERIAL_TX_PIN PD8 -#define X_SERIAL_RX_PIN PD8 #define Y_STEP_PIN PE15 #define Y_DIR_PIN PE14 #define Y_ENABLE_PIN PB13 -#define Y_SERIAL_TX_PIN PB12 -#define Y_SERIAL_RX_PIN PB12 #define Z_STEP_PIN PE7 #define Z_DIR_PIN PB1 #define Z_ENABLE_PIN PE9 -#define Z_SERIAL_TX_PIN PE8 -#define Z_SERIAL_RX_PIN PE8 #define I_STEP_PIN PC4 #define I_DIR_PIN PA4 #define I_ENABLE_PIN PB0 -#define I_SERIAL_TX_PIN PC5 -#define I_SERIAL_RX_PIN PC5 #define J_STEP_PIN PE11 #define J_DIR_PIN PE10 #define J_ENABLE_PIN PE13 -#define J_SERIAL_TX_PIN PE12 -#define J_SERIAL_RX_PIN PE12 -#define K_SERIAL_TX_PIN PA2 -#define K_SERIAL_RX_PIN PA2 #define K_STEP_PIN PD6 #define K_DIR_PIN PD7 #define K_ENABLE_PIN PA3 -// Reduce baud rate to improve software serial reliability -#define TMC_BAUD_RATE 19200 +#if HAS_TMC_SPI + /** + * Make sure to configure the jumpers on the back side of the Mobo according to + * this diagram: https://github.com/MarlinFirmware/Marlin/pull/23851 + */ + #error "SPI drivers require a custom jumper configuration, see comment above! Comment out this line to continue." + + #if AXIS_HAS_SPI(X) + #define X_CS_PIN PD8 + #endif + #if AXIS_HAS_SPI(Y) + #define Y_CS_PIN PB12 + #endif + #if AXIS_HAS_SPI(Z) + #define Z_CS_PIN PE8 + #endif + #if AXIS_HAS_SPI(I) + #define I_CS_PIN PC5 + #endif + #if AXIS_HAS_SPI(J) + #define J_CS_PIN PE12 + #endif + #if AXIS_HAS_SPI(K) + #define K_CS_PIN PA2 + #endif + +#elif HAS_TMC_UART + + #define X_SERIAL_TX_PIN PD8 + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + + #define Y_SERIAL_TX_PIN PB12 + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + + #define Z_SERIAL_TX_PIN PE8 + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + + #define I_SERIAL_TX_PIN PC5 + #define I_SERIAL_RX_PIN I_SERIAL_TX_PIN + + #define J_SERIAL_TX_PIN PE12 + #define J_SERIAL_RX_PIN J_SERIAL_TX_PIN + + #define K_SERIAL_TX_PIN PA2 + #define K_SERIAL_RX_PIN K_SERIAL_TX_PIN + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 + +#endif -// Not required for this board. Fails to compile otherwise. -// PD0 is not connected on this board. -#define TEMP_0_PIN PD0 - -// General use mosfets, useful for things like pumps and solenoids +// +// Heaters / Fans +// #define FAN_PIN PE2 #define FAN1_PIN PE3 #define FAN2_PIN PE4 @@ -121,16 +155,26 @@ #define FAN_SOFT_PWM_REQUIRED -// Neopixel Rings +// +// Neopixel +// #define NEOPIXEL_PIN PC7 #define NEOPIXEL2_PIN PC8 +// // SPI +// #define MISO_PIN PB4 #define MOSI_PIN PB5 #define SCK_PIN PB3 +#define TMC_SW_MISO MISO_PIN +#define TMC_SW_MOSI MOSI_PIN +#define TMC_SW_SCK SCK_PIN + +// // I2C +// #define I2C_SDA_PIN PB7 #define I2C_SCL_PIN PB6 From 61fb3828688c377178031142ba9cfaa3512cb915 Mon Sep 17 00:00:00 2001 From: kisslorand <50251547+kisslorand@users.noreply.github.com> Date: Sat, 12 Mar 2022 02:21:08 +0200 Subject: [PATCH 157/502] =?UTF-8?q?=F0=9F=9A=B8=20M401=20H=20-=20Report=20?= =?UTF-8?q?BLTouch=20HS=20State=20(#23724)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/probe/M401_M402.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/probe/M401_M402.cpp b/Marlin/src/gcode/probe/M401_M402.cpp index 7cbae76f4b88..33895749193f 100644 --- a/Marlin/src/gcode/probe/M401_M402.cpp +++ b/Marlin/src/gcode/probe/M401_M402.cpp @@ -36,12 +36,18 @@ * M401: Deploy and activate the Z probe * * With BLTOUCH_HS_MODE: + * H Report the current BLTouch HS mode state and exit * S Set High Speed (HS) Mode and exit without deploy */ void GcodeSuite::M401() { - if (parser.seen('S')) { + const bool seenH = parser.seen_test('H'), + seenS = parser.seen('S'); + if (seenH || seenS) { #ifdef BLTOUCH_HS_MODE - bltouch.high_speed_mode = parser.value_bool(); + if (seenS) bltouch.high_speed_mode = parser.value_bool(); + SERIAL_ECHO_START(); + SERIAL_ECHOPGM("BLTouch HS mode "); + serialprintln_onoff(bltouch.high_speed_mode); #endif } else { From 16271377e2a00c2cd416ec21e5a21272e9f805ed Mon Sep 17 00:00:00 2001 From: BIGTREETECH <38851044+bigtreetech@users.noreply.github.com> Date: Sat, 12 Mar 2022 08:23:18 +0800 Subject: [PATCH 158/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20STM?= =?UTF-8?q?32G0Bx=20:=20Use=20PLLQ=20for=20USB=20clock=20(#23870)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../variant_MARLIN_STM32G0B1RE.cpp | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp index e53fb4182c2e..8af7150dc781 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp +++ b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp @@ -115,11 +115,11 @@ extern "C" { * AHB Prescaler = 1 * APB1 Prescaler = 1 * PLL_M = 1 - * PLL_N = 16 - * PLL_R = 2 + * PLL_N = 24 + * PLL_R = 3 * PLL_P = 2 - * PLL_Q = 2 - * USB(Hz) = 48000000 (HSI48M) + * PLL_Q = 4 + * USB(Hz) = 48000000 (PLLQ) * @param None * @retval None */ @@ -129,22 +129,31 @@ WEAK void SystemClock_Config(void) RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; + // Reset clock registers (in case bootloader has changed them) + RCC->CR |= RCC_CR_HSION; + while (!(RCC->CR & RCC_CR_HSIRDY)) + ; + RCC->CFGR = 0x00000000; + RCC->CR = RCC_CR_HSION; + while (RCC->CR & RCC_CR_PLLRDY) + ; + RCC->PLLCFGR = 0x00001000; + /** Configure the main internal regulator output voltage */ HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1); /** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDef structure. */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE|RCC_OSCILLATORTYPE_HSI48; + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1; - RCC_OscInitStruct.PLL.PLLN = 16; + RCC_OscInitStruct.PLL.PLLN = 24; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; - RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; + RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV4; + RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV3; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); @@ -164,7 +173,7 @@ WEAK void SystemClock_Config(void) /** Initializes the peripherals clocks */ PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB; - PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48; + PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { Error_Handler(); From 4817efcf81d353032b2873dc958ec63bcb298d19 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 12 Mar 2022 15:58:28 -0600 Subject: [PATCH 159/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Add?= =?UTF-8?q?=20ExtUI::onLevelingDone,=20match=20DWIN=20to=20ExtUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 1 + Marlin/src/gcode/bedlevel/abl/G29.cpp | 10 ++-- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 5 +- Marlin/src/gcode/calibrate/G28.cpp | 6 +-- Marlin/src/gcode/sd/M1001.cpp | 2 +- Marlin/src/lcd/e3v2/creality/dwin.cpp | 4 +- Marlin/src/lcd/e3v2/creality/dwin.h | 6 +-- Marlin/src/lcd/e3v2/proui/dwin.cpp | 8 ++-- Marlin/src/lcd/e3v2/proui/dwin.h | 8 ++-- .../extui/anycubic_chiron/chiron_extui.cpp | 11 +++-- .../lcd/extui/anycubic_chiron/chiron_tft.cpp | 48 +++++++++++-------- .../extui/anycubic_i3mega/anycubic_extui.cpp | 7 +-- Marlin/src/lcd/extui/dgus/dgus_extui.cpp | 7 +-- .../dgus_reloaded/dgus_reloaded_extui.cpp | 7 +-- Marlin/src/lcd/extui/example/example.cpp | 7 +-- .../ftdi_eve_touch_ui/ftdi_eve_extui.cpp | 7 +-- Marlin/src/lcd/extui/malyan/malyan_extui.cpp | 7 +-- .../src/lcd/extui/nextion/nextion_extui.cpp | 7 +-- Marlin/src/lcd/extui/ui_api.h | 7 +-- 19 files changed, 94 insertions(+), 71 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 023d0c5b1d63..f62e83e07002 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -1219,6 +1219,7 @@ void unified_bed_leveling::restore_ubl_active_state_and_leave() { } #endif set_bed_leveling_enabled(ubl_state_at_invocation); + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); } mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 33f45e1c9f26..1868c636ee36 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -419,12 +419,13 @@ G29_TYPE GcodeSuite::G29() { planner.synchronize(); + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); + #if ENABLED(AUTO_BED_LEVELING_3POINT) if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling"); points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - TERN_(EXTENSIBLE_UI, ExtUI::onMeshLevelingStart()); - TERN_(DWIN_LCD_PROUI, DWIN_MeshLevelingStart()); + TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_LevelingStart()); #endif if (!faux) { @@ -577,6 +578,7 @@ G29_TYPE GcodeSuite::G29() { SERIAL_ECHOLNPGM("Grid probing done."); // Re-enable software endstops, if needed SET_SOFT_ENDSTOP_LOOSE(false); + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); } #elif ENABLED(AUTO_BED_LEVELING_3POINT) @@ -606,6 +608,8 @@ G29_TYPE GcodeSuite::G29() { abl.reenable = false; } + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); + } #endif // AUTO_BED_LEVELING_3POINT @@ -899,7 +903,7 @@ G29_TYPE GcodeSuite::G29() { process_subcommands_now(F(Z_PROBE_END_SCRIPT)); #endif - TERN_(HAS_DWIN_E3V2_BASIC, DWIN_CompletedLeveling()); + TERN_(HAS_DWIN_E3V2_BASIC, DWIN_LevelingDone()); TERN_(HAS_MULTI_HOTEND, if (abl.tool_index != 0) tool_change(abl.tool_index)); diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 3767cef3cfbf..f262546d6193 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -104,8 +104,8 @@ void GcodeSuite::G29() { mbl_probe_index = 0; if (!ui.wait_for_move) { queue.inject(parser.seen_test('N') ? F("G28" TERN(CAN_SET_LEVELING_AFTER_G28, "L0", "") "\nG29S2") : F("G29S2")); - TERN_(EXTENSIBLE_UI, ExtUI::onMeshLevelingStart()); - TERN_(DWIN_LCD_PROUI, DWIN_MeshLevelingStart()); + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); + TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart()); return; } state = MeshNext; @@ -168,6 +168,7 @@ void GcodeSuite::G29() { #endif TERN_(LCD_BED_LEVELING, ui.wait_for_move = false); + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); } break; diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index dbbea79353a5..9361790d74cf 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -239,7 +239,7 @@ void GcodeSuite::G28() { set_and_report_grblstate(M_HOMING); #endif - TERN_(HAS_DWIN_E3V2_BASIC, DWIN_StartHoming()); + TERN_(HAS_DWIN_E3V2_BASIC, DWIN_HomingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart()); planner.synchronize(); // Wait for planner moves to finish! @@ -552,8 +552,8 @@ void GcodeSuite::G28() { ui.refresh(); - TERN_(HAS_DWIN_E3V2_BASIC, DWIN_CompletedHoming()); - TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete()); + TERN_(HAS_DWIN_E3V2_BASIC, DWIN_HomingDone()); + TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone()); report_current_position(); diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 87de89a68207..197177882c31 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -108,7 +108,7 @@ void GcodeSuite::M1001() { process_subcommands_now(F(SD_FINISHED_RELEASECOMMAND)); #endif - TERN_(EXTENSIBLE_UI, ExtUI::onPrintFinished()); + TERN_(EXTENSIBLE_UI, ExtUI::onPrintDone()); TERN_(DWIN_LCD_PROUI, DWIN_Print_Finished()); // Re-select the last printed file in the UI diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 7dc06d00f2aa..05ac38d226ce 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -4281,7 +4281,7 @@ void DWIN_HandleScreen() { } } -void DWIN_CompletedHoming() { +void DWIN_HomingDone() { HMI_flag.home_flag = false; dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); if (checkkey == Last_Prepare) { @@ -4297,7 +4297,7 @@ void DWIN_CompletedHoming() { } } -void DWIN_CompletedLeveling() { +void DWIN_LevelingDone() { if (checkkey == Leveling) Goto_MainMenu(); } diff --git a/Marlin/src/lcd/e3v2/creality/dwin.h b/Marlin/src/lcd/e3v2/creality/dwin.h index 3ccb70e52f7a..487f309ed996 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.h +++ b/Marlin/src/lcd/e3v2/creality/dwin.h @@ -243,7 +243,7 @@ void DWIN_HandleScreen(); void DWIN_StatusChanged(const char * const cstr=nullptr); void DWIN_StatusChanged(FSTR_P const fstr); -inline void DWIN_StartHoming() { HMI_flag.home_flag = true; } +inline void DWIN_HomingStart() { HMI_flag.home_flag = true; } -void DWIN_CompletedHoming(); -void DWIN_CompletedLeveling(); +void DWIN_HomingDone(); +void DWIN_LevelingDone(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 0a392cd5636d..95cb0b28b929 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1542,20 +1542,20 @@ void HMI_SaveProcessID(const uint8_t id) { } } -void DWIN_StartHoming() { +void DWIN_HomingStart() { HMI_flag.home_flag = true; HMI_SaveProcessID(Homing); Title.ShowCaption(GET_TEXT_F(MSG_HOMING)); DWIN_Show_Popup(ICON_BLTouch, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); } -void DWIN_CompletedHoming() { +void DWIN_HomingDone() { HMI_flag.home_flag = false; dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); if (HMI_flag.abort_action) DWIN_Print_Aborted(); else HMI_ReturnScreen(); } -void DWIN_MeshLevelingStart() { +void DWIN_LevelingStart() { #if HAS_ONESTEP_LEVELING HMI_SaveProcessID(Leveling); Title.ShowCaption(GET_TEXT_F(MSG_BED_LEVELING)); @@ -1565,7 +1565,7 @@ void DWIN_MeshLevelingStart() { #endif } -void DWIN_CompletedLeveling() { +void DWIN_LevelingDone() { TERN_(HAS_ONESTEP_LEVELING, if (planner.leveling_active) Goto_MeshViewer()); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 9f49fa1825b8..b61ed846dfcb 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -142,13 +142,13 @@ void update_variable(); void DWIN_InitScreen(); void DWIN_HandleScreen(); void DWIN_CheckStatusMessage(); -void DWIN_StartHoming(); -void DWIN_CompletedHoming(); +void DWIN_HomingStart(); +void DWIN_HomingDone(); #if HAS_MESH void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval); #endif -void DWIN_MeshLevelingStart(); -void DWIN_CompletedLeveling(); +void DWIN_LevelingStart(); +void DWIN_LevelingDone(); void DWIN_PidTuning(pidresult_t result); void DWIN_Print_Started(const bool sd=false); void DWIN_Print_Pause(); diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp index 7a58963c11fe..b9fe8f967c0d 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp @@ -57,14 +57,16 @@ namespace ExtUI { void onPrintTimerStarted() { Chiron.TimerEvent(AC_timer_started); } void onPrintTimerPaused() { Chiron.TimerEvent(AC_timer_paused); } - void onPrintTimerStopped() { Chiron.TimerEvent(AC_timer_stopped); } + void onPrintTimerStopped() { Chiron.TimerEvent(AC_timer_stopped); } + void onPrintDone() {} + void onFilamentRunout(const extruder_t) { Chiron.FilamentRunout(); } + void onUserConfirmRequired(const char * const msg) { Chiron.ConfirmationRequest(msg); } void onStatusChanged(const char * const msg) { Chiron.StatusChange(msg); } void onHomingStart() {} - void onHomingComplete() {} - void onPrintFinished() {} + void onHomingDone() {} void onFactoryReset() {} @@ -103,7 +105,8 @@ namespace ExtUI { } #if HAS_MESH - void onMeshLevelingStart() {} + void onLevelingStart() {} + void onLevelingDone() {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { // Called when any mesh points are updated diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp index c56d8aa7fbb3..fac0615cd65b 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp @@ -86,13 +86,23 @@ void ChironTFT::Startup() { TFTSer.begin(115200); // wait for the TFT panel to initialise and finish the animation - delay_ms(250); + safe_delay(1000); // There are different panels for the Chiron with slightly different commands // So we need to know what we are working with. - // Panel type can be defined otherwise detect it automatically - if (panel_type == AC_panel_unknown) DetectPanelType(); + switch (panel_type) { + case AC_panel_new: + SERIAL_ECHOLNF(AC_msg_new_panel_set); + break; + case AC_panel_standard: + SERIAL_ECHOLNF(AC_msg_old_panel_set); + break; + default: + SERIAL_ECHOLNF(AC_msg_auto_panel_detection); + DetectPanelType(); + break; + } // Signal Board has reset SendtoTFTLN(AC_msg_main_board_has_reset); @@ -358,15 +368,14 @@ bool ChironTFT::ReadTFTCommand() { } int8_t ChironTFT::FindToken(char c) { - int8_t pos = 0; - do { + for (int8_t pos = 0; pos < command_len; pos++) { if (panel_command[pos] == c) { #if ACDEBUG(AC_INFO) SERIAL_ECHOLNPGM("Tpos:", pos, " ", c); #endif return pos; } - } while (++pos < command_len); + } #if ACDEBUG(AC_INFO) SERIAL_ECHOLNPGM("Not found: ", c); #endif @@ -623,18 +632,18 @@ void ChironTFT::PanelAction(uint8_t req) { SelectFile(); break; - case 14: { // A14 Start Printing + case 14: // A14 Start Printing // Allows printer to restart the job if we don't want to recover if (printer_state == AC_printer_resuming_from_power_outage) { injectCommands(F("M1000 C")); // Cancel recovery printer_state = AC_printer_idle; } #if ACDebugLevel >= 1 - SERIAL_ECHOLNPAIR_F("Print: ", selectedfile); + SERIAL_ECHOLNPGM("Print: ", selectedfile); #endif printFile(selectedfile); SendtoTFTLN(AC_msg_print_from_sd_card); - } break; + break; case 15: // A15 Resuming from outage if (printer_state == AC_printer_resuming_from_power_outage) { @@ -801,25 +810,22 @@ void ChironTFT::PanelProcess(uint8_t req) { } } break; - case 30: { // A30 Auto leveling + case 30: // A30 Auto leveling if (FindToken('S') != -1) { // Start probing New panel adds spaces.. // Ignore request if printing if (isPrinting()) SendtoTFTLN(AC_msg_probing_not_allowed); // forbid auto leveling else { - - SendtoTFTLN(AC_msg_start_probing); injectCommands(F("G28\nG29")); printer_state = AC_printer_probing; } } - else { + else SendtoTFTLN(AC_msg_start_probing); // Just enter levelling menu - } - } break; + break; - case 31: { // A31 Adjust all Probe Points + case 31: // A31 Adjust all Probe Points // The tokens can occur in different places on the new panel so we need to find it. if (FindToken('C') != -1) { // Restore and apply original offsets @@ -907,18 +913,18 @@ void ChironTFT::PanelProcess(uint8_t req) { } } } - } break; + break; - case 32: { // A32 clean leveling beep flag + case 32: // A32 clean leveling beep flag // Ignore request if printing //if (isPrinting()) break; //injectCommands(F("M500\nM420 S1\nG1 Z10 F240\nG1 X0 Y0 F6000")); //TFTSer.println(); - } break; + break; // A33 firmware info request see PanelInfo() - case 34: { // A34 Adjust single mesh point A34 C/S X1 Y1 V123 + case 34: // A34 Adjust single mesh point A34 C/S X1 Y1 V123 if (panel_command[3] == 'C') { // Restore original offsets injectCommands(F("M501\nM420 S1")); selectedmeshpoint.x = selectedmeshpoint.y = 99; @@ -950,7 +956,7 @@ void ChironTFT::PanelProcess(uint8_t req) { } } } - } break; + break; case 36: // A36 Auto leveling for new TFT bet that was a typo in the panel code! SendtoTFTLN(AC_msg_start_probing); diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp index c0e1b4457897..da8f4e26a0ff 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp @@ -54,8 +54,8 @@ namespace ExtUI { void onStatusChanged(const char * const msg) {} void onHomingStart() {} - void onHomingComplete() {} - void onPrintFinished() {} + void onHomingDone() {} + void onPrintDone() {} void onFactoryReset() {} @@ -95,7 +95,8 @@ namespace ExtUI { #if HAS_MESH - void onMeshLevelingStart() {} + void onLevelingStart() {} + void onLevelingDone() {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { // Called when any mesh points are updated diff --git a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp index 04ba6b95c2c7..0041be82769f 100644 --- a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp +++ b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp @@ -73,8 +73,8 @@ namespace ExtUI { void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); } void onHomingStart() {} - void onHomingComplete() {} - void onPrintFinished() {} + void onHomingDone() {} + void onPrintDone() {} void onFactoryReset() {} @@ -113,7 +113,8 @@ namespace ExtUI { } #if HAS_MESH - void onMeshLevelingStart() {} + void onLevelingStart() {} + void onLevelingDone() {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { // Called when any mesh points are updated diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp index 61b072a3f783..5c330bd6b472 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp @@ -83,8 +83,8 @@ namespace ExtUI { } void onHomingStart() {} - void onHomingComplete() {} - void onPrintFinished() {} + void onHomingDone() {} + void onPrintDone() {} void onFactoryReset() { dgus_screen_handler.SettingsReset(); @@ -109,7 +109,8 @@ namespace ExtUI { } #if HAS_MESH - void onMeshLevelingStart() {} + void onLevelingStart() {} + void onLevelingDone() {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { dgus_screen_handler.MeshUpdate(xpos, ypos); diff --git a/Marlin/src/lcd/extui/example/example.cpp b/Marlin/src/lcd/extui/example/example.cpp index 8f38d2aba6d8..dd0f8e401e91 100644 --- a/Marlin/src/lcd/extui/example/example.cpp +++ b/Marlin/src/lcd/extui/example/example.cpp @@ -59,8 +59,8 @@ namespace ExtUI { void onStatusChanged(const char * const msg) {} void onHomingStart() {} - void onHomingComplete() {} - void onPrintFinished() {} + void onHomingDone() {} + void onPrintDone() {} void onFactoryReset() {} @@ -99,7 +99,8 @@ namespace ExtUI { } #if HAS_MESH - void onMeshLevelingStart() {} + void onLevelingStart() {} + void onLevelingDone() {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { // Called when any mesh points are updated diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp index f2ee1e5639e4..1c7b3621f2b4 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp @@ -80,7 +80,7 @@ namespace ExtUI { } void onPrintTimerPaused() {} - void onPrintFinished() {} + void onPrintDone() {} void onFilamentRunout(const extruder_t extruder) { char lcd_msg[30]; @@ -90,7 +90,7 @@ namespace ExtUI { } void onHomingStart() {} - void onHomingComplete() {} + void onHomingDone() {} void onFactoryReset() { InterfaceSettingsScreen::defaultSettings(); } void onStoreSettings(char *buff) { InterfaceSettingsScreen::saveSettings(buff); } @@ -118,7 +118,8 @@ namespace ExtUI { } #if HAS_LEVELING && HAS_MESH - void onMeshLevelingStart() {} + void onLevelingStart() {} + void onLevelingDone() {} void onMeshUpdate(const int8_t x, const int8_t y, const_float_t val) { BedMeshViewScreen::onMeshUpdate(x, y, val); } void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) { BedMeshViewScreen::onMeshUpdate(x, y, state); } #endif diff --git a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp index f323728e2747..2d36a4e737dc 100644 --- a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp @@ -141,8 +141,8 @@ namespace ExtUI { void onFilamentRunout(const extruder_t extruder) {} void onUserConfirmRequired(const char * const) {} void onHomingStart() {} - void onHomingComplete() {} - void onPrintFinished() {} + void onHomingDone() {} + void onPrintDone() {} void onFactoryReset() {} void onStoreSettings(char*) {} void onLoadSettings(const char*) {} @@ -151,7 +151,8 @@ namespace ExtUI { void onConfigurationStoreRead(bool) {} #if HAS_MESH - void onMeshLevelingStart() {} + void onLevelingStart() {} + void onLevelingDone() {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {} #endif diff --git a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp index c19d3aee46f0..c15175a28d9a 100644 --- a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp +++ b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp @@ -50,8 +50,8 @@ namespace ExtUI { void onStatusChanged(const char * const msg) { nextion.StatusChange(msg); } void onHomingStart() {} - void onHomingComplete() {} - void onPrintFinished() { nextion.PrintFinished(); } + void onHomingDone() {} + void onPrintDone() { nextion.PrintFinished(); } void onFactoryReset() {} @@ -90,7 +90,8 @@ namespace ExtUI { } #if HAS_MESH - void onMeshLevelingStart() {} + void onLevelingStart() {} + void onLevelingDone() {} void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) { // Called when any mesh points are updated diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 6753c53740f8..b575684a039d 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -172,7 +172,8 @@ namespace ExtUI { float getMeshPoint(const xy_uint8_t &pos); void setMeshPoint(const xy_uint8_t &pos, const_float_t zval); void moveToMeshPoint(const xy_uint8_t &pos, const_float_t z); - void onMeshLevelingStart(); + void onLevelingStart(); + void onLevelingDone(); void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval); inline void onMeshUpdate(const xy_int8_t &pos, const_float_t zval) { onMeshUpdate(pos.x, pos.y, zval); } @@ -403,14 +404,14 @@ namespace ExtUI { void onPrintTimerStarted(); void onPrintTimerPaused(); void onPrintTimerStopped(); - void onPrintFinished(); + void onPrintDone(); void onFilamentRunout(const extruder_t extruder); void onUserConfirmRequired(const char * const msg); void onUserConfirmRequired(FSTR_P const fstr); void onStatusChanged(const char * const msg); void onStatusChanged(FSTR_P const fstr); void onHomingStart(); - void onHomingComplete(); + void onHomingDone(); void onSteppersDisabled(); void onSteppersEnabled(); void onFactoryReset(); From 2c3f2a14715665d7309e212bfd2a48240118e627 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 12 Mar 2022 15:59:01 -0600 Subject: [PATCH 160/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20UBL=20'G29=20Q1'?= =?UTF-8?q?=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index f62e83e07002..0d00296b5b60 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -367,13 +367,13 @@ void unified_bed_leveling::G29() { case 1: LOOP_L_N(x, GRID_MAX_POINTS_X) { // Create a diagonal line several Mesh cells thick that is raised + const uint8_t x2 = x + (x < (GRID_MAX_POINTS_Y) - 1 ? 1 : -1); z_values[x][x] += 9.999f; - z_values[x][x + (x < (GRID_MAX_POINTS_Y) - 1) ? 1 : -1] += 9.999f; // We want the altered line several mesh points thick + z_values[x][x2] += 9.999f; // We want the altered line several mesh points thick #if ENABLED(EXTENSIBLE_UI) ExtUI::onMeshUpdate(x, x, z_values[x][x]); - ExtUI::onMeshUpdate(x, (x + (x < (GRID_MAX_POINTS_Y) - 1) ? 1 : -1), z_values[x][x + (x < (GRID_MAX_POINTS_Y) - 1) ? 1 : -1]); + ExtUI::onMeshUpdate(x, (x2), z_values[x][x2]); #endif - } break; From f82b13359520baf4da4e41aa85ed0fe3f8d31173 Mon Sep 17 00:00:00 2001 From: Ludy Date: Sun, 13 Mar 2022 00:36:23 +0100 Subject: [PATCH 161/502] =?UTF-8?q?=F0=9F=8C=90=20Fix,=20add=20some=20menu?= =?UTF-8?q?=20labels=20(#23895)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_de.h | 5 +++++ Marlin/src/lcd/language/language_en.h | 3 ++- Marlin/src/lcd/language/language_fr.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index bf408d436f12..393d5b58bc1a 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -135,6 +135,7 @@ namespace Language_de { LSTR MSG_BED_LEVELING = _UxGT("Bett-Nivellierung"); LSTR MSG_LEVEL_BED = _UxGT("Bett nivellieren"); LSTR MSG_BED_TRAMMING = _UxGT("Bett ausrichten"); + LSTR MSG_BED_TRAMMING_MANUAL = _UxGT("Manuelles ausrichten"); LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Das Bett anpassen, bis zum auslösen."); LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Ecken in der Toleranz. Bett ausger."); LSTR MSG_BED_TRAMMING_GOOD_POINTS = _UxGT("Gute Punkte: "); @@ -389,6 +390,7 @@ namespace Language_de { LSTR MSG_CONTRAST = _UxGT("LCD-Kontrast"); LSTR MSG_BRIGHTNESS = _UxGT("LCD Helligkeit"); LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD-Ruhezustand (s)"); + LSTR MSG_BRIGHTNESS_OFF = _UxGT("LCD ausschalten"); LSTR MSG_STORE_EEPROM = _UxGT("Konfig. speichern"); LSTR MSG_LOAD_EEPROM = _UxGT("Konfig. laden"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Standardwerte laden"); @@ -415,6 +417,8 @@ namespace Language_de { LSTR MSG_BUTTON_RESET = _UxGT("Reseten"); LSTR MSG_BUTTON_IGNORE = _UxGT("Ignorieren"); LSTR MSG_BUTTON_CANCEL = _UxGT("Abbrechen"); + LSTR MSG_BUTTON_CONFIRM = _UxGT("Bestätigen"); + LSTR MSG_BUTTON_CONTINUE = _UxGT("Fortsetzen"); LSTR MSG_BUTTON_DONE = _UxGT("Fertig"); LSTR MSG_BUTTON_BACK = _UxGT("Zurück"); LSTR MSG_BUTTON_PROCEED = _UxGT("Weiter"); @@ -424,6 +428,7 @@ namespace Language_de { LSTR MSG_BUTTON_PAUSE = _UxGT("Pause"); LSTR MSG_BUTTON_RESUME = _UxGT("Fortsetzen"); LSTR MSG_BUTTON_ADVANCED = _UxGT("Erweitert"); + LSTR MSG_BUTTON_SAVE = _UxGT("Speichern"); LSTR MSG_PAUSING = _UxGT("Pause..."); LSTR MSG_PAUSE_PRINT = _UxGT("SD-Druck pausieren"); LSTR MSG_ADVANCED_PAUSE = _UxGT("Erweiterte Pause"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 7fe5c2227158..43bbd90210fd 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -403,7 +403,8 @@ namespace Language_en { LSTR MSG_ADVANCE_K_E = _UxGT("Advance K *"); LSTR MSG_CONTRAST = _UxGT("LCD Contrast"); LSTR MSG_BRIGHTNESS = _UxGT("LCD Brightness"); - LSTR MSG_BRIGHTNESS_OFF = _UxGT("Turn Off LCD"); + LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD Timeout (s)"); + LSTR MSG_BRIGHTNESS_OFF = _UxGT("Backlight Off"); LSTR MSG_STORE_EEPROM = _UxGT("Store Settings"); LSTR MSG_LOAD_EEPROM = _UxGT("Load Settings"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Restore Defaults"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 02f9d2f54994..ca3757f704d6 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -336,6 +336,7 @@ namespace Language_fr { LSTR MSG_BRIGHTNESS = _UxGT("Luminosité LCD"); LSTR MSG_CONTRAST = _UxGT("Contraste LCD"); LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("Veille LCD (s)"); + LSTR MSG_BRIGHTNESS_OFF = _UxGT("Éteindre l'écran LCD"); LSTR MSG_STORE_EEPROM = _UxGT("Enregistrer config."); LSTR MSG_LOAD_EEPROM = _UxGT("Charger config."); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Restaurer défauts"); From c49f26a7ae6499f4e19dc1f75bb4438cb0d549cf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 12 Mar 2022 16:34:58 -0600 Subject: [PATCH 162/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20=20?= =?UTF-8?q?Add=20standard=20BUZZ=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/mmu/mmu2.cpp | 45 ++++++++++++------------- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 3 +- Marlin/src/gcode/geometry/M206_M428.cpp | 5 ++- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 14 ++------ Marlin/src/lcd/e3v2/proui/dwin.cpp | 12 +------ Marlin/src/lcd/menu/menu.cpp | 6 +--- Marlin/src/libs/buzzer.h | 5 +++ Marlin/src/module/printcounter.cpp | 2 +- Marlin/src/module/probe.cpp | 3 +- 9 files changed, 36 insertions(+), 59 deletions(-) diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp index 2813337c635b..28dea681ef47 100644 --- a/Marlin/src/feature/mmu/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -143,6 +143,8 @@ uint8_t MMU2::get_current_tool() { #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE) #endif +inline void ATTN_BUZZ(const bool two=false) { BUZZ(200, 404); if (two) { BUZZ(10, 0); BUZZ(200, 404); } } + void MMU2::mmu_loop() { switch (state) { @@ -525,7 +527,7 @@ static void mmu2_not_responding() { while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); load_filament_to_nozzle(index); #else - BUZZ(400, 40); + ERR_BUZZ(); #endif } break; @@ -544,7 +546,7 @@ static void mmu2_not_responding() { active_extruder = 0; } #else - BUZZ(400, 40); + ERR_BUZZ(); #endif } break; @@ -613,7 +615,7 @@ static void mmu2_not_responding() { while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); load_filament_to_nozzle(index); #else - BUZZ(400, 40); + ERR_BUZZ(); #endif } break; @@ -633,7 +635,7 @@ static void mmu2_not_responding() { extruder = index; active_extruder = 0; #else - BUZZ(400, 40); + ERR_BUZZ(); #endif } break; @@ -707,7 +709,7 @@ static void mmu2_not_responding() { while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); load_filament_to_nozzle(index); #else - BUZZ(400, 40); + ERR_BUZZ(); #endif } break; @@ -726,7 +728,7 @@ static void mmu2_not_responding() { extruder = index; active_extruder = 0; #else - BUZZ(400, 40); + ERR_BUZZ(); #endif } break; @@ -811,25 +813,21 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { if (turn_off_nozzle && resume_hotend_temp) { thermalManager.setTargetHotend(resume_hotend_temp, active_extruder); LCD_MESSAGE(MSG_HEATING); - BUZZ(200, 40); + ERR_BUZZ(); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(1000); } - if (move_axes && all_axes_homed()) { - LCD_MESSAGE(MSG_MMU2_RESUMING); - BUZZ(198, 404); BUZZ(4, 0); BUZZ(198, 404); + LCD_MESSAGE(MSG_MMU2_RESUMING); + ATTN_BUZZ(true); + if (move_axes && all_axes_homed()) { // Move XY to starting position, then Z do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE)); // Move Z_AXIS to saved position do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); } - else { - BUZZ(198, 404); BUZZ(4, 0); BUZZ(198, 404); - LCD_MESSAGE(MSG_MMU2_RESUMING); - } } } } @@ -898,7 +896,7 @@ void MMU2::load_filament(const uint8_t index) { command(MMU_CMD_L0 + index); manage_response(false, false); - BUZZ(200, 404); + ATTN_BUZZ(); } /** @@ -909,7 +907,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) { if (!_enabled) return false; if (thermalManager.tooColdToExtrude(active_extruder)) { - BUZZ(200, 404); + ATTN_BUZZ(); LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD); return false; } @@ -924,7 +922,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) { extruder = index; active_extruder = 0; load_to_nozzle(); - BUZZ(200, 404); + ATTN_BUZZ(); } return success; } @@ -945,7 +943,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) { if (!_enabled) return false; if (thermalManager.tooColdToExtrude(active_extruder)) { - BUZZ(200, 404); + ATTN_BUZZ(); LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD); return false; } @@ -961,12 +959,11 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) { if (recover) { LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER); - BUZZ(200, 404); + ATTN_BUZZ(); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover"))); TERN_(HAS_RESUME_CONTINUE, wait_for_user_response()); - BUZZ(200, 404); - BUZZ(200, 404); + ATTN_BUZZ(true); command(MMU_CMD_R0); manage_response(false, false); @@ -979,7 +976,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) { set_runout_valid(false); - BUZZ(200, 404); + ATTN_BUZZ(); stepper.disable_extruder(); @@ -994,7 +991,7 @@ bool MMU2::unload() { if (!_enabled) return false; if (thermalManager.tooColdToExtrude(active_extruder)) { - BUZZ(200, 404); + ATTN_BUZZ(); LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD); return false; } @@ -1005,7 +1002,7 @@ bool MMU2::unload() { command(MMU_CMD_U0); manage_response(false, true); - BUZZ(200, 404); + ATTN_BUZZ(); // no active tool extruder = MMU2_NO_TOOL; diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index f262546d6193..f06bfc0fdce1 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -155,8 +155,7 @@ void GcodeSuite::G29() { mbl_probe_index = -1; SERIAL_ECHOLNPGM("Mesh probing done."); TERN_(HAS_STATUS_MESSAGE, LCD_MESSAGE(MSG_MESH_DONE)); - BUZZ(100, 659); - BUZZ(100, 698); + OKAY_BUZZ(); home_all_axes(); set_bed_leveling_enabled(true); diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index 131dbecf3343..b32d72996940 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -92,7 +92,7 @@ void GcodeSuite::M428() { if (!WITHIN(diff[i], -20, 20)) { SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR); LCD_ALERTMESSAGE_F("Err: Too far!"); - BUZZ(200, 40); + ERR_BUZZ(); return; } } @@ -100,8 +100,7 @@ void GcodeSuite::M428() { LOOP_LINEAR_AXES(i) set_home_offset((AxisEnum)i, diff[i]); report_current_position(); LCD_MESSAGE(MSG_HOME_OFFSETS_APPLIED); - BUZZ(100, 659); - BUZZ(100, 698); + OKAY_BUZZ(); } #endif // HAS_M206_COMMAND diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index d384bae3e33c..51df15da739f 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4920,18 +4920,10 @@ void CrealityDWINClass::Screen_Update() { } void CrealityDWINClass::AudioFeedback(const bool success/*=true*/) { - if (success) { - if (ui.buzzer_enabled) { - BUZZ(100, 659); - BUZZ( 10, 0); - BUZZ(100, 698); - } - else Update_Status("Success"); - } - else if (ui.buzzer_enabled) - BUZZ(40, 440); + if (ui.buzzer_enabled) + DONE_BUZZ(success); else - Update_Status("Failed"); + Update_Status(success ? "Success" : "Failed"); } void CrealityDWINClass::Save_Settings(char *buff) { diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 95cb0b28b929..66e90740fdfb 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1285,17 +1285,7 @@ void HMI_Printing() { #include "../../../libs/buzzer.h" -void HMI_AudioFeedback(const bool success/*=true*/) { - #if HAS_BUZZER - if (success) { - BUZZ(100, 659); - BUZZ(10, 0); - BUZZ(100, 698); - } - else - BUZZ(40, 440); - #endif -} +void HMI_AudioFeedback(const bool success/*=true*/) { DONE_BUZZ(success); } void Draw_Main_Area() { switch (checkkey) { diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 2dca6c1b826c..52c43ec5e90f 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -276,11 +276,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { #if HAS_BUZZER void MarlinUI::completion_feedback(const bool good/*=true*/) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); // Wake up on rotary encoder click... - if (good) { - BUZZ(100, 659); - BUZZ(100, 698); - } - else BUZZ(20, 440); + if (good) OKAY_BUZZ(); else ERR_BUZZ(); } #endif diff --git a/Marlin/src/libs/buzzer.h b/Marlin/src/libs/buzzer.h index db5e3ee4ca79..9fc46ff6296c 100644 --- a/Marlin/src/libs/buzzer.h +++ b/Marlin/src/libs/buzzer.h @@ -127,3 +127,8 @@ #define BUZZ(d,f) NOOP #endif + +#define ERR_BUZZ() BUZZ(400, 40); +#define ATTN_BUZZ() do{ BUZZ(198, 404); BUZZ(4, 0); BUZZ(198, 404); }while(0) +#define OKAY_BUZZ() do{ BUZZ(100, 659); BUZZ(10, 0); BUZZ(100, 698); }while(0) +#define DONE_BUZZ(OK) do{ if (OK) OKAY_BUZZ(); else ERR_BUZZ(); }while(0) diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index affb6087802c..c35b722cf4c6 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -151,7 +151,7 @@ void PrintCounter::loadStats() { if (data.nextService3 == 0) doBuzz = _service_warn(PSTR(" " SERVICE_NAME_3)); #endif #if HAS_BUZZER && SERVICE_WARNING_BUZZES > 0 - if (doBuzz) for (int i = 0; i < SERVICE_WARNING_BUZZES; i++) BUZZ(200, 404); + if (doBuzz) for (int i = 0; i < SERVICE_WARNING_BUZZES; i++) { BUZZ(200, 404); BUZZ(10, 0); } #else UNUSED(doBuzz); #endif diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 8793ea49dcf1..ee6323518a2f 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -306,8 +306,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { if (deploy != PROBE_TRIGGERED()) break; #endif - BUZZ(100, 659); - BUZZ(100, 698); + OKAY_BUZZ(); FSTR_P const ds_str = deploy ? GET_TEXT_F(MSG_MANUAL_DEPLOY) : GET_TEXT_F(MSG_MANUAL_STOW); ui.return_to_status(); // To display the new status message From 4028c1cfc7bcaf78e49bb98b527353ec30a970de Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 12 Mar 2022 17:12:21 -0600 Subject: [PATCH 163/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20FSTR=20/=20PSTR=20?= =?UTF-8?q?usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 13 ++++----- .../archim2-flash/flash_storage.cpp | 2 +- .../bioprinter/printing_dialog_box.cpp | 4 +-- .../ftdi_eve_lib/extended/command_processor.h | 6 ++-- .../ftdi_eve_lib/extended/text_box.cpp | 6 ++-- .../ftdi_eve_lib/extended/text_ellipsis.cpp | 29 +++++++++---------- .../ftdi_eve_lib/extended/unicode/unicode.cpp | 12 ++++---- .../base_numeric_adjustment_screen.cpp | 4 +-- .../generic/status_screen.cpp | 4 +-- Marlin/src/lcd/fontutils.h | 1 + Marlin/src/lcd/lcdprint.h | 3 ++ Marlin/src/lcd/menu/menu.h | 4 +-- 12 files changed, 43 insertions(+), 45 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 51df15da739f..3e777d4aaaed 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -958,8 +958,8 @@ void CrealityDWINClass::Update_Status_Bar(bool refresh/*=false*/) { static bool new_msg; static uint8_t msgscrl = 0; static char lastmsg[64]; - if (strcmp_P(lastmsg, statusmsg) != 0 || refresh) { - strcpy_P(lastmsg, statusmsg); + if (strcmp(lastmsg, statusmsg) != 0 || refresh) { + strcpy(lastmsg, statusmsg); msgscrl = 0; new_msg = true; } @@ -4695,10 +4695,7 @@ void CrealityDWINClass::Modify_Option(uint8_t value, const char * const * option /* Main Functions */ 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, PSTR("")) == 0) { + if (strncmp_P(text, PSTR(""), 3) == 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); @@ -4722,10 +4719,10 @@ void CrealityDWINClass::Start_Print(bool sd) { card.selectFileByName(fname); } #endif - strcpy_P(filename, card.longest_filename()); + strcpy(filename, card.longest_filename()); } else - strcpy_P(filename, "Host Print"); + strcpy_P(filename, PSTR("Host Print")); TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(0)); TERN_(USE_M73_REMAINING_TIME, ui.set_remaining_time(0)); Draw_Print_Screen(); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp index 8b0c0f877c2b..dbee1e034b07 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp @@ -421,7 +421,7 @@ bool UIFlashStorage::is_present = false; uint32_t addr; uint8_t buff[write_page_size]; - strcpy_P( (char*) buff, (const char*) filename); + strcpy_P((char*)buff, FTOP(filename)); MediaFileReader reader; if (!reader.open((char*) buff)) { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp index f0c0a59d3658..6d177c5a7b4c 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp @@ -106,8 +106,8 @@ bool BioPrintingDialogBox::onTouchEnd(uint8_t tag) { } void BioPrintingDialogBox::setStatusMessage(FSTR_P message) { - char buff[strlen_P((const char*)message)+1]; - strcpy_P(buff, (const char*) message); + char buff[strlen_P(FTOP(message)) + 1]; + strcpy_P(buff, FTOP(message)); setStatusMessage(buff); } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h index 24e93982c22a..648ed5330a98 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h @@ -242,10 +242,10 @@ class CommandProcessor : public CLCD::CommandFifo { } CommandProcessor& toggle2(int16_t x, int16_t y, int16_t w, int16_t h, FSTR_P no, FSTR_P yes, bool state, uint16_t options = FTDI::OPT_3D) { - char text[strlen_P((const char *)no) + strlen_P((const char *)yes) + 2]; - strcpy_P(text, (const char *)no); + char text[strlen_P(FTOP(no)) + strlen_P(FTOP(yes)) + 2]; + strcpy_P(text, FTOP(no)); strcat(text, "\xFF"); - strcat_P(text, (const char *)yes); + strcat_P(text, FTOP(yes)); return toggle(x, y, w, h, text, state, options); } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp index b4d8156b39d8..c75cdf18121a 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp @@ -135,9 +135,9 @@ namespace FTDI { } } - void draw_text_box(CommandProcessor& cmd, int x, int y, int w, int h, FSTR_P pstr, uint16_t options, uint8_t font) { - char str[strlen_P((const char*)pstr) + 1]; - strcpy_P(str, (const char*)pstr); + void draw_text_box(CommandProcessor& cmd, int x, int y, int w, int h, FSTR_P fstr, uint16_t options, uint8_t font) { + char str[strlen_P(FTOP(fstr)) + 1]; + strcpy_P(str, FTOP(fstr)); draw_text_box(cmd, x, y, w, h, (const char*) str, options, font); } } // namespace FTDI diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp index 698bcdb15062..a6d014b56e3b 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_ellipsis.cpp @@ -33,6 +33,7 @@ namespace FTDI { const bool use_utf8 = has_utf8_chars(str); #define CHAR_WIDTH(c) use_utf8 ? utf8_fm.get_char_width(c) : clcd_fm.char_widths[(uint8_t)c] #else + constexpr bool use_utf8 = false; #define CHAR_WIDTH(c) utf8_fm.get_char_width(c) #endif FontMetrics utf8_fm(font); @@ -53,21 +54,17 @@ namespace FTDI { breakPoint = (char*)next; } - if (lineWidth > w) { - *breakPoint = '\0'; - strcpy_P(breakPoint,PSTR("...")); - } + if (lineWidth > w) + strcpy_P(breakPoint, PSTR("...")); cmd.apply_text_alignment(x, y, w, h, options); - #if ENABLED(TOUCH_UI_USE_UTF8) - if (use_utf8) { - draw_utf8_text(cmd, x, y, str, font_size_t::from_romfont(font), options); - } else - #endif - { - cmd.CLCD::CommandFifo::text(x, y, font, options); - cmd.CLCD::CommandFifo::str(str); - } + if (use_utf8) { + TERN_(TOUCH_UI_USE_UTF8, draw_utf8_text(cmd, x, y, str, font_size_t::from_romfont(font), options)); + } + else { + cmd.CLCD::CommandFifo::text(x, y, font, options); + cmd.CLCD::CommandFifo::str(str); + } } /** @@ -80,9 +77,9 @@ namespace FTDI { _draw_text_with_ellipsis(cmd, x, y, w, h, tmp, options, font); } - void draw_text_with_ellipsis(CommandProcessor& cmd, int x, int y, int w, int h, FSTR_P pstr, uint16_t options, uint8_t font) { - char tmp[strlen_P((const char*)pstr) + 3]; - strcpy_P(tmp, (const char*)pstr); + void draw_text_with_ellipsis(CommandProcessor& cmd, int x, int y, int w, int h, FSTR_P fstr, uint16_t options, uint8_t font) { + char tmp[strlen_P(FTOP(fstr)) + 3]; + strcpy_P(tmp, FTOP(fstr)); _draw_text_with_ellipsis(cmd, x, y, w, h, tmp, options, font); } } // namespace FTDI diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp index ca25dea3ca9d..d428f686b7bb 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -191,9 +191,9 @@ return render_utf8_text(nullptr, 0, 0, str, fs, maxlen); } - uint16_t FTDI::get_utf8_text_width(FSTR_P pstr, font_size_t fs) { - char str[strlen_P((const char*)pstr) + 1]; - strcpy_P(str, (const char*)pstr); + uint16_t FTDI::get_utf8_text_width(FSTR_P fstr, font_size_t fs) { + char str[strlen_P(FTOP(fstr)) + 1]; + strcpy_P(str, FTOP(fstr)); return get_utf8_text_width(str, fs); } @@ -234,9 +234,9 @@ cmd.cmd(RESTORE_CONTEXT()); } - void FTDI::draw_utf8_text(CommandProcessor& cmd, int x, int y, FSTR_P pstr, font_size_t fs, uint16_t options) { - char str[strlen_P((const char*)pstr) + 1]; - strcpy_P(str, (const char*)pstr); + void FTDI::draw_utf8_text(CommandProcessor& cmd, int x, int y, FSTR_P fstr, font_size_t fs, uint16_t options) { + char str[strlen_P(FTOP(fstr)) + 1]; + strcpy_P(str, FTOP(fstr)); draw_utf8_text(cmd, x, y, (const char*) str, fs, options); } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/base_numeric_adjustment_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/base_numeric_adjustment_screen.cpp index 4415ed50fcee..ce3066ae41f2 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/base_numeric_adjustment_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/base_numeric_adjustment_screen.cpp @@ -245,8 +245,8 @@ void BaseNumericAdjustmentScreen::widgets_t::adjuster(uint8_t tag, FSTR_P label, } if (_what & FOREGROUND) { - char b[strlen_P(value)+1]; - strcpy_P(b,value); + char b[strlen(value) + 1]; + strcpy(b, value); adjuster_sram_val(tag, label, b, is_enabled); } } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp index 4e76450683e9..7310577995e5 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp @@ -345,8 +345,8 @@ void StatusScreen::draw_status_message(draw_mode_t what, const char *message) { } void StatusScreen::setStatusMessage(FSTR_P message) { - char buff[strlen_P((const char * const)message)+1]; - strcpy_P(buff, (const char * const) message); + char buff[strlen_P(FTOP(message)) + 1]; + strcpy_P(buff, FTOP(message)); setStatusMessage((const char *) buff); } diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index 3901d4439fde..21aee1e93919 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -63,6 +63,7 @@ uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t /* Returns length of string in CHARACTERS, NOT BYTES */ uint8_t utf8_strlen(const char *pstart); uint8_t utf8_strlen_P(PGM_P pstart); +inline uint8_t utf8_strlen(FSTR_P fstart) { return utf8_strlen_P(FTOP(fstart)); } /* Returns start byte position of desired char number */ uint8_t utf8_byte_pos_by_char_num(const char *pstart, const uint8_t charnum); diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index c701a59568f5..d716d035caf6 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -190,6 +190,9 @@ inline lcd_uint_t lcd_put_u8str_ind_P(const lcd_uint_t col, const lcd_uint_t row lcd_moveto(col, row); return lcd_put_u8str_ind_P(pstr, ind, inStr, maxlen); } +inline lcd_uint_t lcd_put_u8str_ind(FSTR_P const fstr, const int8_t ind, FSTR_P const inFstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { + return lcd_put_u8str_ind_P(FTOP(fstr), ind, FTOP(inFstr), maxlen); +} inline lcd_uint_t lcd_put_u8str_ind(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const fstr, const int8_t ind, FSTR_P const inFstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { return lcd_put_u8str_ind_P(col, row, FTOP(fstr), ind, FTOP(inFstr), maxlen); } diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 72826262f456..b111236d69cd 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -114,8 +114,8 @@ class MenuItem_confirm : public MenuItemBase { selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, FSTR_P const string, PGM_P const suff=nullptr ) { - char str[strlen_P((PGM_P)string) + 1]; - strcpy_P(str, (PGM_P)string); + char str[strlen_P(FTOP(string)) + 1]; + strcpy_P(str, FTOP(string)); select_screen(yes, no, yesFunc, noFunc, pref, str, suff); } // Shortcut for prompt with "NO"/ "YES" labels From 1a76d4d467ebb3d8ed1df39767efa99beb08e854 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 12 Mar 2022 23:47:47 +0000 Subject: [PATCH 164/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Chiron=20new=20TFT?= =?UTF-8?q?=20SD=20print=20after=20reset=20(#23855)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 6 ++-- .../extui/anycubic_chiron/FileNavigator.cpp | 4 +-- .../lcd/extui/anycubic_chiron/chiron_tft.cpp | 30 ++++++++++--------- .../extui/anycubic_chiron/chiron_tft_defs.h | 10 +++++-- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index f06bfc0fdce1..74843235f437 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -118,9 +118,11 @@ void GcodeSuite::G29() { // For each G29 S2... if (mbl_probe_index == 0) { // Move close to the bed before the first point - do_blocking_move_to_z(0.4f + do_blocking_move_to_z( #ifdef MANUAL_PROBE_START_Z - + (MANUAL_PROBE_START_Z) - 0.4f + MANUAL_PROBE_START_Z + #else + 0.4f #endif ); } diff --git a/Marlin/src/lcd/extui/anycubic_chiron/FileNavigator.cpp b/Marlin/src/lcd/extui/anycubic_chiron/FileNavigator.cpp index f49b17acc190..0ef818666837 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/FileNavigator.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/FileNavigator.cpp @@ -155,7 +155,7 @@ void FileNavigator::skiptofileindex(uint16_t skip) { if (currentindex == 0 && currentfolderdepth > 0) { // Add a link to go up a folder // The new panel ignores entries that don't end in .GCO or .gcode so add and pad them. - if (paneltype == AC_panel_new) { + if (paneltype <= AC_panel_new) { TFTSer.println("<<.GCO"); Chiron.SendtoTFTLN(F(".. .gcode")); } @@ -177,7 +177,7 @@ void FileNavigator::skiptofileindex(uint16_t skip) { void FileNavigator::sendFile(panel_type_t paneltype) { if (filelist.isDir()) { // Add mandatory tags for new panel otherwise lines are ignored. - if (paneltype == AC_panel_new) { + if (paneltype <= AC_panel_new) { TFTSer.print(filelist.shortFilename()); TFTSer.println(".GCO"); TFTSer.print(filelist.shortFilename()); diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp index fac0615cd65b..fa85de2a8e84 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp @@ -442,7 +442,7 @@ void ChironTFT::SendFileList(int8_t startindex) { } void ChironTFT::SelectFile() { - if (panel_type == AC_panel_new) { + if (panel_type <= AC_panel_new) { strncpy(selectedfile, panel_command + 4, command_len - 3); selectedfile[command_len - 4] = '\0'; } @@ -465,7 +465,7 @@ void ChironTFT::SelectFile() { break; default: // enter sub folder // for new panel remove the '.GCO' tag that was added to the end of the path - if (panel_type == AC_panel_new) + if (panel_type <= AC_panel_new) selectedfile[strlen(selectedfile) - 4] = '\0'; filenavigator.changeDIR(selectedfile); SendtoTFTLN(AC_msg_sd_file_open_failed); @@ -478,8 +478,8 @@ void ChironTFT::ProcessPanelRequest() { // Break these up into logical blocks // as its easier to navigate than one huge switch case! int8_t tpos = FindToken('A'); // Panel request are 'A0' - 'A36' - if (tpos != -1) { - const int8_t req = atoi(&panel_command[tpos+1]); + if (tpos >= 0) { + const int8_t req = atoi(&panel_command[tpos + 1]); // Information requests A0 - A8 and A33 if (req <= 8 || req == 33) PanelInfo(req); @@ -495,16 +495,18 @@ void ChironTFT::ProcessPanelRequest() { // This may be a response to a panel type detection query if (panel_type == AC_panel_unknown) { tpos = FindToken('S'); // old panel will respond to 'SIZE' with 'SXY 480 320' - if (tpos != -1) { - if (panel_command[tpos+1]== 'X' && panel_command[tpos+2]=='Y') { + if (tpos >= 0) { + if (panel_command[tpos + 1] == 'X' && panel_command[tpos + 2] =='Y') { panel_type = AC_panel_standard; SERIAL_ECHOLNF(AC_msg_old_panel_detected); } } else { - tpos = FindToken('['); // new panel will respond to 'J200' with '[0]=0' - if (tpos != -1) { - if (panel_command[tpos+1]== '0' && panel_command[tpos+2]==']') { + // new panel will respond to 'J200' with '[0]=0' + // it seems only after a power cycle so detection assumes a new panel + tpos = FindToken('['); + if (tpos >= 0) { + if (panel_command[tpos + 1] == '0' && panel_command[tpos + 2] ==']') { panel_type = AC_panel_new; SERIAL_ECHOLNF(AC_msg_new_panel_detected); } @@ -811,7 +813,7 @@ void ChironTFT::PanelProcess(uint8_t req) { } break; case 30: // A30 Auto leveling - if (FindToken('S') != -1) { // Start probing New panel adds spaces.. + if (FindToken('S') >= 0) { // Start probing New panel adds spaces.. // Ignore request if printing if (isPrinting()) SendtoTFTLN(AC_msg_probing_not_allowed); // forbid auto leveling @@ -828,7 +830,7 @@ void ChironTFT::PanelProcess(uint8_t req) { case 31: // A31 Adjust all Probe Points // The tokens can occur in different places on the new panel so we need to find it. - if (FindToken('C') != -1) { // Restore and apply original offsets + if (FindToken('C') >= 0) { // Restore and apply original offsets if (!isPrinting()) { injectCommands(F("M501\nM420 S1")); selectedmeshpoint.x = selectedmeshpoint.y = 99; @@ -836,7 +838,7 @@ void ChironTFT::PanelProcess(uint8_t req) { } } - else if (FindToken('D') != -1) { // Save Z Offset tables and restore leveling state + else if (FindToken('D') >= 0) { // Save Z Offset tables and restore leveling state if (!isPrinting()) { setAxisPosition_mm(1.0,Z); // Lift nozzle before any further movements are made injectCommands(F("M500")); @@ -845,7 +847,7 @@ void ChironTFT::PanelProcess(uint8_t req) { } } - else if (FindToken('G') != -1) { // Get current offset + else if (FindToken('G') >= 0) { // Get current offset SendtoTFT(F("A31V ")); // When printing use the live z Offset position // we will use babystepping to move the print head @@ -859,7 +861,7 @@ void ChironTFT::PanelProcess(uint8_t req) { else { int8_t tokenpos = FindToken('S'); - if (tokenpos != -1) { // Set offset (adjusts all points by value) + if (tokenpos >= 0) { // Set offset (adjusts all points by value) float Zshift = atof(&panel_command[tokenpos+1]); setSoftEndstopState(false); // disable endstops // Allow temporary Z position nudging during print diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft_defs.h b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft_defs.h index 0fd7770cddfb..e3609b5408df 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft_defs.h +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft_defs.h @@ -89,6 +89,10 @@ #define AC_msg_mesh_changes_saved F("Mesh changes saved.") #define AC_msg_old_panel_detected F("Standard TFT panel detected!") #define AC_msg_new_panel_detected F("New TFT panel detected!") +#define AC_msg_auto_panel_detection F("Auto detect panel type (assuming new panel)") +#define AC_msg_old_panel_set F("Set for standard TFT panel.") +#define AC_msg_new_panel_set F("Set for new TFT panel.") + #define AC_msg_powerloss_recovery F("Resuming from power outage! select the same SD file then press resume") // Error messages must not contain spaces #define AC_msg_error_bed_temp F("Abnormal_bed_temp") @@ -161,10 +165,10 @@ namespace Anycubic { AC_menu_change_to_file, AC_menu_change_to_command }; - enum panel_type_t : uint8_t { + enum panel_type_t : uint8_t { // order is important here as we assume new panel if type is unknown AC_panel_unknown, - AC_panel_standard, - AC_panel_new + AC_panel_new, + AC_panel_standard }; enum last_error_t : uint8_t { AC_error_none, From 5d9ab7e71eed56f242d4fae32836f305bb1ff680 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sat, 12 Mar 2022 16:23:29 -0800 Subject: [PATCH 165/502] =?UTF-8?q?=F0=9F=94=A8=20Drop=20extraneous=20buil?= =?UTF-8?q?d=20flag=20(#23862)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/stm32f4.ini | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 9e6e21342730..d7c160d63942 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -298,9 +298,8 @@ extends = env:BIGTREE_OCTOPUS_PRO_V1_F429 platform_packages = ${stm_flash_drive.platform_packages} build_unflags = -DUSBD_USE_CDC build_flags = ${stm_flash_drive.build_flags} - -DSTM32F446_5VX -DUSE_USB_HS_IN_FS - -DUSE_USBHOST_HS -DUSBD_IRQ_PRIO=5 - -DUSBD_IRQ_SUBPRIO=6 + -DUSE_USB_HS_IN_FS -DUSE_USBHOST_HS + -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 -DUSBD_USE_CDC_MSC # From 8257040fafe758ac1913e9bf633fa0c9930dd9cb Mon Sep 17 00:00:00 2001 From: Mathew Winters Date: Sun, 13 Mar 2022 14:13:41 +1300 Subject: [PATCH 166/502] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20G12=20-=20Only=20r?= =?UTF-8?q?equire=20used=20axes=20to=20be=20homed=20(#23422)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/gcode/feature/clean/G12.cpp | 3 ++- Marlin/src/module/motion.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/feature/clean/G12.cpp b/Marlin/src/gcode/feature/clean/G12.cpp index a0b87b1abc9e..999a9b10bd85 100644 --- a/Marlin/src/gcode/feature/clean/G12.cpp +++ b/Marlin/src/gcode/feature/clean/G12.cpp @@ -46,7 +46,8 @@ */ void GcodeSuite::G12() { // Don't allow nozzle cleaning without homing first - if (homing_needed_error()) return; + if (homing_needed_error(linear_bits & ~TERN0(NOZZLE_CLEAN_NO_Z, Z_AXIS) & ~TERN0(NOZZLE_CLEAN_NO_Y, Y_AXIS))) + return; #ifdef WIPE_SEQUENCE_COMMANDS if (!parser.seen_any()) { diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 2fbb4ce11479..1dd6d8c4ede2 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -404,7 +404,7 @@ void set_axis_is_at_home(const AxisEnum axis); constexpr linear_axis_bits_t axis_homed = linear_bits, axis_trusted = linear_bits; // Zero-endstop machines are always homed and trusted inline void homeaxis(const AxisEnum axis) {} inline void set_axis_never_homed(const AxisEnum) {} - inline linear_axis_bits_t axes_should_home(linear_axis_bits_t=linear_bits) { return false; } + inline linear_axis_bits_t axes_should_home(linear_axis_bits_t=linear_bits) { return 0; } inline bool homing_needed_error(linear_axis_bits_t=linear_bits) { return false; } inline void set_axis_unhomed(const AxisEnum axis) {} inline void set_axis_untrusted(const AxisEnum axis) {} From 4ffa88f814f3ddcb7273b73c9bb68773bcf1fd51 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 13 Mar 2022 16:46:08 -0500 Subject: [PATCH 167/502] =?UTF-8?q?=F0=9F=9A=B8=20Test=20LIN=5FADVANCE=20i?= =?UTF-8?q?n=20a=20pins=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/esp32/pins_MRR_ESPE.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index 60c8405dfe2d..9b9b54e3aebe 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -55,7 +55,9 @@ #define I2S_WS 26 #define I2S_BCK 25 #define I2S_DATA 27 -#undef LIN_ADVANCE // Currently, I2S stream does not work with linear advance +#if ENABLED(LIN_ADVANCE) + #error "I2S stream is currently incompatible with LIN_ADVANCE." +#endif // // Steppers From 61b470249c1cfa361f25060940cc8b7f8a8f64e9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 13 Mar 2022 16:59:43 -0500 Subject: [PATCH 168/502] =?UTF-8?q?=F0=9F=93=9D=20Fix=20DEFAULT=5FDUAL=5FX?= =?UTF-8?q?=5FCARRIAGE=5FMODE=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 83a8eaa0fb87..8d9b4dfb3bab 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -822,7 +822,7 @@ // without modifying the firmware (through the "M218 T1 X???" command). // Remember: you should set the second extruder x-offset to 0 in your slicer. - // This is the default power-up mode which can be later using M605. + // This is the default power-up mode which can be changed later using M605 S. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE // Default x offset in duplication mode (typically set to half print bed width) From 8d20c5aadfff34a024665ea349c0b66834e4d305 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sun, 13 Mar 2022 18:00:35 -0400 Subject: [PATCH 169/502] =?UTF-8?q?=F0=9F=93=9D=20Fix=20X2=5FMAX=5FPOS=20c?= =?UTF-8?q?omment=20(#23873)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 19 +++++++++---------- Marlin/src/module/motion.cpp | 23 ++++++++++------------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 8d9b4dfb3bab..d78e63100e6f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -811,16 +811,15 @@ */ //#define DUAL_X_CARRIAGE #if ENABLED(DUAL_X_CARRIAGE) - #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS - #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage - #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage - #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed - #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position - #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. - // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software - // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops - // without modifying the firmware (through the "M218 T1 X???" command). - // Remember: you should set the second extruder x-offset to 0 in your slicer. + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // A max coordinate so the X1 carriage can't hit the parked X2 carriage + #define X2_MIN_POS 80 // A min coordinate so the X2 carriage can't hit the parked X1 carriage + #define X2_MAX_POS 353 // The max position of the X2 carriage, typically also the home position + #define X2_HOME_DIR 1 // Set to 1. The X2 carriage always homes to the max endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // NOTE: For Dual X Carriage use M218 T1 Xn to override the X2_HOME_POS. + // This allows recalibration of endstops distance without a rebuild. + // Remember to set the second extruder's X-offset to 0 in your slicer. // This is the default power-up mode which can be changed later using M605 S. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 4b0c6aba7d35..0f8e02db9e5f 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -125,9 +125,7 @@ xyze_pos_t destination; // {0} ); // Transpose from [XYZ][HOTENDS] to [HOTENDS][XYZ] HOTEND_LOOP() LOOP_ABC(a) hotend_offset[e][a] = tmp[a][e]; - #if ENABLED(DUAL_X_CARRIAGE) - hotend_offset[1].x = _MAX(X2_HOME_POS, X2_MAX_POS); - #endif + TERN_(DUAL_X_CARRIAGE, hotend_offset[1].x = _MAX(X2_HOME_POS, X2_MAX_POS)); } #endif @@ -1116,16 +1114,15 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { bool idex_mirrored_mode = false; // Used in mode 3 float x_home_pos(const uint8_t extruder) { - if (extruder == 0) - return X_HOME_POS; - else - /** - * In dual carriage mode the extruder offset provides an override of the - * second X-carriage position when homed - otherwise X2_HOME_POS is used. - * This allows soft recalibration of the second extruder home position - * without firmware reflash (through the M218 command). - */ - return hotend_offset[1].x > 0 ? hotend_offset[1].x : X2_HOME_POS; + if (extruder == 0) return X_HOME_POS; + + /** + * In dual carriage mode the extruder offset provides an override of the + * second X-carriage position when homed - otherwise X2_HOME_POS is used. + * This allows soft recalibration of the second extruder home position + * (with M218 T1 Xn) without firmware reflash. + */ + return hotend_offset[1].x > 0 ? hotend_offset[1].x : X2_HOME_POS; } void idex_set_mirrored_mode(const bool mirr) { From 62f298aca39ff17bc7a51f49b9ff6b5b17a76c30 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Sun, 13 Mar 2022 23:09:32 +0100 Subject: [PATCH 170/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20ExtUI=20build=20wi?= =?UTF-8?q?th=20Host=20Keepalive=20disabled=20(#23898)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/ui_api.cpp | 6 ++++-- Marlin/src/lcd/extui/ui_api.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index bfcbc39d7bf0..0dad675cb75c 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -389,8 +389,10 @@ namespace ExtUI { return !thermalManager.tooColdToExtrude(extruder - E0); } - GcodeSuite::MarlinBusyState getHostKeepaliveState() { return TERN0(HOST_KEEPALIVE_FEATURE, gcode.busy_state); } - bool getHostKeepaliveIsPaused() { return TERN0(HOST_KEEPALIVE_FEATURE, gcode.host_keepalive_is_paused()); } + #if ENABLED(HOST_KEEPALIVE_FEATURE) + GcodeSuite::MarlinBusyState getHostKeepaliveState() { return gcode.busy_state; } + bool getHostKeepaliveIsPaused() { return gcode.host_keepalive_is_paused(); } + #endif #if HAS_SOFTWARE_ENDSTOPS bool getSoftEndstopState() { return soft_endstop._enabled; } diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index b575684a039d..248bffb6f4ad 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -83,8 +83,10 @@ namespace ExtUI { void injectCommands(char * const); bool commandsInQueue(); - GcodeSuite::MarlinBusyState getHostKeepaliveState(); - bool getHostKeepaliveIsPaused(); + #if ENABLED(HOST_KEEPALIVE_FEATURE) + GcodeSuite::MarlinBusyState getHostKeepaliveState(); + bool getHostKeepaliveIsPaused(); + #endif bool isHeaterIdle(const heater_t); bool isHeaterIdle(const extruder_t); From 1db685593922214e49496d805dc9ea099e227f50 Mon Sep 17 00:00:00 2001 From: Mrnt Date: Sun, 13 Mar 2022 15:17:35 -0700 Subject: [PATCH 171/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20All?= =?UTF-8?q?ow=20DIGIPOT=20Rsx=20/=20Vrefmax=20override=20(#23885)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/digipot/digipot_mcp4018.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index 37853ff428bc..3f2ecbfcdc0b 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -31,9 +31,13 @@ // Settings for the I2C based DIGIPOT (MCP4018) based on WT150 -#define DIGIPOT_A4988_Rsx 0.250 -#define DIGIPOT_A4988_Vrefmax 1.666 -#define DIGIPOT_MCP4018_MAX_VALUE 127 +#ifndef DIGIPOT_A4988_Rsx + #define DIGIPOT_A4988_Rsx 0.250 +#endif +#ifndef DIGIPOT_A4988_Vrefmax + #define DIGIPOT_A4988_Vrefmax 1.666 +#endif +#define DIGIPOT_MCP4018_MAX_VALUE 127 #define DIGIPOT_A4988_Itripmax(Vref) ((Vref) / (8.0 * DIGIPOT_A4988_Rsx)) From 2558b323e85006c3c9f6a03bcaa82f61c95da0bb Mon Sep 17 00:00:00 2001 From: Jelmer van der Stel Date: Sun, 13 Mar 2022 23:20:30 +0100 Subject: [PATCH 172/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20DWIN=20E3V2=20disp?= =?UTF-8?q?lay=20issues=20by=20allowing=20re-init=20(#23879)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_post.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 547ca36e92d3..9942f14eee87 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -459,7 +459,7 @@ #endif -#if PIN_EXISTS(SD_DETECT) && NONE(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI) +#if PIN_EXISTS(SD_DETECT) && NONE(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI, HAS_DWIN_E3V2) #define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion #endif From 2f2a999368f22f2c6b3105ab481987c2025bc50e Mon Sep 17 00:00:00 2001 From: John Robertson Date: Thu, 17 Mar 2022 19:35:33 +0000 Subject: [PATCH 173/502] =?UTF-8?q?=F0=9F=90=9B=20MKS=20TinyBee=20-=202.5V?= =?UTF-8?q?=20ADC=20Vref=20(#23903)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/ESP32/HAL.cpp | 6 +++++- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index 4000dcc90853..c1a44a3dea78 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -229,11 +229,15 @@ void MarlinHAL::adc_init() { } } +#ifndef ADC_REFERENCE_VOLTAGE + #define ADC_REFERENCE_VOLTAGE 3.3 +#endif + void MarlinHAL::adc_start(const pin_t pin) { const adc1_channel_t chan = get_channel(pin); uint32_t mv; esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv); - adc_result = mv * 1023.0 / 3300.0; + adc_result = mv * 1023.0f / float(ADC_REFERENCE_VOLTAGE) / 1000.0f; // Change the attenuation level based on the new reading adc_atten_t atten; diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 122dad214641..68b8ed4ac800 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -113,6 +113,11 @@ //#define E0_AUTO_FAN_PIN 148 // need to update Configuration_adv.h @section extruder //#define E1_AUTO_FAN_PIN 149 // need to update Configuration_adv.h @section extruder +// +// ADC Reference Voltage +// +#define ADC_REFERENCE_VOLTAGE 2.5 // 2.5V reference VDDA + // // MicroSD card // From c87eded8f6183c33bd9b9a74dd577fe6c77c32df Mon Sep 17 00:00:00 2001 From: Ludy Date: Fri, 18 Mar 2022 02:55:33 +0100 Subject: [PATCH 174/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20redundant=20var=20?= =?UTF-8?q?declaration=20(#23913)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/drivers.h | 2 +- Marlin/src/gcode/feature/trinamic/M906.cpp | 2 +- Marlin/src/gcode/feature/trinamic/M911-M914.cpp | 2 +- Marlin/src/gcode/feature/trinamic/M919.cpp | 2 +- Marlin/src/lcd/language/language_de.h | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index 2e66cc920119..ac1f4a155de1 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -200,4 +200,4 @@ #define HAS_L64XX_NOT_L6474 1 #endif -#define AXIS_IS_L64XX(A) (AXIS_DRIVER_TYPE_##A(L6470) || AXIS_DRIVER_TYPE_##A(L6474) || AXIS_DRIVER_TYPE_##A(L6480) || AXIS_DRIVER_TYPE_##A(POWERSTEP01)) +#define AXIS_IS_L64XX(A) (AXIS_DRIVER_TYPE_##A(L6470) || AXIS_DRIVER_TYPE_##A(L6474) || AXIS_DRIVER_TYPE_##A(L6480) || AXIS_DRIVER_TYPE_##A(POWERSTEP01)) diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index 164ff001795a..c85d0be8a19a 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -59,7 +59,7 @@ void GcodeSuite::M906() { #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) const int8_t index = parser.byteval('I', -1); - #else + #elif AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) constexpr int8_t index = -1; #endif diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index 628ae40f4845..b37c81733c7c 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -258,7 +258,7 @@ bool report = true; #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) const int8_t index = parser.byteval('I', -1); - #else + #elif AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) constexpr int8_t index = -1; #endif LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(axis_codes[i])) { diff --git a/Marlin/src/gcode/feature/trinamic/M919.cpp b/Marlin/src/gcode/feature/trinamic/M919.cpp index 4dce28f0ae7d..d4ba4f74eaa1 100644 --- a/Marlin/src/gcode/feature/trinamic/M919.cpp +++ b/Marlin/src/gcode/feature/trinamic/M919.cpp @@ -93,7 +93,7 @@ void GcodeSuite::M919() { #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) const int8_t index = parser.byteval('I'); - #else + #elif AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) constexpr int8_t index = -1; #endif diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 393d5b58bc1a..a6782bb0acc2 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -388,7 +388,7 @@ namespace Language_de { LSTR MSG_ADVANCE_K = _UxGT("Vorschubfaktor"); LSTR MSG_ADVANCE_K_E = _UxGT("Vorschubfaktor *"); LSTR MSG_CONTRAST = _UxGT("LCD-Kontrast"); - LSTR MSG_BRIGHTNESS = _UxGT("LCD Helligkeit"); + LSTR MSG_BRIGHTNESS = _UxGT("LCD-Helligkeit"); LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD-Ruhezustand (s)"); LSTR MSG_BRIGHTNESS_OFF = _UxGT("LCD ausschalten"); LSTR MSG_STORE_EEPROM = _UxGT("Konfig. speichern"); @@ -401,7 +401,7 @@ namespace Language_de { LSTR MSG_SETTINGS_STORED = _UxGT("Einstell. gespei."); LSTR MSG_MEDIA_UPDATE = _UxGT("FW Update vom Medium"); LSTR MSG_RESET_PRINTER = _UxGT("Drucker neustarten"); - LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Aktualisieren"); + LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Aktualisieren"); LSTR MSG_INFO_SCREEN = _UxGT("Info"); LSTR MSG_PREPARE = _UxGT("Vorbereitung"); LSTR MSG_TUNE = _UxGT("Justierung"); From 260b40d1453a9310581c45d3e1327a3103b36a22 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Fri, 18 Mar 2022 03:15:26 +0000 Subject: [PATCH 175/502] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Fix=20noisy=20ADC?= =?UTF-8?q?=20-=2016x=20oversampling=20with=2012-bit=20ADC=20(#23867)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/types.h | 1 + Marlin/src/feature/joystick.cpp | 22 ++-- Marlin/src/lcd/marlinui.cpp | 14 +-- Marlin/src/module/temperature.cpp | 126 ++++++++++----------- Marlin/src/module/temperature.h | 57 +++++----- Marlin/src/module/thermistor/thermistors.h | 16 ++- 6 files changed, 118 insertions(+), 118 deletions(-) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index b95b59565920..53d98e0e6dd2 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -128,6 +128,7 @@ typedef float feedRate_t; // celsius_t is the native unit of temperature. Signed to handle a disconnected thermistor value (-14). // For more resolition (e.g., for a chocolate printer) this may later be changed to Celsius x 100 // +typedef uint16_t raw_adc_t; typedef int16_t celsius_t; typedef float celsius_float_t; diff --git a/Marlin/src/feature/joystick.cpp b/Marlin/src/feature/joystick.cpp index 7f91c1549b9e..c68a2b8df90a 100644 --- a/Marlin/src/feature/joystick.cpp +++ b/Marlin/src/feature/joystick.cpp @@ -68,13 +68,13 @@ Joystick joystick; void Joystick::report() { SERIAL_ECHOPGM("Joystick"); #if HAS_JOY_ADC_X - SERIAL_ECHOPGM_P(SP_X_STR, JOY_X(x.raw)); + SERIAL_ECHOPGM_P(SP_X_STR, JOY_X(x.getraw())); #endif #if HAS_JOY_ADC_Y - SERIAL_ECHOPGM_P(SP_Y_STR, JOY_Y(y.raw)); + SERIAL_ECHOPGM_P(SP_Y_STR, JOY_Y(y.getraw())); #endif #if HAS_JOY_ADC_Z - SERIAL_ECHOPGM_P(SP_Z_STR, JOY_Z(z.raw)); + SERIAL_ECHOPGM_P(SP_Z_STR, JOY_Z(z.getraw())); #endif #if HAS_JOY_ADC_EN SERIAL_ECHO_TERNARY(READ(JOY_EN_PIN), " EN=", "HIGH (dis", "LOW (en", "abled)"); @@ -91,29 +91,29 @@ Joystick joystick; if (READ(JOY_EN_PIN)) return; #endif - auto _normalize_joy = [](float &axis_jog, const int16_t raw, const int16_t (&joy_limits)[4]) { + auto _normalize_joy = [](float &axis_jog, const raw_adc_t raw, const raw_adc_t (&joy_limits)[4]) { if (WITHIN(raw, joy_limits[0], joy_limits[3])) { // within limits, check deadzone if (raw > joy_limits[2]) axis_jog = (raw - joy_limits[2]) / float(joy_limits[3] - joy_limits[2]); else if (raw < joy_limits[1]) - axis_jog = (raw - joy_limits[1]) / float(joy_limits[1] - joy_limits[0]); // negative value + axis_jog = int16_t(raw - joy_limits[1]) / float(joy_limits[1] - joy_limits[0]); // negative value // Map normal to jog value via quadratic relationship axis_jog = SIGN(axis_jog) * sq(axis_jog); } }; #if HAS_JOY_ADC_X - static constexpr int16_t joy_x_limits[4] = JOY_X_LIMITS; - _normalize_joy(norm_jog.x, JOY_X(x.raw), joy_x_limits); + static constexpr raw_adc_t joy_x_limits[4] = JOY_X_LIMITS; + _normalize_joy(norm_jog.x, JOY_X(x.getraw()), joy_x_limits); #endif #if HAS_JOY_ADC_Y - static constexpr int16_t joy_y_limits[4] = JOY_Y_LIMITS; - _normalize_joy(norm_jog.y, JOY_Y(y.raw), joy_y_limits); + static constexpr raw_adc_t joy_y_limits[4] = JOY_Y_LIMITS; + _normalize_joy(norm_jog.y, JOY_Y(y.getraw()), joy_y_limits); #endif #if HAS_JOY_ADC_Z - static constexpr int16_t joy_z_limits[4] = JOY_Z_LIMITS; - _normalize_joy(norm_jog.z, JOY_Z(z.raw), joy_z_limits); + static constexpr raw_adc_t joy_z_limits[4] = JOY_Z_LIMITS; + _normalize_joy(norm_jog.z, JOY_Z(z.getraw()), joy_z_limits); #endif } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index f0677afd2d1d..786a865049fa 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1176,7 +1176,7 @@ void MarlinUI::init() { #if HAS_ADC_BUTTONS typedef struct { - uint16_t ADCKeyValueMin, ADCKeyValueMax; + raw_adc_t ADCKeyValueMin, ADCKeyValueMax; uint8_t ADCKeyNo; } _stADCKeypadTable_; @@ -1203,10 +1203,10 @@ void MarlinUI::init() { #endif // Calculate the ADC value for the voltage divider with specified pull-down resistor value - #define ADC_BUTTON_VALUE(r) int(HAL_ADC_RANGE * (ADC_BUTTONS_VALUE_SCALE) * r / (r + ADC_BUTTONS_R_PULLUP)) + #define ADC_BUTTON_VALUE(r) raw_adc_t(HAL_ADC_RANGE * (ADC_BUTTONS_VALUE_SCALE) * r / (r + ADC_BUTTONS_R_PULLUP)) - static constexpr uint16_t adc_button_tolerance = HAL_ADC_RANGE * 25 / 1024, - adc_other_button = HAL_ADC_RANGE * 1000 / 1024; + static constexpr raw_adc_t adc_button_tolerance = HAL_ADC_RANGE * 25 / 1024, + adc_other_button = HAL_ADC_RANGE * 1000 / 1024; static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = { // VALUE_MIN, VALUE_MAX, KEY { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F1 }, // F1 @@ -1226,13 +1226,13 @@ void MarlinUI::init() { uint8_t get_ADC_keyValue() { if (thermalManager.ADCKey_count >= 16) { - const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw; + const raw_adc_t currentkpADCValue = thermalManager.current_ADCKey_raw; thermalManager.current_ADCKey_raw = HAL_ADC_RANGE; thermalManager.ADCKey_count = 0; if (currentkpADCValue < adc_other_button) LOOP_L_N(i, ADC_KEY_NUM) { - const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin), - hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax); + const raw_adc_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin), + hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax); if (WITHIN(currentkpADCValue, lo, hi)) return pgm_read_byte(&stADCKeyTable[i].ADCKeyNo); } } diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 653b3179b0c0..a983275b8aff 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -437,8 +437,8 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); #if HAS_HEATED_BED bed_info_t Temperature::temp_bed; // = { 0 } // Init min and max temp with extreme values to prevent false errors during startup - int16_t Temperature::mintemp_raw_BED = TEMP_SENSOR_BED_RAW_LO_TEMP, - Temperature::maxtemp_raw_BED = TEMP_SENSOR_BED_RAW_HI_TEMP; + raw_adc_t Temperature::mintemp_raw_BED = TEMP_SENSOR_BED_RAW_LO_TEMP, + Temperature::maxtemp_raw_BED = TEMP_SENSOR_BED_RAW_HI_TEMP; TERN_(WATCH_BED, bed_watch_t Temperature::watch_bed); // = { 0 } IF_DISABLED(PIDTEMPBED, millis_t Temperature::next_bed_check_ms); #endif @@ -448,8 +448,8 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); #if HAS_HEATED_CHAMBER millis_t next_cool_check_ms_2 = 0; celsius_float_t old_temp = 9999; - int16_t Temperature::mintemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_LO_TEMP, - Temperature::maxtemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_HI_TEMP; + raw_adc_t Temperature::mintemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_LO_TEMP, + Temperature::maxtemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_HI_TEMP; TERN_(WATCH_CHAMBER, chamber_watch_t Temperature::watch_chamber{0}); IF_DISABLED(PIDTEMPCHAMBER, millis_t Temperature::next_chamber_check_ms); #endif @@ -461,8 +461,8 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); bool flag_cooler_state; //bool flag_cooler_excess = false; celsius_float_t previous_temp = 9999; - int16_t Temperature::mintemp_raw_COOLER = TEMP_SENSOR_COOLER_RAW_LO_TEMP, - Temperature::maxtemp_raw_COOLER = TEMP_SENSOR_COOLER_RAW_HI_TEMP; + raw_adc_t Temperature::mintemp_raw_COOLER = TEMP_SENSOR_COOLER_RAW_LO_TEMP, + Temperature::maxtemp_raw_COOLER = TEMP_SENSOR_COOLER_RAW_HI_TEMP; #if WATCH_COOLER cooler_watch_t Temperature::watch_cooler{0}; #endif @@ -477,8 +477,8 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); #if HAS_TEMP_BOARD board_info_t Temperature::temp_board; // = { 0 } #if ENABLED(THERMAL_PROTECTION_BOARD) - int16_t Temperature::mintemp_raw_BOARD = TEMP_SENSOR_BOARD_RAW_LO_TEMP, - Temperature::maxtemp_raw_BOARD = TEMP_SENSOR_BOARD_RAW_HI_TEMP; + raw_adc_t Temperature::mintemp_raw_BOARD = TEMP_SENSOR_BOARD_RAW_LO_TEMP, + Temperature::maxtemp_raw_BOARD = TEMP_SENSOR_BOARD_RAW_HI_TEMP; #endif #endif @@ -508,6 +508,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif #define TEMPDIR(N) ((TEMP_SENSOR_##N##_RAW_LO_TEMP) < (TEMP_SENSOR_##N##_RAW_HI_TEMP) ? 1 : -1) +#define TP_CMP(S,A,B) (TEMPDIR(S) < 0 ? ((A)<(B)) : ((A)>(B))) #if HAS_HOTEND // Init mintemp and maxtemp with extreme values to prevent false errors during startup @@ -1689,8 +1690,8 @@ void Temperature::manage_heater() { m = (l + r) >> 1; \ if (!m) return celsius_t(pgm_read_word(&TBL[0].celsius)); \ if (m == l || m == r) return celsius_t(pgm_read_word(&TBL[LEN-1].celsius)); \ - int16_t v00 = pgm_read_word(&TBL[m-1].value), \ - v10 = pgm_read_word(&TBL[m-0].value); \ + raw_adc_t v00 = pgm_read_word(&TBL[m-1].value), \ + v10 = pgm_read_word(&TBL[m-0].value); \ if (raw < v00) r = m; \ else if (raw > v10) l = m; \ else { \ @@ -1784,7 +1785,7 @@ void Temperature::manage_heater() { SERIAL_EOL(); } - celsius_float_t Temperature::user_thermistor_to_deg_c(const uint8_t t_index, const int16_t raw) { + celsius_float_t Temperature::user_thermistor_to_deg_c(const uint8_t t_index, const raw_adc_t raw) { if (!WITHIN(t_index, 0, COUNT(user_thermistor) - 1)) return 25; @@ -1799,8 +1800,8 @@ void Temperature::manage_heater() { } // maximum adc value .. take into account the over sampling - const int adc_max = MAX_RAW_THERMISTOR_VALUE, - adc_raw = constrain(raw, 1, adc_max - 1); // constrain to prevent divide-by-zero + constexpr raw_adc_t adc_max = MAX_RAW_THERMISTOR_VALUE; + const raw_adc_t adc_raw = constrain(raw, 1, adc_max - 1); // constrain to prevent divide-by-zero const float adc_inverse = (adc_max - adc_raw) - 0.5f, resistance = t.series_res * (adc_raw + 0.5f) / adc_inverse, @@ -1820,7 +1821,7 @@ void Temperature::manage_heater() { #if HAS_HOTEND // Derived from RepRap FiveD extruder::getTemperature() // For hot end temperature measurement. - celsius_float_t Temperature::analog_to_celsius_hotend(const int16_t raw, const uint8_t e) { + celsius_float_t Temperature::analog_to_celsius_hotend(const raw_adc_t raw, const uint8_t e) { if (e >= HOTENDS) { SERIAL_ERROR_START(); SERIAL_ECHO(e); @@ -1836,11 +1837,11 @@ void Temperature::manage_heater() { #elif TEMP_SENSOR_0_IS_MAX_TC #if TEMP_SENSOR_0_IS_MAX31865 return TERN(LIB_INTERNAL_MAX31865, - max31865_0.temperature((uint16_t)raw), + max31865_0.temperature(raw), max31865_0.temperature(MAX31865_SENSOR_OHMS_0, MAX31865_CALIBRATION_OHMS_0) ); #else - return raw * 0.25; + return (int16_t)raw * 0.25; #endif #elif TEMP_SENSOR_0_IS_AD595 return TEMP_AD595(raw); @@ -1855,11 +1856,11 @@ void Temperature::manage_heater() { #elif TEMP_SENSOR_1_IS_MAX_TC #if TEMP_SENSOR_0_IS_MAX31865 return TERN(LIB_INTERNAL_MAX31865, - max31865_1.temperature((uint16_t)raw), + max31865_1.temperature(raw), max31865_1.temperature(MAX31865_SENSOR_OHMS_1, MAX31865_CALIBRATION_OHMS_1) ); #else - return raw * 0.25; + return (int16_t)raw * 0.25; #endif #elif TEMP_SENSOR_1_IS_AD595 return TEMP_AD595(raw); @@ -1943,7 +1944,7 @@ void Temperature::manage_heater() { #if HAS_HEATED_BED // For bed temperature measurement. - celsius_float_t Temperature::analog_to_celsius_bed(const int16_t raw) { + celsius_float_t Temperature::analog_to_celsius_bed(const raw_adc_t raw) { #if TEMP_SENSOR_BED_IS_CUSTOM return user_thermistor_to_deg_c(CTI_BED, raw); #elif TEMP_SENSOR_BED_IS_THERMISTOR @@ -1961,7 +1962,7 @@ void Temperature::manage_heater() { #if HAS_TEMP_CHAMBER // For chamber temperature measurement. - celsius_float_t Temperature::analog_to_celsius_chamber(const int16_t raw) { + celsius_float_t Temperature::analog_to_celsius_chamber(const raw_adc_t raw) { #if TEMP_SENSOR_CHAMBER_IS_CUSTOM return user_thermistor_to_deg_c(CTI_CHAMBER, raw); #elif TEMP_SENSOR_CHAMBER_IS_THERMISTOR @@ -1979,7 +1980,7 @@ void Temperature::manage_heater() { #if HAS_TEMP_COOLER // For cooler temperature measurement. - celsius_float_t Temperature::analog_to_celsius_cooler(const int16_t raw) { + celsius_float_t Temperature::analog_to_celsius_cooler(const raw_adc_t raw) { #if TEMP_SENSOR_COOLER_IS_CUSTOM return user_thermistor_to_deg_c(CTI_COOLER, raw); #elif TEMP_SENSOR_COOLER_IS_THERMISTOR @@ -1997,7 +1998,7 @@ void Temperature::manage_heater() { #if HAS_TEMP_PROBE // For probe temperature measurement. - celsius_float_t Temperature::analog_to_celsius_probe(const int16_t raw) { + celsius_float_t Temperature::analog_to_celsius_probe(const raw_adc_t raw) { #if TEMP_SENSOR_PROBE_IS_CUSTOM return user_thermistor_to_deg_c(CTI_PROBE, raw); #elif TEMP_SENSOR_PROBE_IS_THERMISTOR @@ -2015,7 +2016,7 @@ void Temperature::manage_heater() { #if HAS_TEMP_BOARD // For motherboard temperature measurement. - celsius_float_t Temperature::analog_to_celsius_board(const int16_t raw) { + celsius_float_t Temperature::analog_to_celsius_board(const raw_adc_t raw) { #if TEMP_SENSOR_BOARD_IS_CUSTOM return user_thermistor_to_deg_c(CTI_BOARD, raw); #elif TEMP_SENSOR_BOARD_IS_THERMISTOR @@ -2033,13 +2034,13 @@ void Temperature::manage_heater() { #if HAS_TEMP_REDUNDANT // For redundant temperature measurement. - celsius_float_t Temperature::analog_to_celsius_redundant(const int16_t raw) { + celsius_float_t Temperature::analog_to_celsius_redundant(const raw_adc_t raw) { #if TEMP_SENSOR_REDUNDANT_IS_CUSTOM return user_thermistor_to_deg_c(CTI_REDUNDANT, raw); #elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E0) - return TERN(TEMP_SENSOR_REDUNDANT_IS_MAX31865, max31865_0.temperature((uint16_t)raw), raw * 0.25); + return TERN(TEMP_SENSOR_REDUNDANT_IS_MAX31865, max31865_0.temperature(raw), (int16_t)raw * 0.25); #elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E1) - return TERN(TEMP_SENSOR_REDUNDANT_IS_MAX31865, max31865_1.temperature((uint16_t)raw), raw * 0.25); + return TERN(TEMP_SENSOR_REDUNDANT_IS_MAX31865, max31865_1.temperature(raw), (int16_t)raw * 0.25); #elif TEMP_SENSOR_REDUNDANT_IS_THERMISTOR SCAN_THERMISTOR_TABLE(TEMPTABLE_REDUNDANT, TEMPTABLE_REDUNDANT_LEN); #elif TEMP_SENSOR_REDUNDANT_IS_AD595 @@ -2069,20 +2070,20 @@ void Temperature::updateTemperaturesFromRawValues() { watchdog_refresh(); // Reset because raw_temps_ready was set by the interrupt - TERN_(TEMP_SENSOR_0_IS_MAX_TC, temp_hotend[0].raw = READ_MAX_TC(0)); - TERN_(TEMP_SENSOR_1_IS_MAX_TC, temp_hotend[1].raw = READ_MAX_TC(1)); - TERN_(TEMP_SENSOR_REDUNDANT_IS_MAX_TC, temp_redundant.raw = READ_MAX_TC(HEATER_ID(TEMP_SENSOR_REDUNDANT_SOURCE))); + TERN_(TEMP_SENSOR_0_IS_MAX_TC, temp_hotend[0].setraw(READ_MAX_TC(0))); + TERN_(TEMP_SENSOR_1_IS_MAX_TC, temp_hotend[1].setraw(READ_MAX_TC(1))); + TERN_(TEMP_SENSOR_REDUNDANT_IS_MAX_TC, temp_redundant.setraw(READ_MAX_TC(HEATER_ID(TEMP_SENSOR_REDUNDANT_SOURCE)))); #if HAS_HOTEND - HOTEND_LOOP() temp_hotend[e].celsius = analog_to_celsius_hotend(temp_hotend[e].raw, e); + HOTEND_LOOP() temp_hotend[e].celsius = analog_to_celsius_hotend(temp_hotend[e].getraw(), e); #endif - TERN_(HAS_HEATED_BED, temp_bed.celsius = analog_to_celsius_bed(temp_bed.raw)); - TERN_(HAS_TEMP_CHAMBER, temp_chamber.celsius = analog_to_celsius_chamber(temp_chamber.raw)); - TERN_(HAS_TEMP_COOLER, temp_cooler.celsius = analog_to_celsius_cooler(temp_cooler.raw)); - TERN_(HAS_TEMP_PROBE, temp_probe.celsius = analog_to_celsius_probe(temp_probe.raw)); - TERN_(HAS_TEMP_BOARD, temp_board.celsius = analog_to_celsius_board(temp_board.raw)); - TERN_(HAS_TEMP_REDUNDANT, temp_redundant.celsius = analog_to_celsius_redundant(temp_redundant.raw)); + TERN_(HAS_HEATED_BED, temp_bed.celsius = analog_to_celsius_bed(temp_bed.getraw())); + TERN_(HAS_TEMP_CHAMBER, temp_chamber.celsius = analog_to_celsius_chamber(temp_chamber.getraw())); + TERN_(HAS_TEMP_COOLER, temp_cooler.celsius = analog_to_celsius_cooler(temp_cooler.getraw())); + TERN_(HAS_TEMP_PROBE, temp_probe.celsius = analog_to_celsius_probe(temp_probe.getraw())); + TERN_(HAS_TEMP_BOARD, temp_board.celsius = analog_to_celsius_board(temp_board.getraw())); + TERN_(HAS_TEMP_REDUNDANT, temp_redundant.celsius = analog_to_celsius_redundant(temp_redundant.getraw())); TERN_(FILAMENT_WIDTH_SENSOR, filwidth.update_measured_mm()); TERN_(HAS_POWER_MONITOR, power_monitor.capture_values()); @@ -2108,46 +2109,45 @@ void Temperature::updateTemperaturesFromRawValues() { }; LOOP_L_N(e, COUNT(temp_dir)) { - const int8_t tdir = temp_dir[e]; - if (tdir) { - const int16_t rawtemp = temp_hotend[e].raw * tdir; // normal direction, +rawtemp, else -rawtemp - if (rawtemp > temp_range[e].raw_max * tdir) max_temp_error((heater_id_t)e); - - const bool heater_on = temp_hotend[e].target > 0; - if (heater_on && rawtemp < temp_range[e].raw_min * tdir && !is_preheating(e)) { - #if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED > 1 - if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) - #endif - min_temp_error((heater_id_t)e); - } + const raw_adc_t r = temp_hotend[e].getraw(); + const bool neg = temp_dir[e] < 0, pos = temp_dir[e] > 0; + if ((neg && r < temp_range[e].raw_max) || (pos && r > temp_range[e].raw_max)) + max_temp_error((heater_id_t)e); + + const bool heater_on = temp_hotend[e].target > 0; + if (heater_on && ((neg && r > temp_range[e].raw_min) || (pos && r < temp_range[e].raw_min))) { #if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED > 1 - else - consecutive_low_temperature_error[e] = 0; + if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) #endif + min_temp_error((heater_id_t)e); } + #if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED > 1 + else + consecutive_low_temperature_error[e] = 0; + #endif } #endif // HAS_HOTEND #define TP_CMP(S,A,B) (TEMPDIR(S) < 0 ? ((A)<(B)) : ((A)>(B))) #if ENABLED(THERMAL_PROTECTION_BED) - if (TP_CMP(BED, temp_bed.raw, maxtemp_raw_BED)) max_temp_error(H_BED); - if (temp_bed.target > 0 && TP_CMP(BED, mintemp_raw_BED, temp_bed.raw)) min_temp_error(H_BED); + if (TP_CMP(BED, temp_bed.getraw(), maxtemp_raw_BED)) max_temp_error(H_BED); + if (temp_bed.target > 0 && TP_CMP(BED, mintemp_raw_BED, temp_bed.getraw())) min_temp_error(H_BED); #endif #if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER) - if (TP_CMP(CHAMBER, temp_chamber.raw, maxtemp_raw_CHAMBER)) max_temp_error(H_CHAMBER); - if (temp_chamber.target > 0 && TP_CMP(CHAMBER, mintemp_raw_CHAMBER, temp_chamber.raw)) min_temp_error(H_CHAMBER); + if (TP_CMP(CHAMBER, temp_chamber.getraw(), maxtemp_raw_CHAMBER)) max_temp_error(H_CHAMBER); + if (temp_chamber.target > 0 && TP_CMP(CHAMBER, mintemp_raw_CHAMBER, temp_chamber.getraw())) min_temp_error(H_CHAMBER); #endif #if BOTH(HAS_COOLER, THERMAL_PROTECTION_COOLER) - if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.raw, maxtemp_raw_COOLER)) max_temp_error(H_COOLER); - if (TP_CMP(COOLER, mintemp_raw_COOLER, temp_cooler.raw)) min_temp_error(H_COOLER); + if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.getraw(), maxtemp_raw_COOLER)) max_temp_error(H_COOLER); + if (TP_CMP(COOLER, mintemp_raw_COOLER, temp_cooler.getraw())) min_temp_error(H_COOLER); #endif #if BOTH(HAS_TEMP_BOARD, THERMAL_PROTECTION_BOARD) - if (TP_CMP(BOARD, temp_board.raw, maxtemp_raw_BOARD)) max_temp_error(H_BOARD); - if (TP_CMP(BOARD, mintemp_raw_BOARD, temp_board.raw)) min_temp_error(H_BOARD); + if (TP_CMP(BOARD, temp_board.getraw(), maxtemp_raw_BOARD)) max_temp_error(H_BOARD); + if (TP_CMP(BOARD, mintemp_raw_BOARD, temp_board.getraw())) min_temp_error(H_BOARD); #endif #undef TP_CMP @@ -2731,7 +2731,7 @@ void Temperature::disable_all_heaters() { * @param hindex the hotend we're referencing (if MULTI_MAX_TC) * @return integer representing the board's buffer, to be converted later if needed */ - int16_t Temperature::read_max_tc(TERN_(HAS_MULTI_MAX_TC, const uint8_t hindex/*=0*/)) { + raw_adc_t Temperature::read_max_tc(TERN_(HAS_MULTI_MAX_TC, const uint8_t hindex/*=0*/)) { #define MAXTC_HEAT_INTERVAL 250UL #if HAS_MAX31855 @@ -2750,7 +2750,7 @@ void Temperature::disable_all_heaters() { #if HAS_MULTI_MAX_TC // Needed to return the correct temp when this is called between readings - static int16_t max_tc_temp_previous[MAX_TC_COUNT] = { 0 }; + static raw_adc_t max_tc_temp_previous[MAX_TC_COUNT] = { 0 }; #define THERMO_TEMP(I) max_tc_temp_previous[I] #define THERMO_SEL(A,B) (hindex ? (B) : (A)) #define MAXTC_CS_WRITE(V) do{ switch (hindex) { case 1: WRITE(TEMP_1_CS_PIN, V); break; default: WRITE(TEMP_0_CS_PIN, V); } }while(0) @@ -2779,7 +2779,7 @@ void Temperature::disable_all_heaters() { // Return last-read value between readings millis_t ms = millis(); if (PENDING(ms, next_max_tc_ms[hindex])) - return (int16_t)THERMO_TEMP(hindex); + return THERMO_TEMP(hindex); next_max_tc_ms[hindex] = ms + MAXTC_HEAT_INTERVAL; @@ -2876,7 +2876,7 @@ void Temperature::disable_all_heaters() { THERMO_TEMP(hindex) = max_tc_temp; - return (int16_t)max_tc_temp; + return max_tc_temp; } #endif // HAS_MAX_TC @@ -3017,7 +3017,7 @@ void Temperature::isr() { uint8_t pwm_count_tmp = pwm_count; #if HAS_ADC_BUTTONS - static unsigned int raw_ADCKey_value = 0; + static raw_adc_t raw_ADCKey_value = 0; static bool ADCKey_pressed = false; #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index eb2f4337c091..cb84f7e395d4 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -192,12 +192,16 @@ enum ADCSensorState : char { // A temperature sensor typedef struct TempInfo { - uint16_t acc; - int16_t raw; +private: + raw_adc_t acc; + raw_adc_t raw; +public: celsius_float_t celsius; inline void reset() { acc = 0; } - inline void sample(const uint16_t s) { acc += s; } + inline void sample(const raw_adc_t s) { acc += s; } inline void update() { raw = acc; } + void setraw(const raw_adc_t r) { raw = r; } + raw_adc_t getraw() { return raw; } } temp_info_t; #if HAS_TEMP_REDUNDANT @@ -287,9 +291,7 @@ struct HeaterWatch { #endif // Temperature sensor read value ranges -typedef struct { int16_t raw_min, raw_max; } raw_range_t; -typedef struct { celsius_t mintemp, maxtemp; } celsius_range_t; -typedef struct { int16_t raw_min, raw_max; celsius_t mintemp, maxtemp; } temp_range_t; +typedef struct { raw_adc_t raw_min, raw_max; celsius_t mintemp, maxtemp; } temp_range_t; #define THERMISTOR_ABS_ZERO_C -273.15f // bbbbrrrrr cold ! #define THERMISTOR_RESISTANCE_NOMINAL_C 25.0f // mmmmm comfortable @@ -492,7 +494,7 @@ class Temperature { static bed_watch_t watch_bed; #endif IF_DISABLED(PIDTEMPBED, static millis_t next_bed_check_ms); - static int16_t mintemp_raw_BED, maxtemp_raw_BED; + static raw_adc_t mintemp_raw_BED, maxtemp_raw_BED; #endif #if HAS_HEATED_CHAMBER @@ -500,7 +502,7 @@ class Temperature { static chamber_watch_t watch_chamber; #endif TERN(PIDTEMPCHAMBER,,static millis_t next_chamber_check_ms); - static int16_t mintemp_raw_CHAMBER, maxtemp_raw_CHAMBER; + static raw_adc_t mintemp_raw_CHAMBER, maxtemp_raw_CHAMBER; #endif #if HAS_COOLER @@ -508,11 +510,11 @@ class Temperature { static cooler_watch_t watch_cooler; #endif static millis_t next_cooler_check_ms, cooler_fan_flush_ms; - static int16_t mintemp_raw_COOLER, maxtemp_raw_COOLER; + static raw_adc_t mintemp_raw_COOLER, maxtemp_raw_COOLER; #endif #if HAS_TEMP_BOARD && ENABLED(THERMAL_PROTECTION_BOARD) - static int16_t mintemp_raw_BOARD, maxtemp_raw_BOARD; + static raw_adc_t mintemp_raw_BOARD, maxtemp_raw_BOARD; #endif #if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED > 1 @@ -566,7 +568,7 @@ class Temperature { static user_thermistor_t user_thermistor[USER_THERMISTORS]; static void M305_report(const uint8_t t_index, const bool forReplay=true); static void reset_user_thermistors(); - static celsius_float_t user_thermistor_to_deg_c(const uint8_t t_index, const int16_t raw); + static celsius_float_t user_thermistor_to_deg_c(const uint8_t t_index, const raw_adc_t raw); static bool set_pull_up_res(int8_t t_index, float value) { //if (!WITHIN(t_index, 0, USER_THERMISTORS - 1)) return false; if (!WITHIN(value, 1, 1000000)) return false; @@ -594,25 +596,25 @@ class Temperature { #endif #if HAS_HOTEND - static celsius_float_t analog_to_celsius_hotend(const int16_t raw, const uint8_t e); + static celsius_float_t analog_to_celsius_hotend(const raw_adc_t raw, const uint8_t e); #endif #if HAS_HEATED_BED - static celsius_float_t analog_to_celsius_bed(const int16_t raw); + static celsius_float_t analog_to_celsius_bed(const raw_adc_t raw); #endif #if HAS_TEMP_CHAMBER - static celsius_float_t analog_to_celsius_chamber(const int16_t raw); + static celsius_float_t analog_to_celsius_chamber(const raw_adc_t raw); #endif #if HAS_TEMP_PROBE - static celsius_float_t analog_to_celsius_probe(const int16_t raw); + static celsius_float_t analog_to_celsius_probe(const raw_adc_t raw); #endif #if HAS_TEMP_COOLER - static celsius_float_t analog_to_celsius_cooler(const int16_t raw); + static celsius_float_t analog_to_celsius_cooler(const raw_adc_t raw); #endif #if HAS_TEMP_BOARD - static celsius_float_t analog_to_celsius_board(const int16_t raw); + static celsius_float_t analog_to_celsius_board(const raw_adc_t raw); #endif #if HAS_TEMP_REDUNDANT - static celsius_float_t analog_to_celsius_redundant(const int16_t raw); + static celsius_float_t analog_to_celsius_redundant(const raw_adc_t raw); #endif #if HAS_FAN @@ -707,8 +709,8 @@ class Temperature { } #if ENABLED(SHOW_TEMP_ADC_VALUES) - static int16_t rawHotendTemp(const uint8_t E_NAME) { - return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].raw); + static raw_adc_t rawHotendTemp(const uint8_t E_NAME) { + return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].getraw()); } #endif @@ -770,7 +772,7 @@ class Temperature { #if HAS_HEATED_BED #if ENABLED(SHOW_TEMP_ADC_VALUES) - static int16_t rawBedTemp() { return temp_bed.raw; } + static raw_adc_t rawBedTemp() { return temp_bed.getraw(); } #endif static celsius_float_t degBed() { return temp_bed.celsius; } static celsius_t wholeDegBed() { return static_cast(degBed() + 0.5f); } @@ -801,7 +803,7 @@ class Temperature { #if HAS_TEMP_PROBE #if ENABLED(SHOW_TEMP_ADC_VALUES) - static int16_t rawProbeTemp() { return temp_probe.raw; } + static raw_adc_t rawProbeTemp() { return temp_probe.getraw(); } #endif static celsius_float_t degProbe() { return temp_probe.celsius; } static celsius_t wholeDegProbe() { return static_cast(degProbe() + 0.5f); } @@ -812,7 +814,7 @@ class Temperature { #if HAS_TEMP_CHAMBER #if ENABLED(SHOW_TEMP_ADC_VALUES) - static int16_t rawChamberTemp() { return temp_chamber.raw; } + static raw_adc_t rawChamberTemp() { return temp_chamber.getraw(); } #endif static celsius_float_t degChamber() { return temp_chamber.celsius; } static celsius_t wholeDegChamber() { return static_cast(degChamber() + 0.5f); } @@ -835,7 +837,7 @@ class Temperature { #if HAS_TEMP_COOLER #if ENABLED(SHOW_TEMP_ADC_VALUES) - static int16_t rawCoolerTemp() { return temp_cooler.raw; } + static raw_adc_t rawCoolerTemp() { return temp_cooler.getraw(); } #endif static celsius_float_t degCooler() { return temp_cooler.celsius; } static celsius_t wholeDegCooler() { return static_cast(temp_cooler.celsius + 0.5f); } @@ -849,7 +851,7 @@ class Temperature { #if HAS_TEMP_BOARD #if ENABLED(SHOW_TEMP_ADC_VALUES) - static int16_t rawBoardTemp() { return temp_board.raw; } + static raw_adc_t rawBoardTemp() { return temp_board.getraw(); } #endif static celsius_float_t degBoard() { return temp_board.celsius; } static celsius_t wholeDegBoard() { return static_cast(temp_board.celsius + 0.5f); } @@ -857,8 +859,7 @@ class Temperature { #if HAS_TEMP_REDUNDANT #if ENABLED(SHOW_TEMP_ADC_VALUES) - static int16_t rawRedundantTemp() { return temp_redundant.raw; } - static int16_t rawRedundanTargetTemp() { return (*temp_redundant.target).raw; } + static raw_adc_t rawRedundantTemp() { return temp_redundant.getraw(); } #endif static celsius_float_t degRedundant() { return temp_redundant.celsius; } static celsius_float_t degRedundantTarget() { return (*temp_redundant.target).celsius; } @@ -991,7 +992,7 @@ class Temperature { #else #define READ_MAX_TC(N) read_max_tc() #endif - static int16_t read_max_tc(TERN_(HAS_MULTI_MAX_TC, const uint8_t hindex=0)); + static raw_adc_t read_max_tc(TERN_(HAS_MULTI_MAX_TC, const uint8_t hindex=0)); #endif #if HAS_AUTO_FAN diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 9f2ebce49a32..a38b7f381feb 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -27,22 +27,20 @@ #define THERMISTOR_TABLE_SCALE (HAL_ADC_RANGE / _BV(THERMISTOR_TABLE_ADC_RESOLUTION)) #if ENABLED(HAL_ADC_FILTERED) #define OVERSAMPLENR 1 -#elif HAL_ADC_RESOLUTION > 10 - #define OVERSAMPLENR (20 - HAL_ADC_RESOLUTION) #else #define OVERSAMPLENR 16 #endif -#define MAX_RAW_THERMISTOR_VALUE (HAL_ADC_RANGE * (OVERSAMPLENR) - 1) -// Currently Marlin stores all oversampled ADC values as int16_t, make sure the HAL settings do not overflow 15bit -#if MAX_RAW_THERMISTOR_VALUE > ((1 << 15) - 1) - #error "MAX_RAW_THERMISTOR_VALUE is too large for int16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION." +// Currently Marlin stores all oversampled ADC values as uint16_t, make sure the HAL settings do not overflow 16 bit +#if (HAL_ADC_RANGE) * (OVERSAMPLENR) > 1 << 16 + #error "MAX_RAW_THERMISTOR_VALUE is too large for uint16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION." #endif +#define MAX_RAW_THERMISTOR_VALUE (uint16_t(HAL_ADC_RANGE) * (OVERSAMPLENR) - 1) -#define OV_SCALE(N) (N) -#define OV(N) int16_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE)) +#define OV_SCALE(N) float(N) +#define OV(N) raw_adc_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE)) -typedef struct { int16_t value; celsius_t celsius; } temp_entry_t; +typedef struct { raw_adc_t value; celsius_t celsius; } temp_entry_t; // Pt1000 and Pt100 handling // From c7a2ecc31aa4def9e60668f5cfc648d87776be9b Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 18 Mar 2022 16:17:41 +1300 Subject: [PATCH 176/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20xatc=20EEPROM=20de?= =?UTF-8?q?bug=20(#23911)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/settings.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 6eb17d5d2e84..63bb93765ba8 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -277,7 +277,9 @@ typedef struct SettingsDataStruct { // X_AXIS_TWIST_COMPENSATION // #if ENABLED(X_AXIS_TWIST_COMPENSATION) - XATC xatc; // M423 X Z + float xatc_spacing; // M423 X Z + float xatc_start; + xatc_array_t xatc_z_offset; #endif // @@ -900,7 +902,7 @@ void MarlinSettings::postprocess() { // X Axis Twist Compensation // #if ENABLED(X_AXIS_TWIST_COMPENSATION) - _FIELD_TEST(xatc); + _FIELD_TEST(xatc_spacing); EEPROM_WRITE(xatc.spacing); EEPROM_WRITE(xatc.start); EEPROM_WRITE(xatc.z_offset); @@ -1811,7 +1813,7 @@ void MarlinSettings::postprocess() { // X Axis Twist Compensation // #if ENABLED(X_AXIS_TWIST_COMPENSATION) - _FIELD_TEST(xatc); + _FIELD_TEST(xatc_spacing); EEPROM_READ(xatc.spacing); EEPROM_READ(xatc.start); EEPROM_READ(xatc.z_offset); From cc8e485e1c55fb2fcdba7dc8f6b89041ed18e9ce Mon Sep 17 00:00:00 2001 From: John Robertson Date: Fri, 18 Mar 2022 03:21:53 +0000 Subject: [PATCH 177/502] =?UTF-8?q?=E2=9C=A8=20ESP32=20-=20Hardware=20PWM?= =?UTF-8?q?=20for=20fan,=20cutter,=20servos=20(#23802)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 2 +- Marlin/src/HAL/ESP32/HAL.cpp | 101 ++++++++++++++++++++----- Marlin/src/HAL/ESP32/HAL.h | 25 ++++-- Marlin/src/HAL/ESP32/Servo.cpp | 18 ++--- Marlin/src/HAL/ESP32/Servo.h | 3 +- Marlin/src/HAL/ESP32/inc/SanityCheck.h | 8 +- 6 files changed, 116 insertions(+), 41 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d78e63100e6f..0a18e95ebcad 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3464,7 +3464,7 @@ #define SPINDLE_LASER_USE_PWM // Enable if your controller supports setting the speed/power #if ENABLED(SPINDLE_LASER_USE_PWM) #define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower - #define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC) + #define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR, ESP32 and LPC) #endif //#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11 diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index c1a44a3dea78..44be0b540afe 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -73,9 +73,16 @@ uint16_t MarlinHAL::adc_result; esp_adc_cal_characteristics_t characteristics[ADC_ATTEN_MAX]; adc_atten_t attenuations[ADC1_CHANNEL_MAX] = {}; uint32_t thresholds[ADC_ATTEN_MAX]; -volatile int numPWMUsed = 0, - pwmPins[MAX_PWM_PINS], - pwmValues[MAX_PWM_PINS]; + +volatile int numPWMUsed = 0; +volatile struct { pin_t pin; int value; } pwmState[MAX_PWM_PINS]; + +pin_t chan_pin[CHANNEL_MAX_NUM + 1] = { 0 }; // PWM capable IOpins - not 0 or >33 on ESP32 + +struct { + uint32_t freq; // ledcReadFreq doesn't work if a duty hasn't been set yet! + uint16_t res; +} pwmInfo[(CHANNEL_MAX_NUM + 1) / 2]; // ------------------------ // Public functions @@ -254,25 +261,81 @@ void MarlinHAL::adc_start(const pin_t pin) { adc1_set_attenuation(chan, atten); } -void analogWrite(pin_t pin, int value) { - // Use ledc hardware for internal pins - if (pin < 34) { - static int cnt_channel = 1, pin_to_channel[40] = { 0 }; - if (pin_to_channel[pin] == 0) { - ledcAttachPin(pin, cnt_channel); - ledcSetup(cnt_channel, 490, 8); - ledcWrite(cnt_channel, value); - pin_to_channel[pin] = cnt_channel++; +// ------------------------ +// PWM +// ------------------------ + +int8_t channel_for_pin(const uint8_t pin) { + for (int i = 0; i <= CHANNEL_MAX_NUM; i++) + if (chan_pin[i] == pin) return i; + return -1; +} + +// get PWM channel for pin - if none then attach a new one +// return -1 if fail or invalid pin#, channel # (0-15) if success +int8_t get_pwm_channel(const pin_t pin, const uint32_t freq, const uint16_t res) { + if (!WITHIN(pin, 1, MAX_PWM_IOPIN)) return -1; // Not a hardware PWM pin! + int8_t cid = channel_for_pin(pin); + if (cid >= 0) return cid; + + // Find an empty adjacent channel (same timer & freq/res) + for (int i = 0; i <= CHANNEL_MAX_NUM; i++) { + if (chan_pin[i] == 0) { + if (chan_pin[i ^ 0x1] != 0) { + if (pwmInfo[i / 2].freq == freq && pwmInfo[i / 2].res == res) { + chan_pin[i] = pin; // Allocate PWM to this channel + ledcAttachPin(pin, i); + return i; + } + } + else if (cid == -1) // Pair of empty channels? + cid = i & 0xFE; // Save lower channel number } - ledcWrite(pin_to_channel[pin], value); + } + // not attached, is an empty timer slot avail? + if (cid >= 0) { + chan_pin[cid] = pin; + pwmInfo[cid / 2].freq = freq; + pwmInfo[cid / 2].res = res; + ledcSetup(cid, freq, res); + ledcAttachPin(pin, cid); + } + return cid; // -1 if no channel avail +} + +void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=_BV(PWM_RESOLUTION)-1*/, const bool invert/*=false*/) { + const int8_t cid = get_pwm_channel(pin, PWM_FREQUENCY, PWM_RESOLUTION); + if (cid >= 0) { + uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, _BV(PWM_RESOLUTION)-1); + ledcWrite(cid, duty); + } +} + +int8_t MarlinHAL::set_pwm_frequency(const pin_t pin, const uint32_t f_desired) { + const int8_t cid = channel_for_pin(pin); + if (cid >= 0) { + if (f_desired == ledcReadFreq(cid)) return cid; // no freq change + ledcDetachPin(chan_pin[cid]); + chan_pin[cid] = 0; // remove old freq channel + } + return get_pwm_channel(pin, f_desired, PWM_RESOLUTION); // try for new one +} + +// use hardware PWM if avail, if not then ISR +void analogWrite(const pin_t pin, const uint16_t value, const uint32_t freq/*=PWM_FREQUENCY*/, const uint16_t res/*=8*/) { // always 8 bit resolution! + // Use ledc hardware for internal pins + const int8_t cid = get_pwm_channel(pin, freq, res); + if (cid >= 0) { + ledcWrite(cid, value); // set duty value return; } + // not a hardware PWM pin OR no PWM channels available int idx = -1; // Search Pin for (int i = 0; i < numPWMUsed; ++i) - if (pwmPins[i] == pin) { idx = i; break; } + if (pwmState[i].pin == pin) { idx = i; break; } // not found ? if (idx < 0) { @@ -281,7 +344,7 @@ void analogWrite(pin_t pin, int value) { // Take new slot for pin idx = numPWMUsed; - pwmPins[idx] = pin; + pwmState[idx].pin = pin; // Start timer on first use if (idx == 0) HAL_timer_start(MF_TIMER_PWM, PWM_TIMER_FREQUENCY); @@ -289,7 +352,7 @@ void analogWrite(pin_t pin, int value) { } // Use 7bit internal value - add 1 to have 100% high at 255 - pwmValues[idx] = (value + 1) / 2; + pwmState[idx].value = (value + 1) / 2; } // Handle PWM timer interrupt @@ -300,9 +363,9 @@ HAL_PWM_TIMER_ISR() { for (int i = 0; i < numPWMUsed; ++i) { if (count == 0) // Start of interval - WRITE(pwmPins[i], pwmValues[i] ? HIGH : LOW); - else if (pwmValues[i] == count) // End of duration - WRITE(pwmPins[i], LOW); + digitalWrite(pwmState[i].pin, pwmState[i].value ? HIGH : LOW); + else if (pwmState[i].value == count) // End of duration + digitalWrite(pwmState[i].pin, LOW); } // 128 for 7 Bit resolution diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index df52e2186cbd..8b26c3471d39 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -64,6 +64,12 @@ #define CRITICAL_SECTION_START() portENTER_CRITICAL(&spinlock) #define CRITICAL_SECTION_END() portEXIT_CRITICAL(&spinlock) +#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment +#define PWM_FREQUENCY 1000u // Default PWM frequency when set_pwm_duty() is called without set_pwm_frequency() +#define PWM_RESOLUTION 10u // Default PWM bit resolution +#define CHANNEL_MAX_NUM 15u // max PWM channel # to allocate (7 to only use low speed, 15 to use low & high) +#define MAX_PWM_IOPIN 33u // hardware pwm pins < 34 + // ------------------------ // Types // ------------------------ @@ -83,7 +89,7 @@ typedef Servo hal_servo_t; void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0); void noTone(const pin_t _pin); -void analogWrite(pin_t pin, int value); +void analogWrite(const pin_t pin, const uint16_t value, const uint32_t freq=PWM_FREQUENCY, const uint16_t res=8); // // Pin Mapping for M42, M43, M226 @@ -209,12 +215,17 @@ class MarlinHAL { static uint16_t adc_value() { return adc_result; } /** - * Set the PWM duty cycle for the pin to the given value. - * No inverting the duty cycle in this HAL. - * No changing the maximum size of the provided value to enable finer PWM duty control in this HAL. + * If not already allocated, allocate a hardware PWM channel + * to the pin and set the duty cycle.. + * Optionally invert the duty cycle [default = false] + * Optionally change the scale of the provided value to enable finer PWM duty control [default = 255] */ - static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { - analogWrite(pin, v); - } + static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false); + + /** + * Allocate and set the frequency of a hardware PWM pin + * Returns -1 if no pin available. + */ + static int8_t set_pwm_frequency(const pin_t pin, const uint32_t f_desired); }; diff --git a/Marlin/src/HAL/ESP32/Servo.cpp b/Marlin/src/HAL/ESP32/Servo.cpp index fcf58485819e..ca3950d07f75 100644 --- a/Marlin/src/HAL/ESP32/Servo.cpp +++ b/Marlin/src/HAL/ESP32/Servo.cpp @@ -31,20 +31,18 @@ // so we only allocate servo channels up high to avoid side effects with regards to analogWrite (fans, leds, laser pwm etc.) int Servo::channel_next_free = 12; -Servo::Servo() { - channel = channel_next_free++; -} +Servo::Servo() {} int8_t Servo::attach(const int inPin) { - if (channel >= CHANNEL_MAX_NUM) return -1; if (inPin > 0) pin = inPin; - - ledcSetup(channel, 50, 16); // channel X, 50 Hz, 16-bit depth - ledcAttachPin(pin, channel); - return true; + channel = get_pwm_channel(pin, 50u, 16u); + return channel; // -1 if no PWM avail. } -void Servo::detach() { ledcDetachPin(pin); } +// leave channel connected to servo - set duty to zero +void Servo::detach() { + if (channel >= 0) ledcWrite(channel, 0); +} int Servo::read() { return degrees; } @@ -52,7 +50,7 @@ void Servo::write(int inDegrees) { degrees = constrain(inDegrees, MIN_ANGLE, MAX_ANGLE); int us = map(degrees, MIN_ANGLE, MAX_ANGLE, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); int duty = map(us, 0, TAU_USEC, 0, MAX_COMPARE); - ledcWrite(channel, duty); + if (channel >= 0) ledcWrite(channel, duty); // don't save duty for servos! } void Servo::move(const int value) { diff --git a/Marlin/src/HAL/ESP32/Servo.h b/Marlin/src/HAL/ESP32/Servo.h index 8542092d66ea..1dbb416a8317 100644 --- a/Marlin/src/HAL/ESP32/Servo.h +++ b/Marlin/src/HAL/ESP32/Servo.h @@ -30,8 +30,7 @@ class Servo { MAX_PULSE_WIDTH = 2400, // Longest pulse sent to a servo TAU_MSEC = 20, TAU_USEC = (TAU_MSEC * 1000), - MAX_COMPARE = _BV(16) - 1, // 65535 - CHANNEL_MAX_NUM = 16; + MAX_COMPARE = _BV(16) - 1; // 65535 public: Servo(); diff --git a/Marlin/src/HAL/ESP32/inc/SanityCheck.h b/Marlin/src/HAL/ESP32/inc/SanityCheck.h index 8bbc68d8715b..052c7e9d12fe 100644 --- a/Marlin/src/HAL/ESP32/inc/SanityCheck.h +++ b/Marlin/src/HAL/ESP32/inc/SanityCheck.h @@ -25,8 +25,8 @@ #error "EMERGENCY_PARSER is not yet implemented for ESP32. Disable EMERGENCY_PARSER to continue." #endif -#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY - #error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on ESP32." +#if (ENABLED(SPINDLE_LASER_USE_PWM) && SPINDLE_LASER_FREQUENCY > 78125) || (ENABLED(FAST_PWM_FAN_FREQUENCY) && FAST_PWM_FAN_FREQUENCY > 78125) + #error "SPINDLE_LASER_FREQUENCY and FAST_PWM_FREQUENCY maximum value is 78125Hz for ESP32." #endif #if HAS_TMC_SW_SERIAL @@ -40,3 +40,7 @@ #if ENABLED(POSTMORTEM_DEBUGGING) #error "POSTMORTEM_DEBUGGING is not yet supported on ESP32." #endif + +#if MB(MKS_TINYBEE) && ENABLED(FAST_PWM_FAN) + #error "FAST_PWM_FAN is not available on TinyBee." +#endif From 7e88ee8c5cc87395e73c45bcd743f3ab0302773b Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 18 Mar 2022 12:49:47 +0800 Subject: [PATCH 178/502] =?UTF-8?q?=F0=9F=93=8C=20PandaPi=20V2.9=20?= =?UTF-8?q?=E2=80=93=20Standalone=20mode=20(#23908)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h | 222 ++++++++++++++++++++ ini/stm32f1.ini | 11 + 4 files changed, 236 insertions(+) create mode 100644 Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 3ec24e776022..d1cc971e51d1 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -364,6 +364,7 @@ #define BOARD_ZONESTAR_ZM3E4 4061 // Zonestar ZM3E4 V1 (STM32F103VC) #define BOARD_ZONESTAR_ZM3E4V2 4062 // Zonestar ZM3E4 V2 (STM32F103VC) #define BOARD_ERYONE_ERY32_MINI 4063 // Eryone Ery32 mini (STM32F103VE) +#define BOARD_PANDA_PI_V29 4064 // Panda Pi V2.9 - Standalone (STM32F103RC) // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 7f0eac8c88fb..426ce1e48e77 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -601,6 +601,8 @@ #include "stm32f1/pins_ZM3E4_V2_0.h" // STM32F1 env:STM32F103VE_ZM3E4V2_USB env:STM32F103VE_ZM3E4V2_USB_maple #elif MB(ERYONE_ERY32_MINI) #include "stm32f1/pins_ERYONE_ERY32_MINI.h" // STM32F103VET6 env:ERYONE_ERY32_MINI_maple +#elif MB(PANDA_PI_V29) + #include "stm32f1/pins_PANDA_PI_V29.h" // STM32F103RCT6 env:PANDA_PI_V29 // // ARM Cortex-M4F diff --git a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h new file mode 100644 index 000000000000..a3c68e644a47 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h @@ -0,0 +1,222 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "env_validate.h" + +#define BOARD_INFO_NAME "PANDA PI V2.9" + +// Release PB3/PB4 (TMC_SW Pins) from JTAG pins +#define DISABLE_JTAG + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB +#endif + +// +// Servos +// +#define SERVO0_PIN PA11 // SERVOS + +// +// Limit Switches +// +#define X_STOP_PIN PA3 // X-STOP +#define Y_STOP_PIN PC9 // Y-STOP +#define Z_STOP_PIN PA1 // Z-STOP + +// +// Z Probe must be this pin +// +//#define Z_MIN_PROBE_PIN PA1 // PROBE + +// +// Filament Runout Sensor +// +//#ifndef FIL_RUNOUT_PIN +// #define FIL_RUNOUT_PIN PC2 // E0-STOP +//#endif + +// +// Steppers +// +#define X_ENABLE_PIN PC12 +#define X_STEP_PIN PC11 +#define X_DIR_PIN PB6 + +#define Y_ENABLE_PIN PC12 +#define Y_STEP_PIN PB5 +#define Y_DIR_PIN PB4 + +#define Z_ENABLE_PIN PC12 +#define Z_STEP_PIN PB3 +#define Z_DIR_PIN PA15 + +#define E0_ENABLE_PIN PC12 +#define E0_STEP_PIN PB15 +#define E0_DIR_PIN PB14 + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PB5 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PB4 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PB3 + #endif +#endif + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL MSerial1 + //#define Y_HARDWARE_SERIAL MSerial1 + //#define Z_HARDWARE_SERIAL MSerial1 + //#define E0_HARDWARE_SERIAL MSerial1 + + #define X_SERIAL_TX_PIN PC10 + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + + #define Y_SERIAL_TX_PIN PC11 + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + + #define Z_SERIAL_TX_PIN PC12 + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + + #define E0_SERIAL_TX_PIN PD2 + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PB0 // Analog Input "TH0" +#define TEMP_BED_PIN PB1 // Analog Input "TB0" +#define TEMP_1_PIN PA2 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB12 // "HE" +#define HEATER_BED_PIN PB13 // "HB" +#define FAN_PIN PA8 // "FAN0" +#define HEATER_1_PIN PA12 + +// +// SD Support +// +#define ONBOARD_SPI_DEVICE 1 // SPI1 +#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card +#define SDSS ONBOARD_SD_CS_PIN + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif +#if SD_CONNECTION_IS(ONBOARD) + //#define SD_DETECT_PIN PA4 + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PA7 +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "SD CUSTOM_CABLE is not compatible with SKR E3 DIP." +#endif + +// +// LCD / Controller +// +#if HAS_WIRED_LCD + #define BTN_ENC PA0 + #define BTN_EN1 PC4 + #define BTN_EN2 PC5 + + #define LCD_PINS_RS PC0 + #define LCD_PINS_ENABLE PC2 + #define LCD_PINS_D4 PC1 +#endif + +#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) + + #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_E3_DIP.h' for details. Comment out this line to continue." + + /** FYSETC TFT TFT81050 display pinout + * + * Board Display + * ----- ----- + * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) + * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) MOD_RESET | 3 4 | SD_CS (PA10) + * (FREE) PB9 | 5 6 PA10 (SD_CS) (PB8) LCD_CS | 5 6 MOSI (SPI1-MOSI) + * RESET | 7 8 | PA9 (MOD_RESET) (PA15) SD_DET | 7 8 | RESET + * (BEEPER) PB6 | 9 10| PA15 (SD_DET) GND | 9 10| 5V + * ----- ----- + * EXP1 EXP1 + * + * Needs custom cable: + * + * Board Adapter Display + * _________ + * EXP1-1 ----------- EXP1-10 + * EXP1-2 ----------- EXP1-9 + * SPI1-4 ----------- EXP1-6 + * EXP1-4 ----------- EXP1-5 + * SP11-3 ----------- EXP1-2 + * EXP1-6 ----------- EXP1-4 + * EXP1-7 ----------- EXP1-8 + * EXP1-8 ----------- EXP1-3 + * SPI1-1 ----------- EXP1-1 + * EXP1-10 ----------- EXP1-7 + */ + + #define CLCD_SPI_BUS 1 // SPI1 connector + + #define BEEPER_PIN PB6 + + #define CLCD_MOD_RESET PA9 + #define CLCD_SPI_CS PB8 + + #if SD_CONNECTION_IS(LCD) && BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) + #define SD_DETECT_PIN PA15 + #define SD_SS_PIN PA10 + #endif + +#elif HAS_WIRED_LCD + + #define BEEPER_PIN PC3 + +#endif diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 07b75e4e9458..9002f81a8143 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -73,6 +73,17 @@ build_flags = ${env:STM32F103RC_btt.build_flags} -DUSBD_USE_CDC_MSC build_unflags = ${common_stm32.build_unflags} -DUSBD_USE_CDC +# +# Panda Pi V2.9 - Standalone (STM32F103RC) +# Headless, without direct Pi control, but potentially hosting OctoPrint, stepdaemon, etc. +# +[env:PANDA_PI_V29] +extends = common_STM32F103RC_variant +build_flags = ${common_STM32F103RC_variant.build_flags} + -DTIMER_SERVO=TIM1 +board_build.offset = 0x5000 +board_upload.offset_address = 0x08005000 + # # MKS Robin (STM32F103ZET6) # Uses HAL STM32 to support Marlin UI for TFT screen with optional touch panel From 05dea4e30a1768913ec7d1f38c65b9423200a558 Mon Sep 17 00:00:00 2001 From: Fredrik Andersson Date: Mon, 21 Mar 2022 02:14:45 +0100 Subject: [PATCH 179/502] =?UTF-8?q?=E2=9C=A8=20Encoder=20button=20noise=20?= =?UTF-8?q?filter=20(#23925)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/marlinui.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 83eb332105d6..b28687ee9173 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -680,7 +680,31 @@ class MarlinUI { #endif static void update_buttons(); - static bool button_pressed() { return BUTTON_CLICK() || TERN(TOUCH_SCREEN, touch_pressed(), false); } + + #if HAS_ENCODER_NOISE + #ifndef ENCODER_SAMPLES + #define ENCODER_SAMPLES 10 + #endif + + /** + * Some printers may have issues with EMI noise especially using a motherboard with 3.3V logic levels + * it may cause the logical LOW to float into the undefined region and register as a logical HIGH + * causing it to errorenously register as if someone clicked the button and in worst case make the printer + * unusable in practice. + */ + static bool hw_button_pressed() { + LOOP_L_N(s, ENCODER_SAMPLES) { + if (!BUTTON_CLICK()) return false; + safe_delay(1); + } + return true; + } + #else + static bool hw_button_pressed() { return BUTTON_CLICK(); } + #endif + + static bool button_pressed() { return hw_button_pressed() || TERN0(TOUCH_SCREEN, touch_pressed()); } + #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) static void wait_for_release(); #endif From 5dae8a67344cfeda3de6d40fcd14498542004fe9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 15:30:29 -0500 Subject: [PATCH 180/502] =?UTF-8?q?=F0=9F=9A=B8=20Allow=20one=20servo=20wi?= =?UTF-8?q?th=20cutter=20on=20RAMPS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/ramps/pins_RAMPS.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 29caaf0533b9..c7ef0be99e64 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -270,7 +270,7 @@ // M3/M4/M5 - Spindle/Laser Control // #if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN) - #if !NUM_SERVOS // Use servo connector if possible + #if NUM_SERVOS < 2 // Use servo connector if possible #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM #define SPINDLE_DIR_PIN 5 From cc4c2c2f98a1742d6b462481f74dacf5b5b93961 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 18:11:01 -0500 Subject: [PATCH 181/502] =?UTF-8?q?=F0=9F=94=A8=20Allow=20I2CPE=5FENC=5Fn?= =?UTF-8?q?=5FINVERT=20set=20to=20false?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/encoder_i2c.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/encoder_i2c.cpp b/Marlin/src/feature/encoder_i2c.cpp index 2ccd686a992d..fa14c9ac715d 100644 --- a/Marlin/src/feature/encoder_i2c.cpp +++ b/Marlin/src/feature/encoder_i2c.cpp @@ -489,7 +489,7 @@ void I2CPositionEncodersMgr::init() { encoders[i].set_stepper_ticks(I2CPE_ENC_1_TICKS_REV); #endif #ifdef I2CPE_ENC_1_INVERT - encoders[i].set_inverted(I2CPE_ENC_1_INVERT); + encoders[i].set_inverted(ENABLED(I2CPE_ENC_1_INVERT)); #endif #ifdef I2CPE_ENC_1_EC_METHOD encoders[i].set_ec_method(I2CPE_ENC_1_EC_METHOD); @@ -518,7 +518,7 @@ void I2CPositionEncodersMgr::init() { encoders[i].set_stepper_ticks(I2CPE_ENC_2_TICKS_REV); #endif #ifdef I2CPE_ENC_2_INVERT - encoders[i].set_inverted(I2CPE_ENC_2_INVERT); + encoders[i].set_inverted(ENABLED(I2CPE_ENC_2_INVERT)); #endif #ifdef I2CPE_ENC_2_EC_METHOD encoders[i].set_ec_method(I2CPE_ENC_2_EC_METHOD); @@ -547,7 +547,7 @@ void I2CPositionEncodersMgr::init() { encoders[i].set_stepper_ticks(I2CPE_ENC_3_TICKS_REV); #endif #ifdef I2CPE_ENC_3_INVERT - encoders[i].set_inverted(I2CPE_ENC_3_INVERT); + encoders[i].set_inverted(ENABLED(I2CPE_ENC_3_INVERT)); #endif #ifdef I2CPE_ENC_3_EC_METHOD encoders[i].set_ec_method(I2CPE_ENC_3_EC_METHOD); @@ -576,7 +576,7 @@ void I2CPositionEncodersMgr::init() { encoders[i].set_stepper_ticks(I2CPE_ENC_4_TICKS_REV); #endif #ifdef I2CPE_ENC_4_INVERT - encoders[i].set_inverted(I2CPE_ENC_4_INVERT); + encoders[i].set_inverted(ENABLED(I2CPE_ENC_4_INVERT)); #endif #ifdef I2CPE_ENC_4_EC_METHOD encoders[i].set_ec_method(I2CPE_ENC_4_EC_METHOD); @@ -605,7 +605,7 @@ void I2CPositionEncodersMgr::init() { encoders[i].set_stepper_ticks(I2CPE_ENC_5_TICKS_REV); #endif #ifdef I2CPE_ENC_5_INVERT - encoders[i].set_inverted(I2CPE_ENC_5_INVERT); + encoders[i].set_inverted(ENABLED(I2CPE_ENC_5_INVERT)); #endif #ifdef I2CPE_ENC_5_EC_METHOD encoders[i].set_ec_method(I2CPE_ENC_5_EC_METHOD); @@ -634,7 +634,7 @@ void I2CPositionEncodersMgr::init() { encoders[i].set_stepper_ticks(I2CPE_ENC_6_TICKS_REV); #endif #ifdef I2CPE_ENC_6_INVERT - encoders[i].set_inverted(I2CPE_ENC_6_INVERT); + encoders[i].set_inverted(ENABLED(I2CPE_ENC_6_INVERT)); #endif #ifdef I2CPE_ENC_6_EC_METHOD encoders[i].set_ec_method(I2CPE_ENC_6_EC_METHOD); From b0a400da72f6752619a82246fac55a07a4e67f3c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 18:14:17 -0500 Subject: [PATCH 182/502] =?UTF-8?q?=F0=9F=A9=B9=20No=20PE=5FMAGNET=5FON=5F?= =?UTF-8?q?STATE=20without=20PARKING=5FEXTRUDER?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/solenoid.cpp | 18 ++++++------------ Marlin/src/feature/solenoid.h | 1 - Marlin/src/gcode/control/M380_M381.cpp | 2 +- Marlin/src/gcode/gcode.h | 4 ++-- Marlin/src/module/tool_change.cpp | 2 +- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Marlin/src/feature/solenoid.cpp b/Marlin/src/feature/solenoid.cpp index b6795d1a1ef8..f78a529280ea 100644 --- a/Marlin/src/feature/solenoid.cpp +++ b/Marlin/src/feature/solenoid.cpp @@ -27,17 +27,11 @@ #include "solenoid.h" #include "../module/motion.h" // for active_extruder - -// PARKING_EXTRUDER options alter the default behavior of solenoids, this ensures compliance of M380-381 - -#if ENABLED(PARKING_EXTRUDER) - #include "../module/tool_change.h" -#endif +#include "../module/tool_change.h" // Used primarily with MANUAL_SOLENOID_CONTROL -static void set_solenoid(const uint8_t num, const bool active) { - const uint8_t value = active ? PE_MAGNET_ON_STATE : !PE_MAGNET_ON_STATE; - #define _SOL_CASE(N) case N: TERN_(HAS_SOLENOID_##N, OUT_WRITE(SOL##N##_PIN, value)); break; +static void set_solenoid(const uint8_t num, const uint8_t state) { + #define _SOL_CASE(N) case N: TERN_(HAS_SOLENOID_##N, OUT_WRITE(SOL##N##_PIN, state)); break; switch (num) { REPEAT(8, _SOL_CASE) default: SERIAL_ECHO_MSG(STR_INVALID_SOLENOID); break; @@ -49,9 +43,9 @@ static void set_solenoid(const uint8_t num, const bool active) { #endif } -void enable_solenoid(const uint8_t num) { set_solenoid(num, true); } -void disable_solenoid(const uint8_t num) { set_solenoid(num, false); } -void enable_solenoid_on_active_extruder() { } +// PARKING_EXTRUDER options alter the default behavior of solenoids to ensure compliance of M380-381 +void enable_solenoid(const uint8_t num) { set_solenoid(num, TERN1(PARKING_EXTRUDER, PE_MAGNET_ON_STATE)); } +void disable_solenoid(const uint8_t num) { set_solenoid(num, TERN0(PARKING_EXTRUDER, !PE_MAGNET_ON_STATE)); } void disable_all_solenoids() { #define _SOL_DISABLE(N) TERN_(HAS_SOLENOID_##N, disable_solenoid(N)); diff --git a/Marlin/src/feature/solenoid.h b/Marlin/src/feature/solenoid.h index 2ba4983fb000..3131aeb868d4 100644 --- a/Marlin/src/feature/solenoid.h +++ b/Marlin/src/feature/solenoid.h @@ -21,7 +21,6 @@ */ #pragma once -void enable_solenoid_on_active_extruder(); void disable_all_solenoids(); void enable_solenoid(const uint8_t num); void disable_solenoid(const uint8_t num); diff --git a/Marlin/src/gcode/control/M380_M381.cpp b/Marlin/src/gcode/control/M380_M381.cpp index 3f5b25246543..6bcec891e281 100644 --- a/Marlin/src/gcode/control/M380_M381.cpp +++ b/Marlin/src/gcode/control/M380_M381.cpp @@ -37,7 +37,7 @@ void GcodeSuite::M380() { #if ENABLED(MANUAL_SOLENOID_CONTROL) enable_solenoid(parser.intval('S', active_extruder)); #else - enable_solenoid_on_active_extruder(); + enable_solenoid(active_extruder); #endif } diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 6e331c127383..61fe6cb9d96f 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -219,8 +219,8 @@ * M350 - Set microstepping mode. (Requires digital microstepping pins.) * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.) * M355 - Set Case Light on/off and set brightness. (Requires CASE_LIGHT_PIN) - * M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID) - * M381 - Disable all solenoids. (Requires EXT_SOLENOID) + * M380 - Activate solenoid on active tool (Requires EXT_SOLENOID) or the tool specified by 'S' (Requires MANUAL_SOLENOID_CONTROL). + * M381 - Disable solenoids on all tools (Requires EXT_SOLENOID) or the tool specified by 'S' (Requires MANUAL_SOLENOID_CONTROL). * M400 - Finish all moves. * M401 - Deploy and activate Z probe. (Requires a probe) * M402 - Deactivate and stow Z probe. (Requires a probe) diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index f2767f2b5b85..ceed05dcf305 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -1292,7 +1292,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #if ENABLED(EXT_SOLENOID) && DISABLED(PARKING_EXTRUDER) disable_all_solenoids(); - enable_solenoid_on_active_extruder(); + enable_solenoid(active_extruder); #endif #if HAS_PRUSA_MMU1 From 7186037f20a2a2c57624e31c1e99adc37759c5f6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 18:31:54 -0500 Subject: [PATCH 183/502] =?UTF-8?q?=F0=9F=94=A7=20No=20Switching=20Nozzle?= =?UTF-8?q?=20with=20MMU2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index a94846275e44..864f75998293 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1157,6 +1157,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible." #elif ENABLED(SINGLENOZZLE) #error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible." + #elif HAS_PRUSA_MMU2 + #error "SWITCHING_NOZZLE and PRUSA_MMU2(S) are incompatible." #elif EXTRUDERS != 2 #error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS." #elif NUM_SERVOS < 1 From 72f207f4895d5db34f697cb203876405b98d89c8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 18:53:42 -0500 Subject: [PATCH 184/502] =?UTF-8?q?=F0=9F=94=A7=20Sanity-checks=20for=20PU?= =?UTF-8?q?LLDOWN,=20SINGLENOZZLE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 864f75998293..74dd77c55c71 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -783,11 +783,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #if !defined(TARGET_LPC1768) && ANY( \ - ENDSTOPPULLDOWNS, \ - ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, \ - ENDSTOPPULLDOWN_ZMAX, ENDSTOPPULLDOWN_XMIN, \ - ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN \ - ) + ENDSTOPPULLDOWNS, ENDSTOPPULLDOWN_ZMIN_PROBE, \ + ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, ENDSTOPPULLDOWN_ZMAX, \ + ENDSTOPPULLDOWN_XMIN, ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN, \ + FIL_RUNOUT_PULLDOWN, \ + FIL_RUNOUT1_PULLDOWN, FIL_RUNOUT2_PULLDOWN, FIL_RUNOUT3_PULLDOWN, FIL_RUNOUT4_PULLDOWN, \ + FIL_RUNOUT5_PULLDOWN, FIL_RUNOUT6_PULLDOWN, FIL_RUNOUT7_PULLDOWN, FIL_RUNOUT8_PULLDOWN, \ + POWER_LOSS_PULLDOWN, CALIBRATION_PIN_PULLDOWN \ + ) #error "PULLDOWN pin mode is not available on the selected board." #endif @@ -1146,6 +1149,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif ENABLED(SINGLENOZZLE) #error "SINGLENOZZLE requires 2 or more EXTRUDERS." + #if ENABLED(PID_PARAMS_PER_HOTEND) + #error "PID_PARAMS_PER_HOTEND must be disabled when using any SINGLENOZZLE extruder." + #endif #endif From abfb0411809568970221281a3614e30970f0dfc1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 19:08:00 -0500 Subject: [PATCH 185/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Add?= =?UTF-8?q?=20neo.set=5Fbackground=5Fcolor(rgbw)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/leds/neopixel.cpp | 8 ++++---- Marlin/src/feature/leds/neopixel.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/leds/neopixel.cpp b/Marlin/src/feature/leds/neopixel.cpp index 3569cb180d53..4f104234f15c 100644 --- a/Marlin/src/feature/leds/neopixel.cpp +++ b/Marlin/src/feature/leds/neopixel.cpp @@ -44,14 +44,14 @@ Adafruit_NeoPixel Marlin_NeoPixel::adaneo1(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIX #ifdef NEOPIXEL_BKGD_INDEX_FIRST - void Marlin_NeoPixel::set_background_color(uint8_t r, uint8_t g, uint8_t b, uint8_t w) { - for (int background_led = NEOPIXEL_BKGD_INDEX_FIRST; background_led <= NEOPIXEL_BKGD_INDEX_LAST; background_led++) + void Marlin_NeoPixel::set_background_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w) { + for (int background_led = NEOPIXEL_BKGD_INDEX_FIRST; background_led <= NEOPIXEL_BKGD_INDEX_LAST; background_led++) set_pixel_color(background_led, adaneo1.Color(r, g, b, w)); } void Marlin_NeoPixel::reset_background_color() { constexpr uint8_t background_color[4] = NEOPIXEL_BKGD_COLOR; - set_background_color(background_color[0], background_color[1], background_color[2], background_color[3]); + set_background_color(background_color); } #endif @@ -108,7 +108,7 @@ void Marlin_NeoPixel::init() { set_color(adaneo1.Color TERN(LED_USER_PRESET_STARTUP, (LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE), - (0, 0, 0, 0)) + (255, 255, 255, 255)) ); } diff --git a/Marlin/src/feature/leds/neopixel.h b/Marlin/src/feature/leds/neopixel.h index 1a38ed1a196d..d71aa25770fc 100644 --- a/Marlin/src/feature/leds/neopixel.h +++ b/Marlin/src/feature/leds/neopixel.h @@ -88,7 +88,8 @@ class Marlin_NeoPixel { static void set_color(const uint32_t c); #ifdef NEOPIXEL_BKGD_INDEX_FIRST - static void set_background_color(uint8_t r, uint8_t g, uint8_t b, uint8_t w); + static void set_background_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w); + static void set_background_color(const uint8_t (&rgbw)[4]) { set_background_color(rgbw[0], rgbw[1], rgbw[2], rgbw[3]); } static void reset_background_color(); #endif From 10a0c9a9b3d4070326954c5c2354cfd8ba490f0c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 19:20:19 -0500 Subject: [PATCH 186/502] =?UTF-8?q?=F0=9F=94=A8=20Suppress=20MMU2=20resume?= =?UTF-8?q?=5Fposition=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/mmu/mmu2.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp index 28dea681ef47..7a7e27f28795 100644 --- a/Marlin/src/feature/mmu/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -821,6 +821,9 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { LCD_MESSAGE(MSG_MMU2_RESUMING); ATTN_BUZZ(true); + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" + if (move_axes && all_axes_homed()) { // Move XY to starting position, then Z do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE)); @@ -828,6 +831,8 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { // Move Z_AXIS to saved position do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); } + + #pragma GCC diagnostic pop } } } From ced0ad8e094baecf6e3ee8eaa36c61baaa5743fc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 19:17:12 -0500 Subject: [PATCH 187/502] =?UTF-8?q?=F0=9F=8E=A8=20Apply=20=5FTERN=20where?= =?UTF-8?q?=20possible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/calibrate/G28.cpp | 28 +++--- .../src/gcode/feature/trinamic/M911-M914.cpp | 88 +++++-------------- Marlin/src/inc/SanityCheck.h | 4 +- Marlin/src/module/motion.cpp | 40 +++------ Marlin/src/module/stepper/trinamic.cpp | 55 +++--------- 5 files changed, 57 insertions(+), 158 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 9361790d74cf..681df55f209f 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -82,15 +82,13 @@ #if ENABLED(SENSORLESS_HOMING) sensorless_t stealth_states { - LINEAR_AXIS_LIST(tmc_enable_stallguard(stepperX), tmc_enable_stallguard(stepperY), false, false, false, false) - , false - #if AXIS_HAS_STALLGUARD(X2) - || tmc_enable_stallguard(stepperX2) - #endif - , false - #if AXIS_HAS_STALLGUARD(Y2) - || tmc_enable_stallguard(stepperY2) - #endif + LINEAR_AXIS_LIST( + TERN0(X_SENSORLESS, tmc_enable_stallguard(stepperX)), + TERN0(Y_SENSORLESS, tmc_enable_stallguard(stepperY)), + false, false, false, false + ) + , TERN0(X2_SENSORLESS, tmc_enable_stallguard(stepperX2)) + , TERN0(Y2_SENSORLESS, tmc_enable_stallguard(stepperY2)) }; #endif @@ -101,14 +99,10 @@ current_position.set(0.0, 0.0); #if ENABLED(SENSORLESS_HOMING) && DISABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - tmc_disable_stallguard(stepperX, stealth_states.x); - tmc_disable_stallguard(stepperY, stealth_states.y); - #if AXIS_HAS_STALLGUARD(X2) - tmc_disable_stallguard(stepperX2, stealth_states.x2); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - tmc_disable_stallguard(stepperY2, stealth_states.y2); - #endif + TERN_(X_SENSORLESS, tmc_disable_stallguard(stepperX, stealth_states.x)); + TERN_(X2_SENSORLESS, tmc_disable_stallguard(stepperX2, stealth_states.x2)); + TERN_(Y_SENSORLESS, tmc_disable_stallguard(stepperY, stealth_states.y)); + TERN_(Y2_SENSORLESS, tmc_disable_stallguard(stepperY2, stealth_states.y2)); #endif } diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index b37c81733c7c..57a77c0e5d4e 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -457,92 +457,48 @@ switch (i) { #if X_SENSORLESS case X_AXIS: - #if AXIS_HAS_STALLGUARD(X) - if (index < 2) stepperX.homing_threshold(value); - #endif - #if AXIS_HAS_STALLGUARD(X2) - if (!(index & 1)) stepperX2.homing_threshold(value); - #endif + if (index < 2) stepperX.homing_threshold(value); + TERN_(X2_SENSORLESS, if (!(index & 1)) stepperX2.homing_threshold(value)); break; #endif #if Y_SENSORLESS case Y_AXIS: - #if AXIS_HAS_STALLGUARD(Y) - if (index < 2) stepperY.homing_threshold(value); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - if (!(index & 1)) stepperY2.homing_threshold(value); - #endif + if (index < 2) stepperY.homing_threshold(value); + TERN_(Y2_SENSORLESS, if (!(index & 1)) stepperY2.homing_threshold(value)); break; #endif #if Z_SENSORLESS case Z_AXIS: - #if AXIS_HAS_STALLGUARD(Z) - if (index < 2) stepperZ.homing_threshold(value); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - if (index == 0 || index == 2) stepperZ2.homing_threshold(value); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - if (index == 0 || index == 3) stepperZ3.homing_threshold(value); - #endif - #if AXIS_HAS_STALLGUARD(Z4) - if (index == 0 || index == 4) stepperZ4.homing_threshold(value); - #endif + if (index < 2) stepperZ.homing_threshold(value); + TERN_(Z2_SENSORLESS, if (index == 0 || index == 2) stepperZ2.homing_threshold(value)); + TERN_(Z3_SENSORLESS, if (index == 0 || index == 3) stepperZ3.homing_threshold(value)); + TERN_(Z4_SENSORLESS, if (index == 0 || index == 4) stepperZ4.homing_threshold(value)); break; #endif - #if I_SENSORLESS && AXIS_HAS_STALLGUARD(I) + #if I_SENSORLESS case I_AXIS: stepperI.homing_threshold(value); break; #endif - #if J_SENSORLESS && AXIS_HAS_STALLGUARD(J) + #if J_SENSORLESS case J_AXIS: stepperJ.homing_threshold(value); break; #endif - #if K_SENSORLESS && AXIS_HAS_STALLGUARD(K) + #if K_SENSORLESS case K_AXIS: stepperK.homing_threshold(value); break; #endif } } if (report) { - #if X_SENSORLESS - #if AXIS_HAS_STALLGUARD(X) - tmc_print_sgt(stepperX); - #endif - #if AXIS_HAS_STALLGUARD(X2) - tmc_print_sgt(stepperX2); - #endif - #endif - #if Y_SENSORLESS - #if AXIS_HAS_STALLGUARD(Y) - tmc_print_sgt(stepperY); - #endif - #if AXIS_HAS_STALLGUARD(Y2) - tmc_print_sgt(stepperY2); - #endif - #endif - #if Z_SENSORLESS - #if AXIS_HAS_STALLGUARD(Z) - tmc_print_sgt(stepperZ); - #endif - #if AXIS_HAS_STALLGUARD(Z2) - tmc_print_sgt(stepperZ2); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - tmc_print_sgt(stepperZ3); - #endif - #if AXIS_HAS_STALLGUARD(Z4) - tmc_print_sgt(stepperZ4); - #endif - #endif - #if I_SENSORLESS && AXIS_HAS_STALLGUARD(I) - tmc_print_sgt(stepperI); - #endif - #if J_SENSORLESS && AXIS_HAS_STALLGUARD(J) - tmc_print_sgt(stepperJ); - #endif - #if K_SENSORLESS && AXIS_HAS_STALLGUARD(K) - tmc_print_sgt(stepperK); - #endif + TERN_(X_SENSORLESS, tmc_print_sgt(stepperX)); + TERN_(X2_SENSORLESS, tmc_print_sgt(stepperX2)); + TERN_(Y_SENSORLESS, tmc_print_sgt(stepperY)); + TERN_(Y2_SENSORLESS, tmc_print_sgt(stepperY2)); + TERN_(Z_SENSORLESS, tmc_print_sgt(stepperZ)); + TERN_(Z2_SENSORLESS, tmc_print_sgt(stepperZ2)); + TERN_(Z3_SENSORLESS, tmc_print_sgt(stepperZ3)); + TERN_(Z4_SENSORLESS, tmc_print_sgt(stepperZ4)); + TERN_(I_SENSORLESS, tmc_print_sgt(stepperI)); + TERN_(J_SENSORLESS, tmc_print_sgt(stepperJ)); + TERN_(K_SENSORLESS, tmc_print_sgt(stepperK)); } } diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 74dd77c55c71..617d117415b0 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1655,9 +1655,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Require pin options and pins to be defined */ #if ENABLED(SENSORLESS_PROBING) - #if ENABLED(DELTA) && !(AXIS_HAS_STALLGUARD(X) && AXIS_HAS_STALLGUARD(Y) && AXIS_HAS_STALLGUARD(Z)) + #if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS) #error "SENSORLESS_PROBING requires TMC2130/2160/2209/5130/5160 drivers on X, Y, and Z." - #elif !AXIS_HAS_STALLGUARD(Z) + #elif !Z_SENSORLESS #error "SENSORLESS_PROBING requires a TMC2130/2160/2209/5130/5160 driver on Z." #endif #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 0f8e02db9e5f..7b1e0a3fb9b9 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1359,9 +1359,7 @@ void prepare_line_to_destination() { #if X_SENSORLESS case X_AXIS: stealth_states.x = tmc_enable_stallguard(stepperX); - #if AXIS_HAS_STALLGUARD(X2) - stealth_states.x2 = tmc_enable_stallguard(stepperX2); - #endif + TERN_(X2_SENSORLESS, stealth_states.x2 = tmc_enable_stallguard(stepperX2)); #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && Y_SENSORLESS stealth_states.y = tmc_enable_stallguard(stepperY); #elif CORE_IS_XZ && Z_SENSORLESS @@ -1372,9 +1370,7 @@ void prepare_line_to_destination() { #if Y_SENSORLESS case Y_AXIS: stealth_states.y = tmc_enable_stallguard(stepperY); - #if AXIS_HAS_STALLGUARD(Y2) - stealth_states.y2 = tmc_enable_stallguard(stepperY2); - #endif + TERN_(Y2_SENSORLESS, stealth_states.y2 = tmc_enable_stallguard(stepperY2)); #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && X_SENSORLESS stealth_states.x = tmc_enable_stallguard(stepperX); #elif CORE_IS_YZ && Z_SENSORLESS @@ -1385,15 +1381,9 @@ void prepare_line_to_destination() { #if Z_SENSORLESS case Z_AXIS: stealth_states.z = tmc_enable_stallguard(stepperZ); - #if AXIS_HAS_STALLGUARD(Z2) - stealth_states.z2 = tmc_enable_stallguard(stepperZ2); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - stealth_states.z3 = tmc_enable_stallguard(stepperZ3); - #endif - #if AXIS_HAS_STALLGUARD(Z4) - stealth_states.z4 = tmc_enable_stallguard(stepperZ4); - #endif + TERN_(Z2_SENSORLESS, stealth_states.z2 = tmc_enable_stallguard(stepperZ2)); + TERN_(Z3_SENSORLESS, stealth_states.z3 = tmc_enable_stallguard(stepperZ3)); + TERN_(Z4_SENSORLESS, stealth_states.z4 = tmc_enable_stallguard(stepperZ4)); #if CORE_IS_XZ && X_SENSORLESS stealth_states.x = tmc_enable_stallguard(stepperX); #elif CORE_IS_YZ && Y_SENSORLESS @@ -1445,9 +1435,7 @@ void prepare_line_to_destination() { #if X_SENSORLESS case X_AXIS: tmc_disable_stallguard(stepperX, enable_stealth.x); - #if AXIS_HAS_STALLGUARD(X2) - tmc_disable_stallguard(stepperX2, enable_stealth.x2); - #endif + TERN_(X2_SENSORLESS, tmc_disable_stallguard(stepperX2, enable_stealth.x2)); #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && Y_SENSORLESS tmc_disable_stallguard(stepperY, enable_stealth.y); #elif CORE_IS_XZ && Z_SENSORLESS @@ -1458,9 +1446,7 @@ void prepare_line_to_destination() { #if Y_SENSORLESS case Y_AXIS: tmc_disable_stallguard(stepperY, enable_stealth.y); - #if AXIS_HAS_STALLGUARD(Y2) - tmc_disable_stallguard(stepperY2, enable_stealth.y2); - #endif + TERN_(Y2_SENSORLESS, tmc_disable_stallguard(stepperY2, enable_stealth.y2)); #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) && X_SENSORLESS tmc_disable_stallguard(stepperX, enable_stealth.x); #elif CORE_IS_YZ && Z_SENSORLESS @@ -1471,15 +1457,9 @@ void prepare_line_to_destination() { #if Z_SENSORLESS case Z_AXIS: tmc_disable_stallguard(stepperZ, enable_stealth.z); - #if AXIS_HAS_STALLGUARD(Z2) - tmc_disable_stallguard(stepperZ2, enable_stealth.z2); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - tmc_disable_stallguard(stepperZ3, enable_stealth.z3); - #endif - #if AXIS_HAS_STALLGUARD(Z4) - tmc_disable_stallguard(stepperZ4, enable_stealth.z4); - #endif + TERN_(Z2_SENSORLESS, tmc_disable_stallguard(stepperZ2, enable_stealth.z2)); + TERN_(Z3_SENSORLESS, tmc_disable_stallguard(stepperZ3, enable_stealth.z3)); + TERN_(Z4_SENSORLESS, tmc_disable_stallguard(stepperZ4, enable_stealth.z4)); #if CORE_IS_XZ && X_SENSORLESS tmc_disable_stallguard(stepperX, enable_stealth.x); #elif CORE_IS_YZ && Y_SENSORLESS diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index 7baa2108f06a..af09623dc1bb 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -906,49 +906,18 @@ void reset_trinamic_drivers() { #endif #if USE_SENSORLESS - #if X_SENSORLESS - stepperX.homing_threshold(X_STALL_SENSITIVITY); - #if AXIS_HAS_STALLGUARD(X2) - stepperX2.homing_threshold(CAT(TERN(X2_SENSORLESS, X2, X), _STALL_SENSITIVITY)); - #endif - #endif - #if Y_SENSORLESS - stepperY.homing_threshold(Y_STALL_SENSITIVITY); - #if AXIS_HAS_STALLGUARD(Y2) - stepperY2.homing_threshold(CAT(TERN(Y2_SENSORLESS, Y2, Y), _STALL_SENSITIVITY)); - #endif - #endif - #if Z_SENSORLESS - stepperZ.homing_threshold(Z_STALL_SENSITIVITY); - #if AXIS_HAS_STALLGUARD(Z2) - stepperZ2.homing_threshold(CAT(TERN(Z2_SENSORLESS, Z2, Z), _STALL_SENSITIVITY)); - #endif - #if AXIS_HAS_STALLGUARD(Z3) - stepperZ3.homing_threshold(CAT(TERN(Z3_SENSORLESS, Z3, Z), _STALL_SENSITIVITY)); - #endif - #if AXIS_HAS_STALLGUARD(Z4) - stepperZ4.homing_threshold(CAT(TERN(Z4_SENSORLESS, Z4, Z), _STALL_SENSITIVITY)); - #endif - #endif - #if I_SENSORLESS - stepperI.homing_threshold(I_STALL_SENSITIVITY); - #if AXIS_HAS_STALLGUARD(I) - stepperI.homing_threshold(CAT(TERN(I_SENSORLESS, I, I), _STALL_SENSITIVITY)); - #endif - #endif - #if J_SENSORLESS - stepperJ.homing_threshold(J_STALL_SENSITIVITY); - #if AXIS_HAS_STALLGUARD(J) - stepperJ.homing_threshold(CAT(TERN(J_SENSORLESS, J, J), _STALL_SENSITIVITY)); - #endif - #endif - #if K_SENSORLESS - stepperK.homing_threshold(K_STALL_SENSITIVITY); - #if AXIS_HAS_STALLGUARD(K) - stepperK.homing_threshold(CAT(TERN(K_SENSORLESS, K, K), _STALL_SENSITIVITY)); - #endif - #endif - #endif // USE SENSORLESS + TERN_(X_SENSORLESS, stepperX.homing_threshold(X_STALL_SENSITIVITY)); + TERN_(X2_SENSORLESS, stepperX2.homing_threshold(CAT(TERN(X2_SENSORLESS, X2, X), _STALL_SENSITIVITY))); + TERN_(Y_SENSORLESS, stepperY.homing_threshold(Y_STALL_SENSITIVITY)); + TERN_(Y2_SENSORLESS, stepperY2.homing_threshold(CAT(TERN(Y2_SENSORLESS, Y2, Y), _STALL_SENSITIVITY))); + TERN_(Z_SENSORLESS, stepperZ.homing_threshold(Z_STALL_SENSITIVITY)); + TERN_(Z2_SENSORLESS, stepperZ2.homing_threshold(CAT(TERN(Z2_SENSORLESS, Z2, Z), _STALL_SENSITIVITY))); + TERN_(Z3_SENSORLESS, stepperZ3.homing_threshold(CAT(TERN(Z3_SENSORLESS, Z3, Z), _STALL_SENSITIVITY))); + TERN_(Z4_SENSORLESS, stepperZ4.homing_threshold(CAT(TERN(Z4_SENSORLESS, Z4, Z), _STALL_SENSITIVITY))); + TERN_(I_SENSORLESS, stepperI.homing_threshold(I_STALL_SENSITIVITY)); + TERN_(J_SENSORLESS, stepperJ.homing_threshold(J_STALL_SENSITIVITY)); + TERN_(K_SENSORLESS, stepperK.homing_threshold(K_STALL_SENSITIVITY)); + #endif #ifdef TMC_ADV TMC_ADV() From 039a22649f4e0201d7580b63c1a414450353438a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 19:56:07 -0500 Subject: [PATCH 188/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20PIO?= =?UTF-8?q?=20--silent=20in=20build=5Fexample?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/build_example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/bin/build_example b/buildroot/bin/build_example index 8ebb58f972e1..cff8ea253e62 100755 --- a/buildroot/bin/build_example +++ b/buildroot/bin/build_example @@ -24,6 +24,6 @@ cp "$SUB"/_Statusscreen.h Marlin/ 2>/dev/null echo "Building the firmware now..." HERE=`dirname "$0"` -$HERE/mftest -a -n1 || { echo "Failed"; exit 1; } +$HERE/mftest -s -a -n1 || { echo "Failed"; exit 1; } echo "Success" From fba8805c0cd87845c80d9cd7738b94332a35e27b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 20:11:10 -0500 Subject: [PATCH 189/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20ADC=20math=20overf?= =?UTF-8?q?low?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/marlinui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 786a865049fa..11b523ff537a 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1206,7 +1206,7 @@ void MarlinUI::init() { #define ADC_BUTTON_VALUE(r) raw_adc_t(HAL_ADC_RANGE * (ADC_BUTTONS_VALUE_SCALE) * r / (r + ADC_BUTTONS_R_PULLUP)) static constexpr raw_adc_t adc_button_tolerance = HAL_ADC_RANGE * 25 / 1024, - adc_other_button = HAL_ADC_RANGE * 1000 / 1024; + adc_other_button = raw_adc_t(uint32_t(HAL_ADC_RANGE * 1000UL) / 1024UL); static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = { // VALUE_MIN, VALUE_MAX, KEY { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F1 }, // F1 From 2d99a608fd993fd5cb75223b72deadfc969a13c1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 20:11:58 -0500 Subject: [PATCH 190/502] =?UTF-8?q?=F0=9F=94=A8=20Fix=20'mftest=20-s'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/mftest | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/buildroot/bin/mftest b/buildroot/bin/mftest index 77e53ff9ace4..9aa5e127327e 100755 --- a/buildroot/bin/mftest +++ b/buildroot/bin/mftest @@ -17,6 +17,7 @@ usage() { Usage: mftest [-t|--env=] [-n|--num=] [-m|--make] [-y|--build=] mftest [-a|--autobuild] mftest [-r|--rebuild] + mftest [-s|--silent] mftest [-u|--autoupload] [-n|--num=] OPTIONS @@ -30,7 +31,7 @@ OPTIONS -v --verbose Extra output for debugging. -s --silent Silence build output from PlatformIO. -env shortcuts: tree due esp lin lpc|lpc8 lpc9 m128 m256|mega stm|f1 f4 f7 s6 teensy|t31|t32 t35|t36 t40|t41 +env shortcuts: tree due esp lin lp8|lpc8 lp9|lpc9 m128 m256|mega stm|f1 f4 f7 s6 teensy|t31|t32 t35|t36 t40|t41 " } @@ -52,7 +53,7 @@ TESTENV='-' CHOICE=0 DEBUG=0 -while getopts 'abhmruvyn:t:-:' OFLAG; do +while getopts 'abhmrsuvyn:t:-:' OFLAG; do case "${OFLAG}" in a) AUTO_BUILD=1 ; bugout "Auto-Build target..." ;; h) EXIT_USAGE=1 ;; @@ -84,6 +85,7 @@ while getopts 'abhmruvyn:t:-:' OFLAG; do esac ;; rebuild) REBUILD=1 ; bugout "Rebuilding previous..." ;; + silent) SILENT_FLAG="-s" ;; make) USE_MAKE=1 ; bugout "Using make with Docker..." ;; debug|verbose) DEBUG=1 ; bugout "Debug ON" ;; build) case "$OVAL" in From b094a3fc0d647f7daff7c4d97db32f9d41e4c11d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 20:31:36 -0500 Subject: [PATCH 191/502] =?UTF-8?q?=F0=9F=8E=A8=20Clean=20up=20tool=20chan?= =?UTF-8?q?ge=20with=20tool=20sensor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/tool_change.cpp | 98 +++++++++++++++---------------- 1 file changed, 48 insertions(+), 50 deletions(-) diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index ceed05dcf305..26815642db02 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -385,65 +385,59 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. #endif // PARKING_EXTRUDER -#if ENABLED(SWITCHING_TOOLHEAD) +#if ENABLED(TOOL_SENSOR) + + bool tool_sensor_disabled; // = false // Return a bitmask of tool sensor states inline uint8_t poll_tool_sensor_pins() { return (0 - #if ENABLED(TOOL_SENSOR) - #if PIN_EXISTS(TOOL_SENSOR1) - | (READ(TOOL_SENSOR1_PIN) << 0) - #endif - #if PIN_EXISTS(TOOL_SENSOR2) - | (READ(TOOL_SENSOR2_PIN) << 1) - #endif - #if PIN_EXISTS(TOOL_SENSOR3) - | (READ(TOOL_SENSOR3_PIN) << 2) - #endif - #if PIN_EXISTS(TOOL_SENSOR4) - | (READ(TOOL_SENSOR4_PIN) << 3) - #endif - #if PIN_EXISTS(TOOL_SENSOR5) - | (READ(TOOL_SENSOR5_PIN) << 4) - #endif - #if PIN_EXISTS(TOOL_SENSOR6) - | (READ(TOOL_SENSOR6_PIN) << 5) - #endif - #if PIN_EXISTS(TOOL_SENSOR7) - | (READ(TOOL_SENSOR7_PIN) << 6) - #endif - #if PIN_EXISTS(TOOL_SENSOR8) - | (READ(TOOL_SENSOR8_PIN) << 7) - #endif + #if PIN_EXISTS(TOOL_SENSOR1) + | (READ(TOOL_SENSOR1_PIN) << 0) + #endif + #if PIN_EXISTS(TOOL_SENSOR2) + | (READ(TOOL_SENSOR2_PIN) << 1) + #endif + #if PIN_EXISTS(TOOL_SENSOR3) + | (READ(TOOL_SENSOR3_PIN) << 2) + #endif + #if PIN_EXISTS(TOOL_SENSOR4) + | (READ(TOOL_SENSOR4_PIN) << 3) + #endif + #if PIN_EXISTS(TOOL_SENSOR5) + | (READ(TOOL_SENSOR5_PIN) << 4) + #endif + #if PIN_EXISTS(TOOL_SENSOR6) + | (READ(TOOL_SENSOR6_PIN) << 5) + #endif + #if PIN_EXISTS(TOOL_SENSOR7) + | (READ(TOOL_SENSOR7_PIN) << 6) + #endif + #if PIN_EXISTS(TOOL_SENSOR8) + | (READ(TOOL_SENSOR8_PIN) << 7) #endif ); } - #if ENABLED(TOOL_SENSOR) - - bool tool_sensor_disabled; // = false - - uint8_t check_tool_sensor_stats(const uint8_t tool_index, const bool kill_on_error/*=false*/, const bool disable/*=false*/) { - static uint8_t sensor_tries; // = 0 - for (;;) { - if (poll_tool_sensor_pins() == _BV(tool_index)) { - sensor_tries = 0; - return tool_index; - } - else if (kill_on_error && (!tool_sensor_disabled || disable)) { - sensor_tries++; - if (sensor_tries > 10) kill(F("Tool Sensor error")); - safe_delay(5); - } - else { - sensor_tries++; - if (sensor_tries > 10) return -1; - safe_delay(5); - } + uint8_t check_tool_sensor_stats(const uint8_t tool_index, const bool kill_on_error/*=false*/, const bool disable/*=false*/) { + static uint8_t sensor_tries; // = 0 + for (;;) { + if (poll_tool_sensor_pins() == _BV(tool_index)) { + sensor_tries = 0; + return tool_index; + } + else if (kill_on_error && (!tool_sensor_disabled || disable)) { + sensor_tries++; + if (sensor_tries > 10) kill(F("Tool Sensor error")); + safe_delay(5); + } + else { + sensor_tries++; + if (sensor_tries > 10) return -1; + safe_delay(5); } } - - #endif + } inline void switching_toolhead_lock(const bool locked) { #ifdef SWITCHING_TOOLHEAD_SERVO_ANGLES @@ -496,9 +490,13 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. switching_toolhead_lock(true); } LCD_MESSAGE_F("TC Success"); - #endif + #endif // TOOL_SENSOR } +#endif // TOOL_SENSOR + +#if ENABLED(SWITCHING_TOOLHEAD) + inline void switching_toolhead_tool_change(const uint8_t new_tool, bool no_move/*=false*/) { if (no_move) return; From 4a8b99d505584d1fa5eb71d588da1bb60c3a2878 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 22:22:08 -0500 Subject: [PATCH 192/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20EXT?= =?UTF-8?q?RUDER=5FLOOP=20macro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/fwretract.cpp | 20 ++++++++++---------- Marlin/src/feature/fwretract.h | 2 +- Marlin/src/feature/powerloss.cpp | 10 +++++----- Marlin/src/gcode/config/M200-M205.cpp | 6 +++--- Marlin/src/gcode/control/M17_M18_M84.cpp | 6 +++--- Marlin/src/gcode/feature/advance/M900.cpp | 18 +++++++++--------- Marlin/src/gcode/feature/pause/M603.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 1 + Marlin/src/lcd/menu/menu_advanced.cpp | 20 ++++++++++---------- Marlin/src/lcd/menu/menu_configuration.cpp | 6 +++--- Marlin/src/lcd/menu/menu_mmu2.cpp | 10 +++++----- Marlin/src/lcd/menu/menu_tune.cpp | 8 ++++---- Marlin/src/module/planner.cpp | 2 +- Marlin/src/module/planner.h | 4 ++-- Marlin/src/module/settings.cpp | 8 ++++---- 15 files changed, 62 insertions(+), 61 deletions(-) diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index 4077d8d1c209..bf47a6b2d557 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -73,10 +73,10 @@ void FWRetract::reset() { settings.swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP; current_hop = 0.0; - LOOP_L_N(i, EXTRUDERS) { - retracted[i] = false; - E_TERN_(retracted_swap[i] = false); - current_retract[i] = 0.0; + EXTRUDER_LOOP() { + retracted[e] = false; + E_TERN_(retracted_swap[e] = false); + current_retract[e] = 0.0; } } @@ -111,10 +111,10 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/)) " swapping ", swapping, " active extruder ", active_extruder ); - LOOP_L_N(i, EXTRUDERS) { - SERIAL_ECHOLNPGM("retracted[", i, "] ", AS_DIGIT(retracted[i])); + EXTRUDER_LOOP() { + SERIAL_ECHOLNPGM("retracted[", e, "] ", AS_DIGIT(retracted[e])); #if HAS_MULTI_EXTRUDER - SERIAL_ECHOLNPGM("retracted_swap[", i, "] ", AS_DIGIT(retracted_swap[i])); + SERIAL_ECHOLNPGM("retracted_swap[", e, "] ", AS_DIGIT(retracted_swap[e])); #endif } SERIAL_ECHOLNPGM("current_position.z ", current_position.z); @@ -184,10 +184,10 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/)) SERIAL_ECHOLNPGM("retracting ", AS_DIGIT(retracting)); SERIAL_ECHOLNPGM("swapping ", AS_DIGIT(swapping)); SERIAL_ECHOLNPGM("active_extruder ", active_extruder); - LOOP_L_N(i, EXTRUDERS) { - SERIAL_ECHOLNPGM("retracted[", i, "] ", AS_DIGIT(retracted[i])); + EXTRUDER_LOOP() { + SERIAL_ECHOLNPGM("retracted[", e, "] ", AS_DIGIT(retracted[e])); #if HAS_MULTI_EXTRUDER - SERIAL_ECHOLNPGM("retracted_swap[", i, "] ", AS_DIGIT(retracted_swap[i])); + SERIAL_ECHOLNPGM("retracted_swap[", e, "] ", AS_DIGIT(retracted_swap[e])); #endif } SERIAL_ECHOLNPGM("current_position.z ", current_position.z); diff --git a/Marlin/src/feature/fwretract.h b/Marlin/src/feature/fwretract.h index d6d0432e3aa7..081ec44c0574 100644 --- a/Marlin/src/feature/fwretract.h +++ b/Marlin/src/feature/fwretract.h @@ -64,7 +64,7 @@ class FWRetract { static void reset(); static void refresh_autoretract() { - LOOP_L_N(i, EXTRUDERS) retracted[i] = false; + EXTRUDER_LOOP() retracted[e] = false; } static void enable_autoretract(const bool enable) { diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 214c248d359c..74008ed55a55 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -196,7 +196,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW #if DISABLED(NO_VOLUMETRICS) info.flag.volumetric_enabled = parser.volumetric_enabled; #if HAS_MULTI_EXTRUDER - for (int8_t e = 0; e < EXTRUDERS; e++) info.filament_size[e] = planner.filament_size[e]; + EXTRUDER_LOOP() info.filament_size[e] = planner.filament_size[e]; #else if (parser.volumetric_enabled) info.filament_size[0] = planner.filament_size[active_extruder]; #endif @@ -461,7 +461,7 @@ void PrintJobRecovery::resume() { // Recover volumetric extrusion state #if DISABLED(NO_VOLUMETRICS) #if HAS_MULTI_EXTRUDER - for (int8_t e = 0; e < EXTRUDERS; e++) { + EXTRUDER_LOOP() { sprintf_P(cmd, PSTR("M200T%iD%s"), e, dtostrf(info.filament_size[e], 1, 3, str_1)); gcode.process_subcommands_now(cmd); } @@ -511,7 +511,7 @@ void PrintJobRecovery::resume() { // Restore retract and hop state from an active `G10` command #if ENABLED(FWRETRACT) - LOOP_L_N(e, EXTRUDERS) { + EXTRUDER_LOOP() { if (info.retract[e] != 0.0) { fwretract.current_retract[e] = info.retract[e]; fwretract.retracted[e] = true; @@ -634,7 +634,7 @@ void PrintJobRecovery::resume() { #if DISABLED(NO_VOLUMETRICS) DEBUG_ECHOPGM("filament_size:"); - LOOP_L_N(i, EXTRUDERS) DEBUG_ECHOLNPGM(" ", info.filament_size[i]); + EXTRUDER_LOOP() DEBUG_ECHOLNPGM(" ", info.filament_size[e]); DEBUG_EOL(); #endif @@ -666,7 +666,7 @@ void PrintJobRecovery::resume() { #if ENABLED(FWRETRACT) DEBUG_ECHOPGM("retract: "); - for (int8_t e = 0; e < EXTRUDERS; e++) { + EXTRUDER_LOOP() { DEBUG_ECHO(info.retract[e]); if (e < EXTRUDERS - 1) DEBUG_CHAR(','); } diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 9490e3c625f3..fb4c9b8af347 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -93,12 +93,12 @@ } #else SERIAL_ECHOLNPGM(" M200 S", parser.volumetric_enabled); - LOOP_L_N(i, EXTRUDERS) { + EXTRUDER_LOOP() { report_echo_start(forReplay); SERIAL_ECHOLNPGM( - " M200 T", i, " D", LINEAR_UNIT(planner.filament_size[i]) + " M200 T", e, " D", LINEAR_UNIT(planner.filament_size[e]) #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) - , " L", LINEAR_UNIT(planner.volumetric_extruder_limit[i]) + , " L", LINEAR_UNIT(planner.volumetric_extruder_limit[e]) #endif ); } diff --git a/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin/src/gcode/control/M17_M18_M84.cpp index 4683786f1fd0..3bc5582ce700 100644 --- a/Marlin/src/gcode/control/M17_M18_M84.cpp +++ b/Marlin/src/gcode/control/M17_M18_M84.cpp @@ -77,7 +77,7 @@ void do_enable(const axis_flags_t to_enable) { } } #if HAS_EXTRUDERS - LOOP_L_N(e, EXTRUDERS) { + EXTRUDER_LOOP() { const uint8_t a = INDEX_OF_AXIS(E_AXIS, e); if (TEST(shall_enable, a)) { stepper.ENABLE_EXTRUDER(e); @@ -161,7 +161,7 @@ void try_to_disable(const axis_flags_t to_disable) { DEBUG_ECHOLNPGM(" ... still_enabled=", hex_word(still_enabled)); } #if HAS_EXTRUDERS - LOOP_L_N(e, EXTRUDERS) { + EXTRUDER_LOOP() { const uint8_t a = INDEX_OF_AXIS(E_AXIS, e); if (TEST(to_disable.bits, a)) { DEBUG_ECHOPGM("Try to disable E", AS_DIGIT(e), " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... "); @@ -194,7 +194,7 @@ void try_to_disable(const axis_flags_t to_disable) { } } #if HAS_EXTRUDERS - LOOP_L_N(e, EXTRUDERS) { + EXTRUDER_LOOP() { const uint8_t a = INDEX_OF_AXIS(E_AXIS, e); if (TEST(still_enabled, a)) { SERIAL_CHAR('E', '0' + e); diff --git a/Marlin/src/gcode/feature/advance/M900.cpp b/Marlin/src/gcode/feature/advance/M900.cpp index 054ea3617f9b..8b59e88fb114 100644 --- a/Marlin/src/gcode/feature/advance/M900.cpp +++ b/Marlin/src/gcode/feature/advance/M900.cpp @@ -117,10 +117,10 @@ void GcodeSuite::M900() { #if EXTRUDERS < 2 SERIAL_ECHOLNPGM("Advance S", new_slot, " K", kref, "(S", !new_slot, " K", lref, ")"); #else - LOOP_L_N(i, EXTRUDERS) { - const bool slot = TEST(lin_adv_slot, i); - SERIAL_ECHOLNPGM("Advance T", i, " S", slot, " K", planner.extruder_advance_K[i], - "(S", !slot, " K", other_extruder_advance_K[i], ")"); + EXTRUDER_LOOP() { + const bool slot = TEST(lin_adv_slot, e); + SERIAL_ECHOLNPGM("Advance T", e, " S", slot, " K", planner.extruder_advance_K[e], + "(S", !slot, " K", other_extruder_advance_K[e], ")"); SERIAL_EOL(); } #endif @@ -132,9 +132,9 @@ void GcodeSuite::M900() { SERIAL_ECHOLNPGM("Advance K=", planner.extruder_advance_K[0]); #else SERIAL_ECHOPGM("Advance K"); - LOOP_L_N(i, EXTRUDERS) { - SERIAL_CHAR(' ', '0' + i, ':'); - SERIAL_DECIMAL(planner.extruder_advance_K[i]); + EXTRUDER_LOOP() { + SERIAL_CHAR(' ', '0' + e, ':'); + SERIAL_DECIMAL(planner.extruder_advance_K[e]); } SERIAL_EOL(); #endif @@ -150,9 +150,9 @@ void GcodeSuite::M900_report(const bool forReplay/*=true*/) { report_echo_start(forReplay); SERIAL_ECHOLNPGM(" M900 K", planner.extruder_advance_K[0]); #else - LOOP_L_N(i, EXTRUDERS) { + EXTRUDER_LOOP() { report_echo_start(forReplay); - SERIAL_ECHOLNPGM(" M900 T", i, " K", planner.extruder_advance_K[i]); + SERIAL_ECHOLNPGM(" M900 T", e, " K", planner.extruder_advance_K[e]); } #endif } diff --git a/Marlin/src/gcode/feature/pause/M603.cpp b/Marlin/src/gcode/feature/pause/M603.cpp index 6689749cfb4c..10d14012f890 100644 --- a/Marlin/src/gcode/feature/pause/M603.cpp +++ b/Marlin/src/gcode/feature/pause/M603.cpp @@ -72,7 +72,7 @@ void GcodeSuite::M603_report(const bool forReplay/*=true*/) { SERIAL_ECHOPGM(" M603 L", LINEAR_UNIT(fc_settings[0].load_length), " U", LINEAR_UNIT(fc_settings[0].unload_length), " ;"); say_units(); #else - LOOP_L_N(e, EXTRUDERS) { + EXTRUDER_LOOP() { report_echo_start(forReplay); SERIAL_ECHOPGM(" M603 T", e, " L", LINEAR_UNIT(fc_settings[e].load_length), " U", LINEAR_UNIT(fc_settings[e].unload_length), " ;"); say_units(); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 33d9e462209d..e7473420cf9d 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -749,6 +749,7 @@ #endif // Helper macros for extruder and hotend arrays +#define EXTRUDER_LOOP() for (int8_t e = 0; e < EXTRUDERS; e++) #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) #define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V) #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_N_1(EXTRUDERS, v1) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 1bc9b9e88ed8..eb979a43195f 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -109,8 +109,8 @@ void menu_backlash(); #if EXTRUDERS == 1 EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10); #elif HAS_MULTI_EXTRUDER - LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 10); + EXTRUDER_LOOP() + EDIT_ITEM_N(float42_52, e, MSG_ADVANCE_K_E, &planner.extruder_advance_K[e], 0, 10); #endif #endif @@ -120,16 +120,16 @@ void menu_backlash(); #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) EDIT_ITEM_FAST(float42_52, MSG_VOLUMETRIC_LIMIT, &planner.volumetric_extruder_limit[active_extruder], 0.0f, 20.0f, planner.calculate_volumetric_extruder_limits); #if HAS_MULTI_EXTRUDER - LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_FAST_N(float42_52, n, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[n], 0.0f, 20.00f, planner.calculate_volumetric_extruder_limits); + EXTRUDER_LOOP() + EDIT_ITEM_FAST_N(float42_52, e, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[e], 0.0f, 20.00f, planner.calculate_volumetric_extruder_limits); #endif #endif if (parser.volumetric_enabled) { EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); #if HAS_MULTI_EXTRUDER - LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_FAST_N(float43, n, MSG_FILAMENT_DIAM_E, &planner.filament_size[n], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); + EXTRUDER_LOOP() + EDIT_ITEM_FAST_N(float43, e, MSG_FILAMENT_DIAM_E, &planner.filament_size[e], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); #endif } #endif @@ -139,14 +139,14 @@ void menu_backlash(); EDIT_ITEM_FAST(float4, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); #if HAS_MULTI_EXTRUDER - LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_FAST_N(float4, n, MSG_FILAMENTUNLOAD_E, &fc_settings[n].unload_length, 0, extrude_maxlength); + EXTRUDER_LOOP() + EDIT_ITEM_FAST_N(float4, e, MSG_FILAMENTUNLOAD_E, &fc_settings[e].unload_length, 0, extrude_maxlength); #endif EDIT_ITEM_FAST(float4, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); #if HAS_MULTI_EXTRUDER - LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_FAST_N(float4, n, MSG_FILAMENTLOAD_E, &fc_settings[n].load_length, 0, extrude_maxlength); + EXTRUDER_LOOP() + EDIT_ITEM_FAST_N(float4, e, MSG_FILAMENTLOAD_E, &fc_settings[e].load_length, 0, extrude_maxlength); #endif #endif diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index b4e9287bd4a3..b6d518f505dd 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -145,9 +145,9 @@ void menu_advanced_settings(); EDIT_ITEM(uint8, MSG_TOOL_MIGRATION_END, &migration.last, 0, EXTRUDERS - 1); // Migrate to a chosen extruder - LOOP_L_N(s, EXTRUDERS) { - if (s != active_extruder) { - ACTION_ITEM_N_P(s, msg_migrate, []{ + EXTRUDER_LOOP() { + if (e != active_extruder) { + ACTION_ITEM_N_P(e, msg_migrate, []{ char cmd[12]; sprintf_P(cmd, PSTR("M217 T%i"), int(MenuItemBase::itemIndex)); queue.inject(cmd); diff --git a/Marlin/src/lcd/menu/menu_mmu2.cpp b/Marlin/src/lcd/menu/menu_mmu2.cpp index 4f3728b74e90..a2412b0f6ae8 100644 --- a/Marlin/src/lcd/menu/menu_mmu2.cpp +++ b/Marlin/src/lcd/menu/menu_mmu2.cpp @@ -48,7 +48,7 @@ void _mmu2_load_filament(uint8_t index) { ui.reset_status(); } void action_mmu2_load_all() { - LOOP_L_N(i, EXTRUDERS) _mmu2_load_filament(i); + EXTRUDER_LOOP() _mmu2_load_filament(e); ui.return_to_status(); } @@ -56,14 +56,14 @@ void menu_mmu2_load_filament() { START_MENU(); BACK_ITEM(MSG_MMU2_MENU); ACTION_ITEM(MSG_MMU2_ALL, action_mmu2_load_all); - LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ _mmu2_load_filament(MenuItemBase::itemIndex); }); + EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ _mmu2_load_filament(MenuItemBase::itemIndex); }); END_MENU(); } void menu_mmu2_load_to_nozzle() { START_MENU(); BACK_ITEM(MSG_MMU2_MENU); - LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_load_filament_to_nozzle(MenuItemBase::itemIndex); }); + EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ action_mmu2_load_filament_to_nozzle(MenuItemBase::itemIndex); }); END_MENU(); } @@ -89,7 +89,7 @@ void action_mmu2_unload_filament() { void menu_mmu2_eject_filament() { START_MENU(); BACK_ITEM(MSG_MMU2_MENU); - LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ _mmu2_eject_filament(MenuItemBase::itemIndex); }); + EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ _mmu2_eject_filament(MenuItemBase::itemIndex); }); END_MENU(); } @@ -130,7 +130,7 @@ void menu_mmu2_choose_filament() { #if LCD_HEIGHT > 2 STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_DEFAULT|SS_INVERT); #endif - LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_chosen(MenuItemBase::itemIndex); }); + EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ action_mmu2_chosen(MenuItemBase::itemIndex); }); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 854f36985f84..7954edf5a127 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -199,8 +199,8 @@ void menu_tune() { EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); }); // Flow En: #if HAS_MULTI_EXTRUDER - LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_N(int3, n, MSG_FLOW_N, &planner.flow_percentage[n], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); + EXTRUDER_LOOP() + EDIT_ITEM_N(int3, e, MSG_FLOW_N, &planner.flow_percentage[e], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); #endif #endif @@ -211,8 +211,8 @@ void menu_tune() { #if EXTRUDERS == 1 EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10); #elif HAS_MULTI_EXTRUDER - LOOP_L_N(n, EXTRUDERS) - EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 10); + EXTRUDER_LOOP() + EDIT_ITEM_N(float42_52, e, MSG_ADVANCE_K_E, &planner.extruder_advance_K[e], 0, 10); #endif #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 51440aac262e..a3caa199c1c4 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1505,7 +1505,7 @@ void Planner::check_axes_activity() { volumetric_extruder_feedrate_limit[e] = (lim && siz) ? lim / CIRCLE_AREA(siz * 0.5f) : 0; } void Planner::calculate_volumetric_extruder_limits() { - LOOP_L_N(e, EXTRUDERS) calculate_volumetric_extruder_limit(e); + EXTRUDER_LOOP() calculate_volumetric_extruder_limit(e); } #endif diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index f29604bea86a..5b79e406f5dd 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -928,8 +928,8 @@ class Planner { #if HAS_LINEAR_E_JERK FORCE_INLINE static void recalculate_max_e_jerk() { const float prop = junction_deviation_mm * SQRT(0.5) / (1.0f - SQRT(0.5)); - LOOP_L_N(i, EXTRUDERS) - max_e_jerk[E_INDEX_N(i)] = SQRT(prop * settings.max_acceleration_mm_per_s2[E_INDEX_N(i)]); + EXTRUDER_LOOP() + max_e_jerk[E_INDEX_N(e)] = SQRT(prop * settings.max_acceleration_mm_per_s2[E_INDEX_N(e)]); } #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 63bb93765ba8..1f482afeb4f0 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -3138,9 +3138,9 @@ void MarlinSettings::reset() { // #if ENABLED(LIN_ADVANCE) - LOOP_L_N(i, EXTRUDERS) { - planner.extruder_advance_K[i] = LIN_ADVANCE_K; - TERN_(EXTRA_LIN_ADVANCE_K, other_extruder_advance_K[i] = LIN_ADVANCE_K); + EXTRUDER_LOOP() { + planner.extruder_advance_K[e] = LIN_ADVANCE_K; + TERN_(EXTRA_LIN_ADVANCE_K, other_extruder_advance_K[e] = LIN_ADVANCE_K); } #endif @@ -3185,7 +3185,7 @@ void MarlinSettings::reset() { // Advanced Pause filament load & unload lengths // #if ENABLED(ADVANCED_PAUSE_FEATURE) - LOOP_L_N(e, EXTRUDERS) { + EXTRUDER_LOOP() { fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH; fc_settings[e].load_length = FILAMENT_CHANGE_FAST_LOAD_LENGTH; } From 9ac1c73041cbf4015b48d9d7a70a59e840a1d442 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 20:34:00 -0500 Subject: [PATCH 193/502] =?UTF-8?q?=F0=9F=8E=A8=20General=20cleanup,=20com?= =?UTF-8?q?ments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/types.h | 1 + Marlin/src/gcode/host/M16.cpp | 3 +- Marlin/src/gcode/host/M360.cpp | 2 +- .../generic/max_acceleration_screen.cpp | 31 +++++++-------- .../generic/max_velocity_screen.cpp | 39 +++++++++---------- Marlin/src/module/probe.h | 9 +++++ Marlin/src/pins/pinsDebug.h | 1 + 7 files changed, 48 insertions(+), 38 deletions(-) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 53d98e0e6dd2..045ca3589f4c 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -118,6 +118,7 @@ typedef IF<(NUM_AXIS_ENUMS > 8), uint16_t, uint8_t>::type axis_bits_t; #define LOOP_LINEAR_AXES(VAR) LOOP_S_L_N(VAR, X_AXIS, LINEAR_AXES) #define LOOP_LOGICAL_AXES(VAR) LOOP_S_L_N(VAR, X_AXIS, LOGICAL_AXES) #define LOOP_DISTINCT_AXES(VAR) LOOP_S_L_N(VAR, X_AXIS, DISTINCT_AXES) +#define LOOP_DISTINCT_E(VAR) LOOP_L_N(VAR, DISTINCT_E) // // feedRate_t is just a humble float diff --git a/Marlin/src/gcode/host/M16.cpp b/Marlin/src/gcode/host/M16.cpp index 03e734daaa8b..07b0c5ef573d 100644 --- a/Marlin/src/gcode/host/M16.cpp +++ b/Marlin/src/gcode/host/M16.cpp @@ -26,6 +26,7 @@ #include "../gcode.h" #include "../../MarlinCore.h" +#include "../../lcd/marlinui.h" /** * M16: Expected Printer Check @@ -37,4 +38,4 @@ void GcodeSuite::M16() { } -#endif +#endif // EXPECTED_PRINTER_CHECK diff --git a/Marlin/src/gcode/host/M360.cpp b/Marlin/src/gcode/host/M360.cpp index 1feb57996adb..b3a95a35aaec 100644 --- a/Marlin/src/gcode/host/M360.cpp +++ b/Marlin/src/gcode/host/M360.cpp @@ -180,7 +180,7 @@ void GcodeSuite::M360() { // config_line(F("NumExtruder"), EXTRUDERS); #if HAS_EXTRUDERS - LOOP_L_N(e, EXTRUDERS) { + EXTRUDER_LOOP() { config_line_e(e, JERK_STR, TERN(HAS_LINEAR_E_JERK, planner.max_e_jerk[E_INDEX_N(e)], TERN(HAS_CLASSIC_JERK, planner.max_jerk.e, DEFAULT_EJERK))); config_line_e(e, F("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(e)]); config_line_e(e, F("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(e)]); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_acceleration_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_acceleration_screen.cpp index 228bc5f96b47..492b908776dd 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_acceleration_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_acceleration_screen.cpp @@ -44,10 +44,10 @@ void MaxAccelerationScreen::onRedraw(draw_mode_t what) { w.color(e_axis).adjuster( 8, F(STR_E0), getAxisMaxAcceleration_mm_s2(E0) ); w.color(e_axis).adjuster(10, F(STR_E1), getAxisMaxAcceleration_mm_s2(E1) ); #if DISTINCT_E > 2 - w.color(e_axis).adjuster(12, F(STR_E2), getAxisMaxAcceleration_mm_s2(E2) ); - #endif - #if DISTINCT_E > 3 - w.color(e_axis).adjuster(14, F(STR_E3), getAxisMaxAcceleration_mm_s2(E3) ); + w.color(e_axis).adjuster(12, F(STR_E2), getAxisMaxAcceleration_mm_s2(E2) ); + #if DISTINCT_E > 3 + w.color(e_axis).adjuster(14, F(STR_E3), getAxisMaxAcceleration_mm_s2(E3) ); + #endif #endif #endif w.increments(); @@ -65,19 +65,18 @@ bool MaxAccelerationScreen::onTouchHeld(uint8_t tag) { case 8: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E0); break; case 9: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E0); break; #if DISTINCT_E > 1 - case 10: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E1); break; - case 11: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E1); break; - #endif - #if DISTINCT_E > 2 - case 12: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E2); break; - case 13: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E2); break; - #endif - #if DISTINCT_E > 3 - case 14: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E3); break; - case 15: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E3); break; + case 10: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E1); break; + case 11: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E1); break; + #if DISTINCT_E > 2 + case 12: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E2); break; + case 13: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E2); break; + #if DISTINCT_E > 3 + case 14: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E3); break; + case 15: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E3); break; + #endif + #endif #endif - default: - return false; + default: return false; } return true; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp index 65dc947b7b48..011127621120 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp @@ -46,9 +46,9 @@ void MaxVelocityScreen::onRedraw(draw_mode_t what) { w.color(e_axis) .adjuster( 10, F(STR_E1), getAxisMaxFeedrate_mm_s(E1) ); #if EXTRUDERS > 2 w.color(e_axis).adjuster( 12, F(STR_E2), getAxisMaxFeedrate_mm_s(E2) ); - #endif - #if EXTRUDERS > 3 - w.color(e_axis).adjuster( 14, F(STR_E3), getAxisMaxFeedrate_mm_s(E3) ); + #if EXTRUDERS > 3 + w.color(e_axis).adjuster( 14, F(STR_E3), getAxisMaxFeedrate_mm_s(E3) ); + #endif #endif #endif w.increments(); @@ -63,24 +63,23 @@ bool MaxVelocityScreen::onTouchHeld(uint8_t tag) { case 5: UI_INCREMENT(AxisMaxFeedrate_mm_s, Y); break; case 6: UI_DECREMENT(AxisMaxFeedrate_mm_s, Z); break; case 7: UI_INCREMENT(AxisMaxFeedrate_mm_s, Z); break; - #if DISTINCT_E > 0 - case 8: UI_DECREMENT(AxisMaxFeedrate_mm_s, E0); break; - case 9: UI_INCREMENT(AxisMaxFeedrate_mm_s, E0); break; - #endif - #if DISTINCT_E > 1 - case 10: UI_DECREMENT(AxisMaxFeedrate_mm_s, E1); break; - case 11: UI_INCREMENT(AxisMaxFeedrate_mm_s, E1); break; - #endif - #if DISTINCT_E > 2 - case 12: UI_DECREMENT(AxisMaxFeedrate_mm_s, E2); break; - case 13: UI_INCREMENT(AxisMaxFeedrate_mm_s, E2); break; - #endif - #if DISTINCT_E > 3 - case 14: UI_DECREMENT(AxisMaxFeedrate_mm_s, E3); break; - case 15: UI_INCREMENT(AxisMaxFeedrate_mm_s, E3); break; + #if DISTINCT_E + case 8: UI_DECREMENT(AxisMaxFeedrate_mm_s, E0); break; + case 9: UI_INCREMENT(AxisMaxFeedrate_mm_s, E0); break; + #if DISTINCT_E > 1 + case 10: UI_DECREMENT(AxisMaxFeedrate_mm_s, E1); break; + case 11: UI_INCREMENT(AxisMaxFeedrate_mm_s, E1); break; + #if DISTINCT_E > 2 + case 12: UI_DECREMENT(AxisMaxFeedrate_mm_s, E2); break; + case 13: UI_INCREMENT(AxisMaxFeedrate_mm_s, E2); break; + #if DISTINCT_E > 3 + case 14: UI_DECREMENT(AxisMaxFeedrate_mm_s, E3); break; + case 15: UI_INCREMENT(AxisMaxFeedrate_mm_s, E3); break; + #endif + #endif + #endif #endif - default: - return false; + default: return false; } SaveSettingsDialogBox::settingsChanged(); return true; diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 752e83f46785..f2fca10a8038 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -188,6 +188,15 @@ class Probe { } #endif + /** + * The nozzle is only able to move within the physical bounds of the machine. + * If the PROBE has an OFFSET Marlin may need to apply additional limits so + * the probe can be prevented from going to unreachable points. + * + * e.g., If the PROBE is to the LEFT of the NOZZLE, it will be limited in how + * close it can get the RIGHT edge of the bed (unless the nozzle is able move + * far enough past the right edge). + */ static constexpr float _min_x(const xy_pos_t &probe_offset_xy=offset_xy) { return TERN(IS_KINEMATIC, (X_CENTER) - probe_radius(probe_offset_xy), diff --git a/Marlin/src/pins/pinsDebug.h b/Marlin/src/pins/pinsDebug.h index e5db7f7b54be..b662f09ba9ef 100644 --- a/Marlin/src/pins/pinsDebug.h +++ b/Marlin/src/pins/pinsDebug.h @@ -19,6 +19,7 @@ * along with this program. If not, see . * */ +#pragma once #include "../inc/MarlinConfig.h" From f8e177a43efa3e7a173e2799562d354ab95544ab Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Mar 2022 20:39:53 -0500 Subject: [PATCH 194/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Imp?= =?UTF-8?q?rove=20STATUS=5FBED=5FX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/dogm/dogm_Statusscreen.h | 1 + Marlin/src/lcd/dogm/status/combined.h | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h index f17dd0636516..8d0ab4efbe46 100644 --- a/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -37,6 +37,7 @@ #undef STATUS_HEATERS_X #undef STATUS_BED_X + /** * Custom _Statusscreen.h files can define: * - A custom logo image diff --git a/Marlin/src/lcd/dogm/status/combined.h b/Marlin/src/lcd/dogm/status/combined.h index ca18f21af6d5..070fe6b027d6 100644 --- a/Marlin/src/lcd/dogm/status/combined.h +++ b/Marlin/src/lcd/dogm/status/combined.h @@ -37,6 +37,7 @@ #if HOTENDS == 0 #define STATUS_HEATERS_WIDTH 96 + #define STATUS_BED_X 74 const unsigned char status_heaters_bmp[] PROGMEM = { B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, @@ -56,6 +57,7 @@ #elif HOTENDS == 1 #define STATUS_HEATERS_WIDTH 96 + #define STATUS_BED_X 74 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, @@ -75,6 +77,7 @@ #elif HOTENDS == 2 #define STATUS_HEATERS_WIDTH 96 + #define STATUS_BED_X 74 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, @@ -104,6 +107,7 @@ #elif HOTENDS == 3 #define STATUS_HEATERS_WIDTH 96 + #define STATUS_BED_X 74 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, @@ -133,6 +137,7 @@ #else // HOTENDS > 3 #define STATUS_HEATERS_WIDTH 120 + #define STATUS_BED_X 98 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, @@ -161,7 +166,8 @@ #endif // HOTENDS - #define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10) + #define STATUS_BED_WIDTH 20 + #define STATUS_BED_TEXT_X (STATUS_BED_X + STATUS_BED_WIDTH / 2) #else // !HAS_HEATED_BED || HOTENDS > 3 From 2ee4a667e1999839e61fa4c7d4e31a88d6e301d6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 12 Jan 2022 09:47:22 -0600 Subject: [PATCH 195/502] =?UTF-8?q?=F0=9F=92=A1=20Misc.=20cleanup,=20comme?= =?UTF-8?q?nts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/feature/pause/G61.cpp | 2 +- Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp | 4 ++-- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 2 +- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 2 +- .../extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp | 2 +- Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 6 +++--- Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h | 8 ++++---- Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp | 13 +++++-------- Marlin/src/lcd/extui/mks_ui/wifiSerial_STM32.h | 10 +++++----- Marlin/src/libs/W25Qxx.cpp | 6 +++--- Marlin/src/libs/W25Qxx.h | 6 +++--- 11 files changed, 29 insertions(+), 32 deletions(-) diff --git a/Marlin/src/gcode/feature/pause/G61.cpp b/Marlin/src/gcode/feature/pause/G61.cpp index 18667501e4aa..e0e1983a2574 100644 --- a/Marlin/src/gcode/feature/pause/G61.cpp +++ b/Marlin/src/gcode/feature/pause/G61.cpp @@ -41,7 +41,7 @@ * * If XYZE are not given, default restore uses the smart blocking move. */ -void GcodeSuite::G61(void) { +void GcodeSuite::G61() { const uint8_t slot = parser.byteval('S'); diff --git a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp index 106ce7613892..d0cf5795d235 100644 --- a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp @@ -45,7 +45,7 @@ #include -int lcd_glyph_height(void) { return 1; } +int lcd_glyph_height() { return 1; } typedef struct _TFTGLCD_charmap_t { wchar_t uchar; // the unicode char @@ -1119,7 +1119,7 @@ int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { return 0; } - int test_TFTGLCD_charmap_all(void) { + int test_TFTGLCD_charmap_all() { int flg_error = 0; if (test_TFTGLCD_charmap(g_TFTGLCD_charmap_device, COUNT(g_TFTGLCD_charmap_device), "g_TFTGLCD_charmap_device", 0) < 0) { flg_error = 1; diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 1c6b03445f47..0745397f4f99 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -265,7 +265,7 @@ void TFTGLCD::setContrast(uint16_t contrast) { extern volatile int8_t encoderDiff; // Read buttons and encoder states -uint8_t MarlinUI::read_slow_buttons(void) { +uint8_t MarlinUI::read_slow_buttons() { if (!PanelDetected) return 0; #if ENABLED(TFTGLCD_PANEL_SPI) uint8_t b = 0; diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index c2174decb681..c9a44e0c64d0 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -61,7 +61,7 @@ #include "../../feature/cooler.h" #endif -#if ENABLED(I2C_AMMETER) +#if DO_DRAW_AMMETER #include "../../feature/ammeter.h" #endif diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 98534ba65f87..729d4547a862 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -63,7 +63,7 @@ char AnycubicTFTClass::SelectedDirectory[30]; char AnycubicTFTClass::SelectedFile[FILENAME_LENGTH]; // Serial helpers -static void sendNewLine(void) { LCD_SERIAL.write('\r'); LCD_SERIAL.write('\n'); } +static void sendNewLine() { LCD_SERIAL.write('\r'); LCD_SERIAL.write('\n'); } static void send(const char *str) { LCD_SERIAL.print(str); } static void send_P(PGM_P str) { while (const char c = pgm_read_byte(str++)) diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 91746f69c4fc..bfa070df8736 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -1459,7 +1459,7 @@ void DGUSScreenHandler::LanguagePInit() { } } -void DGUSScreenHandler::DGUS_ExtrudeLoadInit(void) { +void DGUSScreenHandler::DGUS_ExtrudeLoadInit() { ex_filament.ex_length = distanceFilament; ex_filament.ex_load_unload_flag = 0; ex_filament.ex_need_time = filamentSpeed_mm_s; @@ -1469,7 +1469,7 @@ void DGUSScreenHandler::DGUS_ExtrudeLoadInit(void) { ex_filament.ex_tick_start = 0; } -void DGUSScreenHandler::DGUS_RunoutInit(void) { +void DGUSScreenHandler::DGUS_RunoutInit() { #if PIN_EXISTS(MT_DET_1) SET_INPUT_PULLUP(MT_DET_1_PIN); #endif @@ -1479,7 +1479,7 @@ void DGUSScreenHandler::DGUS_RunoutInit(void) { runout_mks.runout_status = UNRUNOUT_STATUS; } -void DGUSScreenHandler::DGUS_Runout_Idle(void) { +void DGUSScreenHandler::DGUS_Runout_Idle() { #if ENABLED(DGUS_MKS_RUNOUT_SENSOR) // scanf runout pin switch (runout_mks.runout_status) { diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h index f14604d01a2b..dbd124cbe9d9 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h @@ -94,10 +94,10 @@ class DGUSScreenHandler { static void DGUS_LanguageDisplay(uint8_t var); static void TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr); static void GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr); - static void LanguagePInit(void); - static void DGUS_Runout_Idle(void); - static void DGUS_RunoutInit(void); - static void DGUS_ExtrudeLoadInit(void); + static void LanguagePInit(); + static void DGUS_Runout_Idle(); + static void DGUS_RunoutInit(); + static void DGUS_ExtrudeLoadInit(); static void LCD_BLK_Adjust(DGUS_VP_Variable &var, void *val_ptr); static void SD_FileBack(DGUS_VP_Variable &var, void *val_ptr); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp index fe7313b17008..15b3f5adcde4 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp @@ -318,7 +318,7 @@ void DGUSDisplay::ProcessRx() { gcode.reset_stepper_timeout(); if (!vp.size) { - DEBUG_ECHOLN(); + DEBUG_EOL(); vp.rx_handler(vp, nullptr); rx_datagram_state = DGUS_IDLE; @@ -330,18 +330,15 @@ void DGUSDisplay::ProcessRx() { memset(buffer, 0, vp.size); for (uint8_t i = 0; i < dlen; i++) { - if (i >= vp.size) { - break; - } + if (i >= vp.size) break; - if (i + 1 < dlen && tmp[i + 3] == 0xFF && tmp[i + 4] == 0xFF) { + if (i + 1 < dlen && tmp[i + 3] == 0xFF && tmp[i + 4] == 0xFF) break; - } buffer[i] = tmp[i + 3]; } - DEBUG_ECHOLN(); + DEBUG_EOL(); vp.rx_handler(vp, buffer); rx_datagram_state = DGUS_IDLE; @@ -354,7 +351,7 @@ void DGUSDisplay::ProcessRx() { break; } - DEBUG_ECHOLN(); + DEBUG_EOL(); vp.rx_handler(vp, &tmp[3]); rx_datagram_state = DGUS_IDLE; diff --git a/Marlin/src/lcd/extui/mks_ui/wifiSerial_STM32.h b/Marlin/src/lcd/extui/mks_ui/wifiSerial_STM32.h index cf32bad3969c..a7281fed4ada 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifiSerial_STM32.h +++ b/Marlin/src/lcd/extui/mks_ui/wifiSerial_STM32.h @@ -39,17 +39,17 @@ class WifiSerial { void begin(uint32_t baud); void begin(uint32_t baud, uint8_t config); void end(); - int available(void); - int read(void); + int available(); + int read(); int write(uint8_t); // Interrupt handlers static int _tx_complete_irq(serial_t *obj); static void _rx_complete_irq(serial_t *obj); - void flush(void); - bool isHalfDuplex(void) const; - void enableHalfDuplexRx(void); + void flush(); + bool isHalfDuplex() const; + void enableHalfDuplexRx(); private: void setRx(uint32_t _rx); diff --git a/Marlin/src/libs/W25Qxx.cpp b/Marlin/src/libs/W25Qxx.cpp index b458a7c965ef..033402d04ab0 100644 --- a/Marlin/src/libs/W25Qxx.cpp +++ b/Marlin/src/libs/W25Qxx.cpp @@ -133,7 +133,7 @@ uint16_t W25QXXFlash::W25QXX_ReadID(void) { return Temp; } -void W25QXXFlash::SPI_FLASH_WriteEnable(void) { +void W25QXXFlash::SPI_FLASH_WriteEnable() { // Select the FLASH: Chip Select low SPI_FLASH_CS_L(); // Send "Write Enable" instruction @@ -151,7 +151,7 @@ void W25QXXFlash::SPI_FLASH_WriteEnable(void) { * Output : None * Return : None *******************************************************************************/ -void W25QXXFlash::SPI_FLASH_WaitForWriteEnd(void) { +void W25QXXFlash::SPI_FLASH_WaitForWriteEnd() { uint8_t FLASH_Status = 0; // Select the FLASH: Chip Select low @@ -216,7 +216,7 @@ void W25QXXFlash::SPI_FLASH_BlockErase(uint32_t BlockAddr) { * Output : None * Return : None *******************************************************************************/ -void W25QXXFlash::SPI_FLASH_BulkErase(void) { +void W25QXXFlash::SPI_FLASH_BulkErase() { // Send write enable instruction SPI_FLASH_WriteEnable(); diff --git a/Marlin/src/libs/W25Qxx.h b/Marlin/src/libs/W25Qxx.h index 1133af2e74dd..778463477d82 100644 --- a/Marlin/src/libs/W25Qxx.h +++ b/Marlin/src/libs/W25Qxx.h @@ -61,11 +61,11 @@ class W25QXXFlash { static void spi_flash_Send(uint8_t b); static void spi_flash_SendBlock(uint8_t token, const uint8_t *buf); static uint16_t W25QXX_ReadID(void); - static void SPI_FLASH_WriteEnable(void); - static void SPI_FLASH_WaitForWriteEnd(void); + static void SPI_FLASH_WriteEnable(); + static void SPI_FLASH_WaitForWriteEnd(); static void SPI_FLASH_SectorErase(uint32_t SectorAddr); static void SPI_FLASH_BlockErase(uint32_t BlockAddr); - static void SPI_FLASH_BulkErase(void); + static void SPI_FLASH_BulkErase(); static void SPI_FLASH_PageWrite(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); static void SPI_FLASH_BufferWrite(uint8_t *pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite); static void SPI_FLASH_BufferRead(uint8_t *pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead); From 1c89c0470f2778f8051ff8514831138e64a2d9ed Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 25 Mar 2022 12:06:28 +1300 Subject: [PATCH 196/502] =?UTF-8?q?=F0=9F=A9=B9=20Wrap=20endstop=5Fdiag.cp?= =?UTF-8?q?p=20(#23931)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/endstop_diag.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp index 74eb94e751af..0b450bd4c0f6 100644 --- a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp @@ -21,15 +21,19 @@ */ /** - * DWIN End Stops diagnostic page for PRO UI + * DWIN Endstops diagnostic page for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) * Version: 1.2.2 * Date: 2022/02/24 */ +#include "../../../inc/MarlinConfigPre.h" + +#if ENABLED(DWIN_LCD_PROUI) + #include "dwin_defines.h" -#if BOTH(DWIN_LCD_PROUI, HAS_ESDIAG) +#if HAS_ESDIAG #include "endstop_diag.h" @@ -105,4 +109,5 @@ void ESDiagClass::Update() { DWIN_UpdateLCD(); } -#endif // DWIN_LCD_PROUI && HAS_ESDIAG +#endif // HAS_ESDIAG +#endif // DWIN_LCD_PROUI From b2a318af9a0c8e91b1f66a5576226b50b1b49f1b Mon Sep 17 00:00:00 2001 From: Serhiy-K <52166448+Serhiy-K@users.noreply.github.com> Date: Fri, 25 Mar 2022 01:07:58 +0200 Subject: [PATCH 197/502] =?UTF-8?q?=F0=9F=8C=90=20Update=20Ukrainian=20lan?= =?UTF-8?q?guage=20(#23935)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_uk.h | 44 ++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 7afc2e031c23..e4eef399fe5d 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -465,7 +465,15 @@ namespace Language_uk { LSTR MSG_FILAMENT_LOAD = _UxGT("Завантаж., мм"); LSTR MSG_ADVANCE_K = _UxGT("Kоеф. просув."); LSTR MSG_ADVANCE_K_E = _UxGT("Kоеф. просув. *"); - LSTR MSG_CONTRAST = _UxGT("Контраст екрану"); + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 + LSTR MSG_CONTRAST = _UxGT("Контраст екрану"); + LSTR MSG_BRIGHTNESS = _UxGT("Яскравість LCD"); + #else + LSTR MSG_CONTRAST = _UxGT("Контраст"); + LSTR MSG_BRIGHTNESS = _UxGT("Яскравість"); + #endif + LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD Таймаут, с"); + LSTR MSG_BRIGHTNESS_OFF = _UxGT("Підсвітка вимк."); LSTR MSG_STORE_EEPROM = _UxGT("Зберегти в EEPROM"); LSTR MSG_LOAD_EEPROM = _UxGT("Зчитати з EEPROM"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("На базові параметри"); @@ -497,10 +505,17 @@ namespace Language_uk { LSTR MSG_BUTTON_RESET = _UxGT("Зкинути"); LSTR MSG_BUTTON_IGNORE = _UxGT("Ігнорув."); LSTR MSG_BUTTON_CANCEL = _UxGT("Відміна"); + LSTR MSG_BUTTON_CONFIRM = _UxGT("Підтвер."); + LSTR MSG_BUTTON_CONTINUE = _UxGT("Продовж."); LSTR MSG_BUTTON_DONE = _UxGT("Готово"); LSTR MSG_BUTTON_BACK = _UxGT("Назад"); - LSTR MSG_BUTTON_PROCEED = _UxGT("Продовжити"); - LSTR MSG_BUTTON_SKIP = _UxGT("Пропустити"); + LSTR MSG_BUTTON_PROCEED = _UxGT("Продовж."); + LSTR MSG_BUTTON_SKIP = _UxGT("Пропуск"); + LSTR MSG_BUTTON_INFO = _UxGT("Інфо"); + LSTR MSG_BUTTON_LEVEL = _UxGT("Рівень"); + LSTR MSG_BUTTON_PAUSE = _UxGT("Пауза"); + LSTR MSG_BUTTON_RESUME = _UxGT("Звіт"); + LSTR MSG_BUTTON_SAVE = _UxGT("Зберегти"); LSTR MSG_PAUSING = _UxGT("Призупинення..."); LSTR MSG_PAUSE_PRINT = _UxGT("Призупинити друк"); @@ -518,6 +533,8 @@ namespace Language_uk { LSTR MSG_USERWAIT = _UxGT("Продовжити..."); LSTR MSG_PRINT_PAUSED = _UxGT("Друк призупинено"); LSTR MSG_PRINTING = _UxGT("Друк..."); + LSTR MSG_STOPPING = _UxGT("Зупинка..."); + LSTR MSG_REMAINING_TIME = _UxGT("Залишилось"); LSTR MSG_PRINT_ABORTED = _UxGT("Друк скасовано"); LSTR MSG_PRINT_DONE = _UxGT("Друк завершено"); LSTR MSG_NO_MOVE = _UxGT("Немає руху."); @@ -702,15 +719,32 @@ namespace Language_uk { LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Завершено"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Екструдовано"); + LSTR MSG_PLEASE_PREHEAT = _UxGT("Нагрійте хотенд"); + LSTR MSG_COLORS_GET = _UxGT("Отримати колір"); #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Носій не вставлений"); + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Перезавантаження..."); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Кількість друків"); - LSTR MSG_INFO_PRINT_TIME = _UxGT("Весь час друку"); + LSTR MSG_INFO_PRINT_TIME = _UxGT("Час друку"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Найдовший час"); + LSTR MSG_COLORS_SELECT = _UxGT("Обрати кольори"); + LSTR MSG_COLORS_APPLIED = _UxGT("Кольори застосовані"); #else + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Немає носія"); + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Перезавантаж..."); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Друків"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Загалом"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Найдовше"); - #endif + LSTR MSG_COLORS_SELECT = _UxGT("Кольори"); + LSTR MSG_COLORS_APPLIED = _UxGT("Кольори застос."); + #endif + LSTR MSG_COLORS_RED = _UxGT("Червоний"); + LSTR MSG_COLORS_GREEN = _UxGT("Зелений"); + LSTR MSG_COLORS_BLUE = _UxGT("Синій"); + LSTR MSG_COLORS_WHITE = _UxGT("Білий"); + LSTR MSG_UI_LANGUAGE = _UxGT("Мова"); + LSTR MSG_SOUND_ENABLE = _UxGT("Дозволити звук"); + LSTR MSG_LOCKSCREEN = _UxGT("Блокувати екран"); LSTR MSG_INFO_MIN_TEMP = _UxGT("Мін. ") LCD_STR_THERMOMETER; LSTR MSG_INFO_MAX_TEMP = _UxGT("Макс. ") LCD_STR_THERMOMETER; From 21f0945d2cfada672756709bc420feb11768e687 Mon Sep 17 00:00:00 2001 From: Oleg Belov Date: Fri, 25 Mar 2022 02:12:35 +0300 Subject: [PATCH 198/502] =?UTF-8?q?=F0=9F=93=8C=20Custom=20cable=20for=20M?= =?UTF-8?q?ini=2012864=20V1=20+=20SKR=20Mini=20E3=20V3.0=20(#23936)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h index 2589a316b6b1..2fddb68a7c0c 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h @@ -256,8 +256,51 @@ #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + + #error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_BTT_SKR_MINI_E3_V3_0.h' for details. Comment out this line to continue." + + /** + * + * Board Display + * ------ ------ + * (EN2) PB5 |10 9 | PA15(BTN_ENC) 5V |10 9 | GND + * (LCD_CS) PA9 | 8 7 | RST (RESET) -- | 8 7 | -- + * (LCD_A0) PA10 |#6 5 | PB9 (EN1) (DIN) | 6 5#| (RESET) + * (LCD_SCK)PB8 | 4 3 | PD6 (MOSI) (LCD_A0) | 4 3 | (LCD_CS) + * GND | 2 1 | 5V (BTN_ENC) | 2 1 | -- + * ------ ------ + * EXP1 EXP1 + * + * ------ + * -- |10 9 | -- + * --- (RESET) | 8 7 | -- + * | 3 | (MOSI) | 6 5#| (EN2) + * | 2 | (DIN) -- | 4 3 | (EN1) + * | 1 | (LCD_SCK)| 2 1 | -- + * --- ------ + * Neopixel EXP2 + * + * Needs custom cable. Connect EN2-EN2, LCD_CS-LCD_CS and so on. + * + * Check twice index position!!! (marked as # here) + * On BTT boards pins from IDC10 connector are numbered in unusual order. + */ + #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 PB9 + #define BTN_EN2 PB5 + #define BEEPER_PIN -1 + + #define DOGLCD_CS PA9 + #define DOGLCD_A0 PA10 + #define DOGLCD_SCK PB8 + #define DOGLCD_MOSI PD6 + + #define FORCE_SOFT_SPI + #define LCD_BACKLIGHT_PIN -1 + #else - #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BIGTREE_SKR_MINI_E3." + #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, FYSETC_MINI_12864_2_1, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BIGTREE_SKR_MINI_E3." #endif #endif // HAS_WIRED_LCD From 5ef4fb378e345e20d1fa3bdbc5312598dc571276 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 24 Mar 2022 20:29:50 -0500 Subject: [PATCH 199/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Encoder=20noise=20?= =?UTF-8?q?followup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #23925 --- Marlin/src/lcd/marlinui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index b28687ee9173..30c22188e426 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -689,8 +689,8 @@ class MarlinUI { /** * Some printers may have issues with EMI noise especially using a motherboard with 3.3V logic levels * it may cause the logical LOW to float into the undefined region and register as a logical HIGH - * causing it to errorenously register as if someone clicked the button and in worst case make the printer - * unusable in practice. + * causing it to erroneously register as if someone clicked the button and in worst case make the + * printer unusable in practice. */ static bool hw_button_pressed() { LOOP_L_N(s, ENCODER_SAMPLES) { From eccbfbcede60922b95971e90bf3a1d7983a5fe39 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 25 Mar 2022 17:04:06 -0500 Subject: [PATCH 200/502] =?UTF-8?q?=F0=9F=A9=B9=20Print=20English=20to=20s?= =?UTF-8?q?erial=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/multi_language.h | 3 +++ Marlin/src/module/probe.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/src/core/multi_language.h b/Marlin/src/core/multi_language.h index 2106f946ac73..a605a6f02441 100644 --- a/Marlin/src/core/multi_language.h +++ b/Marlin/src/core/multi_language.h @@ -80,6 +80,9 @@ typedef const char Language_Str[]; #endif #define GET_TEXT_F(MSG) FPSTR(GET_TEXT(MSG)) +#define GET_EN_TEXT(MSG) GET_LANG(en)::MSG +#define GET_EN_TEXT_F(MSG) FPSTR(GET_EN_TEXT(MSG)) + #define GET_LANGUAGE_NAME(INDEX) GET_LANG(LCD_LANGUAGE_##INDEX)::LANGUAGE #define LANG_CHARSIZE GET_TEXT(CHARSIZE) #define USE_WIDE_GLYPH (LANG_CHARSIZE > 2) diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index ee6323518a2f..c34178412f28 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -311,7 +311,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { FSTR_P const ds_str = deploy ? GET_TEXT_F(MSG_MANUAL_DEPLOY) : GET_TEXT_F(MSG_MANUAL_STOW); ui.return_to_status(); // To display the new status message ui.set_status(ds_str, 99); - SERIAL_ECHOLNF(ds_str); + SERIAL_ECHOLNF(deploy ? GET_EN_TEXT_F(MSG_MANUAL_DEPLOY) : GET_EN_TEXT_F(MSG_MANUAL_STOW)); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Stow Probe"))); From 5632ad65f59710ca64e4abca99afa64cb99d559e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 25 Mar 2022 17:09:26 -0500 Subject: [PATCH 201/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20status=5Fprintf=20?= =?UTF-8?q?alert=20level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/marlinui.cpp | 39 ++++++++++++++++++++----------------- Marlin/src/lcd/marlinui.h | 2 +- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 11b523ff537a..9e27dc6006a0 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1487,9 +1487,12 @@ void MarlinUI::init() { #include - void MarlinUI::status_printf(const uint8_t level, FSTR_P const fmt, ...) { + void MarlinUI::status_printf(int8_t level, FSTR_P const fmt, ...) { + // Alerts block lower priority messages + if (level < 0) level = alert_level = 0; if (level < alert_level) return; alert_level = level; + va_list args; va_start(args, FTOP(fmt)); vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, FTOP(fmt), args); @@ -1551,7 +1554,22 @@ void MarlinUI::init() { #endif -#endif +#else // !HAS_STATUS_MESSAGE + + // + // Send the status line as a host notification + // + void MarlinUI::set_status(const char * const cstr, const bool) { + TERN(HOST_PROMPT_SUPPORT, hostui.notify(cstr), UNUSED(cstr)); + } + void MarlinUI::set_status(FSTR_P const fstr, const int8_t) { + TERN(HOST_PROMPT_SUPPORT, hostui.notify(fstr), UNUSED(fstr)); + } + void MarlinUI::status_printf(int8_t, FSTR_P const fstr, ...) { + TERN(HOST_PROMPT_SUPPORT, hostui.notify(fstr), UNUSED(fstr)); + } + +#endif // !HAS_STATUS_MESSAGE #if HAS_DISPLAY @@ -1663,22 +1681,7 @@ void MarlinUI::init() { #endif -#elif !HAS_STATUS_MESSAGE // && !HAS_DISPLAY - - // - // Send the status line as a host notification - // - void MarlinUI::set_status(const char * const cstr, const bool) { - TERN(HOST_PROMPT_SUPPORT, hostui.notify(cstr), UNUSED(cstr)); - } - void MarlinUI::set_status(FSTR_P const fstr, const int8_t) { - TERN(HOST_PROMPT_SUPPORT, hostui.notify(fstr), UNUSED(fstr)); - } - void MarlinUI::status_printf(const uint8_t, FSTR_P const fstr, ...) { - TERN(HOST_PROMPT_SUPPORT, hostui.notify(fstr), UNUSED(fstr)); - } - -#endif // !HAS_DISPLAY && !HAS_STATUS_MESSAGE +#endif // HAS_DISPLAY #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 30c22188e426..7a6b3992b4c4 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -365,7 +365,7 @@ class MarlinUI { static void set_status(const char * const cstr, const bool persist=false); static void set_status(FSTR_P const fstr, const int8_t level=0); - static void status_printf(const uint8_t level, FSTR_P const fmt, ...); + static void status_printf(int8_t level, FSTR_P const fmt, ...); #if HAS_DISPLAY From 9324132a401cf0ab3781c9992d607bd4f88ba086 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 25 Mar 2022 17:09:55 -0500 Subject: [PATCH 202/502] =?UTF-8?q?=F0=9F=8E=A8=20Format,=20use=20status?= =?UTF-8?q?=20macros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 10 +++++----- Marlin/src/gcode/lcd/M117.cpp | 2 +- Marlin/src/gcode/temp/M140_M190.cpp | 5 ++--- Marlin/src/gcode/temp/M192.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 4 ++-- Marlin/src/lcd/marlinui.cpp | 14 +++++++++++--- Marlin/src/lcd/marlinui.h | 4 ---- Marlin/src/module/motion.cpp | 9 ++------- Marlin/src/module/probe.cpp | 6 +++--- Marlin/src/module/temperature.cpp | 2 +- Marlin/src/sd/cardreader.cpp | 2 +- 11 files changed, 29 insertions(+), 31 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 0a18e95ebcad..d8e64294f057 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1339,13 +1339,13 @@ #endif #if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI) - // The timeout (in ms) to return to the status screen from sub-menus - //#define LCD_TIMEOUT_TO_STATUS 15000 + // The timeout to return to the status screen from sub-menus + //#define LCD_TIMEOUT_TO_STATUS 15000 // (ms) #if ENABLED(SHOW_BOOTSCREEN) - #define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s) + #define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s) #if EITHER(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI) - #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash) + #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash) #endif #endif @@ -3464,7 +3464,7 @@ #define SPINDLE_LASER_USE_PWM // Enable if your controller supports setting the speed/power #if ENABLED(SPINDLE_LASER_USE_PWM) #define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower - #define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR, ESP32 and LPC) + #define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR, ESP32, and LPC) #endif //#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11 diff --git a/Marlin/src/gcode/lcd/M117.cpp b/Marlin/src/gcode/lcd/M117.cpp index f26694bd6463..86023e12e3b4 100644 --- a/Marlin/src/gcode/lcd/M117.cpp +++ b/Marlin/src/gcode/lcd/M117.cpp @@ -33,7 +33,7 @@ void GcodeSuite::M117() { if (parser.string_arg && parser.string_arg[0]) - ui.set_status(parser.string_arg); + ui.set_status(parser.string_arg, true); else ui.reset_status(); diff --git a/Marlin/src/gcode/temp/M140_M190.cpp b/Marlin/src/gcode/temp/M140_M190.cpp index 7532defccdac..d6992ba938e4 100644 --- a/Marlin/src/gcode/temp/M140_M190.cpp +++ b/Marlin/src/gcode/temp/M140_M190.cpp @@ -82,10 +82,9 @@ void GcodeSuite::M140_M190(const bool isM190) { if (!got_temp) return; thermalManager.setTargetBed(temp); + thermalManager.isHeatingBed() ? LCD_MESSAGE(MSG_BED_HEATING) : LCD_MESSAGE(MSG_BED_COOLING); - ui.set_status(thermalManager.isHeatingBed() ? GET_TEXT_F(MSG_BED_HEATING) : GET_TEXT_F(MSG_BED_COOLING)); - - // with PRINTJOB_TIMER_AUTOSTART, M190 can start the timer, and M140 can stop it + // With PRINTJOB_TIMER_AUTOSTART, M190 can start the timer, and M140 can stop it TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(isM190, !isM190)); if (isM190) diff --git a/Marlin/src/gcode/temp/M192.cpp b/Marlin/src/gcode/temp/M192.cpp index a96e2d34a4bf..04b36a548c3c 100644 --- a/Marlin/src/gcode/temp/M192.cpp +++ b/Marlin/src/gcode/temp/M192.cpp @@ -49,7 +49,7 @@ void GcodeSuite::M192() { } const celsius_t target_temp = parser.value_celsius(); - ui.set_status(thermalManager.isProbeBelowTemp(target_temp) ? GET_TEXT_F(MSG_PROBE_HEATING) : GET_TEXT_F(MSG_PROBE_COOLING)); + thermalManager.isProbeBelowTemp(target_temp) ? LCD_MESSAGE(MSG_PROBE_HEATING) : LCD_MESSAGE(MSG_PROBE_COOLING); thermalManager.wait_for_probe(target_temp, no_wait_for_cooling); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 66e90740fdfb..7b5f6955afb4 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -2304,7 +2304,7 @@ TERN(HAS_ONESTEP_LEVELING, float, void) Tram(uint8_t point) { inLev = true; zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW); if (isnan(zval)) - ui.set_status(F("Position Not Reachable, check offsets")); + LCD_MESSAGE_F("Position Not Reachable, check offsets"); else { sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"), dtostrf(xpos, 1, 1, str_1), @@ -2336,7 +2336,7 @@ void TramC () { Tram(4); } void Trammingwizard() { bed_mesh_t zval = {0}; if (HMI_data.FullManualTramming) { - ui.set_status(F("Disable manual tramming")); + LCD_MESSAGE_F("Disable manual tramming"); return; } zval[0][0] = Tram(0); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 9e27dc6006a0..dc7ecf2246e4 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -593,7 +593,7 @@ void MarlinUI::init() { // share the same line on the display. // - #if DISABLED(PROGRESS_MSG_ONCE) || (PROGRESS_MSG_EXPIRE > 0) + #if DISABLED(PROGRESS_MSG_ONCE) || PROGRESS_MSG_EXPIRE > 0 #define GOT_MS const millis_t ms = millis(); #endif @@ -1420,6 +1420,7 @@ void MarlinUI::init() { #if SERVICE_INTERVAL_3 > 0 static PGMSTR(service3, "> " SERVICE_NAME_3 "!"); #endif + FSTR_P msg; if (printingIsPaused()) msg = GET_TEXT_F(MSG_PRINT_PAUSED); @@ -1450,13 +1451,18 @@ void MarlinUI::init() { set_status(msg, -1); } + /** + * Set Status with a fixed string and alert level. + * @param fstr A constant F-string to set as the status. + * @param level Alert level. Negative to ignore and reset the level. Non-zero never expires. + */ void MarlinUI::set_status(FSTR_P const fstr, int8_t level) { - PGM_P const pstr = FTOP(fstr); + // Alerts block lower priority messages if (level < 0) level = alert_level = 0; if (level < alert_level) return; alert_level = level; - TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify(fstr)); + PGM_P const pstr = FTOP(fstr); // Since the message is encoded in UTF8 it must // only be cut on a character boundary. @@ -1476,6 +1482,8 @@ void MarlinUI::init() { strncpy_P(status_message, pstr, maxLen); status_message[maxLen] = '\0'; + TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify(fstr)); + finish_status(level > 0); } diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 7a6b3992b4c4..b9e2e9b692f0 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -39,10 +39,6 @@ #define HAS_ENCODER_ACTION 1 #endif -#if HAS_STATUS_MESSAGE - #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U) -#endif - #if E_MANUAL > 1 #define MULTI_E_MANUAL 1 #endif diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 7b1e0a3fb9b9..d8df8e12e1ed 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -29,9 +29,8 @@ #include "stepper.h" #include "planner.h" #include "temperature.h" - #include "../gcode/gcode.h" - +#include "../lcd/marlinui.h" #include "../inc/MarlinConfig.h" #if IS_SCARA @@ -51,10 +50,6 @@ #include "../feature/bltouch.h" #endif -#if HAS_STATUS_MESSAGE - #include "../lcd/marlinui.h" -#endif - #if HAS_FILAMENT_SENSOR #include "../feature/runout.h" #endif @@ -1325,7 +1320,7 @@ void prepare_line_to_destination() { ); SERIAL_ECHO_START(); SERIAL_ECHOLN(msg); - TERN_(HAS_STATUS_MESSAGE, ui.set_status(msg)); + ui.set_status(msg); return true; } return false; diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index c34178412f28..5b0bd77d0de7 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -313,9 +313,9 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { ui.set_status(ds_str, 99); SERIAL_ECHOLNF(deploy ? GET_EN_TEXT_F(MSG_MANUAL_DEPLOY) : GET_EN_TEXT_F(MSG_MANUAL_STOW)); - TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("Stow Probe"), FPSTR(CONTINUE_STR))); - TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Stow Probe"))); - TERN_(DWIN_LCD_PROUI, DWIN_Popup_Confirm(ICON_BLTouch, F("Stow Probe"), FPSTR(CONTINUE_STR))); + TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, ds_str, FPSTR(CONTINUE_STR))); + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(ds_str)); + TERN_(DWIN_LCD_PROUI, DWIN_Popup_Confirm(ICON_BLTouch, ds_str, FPSTR(CONTINUE_STR))); TERN_(HAS_RESUME_CONTINUE, wait_for_user_response()); ui.reset_status(); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index a983275b8aff..38cc3663d2c8 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -651,7 +651,7 @@ volatile bool Temperature::raw_temps_ready = false; // PID Tuning loop wait_for_heatup = true; // Can be interrupted with M108 - TERN_(HAS_STATUS_MESSAGE, ui.set_status(F("Wait for heat up..."))); + LCD_MESSAGE(MSG_HEATING); while (wait_for_heatup) { const millis_t ms = millis(); diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 724de8f82a2f..652a44e52651 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -458,7 +458,7 @@ void CardReader::mount() { cdroot(); #if ENABLED(USB_FLASH_DRIVE_SUPPORT) || PIN_EXISTS(SD_DETECT) else if (marlin_state != MF_INITIALIZING) - ui.set_status(GET_TEXT_F(MSG_MEDIA_INIT_FAIL), -1); + LCD_ALERTMESSAGE(MSG_MEDIA_INIT_FAIL); #endif ui.refresh(); From 0e693854d0c86fa0998a5d497607d42d6798f6ab Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 25 Mar 2022 17:35:00 -0500 Subject: [PATCH 203/502] =?UTF-8?q?=F0=9F=9A=B8=20Clear=20"heating/cooling?= =?UTF-8?q?"=20message=20on=20temp=20reached?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/temp/M104_M109.cpp | 2 +- Marlin/src/gcode/temp/M140_M190.cpp | 5 +++++ Marlin/src/lcd/marlinui.cpp | 6 ++++++ Marlin/src/lcd/marlinui.h | 6 ++++++ Marlin/src/module/temperature.cpp | 10 +++++++++- Marlin/src/module/temperature.h | 4 ++-- 6 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Marlin/src/gcode/temp/M104_M109.cpp b/Marlin/src/gcode/temp/M104_M109.cpp index baaac0210098..331ceeb61db1 100644 --- a/Marlin/src/gcode/temp/M104_M109.cpp +++ b/Marlin/src/gcode/temp/M104_M109.cpp @@ -126,7 +126,7 @@ void GcodeSuite::M104_M109(const bool isM109) { #endif if (thermalManager.isHeatingHotend(target_extruder) || !no_wait_for_cooling) - thermalManager.set_heating_message(target_extruder); + thermalManager.set_heating_message(target_extruder, !isM109 && got_temp); } TERN_(AUTOTEMP, planner.autotemp_M104_M109()); diff --git a/Marlin/src/gcode/temp/M140_M190.cpp b/Marlin/src/gcode/temp/M140_M190.cpp index d6992ba938e4..c5e3c000290c 100644 --- a/Marlin/src/gcode/temp/M140_M190.cpp +++ b/Marlin/src/gcode/temp/M140_M190.cpp @@ -89,6 +89,11 @@ void GcodeSuite::M140_M190(const bool isM190) { if (isM190) thermalManager.wait_for_bed(no_wait_for_cooling); + else + ui.set_status_reset_fn([]{ + const celsius_t c = thermalManager.degTargetBed(); + return c < 30 || thermalManager.degBedNear(c); + }); } #endif // HAS_HEATED_BED diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index dc7ecf2246e4..8906b01e5e53 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -73,6 +73,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1]; uint8_t MarlinUI::alert_level; // = 0 + statusResetFunc_t MarlinUI::status_reset_callback; // = nullptr #endif #if ENABLED(LCD_SET_PROGRESS_MANUALLY) @@ -627,6 +628,9 @@ void MarlinUI::init() { #endif // BASIC_PROGRESS_BAR + if (status_reset_callback && (*status_reset_callback)()) + reset_status(); + #if HAS_MARLINUI_MENU if (use_click()) { #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) @@ -1515,6 +1519,8 @@ void MarlinUI::init() { UNUSED(persist); + set_status_reset_fn(); + #if HAS_WIRED_LCD #if BASIC_PROGRESS_BAR || BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index b9e2e9b692f0..17852a5039a4 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -59,6 +59,8 @@ #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80U) +typedef bool (*statusResetFunc_t)(); + #if HAS_WIRED_LCD enum LCDViewAction : uint8_t { @@ -352,11 +354,15 @@ class MarlinUI { static void reset_status(const bool no_welcome=false); static void set_alert_status(FSTR_P const fstr); static void reset_alert_level() { alert_level = 0; } + + static statusResetFunc_t status_reset_callback; + static void set_status_reset_fn(const statusResetFunc_t fn=nullptr) { status_reset_callback = fn; } #else static constexpr bool has_status() { return false; } static void reset_status(const bool=false) {} static void set_alert_status(FSTR_P const) {} static void reset_alert_level() {} + static void set_status_reset_fn(const statusResetFunc_t=nullptr) {} #endif static void set_status(const char * const cstr, const bool persist=false); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 38cc3663d2c8..6660d9a8f81c 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -3631,7 +3631,7 @@ void Temperature::isr() { #endif #if HAS_HOTEND && HAS_STATUS_MESSAGE - void Temperature::set_heating_message(const uint8_t e) { + void Temperature::set_heating_message(const uint8_t e, const bool isM104/*=false*/) { const bool heating = isHeatingHotend(e); ui.status_printf(0, #if HAS_MULTI_HOTEND @@ -3641,6 +3641,14 @@ void Temperature::isr() { #endif , heating ? GET_TEXT(MSG_HEATING) : GET_TEXT(MSG_COOLING) ); + + if (isM104) { + static uint8_t wait_e; wait_e = e; + ui.set_status_reset_fn([]{ + const celsius_t c = degTargetHotend(wait_e); + return c < 30 || degHotendNear(wait_e, c); + }); + } } #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index cb84f7e395d4..a4681ba02ba9 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -961,9 +961,9 @@ class Temperature { #endif #if HAS_HOTEND && HAS_STATUS_MESSAGE - static void set_heating_message(const uint8_t e); + static void set_heating_message(const uint8_t e, const bool isM104=false); #else - static void set_heating_message(const uint8_t) {} + static void set_heating_message(const uint8_t, const bool=false) {} #endif #if HAS_MARLINUI_MENU && HAS_TEMPERATURE From c89d0114acba957d63e894bc1a479ec10cb18a81 Mon Sep 17 00:00:00 2001 From: Robby Candra Date: Sat, 26 Mar 2022 06:34:20 +0700 Subject: [PATCH 204/502] =?UTF-8?q?=E2=9C=A8=20STATUS=5FMESSAGE=5FTIMEOUT?= =?UTF-8?q?=5FSEC=20(#23135)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 3 +++ Marlin/src/inc/Conditionals_adv.h | 4 ++++ Marlin/src/inc/Warnings.cpp | 4 ++++ Marlin/src/lcd/marlinui.cpp | 18 ++++++++++++++++-- Marlin/src/lcd/marlinui.h | 4 ++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d8e64294f057..86eef1a02657 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1352,6 +1352,9 @@ // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING + // Apply a timeout to low-priority status messages + //#define STATUS_MESSAGE_TIMEOUT_SEC 30 // (seconds) + // On the Info Screen, display XY with one decimal place when possible //#define LCD_DECIMAL_SMALL_XY diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index d63395a7199f..8a85536aea48 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -587,6 +587,10 @@ #define HAS_PRINT_PROGRESS 1 #endif +#if STATUS_MESSAGE_TIMEOUT_SEC > 0 + #define HAS_STATUS_MESSAGE_TIMEOUT 1 +#endif + #if ENABLED(SDSUPPORT) && SD_PROCEDURE_DEPTH #define HAS_MEDIA_SUBCALLS 1 #endif diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index c4716cd3769a..055cfc76985e 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -574,6 +574,10 @@ #warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX." #endif +#if PROGRESS_MSG_EXPIRE > 0 && HAS_STATUS_MESSAGE_TIMEOUT + #warning "It is recommended not to combine PROGRESS_MSG_EXPIRE with STATUS_MESSAGE_TIMEOUT_SEC." +#endif + /** * FYSETC backlighting */ diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 8906b01e5e53..7c97ef791ddc 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -73,6 +73,9 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1]; uint8_t MarlinUI::alert_level; // = 0 + #if HAS_STATUS_MESSAGE_TIMEOUT + millis_t MarlinUI::status_message_expire_ms; // = 0 + #endif statusResetFunc_t MarlinUI::status_reset_callback; // = nullptr #endif @@ -628,8 +631,17 @@ void MarlinUI::init() { #endif // BASIC_PROGRESS_BAR - if (status_reset_callback && (*status_reset_callback)()) - reset_status(); + bool did_expire = status_reset_callback && (*status_reset_callback)(); + + #if HAS_STATUS_MESSAGE_TIMEOUT + #ifndef GOT_MS + #define GOT_MS + const millis_t ms = millis(); + #endif + did_expire |= status_message_expire_ms && ELAPSED(ms, status_message_expire_ms); + #endif + + if (did_expire) reset_status(); #if HAS_MARLINUI_MENU if (use_click()) { @@ -1521,6 +1533,8 @@ void MarlinUI::init() { set_status_reset_fn(); + TERN_(HAS_STATUS_MESSAGE_TIMEOUT, status_message_expire_ms = persist ? 0 : millis() + (STATUS_MESSAGE_TIMEOUT_SEC) * 1000UL); + #if HAS_WIRED_LCD #if BASIC_PROGRESS_BAR || BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 17852a5039a4..d9404541d268 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -344,6 +344,10 @@ class MarlinUI { static char status_message[]; static uint8_t alert_level; // Higher levels block lower levels + #if HAS_STATUS_MESSAGE_TIMEOUT + static millis_t status_message_expire_ms; // Reset some status messages after a timeout + #endif + #if ENABLED(STATUS_MESSAGE_SCROLLING) static uint8_t status_scroll_offset; static void advance_status_scroll(); From 3bce266ef7865a62b5e79c7c5c67a068bb5e4c20 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 26 Mar 2022 14:03:43 +1300 Subject: [PATCH 205/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MMU2=20buzz=20(#23?= =?UTF-8?q?943)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to 89a9c3a391 --- Marlin/src/feature/mmu/mmu2.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp index 7a7e27f28795..a469c988c9cf 100644 --- a/Marlin/src/feature/mmu/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -143,7 +143,10 @@ uint8_t MMU2::get_current_tool() { #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE) #endif -inline void ATTN_BUZZ(const bool two=false) { BUZZ(200, 404); if (two) { BUZZ(10, 0); BUZZ(200, 404); } } +void mmu2_attn_buzz(const bool two=false) { + BUZZ(200, 404); + if (two) { BUZZ(10, 0); BUZZ(200, 404); } +} void MMU2::mmu_loop() { @@ -819,7 +822,7 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { } LCD_MESSAGE(MSG_MMU2_RESUMING); - ATTN_BUZZ(true); + mmu2_attn_buzz(true); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" @@ -901,7 +904,7 @@ void MMU2::load_filament(const uint8_t index) { command(MMU_CMD_L0 + index); manage_response(false, false); - ATTN_BUZZ(); + mmu2_attn_buzz(); } /** @@ -912,7 +915,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) { if (!_enabled) return false; if (thermalManager.tooColdToExtrude(active_extruder)) { - ATTN_BUZZ(); + mmu2_attn_buzz(); LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD); return false; } @@ -927,7 +930,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) { extruder = index; active_extruder = 0; load_to_nozzle(); - ATTN_BUZZ(); + mmu2_attn_buzz(); } return success; } @@ -948,7 +951,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) { if (!_enabled) return false; if (thermalManager.tooColdToExtrude(active_extruder)) { - ATTN_BUZZ(); + mmu2_attn_buzz(); LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD); return false; } @@ -964,11 +967,11 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) { if (recover) { LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER); - ATTN_BUZZ(); + mmu2_attn_buzz(); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover"))); TERN_(HAS_RESUME_CONTINUE, wait_for_user_response()); - ATTN_BUZZ(true); + mmu2_attn_buzz(true); command(MMU_CMD_R0); manage_response(false, false); @@ -981,7 +984,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) { set_runout_valid(false); - ATTN_BUZZ(); + mmu2_attn_buzz(); stepper.disable_extruder(); @@ -996,7 +999,7 @@ bool MMU2::unload() { if (!_enabled) return false; if (thermalManager.tooColdToExtrude(active_extruder)) { - ATTN_BUZZ(); + mmu2_attn_buzz(); LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD); return false; } @@ -1007,7 +1010,7 @@ bool MMU2::unload() { command(MMU_CMD_U0); manage_response(false, true); - ATTN_BUZZ(); + mmu2_attn_buzz(); // no active tool extruder = MMU2_NO_TOOL; From edc4089121bcd96645b7be6bbd3dafa88c510ede Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 25 Mar 2022 21:16:00 -0500 Subject: [PATCH 206/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20pulldown=20sanity?= =?UTF-8?q?=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/inc/SanityCheck.h | 4 ++++ Marlin/src/HAL/DUE/inc/SanityCheck.h | 4 ++++ Marlin/src/HAL/ESP32/inc/SanityCheck.h | 4 ++++ Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h | 4 ++++ Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h | 4 ++++ Marlin/src/inc/Conditionals_post.h | 11 +++++++++++ Marlin/src/inc/SanityCheck.h | 12 ------------ 7 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Marlin/src/HAL/AVR/inc/SanityCheck.h b/Marlin/src/HAL/AVR/inc/SanityCheck.h index 5c1f01a8f477..15a5be4cd257 100644 --- a/Marlin/src/HAL/AVR/inc/SanityCheck.h +++ b/Marlin/src/HAL/AVR/inc/SanityCheck.h @@ -71,3 +71,7 @@ #if ENABLED(POSTMORTEM_DEBUGGING) #error "POSTMORTEM_DEBUGGING is not supported on AVR boards." #endif + +#if USING_PULLDOWNS + #error "PULLDOWN pin mode is not available on AVR boards." +#endif diff --git a/Marlin/src/HAL/DUE/inc/SanityCheck.h b/Marlin/src/HAL/DUE/inc/SanityCheck.h index 87b09cf29257..75480acaf2e2 100644 --- a/Marlin/src/HAL/DUE/inc/SanityCheck.h +++ b/Marlin/src/HAL/DUE/inc/SanityCheck.h @@ -59,3 +59,7 @@ #if HAS_TMC_SW_SERIAL #error "TMC220x Software Serial is not supported on the DUE platform." #endif + +#if USING_PULLDOWNS + #error "PULLDOWN pin mode is not available on DUE boards." +#endif diff --git a/Marlin/src/HAL/ESP32/inc/SanityCheck.h b/Marlin/src/HAL/ESP32/inc/SanityCheck.h index 052c7e9d12fe..04d70ec14f0b 100644 --- a/Marlin/src/HAL/ESP32/inc/SanityCheck.h +++ b/Marlin/src/HAL/ESP32/inc/SanityCheck.h @@ -44,3 +44,7 @@ #if MB(MKS_TINYBEE) && ENABLED(FAST_PWM_FAN) #error "FAST_PWM_FAN is not available on TinyBee." #endif + +#if USING_PULLDOWNS + #error "PULLDOWN pin mode is not available on ESP32 boards." +#endif diff --git a/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h b/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h index 1efa76b1e9df..dbce187673c9 100644 --- a/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h +++ b/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h @@ -40,3 +40,7 @@ #if ENABLED(POSTMORTEM_DEBUGGING) #error "POSTMORTEM_DEBUGGING is not yet supported on Teensy 3.1/3.2." #endif + +#if USING_PULLDOWNS + #error "PULLDOWN pin mode is not available on Teensy 3.1/3.2 boards." +#endif diff --git a/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h b/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h index eef2850550eb..330870737184 100644 --- a/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h +++ b/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h @@ -40,3 +40,7 @@ #if ENABLED(POSTMORTEM_DEBUGGING) #error "POSTMORTEM_DEBUGGING is not yet supported on Teensy 3.5/3.6." #endif + +#if USING_PULLDOWNS + #error "PULLDOWN pin mode is not available on Teensy 3.5/3.6 boards." +#endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 9942f14eee87..dd175ac2cc41 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -3507,3 +3507,14 @@ #if PIN_EXISTS(SAFE_POWER) && DISABLED(DISABLE_DRIVER_SAFE_POWER_PROTECT) #define HAS_DRIVER_SAFE_POWER_PROTECT 1 #endif + +#if ANY(ENDSTOPPULLDOWNS, ENDSTOPPULLDOWN_ZMIN_PROBE, \ + ENDSTOPPULLDOWN_XMIN, ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN, \ + ENDSTOPPULLDOWN_IMIN, ENDSTOPPULLDOWN_JMIN, ENDSTOPPULLDOWN_KMIN, \ + ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, ENDSTOPPULLDOWN_ZMAX, \ + ENDSTOPPULLDOWN_IMAX, ENDSTOPPULLDOWN_JMAX, ENDSTOPPULLDOWN_KMAX, \ + POWER_LOSS_PULLDOWN, CALIBRATION_PIN_PULLDOWN, FIL_RUNOUT_PULLDOWN, \ + FIL_RUNOUT1_PULLDOWN, FIL_RUNOUT2_PULLDOWN, FIL_RUNOUT3_PULLDOWN, FIL_RUNOUT4_PULLDOWN, \ + FIL_RUNOUT5_PULLDOWN, FIL_RUNOUT6_PULLDOWN, FIL_RUNOUT7_PULLDOWN, FIL_RUNOUT8_PULLDOWN) + #define USING_PULLDOWNS 1 +#endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 617d117415b0..552a6270934e 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -782,18 +782,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif -#if !defined(TARGET_LPC1768) && ANY( \ - ENDSTOPPULLDOWNS, ENDSTOPPULLDOWN_ZMIN_PROBE, \ - ENDSTOPPULLDOWN_XMAX, ENDSTOPPULLDOWN_YMAX, ENDSTOPPULLDOWN_ZMAX, \ - ENDSTOPPULLDOWN_XMIN, ENDSTOPPULLDOWN_YMIN, ENDSTOPPULLDOWN_ZMIN, \ - FIL_RUNOUT_PULLDOWN, \ - FIL_RUNOUT1_PULLDOWN, FIL_RUNOUT2_PULLDOWN, FIL_RUNOUT3_PULLDOWN, FIL_RUNOUT4_PULLDOWN, \ - FIL_RUNOUT5_PULLDOWN, FIL_RUNOUT6_PULLDOWN, FIL_RUNOUT7_PULLDOWN, FIL_RUNOUT8_PULLDOWN, \ - POWER_LOSS_PULLDOWN, CALIBRATION_PIN_PULLDOWN \ - ) - #error "PULLDOWN pin mode is not available on the selected board." -#endif - #if BOTH(ENDSTOPPULLUPS, ENDSTOPPULLDOWNS) #error "Enable only one of ENDSTOPPULLUPS or ENDSTOPPULLDOWNS." #elif BOTH(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN) From e99104a0040f58477809c9e2b9506fe2bcd94331 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 26 Mar 2022 16:44:22 +1300 Subject: [PATCH 207/502] =?UTF-8?q?=E2=9C=A8=20Configurable=20FREEZE=20pin?= =?UTF-8?q?=20state=20(#23944,=20#23948)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Scott Lahteine --- Marlin/Configuration_adv.h | 1 + Marlin/src/MarlinCore.cpp | 10 +++++++--- Marlin/src/inc/Conditionals_post.h | 14 +++----------- Marlin/src/inc/SanityCheck.h | 4 ++-- Marlin/src/module/stepper.cpp | 4 ++-- Marlin/src/module/stepper.h | 2 +- Marlin/src/pins/pinsDebug_list.h | 2 +- 7 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 86eef1a02657..195a0e8d163d 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -4116,6 +4116,7 @@ //#define FREEZE_FEATURE #if ENABLED(FREEZE_FEATURE) //#define FREEZE_PIN 41 // Override the default (KILL) pin here + #define FREEZE_STATE LOW // State of pin indicating freeze #endif /** diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 4117d3f382a1..be93bfcfb9d7 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -476,7 +476,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { #endif #if HAS_FREEZE_PIN - Stepper::frozen = !READ(FREEZE_PIN); + stepper.frozen = READ(FREEZE_PIN) == FREEZE_STATE; #endif #if HAS_HOME @@ -1166,9 +1166,13 @@ void setup() { #endif #endif - #if HAS_FREEZE_PIN + #if ENABLED(FREEZE_FEATURE) SETUP_LOG("FREEZE_PIN"); - SET_INPUT_PULLUP(FREEZE_PIN); + #if FREEZE_STATE + SET_INPUT_PULLDOWN(FREEZE_PIN); + #else + SET_INPUT_PULLUP(FREEZE_PIN); + #endif #endif #if HAS_SUICIDE diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index dd175ac2cc41..85ccb8088ec2 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2824,17 +2824,9 @@ #endif // User Interface -#if ENABLED(FREEZE_FEATURE) - #if !PIN_EXISTS(FREEZE) && PIN_EXISTS(KILL) - #define FREEZE_PIN KILL_PIN - #endif - #if PIN_EXISTS(FREEZE) - #define HAS_FREEZE_PIN 1 - #endif -#else - #undef FREEZE_PIN -#endif -#if PIN_EXISTS(KILL) && TERN1(FREEZE_FEATURE, KILL_PIN != FREEZE_PIN) +#if ENABLED(FREEZE_FEATURE) && !PIN_EXISTS(FREEZE) && PIN_EXISTS(KILL) + #define FREEZE_PIN KILL_PIN +#elif PIN_EXISTS(KILL) && TERN1(FREEZE_FEATURE, KILL_PIN != FREEZE_PIN) #define HAS_KILL 1 #endif #if PIN_EXISTS(HOME) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 552a6270934e..405c9fd7ca5d 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1035,8 +1035,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Instant Freeze */ -#if ENABLED(FREEZE_FEATURE) && !PIN_EXISTS(FREEZE) - #error "FREEZE_FEATURE requires a FREEZE_PIN to be defined." +#if ENABLED(FREEZE_FEATURE) && !(PIN_EXISTS(FREEZE) && defined(FREEZE_STATE)) + #error "FREEZE_FEATURE requires both FREEZE_PIN and FREEZE_STATE." #endif /** diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index f83104fe9c47..af64d9f8bf1d 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -189,7 +189,7 @@ bool Stepper::abort_current_block; uint32_t Stepper::acceleration_time, Stepper::deceleration_time; uint8_t Stepper::steps_per_isr; -#if HAS_FREEZE_PIN +#if ENABLED(FREEZE_FEATURE) bool Stepper::frozen; // = false #endif @@ -1643,7 +1643,7 @@ void Stepper::pulse_phase_isr() { if (!current_block) return; // Skipping step processing causes motion to freeze - if (TERN0(HAS_FREEZE_PIN, frozen)) return; + if (TERN0(FREEZE_FEATURE, frozen)) return; // Count of pending loops and events for this iteration const uint32_t pending_events = step_event_count - step_events_completed; diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 99aa714ca095..4c9fbb9556b9 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -336,7 +336,7 @@ class Stepper { static constexpr uint8_t last_moved_extruder = 0; #endif - #if HAS_FREEZE_PIN + #if ENABLED(FREEZE_FEATURE) static bool frozen; // Set this flag to instantly freeze motion #endif diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index 2328a826ef7e..d7e84b996605 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -823,7 +823,7 @@ #if HAS_KILL REPORT_NAME_DIGITAL(__LINE__, KILL_PIN) #endif -#if HAS_FREEZE_PIN +#if PIN_EXISTS(FREEZE) REPORT_NAME_DIGITAL(__LINE__, FREEZE_PIN) #endif #if PIN_EXISTS(LCD_BACKLIGHT) From be08d4c4f01e2c297365664bd3e0f7dc2b051fde Mon Sep 17 00:00:00 2001 From: David Forrest Date: Sun, 27 Mar 2022 21:19:02 -0400 Subject: [PATCH 208/502] =?UTF-8?q?=F0=9F=94=A8=20Fix=20Makefile=20GCC=20w?= =?UTF-8?q?arning=20(#23957)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Makefile b/Marlin/Makefile index eee1403b537c..f1c89ff7f520 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -132,7 +132,7 @@ CC_MIN:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_MINOR__ | cut -f3 -d\ ) CC_PATCHLEVEL:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_PATCHLEVEL__ | cut -f3 -d\ ) CC_VER:=$(shell echo $$(( $(CC_MAJ) * 10000 + $(CC_MIN) * 100 + $(CC_PATCHLEVEL) ))) ifeq ($(shell test $(CC_VER) -lt 40901 && echo 1),1) - @echo This version of GCC is likely broken. Enabling relocation workaround. + $(warning This GCC version $(CC_VER) is likely broken. Enabling relocation workaround.) RELOC_WORKAROUND = 1 endif From 071e5c336a157ca39b75081b8cb4436a72af965e Mon Sep 17 00:00:00 2001 From: Ludy Date: Mon, 28 Mar 2022 03:20:54 +0200 Subject: [PATCH 209/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MMU2=20buzz=20(#23?= =?UTF-8?q?950)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #23943 --- Marlin/src/libs/buzzer.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/src/libs/buzzer.h b/Marlin/src/libs/buzzer.h index 9fc46ff6296c..73406c0591be 100644 --- a/Marlin/src/libs/buzzer.h +++ b/Marlin/src/libs/buzzer.h @@ -129,6 +129,5 @@ #endif #define ERR_BUZZ() BUZZ(400, 40); -#define ATTN_BUZZ() do{ BUZZ(198, 404); BUZZ(4, 0); BUZZ(198, 404); }while(0) #define OKAY_BUZZ() do{ BUZZ(100, 659); BUZZ(10, 0); BUZZ(100, 698); }while(0) #define DONE_BUZZ(OK) do{ if (OK) OKAY_BUZZ(); else ERR_BUZZ(); }while(0) From c7e8ba78576af230278a5662103acf421dc59bfd Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Mon, 2 May 2022 16:29:25 -0700 Subject: [PATCH 210/502] =?UTF-8?q?=F0=9F=93=9D=20Fix=20extraneous=20URL?= =?UTF-8?q?=20args=20(#24125)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 2 +- Marlin/src/pins/ramps/pins_RAMPS.h | 2 +- Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h | 2 +- Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h | 2 +- Marlin/src/pins/stm32f4/pins_ARMED.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 9c6b74f1269d..b8de260909b6 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -234,7 +234,7 @@ #if ENABLED(FYSETC_MINI_12864) // - // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + // See https://wiki.fysetc.com/Mini12864_Panel/ // #define DOGLCD_A0 16 #define DOGLCD_CS 17 diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index c7ef0be99e64..d88d7e33127b 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -752,7 +752,7 @@ #elif ENABLED(FYSETC_MINI_12864) - // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + // From https://wiki.fysetc.com/Mini12864_Panel/ #define DOGLCD_A0 EXP1_07_PIN #define DOGLCD_CS EXP1_08_PIN diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h index 1e0efcf0b21d..1315d994c8b8 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h @@ -439,7 +439,7 @@ #elif ENABLED(FYSETC_MINI_12864) - // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + // From https://wiki.fysetc.com/Mini12864_Panel/ // TO TEST //#define DOGLCD_A0 16 diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h index 2484674a90b3..5450b3766b71 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h @@ -490,7 +490,7 @@ #elif ENABLED(FYSETC_MINI_12864) - // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + // From https://wiki.fysetc.com/Mini12864_Panel/ // TO TEST //#define DOGLCD_A0 16 diff --git a/Marlin/src/pins/stm32f4/pins_ARMED.h b/Marlin/src/pins/stm32f4/pins_ARMED.h index 7cccac7caa3a..f7c6b7f88a76 100644 --- a/Marlin/src/pins/stm32f4/pins_ARMED.h +++ b/Marlin/src/pins/stm32f4/pins_ARMED.h @@ -150,7 +150,7 @@ #if ENABLED(FYSETC_MINI_12864) // - // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + // See https://wiki.fysetc.com/Mini12864_Panel/ // #define DOGLCD_A0 PE9 #define DOGLCD_CS PE8 From eeda8b451acb2a0ae96656876f6a7682d43aca1d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 4 May 2022 12:47:15 -0500 Subject: [PATCH 211/502] =?UTF-8?q?=F0=9F=93=9D=20Replace=20KB=20with=20K?= =?UTF-8?q?=20in=20pins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 2 +- Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 2 +- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 2 +- Marlin/src/pins/sam/pins_KRATOS32.h | 2 +- Marlin/src/pins/sam/pins_RADDS.h | 2 +- Marlin/src/pins/stm32f0/pins_MALYAN_M300.h | 2 +- Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h | 4 ++-- Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 4 ++-- Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h | 2 +- Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h | 4 ++-- Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 4 ++-- Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h | 4 ++-- Marlin/src/pins/stm32f1/pins_CHITU3D_common.h | 4 ++-- Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h | 2 +- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 4 ++-- Marlin/src/pins/stm32f1/pins_FLY_MINI.h | 2 +- Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h | 4 ++-- Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h | 4 ++-- Marlin/src/pins/stm32f1/pins_GTM32_MINI.h | 2 +- Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h | 2 +- Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h | 2 +- Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h | 2 +- Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h | 4 ++-- Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h | 10 +++++----- Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h | 6 +++--- Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 2 +- .../src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 4 ++-- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 4 ++-- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h | 4 ++-- Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h | 4 ++-- Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h | 4 ++-- Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h | 4 ++-- Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h | 4 ++-- Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h | 4 ++-- Marlin/src/pins/stm32f4/pins_ANET_ET4.h | 4 ++-- Marlin/src/pins/stm32f4/pins_ARMED.h | 2 +- Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h | 2 +- Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h | 2 +- Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h | 2 +- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 2 +- Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 2 +- Marlin/src/pins/stm32f4/pins_FLYF407ZG.h | 4 ++-- Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 2 +- Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h | 2 +- Marlin/src/pins/stm32f4/pins_INDEX_REV03.h | 2 +- Marlin/src/pins/stm32f4/pins_LERDGE_S.h | 6 +++--- Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h | 2 +- .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 2 +- Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 2 +- Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h | 4 ++-- Marlin/src/pins/stm32f4/pins_RUMBA32_BTT.h | 2 +- Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h | 2 +- Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h | 2 +- Marlin/src/pins/stm32f4/pins_VAKE403D.h | 2 +- Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h | 2 +- Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h | 2 +- 59 files changed, 88 insertions(+), 88 deletions(-) diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index e2efdfa4929b..7953f678fa48 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -54,7 +54,7 @@ #endif #ifndef MARLIN_EEPROM_SIZE - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index 56ee7fa73235..27b65c22cd5c 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -35,7 +35,7 @@ // Onboard I2C EEPROM #define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x1000 // 4KB (AT24C32) +#define MARLIN_EEPROM_SIZE 0x1000 // 4K (AT24C32) // // Servos diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index 7edfb9196fa2..0c001e6061cc 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -39,7 +39,7 @@ //#define SDCARD_EEPROM_EMULATION //#define I2C_EEPROM // AT24C32 #define FLASH_EEPROM_EMULATION - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/sam/pins_KRATOS32.h b/Marlin/src/pins/sam/pins_KRATOS32.h index f429e5634706..f7867f9b2607 100644 --- a/Marlin/src/pins/sam/pins_KRATOS32.h +++ b/Marlin/src/pins/sam/pins_KRATOS32.h @@ -34,7 +34,7 @@ // #if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) #define I2C_EEPROM - #define MARLIN_EEPROM_SIZE 0x1F400 // 16KB + #define MARLIN_EEPROM_SIZE 0x1F400 // 16K #endif // diff --git a/Marlin/src/pins/sam/pins_RADDS.h b/Marlin/src/pins/sam/pins_RADDS.h index da176f444784..af24014614c1 100644 --- a/Marlin/src/pins/sam/pins_RADDS.h +++ b/Marlin/src/pins/sam/pins_RADDS.h @@ -34,7 +34,7 @@ // #if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) #define I2C_EEPROM - #define MARLIN_EEPROM_SIZE 0x2000 // 8KB + #define MARLIN_EEPROM_SIZE 0x2000 // 8K #endif // diff --git a/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h b/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h index 904a9a56fac6..d38d4bbdb378 100644 --- a/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h +++ b/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h @@ -33,7 +33,7 @@ #if NO_EEPROM_SELECTED #define FLASH_EEPROM_EMULATION #ifndef MARLIN_EEPROM_SIZE - #define MARLIN_EEPROM_SIZE 0x800U // 2KB + #define MARLIN_EEPROM_SIZE 0x800U // 2K #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h index 7b8abb130060..e3e91ff35ad4 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h @@ -52,9 +52,9 @@ #if ENABLED(I2C_EEPROM) #define IIC_EEPROM_SDA PB7 #define IIC_EEPROM_SCL PB6 - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #elif ENABLED(SDCARD_EEPROM_EMULATION) - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h index 704501de108b..7300919d9df7 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -33,9 +33,9 @@ #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h index 2ab7a61e0b95..b5fddc4d7494 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h @@ -29,7 +29,7 @@ #if NO_EEPROM_SELECTED #define I2C_EEPROM #define SOFT_I2C_EEPROM - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #define I2C_SDA_PIN PB7 #define I2C_SCL_PIN PB6 #undef NO_EEPROM_SELECTED diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index 5b48d7cadbcf..e728af317d82 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -33,9 +33,9 @@ #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h index a92de805f75b..7e2c638acb50 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h @@ -33,9 +33,9 @@ #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h index b0b201f1d50d..ed3a653d2192 100644 --- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h +++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h @@ -43,9 +43,9 @@ // #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE 0x800U // 2KB + #define EEPROM_PAGE_SIZE 0x800U // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_common.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_common.h index 989b7eec6f65..bc41e97041fc 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_common.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_common.h @@ -44,10 +44,10 @@ #if ENABLED(FLASH_EEPROM_EMULATION) // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h) #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE) - #define EEPROM_PAGE_SIZE (0x800U) // 2KB, but will use 2x more (4KB) + #define EEPROM_PAGE_SIZE (0x800U) // 2K, but will use 2x more (4K) #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE #else - #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM + #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2K, require this amount of RAM #endif // diff --git a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h index 0682bfd73620..8d0093a4d989 100644 --- a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h @@ -41,7 +41,7 @@ #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE) #endif diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 947e36c765e7..ada12ee3ea4b 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -53,9 +53,9 @@ // #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 5468d0b4bd7c..952b40c1dedb 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -32,7 +32,7 @@ // #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE 0x800 // 2KB + #define EEPROM_PAGE_SIZE 0x800 // 2K #define EEPROM_START_ADDRESS (0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) // 256K firmware space #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE #endif diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h index de91db22d554..9f4a66b7070c 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h @@ -40,9 +40,9 @@ // #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h index e0f906bf9ecc..c473a37d3e58 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h @@ -37,9 +37,9 @@ #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index 03547381c010..5515132c7844 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -53,7 +53,7 @@ // Enable EEPROM Emulation for this board as it doesn't have EEPROM #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h index cb5200bc27da..dc23680b8c20 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h @@ -53,7 +53,7 @@ // Enable EEPROM Emulation for this board as it doesn't have EEPROM #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h index 88aa35f2c08b..4b5d38e8c544 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h @@ -58,7 +58,7 @@ // Enable EEPROM Emulation for this board as it doesn't have EEPROM #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h index 12a6d5b84d7f..968d9cb6bd58 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h @@ -53,7 +53,7 @@ // Enable EEPROM Emulation for this board as it doesn't have EEPROM #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h index beae0a3bf0b6..86a8ed6b9a81 100644 --- a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h @@ -53,9 +53,9 @@ #endif #if ENABLED(I2C_EEPROM) - //#define MARLIN_EEPROM_SIZE 0x8000UL // 32KB + //#define MARLIN_EEPROM_SIZE 0x8000UL // 32K #elif ENABLED(FLASH_EEPROM_EMULATION) - //#define MARLIN_EEPROM_SIZE 0x1000UL // 4KB + //#define MARLIN_EEPROM_SIZE 0x1000UL // 4K //#define MARLIN_EEPROM_SIZE (EEPROM_START_ADDRESS + (EEPROM_PAGE_SIZE) * 2UL) #endif diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index ac11bd8b38b8..59d9b8d95676 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -194,19 +194,19 @@ #define EEPROM_SCK_PIN BOARD_SPI1_SCK_PIN // PA5 pin 30 #define EEPROM_MISO_PIN BOARD_SPI1_MISO_PIN // PA6 pin 31 #define EEPROM_MOSI_PIN BOARD_SPI1_MOSI_PIN // PA7 pin 32 - #define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet) - #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64KB for now... + #define EEPROM_PAGE_SIZE 0x1000U // 4K (from datasheet) + #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64K for now... #elif HAS_SPI_FLASH - #define SPI_FLASH_SIZE 0x40000U // limit to 256KB (M993 will reboot with 512) + #define SPI_FLASH_SIZE 0x40000U // limit to 256K (M993 will reboot with 512) #define SPI_FLASH_CS_PIN PC5 #define SPI_FLASH_MOSI_PIN PA7 #define SPI_FLASH_MISO_PIN PA6 #define SPI_FLASH_SCK_PIN PA5 #elif ENABLED(FLASH_EEPROM_EMULATION) // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h) - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE) #else - #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM + #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2K, require this amount of RAM #endif diff --git a/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h b/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h index 87526bac8797..37c67708848c 100644 --- a/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h @@ -46,16 +46,16 @@ #define I2C_EEPROM #undef NO_EEPROM_SELECTED -#define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#define MARLIN_EEPROM_SIZE 0x1000 // 4K #define USE_SHARED_EEPROM 1 // Use Platform-independent Arduino functions for I2C EEPROM #define E2END 0xFFFF // EEPROM end address AT24C256 (32kB) */ #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE 0x800U // 2KB + #define EEPROM_PAGE_SIZE 0x800U // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif #define SPI_DEVICE 2 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index 150c18d79a1b..6ab20681ad5a 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -53,7 +53,7 @@ #endif #if ENABLED(FLASH_EEPROM_EMULATION) - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE) #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 88c5d5f53c73..ef800b15c7a3 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -54,7 +54,7 @@ #if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) #define I2C_EEPROM // EEPROM on I2C-0 - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h index 4eaf2e946939..31e034e025e9 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1_common.h @@ -27,7 +27,7 @@ // Onboard I2C EEPROM #if NO_EEPROM_SELECTED #define I2C_EEPROM - #define MARLIN_EEPROM_SIZE 0x1000// 4KB + #define MARLIN_EEPROM_SIZE 0x1000// 4K #undef NO_EEPROM_SELECTED #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index a1a822a9c2f3..4af88c18482a 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -40,9 +40,9 @@ // #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index c981fdc00a57..d45ab1a950ec 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -45,9 +45,9 @@ // #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif #define SPI_DEVICE 2 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 07ee8c4fa060..49fe59577edc 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -54,7 +54,7 @@ #if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) #define I2C_EEPROM // EEPROM on I2C-0 - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h index e057e13c25f0..2040a4ba29d8 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h @@ -42,9 +42,9 @@ #endif #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif #define SPI_DEVICE 2 diff --git a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h index a3c68e644a47..382e461d5174 100644 --- a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h +++ b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h @@ -33,9 +33,9 @@ #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_PAGE_SIZE (0x800U) // 2K #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index 6c7e7cbbfa48..4ffa8da924d3 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -51,10 +51,10 @@ #if ENABLED(FLASH_EEPROM_EMULATION) // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h) #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE) - #define EEPROM_PAGE_SIZE (0x800U) // 2KB, but will use 2x more (4KB) + #define EEPROM_PAGE_SIZE (0x800U) // 2K, but will use 2x more (4K) #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE #else - #define MARLIN_EEPROM_SIZE (0x800U) // On SD, Limit to 2KB, require this amount of RAM + #define MARLIN_EEPROM_SIZE (0x800U) // On SD, Limit to 2K, require this amount of RAM #endif // diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h index b1e5f77d0e9f..f1f03a7dd789 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h @@ -30,9 +30,9 @@ #if NO_EEPROM_SELECTED #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800) // 2KB + #define EEPROM_PAGE_SIZE (0x800) // 2K #define EEPROM_START_ADDRESS (0x08000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif //============================================================================= diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h index 49e9564b2738..17e13bdc87ba 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h @@ -30,9 +30,9 @@ #if NO_EEPROM_SELECTED #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800) // 2KB + #define EEPROM_PAGE_SIZE (0x800) // 2K #define EEPROM_START_ADDRESS (0x08000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif //#define OPTION_DUALZ_DRIVE diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h index 295ab4c50ccc..df0eb9c3d812 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h @@ -30,9 +30,9 @@ #if NO_EEPROM_SELECTED #define FLASH_EEPROM_EMULATION - #define EEPROM_PAGE_SIZE (0x800) // 2KB + #define EEPROM_PAGE_SIZE (0x800) // 2K #define EEPROM_START_ADDRESS (0x08000000 + (STM32_FLASH_SIZE) * 1024 - 2 * EEPROM_PAGE_SIZE) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif //#define OPTION_DUALZ_DRIVE diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h index 43aefe97f51d..09da5adf7c6d 100644 --- a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -39,7 +39,7 @@ #if NO_EEPROM_SELECTED //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation - //#define IIC_BL24CXX_EEPROM // Use I2C EEPROM onboard IC (AT24C04C, Size 4KB, PageSize 16B) + //#define IIC_BL24CXX_EEPROM // Use I2C EEPROM onboard IC (AT24C04C, Size 4K, PageSize 16B) #endif #if ENABLED(FLASH_EEPROM_EMULATION) @@ -50,7 +50,7 @@ #define IIC_EEPROM_SDA PB11 #define IIC_EEPROM_SCL PB10 #define EEPROM_DEVICE_ADDRESS 0xA0 - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f4/pins_ARMED.h b/Marlin/src/pins/stm32f4/pins_ARMED.h index f7c6b7f88a76..6d5b87240d6b 100644 --- a/Marlin/src/pins/stm32f4/pins_ARMED.h +++ b/Marlin/src/pins/stm32f4/pins_ARMED.h @@ -40,7 +40,7 @@ #if NO_EEPROM_SELECTED #define I2C_EEPROM - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h index e6d7c3c20c3c..3f475ee35588 100644 --- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h +++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h @@ -33,7 +33,7 @@ #define FLASH_EEPROM_EMULATION //#define I2C_EEPROM #endif -//#define E2END 0xFFF // 4KB +//#define E2END 0xFFF // 4K #define HAL_TIMER_RATE F_CPU diff --git a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h index 061680aa79cd..9da6e1a01b6a 100644 --- a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h +++ b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h @@ -42,7 +42,7 @@ //#define I2C_EEPROM #define SRAM_EEPROM_EMULATION -#define MARLIN_EEPROM_SIZE 0x2000 // 8KB +#define MARLIN_EEPROM_SIZE 0x2000 // 8K // // Servos diff --git a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h index 554b2704c7df..40f953a7e8f5 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h @@ -36,7 +36,7 @@ // Onboard I2C EEPROM #define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#define MARLIN_EEPROM_SIZE 0x1000 // 4K // // Servos diff --git a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h index 7db6c4922e88..25736b1a4905 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -37,7 +37,7 @@ // Onboard I2C EEPROM #define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x2000 // 8KB (24C64 ... 64Kb = 8KB) +#define MARLIN_EEPROM_SIZE 0x2000 // 8K (24C64 ... 64Kb = 8K) // // Servos diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h index 8652a815c21b..c53e9344aaa6 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -28,7 +28,7 @@ // Onboard I2C EEPROM #define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x8000 // 32KB (24C32A) +#define MARLIN_EEPROM_SIZE 0x8000 // 32K (24C32A) #define I2C_SCL_PIN PB8 #define I2C_SDA_PIN PB9 diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 514fad4b8924..3f5f7262b387 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -50,11 +50,11 @@ // the 128kB sector allocated for EEPROM emulation. #define FLASH_EEPROM_LEVELING #elif ENABLED(I2C_EEPROM) - #define MARLIN_EEPROM_SIZE 0x2000 // 8KB + #define MARLIN_EEPROM_SIZE 0x2000 // 8K #endif #ifndef MARLIN_EEPROM_SIZE - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index dfcb4217c9db..299cc153773d 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -50,7 +50,7 @@ // 128 kB sector allocated for EEPROM emulation. #define FLASH_EEPROM_LEVELING #elif ENABLED(I2C_EEPROM) - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h b/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h index e05811552e2b..67f276bd2295 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h @@ -39,7 +39,7 @@ #endif #if ENABLED(I2C_EEPROM) - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h b/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h index 977f4763437c..ba3172aa8008 100644 --- a/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h +++ b/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h @@ -40,7 +40,7 @@ */ #define SRAM_EEPROM_EMULATION -#define MARLIN_EEPROM_SIZE 0x2000 // 8KB +#define MARLIN_EEPROM_SIZE 0x2000 // 8K // I2C MCP3426 (16-Bit, 240SPS, dual-channel ADC) #define HAS_MCP3426_ADC diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h index e4fc97170c44..4def11abec8e 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h @@ -186,15 +186,15 @@ #define EEPROM_SCK_PIN PB13 // datasheet: CLK pin, found with multimeter, not tested #define EEPROM_MISO_PIN PB14 // datasheet: DO pin, found with multimeter, not tested #define EEPROM_MOSI_PIN PB15 // datasheet: DI pin, found with multimeter, not tested - #define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet) - #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64KB for now... + #define EEPROM_PAGE_SIZE 0x1000U // 4K (from datasheet) + #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64K for now... #elif ENABLED(I2C_EEPROM) // FM24CL64BG (CYP1813) 64Kbit F-RAM #define SOFT_I2C_EEPROM // Force the use of Software I2C #define I2C_SDA_PIN PG13 #define I2C_SCL_PIN PG14 // To be confirmed on the Lerdge S, but probably same as the K #define MARLIN_EEPROM_SIZE 0x10000 #else - #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM + #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2K, require this amount of RAM #endif // diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h index af71f0d562c8..124923fef841 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h @@ -44,7 +44,7 @@ //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation //#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation #define I2C_EEPROM // Need use jumpers set i2c for EEPROM -#define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#define MARLIN_EEPROM_SIZE 0x1000 // 4K #define I2C_SCL_PIN PB8 // I2C_SCL and CAN_RX #define I2C_SDA_PIN PB9 // I2C_SDA and CAN_TX diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index 032ce41bcb2f..22e00a4eb4a7 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -36,7 +36,7 @@ //#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation #if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) #define I2C_EEPROM - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #define I2C_SCL_PIN PB6 #define I2C_SDA_PIN PB7 #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index 68b238525477..fde2682dc097 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -37,7 +37,7 @@ //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation //#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation #define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#define MARLIN_EEPROM_SIZE 0x1000 // 4K #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h index f2073457b13b..e926a2b0c6a4 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h @@ -33,10 +33,10 @@ #if NO_EEPROM_SELECTED #if MB(RUMBA32_V1_0) #define FLASH_EEPROM_EMULATION - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #elif MB(RUMBA32_V1_1) #define I2C_EEPROM - #define MARLIN_EEPROM_SIZE 0x2000 // 8KB (24LC64T-I/OT) + #define MARLIN_EEPROM_SIZE 0x2000 // 8K (24LC64T-I/OT) #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_BTT.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_BTT.h index 28d2dfd1806f..2f3e121fe17a 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_BTT.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_BTT.h @@ -30,7 +30,7 @@ #if NO_EEPROM_SELECTED #define I2C_EEPROM - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB (24LC32AT-I/OT) + #define MARLIN_EEPROM_SIZE 0x1000 // 4K (24LC32AT-I/OT) #endif #if ENABLED(FLASH_EEPROM_EMULATION) diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h index 0b539417d6d0..3833a3a007a9 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h @@ -37,7 +37,7 @@ #if NO_EEPROM_SELECTED #define FLASH_EEPROM_EMULATION - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif #if ENABLED(FLASH_EEPROM_EMULATION) diff --git a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h index fd6b96054214..1439e6de651c 100644 --- a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h +++ b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h @@ -34,7 +34,7 @@ // Onboard I2C EEPROM #if NO_EEPROM_SELECTED #define I2C_EEPROM - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #define I2C_SCL_PIN PB6 #define I2C_SDA_PIN PB7 #undef NO_EEPROM_SELECTED diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h index c6b24f9eca61..813944d3cb43 100644 --- a/Marlin/src/pins/stm32f4/pins_VAKE403D.h +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -32,7 +32,7 @@ #define BOARD_INFO_NAME "STM32F4 VAkE" //#define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#define MARLIN_EEPROM_SIZE 0x1000 // 4K // // Servos diff --git a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h index 2fddb68a7c0c..4fc3504ed1c9 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h @@ -41,7 +41,7 @@ #define SOFT_I2C_EEPROM // Force the use of Software I2C #define I2C_SCL_PIN PB6 #define I2C_SDA_PIN PB7 - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif // diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h index 9eb0acf1448d..0b6edc9d3c6e 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h @@ -30,7 +30,7 @@ // Onboard I2C EEPROM #define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x1000 // 4KB (24C32 ... 32Kb = 4KB) +#define MARLIN_EEPROM_SIZE 0x1000 // 4K (24C32 ... 32Kb = 4K) #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support From 81f403025c3ddb479ccf363fb091ac0fcf8e667b Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Thu, 5 May 2022 00:38:48 -0700 Subject: [PATCH 212/502] =?UTF-8?q?=F0=9F=90=9B=20Some=20EEPROM=20size=20f?= =?UTF-8?q?ixes=20(#24113)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 4 ++-- Marlin/src/pins/sam/pins_RURAMPS4D_11.h | 2 +- Marlin/src/pins/sam/pins_RURAMPS4D_13.h | 2 +- Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h | 2 +- Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 4 ++-- Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h | 4 ++-- Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h | 4 ++-- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 2 +- Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 2 +- Marlin/src/pins/stm32f4/pins_LERDGE_S.h | 4 ++-- Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index df6ae8c01721..25c7ba69b6db 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -46,9 +46,9 @@ #endif #if ENABLED(I2C_EEPROM) - #define MARLIN_EEPROM_SIZE 0x8000 // 32Kb + #define MARLIN_EEPROM_SIZE 0x8000 // 32K #elif ENABLED(SDCARD_EEPROM_EMULATION) - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb + #define MARLIN_EEPROM_SIZE 0x800 // 2K #endif // diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 4bdadd80828e..643c68ae4fad 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -179,7 +179,7 @@ // // EEPROM // -#define MARLIN_EEPROM_SIZE 0x8000 // 32Kb (24lc256) +#define MARLIN_EEPROM_SIZE 0x8000 // 32K (24lc256) #define I2C_EEPROM // EEPROM on I2C-0 //#define EEPROM_SD // EEPROM on SDCARD //#define SPI_EEPROM // EEPROM on SPI-0 diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index 5273cbcd0e93..ee741dcbf540 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -162,7 +162,7 @@ // // EEPROM // -#define MARLIN_EEPROM_SIZE 0x8000 // 32Kb (24lc256) +#define MARLIN_EEPROM_SIZE 0x8000 // 32K (24lc256) #define I2C_EEPROM // EEPROM on I2C-0 //#define EEPROM_SD // EEPROM on SDCARD //#define SPI_EEPROM // EEPROM on SPI-0 diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h index 1315d994c8b8..382c607d239b 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h @@ -44,7 +44,7 @@ */ //#define FLASH_EEPROM_EMULATION #define I2C_EEPROM // EEPROM on I2C-0 -#define MARLIN_EEPROM_SIZE 0x70000 // 512K (CAT24C512) +#define MARLIN_EEPROM_SIZE 0x10000 // 64K (CAT24C512) // This is another option to emulate an EEPROM, but it's more efficient to not lose the data in the first place. //#define SDCARD_EEPROM_EMULATION diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h index 5450b3766b71..71fe76a59219 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h @@ -48,7 +48,7 @@ */ //#define FLASH_EEPROM_EMULATION #define I2C_EEPROM // EEPROM on I2C-0 -#define MARLIN_EEPROM_SIZE 0x70000 // 512K (CAT24C512) +#define MARLIN_EEPROM_SIZE 0x10000 // 64K (CAT24C512) //This its another option to emulate an EEPROM, but its more efficient to dont loose the data the first One. //#define SDCARD_EEPROM_EMULATION diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index d6d496624121..b2534beab6db 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -51,9 +51,9 @@ #if ENABLED(IIC_BL24CXX_EEPROM) #define IIC_EEPROM_SDA PA11 #define IIC_EEPROM_SCL PA12 - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) + #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16) #elif ENABLED(SDCARD_EEPROM_EMULATION) - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb + #define MARLIN_EEPROM_SIZE 0x800 // 2K #endif // diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h index 7bf34441bcf4..87101ecccd54 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -52,10 +52,10 @@ #if ENABLED(IIC_BL24CXX_EEPROM) #define IIC_EEPROM_SDA PA11 #define IIC_EEPROM_SCL PA12 - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) + #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16) #else #define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb + #define MARLIN_EEPROM_SIZE 0x800 // 2K #endif // SPI diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h index 85d279872d55..a9ff02d1f4e2 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h @@ -47,9 +47,9 @@ #if ENABLED(IIC_BL24CXX_EEPROM) #define IIC_EEPROM_SDA PA11 #define IIC_EEPROM_SCL PA12 - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16) + #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16) #elif ENABLED(SDCARD_EEPROM_EMULATION) - #define MARLIN_EEPROM_SIZE 0x800 // 2Kb + #define MARLIN_EEPROM_SIZE 0x800 // 2K #endif // diff --git a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h index 25736b1a4905..68d92e1c30d7 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -37,7 +37,7 @@ // Onboard I2C EEPROM #define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x2000 // 8K (24C64 ... 64Kb = 8K) +#define MARLIN_EEPROM_SIZE 0x2000 // 8K (24C64) // // Servos diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h index c53e9344aaa6..4255881baf86 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -28,7 +28,7 @@ // Onboard I2C EEPROM #define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x8000 // 32K (24C32A) +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB (AT24C32) #define I2C_SCL_PIN PB8 #define I2C_SDA_PIN PB9 diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h index 4def11abec8e..0e8b6e09a865 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h @@ -187,12 +187,12 @@ #define EEPROM_MISO_PIN PB14 // datasheet: DO pin, found with multimeter, not tested #define EEPROM_MOSI_PIN PB15 // datasheet: DI pin, found with multimeter, not tested #define EEPROM_PAGE_SIZE 0x1000U // 4K (from datasheet) - #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64K for now... + #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64K for now... #elif ENABLED(I2C_EEPROM) // FM24CL64BG (CYP1813) 64Kbit F-RAM #define SOFT_I2C_EEPROM // Force the use of Software I2C #define I2C_SDA_PIN PG13 #define I2C_SCL_PIN PG14 // To be confirmed on the Lerdge S, but probably same as the K - #define MARLIN_EEPROM_SIZE 0x10000 + #define MARLIN_EEPROM_SIZE 0x2000U // 8K #else #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2K, require this amount of RAM #endif diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h index 0b6edc9d3c6e..f48c007d8cec 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h @@ -30,7 +30,7 @@ // Onboard I2C EEPROM #define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x1000 // 4K (24C32 ... 32Kb = 4K) +#define MARLIN_EEPROM_SIZE 0x1000 // 4K (24C32) #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support From 6112277f9b2d24a7c9effeb5966dadef279a261c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 5 May 2022 19:11:59 -0500 Subject: [PATCH 213/502] =?UTF-8?q?=F0=9F=94=A8=20Use=20first=20g++=20in?= =?UTF-8?q?=20path=20for=20'native'=20targets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/PlatformIO/scripts/preprocessor.py | 16 ++++++++++------ ini/native.ini | 9 ++++++--- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/preprocessor.py b/buildroot/share/PlatformIO/scripts/preprocessor.py index 6f4ed900cab1..3d324bac4b38 100644 --- a/buildroot/share/PlatformIO/scripts/preprocessor.py +++ b/buildroot/share/PlatformIO/scripts/preprocessor.py @@ -3,6 +3,7 @@ # import subprocess,os,re +nocache = 1 verbose = 0 def blab(str): @@ -50,7 +51,7 @@ def run_preprocessor(env, fn=None): # def search_compiler(env): - ENV_BUILD_PATH = os.path.join(env.Dictionary('PROJECT_BUILD_DIR'), env['PIOENV']) + ENV_BUILD_PATH = os.path.join(env['PROJECT_BUILD_DIR'], env['PIOENV']) GCC_PATH_CACHE = os.path.join(ENV_BUILD_PATH, ".gcc_path") try: @@ -60,14 +61,17 @@ def search_compiler(env): except: pass - if os.path.exists(GCC_PATH_CACHE): + # Warning: The cached .gcc_path will obscure a newly-installed toolkit + if not nocache and os.path.exists(GCC_PATH_CACHE): blab("Getting g++ path from cache") with open(GCC_PATH_CACHE, 'r') as f: return f.read() - # Find the current platform compiler by searching the $PATH - # which will be in a platformio toolchain bin folder - path_regex = re.escape(env['PROJECT_PACKAGES_DIR']) + # Find a platform compiler by searching $PATH items + # A native target will search all PATH bin folders. + # Others look only within $HOME/.platformio. + path_regex = "" if env.GetProjectOption('platform') == 'native' else re.escape(env['PROJECT_PACKAGES_DIR']) + gcc = "g++" if env['PLATFORM'] == 'win32': path_separator = ';' @@ -87,7 +91,7 @@ def search_compiler(env): # Use entire path to not rely on env PATH filepath = os.path.sep.join([pathdir, filepath]) # Cache the g++ path to no search always - if os.path.exists(ENV_BUILD_PATH): + if not nocache and os.path.exists(ENV_BUILD_PATH): blab("Caching g++ for current env") with open(GCC_PATH_CACHE, 'w+') as f: f.write(filepath) diff --git a/ini/native.ini b/ini/native.ini index 3d196f343649..02737a074638 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -63,12 +63,12 @@ build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags} # # Simulator for macOS (MacPorts) # -# sudo port install gcc10 gdb glm libsdl2 libsdl2_net freetype +# sudo port install gcc11 gdb glm libsdl2 libsdl2_net freetype # sudo port install ld64 @3_3 +ld64_xcode # # cd /opt/local/bin # sudo rm -f gcc g++ cc -# sudo ln -s gcc-mp-10 gcc ; sudo ln -s g++-mp-10 g++ ; sudo ln -s g++ cc +# sudo ln -s gcc-mp-11 gcc ; sudo ln -s g++-mp-11 g++ ; sudo ln -s g++ cc # This step may be obsolete: # sudo port uninstall ld64 ld64-latest # @@ -79,7 +79,6 @@ build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags} # [simulator_macos] build_unflags = -lGL -custom_verbose = 0 build_flags = -I/opt/local/include -I/opt/local/include/freetype2 @@ -93,11 +92,15 @@ build_flags = extends = env:simulator_linux_debug build_flags = ${env:simulator_linux_debug.build_flags} ${simulator_macos.build_flags} -ggdb -Og -D_THREAD_SAFE build_unflags = ${simulator_macos.build_unflags} +custom_verbose = 0 +custom_gcc = g++ [env:simulator_macos_release] extends = env:simulator_linux_release build_flags = ${env:simulator_linux_release.build_flags} ${simulator_macos.build_flags} build_unflags = ${simulator_macos.build_unflags} +custom_verbose = 0 +custom_gcc = g++ # # Simulator for Windows 10 From ceb99e89a081d2230479e9bb7b63c23d14bf0b98 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 5 May 2022 18:55:43 -0500 Subject: [PATCH 214/502] =?UTF-8?q?=F0=9F=94=A8=20Prevent=20build=20attrib?= =?UTF-8?q?ute=20define=20conflicts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/macros.h | 10 +++++----- Marlin/src/feature/bedlevel/ubl/ubl.h | 18 +++++++++--------- Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp | 2 +- Marlin/src/libs/bresenham.h | 6 +++--- Marlin/src/libs/nozzle.h | 12 ++++++------ Marlin/src/module/endstops.cpp | 2 +- Marlin/src/module/temperature.h | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 31808586cf0d..8e52152c1453 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -70,11 +70,11 @@ #define FORCE_INLINE __attribute__((always_inline)) inline #define NO_INLINE __attribute__((noinline)) #define _UNUSED __attribute__((unused)) -#define _O0 __attribute__((optimize("O0"))) -#define _Os __attribute__((optimize("Os"))) -#define _O1 __attribute__((optimize("O1"))) -#define _O2 __attribute__((optimize("O2"))) -#define _O3 __attribute__((optimize("O3"))) +#define __O0 __attribute__((optimize("O0"))) +#define __Os __attribute__((optimize("Os"))) +#define __O1 __attribute__((optimize("O1"))) +#define __O2 __attribute__((optimize("O2"))) +#define __O3 __attribute__((optimize("O3"))) #define IS_CONSTEXPR(...) __builtin_constant_p(__VA_ARGS__) // Only valid solution with C++14. Should use std::is_constant_evaluated() in C++20 instead diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index f117c1af65d3..8dad966acb84 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -70,13 +70,13 @@ class unified_bed_leveling { static void move_z_with_encoder(const_float_t multiplier); static float measure_point_with_encoder(); static float measure_business_card_thickness(); - static void manually_probe_remaining_mesh(const xy_pos_t&, const_float_t , const_float_t , const bool) _O0; - static void fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) _O0; + static void manually_probe_remaining_mesh(const xy_pos_t&, const_float_t , const_float_t , const bool) __O0; + static void fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) __O0; #endif - static bool G29_parse_parameters() _O0; + static bool G29_parse_parameters() __O0; static void shift_mesh_height(); - static void probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) _O0; + static void probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) __O0; static void tilt_mesh_based_on_3pts(const_float_t z1, const_float_t z2, const_float_t z3); static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map); static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); @@ -98,17 +98,17 @@ class unified_bed_leveling { static void report_state(); static void save_ubl_active_state_and_disable(); static void restore_ubl_active_state_and_leave(); - static void display_map(const uint8_t) _O0; - static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) _O0; - static mesh_index_pair find_furthest_invalid_mesh_point() _O0; + static void display_map(const uint8_t) __O0; + static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) __O0; + static mesh_index_pair find_furthest_invalid_mesh_point() __O0; static void reset(); static void invalidate(); static void set_all_mesh_points_to_value(const_float_t value); static void adjust_mesh_to_mean(const bool cflag, const_float_t value); static bool sanity_check(); - static void G29() _O0; // O0 for no optimization - static void smart_fill_wlsf(const_float_t ) _O2; // O2 gives smaller code than Os on A2560 + static void G29() __O0; // O0 for no optimization + static void smart_fill_wlsf(const_float_t ) __O2; // O2 gives smaller code than Os on A2560 static int8_t storage_slot; diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp index f7e98c9fa77d..3da4ed9809f9 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp @@ -340,7 +340,7 @@ * Returns true if did NOT move, false if moved (requires current_position update). */ - bool _O2 unified_bed_leveling::line_to_destination_segmented(const_feedRate_t scaled_fr_mm_s) { + bool __O2 unified_bed_leveling::line_to_destination_segmented(const_feedRate_t scaled_fr_mm_s) { if (!position_is_reachable(destination)) // fail if moving outside reachable boundary return true; // did not move, so current_position still accurate diff --git a/Marlin/src/libs/bresenham.h b/Marlin/src/libs/bresenham.h index 865c43c29e0b..39ab60700769 100644 --- a/Marlin/src/libs/bresenham.h +++ b/Marlin/src/libs/bresenham.h @@ -30,7 +30,7 @@ */ #define FORCE_INLINE __attribute__((always_inline)) inline -#define _O3 __attribute__((optimize("O3"))) +#define __O3 __attribute__((optimize("O3"))) template struct BresenhamCfg { static constexpr uint8_t UID = uid, SIZE = size; }; @@ -114,9 +114,9 @@ class Bresenham { if (tick1(index)) { value[index] += dir[index]; back(index); } } - FORCE_INLINE static void tick1() _O3 { for (uint8_t i = 0; i < Cfg::SIZE; i++) (void)tick1(i); } + FORCE_INLINE static void tick1() __O3 { for (uint8_t i = 0; i < Cfg::SIZE; i++) (void)tick1(i); } - FORCE_INLINE static void tick() _O3 { for (uint8_t i = 0; i < Cfg::SIZE; i++) (void)tick(i); } + FORCE_INLINE static void tick() __O3 { for (uint8_t i = 0; i < Cfg::SIZE; i++) (void)tick(i); } static void report(const uint8_t index) { if (index < Cfg::SIZE) { diff --git a/Marlin/src/libs/nozzle.h b/Marlin/src/libs/nozzle.h index 7bbd0e35c11b..69790f5a6786 100644 --- a/Marlin/src/libs/nozzle.h +++ b/Marlin/src/libs/nozzle.h @@ -41,7 +41,7 @@ class Nozzle { * @param end xyz_pos_t defining the ending point * @param strokes number of strokes to execute */ - static void stroke(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes) _Os; + static void stroke(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes) __Os; /** * @brief Zig-zag clean pattern @@ -52,7 +52,7 @@ class Nozzle { * @param strokes number of strokes to execute * @param objects number of objects to create */ - static void zigzag(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes, const uint8_t &objects) _Os; + static void zigzag(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes, const uint8_t &objects) __Os; /** * @brief Circular clean pattern @@ -62,7 +62,7 @@ class Nozzle { * @param strokes number of strokes to execute * @param radius radius of circle */ - static void circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const_float_t radius) _Os; + static void circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const_float_t radius) __Os; #endif // NOZZLE_CLEAN_FEATURE @@ -77,14 +77,14 @@ class Nozzle { * @param pattern one of the available patterns * @param argument depends on the cleaning pattern */ - static void clean(const uint8_t &pattern, const uint8_t &strokes, const_float_t radius, const uint8_t &objects, const uint8_t cleans) _Os; + static void clean(const uint8_t &pattern, const uint8_t &strokes, const_float_t radius, const uint8_t &objects, const uint8_t cleans) __Os; #endif // NOZZLE_CLEAN_FEATURE #if ENABLED(NOZZLE_PARK_FEATURE) - static float park_mode_0_height(const_float_t park_z) _Os; - static void park(const uint8_t z_action, const xyz_pos_t &park=NOZZLE_PARK_POINT) _Os; + static float park_mode_0_height(const_float_t park_z) __Os; + static void park(const uint8_t z_action, const xyz_pos_t &park=NOZZLE_PARK_POINT) __Os; #endif }; diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 3dd6d8aeb685..180f455734b3 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -494,7 +494,7 @@ static void print_es_state(const bool is_hit, FSTR_P const flabel=nullptr) { #pragma GCC diagnostic pop -void _O2 Endstops::report_states() { +void __O2 Endstops::report_states() { TERN_(BLTOUCH, bltouch._set_SW_mode()); SERIAL_ECHOLNPGM(STR_M119_REPORT); #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, F(STR_##S)) diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index a4681ba02ba9..d1552d8f48cf 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -677,7 +677,7 @@ class Temperature { /** * Call periodically to manage heaters */ - static void manage_heater() _O2; // Added _O2 to work around a compiler error + static void manage_heater() __O2; // __O2 added to work around a compiler error /** * Preheating hotends From dd29394bbe17ab6458817cce65b94f106252092f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 May 2022 14:58:39 -0500 Subject: [PATCH 215/502] =?UTF-8?q?=F0=9F=94=A8=20Improved=20mfprep=20scri?= =?UTF-8?q?pt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/git/mfprep | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/buildroot/share/git/mfprep b/buildroot/share/git/mfprep index b329d7d8c5d9..7245126de156 100755 --- a/buildroot/share/git/mfprep +++ b/buildroot/share/git/mfprep @@ -2,11 +2,16 @@ # # mfprep tag1 [tag2] # -# Find commits in bugfix-2.0.x not yet in 2.0.x +# Find commits in bugfix-2.0.x that are not yet in 2.0.x. +# +# Specify a version tag to start from, and optional version tag to end at. +# For bugfix-2.0.x the tag will be prefixed by bf- to distinguish it from the version tag, +# so at every release be sure to create a bf- tag and publish it to origin. # SED=$(which gsed sed | head -n1) SELF=`basename "$0"` +DRYRUN=0 [[ $# < 1 || $# > 2 ]] && { echo "Usage $SELF tag1 [tag2]" ; exit 1 ; } @@ -38,13 +43,22 @@ git log --pretty="[%h] %s" $TAG1..$TAG2 | $SED '1!G;h;$!d' >"$LOG2" || { echo "C cat "$LOG2" | while read line; do #echo "... $line" - if [[ $line =~ (\(#[0-9]{5}\))$ ]]; then - PATT=${BASH_REMATCH[1]} + if [[ $line =~ \(((#[0-9]{5}),* *)((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?\)$ ]]; then + PATT="" + for i in ${!BASH_REMATCH[@]}; do + if ((i > 0 && (i % 2 == 0))); then + if [[ -n "${BASH_REMATCH[i]}" ]]; then + [[ -n "$PATT" ]] && PATT="$PATT|" + PATT="$PATT${BASH_REMATCH[i]}" + fi + fi + done #echo "... $PATT" + [[ -n $PATT ]] && { grep -vE "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } else PATT=$( $SED -E 's/^\[[0-9a-f]{10}\]( . )?(.+)$/\2/' <<<"$line" ) + [[ -n $PATT ]] && { grep -v "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } fi - [[ -n $PATT ]] && { grep -v "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } done # Convert remaining commits into git commands @@ -62,4 +76,4 @@ done mv "$TMPF" "$SCRF" chmod ug+x "$SCRF" -open "$TMPDIR" +((DRYRUN)) && rm -r "$TMPDIR" || open "$TMPDIR" From 68ee64283a7aab95c2f70eaf734e24b9d909dfa7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 29 Mar 2022 03:48:37 -0500 Subject: [PATCH 216/502] =?UTF-8?q?=F0=9F=8E=A8=20=20INI=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/features.ini | 2 +- platformio.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ini/features.ini b/ini/features.ini index 8e45b71e4218..a153b1853064 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -199,11 +199,11 @@ AUTO_REPORT_POSITION = src_filter=+ REPETIER_GCODE_M360 = src_filter=+ HAS_GCODE_M876 = src_filter=+ HAS_RESUME_CONTINUE = src_filter=+ +LCD_SET_PROGRESS_MANUALLY = src_filter=+ HAS_STATUS_MESSAGE = src_filter=+ HAS_LCD_CONTRAST = src_filter=+ HAS_LCD_BRIGHTNESS = src_filter=+ HAS_BUZZER = src_filter=+ -LCD_SET_PROGRESS_MANUALLY = src_filter=+ TOUCH_SCREEN_CALIBRATION = src_filter=+ ARC_SUPPORT = src_filter=+ GCODE_MOTION_MODES = src_filter=+ diff --git a/platformio.ini b/platformio.ini index 0e50da2b7392..952912b21dfa 100644 --- a/platformio.ini +++ b/platformio.ini @@ -215,11 +215,11 @@ default_src_filter = + - - + - - - + - - - - - - - - - - - From bd5c6bf23c1478dcab31cc1c2edcd0fa546eb6ea Mon Sep 17 00:00:00 2001 From: John Lagonikas <39417467+zeleps@users.noreply.github.com> Date: Tue, 29 Mar 2022 11:13:45 +0300 Subject: [PATCH 217/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20parking=20ex?= =?UTF-8?q?truder=20compile=20(#23961)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to d3e3e6a491 --- Marlin/src/feature/solenoid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/solenoid.cpp b/Marlin/src/feature/solenoid.cpp index f78a529280ea..861e44ed05de 100644 --- a/Marlin/src/feature/solenoid.cpp +++ b/Marlin/src/feature/solenoid.cpp @@ -38,7 +38,7 @@ static void set_solenoid(const uint8_t num, const uint8_t state) { } #if ENABLED(PARKING_EXTRUDER) - if (!active && active_extruder == num) // If active extruder's solenoid is disabled, carriage is considered parked + if (state == LOW && active_extruder == num) // If active extruder's solenoid is disabled, carriage is considered parked parking_extruder_set_parked(true); #endif } From a6794c1862c663b387637597dba5f258a3e0e1e2 Mon Sep 17 00:00:00 2001 From: Manianac <2092573+manianac@users.noreply.github.com> Date: Thu, 31 Mar 2022 17:23:52 -0700 Subject: [PATCH 218/502] =?UTF-8?q?=F0=9F=90=9B=20Use=20ADC=5FVREF=20for?= =?UTF-8?q?=20Filament=20Width=20ADC=20Vref=20(#23977)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/filwidth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/filwidth.h b/Marlin/src/feature/filwidth.h index e234380e981a..9eb1e77762ff 100644 --- a/Marlin/src/feature/filwidth.h +++ b/Marlin/src/feature/filwidth.h @@ -67,7 +67,7 @@ class FilamentWidthSensor { } // Convert raw measurement to mm - static float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); } + static float raw_to_mm(const uint16_t v) { return v * float(ADC_VREF) * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); } static float raw_to_mm() { return raw_to_mm(raw); } // A scaled reading is ready From 20154718b5a41c1522a313ada06ef5c35ce2023d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 4 May 2022 17:03:25 -0500 Subject: [PATCH 219/502] =?UTF-8?q?=F0=9F=8C=90=20Clean=20up=20languages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_an.h | 1 - Marlin/src/lcd/language/language_bg.h | 1 - Marlin/src/lcd/language/language_ca.h | 1 - Marlin/src/lcd/language/language_cz.h | 1 - Marlin/src/lcd/language/language_da.h | 1 - Marlin/src/lcd/language/language_de.h | 1 - Marlin/src/lcd/language/language_el.h | 1 - Marlin/src/lcd/language/language_el_gr.h | 1 - Marlin/src/lcd/language/language_en.h | 1 - Marlin/src/lcd/language/language_es.h | 1 - Marlin/src/lcd/language/language_eu.h | 1 - Marlin/src/lcd/language/language_fi.h | 1 - Marlin/src/lcd/language/language_fr.h | 1 - Marlin/src/lcd/language/language_gl.h | 1 - Marlin/src/lcd/language/language_hr.h | 1 - Marlin/src/lcd/language/language_hu.h | 1 - Marlin/src/lcd/language/language_it.h | 1 - Marlin/src/lcd/language/language_jp_kana.h | 1 - Marlin/src/lcd/language/language_nl.h | 1 - Marlin/src/lcd/language/language_pl.h | 1 - Marlin/src/lcd/language/language_pt.h | 1 - Marlin/src/lcd/language/language_pt_br.h | 1 - Marlin/src/lcd/language/language_ro.h | 1 - Marlin/src/lcd/language/language_ru.h | 1 - Marlin/src/lcd/language/language_sk.h | 1 - Marlin/src/lcd/language/language_sv.h | 1 - Marlin/src/lcd/language/language_tr.h | 1 - Marlin/src/lcd/language/language_uk.h | 1 - Marlin/src/lcd/language/language_vi.h | 1 - Marlin/src/lcd/language/language_zh_CN.h | 1 - Marlin/src/lcd/language/language_zh_TW.h | 1 - 31 files changed, 31 deletions(-) diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 1ebe13868717..c5a7e1877ec5 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -55,7 +55,6 @@ namespace Language_an { LSTR MSG_LEVEL_BED_DONE = _UxGT("Nivelacion feita!"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Achustar desfases"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfase aplicau"); - LSTR MSG_SET_ORIGIN = _UxGT("Establir orichen"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Precalentar ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Precalentar ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index 3137228c2d29..95ca4ce1bfcc 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -44,7 +44,6 @@ namespace Language_bg { LSTR MSG_DISABLE_STEPPERS = _UxGT("Изкл. двигатели"); LSTR MSG_AUTO_HOME = _UxGT("Паркиране"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Задай Начало"); - LSTR MSG_SET_ORIGIN = _UxGT("Изходна точка"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Подгряване ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Подгряване ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 0e16c1a1fa47..582c27b1ae6a 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -53,7 +53,6 @@ namespace Language_ca { LSTR MSG_LEVEL_BED_DONE = _UxGT("Anivellament fet!"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ajusta decalatge"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Decalatge aplicat"); - LSTR MSG_SET_ORIGIN = _UxGT("Estableix origen"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Preescalfa ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Preescalfa ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 6f5d8445af82..76469c5fe5a8 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -77,7 +77,6 @@ namespace Language_cz { LSTR MSG_Z_FADE_HEIGHT = _UxGT("Výška srovnávání"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Nastavit ofsety"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastaveny"); - LSTR MSG_SET_ORIGIN = _UxGT("Nastavit počátek"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Zahřát ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Zahřát ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index b022720b5cae..01281db2688c 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -47,7 +47,6 @@ namespace Language_da { LSTR MSG_LEVEL_BED_DONE = _UxGT("Bed level er færdig!"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Sæt forsk. af home"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Forsk. er nu aktiv"); - LSTR MSG_SET_ORIGIN = _UxGT("Sæt origin"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Forvarm ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Forvarm ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index a6782bb0acc2..461497a2db9b 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -88,7 +88,6 @@ namespace Language_de { LSTR MSG_HOME_OFFSET_J = _UxGT("Homeversatz ") STR_J; LSTR MSG_HOME_OFFSET_K = _UxGT("Homeversatz ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Homeversatz aktiv"); - LSTR MSG_SET_ORIGIN = _UxGT("Setze Nullpunkte"); //"G92 X0 Y0 Z0" commented out in marlinui.cpp LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Assistent"); LSTR MSG_SELECT_ORIGIN = _UxGT("Wählen Sie Ursprung"); LSTR MSG_LAST_VALUE_SP = _UxGT("Letzter Wert "); diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index f3cd7ef27898..370568175656 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -64,7 +64,6 @@ namespace Language_el { LSTR MSG_LEVEL_BED_DONE = _UxGT("Τέλος επιπεδοποίησης!"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ορισμός μετατοπίσεων"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Εφαρμογή μετατοπίσεων"); - LSTR MSG_SET_ORIGIN = _UxGT("Ορισμός προέλευσης"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index d8c7cae38d68..b13893fb4cde 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -53,7 +53,6 @@ namespace Language_el_gr { LSTR MSG_LEVEL_BED_DONE = _UxGT("Ολοκλήρωση επιπεδοποίησης!"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ορισμός βασικών μετατοπίσεων"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Εφαρμόστηκαν οι μετατοπίσεις"); - LSTR MSG_SET_ORIGIN = _UxGT("Ορισμός προέλευσης"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Προθέρμανση ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 43bbd90210fd..03c1902ef9fc 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -104,7 +104,6 @@ namespace Language_en { LSTR MSG_HOME_OFFSET_J = _UxGT("Home Offset ") STR_J; LSTR MSG_HOME_OFFSET_K = _UxGT("Home Offset ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets Applied"); - LSTR MSG_SET_ORIGIN = _UxGT("Set Origin"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Wizard"); LSTR MSG_SELECT_ORIGIN = _UxGT("Select Origin"); LSTR MSG_LAST_VALUE_SP = _UxGT("Last value "); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 6e2c82533e6f..4eb7c9f7e1a6 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -72,7 +72,6 @@ namespace Language_es { LSTR MSG_Z_FADE_HEIGHT = _UxGT("Compen. Altura"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ajustar desfases"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfase aplicada"); - LSTR MSG_SET_ORIGIN = _UxGT("Establecer origen"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Precal. ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Precal. ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 5742fa8f6f97..2d84518f0bfe 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -56,7 +56,6 @@ namespace Language_eu { LSTR MSG_LEVEL_BED_DONE = _UxGT("Berdintzea eginda"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Etxe. offset eza."); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsetak ezarrita"); - LSTR MSG_SET_ORIGIN = _UxGT("Hasiera ipini"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Berotu ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Berotu ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 62f3aae807a5..066179c9504d 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -43,7 +43,6 @@ namespace Language_fi { LSTR MSG_RUN_AUTO_FILES = _UxGT("Automaatti"); LSTR MSG_DISABLE_STEPPERS = _UxGT("Vapauta moottorit"); LSTR MSG_AUTO_HOME = _UxGT("Aja referenssiin"); - LSTR MSG_SET_ORIGIN = _UxGT("Aseta origo"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Esilämmitä ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Esilämmitä ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index ca3757f704d6..38c364ff9dca 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -76,7 +76,6 @@ namespace Language_fr { LSTR MSG_HOME_OFFSET_J = _UxGT("Décal. origine ") STR_J; LSTR MSG_HOME_OFFSET_K = _UxGT("Décal. origine ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Décalages appliqués"); - LSTR MSG_SET_ORIGIN = _UxGT("Régler origine"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Assistant Molettes"); LSTR MSG_SELECT_ORIGIN = _UxGT("Molette du lit"); // Not a selection of the origin LSTR MSG_LAST_VALUE_SP = _UxGT("Ecart origine "); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 731f89cad4dd..cc57545e6564 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -69,7 +69,6 @@ namespace Language_gl { LSTR MSG_Z_FADE_HEIGHT = _UxGT("Compensación Altura"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Axustar Desfases"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Desfases aplicados"); - LSTR MSG_SET_ORIGIN = _UxGT("Fixar orixe"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Prequentar ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Prequentar ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 78db2ad66029..40705bbc91d9 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -53,7 +53,6 @@ namespace Language_hr { LSTR MSG_LEVEL_BED_DONE = _UxGT("Niveliranje gotovo!"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Postavi home offsete"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets postavljeni"); - LSTR MSG_SET_ORIGIN = _UxGT("Postavi ishodište"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Predgrij ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Predgrij ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 341d1b467ddb..a47b687f3a15 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -83,7 +83,6 @@ namespace Language_hu { LSTR MSG_HOME_OFFSET_J = _UxGT("Kezdö eltol. ") STR_J; LSTR MSG_HOME_OFFSET_K = _UxGT("Kezdö eltol. ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Eltolás beállítva."); - LSTR MSG_SET_ORIGIN = _UxGT("Eredeti Be"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Elektromos varázsló"); LSTR MSG_SELECT_ORIGIN = _UxGT("Eredeti választása"); LSTR MSG_LAST_VALUE_SP = _UxGT("Utolsó érték "); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 431b1d01b7be..ff1585de3c29 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -89,7 +89,6 @@ namespace Language_it { LSTR MSG_HOME_OFFSET_J = _UxGT("Offset home ") STR_J; LSTR MSG_HOME_OFFSET_K = _UxGT("Offset home ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset applicato"); - LSTR MSG_SET_ORIGIN = _UxGT("Imposta Origine"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Wizard Tramming"); LSTR MSG_SELECT_ORIGIN = _UxGT("Selez. origine"); LSTR MSG_LAST_VALUE_SP = _UxGT("Ultimo valore "); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 164dca8fcfe2..01d1c0b987ea 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -61,7 +61,6 @@ namespace Language_jp_kana { LSTR MSG_LEVEL_BED_DONE = _UxGT("レベリングカンリョウ"); // "Leveling Done!" LSTR MSG_SET_HOME_OFFSETS = _UxGT("キジュンオフセットセッテイ"); // "Set home offsets" LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("オフセットガテキヨウサレマシタ"); // "Offsets applied" - LSTR MSG_SET_ORIGIN = _UxGT("キジュンセット"); // "Set origin" #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" ヨネツ"); // "Preheat " PREHEAT_1_LABEL LSTR MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" ヨネツ ~"); // "Preheat " PREHEAT_1_LABEL diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index e55ed9fea78f..29a8a1fdc8d8 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -53,7 +53,6 @@ namespace Language_nl { LSTR MSG_LEVEL_BED_DONE = _UxGT("Bed level kompl."); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Zet home offsets"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("H offset toegep."); - LSTR MSG_SET_ORIGIN = _UxGT("Nulpunt instellen"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = PREHEAT_1_LABEL _UxGT(" voorverwarmen"); LSTR MSG_PREHEAT_1_H = PREHEAT_1_LABEL _UxGT(" voorverw. ~"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 47c89e9e3291..8bd7d2d30159 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -80,7 +80,6 @@ namespace Language_pl { LSTR MSG_Z_FADE_HEIGHT = _UxGT("Wys. zanikania"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ust. poz. zer."); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Poz. zerowa ust."); - LSTR MSG_SET_ORIGIN = _UxGT("Ustaw punkt zero"); LSTR MSG_SELECT_ORIGIN = _UxGT("Wybierz punkt zero"); LSTR MSG_LAST_VALUE_SP = _UxGT("Poprzednia wartość "); #if HAS_PREHEAT diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index f73fe1f1b481..2366142f062f 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -52,7 +52,6 @@ namespace Language_pt { LSTR MSG_LEVEL_BED_DONE = _UxGT("Pronto !"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Definir desvio"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets aplicados"); - LSTR MSG_SET_ORIGIN = _UxGT("Definir origem"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 8d8c65f63d4e..5e3e33b37625 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -67,7 +67,6 @@ namespace Language_pt_br { LSTR MSG_Z_FADE_HEIGHT = _UxGT("Suavizar altura"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Compensar origem"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Alteração aplicada"); - LSTR MSG_SET_ORIGIN = _UxGT("Ajustar Origem"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Pre-aquecer ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index f51179829a8e..c3fc37bf483d 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -68,7 +68,6 @@ namespace Language_ro { LSTR MSG_Z_FADE_HEIGHT = _UxGT("Fade Inaltime"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Seteaza Offseturile Acasa"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offseturi Aplicate"); - LSTR MSG_SET_ORIGIN = _UxGT("Seteaza Originea"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Preincalzeste ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Preincalzeste ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index d6b5bbfbdf04..4b52c926087b 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -97,7 +97,6 @@ namespace Language_ru { LSTR MSG_HOME_OFFSET_K = _UxGT("Смещ. дома ") STR_K; #endif LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Смещения применены"); - LSTR MSG_SET_ORIGIN = _UxGT("Установить ноль"); LSTR MSG_SELECT_ORIGIN = _UxGT("Выберите ноль"); #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_LAST_VALUE_SP = _UxGT("Последнее знач. "); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 64e298cb152e..80cca911e53f 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -102,7 +102,6 @@ namespace Language_sk { LSTR MSG_HOME_OFFSET_J = STR_J _UxGT(" Ofset"); LSTR MSG_HOME_OFFSET_K = STR_K _UxGT(" Ofset"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastavené"); - LSTR MSG_SET_ORIGIN = _UxGT("Nastaviť začiatok"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Spriev. vyrovn."); LSTR MSG_SELECT_ORIGIN = _UxGT("Vyberte začiatok"); LSTR MSG_LAST_VALUE_SP = _UxGT("Posl. hodnota "); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index 744fb7e3e603..c077da1e6925 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -73,7 +73,6 @@ namespace Language_sv { LSTR MSG_Z_FADE_HEIGHT = _UxGT("Falna Höjd"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Sätt Hem Offset"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset Tillämpad"); - LSTR MSG_SET_ORIGIN = _UxGT("Sätt Origo"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Justerings Wizard"); LSTR MSG_SELECT_ORIGIN = _UxGT("Välj Origo"); LSTR MSG_LAST_VALUE_SP = _UxGT("Senaste värde "); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 8a1864c96647..0acdd958c32d 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -72,7 +72,6 @@ namespace Language_tr { LSTR MSG_Z_FADE_HEIGHT = _UxGT("Kaçınma Yüksekliği"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ofset Ayarla"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofset Tamam"); - LSTR MSG_SET_ORIGIN = _UxGT("Sıfır Belirle"); #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Ön Isınma ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Ön Isınma ") PREHEAT_1_LABEL " ~"; diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index e4eef399fe5d..94810bce43c2 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -99,7 +99,6 @@ namespace Language_uk { LSTR MSG_HOME_OFFSET_K = _UxGT("Зміщ. дому ") STR_K; #endif LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Зміщення прийняті"); - LSTR MSG_SET_ORIGIN = _UxGT("Встановити нуль"); LSTR MSG_SELECT_ORIGIN = _UxGT("Оберіть нуль"); #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_LAST_VALUE_SP = _UxGT("Останнє значення "); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index 879ccdeae7c6..da9e1fc03015 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -63,7 +63,6 @@ namespace Language_vi { LSTR MSG_Z_FADE_HEIGHT = _UxGT("Chiều cao mờ dần"); // Fade Height LSTR MSG_SET_HOME_OFFSETS = _UxGT("Đặt bù đắp nhà"); // Set home offsets LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Bù đắp được áp dụng"); // Offsets applied - LSTR MSG_SET_ORIGIN = _UxGT("Đặt nguồn gốc"); // Set origin #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" trước"); // Preheat LSTR MSG_PREHEAT_1_H = _UxGT("Làm nóng ") PREHEAT_1_LABEL _UxGT(" trước ~"); // Preheat diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 7f0ca874d61e..fb6d43491776 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -67,7 +67,6 @@ namespace Language_zh_CN { LSTR MSG_Z_FADE_HEIGHT = _UxGT("淡出高度"); // "Fade Height" LSTR MSG_SET_HOME_OFFSETS = _UxGT("设置原点偏移"); // "Set home offsets" LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("偏移已启用"); // "Offsets applied" - LSTR MSG_SET_ORIGIN = _UxGT("设置原点"); // "Set origin" #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("预热 ") PREHEAT_1_LABEL; // "Preheat PREHEAT_2_LABEL" LSTR MSG_PREHEAT_1_H = _UxGT("预热 ") PREHEAT_1_LABEL " ~"; // "Preheat PREHEAT_2_LABEL" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 6c91cc1fec25..3c0acd5fa87d 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -65,7 +65,6 @@ namespace Language_zh_TW { LSTR MSG_Z_FADE_HEIGHT = _UxGT("淡出高度"); // "Fade Height" LSTR MSG_SET_HOME_OFFSETS = _UxGT("設置原點偏移"); // "Set home offsets" LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("偏移已啟用"); // "Offsets applied" - LSTR MSG_SET_ORIGIN = _UxGT("設置原點"); // "Set origin" #if HAS_PREHEAT LSTR MSG_PREHEAT_1 = _UxGT("預熱 ") PREHEAT_1_LABEL; // "Preheat PREHEAT_1_LABEL" LSTR MSG_PREHEAT_1_H = _UxGT("預熱 ") PREHEAT_1_LABEL " ~"; // "Preheat PREHEAT_1_LABEL" From 7456fd68a41b12592f3ac3f47308f7037ca22b86 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 3 Apr 2022 14:13:29 -0700 Subject: [PATCH 220/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20NOZZLE=5FPAR?= =?UTF-8?q?K=5FY=5FONLY=20sanity-check=20(#23990)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 405c9fd7ca5d..76f7d777c3c2 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -612,7 +612,7 @@ #elif defined(NOZZLE_PARK_X_ONLY) #error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 1." #elif defined(NOZZLE_PARK_Y_ONLY) - #error "NOZZLE_PARK_X_ONLY is now NOZZLE_PARK_MOVE 2." + #error "NOZZLE_PARK_Y_ONLY is now NOZZLE_PARK_MOVE 2." #elif defined(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS is now just Z_STEPPER_ALIGN_STEPPER_XY." #elif defined(DWIN_CREALITY_LCD_ENHANCED) From b7b5cee88baadfb10822b6bb13b6e7d3b0acaff8 Mon Sep 17 00:00:00 2001 From: grauerfuchs <42082416+grauerfuchs@users.noreply.github.com> Date: Thu, 31 Mar 2022 22:15:06 -0400 Subject: [PATCH 221/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MightyBoard=20Rev.?= =?UTF-8?q?=20E=20EX2,=20extra=20MOSFETs=20(#23976)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index f2a95baf011b..13ffc9448640 100644 --- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -149,10 +149,10 @@ #define MOSFET_1_PIN 6 // Plug EX1 Pin 1-2 -> PH3 #15 -> Logical 06 #define MOSFET_2_PIN 7 // Plug EX1 Pin 3-4 -> PH4 #16 -> Logical 07 -#define MOSFET_3_PIN 12 // Plug EX2 1-2 -> PB5 #25 -> Logical 12 -#define MOSFET_4_PIN 11 // Plug EX2 3-4 -> PB6 #24 -> Logical 11 +#define MOSFET_3_PIN 11 // Plug EX2 1-2 -> PB6 #24 -> Logical 11 +#define MOSFET_4_PIN 12 // Plug EX2 3-4 -> PB5 #25 -> Logical 12 #define MOSFET_5_PIN 45 // Plug HBD 1-2 -> PL4 #39 -> Logical 45 -#define MOSFET_6_PIN 13 // Plug Extra 1-2 -> PL5 #40 -> Logical 44 (FET not soldered in all boards) +#define MOSFET_6_PIN 44 // Plug Extra 1-2 -> PL5 #40 -> Logical 44 (FET not soldered in all boards) // // Heaters / Fans (24V) From a083b1280ec80a525766c0a9487865b76de64c81 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Thu, 31 Mar 2022 19:16:11 -0700 Subject: [PATCH 222/502] =?UTF-8?q?=F0=9F=93=8C=20SKR=20Mini=20V1.1=20TMC?= =?UTF-8?q?=20UART=20Pins=20(#23970)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h index 7e2c638acb50..1ea947ffdf18 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h @@ -80,6 +80,23 @@ #endif #endif +#if HAS_TMC_UART // Shared with EXP1 + #define X_SERIAL_TX_PIN PC10 + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + + #define Y_SERIAL_TX_PIN PC11 + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + + #define Z_SERIAL_TX_PIN PC12 + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + + #define E0_SERIAL_TX_PIN PC14 + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + // // Heaters / Fans // From 5ee99dfc49eaa8e81f5beb66eb1c160ac2d217fb Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 31 Mar 2022 22:18:32 -0400 Subject: [PATCH 223/502] =?UTF-8?q?=F0=9F=A9=B9=20SKR2=20Pins=20DIAG=20fla?= =?UTF-8?q?g=20(#23968)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #23050 --- Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h | 2 ++ 1 file changed, 2 insertions(+) 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 4f5ed6c1b4eb..d526c75b6396 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 @@ -23,6 +23,8 @@ #include "env_validate.h" +#define USES_DIAG_JUMPERS + // If you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION // https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT //#define BTT_MOTOR_EXPANSION From bb0e0cf7f35cf3b89aac4f395185d55f3aa62979 Mon Sep 17 00:00:00 2001 From: aegelsky Date: Fri, 1 Apr 2022 05:21:10 +0300 Subject: [PATCH 224/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MKS=20Gen.=20L=20-?= =?UTF-8?q?=20EEB=20(#23965)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/ramps/pins_MKS_GEN_L.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h index 522a34cda199..4dca1ca187b0 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h @@ -37,6 +37,12 @@ // Power outputs EFBF or EFBE #define MOSFET_D_PIN 7 +// Hotend, Hotend, Bed + Fan on D9 +#if FET_ORDER_EEB + #define MOSFET_B_PIN 7 + #define FAN_PIN 9 +#endif + // // CS Pins wired to avoid conflict with the LCD // See https://www.thingiverse.com/asset:66604 From 5c5b380fda9f541ee182e614966fc39a72ac6a18 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Tue, 29 Mar 2022 05:41:33 -0400 Subject: [PATCH 225/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MarlinUI=20on=20En?= =?UTF-8?q?der=203=20S1=20(#23949)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/lcd/e3v2/common/dwin_api.cpp | 42 ++++++++++++++++++++++ Marlin/src/lcd/e3v2/marlinui/dwin_lcd.cpp | 2 +- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 24 +++++++++---- 4 files changed, 62 insertions(+), 8 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 76f7d777c3c2..f9b6d8da4eea 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -853,7 +853,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Custom Boot and Status screens */ -#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE) +#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, IS_DWIN_MARLINUI) #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE." #elif ENABLED(SHOW_CUSTOM_BOOTSCREEN) && DISABLED(SHOW_BOOTSCREEN) #error "SHOW_CUSTOM_BOOTSCREEN requires SHOW_BOOTSCREEN." diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.cpp b/Marlin/src/lcd/e3v2/common/dwin_api.cpp index f6780bba6c26..89d7cb41443b 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.cpp +++ b/Marlin/src/lcd/e3v2/common/dwin_api.cpp @@ -25,6 +25,7 @@ #include "dwin_api.h" #include "dwin_set.h" +#include "dwin_font.h" #include "../../../inc/MarlinConfig.h" @@ -89,6 +90,40 @@ bool DWIN_Handshake() { } #endif +// Get font character width +uint8_t fontWidth(uint8_t cfont) { + switch (cfont) { + case font6x12 : return 6; + case font8x16 : return 8; + case font10x20: return 10; + case font12x24: return 12; + case font14x28: return 14; + case font16x32: return 16; + case font20x40: return 20; + case font24x48: return 24; + case font28x56: return 28; + case font32x64: return 32; + default: return 0; + } +} + +// Get font character height +uint8_t fontHeight(uint8_t cfont) { + switch (cfont) { + case font6x12 : return 12; + case font8x16 : return 16; + case font10x20: return 20; + case font12x24: return 24; + case font14x28: return 28; + case font16x32: return 32; + case font20x40: return 40; + case font24x48: return 48; + case font28x56: return 56; + case font32x64: return 64; + default: return 0; + } +} + // Set screen display direction // dir: 0=0°, 1=90°, 2=180°, 3=270° void DWIN_Frame_SetDir(uint8_t dir) { @@ -199,6 +234,8 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis, // *string: The string // rlimit: To limit the drawn string length void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit/*=0xFFFF*/) { + DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size)); + DWIN_UpdateLCD(); constexpr uint8_t widthAdjust = 0; size_t i = 0; DWIN_Byte(i, 0x11); @@ -213,6 +250,7 @@ void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, DWIN_Word(i, y); DWIN_Text(i, string, rlimit); DWIN_Send(i); + DWIN_UpdateLCD(); } // Draw a positive integer @@ -228,6 +266,7 @@ void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, void DWIN_Draw_IntValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, uint32_t value) { size_t i = 0; + DWIN_Draw_Rectangle(1, bColor, x, y, x + fontWidth(size) * iNum + 1, y + fontHeight(size)); DWIN_Byte(i, 0x14); // Bit 7: bshow // Bit 6: 1 = signed; 0 = unsigned number; @@ -258,6 +297,7 @@ void DWIN_Draw_IntValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t #endif DWIN_Send(i); + DWIN_UpdateLCD(); } // Draw a floating point number @@ -275,6 +315,7 @@ void DWIN_Draw_FloatValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_ uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, int32_t value) { //uint8_t *fvalue = (uint8_t*)&value; size_t i = 0; + DWIN_Draw_Rectangle(1, bColor, x, y, x + fontWidth(size) * (iNum+fNum+1), y + fontHeight(size)); DWIN_Byte(i, 0x14); DWIN_Byte(i, (bShow * 0x80) | (zeroFill * 0x20) | (zeroMode * 0x10) | size); DWIN_Word(i, color); @@ -291,6 +332,7 @@ void DWIN_Draw_FloatValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_ DWIN_Byte(i, fvalue[0]); */ DWIN_Send(i); + DWIN_UpdateLCD(); } // Draw a floating point number diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.cpp index a4cefe4ab99a..7154270bffc6 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.cpp @@ -45,8 +45,8 @@ void DWIN_Startup() { const bool success = DWIN_Handshake(); if (success) DEBUG_ECHOLNPGM("ok."); else DEBUG_ECHOLNPGM("error."); DWIN_Frame_SetDir(TERN(DWIN_MARLINUI_LANDSCAPE, 0, 1)); - DWIN_JPG_ShowAndCache(3); DWIN_Frame_Clear(Color_Bg_Black); // MarlinUI handles the bootscreen so just clear here + DWIN_JPG_ShowAndCache(3); DWIN_UpdateLCD(); } diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index f49d06d39642..4e0174705e53 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -84,6 +84,7 @@ void MarlinUI::init_lcd() { DWIN_Startup(); } // This LCD should clear where it will draw anew void MarlinUI::clear_lcd() { DWIN_ICON_AnimationControl(0x0000); // disable all icon animations + DWIN_JPG_ShowAndCache(3); DWIN_Frame_Clear(Color_Bg_Black); DWIN_UpdateLCD(); @@ -93,29 +94,39 @@ void MarlinUI::clear_lcd() { #if ENABLED(SHOW_BOOTSCREEN) void MarlinUI::show_bootscreen() { - clear_lcd(); dwin_string.set(F(SHORT_BUILD_VERSION)); + #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && !defined(CUSTOM_BOOTSCREEN_TIMEOUT) + #define CUSTOM_BOOTSCREEN_TIMEOUT 3000 + #endif + #if ENABLED(DWIN_MARLINUI_PORTRAIT) #define LOGO_CENTER ((LCD_PIXEL_WIDTH) / 2) #define INFO_CENTER LOGO_CENTER #define VERSION_Y 330 - DWIN_ICON_Show(BOOT_ICON, ICON_MarlinBoot, LOGO_CENTER - 266 / 2, 15); + #else + #define LOGO_CENTER (280 / 2) + #define INFO_CENTER ((LCD_PIXEL_WIDTH) - 200 / 2) + #define VERSION_Y 84 + #endif + + DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length() * 10) / 2, VERSION_Y, S(dwin_string.string())); + TERN_(SHOW_CUSTOM_BOOTSCREEN, safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT)); + clear_lcd(); + + DWIN_ICON_Show(BOOT_ICON, ICON_MarlinBoot, LOGO_CENTER - 266 / 2, 15); + #if ENABLED(DWIN_MARLINUI_PORTRAIT) DWIN_ICON_Show(BOOT_ICON, ICON_OpenSource, LOGO_CENTER - 174 / 2, 280); DWIN_ICON_Show(BOOT_ICON, ICON_GitHubURL, LOGO_CENTER - 180 / 2, 420); DWIN_ICON_Show(BOOT_ICON, ICON_MarlinURL, LOGO_CENTER - 100 / 2, 440); DWIN_ICON_Show(BOOT_ICON, ICON_Copyright, LOGO_CENTER - 126 / 2, 460); #else - #define LOGO_CENTER (280 / 2) - #define INFO_CENTER ((LCD_PIXEL_WIDTH) - 200 / 2) - #define VERSION_Y 84 DWIN_ICON_Show(BOOT_ICON, ICON_MarlinBoot, LOGO_CENTER - 266 / 2, 15); DWIN_ICON_Show(BOOT_ICON, ICON_OpenSource, INFO_CENTER - 174 / 2, 60); DWIN_ICON_Show(BOOT_ICON, ICON_GitHubURL, INFO_CENTER - 180 / 2, 130); DWIN_ICON_Show(BOOT_ICON, ICON_MarlinURL, INFO_CENTER - 100 / 2, 152); DWIN_ICON_Show(BOOT_ICON, ICON_Copyright, INFO_CENTER - 126 / 2, 200); #endif - DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length() * 10) / 2, VERSION_Y, S(dwin_string.string())); DWIN_UpdateLCD(); } @@ -170,6 +181,7 @@ void MarlinUI::draw_status_message(const bool blink) { dwin_font.solid = true; dwin_font.fg = Color_White; dwin_font.bg = Color_Bg_Black; + DWIN_Draw_Box(1, Color_Bg_Black, 0, (LCD_PIXEL_HEIGHT - (STAT_FONT_HEIGHT) - 1), 272, STAT_FONT_HEIGHT + 1); lcd_moveto_xy(0, LCD_PIXEL_HEIGHT - (STAT_FONT_HEIGHT) - 1); constexpr uint8_t max_status_chars = (LCD_PIXEL_WIDTH) / (STAT_FONT_WIDTH); From c5f7547e8cf0d744fb1392b3651078d3985cecb1 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Tue, 26 Apr 2022 05:03:16 +0200 Subject: [PATCH 226/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20"elapsed"=20text?= =?UTF-8?q?=20on=20DOGLCD=20(#24087)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index c9a44e0c64d0..7e5329aeef3a 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -791,7 +791,7 @@ void MarlinUI::draw_status_screen() { lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string); } else if (elapsed_string[0]) { - lcd_put_u8str_P(PROGRESS_BAR_X, EXTRAS_BASELINE, E_LBL); + lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("E:")); lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string); } From a5e083603f1435a4a0e2e9fa7449c9133aa73225 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Apr 2022 06:11:03 -0500 Subject: [PATCH 227/502] =?UTF-8?q?=F0=9F=93=9D=20Fix=20'M150=20S'=20comme?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/feature/leds/M150.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/feature/leds/M150.cpp b/Marlin/src/gcode/feature/leds/M150.cpp index f01c220d0131..95e7367b6e23 100644 --- a/Marlin/src/gcode/feature/leds/M150.cpp +++ b/Marlin/src/gcode/feature/leds/M150.cpp @@ -38,7 +38,7 @@ * I Set the NeoPixel index to affect. Default: All * * With NEOPIXEL2_SEPARATE: - * S The NeoPixel strip to set. Default is index 0. + * S The NeoPixel strip to set. Default: All. * * Examples: * From 8bd1547c3bb16cdce37412624161fab5b9d5ead6 Mon Sep 17 00:00:00 2001 From: Moritz Wirger Date: Fri, 15 Apr 2022 04:43:21 +0200 Subject: [PATCH 228/502] =?UTF-8?q?=E2=9C=A8=20enwi=20ESPNP=20board=20supp?= =?UTF-8?q?ort=20(#24029)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/esp32/pins_ENWI_ESPNP.h | 116 ++++++++++++++++++++++++ Marlin/src/pins/pins.h | 2 + 3 files changed, 119 insertions(+) create mode 100644 Marlin/src/pins/esp32/pins_ENWI_ESPNP.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index d1cc971e51d1..14303754820c 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -441,6 +441,7 @@ #define BOARD_PANDA_ZHU 6006 // Panda_ZHU #define BOARD_PANDA_M4 6007 // Panda_M4 #define BOARD_MKS_TINYBEE 6008 // MKS TinyBee based on ESP32 (with I2S stepper stream) +#define BOARD_ENWI_ESPNP 6009 // enwi ESPNP based on ESP32 (with I2S stepper stream) // // SAMD51 ARM Cortex M4 diff --git a/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h b/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h new file mode 100644 index 000000000000..aff7f742edf9 --- /dev/null +++ b/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h @@ -0,0 +1,116 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Espressif ESP32 (Tensilica Xtensa LX6) on ESPNP by enwi + * Website https://github.com/enwi/ESPNP + */ + +#include "env_validate.h" + +#define BOARD_INFO_NAME "ESPNP" +#define DEFAULT_MACHINE_NAME "ESP Pick and Place" + +// +// I2S (steppers & other output-only pins) +// +#define I2S_STEPPER_STREAM +#define I2S_WS 17 +#define I2S_BCK 22 +#define I2S_DATA 21 + +// +// Servos +// +#define SERVO0_PIN 26 +#define SERVO1_PIN 25 + +// +// Limit Switches +// +#define X_STOP_PIN 36 +#define Y_STOP_PIN 39 +#define Z_STOP_PIN 34 +#define I_STOP_PIN 35 +#define J_STOP_PIN 05 +#define K_STOP_PIN 16 + +// +// Steppers +// +#define X_ENABLE_PIN 136 +#define X_DIR_PIN 137 +#define X_STEP_PIN 138 +#define X_CS_PIN 139 + +#define Y_ENABLE_PIN 140 +#define Y_DIR_PIN 141 +#define Y_STEP_PIN 142 +#define Y_CS_PIN 143 + +#define Z_ENABLE_PIN 144 +#define Z_DIR_PIN 145 +#define Z_STEP_PIN 146 +#define Z_CS_PIN 147 + +#define I_ENABLE_PIN 148 +#define I_DIR_PIN 149 +#define I_STEP_PIN 150 +#define I_CS_PIN 151 + +#define J_ENABLE_PIN 152 +#define J_DIR_PIN 153 +#define J_STEP_PIN 154 +#define J_CS_PIN 155 + +#define K_ENABLE_PIN 156 +#define K_DIR_PIN 157 +#define K_STEP_PIN 158 +#define K_CS_PIN 159 + +// Reduce baud rate to improve software serial reliability +#define TMC_BAUD_RATE 19200 + +// +// Temperature Sensors +// +//#define TEMP_0_PIN 36 // Analog Input +//#define TEMP_BED_PIN 39 // Analog Input + +// General use mosfets, useful for things like pumps and solenoids +// Shift register pins 128, 129, 130 and 131 are broken out and can be used +#define FAN_PIN 132 +#define FAN1_PIN 134 +#define FAN2_PIN 135 +#define FAN3_PIN 136 + +// #define FAN_SOFT_PWM_REQUIRED // check if needed + +// Neopixel Rings +#define NEOPIXEL_PIN 14 +#define NEOPIXEL2_PIN 27 + +// SPI +#define MISO_PIN 19 +#define MOSI_PIN 23 +#define SCK_PIN 18 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 426ce1e48e77..202630ae4aa2 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -731,6 +731,8 @@ #include "esp32/pins_PANDA_M4.h" // ESP32 env:PANDA #elif MB(MKS_TINYBEE) #include "esp32/pins_MKS_TINYBEE.h" // ESP32 env:mks_tinybee +#elif MB(ENWI_ESPNP) + #include "esp32/pins_ENWI_ESPNP.h" // ESP32 env:esp32 // // Adafruit Grand Central M4 (SAMD51 ARM Cortex-M4) From 5e68a86968d63f97f0febb8378b2a508e909ec90 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 10 Apr 2022 12:37:24 +1200 Subject: [PATCH 229/502] =?UTF-8?q?=F0=9F=94=A8=20Preflight=20check=20old?= =?UTF-8?q?=20abl=20files=20(#24010)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/preflight-checks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index 9f38ffe8bfa2..dbd0510b5dff 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -102,6 +102,10 @@ def sanity_check_target(): for f in [ "ultralcd_DOGM.cpp", "ultralcd_DOGM.h" ]: if os.path.isfile(os.path.join(p, f)): mixedin += [ f ] + p = os.path.join(env['PROJECT_DIR'], "Marlin", "src", "feature", "bedlevel", "abl") + for f in [ "abl.cpp", "abl.h" ]: + if os.path.isfile(os.path.join(p, f)): + mixedin += [ f ] if mixedin: err = "ERROR: Old files fell into your Marlin folder. Remove %s and try again" % ", ".join(mixedin) raise SystemExit(err) From 2d0af75d37c9ea8ab44c889ef4e489b3b533eb30 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Apr 2022 18:07:40 -0500 Subject: [PATCH 230/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20No=20such=20pin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 195a0e8d163d..846b566e8c33 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -620,7 +620,6 @@ #define E7_AUTO_FAN_PIN -1 #define CHAMBER_AUTO_FAN_PIN -1 #define COOLER_AUTO_FAN_PIN -1 -#define COOLER_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed From e667d4e6e43b407cedce6bbf543ea1d815e8d520 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Apr 2022 16:53:39 -0500 Subject: [PATCH 231/502] =?UTF-8?q?=F0=9F=8C=90=20=20Rename=20"LCD=20Timeo?= =?UTF-8?q?ut"=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_de.h | 2 +- Marlin/src/lcd/language/language_en.h | 2 +- Marlin/src/lcd/language/language_fr.h | 2 +- Marlin/src/lcd/language/language_uk.h | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 461497a2db9b..0c4ba8e8dc36 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -388,7 +388,7 @@ namespace Language_de { LSTR MSG_ADVANCE_K_E = _UxGT("Vorschubfaktor *"); LSTR MSG_CONTRAST = _UxGT("LCD-Kontrast"); LSTR MSG_BRIGHTNESS = _UxGT("LCD-Helligkeit"); - LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD-Ruhezustand (s)"); + LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("LCD-Ruhezustand (s)"); LSTR MSG_BRIGHTNESS_OFF = _UxGT("LCD ausschalten"); LSTR MSG_STORE_EEPROM = _UxGT("Konfig. speichern"); LSTR MSG_LOAD_EEPROM = _UxGT("Konfig. laden"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 03c1902ef9fc..ed152a4dfdd9 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -402,7 +402,7 @@ namespace Language_en { LSTR MSG_ADVANCE_K_E = _UxGT("Advance K *"); LSTR MSG_CONTRAST = _UxGT("LCD Contrast"); LSTR MSG_BRIGHTNESS = _UxGT("LCD Brightness"); - LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD Timeout (s)"); + LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("LCD Timeout (s)"); LSTR MSG_BRIGHTNESS_OFF = _UxGT("Backlight Off"); LSTR MSG_STORE_EEPROM = _UxGT("Store Settings"); LSTR MSG_LOAD_EEPROM = _UxGT("Load Settings"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 38c364ff9dca..f3ea9b5e3b80 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -334,7 +334,7 @@ namespace Language_fr { LSTR MSG_ADVANCE_K_E = _UxGT("Avance K *"); LSTR MSG_BRIGHTNESS = _UxGT("Luminosité LCD"); LSTR MSG_CONTRAST = _UxGT("Contraste LCD"); - LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("Veille LCD (s)"); + LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("Veille LCD (s)"); LSTR MSG_BRIGHTNESS_OFF = _UxGT("Éteindre l'écran LCD"); LSTR MSG_STORE_EEPROM = _UxGT("Enregistrer config."); LSTR MSG_LOAD_EEPROM = _UxGT("Charger config."); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 94810bce43c2..892eb57cf629 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -471,7 +471,7 @@ namespace Language_uk { LSTR MSG_CONTRAST = _UxGT("Контраст"); LSTR MSG_BRIGHTNESS = _UxGT("Яскравість"); #endif - LSTR MSG_LCD_BKL_TIMEOUT = _UxGT("LCD Таймаут, с"); + LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("LCD Таймаут, с"); LSTR MSG_BRIGHTNESS_OFF = _UxGT("Підсвітка вимк."); LSTR MSG_STORE_EEPROM = _UxGT("Зберегти в EEPROM"); LSTR MSG_LOAD_EEPROM = _UxGT("Зчитати з EEPROM"); diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index b6d518f505dd..b0d739f06173 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -542,7 +542,7 @@ void menu_configuration() { EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true); #endif #if LCD_BACKLIGHT_TIMEOUT && LCD_BKL_TIMEOUT_MIN < LCD_BKL_TIMEOUT_MAX - EDIT_ITEM(uint16_4, MSG_LCD_BKL_TIMEOUT, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout); + EDIT_ITEM(uint16_4, MSG_LCD_TIMEOUT_SEC, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout); #endif #if ENABLED(FWRETRACT) From a81fd009f081eca3685e42cffac7f35e75428fea Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Apr 2022 07:08:26 -0500 Subject: [PATCH 232/502] =?UTF-8?q?=F0=9F=8E=A8=20=20misc.=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp | 14 +++++++------- Marlin/src/HAL/STM32/timers.cpp | 10 +++++----- Marlin/src/module/motion.cpp | 1 - Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp index 3b5acc1656cd..91b7e0f67f76 100644 --- a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp +++ b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp @@ -38,13 +38,13 @@ #ifdef __cplusplus extern "C" { #endif -void u8g_SetPinOutput(uint8_t internal_pin_number){SET_DIR_OUTPUT(internal_pin_number);} -void u8g_SetPinInput(uint8_t internal_pin_number){SET_DIR_INPUT(internal_pin_number);} -void u8g_SetPinLevel(uint8_t pin, uint8_t pin_status){WRITE_PIN(pin, pin_status);} -uint8_t u8g_GetPinLevel(uint8_t pin){return READ_PIN(pin);} -void usleep(uint64_t microsec){ -assert(false); // why we here? -} + +void u8g_SetPinOutput(uint8_t internal_pin_number) { SET_DIR_OUTPUT(internal_pin_number); } +void u8g_SetPinInput(uint8_t internal_pin_number) { SET_DIR_INPUT(internal_pin_number); } +void u8g_SetPinLevel(uint8_t pin, uint8_t pin_status) { WRITE_PIN(pin, pin_status); } +uint8_t u8g_GetPinLevel(uint8_t pin) { return READ_PIN(pin); } +void usleep(uint64_t microsec) { assert(false); /* why we here? */ } + #ifdef __cplusplus } #endif diff --git a/Marlin/src/HAL/STM32/timers.cpp b/Marlin/src/HAL/STM32/timers.cpp index a1e3372bbb2e..e68b59c46fee 100644 --- a/Marlin/src/HAL/STM32/timers.cpp +++ b/Marlin/src/HAL/STM32/timers.cpp @@ -303,16 +303,16 @@ enum TimerPurpose { TP_SERIAL, TP_TONE, TP_SERVO, TP_STEP, TP_TEMP }; // This cannot yet account for timers used for PWM output, such as for fans. static constexpr struct { TimerPurpose p; int t; } timers_in_use[] = { #if HAS_TMC_SW_SERIAL - {TP_SERIAL, get_timer_num_from_base_address(timer_serial[0])}, // Set in variant.h, or as a define in platformio.h if not present in variant.h + { TP_SERIAL, get_timer_num_from_base_address(timer_serial[0]) }, // Set in variant.h, or as a define in platformio.h if not present in variant.h #endif #if ENABLED(SPEAKER) - {TP_TONE, get_timer_num_from_base_address(timer_tone[0])}, // Set in variant.h, or as a define in platformio.h if not present in variant.h + { TP_TONE, get_timer_num_from_base_address(timer_tone[0]) }, // Set in variant.h, or as a define in platformio.h if not present in variant.h #endif #if HAS_SERVOS - {TP_SERVO, get_timer_num_from_base_address(timer_servo[0])}, // Set in variant.h, or as a define in platformio.h if not present in variant.h + { TP_SERVO, get_timer_num_from_base_address(timer_servo[0]) }, // Set in variant.h, or as a define in platformio.h if not present in variant.h #endif - {TP_STEP, STEP_TIMER}, - {TP_TEMP, TEMP_TIMER}, + { TP_STEP, STEP_TIMER }, + { TP_TEMP, TEMP_TIMER }, }; static constexpr bool verify_no_timer_conflicts() { diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index d8df8e12e1ed..d2fb9d95d01c 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -237,7 +237,6 @@ void report_current_position_projected() { } #if ENABLED(AUTO_REPORT_POSITION) - //struct PositionReport { void report() { report_current_position_projected(); } }; AutoReporter position_auto_reporter; #endif diff --git a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h index 382e461d5174..98ef165e2d66 100644 --- a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h +++ b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h @@ -22,7 +22,7 @@ #pragma once #include "env_validate.h" - + #define BOARD_INFO_NAME "PANDA PI V2.9" // Release PB3/PB4 (TMC_SW Pins) from JTAG pins From 70ea0e7c3450680e1062088243d2cf139eadc02a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 18 Apr 2022 16:41:16 -0500 Subject: [PATCH 233/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Remove=20extra=20G?= =?UTF-8?q?29=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to 85a62bbf --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 1868c636ee36..4f7d052c9553 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -624,8 +624,6 @@ G29_TYPE GcodeSuite::G29() { bool zig = PR_OUTER_SIZE & 1; // Always end at RIGHT and BACK_PROBE_BED_POSITION - abl.measured_z = 0; - // Outer loop is X with PROBE_Y_FIRST enabled // Outer loop is Y with PROBE_Y_FIRST disabled for (PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_SIZE && !isnan(abl.measured_z); PR_OUTER_VAR++) { From 2dc4c642e78bb4fa99ca41f3ae3c92335248ffd4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Apr 2022 16:50:39 -0500 Subject: [PATCH 234/502] =?UTF-8?q?=F0=9F=8E=A8=20=20Misc.=20adjustments,?= =?UTF-8?q?=20spacing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 64 +++++++++---------- Marlin/src/gcode/host/M876.cpp | 4 +- Marlin/src/inc/Conditionals_adv.h | 4 ++ Marlin/src/lcd/marlinui.cpp | 2 + Marlin/src/lcd/menu/menu_configuration.cpp | 4 ++ Marlin/src/module/settings.cpp | 10 +-- .../PlatformIO/scripts/common-dependencies.h | 4 -- platformio.ini | 2 +- 8 files changed, 50 insertions(+), 44 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c2d5dced283b..051560981eff 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2584,38 +2584,38 @@ //========================== Extensible UI Displays =========================== //============================================================================= -// -// DGUS Touch Display with DWIN OS. (Choose one.) -// ORIGIN : https://www.aliexpress.com/item/32993409517.html -// FYSETC : https://www.aliexpress.com/item/32961471929.html -// MKS : https://www.aliexpress.com/item/1005002008179262.html -// -// Flash display with DGUS Displays for Marlin: -// - Format the SD card to FAT32 with an allocation size of 4kb. -// - Download files as specified for your type of display. -// - Plug the microSD card into the back of the display. -// - Boot the display and wait for the update to complete. -// -// ORIGIN (Marlin DWIN_SET) -// - Download https://github.com/coldtobi/Marlin_DGUS_Resources -// - Copy the downloaded DWIN_SET folder to the SD card. -// -// FYSETC (Supplier default) -// - Download https://github.com/FYSETC/FYSTLCD-2.0 -// - Copy the downloaded SCREEN folder to the SD card. -// -// HIPRECY (Supplier default) -// - Download https://github.com/HiPrecy/Touch-Lcd-LEO -// - Copy the downloaded DWIN_SET folder to the SD card. -// -// MKS (MKS-H43) (Supplier default) -// - Download https://github.com/makerbase-mks/MKS-H43 -// - Copy the downloaded DWIN_SET folder to the SD card. -// -// RELOADED (T5UID1) -// - Download https://github.com/Desuuuu/DGUS-reloaded/releases -// - Copy the downloaded DWIN_SET folder to the SD card. -// +/** + * DGUS Touch Display with DWIN OS. (Choose one.) + * ORIGIN : https://www.aliexpress.com/item/32993409517.html + * FYSETC : https://www.aliexpress.com/item/32961471929.html + * MKS : https://www.aliexpress.com/item/1005002008179262.html + * + * Flash display with DGUS Displays for Marlin: + * - Format the SD card to FAT32 with an allocation size of 4kb. + * - Download files as specified for your type of display. + * - Plug the microSD card into the back of the display. + * - Boot the display and wait for the update to complete. + * + * ORIGIN (Marlin DWIN_SET) + * - Download https://github.com/coldtobi/Marlin_DGUS_Resources + * - Copy the downloaded DWIN_SET folder to the SD card. + * + * FYSETC (Supplier default) + * - Download https://github.com/FYSETC/FYSTLCD-2.0 + * - Copy the downloaded SCREEN folder to the SD card. + * + * HIPRECY (Supplier default) + * - Download https://github.com/HiPrecy/Touch-Lcd-LEO + * - Copy the downloaded DWIN_SET folder to the SD card. + * + * MKS (MKS-H43) (Supplier default) + * - Download https://github.com/makerbase-mks/MKS-H43 + * - Copy the downloaded DWIN_SET folder to the SD card. + * + * RELOADED (T5UID1) + * - Download https://github.com/Desuuuu/DGUS-reloaded/releases + * - Copy the downloaded DWIN_SET folder to the SD card. + */ //#define DGUS_LCD_UI_ORIGIN //#define DGUS_LCD_UI_FYSETC //#define DGUS_LCD_UI_HIPRECY diff --git a/Marlin/src/gcode/host/M876.cpp b/Marlin/src/gcode/host/M876.cpp index 49994f44e605..c2a519d0ac60 100644 --- a/Marlin/src/gcode/host/M876.cpp +++ b/Marlin/src/gcode/host/M876.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER) +#if HAS_GCODE_M876 #include "../../feature/host_actions.h" #include "../gcode.h" @@ -37,4 +37,4 @@ void GcodeSuite::M876() { } -#endif // HOST_PROMPT_SUPPORT && !EMERGENCY_PARSER +#endif // HAS_GCODE_M876 diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 8a85536aea48..d86fcddb3a0f 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -701,6 +701,10 @@ #undef SERIAL_XON_XOFF #endif +#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER) + #define HAS_GCODE_M876 1 +#endif + #if ENABLED(HOST_ACTION_COMMANDS) #ifndef ACTION_ON_PAUSE #define ACTION_ON_PAUSE "pause" diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 7c97ef791ddc..cf225eb2bd60 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -184,12 +184,14 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif #if LCD_BACKLIGHT_TIMEOUT + uint16_t MarlinUI::lcd_backlight_timeout; // Initialized by settings.load() millis_t MarlinUI::backlight_off_ms = 0; void MarlinUI::refresh_backlight_timeout() { backlight_off_ms = lcd_backlight_timeout ? millis() + lcd_backlight_timeout * 1000UL : 0; WRITE(LCD_BACKLIGHT_PIN, HIGH); } + #endif void MarlinUI::init() { diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index b0d739f06173..c66df8502441 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -541,6 +541,10 @@ void menu_configuration() { #if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN < LCD_CONTRAST_MAX EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true); #endif + + // + // Set display backlight / sleep timeout + // #if LCD_BACKLIGHT_TIMEOUT && LCD_BKL_TIMEOUT_MIN < LCD_BKL_TIMEOUT_MAX EDIT_ITEM(uint16_4, MSG_LCD_TIMEOUT_SEC, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout); #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 1f482afeb4f0..6e373f6132f4 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -398,7 +398,7 @@ typedef struct SettingsDataStruct { uint8_t lcd_brightness; // M256 B // - // LCD_BACKLIGHT_TIMEOUT + // Display Sleep // #if LCD_BACKLIGHT_TIMEOUT uint16_t lcd_backlight_timeout; // (G-code needed) @@ -1130,7 +1130,7 @@ void MarlinSettings::postprocess() { } // - // LCD Backlight Timeout + // LCD Backlight / Sleep Timeout // #if LCD_BACKLIGHT_TIMEOUT EEPROM_WRITE(ui.lcd_backlight_timeout); @@ -1144,7 +1144,7 @@ void MarlinSettings::postprocess() { #if ENABLED(USE_CONTROLLER_FAN) const controllerFan_settings_t &cfs = controllerFan.settings; #else - controllerFan_settings_t cfs = controllerFan_defaults; + constexpr controllerFan_settings_t cfs = controllerFan_defaults; #endif EEPROM_WRITE(cfs); } @@ -2054,7 +2054,7 @@ void MarlinSettings::postprocess() { } // - // LCD Backlight Timeout + // LCD Backlight / Sleep Timeout // #if LCD_BACKLIGHT_TIMEOUT EEPROM_READ(ui.lcd_backlight_timeout); @@ -3094,7 +3094,7 @@ void MarlinSettings::reset() { TERN_(HAS_LCD_BRIGHTNESS, ui.brightness = LCD_BRIGHTNESS_DEFAULT); // - // LCD Backlight Timeout + // LCD Backlight / Sleep Timeout // #if LCD_BACKLIGHT_TIMEOUT ui.lcd_backlight_timeout = LCD_BACKLIGHT_TIMEOUT; diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h index f004c54adb85..4aa97c41ad69 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.h +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h @@ -45,10 +45,6 @@ #define HAS_SAVED_POSITIONS #endif -#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER) - #define HAS_GCODE_M876 -#endif - #if ENABLED(DUET_SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD) #define HAS_SMART_EFF_MOD #endif diff --git a/platformio.ini b/platformio.ini index 952912b21dfa..29e81782dd0d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -217,7 +217,7 @@ default_src_filter = + - - + - - - - - - + - - - - - - From 2f3960904e1a7b830c686fa793b122de49f3d674 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Apr 2022 03:45:28 -0500 Subject: [PATCH 235/502] =?UTF-8?q?=F0=9F=8E=A8=20=20Misc.=20USB=20flash?= =?UTF-8?q?=20code=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sd/usb_flashdrive/Sd2Card_FlashDrive.cpp | 20 ++++++++++--------- .../sd/usb_flashdrive/lib-uhs2/usbhost.cpp | 17 ++++++++-------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp index 05671167c800..a681af4efa63 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp @@ -61,10 +61,8 @@ #define USB_NO_TEST_UNIT_READY // Required for removable media adapter #define USB_HOST_MANUAL_POLL // Optimization to shut off IRQ automatically - // Workarounds for keeping Marlin's watchdog timer from barking... - void marlin_yield() { - thermalManager.manage_heater(); - } + // Workarounds to keep Marlin's watchdog timer from barking... + void marlin_yield() { thermalManager.manage_heater(); } #define SYSTEM_OR_SPECIAL_YIELD(...) marlin_yield(); #define delay(x) safe_delay(x) @@ -82,6 +80,7 @@ #define UHS_START (usb.Init() == 0) #define UHS_STATE(state) UHS_USB_HOST_STATE_##state + #elif ENABLED(USE_OTG_USB_HOST) #if HAS_SD_HOST_DRIVE @@ -93,7 +92,9 @@ #define UHS_START usb.start() #define rREVISION 0 #define UHS_STATE(state) USB_STATE_##state + #else + #include "lib-uhs2/Usb.h" #include "lib-uhs2/masstorage.h" @@ -102,6 +103,7 @@ #define UHS_START usb.start() #define UHS_STATE(state) USB_STATE_##state + #endif #include "Sd2Card_FlashDrive.h" @@ -271,11 +273,11 @@ bool DiskIODriver_USBFlash::init(const uint8_t, const pin_t) { if (!isInserted()) return false; #if USB_DEBUG >= 1 - const uint32_t sectorSize = bulk.GetSectorSize(0); - if (sectorSize != 512) { - SERIAL_ECHOLNPGM("Expecting sector size of 512. Got: ", sectorSize); - return false; - } + const uint32_t sectorSize = bulk.GetSectorSize(0); + if (sectorSize != 512) { + SERIAL_ECHOLNPGM("Expecting sector size of 512. Got: ", sectorSize); + return false; + } #endif #if USB_DEBUG >= 3 diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp index 9ff9cd77bc8b..09fd57b15467 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp @@ -27,19 +27,18 @@ #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && DISABLED(USE_UHS3_USB) +#if !PINS_EXIST(USB_CS, USB_INTR) + #error "USB_FLASH_DRIVE_SUPPORT requires USB_CS_PIN and USB_INTR_PIN to be defined." +#endif + #include "Usb.h" #include "usbhost.h" uint8_t MAX3421e::vbusState = 0; // constructor -void MAX3421e::cs() { - WRITE(USB_CS_PIN,0); -} - -void MAX3421e::ncs() { - WRITE(USB_CS_PIN,1); -} +void MAX3421e::cs() { WRITE(USB_CS_PIN, LOW); } +void MAX3421e::ncs() { WRITE(USB_CS_PIN, HIGH); } // write single byte into MAX3421 register void MAX3421e::regWr(uint8_t reg, uint8_t data) { @@ -76,8 +75,8 @@ uint8_t MAX3421e::regRd(uint8_t reg) { ncs(); return rv; } -// multiple-byte register read +// multiple-byte register read // return a pointer to a memory position after last read uint8_t* MAX3421e::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p) { cs(); @@ -86,8 +85,8 @@ uint8_t* MAX3421e::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t *data_p) { ncs(); return data_p; } -// GPIO read. See gpioWr for explanation +// GPIO read. See gpioWr for explanation // GPIN pins are in high nybbles of IOPINS1, IOPINS2 uint8_t MAX3421e::gpioRd() { return (regRd(rIOPINS2) & 0xF0) | // pins 4-7, clean lower nybble From f6f31434b8c0e21f98fef460e0c8492fd4c240d5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Apr 2022 07:16:52 -0500 Subject: [PATCH 236/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20IS?= =?UTF-8?q?=5FULTRA=5FLCD=20=3D>=20HAS=5FWIRED=5FLCD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 11 +++++------ Marlin/src/pins/mega/pins_MEGATRONICS.h | 4 ++-- Marlin/src/pins/pins.h | 2 +- Marlin/src/pins/ramps/pins_3DRAG.h | 6 +++--- Marlin/src/pins/ramps/pins_FELIX2.h | 2 +- Marlin/src/pins/ramps/pins_K8600.h | 2 +- Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h | 2 +- Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h | 4 ++-- Marlin/src/pins/teensy2/pins_PRINTRBOARD.h | 4 ++-- Marlin/src/pins/teensy2/pins_TEENSYLU.h | 4 ++-- 10 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index e7473420cf9d..d063e41bccad 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -41,13 +41,13 @@ * * DOGLCD : Run a Graphical LCD through U8GLib (with MarlinUI) * IS_ULTIPANEL : Define LCD_PINS_D5/6/7 for direct-connected "Ultipanel" LCDs - * IS_ULTRA_LCD : Ultra LCD, not necessarily Ultipanel. + * HAS_WIRED_LCD : Ultra LCD, not necessarily Ultipanel. * IS_RRD_SC : Common RRD Smart Controller digital interface pins * IS_RRD_FG_SC : Common RRD Full Graphical Smart Controller digital interface pins * IS_U8GLIB_ST7920 : Most common DOGM display SPI interface, supporting a "lightweight" display mode. * U8GLIB_SH1106 : SH1106 OLED with I2C interface via U8GLib * IS_U8GLIB_SSD1306 : SSD1306 OLED with I2C interface via U8GLib (U8GLIB_SSD1306) - * U8GLIB_SSD1309 : SSD1309 OLED with I2C interface via U8GLib (HAS_U8GLIB_I2C_OLED, IS_ULTRA_LCD, DOGLCD) + * U8GLIB_SSD1309 : SSD1309 OLED with I2C interface via U8GLib (HAS_U8GLIB_I2C_OLED, HAS_WIRED_LCD, DOGLCD) * IS_U8GLIB_ST7565_64128N : ST7565 128x64 LCD with SPI interface via U8GLib * IS_U8GLIB_LM6059_AF : LM6059 with Hardware SPI via U8GLib */ @@ -287,7 +287,7 @@ // 128x64 I2C OLED LCDs - SSD1306/SSD1309/SH1106 #if ANY(U8GLIB_SSD1306, U8GLIB_SSD1309, U8GLIB_SH1106) #define HAS_U8GLIB_I2C_OLED 1 - #define IS_ULTRA_LCD 1 + #define HAS_WIRED_LCD 1 #define DOGLCD #endif @@ -443,7 +443,7 @@ #endif #if EITHER(IS_ULTIPANEL, ULTRA_LCD) - #define IS_ULTRA_LCD 1 + #define HAS_WIRED_LCD 1 #endif #if EITHER(IS_ULTIPANEL, REPRAPWORLD_KEYPAD) @@ -502,8 +502,7 @@ #endif #endif -#if IS_ULTRA_LCD - #define HAS_WIRED_LCD 1 +#if HAS_WIRED_LCD #if ENABLED(DOGLCD) #define HAS_MARLINUI_U8GLIB 1 #elif IS_TFTGLCD_PANEL diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS.h b/Marlin/src/pins/mega/pins_MEGATRONICS.h index 0308175b2a3f..ac0ba4eea662 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS.h @@ -106,7 +106,7 @@ // #define BEEPER_PIN 33 -#if IS_ULTRA_LCD && IS_NEWPANEL +#if HAS_WIRED_LCD && IS_NEWPANEL #define LCD_PINS_RS 16 #define LCD_PINS_ENABLE 17 @@ -122,7 +122,7 @@ #define SD_DETECT_PIN -1 // RAMPS doesn't use this -#endif // IS_ULTRA_LCD && IS_NEWPANEL +#endif // HAS_WIRED_LCD && IS_NEWPANEL // // M3/M4/M5 - Spindle/Laser Control diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 202630ae4aa2..01e5ee41e383 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -61,7 +61,7 @@ #endif #endif -#if !(BOTH(IS_ULTRA_LCD, IS_NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, WYH_L12864, MINIPANEL, REPRAPWORLD_KEYPAD)) +#if !(BOTH(HAS_WIRED_LCD, IS_NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, WYH_L12864, MINIPANEL, REPRAPWORLD_KEYPAD)) #define HAS_FREE_AUX2_PINS 1 #endif diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h index 48eeacd5c478..6f5b775af9ce 100644 --- a/Marlin/src/pins/ramps/pins_3DRAG.h +++ b/Marlin/src/pins/ramps/pins_3DRAG.h @@ -111,7 +111,7 @@ #define SPINDLE_LASER_PWM_PIN 46 // Hardware PWM #define SPINDLE_LASER_ENA_PIN 62 // Pullup! #define SPINDLE_DIR_PIN 48 - #elif !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // Use expansion header if no LCD in use + #elif !BOTH(HAS_WIRED_LCD, IS_NEWPANEL) // Use expansion header if no LCD in use #define SPINDLE_LASER_ENA_PIN 16 // Pullup or pulldown! #define SPINDLE_DIR_PIN 17 #if !NUM_SERVOS // Use servo connector if possible @@ -135,7 +135,7 @@ // // LCD / Controller // -#if IS_ULTRA_LCD && IS_NEWPANEL +#if HAS_WIRED_LCD && IS_NEWPANEL #undef BEEPER_PIN // TODO: Remap EXP1/2 based on adapter @@ -164,7 +164,7 @@ #define BEEPER_PIN 33 -#endif // IS_ULTRA_LCD && IS_NEWPANEL +#endif // HAS_WIRED_LCD && IS_NEWPANEL #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 0 diff --git a/Marlin/src/pins/ramps/pins_FELIX2.h b/Marlin/src/pins/ramps/pins_FELIX2.h index e572d3f2866c..bdf83c44ba8e 100644 --- a/Marlin/src/pins/ramps/pins_FELIX2.h +++ b/Marlin/src/pins/ramps/pins_FELIX2.h @@ -49,7 +49,7 @@ // // LCD / Controller // -#if IS_ULTRA_LCD && IS_NEWPANEL +#if HAS_WIRED_LCD && IS_NEWPANEL #define SD_DETECT_PIN 6 diff --git a/Marlin/src/pins/ramps/pins_K8600.h b/Marlin/src/pins/ramps/pins_K8600.h index 015512992782..2dabd9d59b93 100644 --- a/Marlin/src/pins/ramps/pins_K8600.h +++ b/Marlin/src/pins/ramps/pins_K8600.h @@ -69,7 +69,7 @@ // // LCD / Controller // -#if IS_ULTRA_LCD && IS_NEWPANEL +#if HAS_WIRED_LCD && IS_NEWPANEL #undef BEEPER_PIN #undef LCD_PINS_RS diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h index 091356a11f82..37060ab94541 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h @@ -172,7 +172,7 @@ #define LCD_PINS_D6 32 #define LCD_PINS_D7 30 -#elif BOTH(BOARD_REV_1_5, IS_ULTRA_LCD) +#elif BOTH(BOARD_REV_1_5, HAS_WIRED_LCD) #define BEEPER_PIN 18 diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h index 8471d1c7f5f3..5fe0d3842dd4 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h @@ -135,7 +135,7 @@ #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED #endif -#if !HAS_CUTTER && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // try to use IO Header +#if !HAS_CUTTER && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(HAS_WIRED_LCD, IS_NEWPANEL) // try to use IO Header #define CASE_LIGHT_PIN 4 // Hardware PWM - see if IO Header is available #endif @@ -268,7 +268,7 @@ // M3/M4/M5 - Spindle/Laser Control // #if HAS_CUTTER - #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // try to use IO Header + #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(HAS_WIRED_LCD, IS_NEWPANEL) // try to use IO Header #define SPINDLE_LASER_ENA_PIN 10 // Pullup or pulldown! #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h index c813287866dd..82d9cec8949b 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h @@ -121,7 +121,7 @@ // // LCD / Controller // -#if IS_ULTRA_LCD && IS_NEWPANEL +#if HAS_WIRED_LCD && IS_NEWPANEL #define LCD_PINS_RS 9 // E1 JP11-11 #define LCD_PINS_ENABLE 8 // E0 JP11-10 @@ -163,7 +163,7 @@ #endif -#endif // IS_ULTRA_LCD && IS_NEWPANEL +#endif // HAS_WIRED_LCD && IS_NEWPANEL #ifndef SDSS #define SDSS 26 // B6 SDCS diff --git a/Marlin/src/pins/teensy2/pins_TEENSYLU.h b/Marlin/src/pins/teensy2/pins_TEENSYLU.h index 535ce534d437..ab722478fd93 100644 --- a/Marlin/src/pins/teensy2/pins_TEENSYLU.h +++ b/Marlin/src/pins/teensy2/pins_TEENSYLU.h @@ -145,7 +145,7 @@ // // LCD / Controller // -#if IS_ULTRA_LCD && IS_NEWPANEL +#if HAS_WIRED_LCD && IS_NEWPANEL #define BEEPER_PIN -1 @@ -158,7 +158,7 @@ #define SD_DETECT_PIN -1 -#endif // IS_ULTRA_LCD && IS_NEWPANEL +#endif // HAS_WIRED_LCD && IS_NEWPANEL // // M3/M4/M5 - Spindle/Laser Control From 99252cf0cd5a8a01228c715a505cb1eaf6b853e5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Apr 2022 08:58:45 -0500 Subject: [PATCH 237/502] =?UTF-8?q?=F0=9F=90=9B=20=20Prevent=20BABYSTEP=20?= =?UTF-8?q?freeze?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #22830, #13300 --- Marlin/src/module/stepper.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index af64d9f8bf1d..09d99e89650c 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2979,7 +2979,12 @@ void Stepper::report_positions() { #else #define CYCLES_EATEN_BABYSTEP 0 #endif - #define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP)) + + #if CYCLES_EATEN_BABYSTEP < STEP_PULSE_CYCLES + #define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP)) + #else + #define EXTRA_CYCLES_BABYSTEP 0 + #endif #if EXTRA_CYCLES_BABYSTEP > 20 #define _SAVE_START() const hal_timer_t pulse_start = HAL_timer_get_count(MF_TIMER_PULSE) From be6535e5f7a39529bd081ed38a1bf76fa645488f Mon Sep 17 00:00:00 2001 From: Christian Piper <42127153+CAP1Sup@users.noreply.github.com> Date: Thu, 21 Apr 2022 03:15:07 -0400 Subject: [PATCH 238/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20PRINTCOUNTER=20wit?= =?UTF-8?q?h=20EXTRUDERS=200=20(#24063)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/module/printcounter.cpp | 47 ++++++++++++++++++------------ Marlin/src/module/printcounter.h | 27 +++++++++-------- buildroot/tests/mega2560 | 2 +- 4 files changed, 43 insertions(+), 35 deletions(-) diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index c365f8a67b42..d26a79b69af8 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -207,7 +207,7 @@ void GcodeSuite::get_destination_from_command() { if (parser.floatval('F') > 0) feedrate_mm_s = parser.value_feedrate(); - #if ENABLED(PRINTCOUNTER) + #if BOTH(PRINTCOUNTER, HAS_EXTRUDERS) if (!DEBUGGING(DRYRUN) && !skip_move) print_job_timer.incFilamentUsed(destination.e - current_position.e); #endif diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index c35b722cf4c6..d05a47957250 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -80,30 +80,36 @@ millis_t PrintCounter::deltaDuration() { return lastDuration - tmp; } -void PrintCounter::incFilamentUsed(float const &amount) { - TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("incFilamentUsed"))); +#if HAS_EXTRUDERS + void PrintCounter::incFilamentUsed(float const &amount) { + TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("incFilamentUsed"))); - // Refuses to update data if object is not loaded - if (!isLoaded()) return; + // Refuses to update data if object is not loaded + if (!isLoaded()) return; - data.filamentUsed += amount; // mm -} + data.filamentUsed += amount; // mm + } +#endif void PrintCounter::initStats() { TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("initStats"))); loaded = true; - data = { 0, 0, 0, 0, 0.0 - #if HAS_SERVICE_INTERVALS - #if SERVICE_INTERVAL_1 > 0 - , SERVICE_INTERVAL_SEC_1 - #endif - #if SERVICE_INTERVAL_2 > 0 - , SERVICE_INTERVAL_SEC_2 - #endif - #if SERVICE_INTERVAL_3 > 0 - , SERVICE_INTERVAL_SEC_3 - #endif + + data = { + .totalPrints = 0 + , .finishedPrints = 0 + , .printTime = 0 + , .longestPrint = 0 + OPTARG(HAS_EXTRUDERS, .filamentUsed = 0.0) + #if SERVICE_INTERVAL_1 > 0 + , .nextService1 = SERVICE_INTERVAL_SEC_1 + #endif + #if SERVICE_INTERVAL_2 > 0 + , .nextService2 = SERVICE_INTERVAL_SEC_2 + #endif + #if SERVICE_INTERVAL_3 > 0 + , .nextService3 = SERVICE_INTERVAL_SEC_3 #endif }; @@ -210,8 +216,11 @@ void PrintCounter::showStats() { SERIAL_CHAR(')'); #endif - SERIAL_ECHOPGM("\n" STR_STATS "Filament used: ", data.filamentUsed / 1000); - SERIAL_CHAR('m'); + #if HAS_EXTRUDERS + SERIAL_ECHOPGM("\n" STR_STATS "Filament used: ", data.filamentUsed / 1000); + SERIAL_CHAR('m'); + #endif + SERIAL_EOL(); #if SERVICE_INTERVAL_1 > 0 diff --git a/Marlin/src/module/printcounter.h b/Marlin/src/module/printcounter.h index 931d14ded6da..63cc1da158e8 100644 --- a/Marlin/src/module/printcounter.h +++ b/Marlin/src/module/printcounter.h @@ -37,7 +37,9 @@ struct printStatistics { // 16 bytes uint16_t finishedPrints; // Number of complete prints uint32_t printTime; // Accumulated printing time uint32_t longestPrint; // Longest successful print job - float filamentUsed; // Accumulated filament consumed in mm + #if HAS_EXTRUDERS + float filamentUsed; // Accumulated filament consumed in mm + #endif #if SERVICE_INTERVAL_1 > 0 uint32_t nextService1; // Service intervals (or placeholders) #endif @@ -52,12 +54,7 @@ struct printStatistics { // 16 bytes class PrintCounter: public Stopwatch { private: typedef Stopwatch super; - - #if EITHER(USE_WIRED_EEPROM, CPU_32_BIT) - typedef uint32_t eeprom_address_t; - #else - typedef uint16_t eeprom_address_t; - #endif + typedef IF::type eeprom_address_t; static printStatistics data; @@ -124,13 +121,15 @@ class PrintCounter: public Stopwatch { */ FORCE_INLINE static bool isLoaded() { return loaded; } - /** - * @brief Increment the total filament used - * @details The total filament used counter will be incremented by "amount". - * - * @param amount The amount of filament used in mm - */ - static void incFilamentUsed(float const &amount); + #if HAS_EXTRUDERS + /** + * @brief Increment the total filament used + * @details The total filament used counter will be incremented by "amount". + * + * @param amount The amount of filament used in mm + */ + static void incFilamentUsed(float const &amount); + #endif /** * @brief Reset the Print Statistics diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560 index 5ae9a2dbcf0b..0321e451c4b2 100755 --- a/buildroot/tests/mega2560 +++ b/buildroot/tests/mega2560 @@ -194,7 +194,7 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_C DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ AXIS_RELATIVE_MODES '{ false, false, false }' -opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \ +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT PRINTCOUNTER \ LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER I2C_AMMETER exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 44780 LCD " "$3" From ec447dba04409c2b60d61b9bacab54c101bd9f3a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Apr 2022 09:05:12 -0500 Subject: [PATCH 239/502] =?UTF-8?q?=F0=9F=9A=B8=20=20Home=20Y=20before=20X?= =?UTF-8?q?=20on=20belt=20printers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index d063e41bccad..d27268a37eb7 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -990,6 +990,10 @@ #undef USE_PROBE_FOR_Z_HOMING #endif +#if ENABLED(BELTPRINTER) && !defined(HOME_Y_BEFORE_X) + #define HOME_Y_BEFORE_X +#endif + #if Z_HOME_TO_MAX #define HOME_Z_FIRST // If homing away from BED do Z first #endif From 421c38ff2e0de3a8d5cd913232aa3448dbfbc487 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Apr 2022 08:57:41 -0500 Subject: [PATCH 240/502] =?UTF-8?q?=F0=9F=90=9B=20=20Home=20Z=20to=20Max?= =?UTF-8?q?=20after=20Z=5FSAFE=5FHOMING?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index d27268a37eb7..22dfdfc3d912 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -994,7 +994,7 @@ #define HOME_Y_BEFORE_X #endif -#if Z_HOME_TO_MAX +#if Z_HOME_TO_MAX && DISABLED(Z_SAFE_HOMING) #define HOME_Z_FIRST // If homing away from BED do Z first #endif From 7ff4b706947e63d708cef90c936b936305947e58 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Apr 2022 07:07:04 -0500 Subject: [PATCH 241/502] =?UTF-8?q?=F0=9F=9A=B8=20Prevent=20accidental=20b?= =?UTF-8?q?utton=20press?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 1 + Marlin/src/lcd/marlinui.h | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index be93bfcfb9d7..279754aee3bd 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -271,6 +271,7 @@ bool wait_for_heatup = true; while (wait_for_user && !(ms && ELAPSED(millis(), ms))) idle(TERN_(ADVANCED_PAUSE_FEATURE, no_sleep)); wait_for_user = false; + while (ui.button_pressed()) safe_delay(50); } #endif diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index d9404541d268..b9c4e72371b4 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -709,8 +709,6 @@ class MarlinUI { static bool hw_button_pressed() { return BUTTON_CLICK(); } #endif - static bool button_pressed() { return hw_button_pressed() || TERN0(TOUCH_SCREEN, touch_pressed()); } - #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) static void wait_for_release(); #endif @@ -742,9 +740,12 @@ class MarlinUI { #else static void update_buttons() {} + static bool hw_button_pressed() { return false; } #endif + static bool button_pressed() { return hw_button_pressed() || TERN0(TOUCH_SCREEN, touch_pressed()); } + #if ENABLED(TOUCH_SCREEN_CALIBRATION) static void touch_calibration_screen(); #endif From c23d0351495a7fc1c396d157642db49db2754135 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Apr 2022 08:43:11 -0500 Subject: [PATCH 242/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Str?= =?UTF-8?q?ip=20#errors=20in=20Configurations=20deployment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/git/mfconfig | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/buildroot/share/git/mfconfig b/buildroot/share/git/mfconfig index 70642a5d39cb..d3e0b67b3e40 100755 --- a/buildroot/share/git/mfconfig +++ b/buildroot/share/git/mfconfig @@ -74,6 +74,8 @@ if [[ $ACTION == "init" ]]; then # a 'BASE' branch with only defaults as a starting point. # + SED=$(which gsed sed | head -n1) + echo "- Initializing BASE branch..." # Use the import branch as the source @@ -82,6 +84,14 @@ if [[ $ACTION == "init" ]]; then # Copy to a temporary location TEMP=$( mktemp -d ) ; cp -R config $TEMP + # Strip all #error lines + IFS=$'\n'; set -f + for fn in $( find $TEMP/config -type f -name "Configuration.h" ); do + $SED -i~ -e "20,30{/#error/d}" "$fn" + rm "$fn~" + done + unset IFS; set +f + # Make sure we're not on the 'BASE' branch... git checkout init-repo >/dev/null 2>&1 || exit @@ -149,7 +159,6 @@ if [[ $ACTION == "init" ]]; then ((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset TPARA..." >/dev/null # Update the %VERSION% in the README.md file - SED=$(which gsed sed | head -n1) VERS=$( echo $EXPORT | $SED 's/release-//' ) eval "${SED} -E -i~ -e 's/%VERSION%/$VERS/g' README.md" rm -f README.md~ From a56bf9045d3e68101c42ced30884fa34675279c5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Apr 2022 02:05:02 -0500 Subject: [PATCH 243/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Sim?= =?UTF-8?q?plify=20BIGTREE=5FSKR=5F2=5FF429=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/stm32f4.ini | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index d7c160d63942..437dbdcd9be1 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -231,18 +231,8 @@ build_unflags = ${env:BIGTREE_SKR_2_USB.build_unflags} -Os -NDEBUG # Bigtreetech SKR V2.0 F429 (STM32F429VGT6 ARM Cortex-M4) with USB Flash Drive Support # [env:BIGTREE_SKR_2_F429] -extends = stm32_variant -platform_packages = ${stm_flash_drive.platform_packages} +extends = env:BIGTREE_SKR_2 board = marlin_STM32F429VGT6 -board_build.variant = MARLIN_F4x7Vx -board_build.offset = 0x8000 -board_upload.offset_address = 0x08008000 -build_flags = ${stm_flash_drive.build_flags} - -DUSE_USBHOST_HS -DUSE_USB_HS_IN_FS - -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 - -DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED - -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 -upload_protocol = stlink # # BigTreeTech SKR V2.0 F429 (STM32F429VGT6 ARM Cortex-M4) with USB Media Share Support From 89d5ed0c9e5570e4a025719a9ad183e505c8ed8a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 29 Mar 2022 04:22:04 -0500 Subject: [PATCH 244/502] =?UTF-8?q?=F0=9F=8E=A8=20=20Combine=20common=20LP?= =?UTF-8?q?C1768=20I2C=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../include/digipot_mcp4451_I2C_routines.c | 33 ++--------------- Marlin/src/HAL/LPC1768/include/i2c_util.c | 26 ++++++++++++++ Marlin/src/HAL/LPC1768/include/i2c_util.h | 5 +++ .../src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp | 36 +------------------ 4 files changed, 34 insertions(+), 66 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c b/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c index f442ab71c0bd..c489c16e5ef6 100644 --- a/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c +++ b/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c @@ -29,7 +29,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if MB(MKS_SBASE) +#if ENABLED(DIGIPOT_MCP4451) && MB(MKS_SBASE) #ifdef __cplusplus extern "C" { @@ -37,35 +37,6 @@ #include "digipot_mcp4451_I2C_routines.h" -// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to -// to the lpc17xx_i2c.c routines so had to copy them into this file & rename them. - -static uint32_t _I2C_Start(LPC_I2C_TypeDef *I2Cx) { - // Reset STA, STO, SI - I2Cx->I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC; - - // Enter to Master Transmitter mode - I2Cx->I2CONSET = I2C_I2CONSET_STA; - - // Wait for complete - while (!(I2Cx->I2CONSET & I2C_I2CONSET_SI)); - I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; - return (I2Cx->I2STAT & I2C_STAT_CODE_BITMASK); -} - -static void _I2C_Stop(LPC_I2C_TypeDef *I2Cx) { - // Make sure start bit is not active - if (I2Cx->I2CONSET & I2C_I2CONSET_STA) - I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; - - I2Cx->I2CONSET = I2C_I2CONSET_STO|I2C_I2CONSET_AA; - I2Cx->I2CONCLR = I2C_I2CONCLR_SIC; -} - -I2C_M_SETUP_Type transferMCfg; - -#define I2C_status (LPC_I2C1->I2STAT & I2C_STAT_CODE_BITMASK) - uint8_t digipot_mcp4451_start(uint8_t sla) { // send slave address and write bit // Sometimes TX data ACK or NAK status is returned. That mean the start state didn't // happen which means only the value of the slave address was send. Keep looping until @@ -102,5 +73,5 @@ uint8_t digipot_mcp4451_send_byte(uint8_t data) { } #endif -#endif // MB(MKS_SBASE) +#endif // DIGIPOT_MCP4451 && MKS_SBASE #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/LPC1768/include/i2c_util.c b/Marlin/src/HAL/LPC1768/include/i2c_util.c index e52fb7c4de92..4e24f23236ea 100644 --- a/Marlin/src/HAL/LPC1768/include/i2c_util.c +++ b/Marlin/src/HAL/LPC1768/include/i2c_util.c @@ -63,6 +63,32 @@ void configure_i2c(const uint8_t clock_option) { I2C_Cmd(I2CDEV_M, I2C_MASTER_MODE, ENABLE); } +////////////////////////////////////////////////////////////////////////////////////// +// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to +// to the lpc17xx_i2c.c routines so had to copy them into this file & rename them. + +uint32_t _I2C_Start(LPC_I2C_TypeDef *I2Cx) { + // Reset STA, STO, SI + I2Cx->I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC; + + // Enter to Master Transmitter mode + I2Cx->I2CONSET = I2C_I2CONSET_STA; + + // Wait for complete + while (!(I2Cx->I2CONSET & I2C_I2CONSET_SI)); + I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; + return (I2Cx->I2STAT & I2C_STAT_CODE_BITMASK); +} + +void _I2C_Stop(LPC_I2C_TypeDef *I2Cx) { + /* Make sure start bit is not active */ + if (I2Cx->I2CONSET & I2C_I2CONSET_STA) + I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; + + I2Cx->I2CONSET = I2C_I2CONSET_STO|I2C_I2CONSET_AA; + I2Cx->I2CONCLR = I2C_I2CONCLR_SIC; +} + #ifdef __cplusplus } #endif diff --git a/Marlin/src/HAL/LPC1768/include/i2c_util.h b/Marlin/src/HAL/LPC1768/include/i2c_util.h index a57f68a4071f..1f1c19f2798b 100644 --- a/Marlin/src/HAL/LPC1768/include/i2c_util.h +++ b/Marlin/src/HAL/LPC1768/include/i2c_util.h @@ -51,6 +51,11 @@ void configure_i2c(const uint8_t clock_option); +uint32_t _I2C_Start(LPC_I2C_TypeDef *I2Cx); +void _I2C_Stop(LPC_I2C_TypeDef *I2Cx); + +#define I2C_status (LPC_I2C1->I2STAT & I2C_STAT_CODE_BITMASK) + #ifdef __cplusplus } #endif diff --git a/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp b/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp index a48a820dc433..e714c3c16da1 100644 --- a/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp @@ -36,40 +36,7 @@ extern int millis(); ////////////////////////////////////////////////////////////////////////////////////// -// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to -// to the lpc17xx_i2c.c routines so had to copy them into this file & rename them. - -static uint32_t _I2C_Start(LPC_I2C_TypeDef *I2Cx) { - // Reset STA, STO, SI - I2Cx->I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC; - - // Enter to Master Transmitter mode - I2Cx->I2CONSET = I2C_I2CONSET_STA; - - // Wait for complete - while (!(I2Cx->I2CONSET & I2C_I2CONSET_SI)); - I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; - return (I2Cx->I2STAT & I2C_STAT_CODE_BITMASK); -} - -static void _I2C_Stop (LPC_I2C_TypeDef *I2Cx) { - /* Make sure start bit is not active */ - if (I2Cx->I2CONSET & I2C_I2CONSET_STA) - I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; - - I2Cx->I2CONSET = I2C_I2CONSET_STO|I2C_I2CONSET_AA; - I2Cx->I2CONCLR = I2C_I2CONCLR_SIC; -} - -////////////////////////////////////////////////////////////////////////////////////// - -#define I2CDEV_S_ADDR 0x78 // from SSD1306 //actual address is 0x3C - shift left 1 with LSB set to 0 to indicate write - -#define BUFFER_SIZE 0x1 // only do single byte transfers with LCDs - -I2C_M_SETUP_Type transferMCfg; - -#define I2C_status (LPC_I2C1->I2STAT & I2C_STAT_CODE_BITMASK) +#define I2CDEV_S_ADDR 0x78 // From SSD1306 (actual address is 0x3C - shift left 1 with LSB set to 0 to indicate write) // Send slave address and write bit uint8_t u8g_i2c_start(const uint8_t sla) { @@ -115,7 +82,6 @@ uint8_t u8g_i2c_send_byte(uint8_t data) { void u8g_i2c_stop() { } - #ifdef __cplusplus } #endif From 18b17fc97d8474b2fe5c5cd7afcfdce05ba7d5cc Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 23 Apr 2022 22:02:13 +1200 Subject: [PATCH 245/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MKS=5FMINI=5F12864?= =?UTF-8?q?=20build=20for=20ESP32=20(#24071)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp index 0aa66ed2cf0d..5437e8181b95 100644 --- a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp +++ b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp @@ -25,7 +25,7 @@ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(FYSETC_MINI_12864_2_1) +#if EITHER(MKS_MINI_12864, FYSETC_MINI_12864_2_1) #include #include "Arduino.h" @@ -96,5 +96,6 @@ uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_pt return 1; } -#endif // FYSETC_MINI_12864_2_1 +#endif // EITHER(MKS_MINI_12864, FYSETC_MINI_12864_2_1) + #endif // ARDUINO_ARCH_ESP32 From e9ea82e78d0c95ef1cee599093b4c91a6f97d709 Mon Sep 17 00:00:00 2001 From: stream2me <32234535+stream2me@users.noreply.github.com> Date: Sun, 10 Apr 2022 02:46:29 +0200 Subject: [PATCH 246/502] =?UTF-8?q?=F0=9F=90=9B=20Prefer=20os.replace,=20f?= =?UTF-8?q?ix=20TFT=5FLVGL=5FUI=20build=20(#24001)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp | 2 +- buildroot/share/PlatformIO/scripts/offset_and_rename.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp b/Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp index aee5573283e7..c047e322d6c8 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp @@ -74,7 +74,7 @@ void lv_draw_level_settings() { #if HAS_BED_PROBE lv_screen_menu_item(scr, machine_menu.LevelingAutoZoffsetConf, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_LEVEL_ZOFFSET, 2); #if ENABLED(PROBE_OFFSET_WIZARD) - lv_screen_menu_item(scr, machine_menu.LevelingZoffsetWizard, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_Z_OFFSET_WIZARD, 3); + lv_screen_menu_item(scr, machine_menu.LevelingZoffsetTitle, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_Z_OFFSET_WIZARD, 3); #endif #endif lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_LEVEL_RETURN, true); diff --git a/buildroot/share/PlatformIO/scripts/offset_and_rename.py b/buildroot/share/PlatformIO/scripts/offset_and_rename.py index 581a06e91e7f..ddbb786fecd1 100644 --- a/buildroot/share/PlatformIO/scripts/offset_and_rename.py +++ b/buildroot/share/PlatformIO/scripts/offset_and_rename.py @@ -57,6 +57,6 @@ def encrypt(source, target, env): def rename_target(source, target, env): firmware = os.path.join(target[0].dir.path, board.get("build.rename")) - os.rename(target[0].path, firmware) + os.replace(target[0].path, firmware) marlin.add_post_action(rename_target) From cd5c5ea60eb20d643ab2447bc3550b3eb5874a39 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Apr 2022 03:44:45 -0500 Subject: [PATCH 247/502] =?UTF-8?q?=F0=9F=94=A8=20Fix=20LPC176x=20debug=20?= =?UTF-8?q?build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #23635 --- buildroot/share/PlatformIO/scripts/common-cxxflags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py index 4a48e44742da..1e8f0dcb0552 100644 --- a/buildroot/share/PlatformIO/scripts/common-cxxflags.py +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -29,7 +29,7 @@ def add_cpu_freq(): # It useful to keep two live versions: a debug version for debugging and another for # release, for flashing when upload is not done automatically by jlink/stlink. # Without this, PIO needs to recompile everything twice for any small change. - if env.GetBuildType() == "debug" and env.get('UPLOAD_PROTOCOL') not in ['jlink', 'stlink']: + if env.GetBuildType() == "debug" and env.get('UPLOAD_PROTOCOL') not in ['jlink', 'stlink', 'custom']: env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug' # On some platform, F_CPU is a runtime variable. Since it's used to convert from ns From eada17ed69ede29d83f7c3897d64e2872faaae18 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Apr 2022 01:49:59 -0500 Subject: [PATCH 248/502] =?UTF-8?q?=F0=9F=A9=B9=20Apply=20100%=20leveling?= =?UTF-8?q?=20correction=20below=20the=20bed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #24002 --- Marlin/src/module/planner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 5b79e406f5dd..3f96863cbdc5 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -591,7 +591,7 @@ class Planner { */ static float fade_scaling_factor_for_z(const_float_t rz) { static float z_fade_factor = 1; - if (!z_fade_height) return 1; + if (!z_fade_height || rz <= 0) return 1; if (rz >= z_fade_height) return 0; if (last_fade_z != rz) { last_fade_z = rz; From 7ffe4de021254d34762d2a7ecd239ded0eca949d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Apr 2022 07:39:50 -0500 Subject: [PATCH 249/502] =?UTF-8?q?=F0=9F=A9=B9=20Use=20LCD=5FCONTRAST=5FI?= =?UTF-8?q?NIT=20in=20pins=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/mega/pins_GT2560_REV_A.h | 2 +- Marlin/src/pins/ramps/pins_K8800.h | 2 +- Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h index ecd341984b6f..99e8704ea558 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h @@ -127,7 +127,7 @@ #define LCD_RESET_PIN 16 - #define LCD_CONTRAST_DEFAULT 220 + #define LCD_CONTRAST_INIT 220 #define LCD_BACKLIGHT_PIN -1 #else diff --git a/Marlin/src/pins/ramps/pins_K8800.h b/Marlin/src/pins/ramps/pins_K8800.h index 5cc4b4323a5a..f1362ec61d34 100644 --- a/Marlin/src/pins/ramps/pins_K8800.h +++ b/Marlin/src/pins/ramps/pins_K8800.h @@ -107,7 +107,7 @@ #define LCD_CONTRAST_MIN 0 #define LCD_CONTRAST_MAX 100 - #define LCD_CONTRAST_DEFAULT 30 + #define LCD_CONTRAST_INIT 30 //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #if IS_NEWPANEL diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h index 3f475ee35588..653735bd61d0 100644 --- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h +++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h @@ -157,7 +157,7 @@ #define NEOPIXEL_PIN PB9 #endif - #define LCD_CONTRAST_DEFAULT 255 + #define LCD_CONTRAST_INIT 255 #else #define LCD_PINS_RS PC15 #define LCD_PINS_ENABLE PB6 From 4fd7d1b056bfab9f31c272ae6d8f256ed2ed202d Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Thu, 21 Apr 2022 21:06:22 +1200 Subject: [PATCH 250/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20STM32=20Pins=20Deb?= =?UTF-8?q?ugging=20(#22896)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/DUE/pinsDebug.h | 1 - Marlin/src/HAL/STM32/pinsDebug.h | 47 ++++++++++++------- Marlin/src/gcode/config/M43.cpp | 14 +++--- .../variant.h | 4 +- .../MARLIN_BIGTREE_OCTOPUS_V1/variant.h | 4 +- 5 files changed, 40 insertions(+), 30 deletions(-) diff --git a/Marlin/src/HAL/DUE/pinsDebug.h b/Marlin/src/HAL/DUE/pinsDebug.h index 6c08585974fd..df1ba415e918 100644 --- a/Marlin/src/HAL/DUE/pinsDebug.h +++ b/Marlin/src/HAL/DUE/pinsDebug.h @@ -86,7 +86,6 @@ bool GET_PINMODE(int8_t pin) { // 1: output, 0: input || pwm_status(pin)); } - void pwm_details(int32_t pin) { if (pwm_status(pin)) { uint32_t chan = g_APinDescription[pin].ulPWMChannel; diff --git a/Marlin/src/HAL/STM32/pinsDebug.h b/Marlin/src/HAL/STM32/pinsDebug.h index a7f022a0b62d..55c64c868192 100644 --- a/Marlin/src/HAL/STM32/pinsDebug.h +++ b/Marlin/src/HAL/STM32/pinsDebug.h @@ -79,7 +79,6 @@ // make a list of the Arduino pin numbers in the Port/Pin order // -#define _PIN_ADD_2(NAME_ALPHA, ARDUINO_NUM) { {NAME_ALPHA}, ARDUINO_NUM }, #define _PIN_ADD(NAME_ALPHA, ARDUINO_NUM) { NAME_ALPHA, ARDUINO_NUM }, #define PIN_ADD(NAME) _PIN_ADD(#NAME, NAME) @@ -108,7 +107,11 @@ const XrefInfo pin_xref[] PROGMEM = { /** * Translation of routines & variables used by pinsDebug.h */ -#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS + +#if PA0 >= NUM_DIGITAL_PINS + #define HAS_HIGH_ANALOG_PINS 1 +#endif +#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS + TERN0(HAS_HIGH_ANALOG_PINS, NUM_ANALOG_INPUTS) #define VALID_PIN(ANUM) ((ANUM) >= 0 && (ANUM) < NUMBER_PINS_TOTAL) #define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads #define PRINT_PIN(Q) @@ -164,17 +167,20 @@ bool GET_PINMODE(const pin_t Ard_num) { return pin_mode == MODE_PIN_OUTPUT || pin_mode == MODE_PIN_ALT; // assume all alt definitions are PWM } -int8_t digital_pin_to_analog_pin(pin_t Ard_num) { - Ard_num -= NUM_ANALOG_FIRST; - return (Ard_num >= 0 && Ard_num < NUM_ANALOG_INPUTS) ? Ard_num : -1; +int8_t digital_pin_to_analog_pin(const pin_t Ard_num) { + if (WITHIN(Ard_num, NUM_ANALOG_FIRST, NUM_ANALOG_FIRST + NUM_ANALOG_INPUTS - 1)) + return Ard_num - NUM_ANALOG_FIRST; + + const uint32_t ind = digitalPinToAnalogInput(Ard_num); + return (ind < NUM_ANALOG_INPUTS) ? ind : -1; } bool IS_ANALOG(const pin_t Ard_num) { return get_pin_mode(Ard_num) == MODE_PIN_ANALOG; } -bool is_digital(const pin_t x) { - const uint8_t pin_mode = get_pin_mode(pin_array[x].pin); +bool is_digital(const pin_t Ard_num) { + const uint8_t pin_mode = get_pin_mode(pin_array[Ard_num].pin); return pin_mode == MODE_PIN_INPUT || pin_mode == MODE_PIN_OUTPUT; } @@ -200,10 +206,15 @@ void port_print(const pin_t Ard_num) { SERIAL_ECHO_SP(7); // Print number to be used with M42 - sprintf_P(buffer, PSTR(" M42 P%d "), Ard_num); - SERIAL_ECHO(buffer); - if (Ard_num < 10) SERIAL_CHAR(' '); - if (Ard_num < 100) SERIAL_CHAR(' '); + int calc_p = Ard_num % (NUM_DIGITAL_PINS + 1); + if (Ard_num > NUM_DIGITAL_PINS && calc_p > 7) calc_p += 8; + SERIAL_ECHOPGM(" M42 P", calc_p); + SERIAL_CHAR(' '); + if (calc_p < 100) { + SERIAL_CHAR(' '); + if (calc_p < 10) + SERIAL_CHAR(' '); + } } bool pwm_status(const pin_t Ard_num) { @@ -225,19 +236,19 @@ void pwm_details(const pin_t Ard_num) { case 'D' : alt_all = GPIOD->AFR[ind]; break; #ifdef PE_0 case 'E' : alt_all = GPIOE->AFR[ind]; break; - #elif defined (PF_0) + #elif defined(PF_0) case 'F' : alt_all = GPIOF->AFR[ind]; break; - #elif defined (PG_0) + #elif defined(PG_0) case 'G' : alt_all = GPIOG->AFR[ind]; break; - #elif defined (PH_0) + #elif defined(PH_0) case 'H' : alt_all = GPIOH->AFR[ind]; break; - #elif defined (PI_0) + #elif defined(PI_0) case 'I' : alt_all = GPIOI->AFR[ind]; break; - #elif defined (PJ_0) + #elif defined(PJ_0) case 'J' : alt_all = GPIOJ->AFR[ind]; break; - #elif defined (PK_0) + #elif defined(PK_0) case 'K' : alt_all = GPIOK->AFR[ind]; break; - #elif defined (PL_0) + #elif defined(PL_0) case 'L' : alt_all = GPIOL->AFR[ind]; break; #endif } diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index 097aa142f03f..0fc5edc54e98 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -313,7 +313,7 @@ void GcodeSuite::M43() { // 'P' Get the range of pins to test or watch uint8_t first_pin = PARSED_PIN_INDEX('P', 0), - last_pin = parser.seenval('P') ? first_pin : NUMBER_PINS_TOTAL - 1; + last_pin = parser.seenval('P') ? first_pin : TERN(HAS_HIGH_ANALOG_PINS, NUM_DIGITAL_PINS, NUMBER_PINS_TOTAL) - 1; if (first_pin > last_pin) return; @@ -333,12 +333,12 @@ void GcodeSuite::M43() { if (M43_NEVER_TOUCH(i) || (!ignore_protection && pin_is_protected(pin))) continue; pinMode(pin, INPUT_PULLUP); delay(1); - /* - if (IS_ANALOG(pin)) - pin_state[pin - first_pin] = analogRead(DIGITAL_PIN_TO_ANALOG_PIN(pin)); // int16_t pin_state[...] - else - //*/ - pin_state[i - first_pin] = extDigitalRead(pin); + /* + if (IS_ANALOG(pin)) + pin_state[pin - first_pin] = analogRead(DIGITAL_PIN_TO_ANALOG_PIN(pin)); // int16_t pin_state[...] + else + //*/ + pin_state[i - first_pin] = extDigitalRead(pin); } #if HAS_RESUME_CONTINUE diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.h index 1870e779297a..b8e4b9667e80 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.h @@ -141,10 +141,10 @@ extern "C" { #define PG15 111 //D79 // This must be a literal with the same value as PEND -#define NUM_DIGITAL_PINS 125 +#define NUM_DIGITAL_PINS 112 // This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS #define NUM_ANALOG_INPUTS 13 -#define NUM_ANALOG_FIRST 112 +#define NUM_ANALOG_FIRST NUM_DIGITAL_PINS //#define ADC_RESOLUTION 12 diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/variant.h index 424538b3950f..22b919697027 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/variant.h @@ -141,10 +141,10 @@ extern "C" { #define PG15 111 //D79 // This must be a literal with the same value as PEND -#define NUM_DIGITAL_PINS 125 +#define NUM_DIGITAL_PINS 112 // This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS #define NUM_ANALOG_INPUTS 13 -#define NUM_ANALOG_FIRST 112 +#define NUM_ANALOG_FIRST NUM_DIGITAL_PINS //#define ADC_RESOLUTION 12 From 7f1c5ad7aa6dc437d3a76abf8a36cb971e1f424e Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sat, 9 Apr 2022 20:19:14 -0400 Subject: [PATCH 251/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20and=20clean=20up?= =?UTF-8?q?=20E3V2=20draw=20(#23979,=20#24013)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/common/dwin_api.cpp | 4 - Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 1 - .../lcd/e3v2/marlinui/ui_status_480x272.cpp | 128 ++++++++++-------- 3 files changed, 71 insertions(+), 62 deletions(-) diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.cpp b/Marlin/src/lcd/e3v2/common/dwin_api.cpp index 89d7cb41443b..63a75b89c8af 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.cpp +++ b/Marlin/src/lcd/e3v2/common/dwin_api.cpp @@ -235,7 +235,6 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis, // rlimit: To limit the drawn string length void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit/*=0xFFFF*/) { DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size)); - DWIN_UpdateLCD(); constexpr uint8_t widthAdjust = 0; size_t i = 0; DWIN_Byte(i, 0x11); @@ -250,7 +249,6 @@ void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, DWIN_Word(i, y); DWIN_Text(i, string, rlimit); DWIN_Send(i); - DWIN_UpdateLCD(); } // Draw a positive integer @@ -297,7 +295,6 @@ void DWIN_Draw_IntValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t #endif DWIN_Send(i); - DWIN_UpdateLCD(); } // Draw a floating point number @@ -332,7 +329,6 @@ void DWIN_Draw_FloatValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_ DWIN_Byte(i, fvalue[0]); */ DWIN_Send(i); - DWIN_UpdateLCD(); } // Draw a floating point number diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 4e0174705e53..1730e6832759 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -181,7 +181,6 @@ void MarlinUI::draw_status_message(const bool blink) { dwin_font.solid = true; dwin_font.fg = Color_White; dwin_font.bg = Color_Bg_Black; - DWIN_Draw_Box(1, Color_Bg_Black, 0, (LCD_PIXEL_HEIGHT - (STAT_FONT_HEIGHT) - 1), 272, STAT_FONT_HEIGHT + 1); lcd_moveto_xy(0, LCD_PIXEL_HEIGHT - (STAT_FONT_HEIGHT) - 1); constexpr uint8_t max_status_chars = (LCD_PIXEL_WIDTH) / (STAT_FONT_WIDTH); diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index c2948048c119..2a4909d921b6 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -193,11 +193,11 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x #define HOTEND_STATS 3 #elif HOTENDS > 1 #define HOTEND_STATS 2 - #elif HAS_HOTEND + #else #define HOTEND_STATS 1 #endif static celsius_t old_temp[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, 500), - old_target[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, 500); + old_target[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, 500); static bool old_on[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, false); #endif @@ -210,25 +210,27 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x #endif #if HAS_HOTEND && HAS_HEATED_BED + float tc, tt; + bool c_draw, t_draw, i_draw, ta; const bool isBed = heater < 0; - const float tc = isBed ? thermalManager.degBed() : thermalManager.degHotend(heater), - tt = isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater); - const bool ta = isBed ? thermalManager.isHeatingBed() : thermalManager.isHeatingHotend(heater); - - bool c_draw = tc != (isBed ? old_bed_temp : old_temp[heater]), - t_draw = tt != (isBed ? old_bed_target : old_target[heater]), - i_draw = ta != (isBed ? old_bed_on : old_on[heater]); - if (isBed) { - #if HAS_LEVELING - if (!i_draw && planner.leveling_active != old_leveling_on) i_draw = true; - old_leveling_on = planner.leveling_active; - #endif + tc = thermalManager.degBed(); + tt = thermalManager.degTargetBed(); + ta = thermalManager.isHeatingBed(); + c_draw = tc != old_bed_temp; + t_draw = tt != old_bed_target; + i_draw = ta != old_bed_on; old_bed_temp = tc; old_bed_target = tt; old_bed_on = ta; } else { + tc = thermalManager.degHotend(heater); + tt = thermalManager.degTargetHotend(heater); + ta = thermalManager.isHeatingHotend(heater); + c_draw = tc != old_temp[heater]; + t_draw = tt != old_target[heater]; + i_draw = ta != old_on[heater]; old_temp[heater] = tc; old_target[heater] = tt; old_on[heater] = ta; @@ -237,31 +239,41 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x constexpr bool isBed = false; const float tc = thermalManager.degHotend(heater), tt = thermalManager.degTargetHotend(heater); const uint8_t ta = thermalManager.isHeatingHotend(heater); - const bool c_draw = tc != old_bed_temp, t_draw = tt != old_bed_target, i_draw = ta != old_bed_on; + bool c_draw = tc != old_temp[heater], t_draw = tt != old_target[heater], i_draw = ta != old_on[heater]; old_temp[heater] = tc; old_target[heater] = tt; old_on[heater] = ta; #elif HAS_HEATED_BED constexpr bool isBed = true; const float tc = thermalManager.degBed(), tt = thermalManager.degTargetBed(); const uint8_t ta = thermalManager.isHeatingBed(); - bool c_draw = tc != old_temp[heater], t_draw = tt != old_target[heater], i_draw = ta != old_on[heater]; - #if HAS_LEVELING - if (!idraw && planner.leveling_active != old_leveling_on) i_draw = true; - old_leveling_on = tl; - #endif + bool c_draw = tc != old_bed_temp, t_draw = tt != old_bed_target, i_draw = ta != old_bed_on; old_bed_temp = tc; old_bed_target = tt; old_bed_on = ta; + #else + bool c_draw = false, t_draw = false, i_draw = false; + constexpr float tc = 0, tt = 0; + constexpr uint8_t ta = 0; #endif + #if HAS_HEATED_BED && HAS_LEVELING + if (isBed) { + i_draw |= (planner.leveling_active != old_leveling_on); + old_leveling_on = planner.leveling_active; + } + #endif + + // Draw target temperature, if needed if (!ui.did_first_redraw || t_draw) { dwin_string.set(i16tostr3rj(tt + 0.5)); dwin_string.add(LCD_STR_DEGREE); DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y, S(dwin_string.string())); } - if (!ui.did_first_redraw || i_draw){ + // Draw heater icon with on / off / leveled states + if (!ui.did_first_redraw || i_draw) { const uint8_t ico = isBed ? (TERN0(HAS_LEVELING, planner.leveling_active) ? ICON_BedLevelOff : ICON_BedOff) : ICON_HotendOff; DWIN_ICON_Show(ICON, ico + ta, x, y + STATUS_CHR_HEIGHT + 2); } + // Draw current temperature, if needed if (!ui.did_first_redraw || c_draw) { dwin_string.set(i16tostr3rj(tc + 0.5)); dwin_string.add(LCD_STR_DEGREE); @@ -412,43 +424,45 @@ void MarlinUI::draw_status_screen() { // // Progress Bar // - constexpr int16_t pb_margin = 5, - pb_left = pb_margin + TERN(DWIN_MARLINUI_PORTRAIT, 0, 90), - pb_height = TERN(DWIN_MARLINUI_PORTRAIT, 60, 20), - pb_right = LCD_PIXEL_WIDTH - pb_margin, - pb_bottom = TERN(DWIN_MARLINUI_PORTRAIT, 410, 220), - pb_top = pb_bottom - pb_height, - pb_width = pb_right - pb_left; - - const progress_t progress = TERN(HAS_PRINT_PROGRESS_PERMYRIAD, get_progress_permyriad, get_progress_percent)(); - - if (!ui.did_first_redraw) - DWIN_Draw_Rectangle(0, Select_Color, pb_left, pb_top, pb_right, pb_bottom); // Outline - - static uint16_t old_solid = 50; - const uint16_t pb_solid = (pb_width - 2) * (progress / (PROGRESS_SCALE)) * 0.01f; - const bool p_draw = !ui.did_first_redraw || old_solid != pb_solid; - - if (p_draw) { - //if (pb_solid) - DWIN_Draw_Rectangle(1, Select_Color, pb_left + 1, pb_top + 1, pb_left + pb_solid, pb_bottom - 1); // Fill the solid part - - //if (pb_solid < old_solid) - DWIN_Draw_Rectangle(1, Color_Bg_Black, pb_left + 1 + pb_solid, pb_top + 1, pb_right - 1, pb_bottom - 1); // Erase the rest - - #if ENABLED(SHOW_SD_PERCENT) - dwin_string.set(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(progress), ui8tostr3rj(progress / (PROGRESS_SCALE)))); - dwin_string.add(PSTR("%")); - DWIN_Draw_String( - false, font16x32, Percent_Color, Color_Bg_Black, - pb_left + (pb_width - dwin_string.length() * 16) / 2, - pb_top + (pb_height - 32) / 2, - S(dwin_string.string()) - ); - #endif + #if HAS_PRINT_PROGRESS + constexpr int16_t pb_margin = 5, + pb_left = pb_margin + TERN(DWIN_MARLINUI_PORTRAIT, 0, 90), + pb_height = TERN(DWIN_MARLINUI_PORTRAIT, 60, 20), + pb_right = LCD_PIXEL_WIDTH - pb_margin, + pb_bottom = TERN(DWIN_MARLINUI_PORTRAIT, 410, 220), + pb_top = pb_bottom - pb_height, + pb_width = pb_right - pb_left; + + const progress_t progress = TERN(HAS_PRINT_PROGRESS_PERMYRIAD, get_progress_permyriad, get_progress_percent)(); + + if (!ui.did_first_redraw) + DWIN_Draw_Rectangle(0, Select_Color, pb_left, pb_top, pb_right, pb_bottom); // Outline + + static uint16_t old_solid = 50; + const uint16_t pb_solid = (pb_width - 2) * (progress / (PROGRESS_SCALE)) * 0.01f; + const bool p_draw = !ui.did_first_redraw || old_solid != pb_solid; + + if (p_draw) { + //if (pb_solid) + DWIN_Draw_Rectangle(1, Select_Color, pb_left + 1, pb_top + 1, pb_left + pb_solid, pb_bottom - 1); // Fill the solid part + + //if (pb_solid < old_solid) + DWIN_Draw_Rectangle(1, Color_Bg_Black, pb_left + 1 + pb_solid, pb_top + 1, pb_right - 1, pb_bottom - 1); // Erase the rest + + #if ENABLED(SHOW_SD_PERCENT) + dwin_string.set(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(progress), ui8tostr3rj(progress / (PROGRESS_SCALE)))); + dwin_string.add(PSTR("%")); + DWIN_Draw_String( + false, font16x32, Percent_Color, Color_Bg_Black, + pb_left + (pb_width - dwin_string.length() * 16) / 2, + pb_top + (pb_height - 32) / 2, + S(dwin_string.string()) + ); + #endif - old_solid = pb_solid; - } + old_solid = pb_solid; + } + #endif // HAS_PRINT_PROGRESS // // Status Message From 27b148442826780c8fc4f7ab8c21608de21f0587 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Tue, 19 Apr 2022 15:03:42 +1200 Subject: [PATCH 252/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Manual=20Move=20co?= =?UTF-8?q?ld=20extrude=20override=20(#24045)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #19606 Co-authored-by: Scott Lahteine --- Marlin/src/lcd/menu/menu.cpp | 2 ++ Marlin/src/lcd/menu/menu_motion.cpp | 2 +- Marlin/src/module/temperature.cpp | 6 ++++++ Marlin/src/module/temperature.h | 10 +++++++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 52c43ec5e90f..bcdff450bd4c 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -28,6 +28,7 @@ #include "../../module/planner.h" #include "../../module/motion.h" #include "../../module/printcounter.h" +#include "../../module/temperature.h" #include "../../gcode/queue.h" #if HAS_BUZZER @@ -171,6 +172,7 @@ bool printer_busy() { */ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) { if (currentScreen != screen) { + thermalManager.set_menu_cold_override(false); TERN_(IS_DWIN_MARLINUI, did_first_redraw = false); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 0a446b1349e3..35b1bcad7040 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -219,7 +219,7 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int ui.goto_screen([]{ MenuItem_confirm::select_screen( GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BACK), - _goto_menu_move_distance_e, nullptr, + [] { _goto_menu_move_distance_e(); thermalManager.set_menu_cold_override(true); }, nullptr, GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!") ); }); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 6660d9a8f81c..89941fe1d1dc 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -482,6 +482,12 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); #endif #endif +#if BOTH(HAS_MARLINUI_MENU, PREVENT_COLD_EXTRUSION) && E_MANUAL > 0 + bool Temperature::allow_cold_extrude_override = false; +#else + constexpr bool Temperature::allow_cold_extrude_override; +#endif + #if ENABLED(PREVENT_COLD_EXTRUSION) bool Temperature::allow_cold_extrude = false; celsius_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP; diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index d1552d8f48cf..0358d32297b9 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -402,10 +402,18 @@ class Temperature { static uint8_t soft_pwm_controller_speed; #endif + #if BOTH(HAS_MARLINUI_MENU, PREVENT_COLD_EXTRUSION) && E_MANUAL > 0 + static bool allow_cold_extrude_override; + static void set_menu_cold_override(const bool allow) { allow_cold_extrude_override = allow; } + #else + static constexpr bool allow_cold_extrude_override = false; + static void set_menu_cold_override(const bool) {} + #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) static bool allow_cold_extrude; static celsius_t extrude_min_temp; - static bool tooCold(const celsius_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp - (TEMP_WINDOW); } + static bool tooCold(const celsius_t temp) { return !allow_cold_extrude && !allow_cold_extrude_override && temp < extrude_min_temp - (TEMP_WINDOW); } static bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); } static bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); } #else From 01c9c2666123f0959b02b757d2acd6adc18f4284 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Mon, 18 Apr 2022 03:46:58 -0700 Subject: [PATCH 253/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Pre?= =?UTF-8?q?heat=20menu=20improvements=20(#24017)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 2 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 500 ++++++--------------------- Marlin/src/lcd/e3v2/jyersui/dwin.h | 9 +- Marlin/src/lcd/menu/menu_ubl.cpp | 21 +- 4 files changed, 106 insertions(+), 426 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 051560981eff..73f6bbcdda31 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1884,7 +1884,7 @@ // @section temperature // -// Preheat Constants - Up to 5 are supported without changes +// Preheat Constants - Up to 6 are supported without changes // #define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 180 diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 3e777d4aaaed..dbf03aa0f342 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1012,10 +1012,62 @@ void CrealityDWINClass::Update_Status_Bar(bool refresh/*=false*/) { /* Menu Item Config */ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/*=true*/) { - uint8_t row = item - scrollpos; + const uint8_t row = item - scrollpos; #if HAS_LEVELING static bool level_state; #endif + + #if HAS_PREHEAT + + #define PREHEAT_BACK 0 + #define PREHEAT_SUBMENU_HOTEND (PREHEAT_BACK + ENABLED(HAS_HOTEND)) + #define PREHEAT_SUBMENU_BED (PREHEAT_SUBMENU_HOTEND + ENABLED(HAS_HEATED_BED)) + #define PREHEAT_SUBMENU_FAN (PREHEAT_SUBMENU_BED + ENABLED(HAS_FAN)) + #define PREHEAT_SUBMENU_TOTAL PREHEAT_SUBMENU_FAN + + auto preheat_submenu = [&](const int index, const uint8_t item, const uint8_t sel) { + switch (item) { + case PREHEAT_BACK: + if (draw) + Draw_Menu_Item(row, ICON_Back, F("Back")); + else + Draw_Menu(TempMenu, sel); + break; + #if HAS_HOTEND + case PREHEAT_SUBMENU_HOTEND: + if (draw) { + Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); + Draw_Float(ui.material_preset[index].hotend_temp, row, false, 1); + } + else + Modify_Value(ui.material_preset[index].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); + break; + #endif + #if HAS_HEATED_BED + case PREHEAT_SUBMENU_BED: + if (draw) { + Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); + Draw_Float(ui.material_preset[index].bed_temp, row, false, 1); + } + else + Modify_Value(ui.material_preset[index].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); + break; + #endif + #if HAS_FAN + case PREHEAT_SUBMENU_FAN: + if (draw) { + Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); + Draw_Float(ui.material_preset[index].fan_speed, row, false, 1); + } + else + Modify_Value(ui.material_preset[index].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); + break; + #endif + } + }; + + #endif + switch (menu) { case Prepare: @@ -1584,7 +1636,6 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_PREHEAT case Preheat: { - #define PREHEAT_BACK 0 #define PREHEAT_MODE (PREHEAT_BACK + 1) #define PREHEAT_1 (PREHEAT_MODE + 1) #define PREHEAT_2 (PREHEAT_1 + (PREHEAT_COUNT >= 2)) @@ -1606,6 +1657,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ else Draw_Menu(Prepare, PREPARE_PREHEAT); break; + case PREHEAT_MODE: if (draw) { Draw_Menu_Item(row, ICON_Homing, F("Preheat Mode")); @@ -1615,50 +1667,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ Modify_Option(preheatmode, preheat_modes, 2); break; - #if PREHEAT_COUNT >= 1 - case PREHEAT_1: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_1_LABEL)); - else - do_preheat(0); - break; - #endif - - #if PREHEAT_COUNT >= 2 - case PREHEAT_2: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_2_LABEL)); - else - do_preheat(1); - break; - #endif - - #if PREHEAT_COUNT >= 3 - case PREHEAT_3: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_3_LABEL)); - else - do_preheat(2); - break; - #endif - - #if PREHEAT_COUNT >= 4 - case PREHEAT_4: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_4_LABEL)); - else - do_preheat(3); - break; - #endif + #define _PREHEAT_CASE(N) \ + case PREHEAT_##N: { \ + if (draw) Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_## N ##_LABEL)); \ + else do_preheat(N - 1); \ + } break; - #if PREHEAT_COUNT >= 5 - case PREHEAT_5: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_5_LABEL)); - else - do_preheat(4); - break; - #endif + REPEAT_1(PREHEAT_COUNT, _PREHEAT_CASE) } } break; #endif // HAS_PREHEAT @@ -1871,46 +1886,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ Draw_Menu(PID); break; #endif - #if PREHEAT_COUNT >= 1 - case TEMP_PREHEAT1: - if (draw) - Draw_Menu_Item(row, ICON_Step, F(PREHEAT_1_LABEL), nullptr, true); - else - Draw_Menu(Preheat1); - break; - #endif - #if PREHEAT_COUNT >= 2 - case TEMP_PREHEAT2: - if (draw) - Draw_Menu_Item(row, ICON_Step, F(PREHEAT_2_LABEL), nullptr, true); - else - Draw_Menu(Preheat2); - break; - #endif - #if PREHEAT_COUNT >= 3 - case TEMP_PREHEAT3: - if (draw) - Draw_Menu_Item(row, ICON_Step, F(PREHEAT_3_LABEL), nullptr, true); - else - Draw_Menu(Preheat3); - break; - #endif - #if PREHEAT_COUNT >= 4 - case TEMP_PREHEAT4: - if (draw) - Draw_Menu_Item(row, ICON_Step, F(PREHEAT_4_LABEL), nullptr, true); - else - Draw_Menu(Preheat4); - break; - #endif - #if PREHEAT_COUNT >= 5 - case TEMP_PREHEAT5: - if (draw) - Draw_Menu_Item(row, ICON_Step, F(PREHEAT_5_LABEL), nullptr, true); - else - Draw_Menu(Preheat5); - break; - #endif + + #define _TEMP_PREHEAT_CASE(N) \ + case TEMP_PREHEAT##N: { \ + if (draw) Draw_Menu_Item(row, ICON_Step, F(PREHEAT_## N ##_LABEL), nullptr, true); \ + else Draw_Menu(Preheat##N); \ + } break; + + REPEAT_1(PREHEAT_COUNT, _TEMP_PREHEAT_CASE) } break; @@ -2095,255 +2078,10 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; #endif // HAS_HEATED_BED - #if PREHEAT_COUNT >= 1 - case Preheat1: - - #define PREHEAT1_BACK 0 - #define PREHEAT1_HOTEND (PREHEAT1_BACK + ENABLED(HAS_HOTEND)) - #define PREHEAT1_BED (PREHEAT1_HOTEND + ENABLED(HAS_HEATED_BED)) - #define PREHEAT1_FAN (PREHEAT1_BED + ENABLED(HAS_FAN)) - #define PREHEAT1_TOTAL PREHEAT1_FAN - - switch (item) { - case PREHEAT1_BACK: - if (draw) - Draw_Menu_Item(row, ICON_Back, F("Back")); - else - Draw_Menu(TempMenu, TEMP_PREHEAT1); - break; - #if HAS_HOTEND - case PREHEAT1_HOTEND: - if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); - Draw_Float(ui.material_preset[0].hotend_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[0].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); - break; - #endif - #if HAS_HEATED_BED - case PREHEAT1_BED: - if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); - Draw_Float(ui.material_preset[0].bed_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[0].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); - break; - #endif - #if HAS_FAN - case PREHEAT1_FAN: - if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); - Draw_Float(ui.material_preset[0].fan_speed, row, false, 1); - } - else - Modify_Value(ui.material_preset[0].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); - break; - #endif - } - break; - #endif // PREHEAT_COUNT >= 1 - - #if PREHEAT_COUNT >= 2 - case Preheat2: - - #define PREHEAT2_BACK 0 - #define PREHEAT2_HOTEND (PREHEAT2_BACK + ENABLED(HAS_HOTEND)) - #define PREHEAT2_BED (PREHEAT2_HOTEND + ENABLED(HAS_HEATED_BED)) - #define PREHEAT2_FAN (PREHEAT2_BED + ENABLED(HAS_FAN)) - #define PREHEAT2_TOTAL PREHEAT2_FAN - - switch (item) { - case PREHEAT2_BACK: - if (draw) - Draw_Menu_Item(row, ICON_Back, F("Back")); - else - Draw_Menu(TempMenu, TEMP_PREHEAT2); - break; - #if HAS_HOTEND - case PREHEAT2_HOTEND: - if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); - Draw_Float(ui.material_preset[1].hotend_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[1].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); - break; - #endif - #if HAS_HEATED_BED - case PREHEAT2_BED: - if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); - Draw_Float(ui.material_preset[1].bed_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[1].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); - break; - #endif - #if HAS_FAN - case PREHEAT2_FAN: - if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); - Draw_Float(ui.material_preset[1].fan_speed, row, false, 1); - } - else - Modify_Value(ui.material_preset[1].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); - break; - #endif - } - break; - #endif // PREHEAT_COUNT >= 2 - - #if PREHEAT_COUNT >= 3 - case Preheat3: - - #define PREHEAT3_BACK 0 - #define PREHEAT3_HOTEND (PREHEAT3_BACK + ENABLED(HAS_HOTEND)) - #define PREHEAT3_BED (PREHEAT3_HOTEND + ENABLED(HAS_HEATED_BED)) - #define PREHEAT3_FAN (PREHEAT3_BED + ENABLED(HAS_FAN)) - #define PREHEAT3_TOTAL PREHEAT3_FAN - - switch (item) { - case PREHEAT3_BACK: - if (draw) - Draw_Menu_Item(row, ICON_Back, F("Back")); - else - Draw_Menu(TempMenu, TEMP_PREHEAT3); - break; - #if HAS_HOTEND - case PREHEAT3_HOTEND: - if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); - Draw_Float(ui.material_preset[2].hotend_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[2].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); - break; - #endif - #if HAS_HEATED_BED - case PREHEAT3_BED: - if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); - Draw_Float(ui.material_preset[2].bed_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[2].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); - break; - #endif - #if HAS_FAN - case PREHEAT3_FAN: - if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); - Draw_Float(ui.material_preset[2].fan_speed, row, false, 1); - } - else - Modify_Value(ui.material_preset[2].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); - break; - #endif - } - break; - #endif // PREHEAT_COUNT >= 3 - - #if PREHEAT_COUNT >= 4 - case Preheat4: - - #define PREHEAT4_BACK 0 - #define PREHEAT4_HOTEND (PREHEAT4_BACK + ENABLED(HAS_HOTEND)) - #define PREHEAT4_BED (PREHEAT4_HOTEND + ENABLED(HAS_HEATED_BED)) - #define PREHEAT4_FAN (PREHEAT4_BED + ENABLED(HAS_FAN)) - #define PREHEAT4_TOTAL PREHEAT4_FAN - - switch (item) { - case PREHEAT4_BACK: - if (draw) - Draw_Menu_Item(row, ICON_Back, F("Back")); - else - Draw_Menu(TempMenu, TEMP_PREHEAT4); - break; - #if HAS_HOTEND - case PREHEAT4_HOTEND: - if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); - Draw_Float(ui.material_preset[3].hotend_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[3].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); - break; - #endif - #if HAS_HEATED_BED - case PREHEAT4_BED: - if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); - Draw_Float(ui.material_preset[3].bed_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[3].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); - break; - #endif - #if HAS_FAN - case PREHEAT4_FAN: - if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); - Draw_Float(ui.material_preset[3].fan_speed, row, false, 1); - } - else - Modify_Value(ui.material_preset[3].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); - break; - #endif - } - break; - #endif // PREHEAT_COUNT >= 4 - - #if PREHEAT_COUNT >= 5 - case Preheat5: - - #define PREHEAT5_BACK 0 - #define PREHEAT5_HOTEND (PREHEAT5_BACK + ENABLED(HAS_HOTEND)) - #define PREHEAT5_BED (PREHEAT5_HOTEND + ENABLED(HAS_HEATED_BED)) - #define PREHEAT5_FAN (PREHEAT5_BED + ENABLED(HAS_FAN)) - #define PREHEAT5_TOTAL PREHEAT5_FAN - - switch (item) { - case PREHEAT5_BACK: - if (draw) - Draw_Menu_Item(row, ICON_Back, F("Back")); - else - Draw_Menu(TempMenu, TEMP_PREHEAT5); - break; - #if HAS_HOTEND - case PREHEAT5_HOTEND: - if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); - Draw_Float(ui.material_preset[4].hotend_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[4].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); - break; - #endif - #if HAS_HEATED_BED - case PREHEAT5_BED: - if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); - Draw_Float(ui.material_preset[4].bed_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[4].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); - break; - #endif - #if HAS_FAN - case PREHEAT5_FAN: - if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); - Draw_Float(ui.material_preset[4].fan_speed, row, false, 1); - } - else - Modify_Value(ui.material_preset[4].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); - break; - #endif - } - break; - #endif // PREHEAT_COUNT >= 5 + #if HAS_PREHEAT + #define _PREHEAT_SUBMENU_CASE(N) case Preheat##N: preheat_submenu(N, item, TEMP_PREHEAT##N); break; + REPEAT_1(PREHEAT_COUNT, _PREHEAT_SUBMENU_CASE) + #endif case Motion: @@ -3855,7 +3593,9 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ } break; - case PreheatHotend: + #if HAS_PREHEAT && HAS_HOTEND + + case PreheatHotend: #define PREHEATHOTEND_BACK 0 #define PREHEATHOTEND_CONTINUE (PREHEATHOTEND_BACK + 1) @@ -3918,46 +3658,16 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ } } break; - #if PREHEAT_COUNT >= 1 - case PREHEATHOTEND_1: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_1_LABEL)); - else - ui.preheat_hotend_and_fan(0); - break; - #endif - #if PREHEAT_COUNT >= 2 - case PREHEATHOTEND_2: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_2_LABEL)); - else - ui.preheat_hotend_and_fan(1); - break; - #endif - #if PREHEAT_COUNT >= 3 - case PREHEATHOTEND_3: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_3_LABEL)); - else - ui.preheat_hotend_and_fan(2); - break; - #endif - #if PREHEAT_COUNT >= 4 - case PREHEATHOTEND_4: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_4_LABEL)); - else - ui.preheat_hotend_and_fan(3); - break; - #endif - #if PREHEAT_COUNT >= 5 - case PREHEATHOTEND_5: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_5_LABEL)); - else - ui.preheat_hotend_and_fan(4); + + + #define _PREHEAT_HOTEND_CASE(N) \ + case PREHEATHOTEND_##N: \ + if (draw) Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_## N ##_LABEL)); \ + else ui.preheat_hotend_and_fan((N) - 1); \ break; - #endif + + REPEAT_1(PREHEAT_COUNT, _PREHEAT_HOTEND_CASE) + case PREHEATHOTEND_CUSTOM: if (draw) { Draw_Menu_Item(row, ICON_Temperature, F("Custom")); @@ -3968,6 +3678,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; } break; + + #endif // HAS_PREHEAT && HAS_HOTEND } } @@ -3998,20 +3710,9 @@ FSTR_P CrealityDWINClass::Get_Menu_Title(uint8_t menu) { #if HAS_HEATED_BED case BedPID: return F("Bed PID Settings"); #endif - #if PREHEAT_COUNT >= 1 - case Preheat1: return F(PREHEAT_1_LABEL " Settings"); - #endif - #if PREHEAT_COUNT >= 2 - case Preheat2: return F(PREHEAT_2_LABEL " Settings"); - #endif - #if PREHEAT_COUNT >= 3 - case Preheat3: return F(PREHEAT_3_LABEL " Settings"); - #endif - #if PREHEAT_COUNT >= 4 - case Preheat4: return F(PREHEAT_4_LABEL " Settings"); - #endif - #if PREHEAT_COUNT >= 5 - case Preheat5: return F(PREHEAT_5_LABEL " Settings"); + #if HAS_PREHEAT + #define _PREHEAT_TITLE_CASE(N) case Preheat##N: return F(PREHEAT_## N ##_LABEL " Settings"); + REPEAT_1(PREHEAT_COUNT, _PREHEAT_TITLE_CASE) #endif case Motion: return F("Motion Settings"); case HomeOffsets: return F("Home Offsets"); @@ -4074,20 +3775,9 @@ uint8_t CrealityDWINClass::Get_Menu_Size(uint8_t menu) { #if HAS_HEATED_BED case BedPID: return BEDPID_TOTAL; #endif - #if PREHEAT_COUNT >= 1 - case Preheat1: return PREHEAT1_TOTAL; - #endif - #if PREHEAT_COUNT >= 2 - case Preheat2: return PREHEAT2_TOTAL; - #endif - #if PREHEAT_COUNT >= 3 - case Preheat3: return PREHEAT3_TOTAL; - #endif - #if PREHEAT_COUNT >= 4 - case Preheat4: return PREHEAT4_TOTAL; - #endif - #if PREHEAT_COUNT >= 5 - case Preheat5: return PREHEAT5_TOTAL; + #if HAS_PREHEAT + case Preheat1 ... CAT(Preheat, PREHEAT_COUNT): + return PREHEAT_SUBMENU_TOTAL; #endif case Motion: return MOTION_TOTAL; case HomeOffsets: return HOMEOFFSETS_TOTAL; @@ -4118,7 +3808,11 @@ uint8_t CrealityDWINClass::Get_Menu_Size(uint8_t menu) { case LevelManual: return LEVELING_M_TOTAL; #endif case Tune: return TUNE_TOTAL; - case PreheatHotend: return PREHEATHOTEND_TOTAL; + + #if HAS_PREHEAT && HAS_HOTEND + case PreheatHotend: return PREHEATHOTEND_TOTAL; + #endif + case ColorSettings: return COLORSETTINGS_TOTAL; } return 0; diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.h b/Marlin/src/lcd/e3v2/jyersui/dwin.h index 0157f673cef9..d238d8e24ffa 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.h +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.h @@ -60,11 +60,10 @@ enum menuID : uint8_t { PID, HotendPID, BedPID, - Preheat1, - Preheat2, - Preheat3, - Preheat4, - Preheat5, + #if HAS_PREHEAT + #define _PREHEAT_ID(N) Preheat##N, + REPEAT_1(PREHEAT_COUNT, _PREHEAT_ID) + #endif Motion, HomeOffsets, MaxSpeed, diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index c7ffd414cb7f..d324e057be62 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -211,26 +211,13 @@ void _lcd_ubl_edit_mesh() { #if HAS_PREHEAT #if HAS_HEATED_BED #define VALIDATE_MESH_GCODE_ITEM(M) \ - GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPI" STRINGIFY(M))) + GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPI" STRINGIFY(M))); #else #define VALIDATE_MESH_GCODE_ITEM(M) \ - GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPB0I" STRINGIFY(M))) + GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPB0I" STRINGIFY(M))); #endif - - VALIDATE_MESH_GCODE_ITEM(0); - #if PREHEAT_COUNT > 1 - VALIDATE_MESH_GCODE_ITEM(1); - #if PREHEAT_COUNT > 2 - VALIDATE_MESH_GCODE_ITEM(2); - #if PREHEAT_COUNT > 3 - VALIDATE_MESH_GCODE_ITEM(3); - #if PREHEAT_COUNT > 4 - VALIDATE_MESH_GCODE_ITEM(4); - #endif - #endif - #endif - #endif - #endif // HAS_PREHEAT + REPEAT(PREHEAT_COUNT, VALIDATE_MESH_GCODE_ITEM) + #endif ACTION_ITEM(MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); From 7b39604d6f58b46de18a41eb4a7de5058d9c4b35 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Mon, 4 Apr 2022 11:46:05 +1200 Subject: [PATCH 254/502] =?UTF-8?q?=F0=9F=8C=90=20Update=20Russian=20langu?= =?UTF-8?q?age=20(#23978)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/mks_ui/tft_Language_ru.h | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/Marlin/src/lcd/extui/mks_ui/tft_Language_ru.h b/Marlin/src/lcd/extui/mks_ui/tft_Language_ru.h index 12c600f0886e..da36ed14c771 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_Language_ru.h +++ b/Marlin/src/lcd/extui/mks_ui/tft_Language_ru.h @@ -24,9 +24,9 @@ //****************俄语***************************// #define TOOL_TEXT_RU "инструмент" #define PREHEAT_TEXT_RU " нагрев" -#define MOVE_TEXT_RU "движение" -#define HOME_TEXT_RU "домой" -#define PRINT_TEXT_RU " печать" +#define MOVE_TEXT_RU "двигать" +#define HOME_TEXT_RU "дом" +#define PRINT_TEXT_RU "печать" #define EXTRUDE_TEXT_RU "экструзия" #define LEVELING_TEXT_RU "уровень" #define AUTO_LEVELING_TEXT_RU "aвтоуровень" @@ -40,17 +40,17 @@ #define EXTRUDER_1_TEXT_RU "экструдер1" #define EXTRUDER_2_TEXT_RU "экструдер2" #define HEATBED_TEXT_RU "стол" -#define TEXT_1C_RU "1℃" -#define TEXT_5C_RU "5℃" -#define TEXT_10C_RU "10℃" +#define TEXT_1C_RU "1°Ц" +#define TEXT_5C_RU "5°Ц" +#define TEXT_10C_RU "10°Ц" #define CLOSE_TEXT_RU "выкл" #define BACK_TEXT_RU "назад" #define TOOL_PREHEAT_RU "нагрев" #define TOOL_EXTRUDE_RU "экструдер" -#define TOOL_MOVE_RU "движение" -#define TOOL_HOME_RU "домой" +#define TOOL_MOVE_RU "двигать" +#define TOOL_HOME_RU "дом" #define TOOL_LEVELING_RU "уровень" #define TOOL_AUTO_LEVELING_RU "aвтоуровень" #define TOOL_FILAMENT_RU "замена" @@ -62,33 +62,33 @@ #define AXIS_Y_DEC_TEXT_RU "Y -" #define AXIS_Z_ADD_TEXT_RU "Z +" #define AXIS_Z_DEC_TEXT_RU "Z -" -#define TEXT_01MM_RU "0.1 mm" -#define TEXT_1MM_RU "1 mm" -#define TEXT_10MM_RU "10 mm" +#define TEXT_01MM_RU "0.1 мм" +#define TEXT_1MM_RU "1 мм" +#define TEXT_10MM_RU "10 мм" #define HOME_X_TEXT_RU "X" #define HOME_Y_TEXT_RU "Y" #define HOME_Z_TEXT_RU "Z" -#define HOME_ALL_TEXT_RU "Home" -#define HOME_STOPMOVE_RU "Quickstop" +#define HOME_ALL_TEXT_RU "Дом" +#define HOME_STOPMOVE_RU "Концевик" #define PAGE_UP_TEXT_RU "вверх" #define PAGE_DOWN_TEXT_RU "вниз" #define EXTRUDER_IN_TEXT_RU "втянуть" #define EXTRUDER_OUT_TEXT_RU "выдавить" -#define EXTRUDE_1MM_TEXT_RU "1 mm" -#define EXTRUDE_5MM_TEXT_RU "5 mm" -#define EXTRUDE_10MM_TEXT_RU "10 mm" -#define EXTRUDE_LOW_SPEED_TEXT_RU "мин" -#define EXTRUDE_MEDIUM_SPEED_TEXT_RU "сред" -#define EXTRUDE_HIGH_SPEED_TEXT_RU "выс" - -#define LEVELING_POINT1_TEXT_RU "1 точка" -#define LEVELING_POINT2_TEXT_RU "2 точка" -#define LEVELING_POINT3_TEXT_RU "3 точка" -#define LEVELING_POINT4_TEXT_RU "4 точка" -#define LEVELING_POINT5_TEXT_RU "5 точка" +#define EXTRUDE_1MM_TEXT_RU "1 мм" +#define EXTRUDE_5MM_TEXT_RU "5 мм" +#define EXTRUDE_10MM_TEXT_RU "10 мм" +#define EXTRUDE_LOW_SPEED_TEXT_RU "минимум" +#define EXTRUDE_MEDIUM_SPEED_TEXT_RU "средний" +#define EXTRUDE_HIGH_SPEED_TEXT_RU "высокий" + +#define LEVELING_POINT1_TEXT_RU "Первая позиция" +#define LEVELING_POINT2_TEXT_RU "Вторая позиция" +#define LEVELING_POINT3_TEXT_RU "Третья позиция" +#define LEVELING_POINT4_TEXT_RU "Четвёртое позиция" +#define LEVELING_POINT5_TEXT_RU "Пятая позиция" #define FILESYS_TEXT_RU "система" #define WIFI_TEXT_RU "WiFi" @@ -115,7 +115,7 @@ #define WIFI_RECONNECT_TEXT_RU "выбор сети" #define CLOUD_TEXT_RU "облако" #define CLOUD_BIND_RU "соединён" -#define CLOUD_UNBIND_RU "отсоед." +#define CLOUD_UNBIND_RU "отсоединён" #define CLOUD_UNBINDING_RU "отвязано" #define CLOUD_DISCONNECTED_RU "отключено" #define CLOUD_UNBINDED_RU "несвяз." @@ -126,7 +126,7 @@ #define FAN_DEC_TEXT_RU "уменьшить" #define FAN_OPEN_TEXT_RU "100%" #define FAN_HALF_TEXT_RU "50%" -#define FAN_CLOSE_TEXT_RU "откл" +#define FAN_CLOSE_TEXT_RU "отключить" #define FAN_TIPS1_TEXT_RU "вентилятор" #define FAN_TIPS2_TEXT_RU "вентилятор\nоткл" @@ -156,7 +156,7 @@ #define PRE_HEAT_EXT_TEXT_RU "E" #define PRE_HEAT_BED_TEXT_RU "стол" -#define FILE_LOADING_RU "загрузка......" +#define FILE_LOADING_RU "загрузка" #define NO_FILE_AND_CHECK_RU "нет файла,попробуйте ещё раз!" #define NO_FILE_RU "нет файла!" @@ -170,11 +170,11 @@ #define ABOUT_VERSION_TEXT_RU "Firmware: " #define ABOUT_WIFI_TEXT_RU "WiFi: " -#define PRINTING_OPERATION_RU "опции" +#define PRINTING_OPERATION_RU "опций" #define PRINTING_PAUSE_RU "пауза" #define PRINTING_TEMP_RU "темп" -#define PRINTING_CHANGESPEED_RU "скорости" -#define PRINTING_RESUME_RU "возобн. " +#define PRINTING_CHANGESPEED_RU "скорост" +#define PRINTING_RESUME_RU "возобновить" #define PRINTING_STOP_RU "стоп" #define PRINTING_MORE_RU "больше" #define PRINTING_EXTRUDER_RU "экстр" @@ -222,8 +222,8 @@ #define DIALOG_RETRY_RU "повтор" #define DIALOG_DISABLE_RU "запретить" #define DIALOG_PRINT_MODEL_RU "печать модели?" -#define DIALOG_CANCEL_PRINT_RU "стоп?" -#define DIALOG_STOP_RU "стоп" +#define DIALOG_CANCEL_PRINT_RU "Остановить?" +#define DIALOG_STOP_RU "Остановить" #define DIALOG_REPRINT_FROM_BREAKPOINT_RU "продолжить?" #define DIALOG_ERROR_TIPS1_RU "ошибка:нет файла, попробуйте ещё раз." #define DIALOG_ERROR_TIPS2_RU "ошибка:сбой передачи. установите скорость \nпередачи данных как на плате управления!" @@ -236,8 +236,8 @@ #define DIALOG_REPRINT_RU "Print again" #define DIALOG_WIFI_ENABLE_TIPS_RU "The wifi module is being configured,\nplease wait a moment....." -#define MESSAGE_PAUSING_RU "Стоянка..." -#define MESSAGE_CHANGING_RU "Подождите, пока начнется смена филамента" +#define MESSAGE_PAUSING_RU "Пауза" +#define MESSAGE_CHANGING_RU "Подождите" #define MESSAGE_UNLOAD_RU "Дождитесь выгрузки нити" #define MESSAGE_WAITING_RU "Нажмите кнопку,чтобы возобновить печать" #define MESSAGE_INSERT_RU "Вставьте нить и нажмите кнопку,чтобы продолжить" @@ -250,7 +250,7 @@ #define MESSAGE_PURGE_MORE_RU "чистка" #define MESSAGE_CONTINUE_PRINT_RU "Распечатать" #define EEPROM_SETTINGS_TITLE_RU "Настройки EEPROM" -#define EEPROM_SETTINGS_STORE_RU "Cохранение настроек в EEPROM" +#define EEPROM_SETTINGS_STORE_RU "Cохранить настройки в EEPROM" #define EEPROM_SETTINGS_READ_RU "Чтение настроек из EEPROM" #define EEPROM_SETTINGS_REVERT_RU "Bосстановить заводские настройки по умолчанию" @@ -272,7 +272,7 @@ #define DISABLE_RU "нет" #define KEY_CONFIRM_RU "OK" -#define MACHINE_PARA_TITLE_RU "настройки" +#define MACHINE_PARA_TITLE_RU "Настройки" #define MACHINE_TYPE_CNOFIG_RU "Hастройки принтера" #define MOTOR_CONFIG_RU "Hастройки моторов" #define MACHINE_LEVELING_CONFIG_RU "Hастройки уровня" From 54e543872be13439523cecb6b670b7b4bf818164 Mon Sep 17 00:00:00 2001 From: LPRtypeCN <1297207734@qq.com> Date: Sun, 10 Apr 2022 19:19:12 +0800 Subject: [PATCH 255/502] =?UTF-8?q?=F0=9F=8C=90=20Update=20Chinese=20langu?= =?UTF-8?q?age=20(#23865)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_zh_CN.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index fb6d43491776..e947cee661b1 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -55,6 +55,7 @@ namespace Language_zh_CN { LSTR MSG_DISABLE_STEPPERS = _UxGT("关闭步进电机"); // "Disable steppers" LSTR MSG_DEBUG_MENU = _UxGT("调试菜单"); // "Debug Menu" LSTR MSG_PROGRESS_BAR_TEST = _UxGT("进度条测试"); // "Progress Bar Test" + LSTR MSG_HOMING = _UxGT("回原点"); LSTR MSG_AUTO_HOME = _UxGT("自动回原点"); // "Auto home" LSTR MSG_AUTO_HOME_X = _UxGT("回X原位"); // "Home X" LSTR MSG_AUTO_HOME_Y = _UxGT("回Y原位"); // "Home Y" @@ -92,8 +93,8 @@ namespace Language_zh_CN { LSTR MSG_SPINDLE_MENU = _UxGT("主轴控制"); LSTR MSG_SPINDLE_POWER = _UxGT("主轴电源"); LSTR MSG_SPINDLE_REVERSE = _UxGT("主轴反转"); - LSTR MSG_SWITCH_PS_ON = _UxGT("电源打开"); // "Switch power on" - LSTR MSG_SWITCH_PS_OFF = _UxGT("电源关闭"); // "Switch power off" + LSTR MSG_SWITCH_PS_ON = _UxGT("开启电源"); // "Switch power on" + LSTR MSG_SWITCH_PS_OFF = _UxGT("关闭电源"); // "Switch power off" LSTR MSG_EXTRUDE = _UxGT("挤出"); // "Extrude" LSTR MSG_RETRACT = _UxGT("回抽"); // "Retract" LSTR MSG_MOVE_AXIS = _UxGT("移动轴"); // "Move axis" From 995221e68e15693697fc7f10dfc31273ea188157 Mon Sep 17 00:00:00 2001 From: Stephen Hawes Date: Thu, 5 May 2022 03:37:47 -0400 Subject: [PATCH 256/502] =?UTF-8?q?=E2=9C=A8=20Add=20M3426=20A=20par?= =?UTF-8?q?ameter=20(#24130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/feature/adc/adc_mcp3426.cpp | 6 +++--- Marlin/src/feature/adc/adc_mcp3426.h | 5 +---- Marlin/src/gcode/feature/adc/M3426.cpp | 15 ++++++++++----- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Marlin/src/feature/adc/adc_mcp3426.cpp b/Marlin/src/feature/adc/adc_mcp3426.cpp index aaddf46821b0..49bb67ef6d5c 100644 --- a/Marlin/src/feature/adc/adc_mcp3426.cpp +++ b/Marlin/src/feature/adc/adc_mcp3426.cpp @@ -34,7 +34,7 @@ #include "adc_mcp3426.h" // Read the ADC value from MCP342X on a specific channel -int16_t MCP3426::ReadValue(uint8_t channel, uint8_t gain) { +int16_t MCP3426::ReadValue(uint8_t channel, uint8_t gain, uint8_t address) { Error = false; #if PINS_EXIST(I2C_SCL, I2C_SDA) && DISABLED(SOFT_I2C_EEPROM) @@ -44,7 +44,7 @@ int16_t MCP3426::ReadValue(uint8_t channel, uint8_t gain) { Wire.begin(); // No address joins the BUS as the master - Wire.beginTransmission(I2C_ADDRESS(MCP342X_ADC_I2C_ADDRESS)); + Wire.beginTransmission(I2C_ADDRESS(address)); // Continuous Conversion Mode, 16 bit, Channel 1, Gain x4 // 26 = 0b00011000 @@ -75,7 +75,7 @@ int16_t MCP3426::ReadValue(uint8_t channel, uint8_t gain) { uint8_t buffer[len] = {}; do { - Wire.requestFrom(I2C_ADDRESS(MCP342X_ADC_I2C_ADDRESS), len); + Wire.requestFrom(I2C_ADDRESS(address), len); if (Wire.available() != len) { Error = true; return 0; diff --git a/Marlin/src/feature/adc/adc_mcp3426.h b/Marlin/src/feature/adc/adc_mcp3426.h index 35458716b975..af48593369e1 100644 --- a/Marlin/src/feature/adc/adc_mcp3426.h +++ b/Marlin/src/feature/adc/adc_mcp3426.h @@ -29,12 +29,9 @@ #include #include -// Address of MCP342X chip -#define MCP342X_ADC_I2C_ADDRESS 104 - class MCP3426 { public: - int16_t ReadValue(uint8_t channel, uint8_t gain); + int16_t ReadValue(uint8_t channel, uint8_t gain, uint8_t address); bool Error; }; diff --git a/Marlin/src/gcode/feature/adc/M3426.cpp b/Marlin/src/gcode/feature/adc/M3426.cpp index 8205fa01f2bd..2820c8b88093 100644 --- a/Marlin/src/gcode/feature/adc/M3426.cpp +++ b/Marlin/src/gcode/feature/adc/M3426.cpp @@ -28,6 +28,8 @@ #include "../../../feature/adc/adc_mcp3426.h" +#define MCP3426_BASE_ADDR (0b1101 << 3) + /** * M3426: Read 16 bit (signed) value from I2C MCP3426 ADC device * @@ -36,12 +38,15 @@ * M3426 I 0 or 1, invert reply */ void GcodeSuite::M3426() { - uint8_t channel = parser.byteval('C', 1), // Select the channel 1 or 2 - gain = parser.byteval('G', 1); - const bool inverted = parser.byteval('I') == 1; + uint8_t channel = parser.byteval('C', 1), // Channel 1 or 2 + gain = parser.byteval('G', 1), // Gain 1, 2, 4, or 8 + address = parser.byteval('A', 3); // Address 0-7 (or 104-111) + const bool inverted = parser.boolval('I'); + + if (address <= 7) address += MCP3426_BASE_ADDR; - if (channel <= 2 && (gain == 1 || gain == 2 || gain == 4 || gain == 8)) { - int16_t result = mcp3426.ReadValue(channel, gain); + if (WITHIN(channel, 1, 2) && (gain == 1 || gain == 2 || gain == 4 || gain == 8) && WITHIN(address, MCP3426_BASE_ADDR, MCP3426_BASE_ADDR + 7)) { + int16_t result = mcp3426.ReadValue(channel, gain, address); if (mcp3426.Error == false) { if (inverted) { From b0d621d8b96fffda485efa45e61a68126613a766 Mon Sep 17 00:00:00 2001 From: John Robertson Date: Mon, 4 Apr 2022 00:47:55 +0100 Subject: [PATCH 257/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Def?= =?UTF-8?q?ine=20isr=5Ffloat=5Ft=20to=20assert=20a=20non-FPU=20float=20(#2?= =?UTF-8?q?3969)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/HAL/AVR/HAL.h | 2 +- Marlin/src/HAL/DUE/HAL.h | 2 +- Marlin/src/HAL/ESP32/HAL.cpp | 3 ++- Marlin/src/HAL/ESP32/HAL.h | 3 ++- Marlin/src/HAL/LPC1768/HAL.h | 2 +- Marlin/src/HAL/NATIVE_SIM/HAL.h | 2 +- Marlin/src/HAL/SAMD51/HAL.h | 2 +- Marlin/src/HAL/STM32/HAL.h | 4 +++- Marlin/src/HAL/STM32F1/HAL.h | 2 +- Marlin/src/HAL/TEENSY31_32/HAL.h | 2 +- Marlin/src/HAL/TEENSY35_36/HAL.h | 2 +- Marlin/src/HAL/TEENSY40_41/HAL.h | 2 +- Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp | 8 ++++---- 13 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index e825b4def3af..c7454a523477 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -229,7 +229,7 @@ class MarlinHAL { SBI(DIDR0, ch); } - // Begin ADC sampling on the given channel + // Begin ADC sampling on the given channel. Called from Temperature::isr! static void adc_start(const uint8_t ch) { #ifdef MUX5 ADCSRB = ch > 7 ? _BV(MUX5) : 0; diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index 9a02c9a0dcf5..d00c4d3da102 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -209,7 +209,7 @@ class MarlinHAL { // Called by Temperature::init for each sensor at startup static void adc_enable(const uint8_t ch) {} - // Begin ADC sampling on the given channel + // Begin ADC sampling on the given channel. Called from Temperature::isr! static void adc_start(const uint8_t ch) { adc_result = analogRead(ch); } // Is the ADC ready for reading? diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index 44be0b540afe..fbb3eac0db17 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -244,7 +244,8 @@ void MarlinHAL::adc_start(const pin_t pin) { const adc1_channel_t chan = get_channel(pin); uint32_t mv; esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv); - adc_result = mv * 1023.0f / float(ADC_REFERENCE_VOLTAGE) / 1000.0f; + + adc_result = mv * isr_float_t(1023) / isr_float_t(ADC_REFERENCE_VOLTAGE) / isr_float_t(1000); // Change the attenuation level based on the new reading adc_atten_t atten; diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index 8b26c3471d39..f7e4383a85f4 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -74,6 +74,7 @@ // Types // ------------------------ +typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs. typedef int16_t pin_t; class Servo; @@ -205,7 +206,7 @@ class MarlinHAL { // Called by Temperature::init for each sensor at startup static void adc_enable(const pin_t pin) {} - // Begin ADC sampling on the given channel + // Begin ADC sampling on the given pin. Called from Temperature::isr! static void adc_start(const pin_t pin); // Is the ADC ready for reading? diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index eefacae99549..0f26509129d5 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -234,7 +234,7 @@ class MarlinHAL { FilteredADC::enable_channel(pin); } - // Begin ADC sampling on the given pin + // Begin ADC sampling on the given pin. Called from Temperature::isr! static uint32_t adc_result; static void adc_start(const pin_t pin) { adc_result = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits diff --git a/Marlin/src/HAL/NATIVE_SIM/HAL.h b/Marlin/src/HAL/NATIVE_SIM/HAL.h index ee2e31fc7fa4..49a5b6ea560b 100644 --- a/Marlin/src/HAL/NATIVE_SIM/HAL.h +++ b/Marlin/src/HAL/NATIVE_SIM/HAL.h @@ -242,7 +242,7 @@ class MarlinHAL { // Called by Temperature::init for each sensor at startup static void adc_enable(const uint8_t ch); - // Begin ADC sampling on the given channel + // Begin ADC sampling on the given channel. Called from Temperature::isr! static void adc_start(const uint8_t ch); // Is the ADC ready for reading? diff --git a/Marlin/src/HAL/SAMD51/HAL.h b/Marlin/src/HAL/SAMD51/HAL.h index 3b09a885a53b..abcc28098776 100644 --- a/Marlin/src/HAL/SAMD51/HAL.h +++ b/Marlin/src/HAL/SAMD51/HAL.h @@ -190,7 +190,7 @@ class MarlinHAL { // Called by Temperature::init for each sensor at startup static void adc_enable(const uint8_t ch) {} - // Begin ADC sampling on the given channel + // Begin ADC sampling on the given pin. Called from Temperature::isr! static void adc_start(const pin_t pin); // Is the ADC ready for reading? diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index f5e8c1187da7..d88342b889b5 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -127,6 +127,8 @@ // Types // ------------------------ +typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs. + #ifdef STM32G0B1xx typedef int32_t pin_t; #else @@ -241,7 +243,7 @@ class MarlinHAL { // Called by Temperature::init for each sensor at startup static void adc_enable(const pin_t pin) { pinMode(pin, INPUT); } - // Begin ADC sampling on the given channel + // Begin ADC sampling on the given pin. Called from Temperature::isr! static void adc_start(const pin_t pin) { adc_result = analogRead(pin); } // Is the ADC ready for reading? diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index ceb17b48848b..a42dd89b8d27 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -280,7 +280,7 @@ class MarlinHAL { // Called by Temperature::init for each sensor at startup static void adc_enable(const pin_t pin) { pinMode(pin, INPUT_ANALOG); } - // Begin ADC sampling on the given channel + // Begin ADC sampling on the given pin. Called from Temperature::isr! static void adc_start(const pin_t pin); // Is the ADC ready for reading? diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.h b/Marlin/src/HAL/TEENSY31_32/HAL.h index 50c0f411cf92..dc0d2d3fa939 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/TEENSY31_32/HAL.h @@ -166,7 +166,7 @@ class MarlinHAL { // Called by Temperature::init for each sensor at startup static void adc_enable(const pin_t ch) {} - // Begin ADC sampling on the given channel + // Begin ADC sampling on the given channel. Called from Temperature::isr! static void adc_start(const pin_t ch); // Is the ADC ready for reading? diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.h b/Marlin/src/HAL/TEENSY35_36/HAL.h index e4c57f8d1e10..c45f2aa49307 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/TEENSY35_36/HAL.h @@ -173,7 +173,7 @@ class MarlinHAL { // Called by Temperature::init for each sensor at startup static void adc_enable(const pin_t) {} - // Begin ADC sampling on the given channel + // Begin ADC sampling on the given pin. Called from Temperature::isr! static void adc_start(const pin_t pin); // Is the ADC ready for reading? diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index a21e65285409..ea874da2faea 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -195,7 +195,7 @@ class MarlinHAL { // Called by Temperature::init for each sensor at startup static void adc_enable(const pin_t pin) {} - // Begin ADC sampling on the given channel + // Begin ADC sampling on the given pin. Called from Temperature::isr! static void adc_start(const pin_t pin); // Is the ADC ready for reading? diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index 2a4909d921b6..ba6814a57a10 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -196,13 +196,13 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x #else #define HOTEND_STATS 1 #endif - static celsius_t old_temp[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, 500), - old_target[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, 500); - static bool old_on[HOTEND_STATS] = ARRAY_N_1(HOTEND_STATS, false); + static celsius_t old_temp[HOTEND_STATS] = { 0 }, + old_target[HOTEND_STATS] = { 0 }; + static bool old_on[HOTEND_STATS] = { false }; #endif #if HAS_HEATED_BED - static celsius_t old_bed_temp = 500, old_bed_target = 500; + static celsius_t old_bed_temp = 0, old_bed_target = 0; static bool old_bed_on = false; #if HAS_LEVELING static bool old_leveling_on = false; From 4ec9af42b8e24cf6ce9f238c9342bc1c11120429 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 29 Mar 2022 03:38:25 -0500 Subject: [PATCH 258/502] =?UTF-8?q?=F0=9F=92=A5=20Rename=20ExtUI=20setting?= =?UTF-8?q?s=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp | 4 ++-- Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp | 4 ++-- Marlin/src/lcd/extui/dgus/dgus_extui.cpp | 4 ++-- Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp | 4 ++-- Marlin/src/lcd/extui/example/example.cpp | 4 ++-- Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp | 4 ++-- Marlin/src/lcd/extui/malyan/malyan_extui.cpp | 4 ++-- Marlin/src/lcd/extui/nextion/nextion_extui.cpp | 5 +++-- Marlin/src/lcd/extui/ui_api.h | 4 ++-- Marlin/src/module/printcounter.cpp | 2 +- Marlin/src/module/settings.cpp | 4 ++-- 11 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp index b9fe8f967c0d..75061c162a7a 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp @@ -94,12 +94,12 @@ namespace ExtUI { // Called after loading or resetting stored settings } - void onConfigurationStoreWritten(bool success) { + void onSettingsStored(bool success) { // Called after the entire EEPROM has been written, // whether successful or not. } - void onConfigurationStoreRead(bool success) { + void onSettingsLoaded(bool success) { // Called after the entire EEPROM has been read, // whether successful or not. } diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp index da8f4e26a0ff..469202ee222b 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp @@ -83,12 +83,12 @@ namespace ExtUI { // Called after loading or resetting stored settings } - void onConfigurationStoreWritten(bool success) { + void onSettingsStored(bool success) { // Called after the entire EEPROM has been written, // whether successful or not. } - void onConfigurationStoreRead(bool success) { + void onSettingsLoaded(bool success) { // Called after the entire EEPROM has been read, // whether successful or not. } diff --git a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp index 0041be82769f..b041687a14fa 100644 --- a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp +++ b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp @@ -102,12 +102,12 @@ namespace ExtUI { // Called after loading or resetting stored settings } - void onConfigurationStoreWritten(bool success) { + void onSettingsStored(bool success) { // Called after the entire EEPROM has been written, // whether successful or not. } - void onConfigurationStoreRead(bool success) { + void onSettingsLoaded(bool success) { // Called after the entire EEPROM has been read, // whether successful or not. } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp index 5c330bd6b472..f6f2c0f89df9 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp @@ -100,11 +100,11 @@ namespace ExtUI { void onPostprocessSettings() {} - void onConfigurationStoreWritten(bool success) { + void onSettingsStored(bool success) { dgus_screen_handler.ConfigurationStoreWritten(success); } - void onConfigurationStoreRead(bool success) { + void onSettingsLoaded(bool success) { dgus_screen_handler.ConfigurationStoreRead(success); } diff --git a/Marlin/src/lcd/extui/example/example.cpp b/Marlin/src/lcd/extui/example/example.cpp index dd0f8e401e91..6ef20cf5f0f3 100644 --- a/Marlin/src/lcd/extui/example/example.cpp +++ b/Marlin/src/lcd/extui/example/example.cpp @@ -88,12 +88,12 @@ namespace ExtUI { // Called after loading or resetting stored settings } - void onConfigurationStoreWritten(bool success) { + void onSettingsStored(bool success) { // Called after the entire EEPROM has been written, // whether successful or not. } - void onConfigurationStoreRead(bool success) { + void onSettingsLoaded(bool success) { // Called after the entire EEPROM has been read, // whether successful or not. } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp index 1c7b3621f2b4..2ce9ed027e86 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp @@ -97,7 +97,7 @@ namespace ExtUI { void onLoadSettings(const char *buff) { InterfaceSettingsScreen::loadSettings(buff); } void onPostprocessSettings() {} // Called after loading or resetting stored settings - void onConfigurationStoreWritten(bool success) { + void onSettingsStored(bool success) { #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE if (success && InterfaceSettingsScreen::backupEEPROM()) { SERIAL_ECHOLNPGM("EEPROM backed up to SPI Flash"); @@ -106,7 +106,7 @@ namespace ExtUI { UNUSED(success); #endif } - void onConfigurationStoreRead(bool) {} + void onSettingsLoaded(bool) {} void onPlayTone(const uint16_t frequency, const uint16_t duration) { sound.play_tone(frequency, duration); } diff --git a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp index 2d36a4e737dc..945ff472e1a1 100644 --- a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp @@ -147,8 +147,8 @@ namespace ExtUI { void onStoreSettings(char*) {} void onLoadSettings(const char*) {} void onPostprocessSettings() {} - void onConfigurationStoreWritten(bool) {} - void onConfigurationStoreRead(bool) {} + void onSettingsStored(bool) {} + void onSettingsLoaded(bool) {} #if HAS_MESH void onLevelingStart() {} diff --git a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp index c15175a28d9a..da54fac38349 100644 --- a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp +++ b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp @@ -79,12 +79,12 @@ namespace ExtUI { // Called after loading or resetting stored settings } - void onConfigurationStoreWritten(bool success) { + void onSettingsStored(bool success) { // Called after the entire EEPROM has been written, // whether successful or not. } - void onConfigurationStoreRead(bool success) { + void onSettingsLoaded(bool success) { // Called after the entire EEPROM has been read, // whether successful or not. } @@ -117,6 +117,7 @@ namespace ExtUI { void onSteppersDisabled() {} void onSteppersEnabled() {} + } #endif // NEXTION_TFT diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 248bffb6f4ad..84b2ed8c6d70 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -420,8 +420,8 @@ namespace ExtUI { void onStoreSettings(char *); void onLoadSettings(const char *); void onPostprocessSettings(); - void onConfigurationStoreWritten(bool success); - void onConfigurationStoreRead(bool success); + void onSettingsStored(bool success); + void onSettingsLoaded(bool success); #if ENABLED(POWER_LOSS_RECOVERY) void onPowerLossResume(); #endif diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index d05a47957250..619fbc137ce4 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -177,7 +177,7 @@ void PrintCounter::saveStats() { persistentStore.write_data(address + sizeof(uint8_t), (uint8_t*)&data, sizeof(printStatistics)); persistentStore.access_finish(); - TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreWritten(true)); + TERN_(EXTENSIBLE_UI, ExtUI::onSettingsStored(true)); } #if HAS_SERVICE_INTERVALS diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 6e373f6132f4..ef6b8a12d787 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1595,7 +1595,7 @@ void MarlinSettings::postprocess() { TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_SETTINGS_STORED))); } - TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreWritten(!eeprom_error)); + TERN_(EXTENSIBLE_UI, ExtUI::onSettingsStored(!eeprom_error)); return !eeprom_error; } @@ -2598,7 +2598,7 @@ void MarlinSettings::postprocess() { bool MarlinSettings::load() { if (validate()) { const bool success = _load(); - TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreRead(success)); + TERN_(EXTENSIBLE_UI, ExtUI::onSettingsLoaded(success)); return success; } reset(); From 74565890f335f26fa7012d0164eb2964c0f2918d Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Fri, 1 Apr 2022 03:13:16 +0100 Subject: [PATCH 259/502] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20and=20f?= =?UTF-8?q?ix=20ABL=20Bilinear=20(#23868,=20#24009,=20#24107)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/utility.cpp | 2 +- Marlin/src/feature/bedlevel/abl/abl.h | 45 ------- .../feature/bedlevel/abl/{abl.cpp => bbl.cpp} | 124 ++++++++++-------- Marlin/src/feature/bedlevel/abl/bbl.h | 73 +++++++++++ Marlin/src/feature/bedlevel/bedlevel.cpp | 19 +-- Marlin/src/feature/bedlevel/bedlevel.h | 4 +- .../bedlevel/mbl/mesh_bed_leveling.cpp | 4 +- Marlin/src/gcode/bedlevel/M420.cpp | 14 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 41 +++--- Marlin/src/gcode/bedlevel/abl/M421.cpp | 6 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- .../extui/dgus_reloaded/DGUSScreenHandler.cpp | 5 +- .../extui/dgus_reloaded/DGUSScreenHandler.h | 2 +- Marlin/src/module/motion.cpp | 2 +- Marlin/src/module/planner.cpp | 4 +- Marlin/src/module/settings.cpp | 31 +++-- 16 files changed, 210 insertions(+), 168 deletions(-) delete mode 100644 Marlin/src/feature/bedlevel/abl/abl.h rename Marlin/src/feature/bedlevel/abl/{abl.cpp => bbl.cpp} (78%) create mode 100644 Marlin/src/feature/bedlevel/abl/bbl.h diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index 59e59d4cb7ff..4e16e2693a4d 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -135,7 +135,7 @@ void safe_delay(millis_t ms) { const float rz = ubl.get_z_correction(current_position); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) SERIAL_ECHOPGM("ABL Adjustment Z"); - const float rz = bilinear_z_offset(current_position); + const float rz = bbl.get_z_correction(current_position); #endif SERIAL_ECHO(ftostr43sign(rz, '+')); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) diff --git a/Marlin/src/feature/bedlevel/abl/abl.h b/Marlin/src/feature/bedlevel/abl/abl.h deleted file mode 100644 index 3d54c55695e8..000000000000 --- a/Marlin/src/feature/bedlevel/abl/abl.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include "../../../inc/MarlinConfigPre.h" - -extern xy_pos_t bilinear_grid_spacing, bilinear_start; -extern xy_float_t bilinear_grid_factor; -extern bed_mesh_t z_values; -float bilinear_z_offset(const xy_pos_t &raw); - -void extrapolate_unprobed_bed_level(); -void print_bilinear_leveling_grid(); -void refresh_bed_level(); -#if ENABLED(ABL_BILINEAR_SUBDIVISION) - void print_bilinear_leveling_grid_virt(); - void bed_level_virt_interpolate(); -#endif - -#if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - void bilinear_line_to_destination(const_feedRate_t scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF); -#endif - -#define _GET_MESH_X(I) float(bilinear_start.x + (I) * bilinear_grid_spacing.x) -#define _GET_MESH_Y(J) float(bilinear_start.y + (J) * bilinear_grid_spacing.y) -#define Z_VALUES_ARR z_values diff --git a/Marlin/src/feature/bedlevel/abl/abl.cpp b/Marlin/src/feature/bedlevel/abl/bbl.cpp similarity index 78% rename from Marlin/src/feature/bedlevel/abl/abl.cpp rename to Marlin/src/feature/bedlevel/abl/bbl.cpp index ece748198195..9dcd66912893 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.cpp +++ b/Marlin/src/feature/bedlevel/abl/bbl.cpp @@ -35,14 +35,19 @@ #include "../../../lcd/extui/ui_api.h" #endif -xy_pos_t bilinear_grid_spacing, bilinear_start; -xy_float_t bilinear_grid_factor; -bed_mesh_t z_values; +LevelingBilinear bbl; + +xy_pos_t LevelingBilinear::grid_spacing, + LevelingBilinear::grid_start; +xy_float_t LevelingBilinear::grid_factor; +bed_mesh_t LevelingBilinear::z_values; +xy_pos_t LevelingBilinear::cached_rel; +xy_int8_t LevelingBilinear::cached_g; /** * Extrapolate a single point from its neighbors */ -static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) { +void LevelingBilinear::extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) { if (!isnan(z_values[x][y])) return; if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM("Extrapolate ["); @@ -92,11 +97,26 @@ static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t #endif #endif +void LevelingBilinear::reset() { + grid_start.reset(); + grid_spacing.reset(); + GRID_LOOP(x, y) { + z_values[x][y] = NAN; + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, 0)); + } +} + +void LevelingBilinear::set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _grid_start) { + grid_spacing = _grid_spacing; + grid_start = _grid_start; + grid_factor = grid_spacing.reciprocal(); +} + /** * Fill in the unprobed points (corners of circular print surface) * using linear extrapolation, away from the center. */ -void extrapolate_unprobed_bed_level() { +void LevelingBilinear::extrapolate_unprobed_bed_level() { #ifdef HALF_IN_X constexpr uint8_t ctrx2 = 0, xend = GRID_MAX_POINTS_X - 1; #else @@ -131,35 +151,31 @@ void extrapolate_unprobed_bed_level() { #endif extrapolate_one_point(x2, y2, -1, -1); // right-above - - } - } -void print_bilinear_leveling_grid() { +void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values /*= NULL*/) { + // print internal grid(s) or just the one passed as a parameter SERIAL_ECHOLNPGM("Bilinear Leveling Grid:"); - print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, - [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; } - ); + print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, _z_values ? *_z_values[0] : z_values[0]); + + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + if (!_z_values) { + SERIAL_ECHOLNPGM("Subdivided with CATMULL ROM Leveling Grid:"); + print_2d_array(ABL_GRID_POINTS_VIRT_X, ABL_GRID_POINTS_VIRT_Y, 5, z_values_virt[0]); + } + #endif } #if ENABLED(ABL_BILINEAR_SUBDIVISION) - #define ABL_GRID_POINTS_VIRT_X GRID_MAX_CELLS_X * (BILINEAR_SUBDIVISIONS) + 1 - #define ABL_GRID_POINTS_VIRT_Y GRID_MAX_CELLS_Y * (BILINEAR_SUBDIVISIONS) + 1 #define ABL_TEMP_POINTS_X (GRID_MAX_POINTS_X + 2) #define ABL_TEMP_POINTS_Y (GRID_MAX_POINTS_Y + 2) - float z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y]; - xy_pos_t bilinear_grid_spacing_virt; - xy_float_t bilinear_grid_factor_virt; - - void print_bilinear_leveling_grid_virt() { - SERIAL_ECHOLNPGM("Subdivided with CATMULL ROM Leveling Grid:"); - print_2d_array(ABL_GRID_POINTS_VIRT_X, ABL_GRID_POINTS_VIRT_Y, 5, - [](const uint8_t ix, const uint8_t iy) { return z_values_virt[ix][iy]; } - ); - } + float LevelingBilinear::z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y]; + xy_pos_t LevelingBilinear::grid_spacing_virt; + xy_float_t LevelingBilinear::grid_factor_virt; #define LINEAR_EXTRAPOLATION(E, I) ((E) * 2 - (I)) - float bed_level_virt_coord(const uint8_t x, const uint8_t y) { + float LevelingBilinear::bed_level_virt_coord(const uint8_t x, const uint8_t y) { uint8_t ep = 0, ip = 1; if (x > (GRID_MAX_POINTS_X) + 1 || y > (GRID_MAX_POINTS_Y) + 1) { // The requested point requires extrapolating two points beyond the mesh. @@ -204,7 +220,7 @@ void print_bilinear_leveling_grid() { return z_values[x - 1][y - 1]; } - static float bed_level_virt_cmr(const float p[4], const uint8_t i, const float t) { + float LevelingBilinear::bed_level_virt_cmr(const float p[4], const uint8_t i, const float t) { return ( p[i-1] * -t * sq(1 - t) + p[i] * (2 - 5 * sq(t) + 3 * t * sq(t)) @@ -213,7 +229,7 @@ void print_bilinear_leveling_grid() { ) * 0.5f; } - static float bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const_float_t tx, const_float_t ty) { + float LevelingBilinear::bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const_float_t tx, const_float_t ty) { float row[4], column[4]; LOOP_L_N(i, 4) { LOOP_L_N(j, 4) { @@ -224,9 +240,9 @@ void print_bilinear_leveling_grid() { return bed_level_virt_cmr(row, 1, tx); } - void bed_level_virt_interpolate() { - bilinear_grid_spacing_virt = bilinear_grid_spacing / (BILINEAR_SUBDIVISIONS); - bilinear_grid_factor_virt = bilinear_grid_spacing_virt.reciprocal(); + void LevelingBilinear::bed_level_virt_interpolate() { + grid_spacing_virt = grid_spacing / (BILINEAR_SUBDIVISIONS); + grid_factor_virt = grid_spacing_virt.reciprocal(); LOOP_L_N(y, GRID_MAX_POINTS_Y) LOOP_L_N(x, GRID_MAX_POINTS_X) LOOP_L_N(ty, BILINEAR_SUBDIVISIONS) @@ -244,38 +260,40 @@ void print_bilinear_leveling_grid() { } #endif // ABL_BILINEAR_SUBDIVISION + // Refresh after other values have been updated -void refresh_bed_level() { - bilinear_grid_factor = bilinear_grid_spacing.reciprocal(); +void LevelingBilinear::refresh_bed_level() { TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); + cached_rel.x = cached_rel.y = -999.999; + cached_g.x = cached_g.y = -99; } #if ENABLED(ABL_BILINEAR_SUBDIVISION) - #define ABL_BG_SPACING(A) bilinear_grid_spacing_virt.A - #define ABL_BG_FACTOR(A) bilinear_grid_factor_virt.A + #define ABL_BG_SPACING(A) grid_spacing_virt.A + #define ABL_BG_FACTOR(A) grid_factor_virt.A #define ABL_BG_POINTS_X ABL_GRID_POINTS_VIRT_X #define ABL_BG_POINTS_Y ABL_GRID_POINTS_VIRT_Y #define ABL_BG_GRID(X,Y) z_values_virt[X][Y] #else - #define ABL_BG_SPACING(A) bilinear_grid_spacing.A - #define ABL_BG_FACTOR(A) bilinear_grid_factor.A + #define ABL_BG_SPACING(A) grid_spacing.A + #define ABL_BG_FACTOR(A) grid_factor.A #define ABL_BG_POINTS_X GRID_MAX_POINTS_X #define ABL_BG_POINTS_Y GRID_MAX_POINTS_Y #define ABL_BG_GRID(X,Y) z_values[X][Y] #endif // Get the Z adjustment for non-linear bed leveling -float bilinear_z_offset(const xy_pos_t &raw) { +float LevelingBilinear::get_z_correction(const xy_pos_t &raw) { static float z1, d2, z3, d4, L, D; - static xy_pos_t prev { -999.999, -999.999 }, ratio; + static xy_pos_t ratio; // Whole units for the grid line indices. Constrained within bounds. - static xy_int8_t thisg, nextg, lastg { -99, -99 }; + static xy_int8_t thisg, nextg; // XY relative to the probed area - xy_pos_t rel = raw - bilinear_start.asFloat(); + xy_pos_t rel = raw - grid_start.asFloat(); #if ENABLED(EXTRAPOLATE_BEYOND_GRID) #define FAR_EDGE_OR_BOX 2 // Keep using the last grid box @@ -283,8 +301,8 @@ float bilinear_z_offset(const xy_pos_t &raw) { #define FAR_EDGE_OR_BOX 1 // Just use the grid far edge #endif - if (prev.x != rel.x) { - prev.x = rel.x; + if (cached_rel.x != rel.x) { + cached_rel.x = rel.x; ratio.x = rel.x * ABL_BG_FACTOR(x); const float gx = constrain(FLOOR(ratio.x), 0, ABL_BG_POINTS_X - (FAR_EDGE_OR_BOX)); ratio.x -= gx; // Subtract whole to get the ratio within the grid box @@ -298,10 +316,10 @@ float bilinear_z_offset(const xy_pos_t &raw) { nextg.x = _MIN(thisg.x + 1, ABL_BG_POINTS_X - 1); } - if (prev.y != rel.y || lastg.x != thisg.x) { + if (cached_rel.y != rel.y || cached_g.x != thisg.x) { - if (prev.y != rel.y) { - prev.y = rel.y; + if (cached_rel.y != rel.y) { + cached_rel.y = rel.y; ratio.y = rel.y * ABL_BG_FACTOR(y); const float gy = constrain(FLOOR(ratio.y), 0, ABL_BG_POINTS_Y - (FAR_EDGE_OR_BOX)); ratio.y -= gy; @@ -315,8 +333,8 @@ float bilinear_z_offset(const xy_pos_t &raw) { nextg.y = _MIN(thisg.y + 1, ABL_BG_POINTS_Y - 1); } - if (lastg != thisg) { - lastg = thisg; + if (cached_g != thisg) { + cached_g = thisg; // Z at the box corners z1 = ABL_BG_GRID(thisg.x, thisg.y); // left-front d2 = ABL_BG_GRID(thisg.x, nextg.y) - z1; // left-back (delta) @@ -336,8 +354,8 @@ float bilinear_z_offset(const xy_pos_t &raw) { /* static float last_offset = 0; if (ABS(last_offset - offset) > 0.2) { - SERIAL_ECHOLNPGM("Sudden Shift at x=", rel.x, " / ", bilinear_grid_spacing.x, " -> thisg.x=", thisg.x); - SERIAL_ECHOLNPGM(" y=", rel.y, " / ", bilinear_grid_spacing.y, " -> thisg.y=", thisg.y); + SERIAL_ECHOLNPGM("Sudden Shift at x=", rel.x, " / ", grid_spacing.x, " -> thisg.x=", thisg.x); + SERIAL_ECHOLNPGM(" y=", rel.y, " / ", grid_spacing.y, " -> thisg.y=", thisg.y); SERIAL_ECHOLNPGM(" ratio.x=", ratio.x, " ratio.y=", ratio.y); SERIAL_ECHOLNPGM(" z1=", z1, " z2=", z2, " z3=", z3, " z4=", z4); SERIAL_ECHOLNPGM(" L=", L, " R=", R, " offset=", offset); @@ -350,13 +368,13 @@ float bilinear_z_offset(const xy_pos_t &raw) { #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - #define CELL_INDEX(A,V) ((V - bilinear_start.A) * ABL_BG_FACTOR(A)) + #define CELL_INDEX(A,V) ((V - grid_start.A) * ABL_BG_FACTOR(A)) /** * Prepare a bilinear-leveled linear move on Cartesian, * splitting the move where it crosses grid borders. */ - void bilinear_line_to_destination(const_feedRate_t scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) { + void LevelingBilinear::line_to_destination(const_feedRate_t scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) { // Get current and destination cells for this line xy_int_t c1 { CELL_INDEX(x, current_position.x), CELL_INDEX(y, current_position.y) }, c2 { CELL_INDEX(x, destination.x), CELL_INDEX(y, destination.y) }; @@ -384,7 +402,7 @@ float bilinear_z_offset(const xy_pos_t &raw) { // Split on the X grid line CBI(x_splits, gc.x); end = destination; - destination.x = bilinear_start.x + ABL_BG_SPACING(x) * gc.x; + destination.x = grid_start.x + ABL_BG_SPACING(x) * gc.x; normalized_dist = (destination.x - current_position.x) / (end.x - current_position.x); destination.y = LINE_SEGMENT_END(y); } @@ -393,7 +411,7 @@ float bilinear_z_offset(const xy_pos_t &raw) { // Split on the Y grid line CBI(y_splits, gc.y); end = destination; - destination.y = bilinear_start.y + ABL_BG_SPACING(y) * gc.y; + destination.y = grid_start.y + ABL_BG_SPACING(y) * gc.y; normalized_dist = (destination.y - current_position.y) / (end.y - current_position.y); destination.x = LINE_SEGMENT_END(x); } @@ -409,11 +427,11 @@ float bilinear_z_offset(const xy_pos_t &raw) { destination.e = LINE_SEGMENT_END(e); // Do the split and look for more borders - bilinear_line_to_destination(scaled_fr_mm_s, x_splits, y_splits); + line_to_destination(scaled_fr_mm_s, x_splits, y_splits); // Restore destination from stack destination = end; - bilinear_line_to_destination(scaled_fr_mm_s, x_splits, y_splits); + line_to_destination(scaled_fr_mm_s, x_splits, y_splits); } #endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES diff --git a/Marlin/src/feature/bedlevel/abl/bbl.h b/Marlin/src/feature/bedlevel/abl/bbl.h new file mode 100644 index 000000000000..fbdb22cd00c9 --- /dev/null +++ b/Marlin/src/feature/bedlevel/abl/bbl.h @@ -0,0 +1,73 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "../../../inc/MarlinConfigPre.h" + +class LevelingBilinear { +private: + static xy_pos_t grid_spacing, grid_start; + static xy_float_t grid_factor; + static bed_mesh_t z_values; + static xy_pos_t cached_rel; + static xy_int8_t cached_g; + + static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); + + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + #define ABL_GRID_POINTS_VIRT_X (GRID_MAX_CELLS_X * (BILINEAR_SUBDIVISIONS) + 1) + #define ABL_GRID_POINTS_VIRT_Y (GRID_MAX_CELLS_Y * (BILINEAR_SUBDIVISIONS) + 1) + + static float z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y]; + static xy_pos_t grid_spacing_virt; + static xy_float_t grid_factor_virt; + + static float bed_level_virt_coord(const uint8_t x, const uint8_t y); + static float bed_level_virt_cmr(const float p[4], const uint8_t i, const float t); + static float bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const_float_t tx, const_float_t ty); + static void bed_level_virt_interpolate(); + #endif + +public: + static void reset(); + static void set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _grid_start); + static void extrapolate_unprobed_bed_level(); + static void print_leveling_grid(const bed_mesh_t* _z_values = NULL); + static void refresh_bed_level(); + static bool has_mesh() { return !!grid_spacing.x; } + static bed_mesh_t& get_z_values() { return z_values; } + static const xy_pos_t& get_grid_spacing() { return grid_spacing; } + static const xy_pos_t& get_grid_start() { return grid_start; } + static float get_mesh_x(int16_t i) { return grid_start.x + i * grid_spacing.x; } + static float get_mesh_y(int16_t j) { return grid_start.y + j * grid_spacing.y; } + static float get_z_correction(const xy_pos_t &raw); + + #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) + static void line_to_destination(const_feedRate_t scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF); + #endif +}; + +extern LevelingBilinear bbl; + +#define _GET_MESH_X(I) bbl.get_mesh_x(I) +#define _GET_MESH_Y(J) bbl.get_mesh_y(J) +#define Z_VALUES_ARR bbl.get_z_values() diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 8e03632de44d..2405905d4e65 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -48,7 +48,7 @@ bool leveling_is_valid() { return TERN1(MESH_BED_LEVELING, mbl.has_mesh()) - && TERN1(AUTO_BED_LEVELING_BILINEAR, !!bilinear_grid_spacing.x) + && TERN1(AUTO_BED_LEVELING_BILINEAR, bbl.has_mesh()) && TERN1(AUTO_BED_LEVELING_UBL, ubl.mesh_is_valid()); } @@ -67,12 +67,6 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { planner.synchronize(); - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - // Force bilinear_z_offset to re-calculate next time - const xyz_pos_t reset { -9999.999, -9999.999, 0 }; - (void)bilinear_z_offset(reset); - #endif - if (planner.leveling_active) { // leveling from on to off if (DEBUGGING(LEVELING)) DEBUG_POS("Leveling ON", current_position); // change unleveled current_position to physical current_position without moving steppers. @@ -129,12 +123,7 @@ void reset_bed_level() { #if ENABLED(MESH_BED_LEVELING) mbl.reset(); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_start.reset(); - bilinear_grid_spacing.reset(); - GRID_LOOP(x, y) { - z_values[x][y] = NAN; - TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, 0)); - } + bbl.reset(); #elif ABL_PLANAR planner.bed_level_matrix.set_to_identity(); #endif @@ -156,7 +145,7 @@ void reset_bed_level() { /** * Print calibration results for plotting or manual frame adjustment. */ - void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, element_2d_fn fn) { + void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, const float *values) { #ifndef SCAD_MESH_OUTPUT LOOP_L_N(x, sx) { serial_spaces(precision + (x < 10 ? 3 : 2)); @@ -176,7 +165,7 @@ void reset_bed_level() { #endif LOOP_L_N(x, sx) { SERIAL_CHAR(' '); - const float offset = fn(x, y); + const float offset = values[x * sx + y]; if (!isnan(offset)) { if (offset >= 0) SERIAL_CHAR('+'); SERIAL_ECHO_F(offset, int(precision)); diff --git a/Marlin/src/feature/bedlevel/bedlevel.h b/Marlin/src/feature/bedlevel/bedlevel.h index 63f032eee87b..f295da1d037a 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.h +++ b/Marlin/src/feature/bedlevel/bedlevel.h @@ -62,7 +62,7 @@ class TemporaryBedLevelingState { typedef float bed_mesh_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - #include "abl/abl.h" + #include "abl/bbl.h" #elif ENABLED(AUTO_BED_LEVELING_UBL) #include "ubl/ubl.h" #elif ENABLED(MESH_BED_LEVELING) @@ -81,7 +81,7 @@ class TemporaryBedLevelingState { /** * Print calibration results for plotting or manual frame adjustment. */ - void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, element_2d_fn fn); + void print_2d_array(const uint8_t sx, const uint8_t sy, const uint8_t precision, const float *values); #endif diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp index 51cf28f89005..fbc3f2785e14 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp @@ -125,9 +125,7 @@ void mesh_bed_leveling::report_mesh() { SERIAL_ECHOPAIR_F(STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh. Z offset: ", z_offset, 5); SERIAL_ECHOLNPGM("\nMeasured points:"); - print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5, - [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; } - ); + print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5, z_values[0]); } #endif // MESH_BED_LEVELING diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index 3c23e85a1dfb..c8325b1fc5c1 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -67,14 +67,17 @@ void GcodeSuite::M420() { const float x_min = probe.min_x(), x_max = probe.max_x(), y_min = probe.min_y(), y_max = probe.max_y(); #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_start.set(x_min, y_min); - bilinear_grid_spacing.set((x_max - x_min) / (GRID_MAX_CELLS_X), - (y_max - y_min) / (GRID_MAX_CELLS_Y)); + xy_pos_t start, spacing; + start.set(x_min, y_min); + spacing.set((x_max - x_min) / (GRID_MAX_CELLS_X), + (y_max - y_min) / (GRID_MAX_CELLS_Y)); + bbl.set_grid(spacing, start); #endif GRID_LOOP(x, y) { Z_VALUES(x, y) = 0.001 * random(-200, 200); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y))); } + TERN_(AUTO_BED_LEVELING_BILINEAR, bbl.refresh_bed_level()); SERIAL_ECHOPGM("Simulated " STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh "); SERIAL_ECHOPGM(" (", x_min); SERIAL_CHAR(','); SERIAL_ECHO(y_min); @@ -178,7 +181,7 @@ void GcodeSuite::M420() { Z_VALUES(x, y) -= zmean; TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y))); } - TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); + TERN_(AUTO_BED_LEVELING_BILINEAR, bbl.refresh_bed_level()); } #endif @@ -199,8 +202,7 @@ void GcodeSuite::M420() { #else if (leveling_is_valid()) { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - print_bilinear_leveling_grid(); - TERN_(ABL_BILINEAR_SUBDIVISION, print_bilinear_leveling_grid_virt()); + bbl.print_leveling_grid(); #elif ENABLED(MESH_BED_LEVELING) SERIAL_ECHOLNPGM("Mesh Bed Level data:"); mbl.report_mesh(); diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 4f7d052c9553..dea457937440 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -124,6 +124,7 @@ class G29_State { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) float Z_offset; + bed_mesh_t z_values; #endif #if ENABLED(AUTO_BED_LEVELING_LINEAR) @@ -308,8 +309,8 @@ G29_TYPE GcodeSuite::G29() { if (!isnan(rx) && !isnan(ry)) { // Get nearest i / j from rx / ry - i = (rx - bilinear_start.x + 0.5 * abl.gridSpacing.x) / abl.gridSpacing.x; - j = (ry - bilinear_start.y + 0.5 * abl.gridSpacing.y) / abl.gridSpacing.y; + i = (rx - bbl.get_grid_start().x) / bbl.get_grid_spacing().x + 0.5f; + j = (ry - bbl.get_grid_start().y) / bbl.get_grid_spacing().y + 0.5f; LIMIT(i, 0, (GRID_MAX_POINTS_X) - 1); LIMIT(j, 0, (GRID_MAX_POINTS_Y) - 1); } @@ -318,8 +319,8 @@ G29_TYPE GcodeSuite::G29() { if (WITHIN(i, 0, (GRID_MAX_POINTS_X) - 1) && WITHIN(j, 0, (GRID_MAX_POINTS_Y) - 1)) { set_bed_leveling_enabled(false); - z_values[i][j] = rz; - TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); + Z_VALUES_ARR[i][j] = rz; + bbl.refresh_bed_level(); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(i, j, rz)); set_bed_leveling_enabled(abl.reenable); if (abl.reenable) report_current_position(); @@ -451,19 +452,19 @@ G29_TYPE GcodeSuite::G29() { #endif #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - if (TERN1(PROBE_MANUALLY, !no_action) - && (abl.gridSpacing != bilinear_grid_spacing || abl.probe_position_lf != bilinear_start) + if (!abl.dryrun + && (abl.gridSpacing != bbl.get_grid_spacing() || abl.probe_position_lf != bbl.get_grid_start()) ) { // Reset grid to 0.0 or "not probed". (Also disables ABL) reset_bed_level(); - // Initialize a grid with the given dimensions - bilinear_grid_spacing = abl.gridSpacing; - bilinear_start = abl.probe_position_lf; - // Can't re-enable (on error) until the new grid is written abl.reenable = false; } + + // Pre-populate local Z values from the stored mesh + TERN_(IS_KINEMATIC, COPY(abl.z_values, Z_VALUES_ARR)); + #endif // AUTO_BED_LEVELING_BILINEAR } // !g29_in_progress @@ -531,7 +532,7 @@ G29_TYPE GcodeSuite::G29() { #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) const float newz = abl.measured_z + abl.Z_offset; - z_values[abl.meshCount.x][abl.meshCount.y] = newz; + abl.z_values[abl.meshCount.x][abl.meshCount.y] = newz; TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(abl.meshCount, newz)); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM_P(PSTR("Save X"), abl.meshCount.x, SP_Y_STR, abl.meshCount.y, SP_Z_STR, abl.measured_z + abl.Z_offset); @@ -680,7 +681,7 @@ G29_TYPE GcodeSuite::G29() { #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) const float z = abl.measured_z + abl.Z_offset; - z_values[abl.meshCount.x][abl.meshCount.y] = z; + abl.z_values[abl.meshCount.x][abl.meshCount.y] = z; TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(abl.meshCount, z)); #endif @@ -751,12 +752,16 @@ G29_TYPE GcodeSuite::G29() { if (!isnan(abl.measured_z)) { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - if (!abl.dryrun) extrapolate_unprobed_bed_level(); - print_bilinear_leveling_grid(); - - refresh_bed_level(); + if (abl.dryrun) + bbl.print_leveling_grid(&abl.z_values); + else { + bbl.set_grid(abl.gridSpacing, abl.probe_position_lf); + COPY(Z_VALUES_ARR, abl.z_values); + TERN_(IS_KINEMATIC, bbl.extrapolate_unprobed_bed_level()); + bbl.refresh_bed_level(); - TERN_(ABL_BILINEAR_SUBDIVISION, print_bilinear_leveling_grid_virt()); + bbl.print_leveling_grid(); + } #elif ENABLED(AUTO_BED_LEVELING_LINEAR) @@ -876,7 +881,7 @@ G29_TYPE GcodeSuite::G29() { // Unapply the offset because it is going to be immediately applied // and cause compensation movement in Z const float fade_scaling_factor = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.fade_scaling_factor_for_z(current_position.z), 1); - current_position.z -= fade_scaling_factor * bilinear_z_offset(current_position); + current_position.z -= fade_scaling_factor * bbl.get_z_correction(current_position); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(" corrected Z:", current_position.z); } diff --git a/Marlin/src/gcode/bedlevel/abl/M421.cpp b/Marlin/src/gcode/bedlevel/abl/M421.cpp index 182dc32515b6..0c12268cb109 100644 --- a/Marlin/src/gcode/bedlevel/abl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/abl/M421.cpp @@ -58,11 +58,11 @@ void GcodeSuite::M421() { sy = iy >= 0 ? iy : 0, ey = iy >= 0 ? iy : GRID_MAX_POINTS_Y - 1; LOOP_S_LE_N(x, sx, ex) { LOOP_S_LE_N(y, sy, ey) { - z_values[x][y] = zval + (hasQ ? z_values[x][y] : 0); - TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y])); + Z_VALUES_ARR[x][y] = zval + (hasQ ? Z_VALUES_ARR[x][y] : 0); + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, Z_VALUES_ARR[x][y])); } } - TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); + bbl.refresh_bed_level(); } else SERIAL_ERROR_MSG(STR_ERR_MESH_XY); diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index dbf03aa0f342..fbd56c1c0f4f 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -3155,7 +3155,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ Draw_Menu_Item(row, ICON_Back, F("Back")); else { set_bed_leveling_enabled(level_state); - TERN_(AUTO_BED_LEVELING_BILINEAR, refresh_bed_level()); + TERN_(AUTO_BED_LEVELING_BILINEAR, bbl.refresh_bed_level()); Draw_Menu(Leveling, LEVELING_MANUAL); } break; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 6388e1683d05..0b584fac3bce 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -200,7 +200,7 @@ void DGUSScreenHandler::StoreSettings(char *buff) { data.initialized = true; data.volume = dgus_display.GetVolume(); data.brightness = dgus_display.GetBrightness(); - data.abl = (ExtUI::getLevelingActive() && ExtUI::getMeshValid()); + data.abl_okay = (ExtUI::getLevelingActive() && ExtUI::getMeshValid()); memcpy(buff, &data, sizeof(data)); } @@ -216,8 +216,7 @@ void DGUSScreenHandler::LoadSettings(const char *buff) { dgus_display.SetBrightness(data.initialized ? data.brightness : DGUS_DEFAULT_BRIGHTNESS); if (data.initialized) { - leveling_active = (data.abl && ExtUI::getMeshValid()); - + leveling_active = (data.abl_okay && ExtUI::getMeshValid()); ExtUI::setLevelingActive(leveling_active); } } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h index 509d59920066..cc59bda6d7fa 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h @@ -134,7 +134,7 @@ class DGUSScreenHandler { bool initialized; uint8_t volume; uint8_t brightness; - bool abl; + bool abl_okay; } eeprom_data_t; }; diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index d2fb9d95d01c..4650765ae15a 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1074,7 +1074,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { #if ENABLED(MESH_BED_LEVELING) mbl.line_to_destination(scaled_fr_mm_s); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_line_to_destination(scaled_fr_mm_s); + bbl.line_to_destination(scaled_fr_mm_s); #endif return true; } diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index a3caa199c1c4..8c723aa06e80 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1591,7 +1591,7 @@ void Planner::check_axes_activity() { #elif ENABLED(AUTO_BED_LEVELING_UBL) fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0 #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 + fade_scaling_factor ? fade_scaling_factor * bbl.get_z_correction(raw) : 0.0 #endif ); @@ -1624,7 +1624,7 @@ void Planner::check_axes_activity() { #elif ENABLED(AUTO_BED_LEVELING_UBL) fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0 #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bilinear_z_offset(raw) : 0.0 + fade_scaling_factor ? fade_scaling_factor * bbl.get_z_correction(raw) : 0.0 #endif ); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index ef6b8a12d787..27c5d450d8a0 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -597,7 +597,7 @@ void MarlinSettings::postprocess() { TERN_(ENABLE_LEVELING_FADE_HEIGHT, set_z_fade_height(new_z_fade_height, false)); // false = no report - TERN_(AUTO_BED_LEVELING_BILINEAR, refresh_bed_level()); + TERN_(AUTO_BED_LEVELING_BILINEAR, bbl.refresh_bed_level()); TERN_(HAS_MOTOR_CURRENT_PWM, stepper.refresh_motor_power()); @@ -876,22 +876,26 @@ void MarlinSettings::postprocess() { { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) static_assert( - sizeof(z_values) == (GRID_MAX_POINTS) * sizeof(z_values[0][0]), + sizeof(Z_VALUES_ARR) == (GRID_MAX_POINTS) * sizeof(Z_VALUES_ARR[0][0]), "Bilinear Z array is the wrong size." ); - #else - const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0}; #endif const uint8_t grid_max_x = TERN(AUTO_BED_LEVELING_BILINEAR, GRID_MAX_POINTS_X, 3), grid_max_y = TERN(AUTO_BED_LEVELING_BILINEAR, GRID_MAX_POINTS_Y, 3); EEPROM_WRITE(grid_max_x); EEPROM_WRITE(grid_max_y); - EEPROM_WRITE(bilinear_grid_spacing); - EEPROM_WRITE(bilinear_start); + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + EEPROM_WRITE(bbl.get_grid_spacing()); + EEPROM_WRITE(bbl.get_grid_start()); + #else + const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0}; + EEPROM_WRITE(bilinear_grid_spacing); + EEPROM_WRITE(bilinear_start); + #endif #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - EEPROM_WRITE(z_values); // 9-256 floats + EEPROM_WRITE(Z_VALUES_ARR); // 9-256 floats #else dummyf = 0; for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_WRITE(dummyf); @@ -1791,20 +1795,19 @@ void MarlinSettings::postprocess() { uint8_t grid_max_x, grid_max_y; EEPROM_READ_ALWAYS(grid_max_x); // 1 byte EEPROM_READ_ALWAYS(grid_max_y); // 1 byte + xy_pos_t spacing, start; + EEPROM_READ(spacing); // 2 ints + EEPROM_READ(start); // 2 ints #if ENABLED(AUTO_BED_LEVELING_BILINEAR) if (grid_max_x == (GRID_MAX_POINTS_X) && grid_max_y == (GRID_MAX_POINTS_Y)) { if (!validating) set_bed_leveling_enabled(false); - EEPROM_READ(bilinear_grid_spacing); // 2 ints - EEPROM_READ(bilinear_start); // 2 ints - EEPROM_READ(z_values); // 9 to 256 floats + bbl.set_grid(spacing, start); + EEPROM_READ(Z_VALUES_ARR); // 9 to 256 floats } else // EEPROM data is stale #endif // AUTO_BED_LEVELING_BILINEAR { // Skip past disabled (or stale) Bilinear Grid data - xy_pos_t bgs, bs; - EEPROM_READ(bgs); - EEPROM_READ(bs); for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_READ(dummyf); } } @@ -3337,7 +3340,7 @@ void MarlinSettings::reset() { LOOP_L_N(px, GRID_MAX_POINTS_X) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" G29 W I", px, " J", py); - SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(z_values[px][py]), 5); + SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(Z_VALUES_ARR[px][py]), 5); } } } From bed8abe5b6df751d7dafc6f0f8d8dff7338625ce Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Sun, 3 Apr 2022 01:27:05 +0200 Subject: [PATCH 260/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20PID=20edit=20menu?= =?UTF-8?q?=20for=20Bed,=20Chamber=20(#23987)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_advanced.cpp | 43 ++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index eb979a43195f..184ff8cf8e61 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -39,7 +39,7 @@ #include "../../module/probe.h" #endif -#if ENABLED(PIDTEMP) +#if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER) #include "../../module/temperature.h" #endif @@ -190,7 +190,12 @@ void menu_backlash(); #if ENABLED(PIDTEMPCHAMBER) case H_CHAMBER: tune_temp = autotune_temp_chamber; break; #endif - default: tune_temp = autotune_temp[hid]; break; + default: + #if ENABLED(PIDTEMP) + tune_temp = autotune_temp[hid]; break; + #else + return; + #endif } sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), hid, tune_temp); queue.inject(cmd); @@ -206,14 +211,36 @@ void menu_backlash(); // Helpers for editing PID Ki & Kd values // grab the PID value out of the temp variable; scale it; then update the PID driver void copy_and_scalePID_i(int16_t e) { - UNUSED(e); - PID_PARAM(Ki, e) = scalePID_i(raw_Ki); - thermalManager.updatePID(); + switch (e) { + #if ENABLED(PIDTEMPBED) + case H_BED: thermalManager.temp_bed.pid.Ki = scalePID_i(raw_Ki); break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case H_CHAMBER: thermalManager.temp_chamber.pid.Ki = scalePID_i(raw_Ki); break; + #endif + default: + #if ENABLED(PIDTEMP) + PID_PARAM(Ki, e) = scalePID_i(raw_Ki); + thermalManager.updatePID(); + #endif + break; + } } void copy_and_scalePID_d(int16_t e) { - UNUSED(e); - PID_PARAM(Kd, e) = scalePID_d(raw_Kd); - thermalManager.updatePID(); + switch (e) { + #if ENABLED(PIDTEMPBED) + case H_BED: thermalManager.temp_bed.pid.Kd = scalePID_d(raw_Kd); break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case H_CHAMBER: thermalManager.temp_chamber.pid.Kd = scalePID_d(raw_Kd); break; + #endif + default: + #if ENABLED(PIDTEMP) + PID_PARAM(Kd, e) = scalePID_d(raw_Kd); + thermalManager.updatePID(); + #endif + break; + } } #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \ From cbc6f23a8af0c864e3607dc24764582149c0d1f3 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Mon, 4 Apr 2022 01:49:51 +0200 Subject: [PATCH 261/502] =?UTF-8?q?=F0=9F=94=A7=20Sanity-check=20SWITCHING?= =?UTF-8?q?=5FTOOLHEAD=5FX=5FPOS=20(#23985)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 8 ++++++++ buildroot/tests/BIGTREE_GTR_V1_0 | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index f9b6d8da4eea..c60c792d3644 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1301,6 +1301,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif +/** + * Generic Switching Toolhead requirements + */ +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + constexpr float thpx[] = SWITCHING_TOOLHEAD_X_POS; + static_assert(COUNT(thpx) == EXTRUDERS, "SWITCHING_TOOLHEAD_X_POS must be an array EXTRUDERS long."); +#endif + /** * Switching Toolhead requirements */ diff --git a/buildroot/tests/BIGTREE_GTR_V1_0 b/buildroot/tests/BIGTREE_GTR_V1_0 index 0a80a6b78c70..4f1a4a690a9c 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0 +++ b/buildroot/tests/BIGTREE_GTR_V1_0 @@ -31,7 +31,8 @@ exec_test $1 $2 "BigTreeTech GTR | 6 Extruders | Quad Z + Endstops" "$3" restore_configs opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \ EXTRUDERS 3 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 \ - SERVO_DELAY '{ 300, 300, 300 }' + SERVO_DELAY '{ 300, 300, 300 }' \ + SWITCHING_TOOLHEAD_X_POS '{ 215, 0 ,0 }' opt_enable SWITCHING_TOOLHEAD TOOL_SENSOR exec_test $1 $2 "BigTreeTech GTR | Switching Toolhead | Tool Sensors" "$3" From 8d3c84a6d969bf9fa576a17b0054d5b98324622d Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sat, 9 Apr 2022 17:21:42 -0700 Subject: [PATCH 262/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20FYSETC=20Min?= =?UTF-8?q?i=20Panel=20neopixel=20type=20(#24011,=20#24111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 10 ++++------ Marlin/src/inc/Warnings.cpp | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c60c792d3644..a52464db9166 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2350,23 +2350,21 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif /** - * FYSETC LCD Requirements + * FYSETC/MKS/BTT Mini Panel Requirements */ #if EITHER(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1) #ifndef NEO_RGB #define NEO_RGB 123 - #define FAUX_RGB 1 #endif #if defined(NEOPIXEL_TYPE) && NEOPIXEL_TYPE != NEO_RGB - #error "Your FYSETC Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB." + #error "Your FYSETC/MKS/BTT Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB." #elif defined(NEOPIXEL_PIXELS) && NEOPIXEL_PIXELS < 3 - #error "Your FYSETC Mini Panel requires NEOPIXEL_PIXELS >= 3." + #error "Your FYSETC/MKS/BTT Mini Panel requires NEOPIXEL_PIXELS >= 3." #endif #if FAUX_RGB #undef NEO_RGB - #undef FAUX_RGB #endif -#elif EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && !DISABLED(RGB_LED) +#elif EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED) #error "Your FYSETC Mini Panel requires RGB_LED." #endif diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 055cfc76985e..7b4371e70080 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -579,10 +579,10 @@ #endif /** - * FYSETC backlighting + * FYSETC/MKS/BTT Mini Panel backlighting */ #if EITHER(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1) && !ALL(NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, LED_COLOR_PRESETS) - #warning "Your FYSETC Mini Panel works best with NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, and LED_COLOR_PRESETS." + #warning "Your FYSETC/MKS/BTT Mini Panel works best with NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, and LED_COLOR_PRESETS." #endif #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED) From 4b456078ddc1099c081e1e7149aba612c8f41008 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Mon, 11 Apr 2022 02:23:53 +0200 Subject: [PATCH 263/502] =?UTF-8?q?=F0=9F=8C=90=20Update=20Italian=20langu?= =?UTF-8?q?age=20(#24019)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_it.h | 155 ++++++++++++++++++++------ 1 file changed, 123 insertions(+), 32 deletions(-) diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index ff1585de3c29..79ef5b5f9de1 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -67,11 +67,21 @@ namespace Language_it { LSTR MSG_DISABLE_STEPPERS = _UxGT("Disabilita Motori"); LSTR MSG_DEBUG_MENU = _UxGT("Menu di debug"); LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Test barra avanzam."); + LSTR MSG_HOMING = _UxGT("Azzeramento"); LSTR MSG_AUTO_HOME = _UxGT("Auto Home"); LSTR MSG_AUTO_HOME_A = _UxGT("Home @"); LSTR MSG_AUTO_HOME_X = _UxGT("Home X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Home Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Home Z"); + LSTR MSG_FILAMENT_SET = _UxGT("Impostaz.filamento"); + LSTR MSG_FILAMENT_MAN = _UxGT("Gestione filamento"); + LSTR MSG_LEVBED_FL = _UxGT("Davanti Sinistra"); + LSTR MSG_LEVBED_FR = _UxGT("Davanti Destra"); + LSTR MSG_LEVBED_C = _UxGT("Centro"); + LSTR MSG_LEVBED_BL = _UxGT("Dietro Sinistra"); + LSTR MSG_LEVBED_BR = _UxGT("Dietro Destra"); + LSTR MSG_MANUAL_MESH = _UxGT("Mesh Manuale"); + LSTR MSG_AUTO_MESH = _UxGT("Generaz.Autom.Mesh"); LSTR MSG_AUTO_Z_ALIGN = _UxGT("Allineam.automat. Z"); LSTR MSG_ITERATION = _UxGT("Iterazione G34: %i"); LSTR MSG_DECREASING_ACCURACY = _UxGT("Precisione in calo!"); @@ -88,6 +98,9 @@ namespace Language_it { LSTR MSG_HOME_OFFSET_I = _UxGT("Offset home ") STR_I; LSTR MSG_HOME_OFFSET_J = _UxGT("Offset home ") STR_J; LSTR MSG_HOME_OFFSET_K = _UxGT("Offset home ") STR_K; + LSTR MSG_HOME_OFFSET_U = _UxGT("Offset home ") STR_U; + LSTR MSG_HOME_OFFSET_V = _UxGT("Offset home ") STR_V; + LSTR MSG_HOME_OFFSET_W = _UxGT("Offset home ") STR_W; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset applicato"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Wizard Tramming"); LSTR MSG_SELECT_ORIGIN = _UxGT("Selez. origine"); @@ -134,15 +147,19 @@ namespace Language_it { LSTR MSG_MOVE_AXIS = _UxGT("Muovi Asse"); LSTR MSG_BED_LEVELING = _UxGT("Livella piano"); LSTR MSG_LEVEL_BED = _UxGT("Livella piano"); - LSTR MSG_BED_TRAMMING = _UxGT("Tramming piano"); + LSTR MSG_BED_TRAMMING = _UxGT("Tarat.fine piano"); + LSTR MSG_BED_TRAMMING_MANUAL = _UxGT("Tarat.fine Manuale"); LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Regola la vite finché la sonda non rileva il piano."); LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Tolleranza raggiunta su tutti gli angoli. Piano livellato!"); LSTR MSG_BED_TRAMMING_GOOD_POINTS = _UxGT("Punti buoni: "); LSTR MSG_BED_TRAMMING_LAST_Z = _UxGT("Ultimo Z: "); LSTR MSG_NEXT_CORNER = _UxGT("Prossimo punto"); LSTR MSG_MESH_EDITOR = _UxGT("Editor Mesh"); + LSTR MSG_MESH_VIEWER = _UxGT("Visualiz. Mesh"); LSTR MSG_EDIT_MESH = _UxGT("Modifica Mesh"); + LSTR MSG_MESH_VIEW = _UxGT("Visualizza Mesh"); LSTR MSG_EDITING_STOPPED = _UxGT("Modif. Mesh Fermata"); + LSTR MSG_NO_VALID_MESH = _UxGT("Mesh non valida"); LSTR MSG_PROBING_POINT = _UxGT("Punto sondato"); LSTR MSG_MESH_X = _UxGT("Indice X"); LSTR MSG_MESH_Y = _UxGT("Indice Y"); @@ -217,7 +234,7 @@ namespace Language_it { LSTR MSG_UBL_FILLIN_MESH = _UxGT("Riempimento Mesh"); LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Invalida Tutto"); LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalid.Punto Vicino"); - LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Ritocca All"); + LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Ritocca Tutto"); LSTR MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Ritocca Punto Vicino"); LSTR MSG_UBL_STORAGE_MESH_MENU = _UxGT("Mesh Salvate"); LSTR MSG_UBL_STORAGE_SLOT = _UxGT("Slot di memoria"); @@ -270,6 +287,9 @@ namespace Language_it { LSTR MSG_MOVE_I = _UxGT("Muovi ") STR_I; LSTR MSG_MOVE_J = _UxGT("Muovi ") STR_J; LSTR MSG_MOVE_K = _UxGT("Muovi ") STR_K; + LSTR MSG_MOVE_U = _UxGT("Muovi ") STR_U; + LSTR MSG_MOVE_V = _UxGT("Muovi ") STR_V; + LSTR MSG_MOVE_W = _UxGT("Muovi ") STR_W; LSTR MSG_MOVE_E = _UxGT("Estrusore"); LSTR MSG_MOVE_EN = _UxGT("Estrusore *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Ugello freddo"); @@ -283,6 +303,12 @@ namespace Language_it { LSTR MSG_MOVE_01IN = _UxGT("Muovi di 0.1\""); LSTR MSG_MOVE_1IN = _UxGT("Muovi di 1\""); LSTR MSG_SPEED = _UxGT("Velocità"); + LSTR MSG_MAXSPEED = _UxGT("Vel.massima (mm/s)"); + LSTR MSG_MAXSPEED_X = _UxGT("Vel.massima ") STR_A; + LSTR MSG_MAXSPEED_Y = _UxGT("Vel.massima ") STR_B; + LSTR MSG_MAXSPEED_Z = _UxGT("Vel.massima ") STR_C; + LSTR MSG_MAXSPEED_E = _UxGT("Vel.massima ") STR_E; + LSTR MSG_MAXSPEED_A = _UxGT("Vel.massima @"); LSTR MSG_BED_Z = _UxGT("Piatto Z"); LSTR MSG_NOZZLE = _UxGT("Ugello"); LSTR MSG_NOZZLE_N = _UxGT("Ugello ~"); @@ -314,44 +340,61 @@ namespace Language_it { LSTR MSG_LCD_ON = _UxGT("On"); LSTR MSG_LCD_OFF = _UxGT("Off"); LSTR MSG_PID_AUTOTUNE = _UxGT("Calibrazione PID"); - LSTR MSG_PID_AUTOTUNE_E = _UxGT("Calibraz. PID *"); + LSTR MSG_PID_AUTOTUNE_E = _UxGT("Calib.PID *"); LSTR MSG_PID_CYCLE = _UxGT("Ciclo PID"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Calibr.PID eseguita"); LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Calibrazione fallita. Estrusore errato."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita. Temperatura troppo alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Calibrazione fallita! Tempo scaduto."); + LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss"); + LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Autotune"); + LSTR MSG_MPC_EDIT = _UxGT("Modif.MPC *"); + LSTR MSG_MPC_POWER_E = _UxGT("Potenza *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("C blocco *"); + LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Reattiv.Sens. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H ambiente *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN255_E= _UxGT("H Amb. vent. *"); LSTR MSG_SELECT = _UxGT("Seleziona"); LSTR MSG_SELECT_E = _UxGT("Seleziona *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); - LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-jerk"); - LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-jerk"); - LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-jerk"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-jerk"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-jerk"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-jerk"); - LSTR MSG_VE_JERK = _UxGT("Ve-jerk"); + LSTR MSG_VA_JERK = _UxGT("Max Jerk ") STR_A; + LSTR MSG_VB_JERK = _UxGT("Max Jerk ") STR_B; + LSTR MSG_VC_JERK = _UxGT("Max Jerk ") STR_C; + LSTR MSG_VI_JERK = _UxGT("Max Jerk ") STR_I; + LSTR MSG_VJ_JERK = _UxGT("Max Jerk ") STR_J; + LSTR MSG_VK_JERK = _UxGT("Max Jerk ") STR_K; + LSTR MSG_VU_JERK = _UxGT("Max Jerk ") STR_U; + LSTR MSG_VV_JERK = _UxGT("Max Jerk ") STR_V; + LSTR MSG_VW_JERK = _UxGT("Max Jerk ") STR_W; + LSTR MSG_VE_JERK = _UxGT("Max Jerk E"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Deviaz. giunzioni"); LSTR MSG_VELOCITY = _UxGT("Velocità"); - LSTR MSG_VMAX_A = _UxGT("Vmax ") STR_A; - LSTR MSG_VMAX_B = _UxGT("Vmax ") STR_B; - LSTR MSG_VMAX_C = _UxGT("Vmax ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vmax ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vmax ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vmax ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vmax ") STR_E; - LSTR MSG_VMAX_EN = _UxGT("Vmax *"); - LSTR MSG_VMIN = _UxGT("Vmin"); - LSTR MSG_VTRAV_MIN = _UxGT("VTrav min"); + LSTR MSG_VMAX_A = _UxGT("Vel.Massima ") STR_A; + LSTR MSG_VMAX_B = _UxGT("Vel.Massima ") STR_B; + LSTR MSG_VMAX_C = _UxGT("Vel.Massima ") STR_C; + LSTR MSG_VMAX_I = _UxGT("Vel.Massima ") STR_I; + LSTR MSG_VMAX_J = _UxGT("Vel.Massima ") STR_J; + LSTR MSG_VMAX_K = _UxGT("Vel.Massima ") STR_K; + LSTR MSG_VMAX_U = _UxGT("Vel.Massima ") STR_U; + LSTR MSG_VMAX_V = _UxGT("Vel.Massima ") STR_V; + LSTR MSG_VMAX_W = _UxGT("Vel.Massima ") STR_W; + LSTR MSG_VMAX_E = _UxGT("Vel.Massima ") STR_E; + LSTR MSG_VMAX_EN = _UxGT("Vel.Massima *"); + LSTR MSG_VMIN = _UxGT("Vel.Minima"); + LSTR MSG_VTRAV_MIN = _UxGT("Vel.Min spostam."); LSTR MSG_ACCELERATION = _UxGT("Accelerazione"); - LSTR MSG_AMAX_A = _UxGT("Max ") STR_A _UxGT(" Accel"); - LSTR MSG_AMAX_B = _UxGT("Max ") STR_B _UxGT(" Accel"); - LSTR MSG_AMAX_C = _UxGT("Max ") STR_C _UxGT(" Accel"); - LSTR MSG_AMAX_I = _UxGT("Max ") STR_I _UxGT(" Accel"); - LSTR MSG_AMAX_J = _UxGT("Max ") STR_J _UxGT(" Accel"); - LSTR MSG_AMAX_K = _UxGT("Max ") STR_K _UxGT(" Accel"); - LSTR MSG_AMAX_E = _UxGT("Max ") STR_E _UxGT(" Accel"); - LSTR MSG_AMAX_EN = _UxGT("Max * Accel"); + LSTR MSG_AMAX_A = _UxGT("Acc.Massima ") STR_A; + LSTR MSG_AMAX_B = _UxGT("Acc.Massima ") STR_B; + LSTR MSG_AMAX_C = _UxGT("Acc.Massima ") STR_C; + LSTR MSG_AMAX_I = _UxGT("Acc.Massima ") STR_I; + LSTR MSG_AMAX_J = _UxGT("Acc.Massima ") STR_J; + LSTR MSG_AMAX_K = _UxGT("Acc.Massima ") STR_K; + LSTR MSG_AMAX_E = _UxGT("Acc.Massima ") STR_E; + LSTR MSG_AMAX_U = _UxGT("Acc.Massima ") STR_U; + LSTR MSG_AMAX_V = _UxGT("Acc.Massima ") STR_V; + LSTR MSG_AMAX_W = _UxGT("Acc.Massima ") STR_W; + LSTR MSG_AMAX_EN = _UxGT("Acc.Massima *"); LSTR MSG_A_RETRACT = _UxGT("A-Ritrazione"); LSTR MSG_A_TRAVEL = _UxGT("A-Spostamento"); LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("Frequenza max"); @@ -363,6 +406,9 @@ namespace Language_it { LSTR MSG_I_STEPS = STR_I _UxGT(" passi/mm"); LSTR MSG_J_STEPS = STR_J _UxGT(" passi/mm"); LSTR MSG_K_STEPS = STR_K _UxGT(" passi/mm"); + LSTR MSG_U_STEPS = STR_U _UxGT(" passi/mm"); + LSTR MSG_V_STEPS = STR_V _UxGT(" passi/mm"); + LSTR MSG_W_STEPS = STR_W _UxGT(" passi/mm"); LSTR MSG_E_STEPS = _UxGT("E passi/mm"); LSTR MSG_EN_STEPS = _UxGT("* passi/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -378,6 +424,10 @@ namespace Language_it { LSTR MSG_ADVANCE_K = _UxGT("K Avanzamento"); LSTR MSG_ADVANCE_K_E = _UxGT("K Avanzamento *"); LSTR MSG_CONTRAST = _UxGT("Contrasto LCD"); + LSTR MSG_BRIGHTNESS = _UxGT("Luminosità LCD"); + LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("Timeout LCD (s)"); + LSTR MSG_SCREEN_TIMEOUT = _UxGT("Timeout LCD (m)"); + LSTR MSG_BRIGHTNESS_OFF = _UxGT("Spegni Retroillum."); LSTR MSG_STORE_EEPROM = _UxGT("Salva impostazioni"); LSTR MSG_LOAD_EEPROM = _UxGT("Carica impostazioni"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Ripristina imp."); @@ -404,12 +454,21 @@ namespace Language_it { LSTR MSG_BUTTON_RESET = _UxGT("Resetta"); LSTR MSG_BUTTON_IGNORE = _UxGT("Ignora"); LSTR MSG_BUTTON_CANCEL = _UxGT("Annulla"); + LSTR MSG_BUTTON_CONFIRM = _UxGT("Conferma"); + LSTR MSG_BUTTON_CONTINUE = _UxGT("Continua"); LSTR MSG_BUTTON_DONE = _UxGT("Fatto"); LSTR MSG_BUTTON_BACK = _UxGT("Indietro"); LSTR MSG_BUTTON_PROCEED = _UxGT("Procedi"); LSTR MSG_BUTTON_SKIP = _UxGT("Salta"); + LSTR MSG_BUTTON_INFO = _UxGT("Info"); + LSTR MSG_BUTTON_LEVEL = _UxGT("Livello"); + LSTR MSG_BUTTON_PAUSE = _UxGT("Pausa"); + LSTR MSG_BUTTON_RESUME = _UxGT("Riprendi"); + LSTR MSG_BUTTON_ADVANCED = _UxGT("Avanzato"); + LSTR MSG_BUTTON_SAVE = _UxGT("Save"); LSTR MSG_PAUSING = _UxGT("Messa in pausa..."); LSTR MSG_PAUSE_PRINT = _UxGT("Pausa stampa"); + LSTR MSG_ADVANCED_PAUSE = _UxGT("Pausa Avanzata"); LSTR MSG_RESUME_PRINT = _UxGT("Riprendi stampa"); LSTR MSG_HOST_START_PRINT = _UxGT("Host Avvio"); LSTR MSG_STOP_PRINT = _UxGT("Arresta stampa"); @@ -418,12 +477,15 @@ namespace Language_it { LSTR MSG_CANCEL_OBJECT = _UxGT("Cancella Oggetto"); LSTR MSG_CANCEL_OBJECT_N = _UxGT("Canc. Oggetto ="); LSTR MSG_OUTAGE_RECOVERY = _UxGT("Ripresa da PowerLoss"); + LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Cont.proc.stampa"); LSTR MSG_MEDIA_MENU = _UxGT("Stampa da media"); LSTR MSG_NO_MEDIA = _UxGT("Media non presente"); LSTR MSG_DWELL = _UxGT("Sospensione..."); LSTR MSG_USERWAIT = _UxGT("Premi tasto.."); LSTR MSG_PRINT_PAUSED = _UxGT("Stampa sospesa"); LSTR MSG_PRINTING = _UxGT("Stampa..."); + LSTR MSG_STOPPING = _UxGT("Fermata..."); + LSTR MSG_REMAINING_TIME = _UxGT("Rimanente"); LSTR MSG_PRINT_ABORTED = _UxGT("Stampa Annullata"); LSTR MSG_PRINT_DONE = _UxGT("Stampa Eseguita"); LSTR MSG_NO_MOVE = _UxGT("Nessun Movimento"); @@ -472,6 +534,7 @@ namespace Language_it { LSTR MSG_BLTOUCH_RESET = _UxGT("Resetta BLTouch"); LSTR MSG_BLTOUCH_DEPLOY = _UxGT("Estendi BLTouch"); LSTR MSG_BLTOUCH_SW_MODE = _UxGT("BLTouch modo SW"); + LSTR MSG_BLTOUCH_SPEED_MODE = _UxGT("Alta Velocità"); LSTR MSG_BLTOUCH_5V_MODE = _UxGT("BLTouch modo 5V"); LSTR MSG_BLTOUCH_OD_MODE = _UxGT("BLTouch modo OD"); LSTR MSG_BLTOUCH_MODE_STORE = _UxGT("BLTouch modo mem."); @@ -488,6 +551,7 @@ namespace Language_it { LSTR MSG_BLTOUCH_STOW = _UxGT("Ritrai BLTouch"); LSTR MSG_MANUAL_STOW = _UxGT("Ritrai Sonda-Z"); LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s prima"); + LSTR MSG_ZPROBE_SETTINGS = _UxGT("Impostazioni sonda"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Offsets sonda"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Offset X sonda"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Offset Y sonda"); @@ -499,11 +563,15 @@ namespace Language_it { LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; + LSTR MSG_BABYSTEP_U = _UxGT("Babystep ") STR_U; + LSTR MSG_BABYSTEP_V = _UxGT("Babystep ") STR_V; + LSTR MSG_BABYSTEP_W = _UxGT("Babystep ") STR_W; LSTR MSG_BABYSTEP_TOTAL = _UxGT("Totali"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Interrompi se FC"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Risc.Fallito"); // Max 12 characters LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP RIDONDANTE"); LSTR MSG_THERMAL_RUNAWAY = _UxGT("TEMP FUORI CONTROLLO"); + LSTR MSG_TEMP_MALFUNCTION = _UxGT("MALFUNZIONAMENTO TEMP"); LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("TEMP PIAT.FUORI CTRL"); LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("T.CAMERA FUORI CTRL"); LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("RAFFREDAM.FUORI CTRL"); @@ -511,10 +579,9 @@ namespace Language_it { LSTR MSG_ERR_MAXTEMP = _UxGT("Err: TEMP MASSIMA"); LSTR MSG_ERR_MINTEMP = _UxGT("Err: TEMP MINIMA"); LSTR MSG_HALTED = _UxGT("STAMPANTE FERMATA"); + LSTR MSG_PLEASE_WAIT = _UxGT("Attendere prego..."); LSTR MSG_PLEASE_RESET = _UxGT("Riavviare prego"); - LSTR MSG_SHORT_DAY = _UxGT("g"); // One character - LSTR MSG_SHORT_HOUR = _UxGT("h"); // One character - LSTR MSG_SHORT_MINUTE = _UxGT("m"); // One character + LSTR MSG_PREHEATING = _UxGT("Preriscaldam..."); LSTR MSG_HEATING = _UxGT("Riscaldamento..."); LSTR MSG_COOLING = _UxGT("Raffreddamento.."); LSTR MSG_BED_HEATING = _UxGT("Risc. piatto..."); @@ -560,12 +627,27 @@ namespace Language_it { LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("STAMPANTE ERRATA"); #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 - LSTR MSG_INFO_PRINT_COUNT = _UxGT("Contat. stampa"); + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nessun supporto inserito."); + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Attendere fino al riavvio."); + LSTR MSG_PLEASE_PREHEAT = _UxGT("Si prega di preriscaldare l'hot end."); + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Azzera contatori stampa"); + LSTR MSG_INFO_PRINT_COUNT = _UxGT("Contatori stampa"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completati"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tempo totale"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Lavoro più lungo"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Totale estruso"); + LSTR MSG_COLORS_GET = _UxGT("Get Color"); + LSTR MSG_COLORS_SELECT = _UxGT("Seleziona colori"); + LSTR MSG_COLORS_APPLIED = _UxGT("Colori applicati"); + LSTR MSG_COLORS_RED = _UxGT("Rosso"); + LSTR MSG_COLORS_GREEN = _UxGT("Verde"); + LSTR MSG_COLORS_BLUE = _UxGT("Blu"); + LSTR MSG_COLORS_WHITE = _UxGT("Bianco"); + LSTR MSG_UI_LANGUAGE = _UxGT("Lingua UI"); + LSTR MSG_SOUND_ENABLE = _UxGT("Abilita suono"); + LSTR MSG_LOCKSCREEN = _UxGT("Blocca Schermo"); #else + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No Supporto"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Stampe"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completati"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Durata"); @@ -582,6 +664,9 @@ namespace Language_it { LSTR MSG_DAC_PERCENT_I = _UxGT("Driver ") STR_I _UxGT(" %"); LSTR MSG_DAC_PERCENT_J = _UxGT("Driver ") STR_J _UxGT(" %"); LSTR MSG_DAC_PERCENT_K = _UxGT("Driver ") STR_K _UxGT(" %"); + LSTR MSG_DAC_PERCENT_U = _UxGT("Driver ") STR_U _UxGT(" %"); + LSTR MSG_DAC_PERCENT_V = _UxGT("Driver ") STR_V _UxGT(" %"); + LSTR MSG_DAC_PERCENT_W = _UxGT("Driver ") STR_W _UxGT(" %"); LSTR MSG_DAC_PERCENT_E = _UxGT("Driver E %"); LSTR MSG_ERROR_TMC = _UxGT("ERR.CONNESSIONE TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Scrivi DAC EEPROM"); @@ -718,6 +803,10 @@ namespace Language_it { LSTR MSG_PROBE_WIZARD_PROBING = _UxGT("Altezza di riferimento sonda"); LSTR MSG_PROBE_WIZARD_MOVING = _UxGT("Spostati in posizione di rilevazione"); + LSTR MSG_XATC = _UxGT("Proc.guid.X-Twist"); + LSTR MSG_XATC_DONE = _UxGT("Proc.guid.X-Twist eseg.!"); + LSTR MSG_XATC_UPDATE_Z_OFFSET = _UxGT("Agg.Offset-Z sonda a "); + LSTR MSG_SOUND = _UxGT("Suoni"); LSTR MSG_TOP_LEFT = _UxGT("Alto sinistra"); @@ -731,4 +820,6 @@ namespace Language_it { LSTR MSG_SD_CARD = _UxGT("Scheda SD"); LSTR MSG_USB_DISK = _UxGT("Disco USB"); + + LSTR MSG_HOST_SHUTDOWN = _UxGT("Arresta host"); } From 7b5e2cd78619ba4334c0fe94b3f8293ed8d6e1ee Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 20 Apr 2022 00:52:05 -0500 Subject: [PATCH 264/502] =?UTF-8?q?=F0=9F=90=9B=20=20Update=20M913,=20M914?= =?UTF-8?q?=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #11248, #11249, #23400 --- .../src/gcode/feature/trinamic/M911-M914.cpp | 38 +++++++++---------- Marlin/src/module/settings.cpp | 8 ++-- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index 57a77c0e5d4e..987c20b157bf 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -257,33 +257,33 @@ bool report = true; #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) - const int8_t index = parser.byteval('I', -1); + const uint8_t index = parser.byteval('I'); #elif AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) - constexpr int8_t index = -1; + constexpr uint8_t index = 0; #endif LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(axis_codes[i])) { report = false; switch (i) { #if X_HAS_STEALTHCHOP || X2_HAS_STEALTHCHOP case X_AXIS: - TERN_(X_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_PWMTHRS(X,X)); - TERN_(X2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_PWMTHRS(X,X2)); + TERN_(X_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(X,X)); + TERN_(X2_HAS_STEALTHCHOP, if (!(index & 1)) TMC_SET_PWMTHRS(X,X2)); break; #endif #if Y_HAS_STEALTHCHOP || Y2_HAS_STEALTHCHOP case Y_AXIS: - TERN_(Y_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_PWMTHRS(Y,Y)); - TERN_(Y2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_PWMTHRS(Y,Y2)); + TERN_(Y_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(Y,Y)); + TERN_(Y2_HAS_STEALTHCHOP, if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2)); break; #endif #if Z_HAS_STEALTHCHOP || Z2_HAS_STEALTHCHOP || Z3_HAS_STEALTHCHOP || Z4_HAS_STEALTHCHOP case Z_AXIS: - TERN_(Z_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_PWMTHRS(Z,Z)); - TERN_(Z2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_PWMTHRS(Z,Z2)); - TERN_(Z3_HAS_STEALTHCHOP, if (index < 0 || index == 2) TMC_SET_PWMTHRS(Z,Z3)); - TERN_(Z4_HAS_STEALTHCHOP, if (index < 0 || index == 3) TMC_SET_PWMTHRS(Z,Z4)); + TERN_(Z_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(Z,Z)); + TERN_(Z2_HAS_STEALTHCHOP, if (!index || index == 2) TMC_SET_PWMTHRS(Z,Z2)); + TERN_(Z3_HAS_STEALTHCHOP, if (!index || index == 3) TMC_SET_PWMTHRS(Z,Z3)); + TERN_(Z4_HAS_STEALTHCHOP, if (!index || index == 4) TMC_SET_PWMTHRS(Z,Z4)); break; #endif @@ -362,7 +362,7 @@ #if X2_HAS_STEALTHCHOP || Y2_HAS_STEALTHCHOP || Z2_HAS_STEALTHCHOP say_M913(forReplay); - SERIAL_ECHOPGM(" I1"); + SERIAL_ECHOPGM(" I2"); #if X2_HAS_STEALTHCHOP SERIAL_ECHOPGM_P(SP_X_STR, stepperX2.get_pwm_thrs()); #endif @@ -377,12 +377,12 @@ #if Z3_HAS_STEALTHCHOP say_M913(forReplay); - SERIAL_ECHOLNPGM(" I2 Z", stepperZ3.get_pwm_thrs()); + SERIAL_ECHOLNPGM(" I3 Z", stepperZ3.get_pwm_thrs()); #endif #if Z4_HAS_STEALTHCHOP say_M913(forReplay); - SERIAL_ECHOLNPGM(" I3 Z", stepperZ4.get_pwm_thrs()); + SERIAL_ECHOLNPGM(" I4 Z", stepperZ4.get_pwm_thrs()); #endif #if I_HAS_STEALTHCHOP @@ -470,9 +470,9 @@ #if Z_SENSORLESS case Z_AXIS: if (index < 2) stepperZ.homing_threshold(value); - TERN_(Z2_SENSORLESS, if (index == 0 || index == 2) stepperZ2.homing_threshold(value)); - TERN_(Z3_SENSORLESS, if (index == 0 || index == 3) stepperZ3.homing_threshold(value)); - TERN_(Z4_SENSORLESS, if (index == 0 || index == 4) stepperZ4.homing_threshold(value)); + TERN_(Z2_SENSORLESS, if (!index || index == 2) stepperZ2.homing_threshold(value)); + TERN_(Z3_SENSORLESS, if (!index || index == 3) stepperZ3.homing_threshold(value)); + TERN_(Z4_SENSORLESS, if (!index || index == 4) stepperZ4.homing_threshold(value)); break; #endif #if I_SENSORLESS @@ -526,7 +526,7 @@ #if X2_SENSORLESS || Y2_SENSORLESS || Z2_SENSORLESS say_M914(forReplay); - SERIAL_ECHOPGM(" I1"); + SERIAL_ECHOPGM(" I2"); #if X2_SENSORLESS SERIAL_ECHOPGM_P(SP_X_STR, stepperX2.homing_threshold()); #endif @@ -541,12 +541,12 @@ #if Z3_SENSORLESS say_M914(forReplay); - SERIAL_ECHOLNPGM(" I2 Z", stepperZ3.homing_threshold()); + SERIAL_ECHOLNPGM(" I3 Z", stepperZ3.homing_threshold()); #endif #if Z4_SENSORLESS say_M914(forReplay); - SERIAL_ECHOLNPGM(" I3 Z", stepperZ4.homing_threshold()); + SERIAL_ECHOLNPGM(" I4 Z", stepperZ4.homing_threshold()); #endif #if I_SENSORLESS diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 27c5d450d8a0..129e513cec26 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -430,10 +430,10 @@ typedef struct SettingsDataStruct { // // HAS_TRINAMIC_CONFIG // - tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5 - tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5 - tmc_sgt_t tmc_sgt; // M914 X Y Z X2 Y2 Z2 Z3 Z4 - tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5 + tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z... + tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z... + tmc_sgt_t tmc_sgt; // M914 X Y Z... + tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z... // // LIN_ADVANCE From 28d2bc353ebbddc0ce0b96a634108392eb1089b4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 1 Jan 2022 16:48:24 -0600 Subject: [PATCH 265/502] =?UTF-8?q?=F0=9F=8E=A8=20Use=20LEDColor=20default?= =?UTF-8?q?=20C-CTOR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/leds/leds.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/leds/leds.h b/Marlin/src/feature/leds/leds.h index bce9052424a8..8649dd014fbf 100644 --- a/Marlin/src/feature/leds/leds.h +++ b/Marlin/src/feature/leds/leds.h @@ -54,6 +54,8 @@ typedef struct LEDColor { OPTARG(NEOPIXEL_LED, i(NEOPIXEL_BRIGHTNESS)) {} + LEDColor(const LEDColor&) = default; + LEDColor(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w=0) OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS)) : r(r), g(g), b(b) OPTARG(HAS_WHITE_LED, w(w)) OPTARG(NEOPIXEL_LED, i(i)) {} @@ -68,11 +70,6 @@ typedef struct LEDColor { return *this; } - LEDColor& operator=(const LEDColor &right) { - if (this != &right) memcpy(this, &right, sizeof(LEDColor)); - return *this; - } - bool operator==(const LEDColor &right) { if (this == &right) return true; return 0 == memcmp(this, &right, sizeof(LEDColor)); From 230db90b70f1cafdea6fe3a8c28499e92004be53 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 22 Apr 2022 23:02:47 +1200 Subject: [PATCH 266/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20DGUS=5FPREHEAT=5FU?= =?UTF-8?q?I=20enable=20with=20DGUS=5FLCD=5FCLASSIC=20(#24066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 85ccb8088ec2..c311790a9f81 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -3044,7 +3044,7 @@ #define HAS_TEMPERATURE 1 #endif -#if HAS_TEMPERATURE && EITHER(HAS_MARLINUI_MENU, HAS_DWIN_E3V2) +#if HAS_TEMPERATURE && ANY(HAS_MARLINUI_MENU, HAS_DWIN_E3V2, HAS_DGUS_LCD_CLASSIC) #ifdef PREHEAT_6_LABEL #define PREHEAT_COUNT 6 #elif defined(PREHEAT_5_LABEL) diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index 9b25f8aeb13f..46d3506254a1 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -629,8 +629,10 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr default: switch (var.VP) { default: return; - case VP_E0_BED_PREHEAT: TERN_(HAS_HOTEND, ui.preheat_all(0)); break; - case VP_E1_BED_PREHEAT: TERN_(HAS_MULTI_HOTEND, ui.preheat_all(1)); break; + case VP_E0_BED_PREHEAT: TERN_(HAS_HOTEND, ui.preheat_all(0)); break; + #if DISABLED(DGUS_LCD_UI_HIPRECY) && HAS_MULTI_HOTEND + case VP_E1_BED_PREHEAT: ui.preheat_all(1); break; + #endif } case 7: break; // Custom preheat case 9: thermalManager.cooldown(); break; // Cool down From 8fb3074901f83034cc240834a2fc75aad0ed43ad Mon Sep 17 00:00:00 2001 From: Robby Candra Date: Fri, 15 Apr 2022 11:21:12 +0700 Subject: [PATCH 267/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20DEBUG=5FCARDREADER?= =?UTF-8?q?=20(#24023)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_adv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index d86fcddb3a0f..f3ad41eabb89 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -976,7 +976,7 @@ #endif // Flag whether hex_print.cpp is used -#if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG, MARLIN_DEV_MODE) +#if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG, MARLIN_DEV_MODE, DEBUG_CARDREADER) #define NEED_HEX_PRINT 1 #endif From 4c84769a814ab6534a1edebc66529b568c9d6d7e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Apr 2022 06:31:39 -0500 Subject: [PATCH 268/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20ADVANCED=5FPAUSE?= =?UTF-8?q?=5FRESUME=5FPRIME=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #23824 --- Marlin/src/feature/pause.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 636ac32042b6..ac5852f91a1a 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -672,8 +672,9 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_ // If resume_position is negative if (resume_position.e < 0) unscaled_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE)); - #if ADVANCED_PAUSE_RESUME_PRIME != 0 - unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE)); + #ifdef ADVANCED_PAUSE_RESUME_PRIME + if (ADVANCED_PAUSE_RESUME_PRIME != 0) + unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE)); #endif // Now all extrusion positions are resumed and ready to be confirmed From 7fa2dceddafcfeea4b2599fa2b9fe3542abd4c1f Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 19 Apr 2022 17:16:26 -0700 Subject: [PATCH 269/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20ProUI=20/=20JyersU?= =?UTF-8?q?I=20leveling=20preheat=20(#24060,=20#24064)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Scott Lahteine --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 8 +++++++- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 13 ++----------- Marlin/src/lcd/e3v2/proui/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 13 ++++++------- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index dea457937440..54ff39804b21 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -433,7 +433,13 @@ G29_TYPE GcodeSuite::G29() { remember_feedrate_scaling_off(); #if ENABLED(PREHEAT_BEFORE_LEVELING) - if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, LEVELING_BED_TEMP); + if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, + #if BOTH(DWIN_LCD_PROUI, HAS_HEATED_BED) + HMI_data.BedLevT + #else + LEVELING_BED_TEMP + #endif + ); #endif } diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index fbd56c1c0f4f..ae23df95e836 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -2079,7 +2079,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #endif // HAS_HEATED_BED #if HAS_PREHEAT - #define _PREHEAT_SUBMENU_CASE(N) case Preheat##N: preheat_submenu(N, item, TEMP_PREHEAT##N); break; + #define _PREHEAT_SUBMENU_CASE(N) case Preheat##N: preheat_submenu((N) - 1, item, TEMP_PREHEAT##N); break; REPEAT_1(PREHEAT_COUNT, _PREHEAT_SUBMENU_CASE) #endif @@ -2869,16 +2869,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if ENABLED(AUTO_BED_LEVELING_UBL) #if ENABLED(PREHEAT_BEFORE_LEVELING) Popup_Handler(Heating); - #if HAS_HOTEND - if (thermalManager.degTargetHotend(0) < LEVELING_NOZZLE_TEMP) - thermalManager.setTargetHotend(LEVELING_NOZZLE_TEMP, 0); - #endif - #if HAS_HEATED_BED - if (thermalManager.degTargetBed() < LEVELING_BED_TEMP) - thermalManager.setTargetBed(LEVELING_BED_TEMP); - #endif - thermalManager.wait_for_hotend(0); - TERN_(HAS_HEATED_BED, thermalManager.wait_for_bed_heating()); + probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, LEVELING_BED_TEMP); #endif #if HAS_BED_PROBE Popup_Handler(Level); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 7b5f6955afb4..9db6355e98bd 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1702,7 +1702,7 @@ void DWIN_SetDataDefaults() { ApplyExtMinT(); #endif #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) - HMI_data.BedLevT = PREHEAT_1_TEMP_BED; + HMI_data.BedLevT = LEVELING_BED_TEMP; #endif TERN_(BAUD_RATE_GCODE, SetBaud250K()); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 5065bb94d75b..4ebc2c16c6e4 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -120,8 +120,12 @@ typedef struct { #if ENABLED(PREVENT_COLD_EXTRUSION) int16_t ExtMinT = EXTRUDE_MINTEMP; #endif - int16_t BedLevT = PREHEAT_1_TEMP_BED; - TERN_(BAUD_RATE_GCODE, bool Baud115K = false); + #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) + int16_t BedLevT = LEVELING_BED_TEMP; + #endif + #if ENABLED(BAUD_RATE_GCODE) + bool Baud115K = false; + #endif bool FullManualTramming = false; // Led #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) @@ -135,8 +139,3 @@ typedef struct { static constexpr size_t eeprom_data_size = 64; extern HMI_data_t HMI_data; - -#if PREHEAT_1_TEMP_BED - #undef LEVELING_BED_TEMP - #define LEVELING_BED_TEMP HMI_data.BedLevT -#endif From f35404f853ba185814bd17a4742ef34688ceba98 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Apr 2022 21:18:39 -0500 Subject: [PATCH 270/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Han?= =?UTF-8?q?dle=20PLR=20in=20manage=5Fmedia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/powerloss.cpp | 11 ++- Marlin/src/feature/powerloss.h | 4 +- Marlin/src/gcode/feature/powerloss/M413.cpp | 2 +- Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h | 2 +- Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h | 2 +- Marlin/src/sd/cardreader.cpp | 73 ++++++++++--------- 6 files changed, 52 insertions(+), 42 deletions(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 74008ed55a55..e880f802dc79 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -108,13 +108,18 @@ void PrintJobRecovery::changed() { * * If a saved state exists send 'M1000 S' to initiate job recovery. */ -void PrintJobRecovery::check() { +bool PrintJobRecovery::check() { //if (!card.isMounted()) card.mount(); + bool success = false; if (card.isMounted()) { load(); - if (!valid()) return cancel(); - queue.inject(F("M1000S")); + success = valid(); + if (!success) + cancel(); + else + queue.inject(F("M1000S")); } + return success; } /** diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 4e97109bb7b9..33d9dc007c0d 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -176,11 +176,11 @@ class PrintJobRecovery { static void open(const bool read) { card.openJobRecoveryFile(read); } static void close() { file.close(); } - static void check(); + static bool check(); static void resume(); static void purge(); - static void cancel() { purge(); IF_DISABLED(NO_SD_AUTOSTART, card.autofile_begin()); } + static void cancel() { purge(); } static void load(); static void save(const bool force=ENABLED(SAVE_EACH_CMD_MODE), const float zraise=POWER_LOSS_ZRAISE, const bool raised=false); diff --git a/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin/src/gcode/feature/powerloss/M413.cpp index 4807d3e8f95b..f6d82b0ad944 100644 --- a/Marlin/src/gcode/feature/powerloss/M413.cpp +++ b/Marlin/src/gcode/feature/powerloss/M413.cpp @@ -49,7 +49,7 @@ void GcodeSuite::M413() { if (parser.seen_test('P')) recovery.purge(); if (parser.seen_test('D')) recovery.debug(F("M413")); if (parser.seen_test('O')) recovery._outage(true); - if (parser.seen_test('C')) recovery.check(); + if (parser.seen_test('C')) (void)recovery.check(); if (parser.seen_test('E')) SERIAL_ECHOF(recovery.exists() ? F("PLR Exists\n") : F("No PLR\n")); if (parser.seen_test('V')) SERIAL_ECHOF(recovery.valid() ? F("Valid\n") : F("Invalid\n")); #endif diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h index 9f4a66b7070c..9250ee112762 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h @@ -27,7 +27,7 @@ #define BOARD_WEBSITE_URL "fysetc.com" #define BOARD_NO_NATIVE_USB - +#define RESET_STEPPERS_ON_MEDIA_INSERT #define DISABLE_JTAG #define pins_v2_20190128 // new pins define diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h index c473a37d3e58..beda50d29b1b 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h @@ -32,7 +32,7 @@ //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 #define BOARD_NO_NATIVE_USB - +#define RESET_STEPPERS_ON_MEDIA_INSERT #define DISABLE_JTAG #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 652a44e52651..ec5f1a970913 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -472,50 +472,55 @@ void CardReader::mount() { #endif void CardReader::manage_media() { - static uint8_t prev_stat = 2; // First call, no prior state + static uint8_t prev_stat = 2; // First call, no prior state uint8_t stat = uint8_t(IS_SD_INSERTED()); if (stat == prev_stat) return; - DEBUG_ECHOLNPGM("SD: Status changed from ", prev_stat, " to ", stat); + DEBUG_SECTION(mm, "CardReader::manage_media", true); + DEBUG_ECHOLNPGM("SD Status ", prev_stat, " -> ", stat); - flag.workDirIsRoot = true; // Return to root on mount/release + flag.workDirIsRoot = true; // Return to root on mount/release - if (ui.detected()) { + if (!ui.detected()) { + DEBUG_ECHOLNPGM("SD: No UI Detected."); + return; + } - uint8_t old_stat = prev_stat; - prev_stat = stat; // Change now to prevent re-entry + uint8_t old_stat = prev_stat; + prev_stat = stat; // Change now to prevent re-entry - if (stat) { // Media Inserted - safe_delay(500); // Some boards need a delay to get settled - if (TERN1(SD_IGNORE_AT_STARTUP, old_stat != 2)) - mount(); // Try to mount the media - #if MB(FYSETC_CHEETAH, FYSETC_CHEETAH_V12, FYSETC_AIO_II) - reset_stepper_drivers(); // Workaround for Cheetah bug - #endif - if (!isMounted()) stat = 0; // Not mounted? - } - else { - #if PIN_EXISTS(SD_DETECT) - release(); // Card is released - #endif - } + if (stat) { // Media Inserted + safe_delay(500); // Some boards need a delay to get settled - ui.media_changed(old_stat, stat); // Update the UI + // Try to mount the media (only later with SD_IGNORE_AT_STARTUP) + if (TERN1(SD_IGNORE_AT_STARTUP, old_stat != 2)) mount(); + if (!isMounted()) stat = 0; // Not mounted? - if (stat) { - TERN_(SDCARD_EEPROM_EMULATION, settings.first_load()); - if (old_stat == 2) { // First mount? - DEBUG_ECHOLNPGM("First mount."); - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.check(); // Check for PLR file. (If not there then call autofile_begin) - #elif DISABLED(NO_SD_AUTOSTART) - autofile_begin(); // Look for auto0.g on the next loop - #endif - } - } + TERN_(RESET_STEPPERS_ON_MEDIA_INSERT, reset_stepper_drivers()); // Workaround for Cheetah bug } - else - DEBUG_ECHOLNPGM("SD: No UI Detected."); + else { + #if PIN_EXISTS(SD_DETECT) + release(); // Card is released + #endif + } + + ui.media_changed(old_stat, stat); // Update the UI + + if (!stat) return; // Exit if no media is present + + TERN_(SDCARD_EEPROM_EMULATION, settings.first_load()); + + if (old_stat != 2) return; // First mount? + + DEBUG_ECHOLNPGM("First mount."); + + bool do_auto = true; UNUSED(do_auto); + + // Check for PLR file. + TERN_(POWER_LOSS_RECOVERY, if (recovery.check()) do_auto = false); + + // Look for auto0.g on the next idle() + IF_DISABLED(NO_SD_AUTOSTART, if (do_auto) autofile_begin()); } /** From 7444933d5d4fc93c6278e091be5af7e4f61b1d9c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 21 Apr 2022 02:26:17 -0500 Subject: [PATCH 271/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20ESP32=20servos,=20?= =?UTF-8?q?SD=5FIGNORE=5FAT=5FSTARTUP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #24007 Followup to aaf5bf02 --- Marlin/src/HAL/ESP32/HAL.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index f7e4383a85f4..ba3627b1fd31 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -89,7 +89,7 @@ typedef Servo hal_servo_t; // void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0); void noTone(const pin_t _pin); - +int8_t get_pwm_channel(const pin_t pin, const uint32_t freq, const uint16_t res); void analogWrite(const pin_t pin, const uint16_t value, const uint32_t freq=PWM_FREQUENCY, const uint16_t res=8); // From 4bdec5e99330a35387c09adc27be94c5082b4405 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 22 Apr 2022 01:12:43 -0500 Subject: [PATCH 272/502] =?UTF-8?q?=F0=9F=9A=B8=20More=20ExtUI=20events=20?= =?UTF-8?q?for=20ABL=20/=20UBL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 7 +++ Marlin/src/gcode/bedlevel/abl/G29.cpp | 48 ++++++++++----------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 0d00296b5b60..436a25f1860c 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -726,6 +726,7 @@ void unified_bed_leveling::shift_mesh_height() { probe.deploy(); // Deploy before ui.capture() to allow for PAUSE_BEFORE_DEPLOY_STOW TERN_(HAS_MARLINUI_MENU, ui.capture()); + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained uint8_t count = GRID_MAX_POINTS; @@ -747,6 +748,7 @@ void unified_bed_leveling::shift_mesh_height() { ui.quick_feedback(); ui.release(); probe.stow(); // Release UI before stow to allow for PAUSE_BEFORE_DEPLOY_STOW + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); return restore_ubl_active_state_and_leave(); } #endif @@ -786,6 +788,8 @@ void unified_bed_leveling::shift_mesh_height() { constrain(nearby.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X), constrain(nearby.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y) ); + + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); } #endif // HAS_BED_PROBE @@ -885,6 +889,7 @@ void set_message_with_feedback(FSTR_P const fstr) { */ void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const_float_t z_clearance, const_float_t thick, const bool do_ubl_mesh_map) { ui.capture(); + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained do_blocking_move_to_xy_z(current_position, z_clearance); @@ -948,6 +953,8 @@ void set_message_with_feedback(FSTR_P const fstr) { restore_ubl_active_state_and_leave(); do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE); + + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); } /** diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 54ff39804b21..c8d37567d53f 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -74,10 +74,14 @@ #endif #endif -#define G29_RETURN(retry) do{ \ +#define G29_RETURN(retry, did) do{ \ if (TERN(G29_RETRY_AND_RECOVER, !retry, true)) { \ TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false)); \ } \ + if (did) { \ + TERN_(HAS_DWIN_E3V2_BASIC, DWIN_LevelingDone()); \ + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); \ + } \ return TERN_(G29_RETRY_AND_RECOVER, retry); \ }while(0) @@ -233,7 +237,7 @@ G29_TYPE GcodeSuite::G29() { // G29 Q is also available if debugging #if ENABLED(DEBUG_LEVELING_FEATURE) if (seenQ || DEBUGGING(LEVELING)) log_machine_info(); - if (DISABLED(PROBE_MANUALLY) && seenQ) G29_RETURN(false); + if (DISABLED(PROBE_MANUALLY) && seenQ) G29_RETURN(false, false); #endif // A = Abort manual probing @@ -245,7 +249,7 @@ G29_TYPE GcodeSuite::G29() { // O = Don't level if leveling is already active if (!no_action && planner.leveling_active && parser.boolval('O')) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> Auto-level not needed, skip"); - G29_RETURN(false); + G29_RETURN(false, false); } // Send 'N' to force homing before G29 (internal only) @@ -253,7 +257,7 @@ G29_TYPE GcodeSuite::G29() { process_subcommands_now(TERN(CAN_SET_LEVELING_AFTER_G28, F("G28L0"), FPSTR(G28_STR))); // Don't allow auto-leveling without homing first - if (homing_needed_error()) G29_RETURN(false); + if (homing_needed_error()) G29_RETURN(false, false); // 3-point leveling gets points from the probe class #if ENABLED(AUTO_BED_LEVELING_3POINT) @@ -291,13 +295,13 @@ G29_TYPE GcodeSuite::G29() { if (seen_w) { if (!leveling_is_valid()) { SERIAL_ERROR_MSG("No bilinear grid"); - G29_RETURN(false); + G29_RETURN(false, false); } const float rz = parser.seenval('Z') ? RAW_Z_POSITION(parser.value_linear_units()) : current_position.z; if (!WITHIN(rz, -10, 10)) { SERIAL_ERROR_MSG("Bad Z value"); - G29_RETURN(false); + G29_RETURN(false, false); } const float rx = RAW_X_POSITION(parser.linearval('X', NAN)), @@ -325,7 +329,7 @@ G29_TYPE GcodeSuite::G29() { set_bed_leveling_enabled(abl.reenable); if (abl.reenable) report_current_position(); } - G29_RETURN(false); + G29_RETURN(false, false); } // parser.seen_test('W') #else @@ -337,13 +341,13 @@ G29_TYPE GcodeSuite::G29() { // Jettison bed leveling data if (!seen_w && parser.seen_test('J')) { reset_bed_level(); - G29_RETURN(false); + G29_RETURN(false, false); } abl.verbose_level = parser.intval('V'); if (!WITHIN(abl.verbose_level, 0, 4)) { SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); - G29_RETURN(false); + G29_RETURN(false, false); } abl.dryrun = parser.boolval('D') || TERN0(PROBE_MANUALLY, no_action); @@ -364,11 +368,11 @@ G29_TYPE GcodeSuite::G29() { if (!WITHIN(abl.grid_points.x, 2, GRID_MAX_POINTS_X)) { SERIAL_ECHOLNPGM("?Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); - G29_RETURN(false); + G29_RETURN(false, false); } if (!WITHIN(abl.grid_points.y, 2, GRID_MAX_POINTS_Y)) { SERIAL_ECHOLNPGM("?Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); - G29_RETURN(false); + G29_RETURN(false, false); } abl.abl_points = abl.grid_points.x * abl.grid_points.y; @@ -403,7 +407,7 @@ G29_TYPE GcodeSuite::G29() { " F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y); } SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds."); - G29_RETURN(false); + G29_RETURN(false, false); } // Probe at the points of a lattice grid @@ -420,8 +424,6 @@ G29_TYPE GcodeSuite::G29() { planner.synchronize(); - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); - #if ENABLED(AUTO_BED_LEVELING_3POINT) if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling"); points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points @@ -429,6 +431,8 @@ G29_TYPE GcodeSuite::G29() { TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_LevelingStart()); #endif + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); + if (!faux) { remember_feedrate_scaling_off(); @@ -453,7 +457,7 @@ G29_TYPE GcodeSuite::G29() { #elif HAS_BED_PROBE if (probe.deploy()) { // (returns true on deploy failure) set_bed_leveling_enabled(abl.reenable); - G29_RETURN(false); + G29_RETURN(false, true); } #endif @@ -503,7 +507,7 @@ G29_TYPE GcodeSuite::G29() { } // For 'A' or 'Q' exit with success state - if (no_action) G29_RETURN(false); + if (no_action) G29_RETURN(false, true); if (abl.abl_probe_index == 0) { // For the initial G29 S2 save software endstop state @@ -578,14 +582,13 @@ G29_TYPE GcodeSuite::G29() { // Disable software endstops to allow manual adjustment // If G29 is not completed, they will not be re-enabled SET_SOFT_ENDSTOP_LOOSE(true); - G29_RETURN(false); + G29_RETURN(false, true); } else { // Leveling done! Fall through to G29 finishing code below SERIAL_ECHOLNPGM("Grid probing done."); // Re-enable software endstops, if needed SET_SOFT_ENDSTOP_LOOSE(false); - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); } #elif ENABLED(AUTO_BED_LEVELING_3POINT) @@ -597,7 +600,7 @@ G29_TYPE GcodeSuite::G29() { // Disable software endstops to allow manual adjustment // If G29 is not completed, they will not be re-enabled SET_SOFT_ENDSTOP_LOOSE(true); - G29_RETURN(false); + G29_RETURN(false, true); } else { @@ -615,8 +618,6 @@ G29_TYPE GcodeSuite::G29() { abl.reenable = false; } - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); - } #endif // AUTO_BED_LEVELING_3POINT @@ -912,14 +913,11 @@ G29_TYPE GcodeSuite::G29() { process_subcommands_now(F(Z_PROBE_END_SCRIPT)); #endif - TERN_(HAS_DWIN_E3V2_BASIC, DWIN_LevelingDone()); - TERN_(HAS_MULTI_HOTEND, if (abl.tool_index != 0) tool_change(abl.tool_index)); report_current_position(); - G29_RETURN(isnan(abl.measured_z)); - + G29_RETURN(isnan(abl.measured_z), true); } #endif // HAS_ABL_NOT_UBL From 044bf8ab7ef7045583c9da175b8ebddd2b750f84 Mon Sep 17 00:00:00 2001 From: Robby Candra Date: Sun, 10 Apr 2022 07:44:31 +0700 Subject: [PATCH 273/502] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20Clean=20up=20dead?= =?UTF-8?q?=20option=20(#24006)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 22dfdfc3d912..83105a9f0220 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -523,7 +523,7 @@ #define HAS_LCDPRINT 1 #endif -#if ANY(HAS_DISPLAY, HAS_DWIN_E3V2, GLOBAL_STATUS_MESSAGE) +#if ANY(HAS_DISPLAY, HAS_DWIN_E3V2) #define HAS_STATUS_MESSAGE 1 #endif From 9ab1a57d729cfa207adfe3ee6d24d40de3bb159c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Apr 2022 05:00:46 -0500 Subject: [PATCH 274/502] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Consolidate=20DGUS?= =?UTF-8?q?ScreenHandler=20class=20(#24067)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp | 6 - Marlin/src/lcd/extui/dgus/DGUSDisplay.h | 5 +- .../src/lcd/extui/dgus/DGUSScreenHandler.cpp | 2 +- Marlin/src/lcd/extui/dgus/DGUSScreenHandler.h | 5 +- .../lcd/extui/dgus/DGUSScreenHandlerBase.h | 241 ++++++++++++++++ .../extui/dgus/fysetc/DGUSScreenHandler.cpp | 16 +- .../lcd/extui/dgus/fysetc/DGUSScreenHandler.h | 219 +-------------- .../extui/dgus/hiprecy/DGUSScreenHandler.cpp | 5 +- .../extui/dgus/hiprecy/DGUSScreenHandler.h | 219 +-------------- .../src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp | 86 +++--- .../lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 150 +++++----- .../lcd/extui/dgus/mks/DGUSScreenHandler.h | 265 ++---------------- .../lcd/extui/dgus/origin/DGUSScreenHandler.h | 219 +-------------- Marlin/src/module/settings.cpp | 2 +- 14 files changed, 410 insertions(+), 1030 deletions(-) create mode 100644 Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp index e2f11502e7d8..6fa188bf5ff3 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp @@ -109,12 +109,6 @@ void DGUSDisplay::WriteVariable(uint16_t adr, int8_t value) { WriteVariable(adr, static_cast(&value), sizeof(int8_t)); } -#if ENABLED(DGUS_LCD_UI_MKS) - void DGUSDisplay::MKS_WriteVariable(uint16_t adr, uint8_t value) { - WriteVariable(adr, static_cast(&value), sizeof(uint8_t)); - } -#endif - void DGUSDisplay::WriteVariable(uint16_t adr, long value) { union { long l; char lb[4]; } endian; char tmp[4]; diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h index 17303c689bb9..b6773db03be9 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h @@ -50,6 +50,8 @@ typedef enum : uint8_t { DGUS_WAIT_TELEGRAM, //< LEN received, Waiting for to receive all bytes. } rx_datagram_state_t; +constexpr uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (value >> 8U); } + // Low-Level access to the display. class DGUSDisplay { public: @@ -66,8 +68,6 @@ class DGUSDisplay { static void WriteVariable(uint16_t adr, uint8_t value); static void WriteVariable(uint16_t adr, int8_t value); static void WriteVariable(uint16_t adr, long value); - static void MKS_WriteVariable(uint16_t adr, uint8_t value); - // Utility functions for bridging ui_api and dbus template @@ -105,7 +105,6 @@ class DGUSDisplay { static void WritePGM(const char str[], uint8_t len); static void ProcessRx(); - static uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (value >> 8U); } static rx_datagram_state_t rx_datagram_state; static uint8_t rx_datagram_len; static bool Initialized, no_reentrance; diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index 46d3506254a1..dc872bff3b0e 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -40,7 +40,7 @@ #include "../../../feature/powerloss.h" #endif -DGUSScreenHandler ScreenHandler; +DGUSScreenHandlerClass ScreenHandler; uint16_t DGUSScreenHandler::ConfirmVP; diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.h index 8ee2761c899b..4b627fe0f69f 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.h @@ -42,9 +42,6 @@ #endif -// endianness swap -inline uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (value >> 8U); } - #if ENABLED(DGUS_LCD_UI_ORIGIN) #include "origin/DGUSScreenHandler.h" #elif ENABLED(DGUS_LCD_UI_MKS) @@ -55,7 +52,7 @@ inline uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (v #include "hiprecy/DGUSScreenHandler.h" #endif -extern DGUSScreenHandler ScreenHandler; +extern DGUSScreenHandlerClass ScreenHandler; // Helper to define a DGUS_VP_Variable for common use-cases. #define VPHELPER(VPADR, VPADRVAR, RXFPTR, TXFPTR) { \ diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h new file mode 100644 index 000000000000..07a108e84663 --- /dev/null +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h @@ -0,0 +1,241 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "DGUSDisplay.h" +#include "DGUSVPVariable.h" +#include "DGUSDisplayDef.h" + +#include "../../../inc/MarlinConfig.h" + +enum DGUSLCD_Screens : uint8_t; + +class DGUSScreenHandler { +public: + DGUSScreenHandler() = default; + + static bool loop(); + + // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen + // The bools specifying whether the strings are in RAM or FLASH. + static void sendinfoscreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); + } + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); + } + + static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + + // "M117" Message -- msg is a RAM ptr. + static void setstatusmessage(const char *msg); + // The same for messages from Flash + static void setstatusmessagePGM(PGM_P const msg); + // Callback for VP "Display wants to change screen on idle printer" + static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr); + // Callback for VP "Screen has been changed" + static void ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr); + + // Callback for VP "All Heaters Off" + static void HandleAllHeatersOff(DGUS_VP_Variable &var, void *val_ptr); + // Hook for "Change this temperature" + static void HandleTemperatureChanged(DGUS_VP_Variable &var, void *val_ptr); + // Hook for "Change Flowrate" + static void HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr); + #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) + // Hook for manual move option + static void HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr); + #endif + + // Hook for manual move. + static void HandleManualMove(DGUS_VP_Variable &var, void *val_ptr); + // Hook for manual extrude. + static void HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr); + // Hook for motor lock and unlook + static void HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr); + #if ENABLED(POWER_LOSS_RECOVERY) + // Hook for power loss recovery. + static void HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr); + #endif + // Hook for settings + static void HandleSettings(DGUS_VP_Variable &var, void *val_ptr); + static void HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr); + static void HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr); + + #if HAS_PID_HEATING + // Hook for "Change this temperature PID para" + static void HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr); + // Hook for PID autotune + static void HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr); + #endif + #if HAS_BED_PROBE + // Hook for "Change probe offset z" + static void HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr); + #endif + #if ENABLED(BABYSTEPPING) + // Hook for live z adjust action + static void HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr); + #endif + #if HAS_FAN + // Hook for fan control + static void HandleFanControl(DGUS_VP_Variable &var, void *val_ptr); + #endif + // Hook for heater control + static void HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr); + #if ENABLED(DGUS_PREHEAT_UI) + // Hook for preheat + static void HandlePreheat(DGUS_VP_Variable &var, void *val_ptr); + #endif + #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) + // Hook for filament load and unload filament option + static void HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr); + // Hook for filament load and unload + static void HandleFilamentLoadUnload(DGUS_VP_Variable &var); + #endif + + #if ENABLED(SDSUPPORT) + // Callback for VP "Display wants to change screen when there is a SD card" + static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr); + // Scroll buttons on the file listing screen. + static void DGUSLCD_SD_ScrollFilelist(DGUS_VP_Variable &var, void *val_ptr); + // File touched. + static void DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr); + // start print after confirmation received. + static void DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr); + // User hit the pause, resume or abort button. + static void DGUSLCD_SD_ResumePauseAbort(DGUS_VP_Variable &var, void *val_ptr); + // User confirmed the abort action + static void DGUSLCD_SD_ReallyAbort(DGUS_VP_Variable &var, void *val_ptr); + // User hit the tune button + static void DGUSLCD_SD_PrintTune(DGUS_VP_Variable &var, void *val_ptr); + // Send a single filename to the display. + static void DGUSLCD_SD_SendFilename(DGUS_VP_Variable &var); + // Marlin informed us that a new SD has been inserted. + static void SDCardInserted(); + // Marlin informed us that the SD Card has been removed(). + static void SDCardRemoved(); + // Marlin informed us about a bad SD Card. + static void SDCardError(); + #endif + + // OK Button on the Confirm screen. + static void ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr); + + // Update data after going to a new screen (by display or by GotoScreen) + // remember to store the last-displayed screen so it can be restored. + // (e.g., for popup messages) + static void UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup=false); + + // Recall the remembered screen. + static void PopToOldScreen(); + + // Make the display show the screen and update all VPs in it. + static void GotoScreen(DGUSLCD_Screens screen, bool ispopup = false); + + static void UpdateScreenVPData(); + + // Helpers to convert and transfer data to the display. + static void DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var); + static void DGUSLCD_SendStringToDisplay(DGUS_VP_Variable &var); + static void DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var); + static void DGUSLCD_SendTemperaturePID(DGUS_VP_Variable &var); + static void DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var); + static void DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var); + static void DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var); + + #if ENABLED(PRINTCOUNTER) + static void DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var); + static void DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var); + #endif + #if HAS_FAN + static void DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var); + #endif + static void DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var); + #if ENABLED(DGUS_UI_WAITING) + static void DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var); + #endif + + // Send a value from 0..100 to a variable with a range from 0..255 + static void DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr); + + template + static void DGUSLCD_SetValueDirectly(DGUS_VP_Variable &var, void *val_ptr) { + if (!var.memadr) return; + union { unsigned char tmp[sizeof(T)]; T t; } x; + unsigned char *ptr = (unsigned char*)val_ptr; + LOOP_L_N(i, sizeof(T)) x.tmp[i] = ptr[sizeof(T) - i - 1]; + *(T*)var.memadr = x.t; + } + + // Send a float value to the display. + // Display will get a 4-byte integer scaled to the number of digits: + // Tell the display the number of digits and it cheats by displaying a dot between... + template + static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) { + if (var.memadr) { + float f = *(float *)var.memadr; + f *= cpow(10, decimals); + dgusdisplay.WriteVariable(var.VP, (long)f); + } + } + + // Send a float value to the display. + // Display will get a 2-byte integer scaled to the number of digits: + // Tell the display the number of digits and it cheats by displaying a dot between... + template + static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { + if (var.memadr) { + float f = *(float *)var.memadr; + DEBUG_ECHOLNPAIR_F(" >> ", f, 6); + f *= cpow(10, decimals); + dgusdisplay.WriteVariable(var.VP, (int16_t)f); + } + } + + // Force an update of all VP on the current screen. + static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } + // Has all VPs sent to the screen + static bool IsScreenComplete() { return ScreenComplete; } + + static DGUSLCD_Screens getCurrentScreen() { return current_screen; } + + static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } + +protected: + static DGUSLCD_Screens current_screen; //< currently on screen + static constexpr uint8_t NUM_PAST_SCREENS = 4; + static DGUSLCD_Screens past_screens[NUM_PAST_SCREENS]; //< LIFO with past screens for the "back" button. + + static uint8_t update_ptr; //< Last sent entry in the VPList for the actual screen. + static uint16_t skipVP; //< When updating the screen data, skip this one, because the user is interacting with it. + static bool ScreenComplete; //< All VPs sent to screen? + + static uint16_t ConfirmVP; //< context for confirm screen (VP that will be emulated-sent on "OK"). + + #if ENABLED(SDSUPPORT) + static int16_t top_file; //< file on top of file chooser + static int16_t file_to_print; //< touched file to be confirmed + #endif + + static void (*confirm_action_cb)(); +}; diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp index e7466bfe087f..1f72c685fb81 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp @@ -333,9 +333,9 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { if (filament_data.action == 0) { // Go back to utility screen #if HAS_HOTEND thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E0); - #endif - #if HAS_MULTI_HOTEND - thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E1); + #if HAS_MULTI_HOTEND + thermalManager.setTargetHotend(e_temp, ExtUI::extruder_t::E1); + #endif #endif GotoScreen(DGUSLCD_SCREEN_UTILITY); } @@ -348,7 +348,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { thermalManager.setTargetHotend(e_temp, filament_data.extruder); break; #endif - #if HAS_MULTI_EXTRUDER + #if HAS_MULTI_HOTEND case VP_E1_FILAMENT_LOAD_UNLOAD: filament_data.extruder = ExtUI::extruder_t::E1; thermalManager.setTargetHotend(e_temp, filament_data.extruder); @@ -413,14 +413,10 @@ bool DGUSScreenHandler::loop() { if (!booted && ELAPSED(ms, BOOTSCREEN_TIMEOUT)) { booted = true; - - if (TERN0(POWER_LOSS_RECOVERY, recovery.valid())) - GotoScreen(DGUSLCD_SCREEN_POWER_LOSS); - else - GotoScreen(DGUSLCD_SCREEN_MAIN); + GotoScreen(TERN0(POWER_LOSS_RECOVERY, recovery.valid()) ? DGUSLCD_SCREEN_POWER_LOSS : DGUSLCD_SCREEN_MAIN); } - #endif + return IsScreenComplete(); } diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h index 0bdf06ed7d57..73e3527d7e7c 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h @@ -21,224 +21,9 @@ */ #pragma once -#include "../DGUSDisplay.h" -#include "../DGUSVPVariable.h" -#include "../DGUSDisplayDef.h" +#include "../DGUSScreenHandlerBase.h" -#include "../../../../inc/MarlinConfig.h" - -enum DGUSLCD_Screens : uint8_t; - -class DGUSScreenHandler { -public: - DGUSScreenHandler() = default; - - static bool loop(); - - // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen - // The bools specifying whether the strings are in RAM or FLASH. - static void sendinfoscreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { - sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); - } - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { - sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); - } - - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - - // "M117" Message -- msg is a RAM ptr. - static void setstatusmessage(const char *msg); - // The same for messages from Flash - static void setstatusmessagePGM(PGM_P const msg); - // Callback for VP "Display wants to change screen on idle printer" - static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr); - // Callback for VP "Screen has been changed" - static void ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr); - - // Callback for VP "All Heaters Off" - static void HandleAllHeatersOff(DGUS_VP_Variable &var, void *val_ptr); - // Hook for "Change this temperature" - static void HandleTemperatureChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for "Change Flowrate" - static void HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - // Hook for manual move option - static void HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr); - #endif - - // Hook for manual move. - static void HandleManualMove(DGUS_VP_Variable &var, void *val_ptr); - // Hook for manual extrude. - static void HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr); - // Hook for motor lock and unlook - static void HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(POWER_LOSS_RECOVERY) - // Hook for power loss recovery. - static void HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr); - #endif - // Hook for settings - static void HandleSettings(DGUS_VP_Variable &var, void *val_ptr); - static void HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr); - static void HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr); - - #if HAS_PID_HEATING - // Hook for "Change this temperature PID para" - static void HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for PID autotune - static void HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if HAS_BED_PROBE - // Hook for "Change probe offset z" - static void HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if ENABLED(BABYSTEPPING) - // Hook for live z adjust action - static void HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if HAS_FAN - // Hook for fan control - static void HandleFanControl(DGUS_VP_Variable &var, void *val_ptr); - #endif - // Hook for heater control - static void HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(DGUS_PREHEAT_UI) - // Hook for preheat - static void HandlePreheat(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - // Hook for filament load and unload filament option - static void HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr); - // Hook for filament load and unload - static void HandleFilamentLoadUnload(DGUS_VP_Variable &var); - #endif - - #if ENABLED(SDSUPPORT) - // Callback for VP "Display wants to change screen when there is a SD card" - static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr); - // Scroll buttons on the file listing screen. - static void DGUSLCD_SD_ScrollFilelist(DGUS_VP_Variable &var, void *val_ptr); - // File touched. - static void DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr); - // start print after confirmation received. - static void DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr); - // User hit the pause, resume or abort button. - static void DGUSLCD_SD_ResumePauseAbort(DGUS_VP_Variable &var, void *val_ptr); - // User confirmed the abort action - static void DGUSLCD_SD_ReallyAbort(DGUS_VP_Variable &var, void *val_ptr); - // User hit the tune button - static void DGUSLCD_SD_PrintTune(DGUS_VP_Variable &var, void *val_ptr); - // Send a single filename to the display. - static void DGUSLCD_SD_SendFilename(DGUS_VP_Variable &var); - // Marlin informed us that a new SD has been inserted. - static void SDCardInserted(); - // Marlin informed us that the SD Card has been removed(). - static void SDCardRemoved(); - // Marlin informed us about a bad SD Card. - static void SDCardError(); - #endif - - // OK Button the Confirm screen. - static void ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr); - - // Update data after went to new screen (by display or by GotoScreen) - // remember: store the last-displayed screen, so it can get returned to. - // (e.g for pop up messages) - static void UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup=false); - - // Recall the remembered screen. - static void PopToOldScreen(); - - // Make the display show the screen and update all VPs in it. - static void GotoScreen(DGUSLCD_Screens screen, bool ispopup = false); - - static void UpdateScreenVPData(); - - // Helpers to convert and transfer data to the display. - static void DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var); - static void DGUSLCD_SendTemperaturePID(DGUS_VP_Variable &var); - static void DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var); - - #if ENABLED(PRINTCOUNTER) - static void DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var); - #endif - #if HAS_FAN - static void DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var); - #endif - static void DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var); - #if ENABLED(DGUS_UI_WAITING) - static void DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var); - #endif - - // Send a value from 0..100 to a variable with a range from 0..255 - static void DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr); - - template - static void DGUSLCD_SetValueDirectly(DGUS_VP_Variable &var, void *val_ptr) { - if (!var.memadr) return; - union { unsigned char tmp[sizeof(T)]; T t; } x; - unsigned char *ptr = (unsigned char*)val_ptr; - LOOP_L_N(i, sizeof(T)) x.tmp[i] = ptr[sizeof(T) - i - 1]; - *(T*)var.memadr = x.t; - } - - // Send a float value to the display. - // Display will get a 4-byte integer scaled to the number of digits: - // Tell the display the number of digits and it cheats by displaying a dot between... - template - static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - float f = *(float *)var.memadr; - f *= cpow(10, decimals); - dgusdisplay.WriteVariable(var.VP, (long)f); - } - } - - // Send a float value to the display. - // Display will get a 2-byte integer scaled to the number of digits: - // Tell the display the number of digits and it cheats by displaying a dot between... - template - static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); - f *= cpow(10, decimals); - dgusdisplay.WriteVariable(var.VP, (int16_t)f); - } - } - - // Force an update of all VP on the current screen. - static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } - // Has all VPs sent to the screen - static bool IsScreenComplete() { return ScreenComplete; } - - static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - - static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } - -private: - static DGUSLCD_Screens current_screen; //< currently on screen - static constexpr uint8_t NUM_PAST_SCREENS = 4; - static DGUSLCD_Screens past_screens[NUM_PAST_SCREENS]; //< LIFO with past screens for the "back" button. - - static uint8_t update_ptr; //< Last sent entry in the VPList for the actual screen. - static uint16_t skipVP; //< When updating the screen data, skip this one, because the user is interacting with it. - static bool ScreenComplete; //< All VPs sent to screen? - - static uint16_t ConfirmVP; //< context for confirm screen (VP that will be emulated-sent on "OK"). - - #if ENABLED(SDSUPPORT) - static int16_t top_file; //< file on top of file chooser - static int16_t file_to_print; //< touched file to be confirmed - #endif - - static void (*confirm_action_cb)(); -}; +typedef DGUSScreenHandler DGUSScreenHandlerClass; #if ENABLED(POWER_LOSS_RECOVERY) #define PLR_SCREEN_RECOVER DGUSLCD_SCREEN_SDPRINTMANIPULATION diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp index d64ac143b031..f04bef2fd8da 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp @@ -411,9 +411,12 @@ bool DGUSScreenHandler::loop() { if (!booted && TERN0(POWER_LOSS_RECOVERY, recovery.valid())) booted = true; - if (!booted && ELAPSED(ms, TERN(USE_MKS_GREEN_UI, 1000, BOOTSCREEN_TIMEOUT))) + if (!booted && ELAPSED(ms, BOOTSCREEN_TIMEOUT)) { booted = true; + GotoScreen(TERN0(POWER_LOSS_RECOVERY, recovery.valid()) ? DGUSLCD_SCREEN_POWER_LOSS : DGUSLCD_SCREEN_MAIN); + } #endif + return IsScreenComplete(); } diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h index 0bdf06ed7d57..73e3527d7e7c 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h @@ -21,224 +21,9 @@ */ #pragma once -#include "../DGUSDisplay.h" -#include "../DGUSVPVariable.h" -#include "../DGUSDisplayDef.h" +#include "../DGUSScreenHandlerBase.h" -#include "../../../../inc/MarlinConfig.h" - -enum DGUSLCD_Screens : uint8_t; - -class DGUSScreenHandler { -public: - DGUSScreenHandler() = default; - - static bool loop(); - - // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen - // The bools specifying whether the strings are in RAM or FLASH. - static void sendinfoscreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { - sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); - } - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { - sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); - } - - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - - // "M117" Message -- msg is a RAM ptr. - static void setstatusmessage(const char *msg); - // The same for messages from Flash - static void setstatusmessagePGM(PGM_P const msg); - // Callback for VP "Display wants to change screen on idle printer" - static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr); - // Callback for VP "Screen has been changed" - static void ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr); - - // Callback for VP "All Heaters Off" - static void HandleAllHeatersOff(DGUS_VP_Variable &var, void *val_ptr); - // Hook for "Change this temperature" - static void HandleTemperatureChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for "Change Flowrate" - static void HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - // Hook for manual move option - static void HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr); - #endif - - // Hook for manual move. - static void HandleManualMove(DGUS_VP_Variable &var, void *val_ptr); - // Hook for manual extrude. - static void HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr); - // Hook for motor lock and unlook - static void HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(POWER_LOSS_RECOVERY) - // Hook for power loss recovery. - static void HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr); - #endif - // Hook for settings - static void HandleSettings(DGUS_VP_Variable &var, void *val_ptr); - static void HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr); - static void HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr); - - #if HAS_PID_HEATING - // Hook for "Change this temperature PID para" - static void HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for PID autotune - static void HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if HAS_BED_PROBE - // Hook for "Change probe offset z" - static void HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if ENABLED(BABYSTEPPING) - // Hook for live z adjust action - static void HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if HAS_FAN - // Hook for fan control - static void HandleFanControl(DGUS_VP_Variable &var, void *val_ptr); - #endif - // Hook for heater control - static void HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(DGUS_PREHEAT_UI) - // Hook for preheat - static void HandlePreheat(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - // Hook for filament load and unload filament option - static void HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr); - // Hook for filament load and unload - static void HandleFilamentLoadUnload(DGUS_VP_Variable &var); - #endif - - #if ENABLED(SDSUPPORT) - // Callback for VP "Display wants to change screen when there is a SD card" - static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr); - // Scroll buttons on the file listing screen. - static void DGUSLCD_SD_ScrollFilelist(DGUS_VP_Variable &var, void *val_ptr); - // File touched. - static void DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr); - // start print after confirmation received. - static void DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr); - // User hit the pause, resume or abort button. - static void DGUSLCD_SD_ResumePauseAbort(DGUS_VP_Variable &var, void *val_ptr); - // User confirmed the abort action - static void DGUSLCD_SD_ReallyAbort(DGUS_VP_Variable &var, void *val_ptr); - // User hit the tune button - static void DGUSLCD_SD_PrintTune(DGUS_VP_Variable &var, void *val_ptr); - // Send a single filename to the display. - static void DGUSLCD_SD_SendFilename(DGUS_VP_Variable &var); - // Marlin informed us that a new SD has been inserted. - static void SDCardInserted(); - // Marlin informed us that the SD Card has been removed(). - static void SDCardRemoved(); - // Marlin informed us about a bad SD Card. - static void SDCardError(); - #endif - - // OK Button the Confirm screen. - static void ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr); - - // Update data after went to new screen (by display or by GotoScreen) - // remember: store the last-displayed screen, so it can get returned to. - // (e.g for pop up messages) - static void UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup=false); - - // Recall the remembered screen. - static void PopToOldScreen(); - - // Make the display show the screen and update all VPs in it. - static void GotoScreen(DGUSLCD_Screens screen, bool ispopup = false); - - static void UpdateScreenVPData(); - - // Helpers to convert and transfer data to the display. - static void DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var); - static void DGUSLCD_SendTemperaturePID(DGUS_VP_Variable &var); - static void DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var); - - #if ENABLED(PRINTCOUNTER) - static void DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var); - #endif - #if HAS_FAN - static void DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var); - #endif - static void DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var); - #if ENABLED(DGUS_UI_WAITING) - static void DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var); - #endif - - // Send a value from 0..100 to a variable with a range from 0..255 - static void DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr); - - template - static void DGUSLCD_SetValueDirectly(DGUS_VP_Variable &var, void *val_ptr) { - if (!var.memadr) return; - union { unsigned char tmp[sizeof(T)]; T t; } x; - unsigned char *ptr = (unsigned char*)val_ptr; - LOOP_L_N(i, sizeof(T)) x.tmp[i] = ptr[sizeof(T) - i - 1]; - *(T*)var.memadr = x.t; - } - - // Send a float value to the display. - // Display will get a 4-byte integer scaled to the number of digits: - // Tell the display the number of digits and it cheats by displaying a dot between... - template - static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - float f = *(float *)var.memadr; - f *= cpow(10, decimals); - dgusdisplay.WriteVariable(var.VP, (long)f); - } - } - - // Send a float value to the display. - // Display will get a 2-byte integer scaled to the number of digits: - // Tell the display the number of digits and it cheats by displaying a dot between... - template - static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); - f *= cpow(10, decimals); - dgusdisplay.WriteVariable(var.VP, (int16_t)f); - } - } - - // Force an update of all VP on the current screen. - static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } - // Has all VPs sent to the screen - static bool IsScreenComplete() { return ScreenComplete; } - - static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - - static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } - -private: - static DGUSLCD_Screens current_screen; //< currently on screen - static constexpr uint8_t NUM_PAST_SCREENS = 4; - static DGUSLCD_Screens past_screens[NUM_PAST_SCREENS]; //< LIFO with past screens for the "back" button. - - static uint8_t update_ptr; //< Last sent entry in the VPList for the actual screen. - static uint16_t skipVP; //< When updating the screen data, skip this one, because the user is interacting with it. - static bool ScreenComplete; //< All VPs sent to screen? - - static uint16_t ConfirmVP; //< context for confirm screen (VP that will be emulated-sent on "OK"). - - #if ENABLED(SDSUPPORT) - static int16_t top_file; //< file on top of file chooser - static int16_t file_to_print; //< touched file to be confirmed - #endif - - static void (*confirm_action_cb)(); -}; +typedef DGUSScreenHandler DGUSScreenHandlerClass; #if ENABLED(POWER_LOSS_RECOVERY) #define PLR_SCREEN_RECOVER DGUSLCD_SCREEN_SDPRINTMANIPULATION diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp index a7ec99d98281..86920d6841c9 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp @@ -69,7 +69,7 @@ void MKS_reset_settings() { { 20, 20 }, { 20, 20 }, { X_CENTER, Y_CENTER } }; - mks_language_index = 0; + mks_language_index = MKS_SimpleChinese; COPY(mks_corner_offsets, init_dgus_level_offsets); mks_park_pos.set(20, 20, 10); mks_min_extrusion_temp = 0; @@ -560,8 +560,8 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { VPHELPER(VP_PID_AUTOTUNE_E0, nullptr, ScreenHandler.HandlePIDAutotune, nullptr), #endif #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - VPHELPER(VP_LOAD_Filament, nullptr, ScreenHandler.MKS_FilamentLoad, nullptr), - VPHELPER(VP_UNLOAD_Filament, nullptr, ScreenHandler.MKS_FilamentUnLoad, nullptr), + VPHELPER(VP_LOAD_Filament, nullptr, ScreenHandler.FilamentLoad, nullptr), + VPHELPER(VP_UNLOAD_Filament, nullptr, ScreenHandler.FilamentUnLoad, nullptr), VPHELPER(VP_Filament_distance, &distanceFilament, ScreenHandler.GetManualFilament, ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_Filament_speed, &filamentSpeed_mm_s, ScreenHandler.GetManualFilamentSpeed, ScreenHandler.DGUSLCD_SendWordValueToDisplay), #endif @@ -618,16 +618,16 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { VPHELPER(VP_ZPos, ¤t_position.z, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>), // Level Point Set - VPHELPER(VP_Level_Point_One_X, &mks_corner_offsets[0].x, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Level_Point_One_Y, &mks_corner_offsets[0].y, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Level_Point_Two_X, &mks_corner_offsets[1].x, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Level_Point_Two_Y, &mks_corner_offsets[1].y, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Level_Point_Three_X, &mks_corner_offsets[2].x, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Level_Point_Three_Y, &mks_corner_offsets[2].y, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Level_Point_Four_X, &mks_corner_offsets[3].x, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Level_Point_Four_Y, &mks_corner_offsets[3].y, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Level_Point_Five_X, &mks_corner_offsets[4].x, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Level_Point_Five_Y, &mks_corner_offsets[4].y, ScreenHandler.HandleChangeLevelPoint_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Level_Point_One_X, &mks_corner_offsets[0].x, ScreenHandler.HandleChangeLevelPoint, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Level_Point_One_Y, &mks_corner_offsets[0].y, ScreenHandler.HandleChangeLevelPoint, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Level_Point_Two_X, &mks_corner_offsets[1].x, ScreenHandler.HandleChangeLevelPoint, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Level_Point_Two_Y, &mks_corner_offsets[1].y, ScreenHandler.HandleChangeLevelPoint, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Level_Point_Three_X, &mks_corner_offsets[2].x, ScreenHandler.HandleChangeLevelPoint, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Level_Point_Three_Y, &mks_corner_offsets[2].y, ScreenHandler.HandleChangeLevelPoint, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Level_Point_Four_X, &mks_corner_offsets[3].x, ScreenHandler.HandleChangeLevelPoint, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Level_Point_Four_Y, &mks_corner_offsets[3].y, ScreenHandler.HandleChangeLevelPoint, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Level_Point_Five_X, &mks_corner_offsets[4].x, ScreenHandler.HandleChangeLevelPoint, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Level_Point_Five_Y, &mks_corner_offsets[4].y, ScreenHandler.HandleChangeLevelPoint, ScreenHandler.DGUSLCD_SendWordValueToDisplay), // Print Progress VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, ScreenHandler.DGUSLCD_SendPrintProgressToDisplay), @@ -639,50 +639,50 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { VPHELPER(VP_SD_FileSelect_Back, nullptr, ScreenHandler.SD_FileBack, nullptr), // Print Time - VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintTimeToDisplay_MKS), + VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintTimeToDisplay), #if ENABLED(PRINTCOUNTER) VPHELPER_STR(VP_PrintAccTime, nullptr, VP_PrintAccTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintAccTimeToDisplay), VPHELPER_STR(VP_PrintsTotal, nullptr, VP_PrintsTotal_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintsTotalToDisplay), #endif - VPHELPER(VP_X_STEP_PER_MM, &planner.settings.axis_steps_per_mm[X_AXIS], ScreenHandler.HandleStepPerMMChanged_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), - VPHELPER(VP_Y_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Y_AXIS], ScreenHandler.HandleStepPerMMChanged_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), - VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], ScreenHandler.HandleStepPerMMChanged_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_X_STEP_PER_MM, &planner.settings.axis_steps_per_mm[X_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_Y_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Y_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_Z_STEP_PER_MM, &planner.settings.axis_steps_per_mm[Z_AXIS], ScreenHandler.HandleStepPerMMChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), - VPHELPER(VP_X_MAX_SPEED, &planner.settings.max_feedrate_mm_s[X_AXIS], ScreenHandler.HandleMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), - VPHELPER(VP_Y_MAX_SPEED, &planner.settings.max_feedrate_mm_s[Y_AXIS], ScreenHandler.HandleMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), - VPHELPER(VP_Z_MAX_SPEED, &planner.settings.max_feedrate_mm_s[Z_AXIS], ScreenHandler.HandleMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_X_MAX_SPEED, &planner.settings.max_feedrate_mm_s[X_AXIS], ScreenHandler.HandleMaxSpeedChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_Y_MAX_SPEED, &planner.settings.max_feedrate_mm_s[Y_AXIS], ScreenHandler.HandleMaxSpeedChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_Z_MAX_SPEED, &planner.settings.max_feedrate_mm_s[Z_AXIS], ScreenHandler.HandleMaxSpeedChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), #if HAS_HOTEND - VPHELPER(VP_E0_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(0)], ScreenHandler.HandleExtruderMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_E0_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(0)], ScreenHandler.HandleExtruderMaxSpeedChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), #if HAS_MULTI_HOTEND - VPHELPER(VP_E1_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(1)], ScreenHandler.HandleExtruderMaxSpeedChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_E1_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(1)], ScreenHandler.HandleExtruderMaxSpeedChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), #endif #endif - VPHELPER(VP_X_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[X_AXIS], ScreenHandler.HandleMaxAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Y_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[Y_AXIS], ScreenHandler.HandleMaxAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Z_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[Z_AXIS], ScreenHandler.HandleMaxAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_X_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[X_AXIS], ScreenHandler.HandleMaxAccChange, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Y_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[Y_AXIS], ScreenHandler.HandleMaxAccChange, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Z_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[Z_AXIS], ScreenHandler.HandleMaxAccChange, ScreenHandler.DGUSLCD_SendWordValueToDisplay), #if HAS_HOTEND - VPHELPER(VP_E0_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(0)], ScreenHandler.HandleExtruderAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_E0_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(0)], ScreenHandler.HandleExtruderAccChange, ScreenHandler.DGUSLCD_SendWordValueToDisplay), #if HAS_MULTI_HOTEND - VPHELPER(VP_E1_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)], ScreenHandler.HandleExtruderAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_E1_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)], ScreenHandler.HandleExtruderAccChange, ScreenHandler.DGUSLCD_SendWordValueToDisplay), #endif #endif - VPHELPER(VP_TRAVEL_SPEED, (uint16_t *)&planner.settings.travel_acceleration, ScreenHandler.HandleTravelAccChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), - VPHELPER(VP_FEEDRATE_MIN_SPEED, (uint16_t *)&planner.settings.min_feedrate_mm_s, ScreenHandler.HandleFeedRateMinChange_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), - VPHELPER(VP_T_F_SPEED, (uint16_t *)&planner.settings.min_travel_feedrate_mm_s, ScreenHandler.HandleMin_T_F_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), - VPHELPER(VP_ACC_SPEED, (uint16_t *)&planner.settings.acceleration, ScreenHandler.HandleAccChange_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_TRAVEL_SPEED, (uint16_t *)&planner.settings.travel_acceleration, ScreenHandler.HandleTravelAccChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_FEEDRATE_MIN_SPEED, (uint16_t *)&planner.settings.min_feedrate_mm_s, ScreenHandler.HandleFeedRateMinChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_T_F_SPEED, (uint16_t *)&planner.settings.min_travel_feedrate_mm_s, ScreenHandler.HandleMin_T_F, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_ACC_SPEED, (uint16_t *)&planner.settings.acceleration, ScreenHandler.HandleAccChange, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_X_PARK_POS, &mks_park_pos.x, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Y_PARK_POS, &mks_park_pos.y, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), - VPHELPER(VP_Z_PARK_POS, &mks_park_pos.z, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_X_PARK_POS, &mks_park_pos.x, ScreenHandler.GetParkPos, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Y_PARK_POS, &mks_park_pos.y, ScreenHandler.GetParkPos, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_Z_PARK_POS, &mks_park_pos.z, ScreenHandler.GetParkPos, ScreenHandler.DGUSLCD_SendWordValueToDisplay), #if ENABLED(PREVENT_COLD_EXTRUSION) - VPHELPER(VP_MIN_EX_T, &thermalManager.extrude_min_temp, ScreenHandler.HandleGetExMinTemp_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), + VPHELPER(VP_MIN_EX_T, &thermalManager.extrude_min_temp, ScreenHandler.HandleGetExMinTemp, ScreenHandler.DGUSLCD_SendWordValueToDisplay), #endif #if ENABLED(SENSORLESS_HOMING) // TMC SENSORLESS Setting @@ -725,8 +725,8 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { #endif VPHELPER(VP_EEPROM_CTRL, nullptr, ScreenHandler.EEPROM_CTRL, nullptr), - VPHELPER(VP_LEVEL_BUTTON, nullptr, ScreenHandler.Level_Ctrl_MKS, nullptr), - VPHELPER(VP_LANGUAGE_CHANGE, nullptr, ScreenHandler.LanguageChange_MKS, nullptr), + VPHELPER(VP_LEVEL_BUTTON, nullptr, ScreenHandler.Level_Ctrl, nullptr), + VPHELPER(VP_LANGUAGE_CHANGE, nullptr, ScreenHandler.LanguageChange, nullptr), //VPHELPER(VP_SD_Print_LiveAdjustZ, nullptr, ScreenHandler.HandleLiveAdjustZ, nullptr), @@ -743,9 +743,9 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { VPHELPER(VP_AutoTurnOffSw, nullptr, ScreenHandler.GetTurnOffCtrl, nullptr), #if HAS_HOTEND - VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], ScreenHandler.HandleStepPerMMExtruderChanged_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), #if HAS_MULTI_HOTEND - VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], ScreenHandler.HandleStepPerMMExtruderChanged_MKS, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), + VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], ScreenHandler.HandleStepPerMMExtruderChanged, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>), #endif #endif @@ -791,10 +791,10 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { //{.VP = VP_MSGSTR3, .memadr = nullptr, .size = VP_MSGSTR3_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = ScreenHandler.DGUSLCD_SendStringToDisplayPGM}, //{.VP = VP_MSGSTR4, .memadr = nullptr, .size = VP_MSGSTR4_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = ScreenHandler.DGUSLCD_SendStringToDisplayPGM}, - {.VP = VP_MSGSTR1, .memadr = nullptr, .size = VP_MSGSTR1_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = ScreenHandler.DGUSLCD_SendStringToDisplay_Language_MKS}, - {.VP = VP_MSGSTR2, .memadr = nullptr, .size = VP_MSGSTR2_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = ScreenHandler.DGUSLCD_SendStringToDisplay_Language_MKS}, - {.VP = VP_MSGSTR3, .memadr = nullptr, .size = VP_MSGSTR3_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = ScreenHandler.DGUSLCD_SendStringToDisplay_Language_MKS}, - {.VP = VP_MSGSTR4, .memadr = nullptr, .size = VP_MSGSTR4_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = ScreenHandler.DGUSLCD_SendStringToDisplay_Language_MKS}, + {.VP = VP_MSGSTR1, .memadr = nullptr, .size = VP_MSGSTR1_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = ScreenHandler.DGUSLCD_SendStringToDisplay_Language}, + {.VP = VP_MSGSTR2, .memadr = nullptr, .size = VP_MSGSTR2_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = ScreenHandler.DGUSLCD_SendStringToDisplay_Language}, + {.VP = VP_MSGSTR3, .memadr = nullptr, .size = VP_MSGSTR3_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = ScreenHandler.DGUSLCD_SendStringToDisplay_Language}, + {.VP = VP_MSGSTR4, .memadr = nullptr, .size = VP_MSGSTR4_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = ScreenHandler.DGUSLCD_SendStringToDisplay_Language}, VPHELPER(0, 0, 0, 0) // must be last entry. }; diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index bfa070df8736..35c2de05497f 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -52,36 +52,36 @@ #endif bool DGUSAutoTurnOff = false; -uint8_t mks_language_index; // Initialized by settings.load() +MKS_Language mks_language_index; // Initialized by settings.load() // endianness swap uint32_t swap32(const uint32_t value) { return (value & 0x000000FFU) << 24U | (value & 0x0000FF00U) << 8U | (value & 0x00FF0000U) >> 8U | (value & 0xFF000000U) >> 24U; } #if 0 -void DGUSScreenHandler::sendinfoscreen_ch_mks(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4) { +void DGUSScreenHandlerMKS::sendinfoscreen_ch(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4) { dgusdisplay.WriteVariable(VP_MSGSTR1, line1, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR2, line2, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR3, line3, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR4, line4, 32, true); } -void DGUSScreenHandler::sendinfoscreen_en_mks(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4) { +void DGUSScreenHandlerMKS::sendinfoscreen_en(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4) { dgusdisplay.WriteVariable(VP_MSGSTR1, line1, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR2, line2, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR3, line3, 32, true); dgusdisplay.WriteVariable(VP_MSGSTR4, line4, 32, true); } -void DGUSScreenHandler::sendinfoscreen_mks(const void *line1, const void *line2, const void *line3, const void *line4, uint16_t language) { +void DGUSScreenHandlerMKS::sendinfoscreen(const void *line1, const void *line2, const void *line3, const void *line4, uint16_t language) { if (language == MKS_English) - DGUSScreenHandler::sendinfoscreen_en_mks((char *)line1, (char *)line2, (char *)line3, (char *)line4); + DGUSScreenHandlerMKS::sendinfoscreen_en((char *)line1, (char *)line2, (char *)line3, (char *)line4); else if (language == MKS_SimpleChinese) - DGUSScreenHandler::sendinfoscreen_ch_mks((uint16_t *)line1, (uint16_t *)line2, (uint16_t *)line3, (uint16_t *)line4); + DGUSScreenHandlerMKS::sendinfoscreen_ch((uint16_t *)line1, (uint16_t *)line2, (uint16_t *)line3, (uint16_t *)line4); } #endif -void DGUSScreenHandler::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) { +void DGUSScreenHandlerMKS::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { //DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP); //DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr); @@ -91,14 +91,14 @@ void DGUSScreenHandler::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) { } } -void DGUSScreenHandler::DGUSLCD_SendBabyStepToDisplay_MKS(DGUS_VP_Variable &var) { +void DGUSScreenHandlerMKS::DGUSLCD_SendBabyStepToDisplay(DGUS_VP_Variable &var) { float value = current_position.z; DEBUG_ECHOLNPAIR_F(" >> ", value, 6); value *= cpow(10, 2); dgusdisplay.WriteVariable(VP_SD_Print_Baby, (uint16_t)value); } -void DGUSScreenHandler::DGUSLCD_SendPrintTimeToDisplay_MKS(DGUS_VP_Variable &var) { +void DGUSScreenHandlerMKS::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) { duration_t elapsed = print_job_timer.duration(); uint32_t time = elapsed.value; dgusdisplay.WriteVariable(VP_PrintTime_H, uint16_t(time / 3600)); @@ -106,7 +106,7 @@ void DGUSScreenHandler::DGUSLCD_SendPrintTimeToDisplay_MKS(DGUS_VP_Variable &var dgusdisplay.WriteVariable(VP_PrintTime_S, uint16_t((time % 3600) % 60)); } -void DGUSScreenHandler::DGUSLCD_SetUint8(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::DGUSLCD_SetUint8(DGUS_VP_Variable &var, void *val_ptr) { if (var.memadr) { const uint16_t value = swap16(*(uint16_t*)val_ptr); DEBUG_ECHOLNPGM("FAN value get:", value); @@ -115,13 +115,13 @@ void DGUSScreenHandler::DGUSLCD_SetUint8(DGUS_VP_Variable &var, void *val_ptr) { } } -void DGUSScreenHandler::DGUSLCD_SendGbkToDisplay(DGUS_VP_Variable &var) { +void DGUSScreenHandlerMKS::DGUSLCD_SendGbkToDisplay(DGUS_VP_Variable &var) { DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr); uint16_t *tmp = (uint16_t*) var.memadr; dgusdisplay.WriteVariable(var.VP, tmp, var.size, true); } -void DGUSScreenHandler::DGUSLCD_SendStringToDisplay_Language_MKS(DGUS_VP_Variable &var) { +void DGUSScreenHandlerMKS::DGUSLCD_SendStringToDisplay_Language(DGUS_VP_Variable &var) { if (mks_language_index == MKS_English) { char *tmp = (char*) var.memadr; dgusdisplay.WriteVariable(var.VP, tmp, var.size, true); @@ -132,7 +132,7 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplay_Language_MKS(DGUS_VP_Variabl } } -void DGUSScreenHandler::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { +void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { #if ENABLED(SENSORLESS_HOMING) #if X_HAS_STEALTHCHOP tmc_step.x = stepperX.homing_threshold(); @@ -268,7 +268,7 @@ void DGUSScreenHandler::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { } #else - void DGUSScreenHandler::PrintReturn(DGUS_VP_Variable& var, void *val_ptr) { + void DGUSScreenHandlerMKS::PrintReturn(DGUS_VP_Variable& var, void *val_ptr) { uint16_t value = swap16(*(uint16_t*)val_ptr); if (value == 0x0F) GotoScreen(DGUSLCD_SCREEN_MAIN); } @@ -315,14 +315,14 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) { #endif } -void DGUSScreenHandler::ScreenBackChange(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::ScreenBackChange(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t target = swap16(*(uint16_t *)val_ptr); DEBUG_ECHOLNPGM(" back = 0x%x", target); switch (target) { } } -void DGUSScreenHandler::ZoffsetConfirm(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::ZoffsetConfirm(DGUS_VP_Variable &var, void *val_ptr) { settings.save(); if (printJobOngoing()) GotoScreen(MKSLCD_SCREEN_PRINT); @@ -330,7 +330,7 @@ void DGUSScreenHandler::ZoffsetConfirm(DGUS_VP_Variable &var, void *val_ptr) { GotoScreen(MKSLCD_SCREEN_PAUSE); } -void DGUSScreenHandler::GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr) { DEBUG_ECHOLNPGM("GetTurnOffCtrl\n"); const uint16_t value = swap16(*(uint16_t *)val_ptr); switch (value) { @@ -339,7 +339,7 @@ void DGUSScreenHandler::GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr) { } } -void DGUSScreenHandler::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr) { DEBUG_ECHOLNPGM("GetMinExtrudeTemp"); const uint16_t value = swap16(*(uint16_t *)val_ptr); TERN_(PREVENT_COLD_EXTRUSION, thermalManager.extrude_min_temp = value); @@ -347,7 +347,7 @@ void DGUSScreenHandler::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr) settings.save(); } -void DGUSScreenHandler::GetZoffsetDistance(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::GetZoffsetDistance(DGUS_VP_Variable &var, void *val_ptr) { DEBUG_ECHOLNPGM("GetZoffsetDistance"); const uint16_t value = swap16(*(uint16_t *)val_ptr); float val_distance = 0; @@ -361,12 +361,12 @@ void DGUSScreenHandler::GetZoffsetDistance(DGUS_VP_Variable &var, void *val_ptr) ZOffset_distance = val_distance; } -void DGUSScreenHandler::GetManualMovestep(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::GetManualMovestep(DGUS_VP_Variable &var, void *val_ptr) { DEBUG_ECHOLNPGM("\nGetManualMovestep"); *(uint16_t *)var.memadr = swap16(*(uint16_t *)val_ptr); } -void DGUSScreenHandler::EEPROM_CTRL(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::EEPROM_CTRL(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t eep_flag = swap16(*(uint16_t *)val_ptr); switch (eep_flag) { case 0: @@ -384,7 +384,7 @@ void DGUSScreenHandler::EEPROM_CTRL(DGUS_VP_Variable &var, void *val_ptr) { } } -void DGUSScreenHandler::Z_offset_select(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::Z_offset_select(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t z_value = swap16(*(uint16_t *)val_ptr); switch (z_value) { case 0: Z_distance = 0.01; break; @@ -394,7 +394,7 @@ void DGUSScreenHandler::Z_offset_select(DGUS_VP_Variable &var, void *val_ptr) { } } -void DGUSScreenHandler::GetOffsetValue(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::GetOffsetValue(DGUS_VP_Variable &var, void *val_ptr) { #if HAS_BED_PROBE int32_t value = swap32(*(int32_t *)val_ptr); @@ -411,21 +411,21 @@ void DGUSScreenHandler::GetOffsetValue(DGUS_VP_Variable &var, void *val_ptr) { settings.save(); } -void DGUSScreenHandler::LanguageChange_MKS(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::LanguageChange(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t lag_flag = swap16(*(uint16_t *)val_ptr); switch (lag_flag) { case MKS_SimpleChinese: DGUS_LanguageDisplay(MKS_SimpleChinese); mks_language_index = MKS_SimpleChinese; - dgusdisplay.MKS_WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_Choose); - dgusdisplay.MKS_WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_NoChoose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_Choose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_NoChoose); settings.save(); break; case MKS_English: DGUS_LanguageDisplay(MKS_English); mks_language_index = MKS_English; - dgusdisplay.MKS_WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_NoChoose); - dgusdisplay.MKS_WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_Choose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_NoChoose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_Choose); settings.save(); break; default: break; @@ -436,7 +436,7 @@ void DGUSScreenHandler::LanguageChange_MKS(DGUS_VP_Variable &var, void *val_ptr) uint8_t mesh_point_count = GRID_MAX_POINTS; #endif -void DGUSScreenHandler::Level_Ctrl_MKS(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::Level_Ctrl(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t lev_but = swap16(*(uint16_t *)val_ptr); #if ENABLED(MESH_BED_LEVELING) auto cs = getCurrentScreen(); @@ -483,7 +483,7 @@ void DGUSScreenHandler::Level_Ctrl_MKS(DGUS_VP_Variable &var, void *val_ptr) { } } -void DGUSScreenHandler::MeshLevelDistanceConfig(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::MeshLevelDistanceConfig(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t mesh_dist = swap16(*(uint16_t *)val_ptr); switch (mesh_dist) { case 0: mesh_adj_distance = 0.01; break; @@ -493,7 +493,7 @@ void DGUSScreenHandler::MeshLevelDistanceConfig(DGUS_VP_Variable &var, void *val } } -void DGUSScreenHandler::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) { #if ENABLED(MESH_BED_LEVELING) const uint16_t mesh_value = swap16(*(uint16_t *)val_ptr); // static uint8_t a_first_level = 1; @@ -588,11 +588,11 @@ void DGUSScreenHandler::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) { #endif // MESH_BED_LEVELING } -void DGUSScreenHandler::SD_FileBack(DGUS_VP_Variable&, void*) { +void DGUSScreenHandlerMKS::SD_FileBack(DGUS_VP_Variable&, void*) { GotoScreen(MKSLCD_SCREEN_HOME); } -void DGUSScreenHandler::LCD_BLK_Adjust(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::LCD_BLK_Adjust(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t lcd_value = swap16(*(uint16_t *)val_ptr); lcd_default_light = constrain(lcd_value, 10, 100); @@ -601,7 +601,7 @@ void DGUSScreenHandler::LCD_BLK_Adjust(DGUS_VP_Variable &var, void *val_ptr) { dgusdisplay.WriteVariable(0x0082, &lcd_data, 5, true); } -void DGUSScreenHandler::ManualAssistLeveling(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::ManualAssistLeveling(DGUS_VP_Variable &var, void *val_ptr) { const int16_t point_value = swap16(*(uint16_t *)val_ptr); // Insist on leveling first time at this screen @@ -654,7 +654,7 @@ void DGUSScreenHandler::ManualAssistLeveling(DGUS_VP_Variable &var, void *val_pt #define mks_min(a, b) ((a) < (b)) ? (a) : (b) #define mks_max(a, b) ((a) > (b)) ? (a) : (b) -void DGUSScreenHandler::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr) { #if EITHER(HAS_TRINAMIC_CONFIG, HAS_STEALTHCHOP) const uint16_t tmc_value = swap16(*(uint16_t*)val_ptr); #endif @@ -893,7 +893,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { return; } -void DGUSScreenHandler::GetParkPos_MKS(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::GetParkPos(DGUS_VP_Variable &var, void *val_ptr) { const int16_t value_pos = swap16(*(int16_t*)val_ptr); switch (var.VP) { @@ -905,8 +905,8 @@ void DGUSScreenHandler::GetParkPos_MKS(DGUS_VP_Variable &var, void *val_ptr) { skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleChangeLevelPoint_MKS(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleChangeLevelPoint_MKS"); +void DGUSScreenHandlerMKS::HandleChangeLevelPoint(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleChangeLevelPoint"); const int16_t value_raw = swap16(*(int16_t*)val_ptr); DEBUG_ECHOLNPGM("value_raw:", value_raw); @@ -917,8 +917,8 @@ void DGUSScreenHandler::HandleChangeLevelPoint_MKS(DGUS_VP_Variable &var, void * skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleStepPerMMChanged_MKS(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleStepPerMMChanged_MKS"); +void DGUSScreenHandlerMKS::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleStepPerMMChanged"); const uint16_t value_raw = swap16(*(uint16_t*)val_ptr); const float value = (float)value_raw; @@ -939,8 +939,8 @@ void DGUSScreenHandler::HandleStepPerMMChanged_MKS(DGUS_VP_Variable &var, void * skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleStepPerMMExtruderChanged_MKS(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged_MKS"); +void DGUSScreenHandlerMKS::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged"); const uint16_t value_raw = swap16(*(uint16_t*)val_ptr); const float value = (float)value_raw; @@ -964,8 +964,8 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged_MKS(DGUS_VP_Variable &var skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleMaxSpeedChange_MKS(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleMaxSpeedChange_MKS"); +void DGUSScreenHandlerMKS::HandleMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleMaxSpeedChange"); const uint16_t value_raw = swap16(*(uint16_t*)val_ptr); const float value = (float)value_raw; @@ -986,8 +986,8 @@ void DGUSScreenHandler::HandleMaxSpeedChange_MKS(DGUS_VP_Variable &var, void *va skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleExtruderMaxSpeedChange_MKS(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleExtruderMaxSpeedChange_MKS"); +void DGUSScreenHandlerMKS::HandleExtruderMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleExtruderMaxSpeedChange"); const uint16_t value_raw = swap16(*(uint16_t*)val_ptr); const float value = (float)value_raw; @@ -1011,8 +1011,8 @@ void DGUSScreenHandler::HandleExtruderMaxSpeedChange_MKS(DGUS_VP_Variable &var, skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleMaxAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleMaxAccChange_MKS"); +void DGUSScreenHandlerMKS::HandleMaxAccChange(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleMaxAccChange"); const uint16_t value_raw = swap16(*(uint16_t*)val_ptr); const float value = (float)value_raw; @@ -1033,8 +1033,8 @@ void DGUSScreenHandler::HandleMaxAccChange_MKS(DGUS_VP_Variable &var, void *val_ skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleExtruderAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("HandleExtruderAccChange_MKS"); +void DGUSScreenHandlerMKS::HandleExtruderAccChange(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("HandleExtruderAccChange"); uint16_t value_raw = swap16(*(uint16_t*)val_ptr); DEBUG_ECHOLNPGM("value_raw:", value_raw); @@ -1056,32 +1056,32 @@ void DGUSScreenHandler::HandleExtruderAccChange_MKS(DGUS_VP_Variable &var, void skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleTravelAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::HandleTravelAccChange(DGUS_VP_Variable &var, void *val_ptr) { uint16_t value_travel = swap16(*(uint16_t*)val_ptr); planner.settings.travel_acceleration = (float)value_travel; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleFeedRateMinChange_MKS(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::HandleFeedRateMinChange(DGUS_VP_Variable &var, void *val_ptr) { uint16_t value_t = swap16(*(uint16_t*)val_ptr); planner.settings.min_feedrate_mm_s = (float)value_t; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleMin_T_F_MKS(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::HandleMin_T_F(DGUS_VP_Variable &var, void *val_ptr) { uint16_t value_t_f = swap16(*(uint16_t*)val_ptr); planner.settings.min_travel_feedrate_mm_s = (float)value_t_f; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::HandleAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr) { uint16_t value_acc = swap16(*(uint16_t*)val_ptr); planner.settings.acceleration = (float)value_acc; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } #if ENABLED(PREVENT_COLD_EXTRUSION) - void DGUSScreenHandler::HandleGetExMinTemp_MKS(DGUS_VP_Variable &var, void *val_ptr) { + void DGUSScreenHandlerMKS::HandleGetExMinTemp(DGUS_VP_Variable &var, void *val_ptr) { const uint16_t value_ex_min_temp = swap16(*(uint16_t*)val_ptr); thermalManager.extrude_min_temp = value_ex_min_temp; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel @@ -1168,7 +1168,7 @@ void DGUSScreenHandler::HandleAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr } #endif // BABYSTEPPING -void DGUSScreenHandler::GetManualFilament(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::GetManualFilament(DGUS_VP_Variable &var, void *val_ptr) { DEBUG_ECHOLNPGM("GetManualFilament"); uint16_t value_len = swap16(*(uint16_t*)val_ptr); @@ -1181,7 +1181,7 @@ void DGUSScreenHandler::GetManualFilament(DGUS_VP_Variable &var, void *val_ptr) skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr) { +void DGUSScreenHandlerMKS::GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr) { DEBUG_ECHOLNPGM("GetManualFilamentSpeed"); uint16_t value_len = swap16(*(uint16_t*)val_ptr); @@ -1193,7 +1193,7 @@ void DGUSScreenHandler::GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } -void DGUSScreenHandler::MKS_FilamentLoadUnload(DGUS_VP_Variable &var, void *val_ptr, const int filamentDir) { +void DGUSScreenHandlerMKS::FilamentLoadUnload(DGUS_VP_Variable &var, void *val_ptr, const int filamentDir) { #if EITHER(HAS_MULTI_HOTEND, SINGLENOZZLE) uint8_t swap_tool = 0; #else @@ -1254,7 +1254,7 @@ void DGUSScreenHandler::MKS_FilamentLoadUnload(DGUS_VP_Variable &var, void *val_ } /** - * M1002: Do a tool-change and relative move for MKS_FilamentLoadUnload + * M1002: Do a tool-change and relative move for FilamentLoadUnload * within the G-code execution window for best concurrency. */ void GcodeSuite::M1002() { @@ -1276,14 +1276,14 @@ void GcodeSuite::M1002() { axis_relative = old_axis_relative; } -void DGUSScreenHandler::MKS_FilamentLoad(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("MKS_FilamentLoad"); - MKS_FilamentLoadUnload(var, val_ptr, 1); +void DGUSScreenHandlerMKS::FilamentLoad(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("FilamentLoad"); + FilamentLoadUnload(var, val_ptr, 1); } -void DGUSScreenHandler::MKS_FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr) { - DEBUG_ECHOLNPGM("MKS_FilamentUnLoad"); - MKS_FilamentLoadUnload(var, val_ptr, -1); +void DGUSScreenHandlerMKS::FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr) { + DEBUG_ECHOLNPGM("FilamentUnLoad"); + FilamentLoadUnload(var, val_ptr, -1); } #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) @@ -1392,7 +1392,7 @@ void DGUSScreenHandler::MKS_FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr) #endif // DGUS_FILAMENT_LOADUNLOAD -bool DGUSScreenHandler::loop() { +bool DGUSScreenHandlerMKS::loop() { dgusdisplay.loop(); const millis_t ms = millis(); @@ -1444,22 +1444,22 @@ bool DGUSScreenHandler::loop() { return IsScreenComplete(); } -void DGUSScreenHandler::LanguagePInit() { +void DGUSScreenHandlerMKS::LanguagePInit() { switch (mks_language_index) { case MKS_SimpleChinese: - dgusdisplay.MKS_WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_Choose); - dgusdisplay.MKS_WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_NoChoose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_Choose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_NoChoose); break; case MKS_English: - dgusdisplay.MKS_WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_NoChoose); - dgusdisplay.MKS_WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_Choose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_NoChoose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_Choose); break; default: break; } } -void DGUSScreenHandler::DGUS_ExtrudeLoadInit() { +void DGUSScreenHandlerMKS::DGUS_ExtrudeLoadInit() { ex_filament.ex_length = distanceFilament; ex_filament.ex_load_unload_flag = 0; ex_filament.ex_need_time = filamentSpeed_mm_s; @@ -1469,7 +1469,7 @@ void DGUSScreenHandler::DGUS_ExtrudeLoadInit() { ex_filament.ex_tick_start = 0; } -void DGUSScreenHandler::DGUS_RunoutInit() { +void DGUSScreenHandlerMKS::DGUS_RunoutInit() { #if PIN_EXISTS(MT_DET_1) SET_INPUT_PULLUP(MT_DET_1_PIN); #endif @@ -1479,7 +1479,7 @@ void DGUSScreenHandler::DGUS_RunoutInit() { runout_mks.runout_status = UNRUNOUT_STATUS; } -void DGUSScreenHandler::DGUS_Runout_Idle() { +void DGUSScreenHandlerMKS::DGUS_Runout_Idle() { #if ENABLED(DGUS_MKS_RUNOUT_SENSOR) // scanf runout pin switch (runout_mks.runout_status) { @@ -1514,7 +1514,7 @@ void DGUSScreenHandler::DGUS_Runout_Idle() { #endif } -void DGUSScreenHandler::DGUS_LanguageDisplay(uint8_t var) { +void DGUSScreenHandlerMKS::DGUS_LanguageDisplay(uint8_t var) { if (var == MKS_English) { const char home_buf_en[] = "Home"; dgusdisplay.WriteVariable(VP_HOME_Dis, home_buf_en, 32, true); diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h index dbd124cbe9d9..823ed4297cd0 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h @@ -21,64 +21,26 @@ */ #pragma once -#include "../DGUSDisplay.h" -#include "../DGUSVPVariable.h" -#include "../DGUSDisplayDef.h" - -#include "../../../../inc/MarlinConfig.h" +#include "../DGUSScreenHandlerBase.h" enum DGUSLCD_Screens : uint8_t; -class DGUSScreenHandler { +class DGUSScreenHandlerMKS : public DGUSScreenHandler { public: - DGUSScreenHandler() = default; - - static bool loop(); - - // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen - // The bools specifying whether the strings are in RAM or FLASH. - static void sendinfoscreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { - sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); - } - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { - sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); - } - - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + DGUSScreenHandlerMKS() = default; #if 0 - static void sendinfoscreen_ch_mks(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4); - static void sendinfoscreen_en_mks(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4); - static void sendinfoscreen_mks(const void *line1, const void *line2, const void *line3, const void *line4, uint16_t language); + static void sendinfoscreen_ch(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4); + static void sendinfoscreen_en(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4); + static void sendinfoscreen(const void *line1, const void *line2, const void *line3, const void *line4, uint16_t language); #endif - // "M117" Message -- msg is a RAM ptr. - static void setstatusmessage(const char *msg); - // The same for messages from Flash - static void setstatusmessagePGM(PGM_P const msg); - // Callback for VP "Display wants to change screen on idle printer" - static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr); - // Callback for VP "Screen has been changed" - static void ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr); - static void ScreenBackChange(DGUS_VP_Variable &var, void *val_ptr); - // Callback for VP "All Heaters Off" - static void HandleAllHeatersOff(DGUS_VP_Variable &var, void *val_ptr); - // Hook for "Change this temperature" - static void HandleTemperatureChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for "Change Flowrate" - static void HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - // Hook for manual move option - static void HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr); - #endif - static void EEPROM_CTRL(DGUS_VP_Variable &var, void *val_ptr); - static void LanguageChange_MKS(DGUS_VP_Variable &var, void *val_ptr); + static void LanguageChange(DGUS_VP_Variable &var, void *val_ptr); static void GetOffsetValue(DGUS_VP_Variable &var, void *val_ptr); - static void Level_Ctrl_MKS(DGUS_VP_Variable &var, void *val_ptr); + static void Level_Ctrl(DGUS_VP_Variable &var, void *val_ptr); static void MeshLevel(DGUS_VP_Variable &var, void *val_ptr); static void MeshLevelDistanceConfig(DGUS_VP_Variable &var, void *val_ptr); static void ManualAssistLeveling(DGUS_VP_Variable &var, void *val_ptr); @@ -87,9 +49,9 @@ class DGUSScreenHandler { static void GetManualMovestep(DGUS_VP_Variable &var, void *val_ptr); static void GetZoffsetDistance(DGUS_VP_Variable &var, void *val_ptr); static void GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr); - static void GetParkPos_MKS(DGUS_VP_Variable &var, void *val_ptr); + static void GetParkPos(DGUS_VP_Variable &var, void *val_ptr); #if ENABLED(PREVENT_COLD_EXTRUSION) - static void HandleGetExMinTemp_MKS(DGUS_VP_Variable &var, void *val_ptr); + static void HandleGetExMinTemp(DGUS_VP_Variable &var, void *val_ptr); #endif static void DGUS_LanguageDisplay(uint8_t var); static void TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr); @@ -101,221 +63,54 @@ class DGUSScreenHandler { static void LCD_BLK_Adjust(DGUS_VP_Variable &var, void *val_ptr); static void SD_FileBack(DGUS_VP_Variable &var, void *val_ptr); - // Hook for manual move. - static void HandleManualMove(DGUS_VP_Variable &var, void *val_ptr); - // Hook for manual extrude. - static void HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr); - // Hook for motor lock and unlook - static void HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(POWER_LOSS_RECOVERY) - // Hook for power loss recovery. - static void HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr); - #endif - // Hook for settings - static void HandleSettings(DGUS_VP_Variable &var, void *val_ptr); static void HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr); static void HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr); - - static void HandleStepPerMMChanged_MKS(DGUS_VP_Variable &var, void *val_ptr); - static void HandleStepPerMMExtruderChanged_MKS(DGUS_VP_Variable &var, void *val_ptr); - static void HandleMaxSpeedChange_MKS(DGUS_VP_Variable &var, void *val_ptr); - static void HandleExtruderMaxSpeedChange_MKS(DGUS_VP_Variable &var, void *val_ptr); - static void HandleAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr); - static void HandleMaxAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr); - static void HandleExtruderAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr); - static void HandleChangeLevelPoint_MKS(DGUS_VP_Variable &var, void *val_ptr); - static void HandleTravelAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr); - static void HandleFeedRateMinChange_MKS(DGUS_VP_Variable &var, void *val_ptr); - static void HandleMin_T_F_MKS(DGUS_VP_Variable &var, void *val_ptr); + static void HandleMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr); + static void HandleExtruderMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr); + static void HandleAccChange(DGUS_VP_Variable &var, void *val_ptr); + static void HandleMaxAccChange(DGUS_VP_Variable &var, void *val_ptr); + static void HandleExtruderAccChange(DGUS_VP_Variable &var, void *val_ptr); + static void HandleChangeLevelPoint(DGUS_VP_Variable &var, void *val_ptr); + static void HandleTravelAccChange(DGUS_VP_Variable &var, void *val_ptr); + static void HandleFeedRateMinChange(DGUS_VP_Variable &var, void *val_ptr); + static void HandleMin_T_F(DGUS_VP_Variable &var, void *val_ptr); #if HAS_PID_HEATING - // Hook for "Change this temperature PID para" - static void HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for PID autotune - static void HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if HAS_BED_PROBE - // Hook for "Change probe offset z" - static void HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if ENABLED(BABYSTEPPING) - // Hook for live z adjust action - static void HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if HAS_FAN - // Hook for fan control - static void HandleFanControl(DGUS_VP_Variable &var, void *val_ptr); - #endif - // Hook for heater control - static void HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(DGUS_PREHEAT_UI) - // Hook for preheat - static void HandlePreheat(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - // Hook for filament load and unload filament option - static void HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr); - // Hook for filament load and unload - static void HandleFilamentLoadUnload(DGUS_VP_Variable &var); - - static void MKS_FilamentLoadUnload(DGUS_VP_Variable &var, void *val_ptr, const int filamentDir); - static void MKS_FilamentLoad(DGUS_VP_Variable &var, void *val_ptr); - static void MKS_FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr); - static void MKS_LOAD_UNLOAD_IDLE(); - static void MKS_LOAD_Cancle(DGUS_VP_Variable &var, void *val_ptr); + static void FilamentLoadUnload(DGUS_VP_Variable &var, void *val_ptr, const int filamentDir); + static void FilamentLoad(DGUS_VP_Variable &var, void *val_ptr); + static void FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr); static void GetManualFilament(DGUS_VP_Variable &var, void *val_ptr); static void GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr); #endif #if ENABLED(SDSUPPORT) - // Callback for VP "Display wants to change screen when there is a SD card" - static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr); - // Scroll buttons on the file listing screen. - static void DGUSLCD_SD_ScrollFilelist(DGUS_VP_Variable &var, void *val_ptr); - // File touched. - static void DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr); - // start print after confirmation received. - static void DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr); - // User hit the pause, resume or abort button. - static void DGUSLCD_SD_ResumePauseAbort(DGUS_VP_Variable &var, void *val_ptr); - // User confirmed the abort action - static void DGUSLCD_SD_ReallyAbort(DGUS_VP_Variable &var, void *val_ptr); - // User hit the tune button - static void DGUSLCD_SD_PrintTune(DGUS_VP_Variable &var, void *val_ptr); - // Send a single filename to the display. - static void DGUSLCD_SD_SendFilename(DGUS_VP_Variable &var); - // Marlin informed us that a new SD has been inserted. - static void SDCardInserted(); - // Marlin informed us that the SD Card has been removed(). - static void SDCardRemoved(); - // Marlin informed us about a bad SD Card. - static void SDCardError(); // Marlin informed us about SD print completion. static void SDPrintingFinished(); #else static void PrintReturn(DGUS_VP_Variable &var, void *val_ptr); #endif - // OK Button on the Confirm screen. - static void ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr); - - // Update data after going to a new screen (by display or by GotoScreen) - // remember: store the last-displayed screen, so it can be returned to. - // (e.g for popup messages) - static void UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup=false); - - // Recall the remembered screen. - static void PopToOldScreen(); - - // Make the display show the screen and update all VPs in it. - static void GotoScreen(DGUSLCD_Screens screen, bool ispopup = false); - - static void UpdateScreenVPData(); - - // Helpers to convert and transfer data to the display. - static void DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var); - static void DGUSLCD_SendTemperaturePID(DGUS_VP_Variable &var); - static void DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var); static void DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var); - - static void DGUSLCD_SendPrintTimeToDisplay_MKS(DGUS_VP_Variable &var); - static void DGUSLCD_SendBabyStepToDisplay_MKS(DGUS_VP_Variable &var); + static void DGUSLCD_SendBabyStepToDisplay(DGUS_VP_Variable &var); static void DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var); static void DGUSLCD_SendGbkToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplay_Language_MKS(DGUS_VP_Variable &var); + static void DGUSLCD_SendStringToDisplay_Language(DGUS_VP_Variable &var); static void DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var); - #if ENABLED(PRINTCOUNTER) - static void DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var); - #endif - #if HAS_FAN - static void DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var); - #endif - static void DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var); - #if ENABLED(DGUS_UI_WAITING) - static void DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var); - #endif - - // Send a value from 0..100 to a variable with a range from 0..255 - static void DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr); - static void DGUSLCD_SetUint8(DGUS_VP_Variable &var, void *val_ptr); - template - static void DGUSLCD_SetValueDirectly(DGUS_VP_Variable &var, void *val_ptr) { - if (!var.memadr) return; - union { unsigned char tmp[sizeof(T)]; T t; } x; - unsigned char *ptr = (unsigned char*)val_ptr; - LOOP_L_N(i, sizeof(T)) x.tmp[i] = ptr[sizeof(T) - i - 1]; - *(T*)var.memadr = x.t; - } - - // Send a float value to the display. - // Display will get a 4-byte integer scaled to the number of digits: - // Tell the display the number of digits and it cheats by displaying a dot between... - template - static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - float f = *(float *)var.memadr; - f *= cpow(10, decimals); - dgusdisplay.WriteVariable(var.VP, (long)f); - } - } - - // Send a float value to the display. - // Display will get a 2-byte integer scaled to the number of digits: - // Tell the display the number of digits and it cheats by displaying a dot between... - template - static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); - f *= cpow(10, decimals); - dgusdisplay.WriteVariable(var.VP, (int16_t)f); - } - } - - // Force an update of all VP on the current screen. - static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } - // Has all VPs sent to the screen - static bool IsScreenComplete() { return ScreenComplete; } - - static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - - static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } - -private: - static DGUSLCD_Screens current_screen; //< currently on screen - static constexpr uint8_t NUM_PAST_SCREENS = 4; - static DGUSLCD_Screens past_screens[NUM_PAST_SCREENS]; //< LIFO with past screens for the "back" button. - - static uint8_t update_ptr; //< Last sent entry in the VPList for the actual screen. - static uint16_t skipVP; //< When updating the screen data, skip this one, because the user is interacting with it. - static bool ScreenComplete; //< All VPs sent to screen? - - static uint16_t ConfirmVP; //< context for confirm screen (VP that will be emulated-sent on "OK"). - - #if ENABLED(SDSUPPORT) - static int16_t top_file; //< file on top of file chooser - static int16_t file_to_print; //< touched file to be confirmed - #endif - - static void (*confirm_action_cb)(); + static bool loop(); }; -#define MKS_Language_Choose 0x00 -#define MKS_Language_NoChoose 0x01 +enum MKS_Choose : uint8_t { MKS_Language_Choose, MKS_Language_NoChoose }; +enum MKS_Language : uint8_t { MKS_SimpleChinese, MKS_English }; -#define MKS_SimpleChinese 0 -#define MKS_English 1 -extern uint8_t mks_language_index; +extern MKS_Language mks_language_index; extern bool DGUSAutoTurnOff; #if ENABLED(POWER_LOSS_RECOVERY) #define PLR_SCREEN_RECOVER MKSLCD_SCREEN_PRINT #define PLR_SCREEN_CANCEL MKSLCD_SCREEN_HOME #endif + +typedef DGUSScreenHandlerMKS DGUSScreenHandlerClass; diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h index 0bdf06ed7d57..73e3527d7e7c 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h @@ -21,224 +21,9 @@ */ #pragma once -#include "../DGUSDisplay.h" -#include "../DGUSVPVariable.h" -#include "../DGUSDisplayDef.h" +#include "../DGUSScreenHandlerBase.h" -#include "../../../../inc/MarlinConfig.h" - -enum DGUSLCD_Screens : uint8_t; - -class DGUSScreenHandler { -public: - DGUSScreenHandler() = default; - - static bool loop(); - - // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen - // The bools specifying whether the strings are in RAM or FLASH. - static void sendinfoscreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { - sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); - } - static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { - sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); - } - - static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - - // "M117" Message -- msg is a RAM ptr. - static void setstatusmessage(const char *msg); - // The same for messages from Flash - static void setstatusmessagePGM(PGM_P const msg); - // Callback for VP "Display wants to change screen on idle printer" - static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr); - // Callback for VP "Screen has been changed" - static void ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr); - - // Callback for VP "All Heaters Off" - static void HandleAllHeatersOff(DGUS_VP_Variable &var, void *val_ptr); - // Hook for "Change this temperature" - static void HandleTemperatureChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for "Change Flowrate" - static void HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) - // Hook for manual move option - static void HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr); - #endif - - // Hook for manual move. - static void HandleManualMove(DGUS_VP_Variable &var, void *val_ptr); - // Hook for manual extrude. - static void HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr); - // Hook for motor lock and unlook - static void HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(POWER_LOSS_RECOVERY) - // Hook for power loss recovery. - static void HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr); - #endif - // Hook for settings - static void HandleSettings(DGUS_VP_Variable &var, void *val_ptr); - static void HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr); - static void HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr); - - #if HAS_PID_HEATING - // Hook for "Change this temperature PID para" - static void HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr); - // Hook for PID autotune - static void HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if HAS_BED_PROBE - // Hook for "Change probe offset z" - static void HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if ENABLED(BABYSTEPPING) - // Hook for live z adjust action - static void HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if HAS_FAN - // Hook for fan control - static void HandleFanControl(DGUS_VP_Variable &var, void *val_ptr); - #endif - // Hook for heater control - static void HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr); - #if ENABLED(DGUS_PREHEAT_UI) - // Hook for preheat - static void HandlePreheat(DGUS_VP_Variable &var, void *val_ptr); - #endif - #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - // Hook for filament load and unload filament option - static void HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr); - // Hook for filament load and unload - static void HandleFilamentLoadUnload(DGUS_VP_Variable &var); - #endif - - #if ENABLED(SDSUPPORT) - // Callback for VP "Display wants to change screen when there is a SD card" - static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr); - // Scroll buttons on the file listing screen. - static void DGUSLCD_SD_ScrollFilelist(DGUS_VP_Variable &var, void *val_ptr); - // File touched. - static void DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr); - // start print after confirmation received. - static void DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr); - // User hit the pause, resume or abort button. - static void DGUSLCD_SD_ResumePauseAbort(DGUS_VP_Variable &var, void *val_ptr); - // User confirmed the abort action - static void DGUSLCD_SD_ReallyAbort(DGUS_VP_Variable &var, void *val_ptr); - // User hit the tune button - static void DGUSLCD_SD_PrintTune(DGUS_VP_Variable &var, void *val_ptr); - // Send a single filename to the display. - static void DGUSLCD_SD_SendFilename(DGUS_VP_Variable &var); - // Marlin informed us that a new SD has been inserted. - static void SDCardInserted(); - // Marlin informed us that the SD Card has been removed(). - static void SDCardRemoved(); - // Marlin informed us about a bad SD Card. - static void SDCardError(); - #endif - - // OK Button the Confirm screen. - static void ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr); - - // Update data after went to new screen (by display or by GotoScreen) - // remember: store the last-displayed screen, so it can get returned to. - // (e.g for pop up messages) - static void UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup=false); - - // Recall the remembered screen. - static void PopToOldScreen(); - - // Make the display show the screen and update all VPs in it. - static void GotoScreen(DGUSLCD_Screens screen, bool ispopup = false); - - static void UpdateScreenVPData(); - - // Helpers to convert and transfer data to the display. - static void DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var); - static void DGUSLCD_SendTemperaturePID(DGUS_VP_Variable &var); - static void DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var); - - #if ENABLED(PRINTCOUNTER) - static void DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var); - static void DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var); - #endif - #if HAS_FAN - static void DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var); - #endif - static void DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var); - #if ENABLED(DGUS_UI_WAITING) - static void DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var); - #endif - - // Send a value from 0..100 to a variable with a range from 0..255 - static void DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr); - - template - static void DGUSLCD_SetValueDirectly(DGUS_VP_Variable &var, void *val_ptr) { - if (!var.memadr) return; - union { unsigned char tmp[sizeof(T)]; T t; } x; - unsigned char *ptr = (unsigned char*)val_ptr; - LOOP_L_N(i, sizeof(T)) x.tmp[i] = ptr[sizeof(T) - i - 1]; - *(T*)var.memadr = x.t; - } - - // Send a float value to the display. - // Display will get a 4-byte integer scaled to the number of digits: - // Tell the display the number of digits and it cheats by displaying a dot between... - template - static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - float f = *(float *)var.memadr; - f *= cpow(10, decimals); - dgusdisplay.WriteVariable(var.VP, (long)f); - } - } - - // Send a float value to the display. - // Display will get a 2-byte integer scaled to the number of digits: - // Tell the display the number of digits and it cheats by displaying a dot between... - template - static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { - if (var.memadr) { - float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); - f *= cpow(10, decimals); - dgusdisplay.WriteVariable(var.VP, (int16_t)f); - } - } - - // Force an update of all VP on the current screen. - static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } - // Has all VPs sent to the screen - static bool IsScreenComplete() { return ScreenComplete; } - - static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - - static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } - -private: - static DGUSLCD_Screens current_screen; //< currently on screen - static constexpr uint8_t NUM_PAST_SCREENS = 4; - static DGUSLCD_Screens past_screens[NUM_PAST_SCREENS]; //< LIFO with past screens for the "back" button. - - static uint8_t update_ptr; //< Last sent entry in the VPList for the actual screen. - static uint16_t skipVP; //< When updating the screen data, skip this one, because the user is interacting with it. - static bool ScreenComplete; //< All VPs sent to screen? - - static uint16_t ConfirmVP; //< context for confirm screen (VP that will be emulated-sent on "OK"). - - #if ENABLED(SDSUPPORT) - static int16_t top_file; //< file on top of file chooser - static int16_t file_to_print; //< touched file to be confirmed - #endif - - static void (*confirm_action_cb)(); -}; +typedef DGUSScreenHandler DGUSScreenHandlerClass; #if ENABLED(POWER_LOSS_RECOVERY) #define PLR_SCREEN_RECOVER DGUSLCD_SCREEN_SDPRINTMANIPULATION diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 129e513cec26..6a79c7e67d8a 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -544,7 +544,7 @@ typedef struct SettingsDataStruct { // MKS UI controller // #if ENABLED(DGUS_LCD_UI_MKS) - uint8_t mks_language_index; // Display Language + MKS_Language mks_language_index; // Display Language xy_int_t mks_corner_offsets[5]; // Bed Tramming xyz_int_t mks_park_pos; // Custom Parking (without NOZZLE_PARK) celsius_t mks_min_extrusion_temp; // Min E Temp (shadow M302 value) From aa4c9917552df8a383816a0af516b86e1237ff48 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Fri, 1 Apr 2022 04:22:26 +0200 Subject: [PATCH 275/502] =?UTF-8?q?=F0=9F=93=9D=20Obsolete=20freeze=20comm?= =?UTF-8?q?ent=20(#23964)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #23944 --- Marlin/Configuration_adv.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 846b566e8c33..8ecb7bc21183 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -4109,7 +4109,6 @@ /** * Instant freeze / unfreeze functionality - * Specified pin has pullup and connecting to ground will instantly pause motion. * Potentially useful for emergency stop that allows being resumed. */ //#define FREEZE_FEATURE From 8f0180802ad327a0be47be9405a9a2764b5937db Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 5 May 2022 11:47:08 -0500 Subject: [PATCH 276/502] =?UTF-8?q?=F0=9F=94=A7=20Move=20LASER=5FCOOLANT?= =?UTF-8?q?=5FFLOW=5FMETER=20to=20LASER=5FFEATURE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 8ecb7bc21183..a0d84092dfa0 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -249,20 +249,6 @@ #endif #endif -// -// Laser Coolant Flow Meter -// -//#define LASER_COOLANT_FLOW_METER -#if ENABLED(LASER_COOLANT_FLOW_METER) - #define FLOWMETER_PIN 20 // Requires an external interrupt-enabled pin (e.g., RAMPS 2,3,18,19,20,21) - #define FLOWMETER_PPL 5880 // (pulses/liter) Flow meter pulses-per-liter on the input pin - #define FLOWMETER_INTERVAL 1000 // (ms) Flow rate calculation interval in milliseconds - #define FLOWMETER_SAFETY // Prevent running the laser without the minimum flow rate set below - #if ENABLED(FLOWMETER_SAFETY) - #define FLOWMETER_MIN_LITERS_PER_MINUTE 1.5 // (liters/min) Minimum flow required when enabled - #endif -#endif - /** * Thermal Protection provides additional protection to your printer from damage * and fire. Marlin always includes safe min and max temperature ranges which @@ -3627,6 +3613,20 @@ #define I2C_AMMETER_SHUNT_RESISTOR 0.1 // (Ohms) Calibration shunt resistor value #endif + // + // Laser Coolant Flow Meter + // + //#define LASER_COOLANT_FLOW_METER + #if ENABLED(LASER_COOLANT_FLOW_METER) + #define FLOWMETER_PIN 20 // Requires an external interrupt-enabled pin (e.g., RAMPS 2,3,18,19,20,21) + #define FLOWMETER_PPL 5880 // (pulses/liter) Flow meter pulses-per-liter on the input pin + #define FLOWMETER_INTERVAL 1000 // (ms) Flow rate calculation interval in milliseconds + #define FLOWMETER_SAFETY // Prevent running the laser without the minimum flow rate set below + #if ENABLED(FLOWMETER_SAFETY) + #define FLOWMETER_MIN_LITERS_PER_MINUTE 1.5 // (liters/min) Minimum flow required when enabled + #endif + #endif + #endif #endif // SPINDLE_FEATURE || LASER_FEATURE From 975b90c0b7e6b836f67f3603c80f818dc095ffa5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Apr 2022 06:18:56 -0500 Subject: [PATCH 277/502] =?UTF-8?q?=F0=9F=8E=A8=20Tweak=20NEOPIXEL=5FLED?= =?UTF-8?q?=20format=20(#24110)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 73f6bbcdda31..a8713da860ae 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2930,30 +2930,31 @@ // Support for Adafruit NeoPixel LED driver //#define NEOPIXEL_LED #if ENABLED(NEOPIXEL_LED) - #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) - //#define NEOPIXEL_PIN 4 // LED driving pin - //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE - //#define NEOPIXEL2_PIN 5 - #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.) - #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. - #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) - //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW, NEO_RGBW, NEO_GRB, NEO_RBG, etc. + // See https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.h + //#define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.) + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup // Support for second Adafruit NeoPixel LED driver controlled with M150 S1 ... //#define NEOPIXEL2_SEPARATE #if ENABLED(NEOPIXEL2_SEPARATE) - #define NEOPIXEL2_PIXELS 15 // Number of LEDs in the second strip - #define NEOPIXEL2_BRIGHTNESS 127 // Initial brightness (0-255) - #define NEOPIXEL2_STARTUP_TEST // Cycle through colors at startup + #define NEOPIXEL2_PIXELS 15 // Number of LEDs in the second strip + #define NEOPIXEL2_BRIGHTNESS 127 // Initial brightness (0-255) + #define NEOPIXEL2_STARTUP_TEST // Cycle through colors at startup #else - //#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel + //#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel #endif // Use some of the NeoPixel LEDs for static (background) lighting - //#define NEOPIXEL_BKGD_INDEX_FIRST 0 // Index of the first background LED - //#define NEOPIXEL_BKGD_INDEX_LAST 5 // Index of the last background LED + //#define NEOPIXEL_BKGD_INDEX_FIRST 0 // Index of the first background LED + //#define NEOPIXEL_BKGD_INDEX_LAST 5 // Index of the last background LED //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W - //#define NEOPIXEL_BKGD_ALWAYS_ON // Keep the backlight on when other NeoPixels are off + //#define NEOPIXEL_BKGD_ALWAYS_ON // Keep the backlight on when other NeoPixels are off #endif /** From 727e7e7fd71fb0404e0f5bf7f36dc10419d155c4 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 8 May 2022 14:56:09 +1200 Subject: [PATCH 278/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8FFix=20Markforged=20en?= =?UTF-8?q?dstops/G38=20(#24141)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/endstops.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 180f455734b3..6abbcfd8fd7c 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -619,7 +619,7 @@ void Endstops::update() { #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT_TO(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX))) #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT)) - #if ENABLED(G38_PROBE_TARGET) && NONE(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_XY) + #if ENABLED(G38_PROBE_TARGET) && NONE(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX) #define HAS_G38_PROBE 1 // For G38 moves check the probe's pin for ALL movement if (G38_move) UPDATE_ENDSTOP_BIT(Z, TERN(USES_Z_MIN_PROBE_PIN, MIN_PROBE, MIN)); @@ -630,7 +630,7 @@ void Endstops::update() { #define X_MAX_TEST() TERN1(DUAL_X_CARRIAGE, TERN0(X_HOME_TO_MAX, stepper.last_moved_extruder == 0) || TERN0(X2_HOME_TO_MAX, stepper.last_moved_extruder != 0)) // Use HEAD for core axes, AXIS for others - #if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_XY) + #if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX) #define X_AXIS_HEAD X_HEAD #else #define X_AXIS_HEAD X_AXIS From 31c87adba80d50a90ae3c85b08cd01c5545c78b4 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 8 May 2022 14:57:13 +1200 Subject: [PATCH 279/502] =?UTF-8?q?=F0=9F=93=8C=20Use=20ESP3DLib=20master?= =?UTF-8?q?=20branch=20(#24140)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/features.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ini/features.ini b/ini/features.ini index a153b1853064..81dad8e03556 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -234,7 +234,7 @@ HAS_SERVOS = src_filter=+ + HAS_MICROSTEPS = src_filter=+ (ESP3D_)?WIFISUPPORT = AsyncTCP, ESP Async WebServer - ESP3DLib=https://github.com/luc-github/ESP3DLib/archive/master-2.0.7.zip + ESP3DLib=https://github.com/luc-github/ESP3DLib/archive/master.zip arduinoWebSockets=links2004/WebSockets@2.3.4 luc-github/ESP32SSDP@^1.1.1 lib_ignore=ESPAsyncTCP From a7e4061d1221531340e9f82bc6f1560e5d6feab8 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sat, 7 May 2022 19:58:57 -0700 Subject: [PATCH 280/502] =?UTF-8?q?=F0=9F=94=A7=20Fix=20Neo=20RGB=20sanity?= =?UTF-8?q?=20check=20(#24146)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index a52464db9166..b542c37c88dd 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2355,6 +2355,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if EITHER(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1) #ifndef NEO_RGB #define NEO_RGB 123 + #define FAUX_RGB 1 #endif #if defined(NEOPIXEL_TYPE) && NEOPIXEL_TYPE != NEO_RGB #error "Your FYSETC/MKS/BTT Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB." @@ -2363,6 +2364,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #if FAUX_RGB #undef NEO_RGB + #undef FAUX_RGB #endif #elif EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED) #error "Your FYSETC Mini Panel requires RGB_LED." From 238ab1dd061145a525edd27bb8203ae216380894 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Mon, 9 May 2022 17:18:47 -0500 Subject: [PATCH 281/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Fan=20Tail=20Speed?= =?UTF-8?q?=20Init=20(#24076)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/module/planner.cpp | 24 ++++++++++++------------ Marlin/src/module/planner.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 8c723aa06e80..22d7d61ac556 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1306,7 +1306,7 @@ void Planner::check_axes_activity() { #if HAS_FAN && DISABLED(LASER_SYNCHRONOUS_M106_M107) #define HAS_TAIL_FAN_SPEED 1 - static uint8_t tail_fan_speed[FAN_COUNT] = ARRAY_N_1(FAN_COUNT, 128); + static uint8_t tail_fan_speed[FAN_COUNT] = ARRAY_N_1(FAN_COUNT, 13); bool fans_need_update = false; #endif @@ -1342,15 +1342,15 @@ void Planner::check_axes_activity() { #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_I, DISABLE_J, DISABLE_K, DISABLE_E) for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block_t *block = &block_buffer[b]; + block_t * const bnext = &block_buffer[b]; LOGICAL_AXIS_CODE( - if (TERN0(DISABLE_E, block->steps.e)) axis_active.e = true, - if (TERN0(DISABLE_X, block->steps.x)) axis_active.x = true, - if (TERN0(DISABLE_Y, block->steps.y)) axis_active.y = true, - if (TERN0(DISABLE_Z, block->steps.z)) axis_active.z = true, - if (TERN0(DISABLE_I, block->steps.i)) axis_active.i = true, - if (TERN0(DISABLE_J, block->steps.j)) axis_active.j = true, - if (TERN0(DISABLE_K, block->steps.k)) axis_active.k = true + if (TERN0(DISABLE_E, bnext->steps.e)) axis_active.e = true, + if (TERN0(DISABLE_X, bnext->steps.x)) axis_active.x = true, + if (TERN0(DISABLE_Y, bnext->steps.y)) axis_active.y = true, + if (TERN0(DISABLE_Z, bnext->steps.z)) axis_active.z = true, + if (TERN0(DISABLE_I, bnext->steps.i)) axis_active.i = true, + if (TERN0(DISABLE_J, bnext->steps.j)) axis_active.j = true, + if (TERN0(DISABLE_K, bnext->steps.k)) axis_active.k = true ); } #endif @@ -1445,14 +1445,14 @@ void Planner::check_axes_activity() { * currently in the planner. */ void Planner::autotemp_task() { - static float oldt = 0; + static float oldt = 0.0f; if (!autotemp_enabled) return; if (thermalManager.degTargetHotend(active_extruder) < autotemp_min - 2) return; // Below the min? - float high = 0.0; + float high = 0.0f; for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block_t *block = &block_buffer[b]; + const block_t * const block = &block_buffer[b]; if (LINEAR_AXIS_GANG(block->steps.x, || block->steps.y, || block->steps.z, || block->steps.i, || block->steps.j, || block->steps.k)) { const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec; NOLESS(high, se); diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 3f96863cbdc5..c450418a5c7a 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -1020,7 +1020,7 @@ class Planner { return limit_value; } - #endif // !CLASSIC_JERK + #endif // HAS_JUNCTION_DEVIATION }; #define PLANNER_XY_FEEDRATE() _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) From 13d1eb7241b8621267520e57811f8069b2e466e9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 May 2022 23:51:38 -0500 Subject: [PATCH 282/502] =?UTF-8?q?=F0=9F=94=A8=20OpenOCD=20Debug=20for=20?= =?UTF-8?q?VSCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/PlatformIO/debugging/launch.json | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/buildroot/share/PlatformIO/debugging/launch.json b/buildroot/share/PlatformIO/debugging/launch.json index 335c4c663e89..583d860eb36c 100644 --- a/buildroot/share/PlatformIO/debugging/launch.json +++ b/buildroot/share/PlatformIO/debugging/launch.json @@ -12,26 +12,17 @@ "version": "0.2.0", "configurations": [ { - "name": "Debug STM32 (launch)", + "name": "Debug STM32 (ST-Link)", "request": "launch", "type": "cortex-debug", "servertype": "openocd", "cwd": "${workspaceRoot}", "showDevDebugOutput": false, "configFiles": [ "interface/stlink.cfg", "target/stm32f4x.cfg" ], - "device": "STM32F407", - "executable": ".pio/build/BIGTREE_SKR_2_USB_debug/firmware.elf", - }, - { - "name": "Debug STM32 (attach)", - "request": "attach", - "type": "cortex-debug", - "servertype": "openocd", - "cwd": "${workspaceRoot}", - "showDevDebugOutput": false, - "configFiles": [ "interface/stlink.cfg", "target/stm32f4x.cfg" ], - "device": "STM32F407", - "executable": ".pio/build/BIGTREE_SKR_2_USB_debug/firmware.elf", + "device": "stlink", + "executable": "${workspaceRoot}/.pio/build/BIGTREE_SKR_2_USB_debug/firmware.elf", + "openOCDLaunchCommands": [ "init", "reset init" ], + "svdFile": "${env:HOME}/.platformio/platforms/ststm32@12.1.1/misc/svd/STM32F40x.svd", }, { "name": "Debug Sim", From a9aca5f5e8c5c1ce40e09ce5cf80a875ec009aa0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 9 May 2022 16:47:04 -0500 Subject: [PATCH 283/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20spurious=20U?= =?UTF-8?q?TF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/LPC1768/eeprom_wired.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/LPC1768/eeprom_wired.cpp b/Marlin/src/HAL/LPC1768/eeprom_wired.cpp index f9286a74ac88..1bbc39d4a242 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_wired.cpp +++ b/Marlin/src/HAL/LPC1768/eeprom_wired.cpp @@ -34,7 +34,7 @@ #include "../shared/eeprom_api.h" #ifndef MARLIN_EEPROM_SIZE - #define MARLIN_EEPROM_SIZE 0x8000 // 32KB‬ + #define MARLIN_EEPROM_SIZE 0x8000 // 32K #endif size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } From bd09f8acff3c40fe9294cfc6b6a9220ec5b766fc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 9 May 2022 17:35:32 -0500 Subject: [PATCH 284/502] =?UTF-8?q?=F0=9F=93=8C=20Define=20RAMPS=5FSMART?= =?UTF-8?q?=20EXP=20headers,=20AZSMZ=5F12864?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #23501 --- Marlin/src/inc/Conditionals_LCD.h | 3 +- Marlin/src/pins/ramps/pins_RAMPS.h | 4 ++ Marlin/src/pins/sam/pins_RAMPS_SMART.h | 69 +++++++++++++++++--------- 3 files changed, 51 insertions(+), 25 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 83105a9f0220..621b33fdb747 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -101,9 +101,8 @@ #elif ANY(miniVIKI, VIKI2, WYH_L12864, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864) - #define IS_DOGM_12864 1 - #define DOGLCD + #define IS_DOGM_12864 1 #define IS_ULTIPANEL 1 #if ENABLED(miniVIKI) diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index d88d7e33127b..4ab7f4007331 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -600,6 +600,10 @@ #define LCD_PINS_D6 AUX2_08_PIN #define LCD_PINS_D7 AUX2_10_PIN + #elif ENABLED(AZSMZ_12864) + + // Pins only defined for RAMPS_SMART currently + #else #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) diff --git a/Marlin/src/pins/sam/pins_RAMPS_SMART.h b/Marlin/src/pins/sam/pins_RAMPS_SMART.h index 96d0c9e1cc9a..2b8942c6ad2d 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_SMART.h +++ b/Marlin/src/pins/sam/pins_RAMPS_SMART.h @@ -61,53 +61,43 @@ */ #define BOARD_INFO_NAME "RAMPS-SMART" -#define ALLOW_SAM3X8E -#include "../ramps/pins_RAMPS.h" // I2C EEPROM with 4K of space #define I2C_EEPROM -#define MARLIN_EEPROM_SIZE 0x1000 - -#define SDA_PIN 20 -#define SCL_PIN 21 +#define MARLIN_EEPROM_SIZE 0x1000 // 4K // See EEPROM device datasheet for the following values. These are for 24xx256 -#define EEPROM_SERIAL_ADDR 0x50 // 7 bit i2c address (without R/W bit) -#define EEPROM_PAGE_SIZE 64 // page write buffer size -#define EEPROM_PAGE_WRITE_TIME 7 // page write time in milliseconds (docs say 5ms but that is too short) - -#define TWI_CLOCK_FREQ 400000 -#define EEPROM_ADDRSZ_BYTES TWI_MMR_IADRSZ_2_BYTE // TWI_MMR_IADRSZ_1_BYTE for 1 byte, or TWI_MMR_IADRSZ_2_BYTE for 2 byte -#define EEPROM_AVAILABLE EEPROM_I2C - -#define RESET_PIN 42 // Resets the board if the jumper is attached +#define EEPROM_DEVICE_ADDRESS 0x50 // 7 bit i2c address (without R/W bit) +#define EEPROM_WRITE_DELAY 7 // page write time in milliseconds (docs say 5ms but that is too short) +//#define EEPROM_PAGE_SIZE 64 // page write buffer size +//#define TWI_CLOCK_FREQ 400000 +//#define EEPROM_ADDRSZ_BYTES TWI_MMR_IADRSZ_2_BYTE // TWI_MMR_IADRSZ_1_BYTE for 1 byte, or TWI_MMR_IADRSZ_2_BYTE for 2 byte +//#define EEPROM_AVAILABLE EEPROM_I2C // // Temperature Sensors // -#undef TEMP_0_PIN #define TEMP_0_PIN 9 // Analog Input - -#undef TEMP_1_PIN #define TEMP_1_PIN 10 // Analog Input - -#undef TEMP_BED_PIN #define TEMP_BED_PIN 11 // Analog Input // SPI for MAX Thermocouple -#undef TEMP_0_CS_PIN #if DISABLED(SDSUPPORT) #define TEMP_0_CS_PIN 67 // Don't use 53 if using Display/SD card #else #define TEMP_0_CS_PIN 67 // Don't use 49 (SD_DETECT_PIN) #endif +#define SDA_PIN 20 +#define SCL_PIN 21 +#define RESET_PIN 42 // Resets the board if the jumper is attached + // // LCD / Controller // - -// Support for AZSMZ 12864 LCD with SD Card 3D printer smart controller control panel #if ENABLED(AZSMZ_12864) + + // Support for AZSMZ 12864 LCD with SD Card 3D printer smart controller control panel #define BEEPER_PIN 66 // Smart RAMPS 1.42 pinout diagram on RepRap WIKI erroneously says this should be pin 65 #define DOGLCD_A0 59 #define DOGLCD_CS 44 @@ -116,4 +106,37 @@ #define BTN_ENC 67 // Smart RAMPS 1.42 pinout diagram on RepRap WIKI erroneously says this should be pin 66 #define SD_DETECT_PIN 49 // Pin 49 for display sd interface, 72 for easy adapter board #define KILL_PIN 42 + +#else + + /** ------ ------ + * 37 |10 9 | 35 (MISO) 50 |10 9 | 52 (SCK) + * 31 | 8 7 | 41 29 | 8 7 | 53 + * 33 6 5 | 23 25 6 5 | 51 (MOSI) + * 42 | 4 3 | 44 49 | 4 3 | 27 + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ + #define EXP1_03_PIN 44 + #define EXP1_04_PIN 42 + #define EXP1_05_PIN 23 + #define EXP1_06_PIN 33 + #define EXP1_07_PIN 41 + #define EXP1_08_PIN 31 + #define EXP1_09_PIN 35 + #define EXP1_10_PIN 37 + + #define EXP2_03_PIN 27 + #define EXP2_04_PIN 49 + #define EXP2_05_PIN 51 + #define EXP2_06_PIN 25 + #define EXP2_07_PIN 53 + #define EXP2_08_PIN 29 + #define EXP2_09_PIN 52 + #define EXP2_10_PIN 50 + #endif + +#define ALLOW_SAM3X8E +#include "../ramps/pins_RAMPS.h" From d3fe0caa7f83b8e971e8503b5344e20811d6c812 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 9 May 2022 18:50:14 -0500 Subject: [PATCH 285/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Cla?= =?UTF-8?q?rify=20acceleration=20factor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/planner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 22d7d61ac556..6d5c94ebb7d1 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2473,7 +2473,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, block->acceleration_steps_per_s2 = accel; block->acceleration = accel / steps_per_mm; #if DISABLED(S_CURVE_ACCELERATION) - block->acceleration_rate = (uint32_t)(accel * (sq(4096.0f) / (STEPPER_TIMER_RATE))); + block->acceleration_rate = (uint32_t)(accel * (float(1 << 24) / (STEPPER_TIMER_RATE))); #endif #if ENABLED(LIN_ADVANCE) if (block->use_advance_lead) { From d67fa98cf601a8ef2642641a8aefbcdab1d5bcc2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 May 2022 04:16:31 -0500 Subject: [PATCH 286/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20accel=20dividend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/planner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 6d5c94ebb7d1..672ca2dde364 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2473,7 +2473,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, block->acceleration_steps_per_s2 = accel; block->acceleration = accel / steps_per_mm; #if DISABLED(S_CURVE_ACCELERATION) - block->acceleration_rate = (uint32_t)(accel * (float(1 << 24) / (STEPPER_TIMER_RATE))); + block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / (STEPPER_TIMER_RATE))); #endif #if ENABLED(LIN_ADVANCE) if (block->use_advance_lead) { From d5f472a6cf4456bf715ee3b3a85132f3fbe7e15f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 May 2022 00:07:22 -0500 Subject: [PATCH 287/502] =?UTF-8?q?=F0=9F=94=A8=20Fix=20g++=20locator=20fo?= =?UTF-8?q?r=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/preprocessor.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/preprocessor.py b/buildroot/share/PlatformIO/scripts/preprocessor.py index 3d324bac4b38..d9c472006c28 100644 --- a/buildroot/share/PlatformIO/scripts/preprocessor.py +++ b/buildroot/share/PlatformIO/scripts/preprocessor.py @@ -67,11 +67,9 @@ def search_compiler(env): with open(GCC_PATH_CACHE, 'r') as f: return f.read() - # Find a platform compiler by searching $PATH items - # A native target will search all PATH bin folders. - # Others look only within $HOME/.platformio. - path_regex = "" if env.GetProjectOption('platform') == 'native' else re.escape(env['PROJECT_PACKAGES_DIR']) - + # Find the current platform compiler by searching the $PATH + # which will be in a platformio toolchain bin folder + path_regex = re.escape(env['PROJECT_PACKAGES_DIR']) gcc = "g++" if env['PLATFORM'] == 'win32': path_separator = ';' From d235bc9e1c5eeb210275a4abcf89a757d0259cc0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Apr 2022 16:14:02 -0500 Subject: [PATCH 288/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Gen?= =?UTF-8?q?eral=20and=20Axis-based=20bitfield=20flags=20(#23989)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/types.h | 53 ++++++++++++++++++++++++ Marlin/src/feature/fancheck.cpp | 4 +- Marlin/src/feature/fancheck.h | 2 +- Marlin/src/feature/fwretract.cpp | 12 +++--- Marlin/src/feature/fwretract.h | 8 ++-- Marlin/src/feature/powerloss.cpp | 2 +- Marlin/src/gcode/control/M17_M18_M84.cpp | 8 ++-- Marlin/src/lcd/menu/menu_tramming.cpp | 9 ++-- Marlin/src/module/settings.cpp | 35 ++++++++-------- Marlin/src/module/stepper.cpp | 2 +- Marlin/src/module/stepper.h | 4 +- Marlin/src/module/temperature.cpp | 8 ++-- Marlin/src/module/tool_change.cpp | 8 ++-- Marlin/src/module/tool_change.h | 2 +- 14 files changed, 106 insertions(+), 51 deletions(-) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 045ca3589f4c..855502458bbb 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -66,6 +66,59 @@ struct IF { typedef L type; }; #define AXIS_COLLISION(L) (AXIS4_NAME == L || AXIS5_NAME == L || AXIS6_NAME == L) +// General Flags for some number of states +template +struct Flags { + typedef typename IF<(N>8), uint16_t, uint8_t>::type bits_t; + typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1; } N8; + typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1; } N16; + union { + bits_t b; + typename IF<(N>8), N16, N8>::type flag; + }; + void reset() { b = 0; } + void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); } + void set(const int n) { b |= (bits_t)_BV(n); } + void clear(const int n) { b &= ~(bits_t)_BV(n); } + bool test(const int n) const { return TEST(b, n); } + bool operator[](const int n) { return test(n); } + const bool operator[](const int n) const { return test(n); } + const int size() const { return sizeof(b); } +}; + +// Specialization for a single bool flag +template<> +struct Flags<1> { + bool b; + void reset() { b = false; } + void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); } + void set(const int) { b = true; } + void clear(const int) { b = false; } + bool test(const int) const { return b; } + bool operator[](const int) { return b; } + const bool operator[](const int) const { return b; } + const int size() const { return sizeof(b); } +}; + +typedef Flags<8> flags_8_t; +typedef Flags<16> flags_16_t; + +// Flags for some axis states, with per-axis aliases xyzijkuvwe +typedef struct AxisFlags { + union { + struct Flags flags; + struct { bool LOGICAL_AXIS_LIST(e:1, x:1, y:1, z:1, i:1, j:1, k:1, u:1, v:1, w:1); }; + }; + void reset() { flags.reset(); } + void set(const int n) { flags.set(n); } + void set(const int n, const bool onoff) { flags.set(n, onoff); } + void clear(const int n) { flags.clear(n); } + bool test(const int n) const { return flags.test(n); } + bool operator[](const int n) { return flags[n]; } + const bool operator[](const int n) const { return flags[n]; } + const int size() const { return sizeof(flags); } +} axis_flags_t; + // // Enumerated axis indices // diff --git a/Marlin/src/feature/fancheck.cpp b/Marlin/src/feature/fancheck.cpp index 1b47fadecc31..126b79b0a409 100644 --- a/Marlin/src/feature/fancheck.cpp +++ b/Marlin/src/feature/fancheck.cpp @@ -34,7 +34,7 @@ #if HAS_AUTO_FAN && EXTRUDER_AUTO_FAN_SPEED != 255 && DISABLED(FOURWIRES_FANS) bool FanCheck::measuring = false; #endif -bool FanCheck::tacho_state[TACHO_COUNT]; +Flags FanCheck::tacho_state; uint16_t FanCheck::edge_counter[TACHO_COUNT]; uint8_t FanCheck::rps[TACHO_COUNT]; FanCheck::TachoError FanCheck::error = FanCheck::TachoError::NONE; @@ -103,7 +103,7 @@ void FanCheck::update_tachometers() { if (status != tacho_state[f]) { if (measuring) ++edge_counter[f]; - tacho_state[f] = status; + tacho_state.set(f, status); } } } diff --git a/Marlin/src/feature/fancheck.h b/Marlin/src/feature/fancheck.h index c8665a0e96e8..b13a34fb19eb 100644 --- a/Marlin/src/feature/fancheck.h +++ b/Marlin/src/feature/fancheck.h @@ -51,7 +51,7 @@ class FanCheck { #else static constexpr bool measuring = true; #endif - static bool tacho_state[TACHO_COUNT]; + static Flags tacho_state; static uint16_t edge_counter[TACHO_COUNT]; static uint8_t rps[TACHO_COUNT]; static TachoError error; diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index bf47a6b2d557..172c97accdda 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -45,7 +45,7 @@ FWRetract fwretract; // Single instance - this calls the constructor // private: #if HAS_MULTI_EXTRUDER - bool FWRetract::retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted + Flags FWRetract::retracted_swap; // Which extruders are swap-retracted #endif // public: @@ -56,7 +56,7 @@ fwretract_settings_t FWRetract::settings; // M207 S F Z W, M208 S F bool FWRetract::autoretract_enabled; // M209 S - Autoretract switch #endif -bool FWRetract::retracted[EXTRUDERS]; // Which extruders are currently retracted +Flags FWRetract::retracted; // Which extruders are currently retracted float FWRetract::current_retract[EXTRUDERS], // Retract value used by planner FWRetract::current_hop; @@ -73,9 +73,9 @@ void FWRetract::reset() { settings.swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP; current_hop = 0.0; + retracted.reset(); EXTRUDER_LOOP() { - retracted[e] = false; - E_TERN_(retracted_swap[e] = false); + E_TERN_(retracted_swap.clear(e)); current_retract[e] = 0.0; } } @@ -173,11 +173,11 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/)) TERN_(RETRACT_SYNC_MIXING, mixer.T(old_mixing_tool)); // Restore original mixing tool - retracted[active_extruder] = retracting; // Active extruder now retracted / recovered + retracted.set(active_extruder, retracting); // Active extruder now retracted / recovered // If swap retract/recover update the retracted_swap flag too #if HAS_MULTI_EXTRUDER - if (swapping) retracted_swap[active_extruder] = retracting; + if (swapping) retracted_swap.set(active_extruder, retracting); #endif /* // debugging diff --git a/Marlin/src/feature/fwretract.h b/Marlin/src/feature/fwretract.h index 081ec44c0574..db2a62c8d410 100644 --- a/Marlin/src/feature/fwretract.h +++ b/Marlin/src/feature/fwretract.h @@ -43,7 +43,7 @@ typedef struct { class FWRetract { private: #if HAS_MULTI_EXTRUDER - static bool retracted_swap[EXTRUDERS]; // Which extruders are swap-retracted + static Flags retracted_swap; // Which extruders are swap-retracted #endif public: @@ -55,7 +55,7 @@ class FWRetract { static constexpr bool autoretract_enabled = false; #endif - static bool retracted[EXTRUDERS]; // Which extruders are currently retracted + static Flags retracted; // Which extruders are currently retracted static float current_retract[EXTRUDERS], // Retract value used by planner current_hop; // Hop value used by planner @@ -63,9 +63,7 @@ class FWRetract { static void reset(); - static void refresh_autoretract() { - EXTRUDER_LOOP() retracted[e] = false; - } + static void refresh_autoretract() { retracted.reset(); } static void enable_autoretract(const bool enable) { #if ENABLED(FWRETRACT_AUTORETRACT) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index e880f802dc79..944f2ee63c84 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -519,7 +519,7 @@ void PrintJobRecovery::resume() { EXTRUDER_LOOP() { if (info.retract[e] != 0.0) { fwretract.current_retract[e] = info.retract[e]; - fwretract.retracted[e] = true; + fwretract.retracted.set(e); } } fwretract.current_hop = info.retract_hop; diff --git a/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin/src/gcode/control/M17_M18_M84.cpp index 3bc5582ce700..8350538a9281 100644 --- a/Marlin/src/gcode/control/M17_M18_M84.cpp +++ b/Marlin/src/gcode/control/M17_M18_M84.cpp @@ -33,8 +33,8 @@ #include "../../core/debug_out.h" #include "../../libs/hex_print.h" -inline axis_flags_t selected_axis_bits() { - axis_flags_t selected{0}; +inline stepper_flags_t selected_axis_bits() { + stepper_flags_t selected{0}; #if HAS_EXTRUDERS if (parser.seen('E')) { if (E_TERN0(parser.has_value())) { @@ -58,7 +58,7 @@ inline axis_flags_t selected_axis_bits() { } // Enable specified axes and warn about other affected axes -void do_enable(const axis_flags_t to_enable) { +void do_enable(const stepper_flags_t to_enable) { const ena_mask_t was_enabled = stepper.axis_enabled.bits, shall_enable = to_enable.bits & ~was_enabled; @@ -141,7 +141,7 @@ void GcodeSuite::M17() { } } -void try_to_disable(const axis_flags_t to_disable) { +void try_to_disable(const stepper_flags_t to_disable) { ena_mask_t still_enabled = to_disable.bits & stepper.axis_enabled.bits; DEBUG_ECHOLNPGM("Enabled: ", hex_word(stepper.axis_enabled.bits), " To Disable: ", hex_word(to_disable.bits), " | ", hex_word(still_enabled)); diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index 7c241e09ece6..cd7a4c677a10 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -44,7 +44,7 @@ #include "../../core/debug_out.h" static float z_measured[G35_PROBE_COUNT]; -static bool z_isvalid[G35_PROBE_COUNT]; +static Flags z_isvalid; static uint8_t tram_index = 0; static int8_t reference_index; // = 0 @@ -61,7 +61,10 @@ static bool probe_single_point() { move_to_tramming_wait_pos(); DEBUG_ECHOLNPGM("probe_single_point(", tram_index, ") = ", z_probed_height, "mm"); - return (z_isvalid[tram_index] = !isnan(z_probed_height)); + + const bool v = !isnan(z_probed_height); + z_isvalid.set(tram_index, v); + return v; } static void _menu_single_probe() { @@ -95,7 +98,7 @@ void goto_tramming_wizard() { ui.defer_status_screen(); // Initialize measured point flags - ZERO(z_isvalid); + z_isvalid.reset(); reference_index = -1; // Inject G28, wait for homing to complete, diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 6a79c7e67d8a..bd38da46282b 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -178,11 +178,12 @@ #endif #define _EN_ITEM(N) , E##N +#define _EN1_ITEM(N) , E##N:1 -typedef struct { uint16_t LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_stepper_current_t; -typedef struct { uint32_t LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_hybrid_threshold_t; -typedef struct { int16_t LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4; } tmc_sgt_t; -typedef struct { bool LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } tmc_stealth_enabled_t; +typedef struct { uint16_t LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint16_t; +typedef struct { uint32_t LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint32_t; +typedef struct { int16_t LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4; } mot_stepper_int16_t; +typedef struct { bool LINEAR_AXIS_LIST(X:1, Y:1, Z:1, I:1, J:1, K:1), X2:1, Y2:1, Z2:1, Z3:1, Z4:1 REPEAT(E_STEPPERS, _EN1_ITEM); } per_stepper_bool_t; #undef _EN_ITEM @@ -430,10 +431,10 @@ typedef struct SettingsDataStruct { // // HAS_TRINAMIC_CONFIG // - tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z... - tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z... - tmc_sgt_t tmc_sgt; // M914 X Y Z... - tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z... + per_stepper_uint16_t tmc_stepper_current; // M906 X Y Z... + per_stepper_uint32_t tmc_hybrid_threshold; // M913 X Y Z... + mot_stepper_int16_t tmc_sgt; // M914 X Y Z... + per_stepper_bool_t tmc_stealth_enabled; // M569 X Y Z... // // LIN_ADVANCE @@ -1213,7 +1214,7 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(tmc_stepper_current); - tmc_stepper_current_t tmc_stepper_current{0}; + per_stepper_uint16_t tmc_stepper_current{0}; #if HAS_TRINAMIC_CONFIG #if AXIS_IS_TMC(X) @@ -1284,7 +1285,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(tmc_hybrid_threshold); #if ENABLED(HYBRID_THRESHOLD) - tmc_hybrid_threshold_t tmc_hybrid_threshold{0}; + per_stepper_uint32_t tmc_hybrid_threshold{0}; TERN_(X_HAS_STEALTHCHOP, tmc_hybrid_threshold.X = stepperX.get_pwm_thrs()); TERN_(Y_HAS_STEALTHCHOP, tmc_hybrid_threshold.Y = stepperY.get_pwm_thrs()); TERN_(Z_HAS_STEALTHCHOP, tmc_hybrid_threshold.Z = stepperZ.get_pwm_thrs()); @@ -1306,7 +1307,7 @@ void MarlinSettings::postprocess() { TERN_(E7_HAS_STEALTHCHOP, tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs()); #else #define _EN_ITEM(N) , .E##N = 30 - const tmc_hybrid_threshold_t tmc_hybrid_threshold = { + const per_stepper_uint32_t tmc_hybrid_threshold = { LINEAR_AXIS_LIST(.X = 100, .Y = 100, .Z = 3, .I = 3, .J = 3, .K = 3), .X2 = 100, .Y2 = 100, .Z2 = 3, .Z3 = 3, .Z4 = 3 REPEAT(E_STEPPERS, _EN_ITEM) @@ -1320,7 +1321,7 @@ void MarlinSettings::postprocess() { // TMC StallGuard threshold // { - tmc_sgt_t tmc_sgt{0}; + mot_stepper_int16_t tmc_sgt{0}; #if USE_SENSORLESS LINEAR_AXIS_CODE( TERN_(X_SENSORLESS, tmc_sgt.X = stepperX.homing_threshold()), @@ -1345,7 +1346,7 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(tmc_stealth_enabled); - tmc_stealth_enabled_t tmc_stealth_enabled = { false }; + per_stepper_bool_t tmc_stealth_enabled = { false }; TERN_(X_HAS_STEALTHCHOP, tmc_stealth_enabled.X = stepperX.get_stored_stealthChop()); TERN_(Y_HAS_STEALTHCHOP, tmc_stealth_enabled.Y = stepperY.get_stored_stealthChop()); TERN_(Z_HAS_STEALTHCHOP, tmc_stealth_enabled.Z = stepperZ.get_stored_stealthChop()); @@ -2135,7 +2136,7 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(tmc_stepper_current); - tmc_stepper_current_t currents; + per_stepper_uint16_t currents; EEPROM_READ(currents); #if HAS_TRINAMIC_CONFIG @@ -2205,7 +2206,7 @@ void MarlinSettings::postprocess() { // TMC Hybrid Threshold { - tmc_hybrid_threshold_t tmc_hybrid_threshold; + per_stepper_uint32_t tmc_hybrid_threshold; _FIELD_TEST(tmc_hybrid_threshold); EEPROM_READ(tmc_hybrid_threshold); @@ -2238,7 +2239,7 @@ void MarlinSettings::postprocess() { // TMC StallGuard threshold. // { - tmc_sgt_t tmc_sgt; + mot_stepper_int16_t tmc_sgt; _FIELD_TEST(tmc_sgt); EEPROM_READ(tmc_sgt); #if USE_SENSORLESS @@ -2264,7 +2265,7 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(tmc_stealth_enabled); - tmc_stealth_enabled_t tmc_stealth_enabled; + per_stepper_bool_t tmc_stealth_enabled; EEPROM_READ(tmc_stealth_enabled); #if HAS_TRINAMIC_CONFIG diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 09d99e89650c..d92d50a048ea 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -153,7 +153,7 @@ Stepper stepper; // Singleton #endif #endif -axis_flags_t Stepper::axis_enabled; // {0} +stepper_flags_t Stepper::axis_enabled; // {0} // private: diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 4c9fbb9556b9..4f1eea702d1f 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -252,7 +252,7 @@ typedef struct { }; constexpr ena_mask_t linear_bits() { return _BV(LINEAR_AXES) - 1; } constexpr ena_mask_t e_bits() { return (_BV(EXTRUDERS) - 1) << LINEAR_AXES; } -} axis_flags_t; +} stepper_flags_t; // All the stepper enable pins constexpr pin_t ena_pins[] = { @@ -587,7 +587,7 @@ class Stepper { static void refresh_motor_power(); #endif - static axis_flags_t axis_enabled; // Axis stepper(s) ENABLED states + static stepper_flags_t axis_enabled; // Axis stepper(s) ENABLED states static bool axis_is_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { return TEST(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex)); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 89941fe1d1dc..b9d24963b8e4 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1092,7 +1092,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { static hotend_pid_t work_pid[HOTENDS]; static float temp_iState[HOTENDS] = { 0 }, temp_dState[HOTENDS] = { 0 }; - static bool pid_reset[HOTENDS] = { false }; + static Flags pid_reset; const float pid_error = temp_hotend[ee].target - temp_hotend[ee].celsius; float pid_output; @@ -1102,17 +1102,17 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { || TERN0(HEATER_IDLE_HANDLER, heater_idle[ee].timed_out) ) { pid_output = 0; - pid_reset[ee] = true; + pid_reset.set(ee); } else if (pid_error > PID_FUNCTIONAL_RANGE) { pid_output = BANG_MAX; - pid_reset[ee] = true; + pid_reset.set(ee); } else { if (pid_reset[ee]) { temp_iState[ee] = 0.0; work_pid[ee].Kd = 0.0; - pid_reset[ee] = false; + pid_reset.clear(ee); } work_pid[ee].Kd = work_pid[ee].Kd + PID_K2 * (PID_PARAM(Kd, ee) * (temp_dState[ee] - temp_hotend[ee].celsius) - work_pid[ee].Kd); diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 26815642db02..0142428bc3e0 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -46,7 +46,7 @@ #endif #if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP) - bool toolchange_extruder_ready[EXTRUDERS]; + Flags toolchange_extruder_ready; #endif #if EITHER(MAGNETIC_PARKING_EXTRUDER, TOOL_SENSOR) \ @@ -1047,7 +1047,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { if (new_tool == old_tool && !first_tool_is_primed && enable_first_prime) { tool_change_prime(); first_tool_is_primed = true; - TERN_(TOOLCHANGE_FS_INIT_BEFORE_SWAP, toolchange_extruder_ready[old_tool] = true); // Primed and initialized + TERN_(TOOLCHANGE_FS_INIT_BEFORE_SWAP, toolchange_extruder_ready.set(old_tool)); // Primed and initialized } #endif @@ -1196,7 +1196,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP) if (!toolchange_extruder_ready[new_tool]) { - toolchange_extruder_ready[new_tool] = true; + toolchange_extruder_ready.set(new_tool); fr = toolchange_settings.prime_speed; // Next move is a prime unscaled_e_move(0, MMM_TO_MMS(fr)); // Init planner with 0 length move } @@ -1381,7 +1381,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { // Migrate the retracted state #if ENABLED(FWRETRACT) - fwretract.retracted[migration_extruder] = fwretract.retracted[active_extruder]; + fwretract.retracted.set(migration_extruder, fwretract.retracted[active_extruder]); #endif // Migrate the temperature to the new hotend diff --git a/Marlin/src/module/tool_change.h b/Marlin/src/module/tool_change.h index bbdc0b686278..73798265edfd 100644 --- a/Marlin/src/module/tool_change.h +++ b/Marlin/src/module/tool_change.h @@ -50,7 +50,7 @@ #endif #if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP) - extern bool toolchange_extruder_ready[EXTRUDERS]; + extern Flags toolchange_extruder_ready; #endif #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) From 0805f9bf3f631d914bb6ff4817d65a9ab237fe6c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 May 2022 20:23:32 -0500 Subject: [PATCH 289/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20ProUI=20leveling?= =?UTF-8?q?=20start=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index c8d37567d53f..fcce26332126 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -428,7 +428,7 @@ G29_TYPE GcodeSuite::G29() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling"); points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_LevelingStart()); + TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart()); #endif TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); From cb4ad020af2f56dc060ecafdfd58b0639a8f0199 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 May 2022 20:13:59 -0500 Subject: [PATCH 290/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Mis?= =?UTF-8?q?c.=20LCD=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 4 ++ Marlin/src/MarlinCore.h | 2 + Marlin/src/feature/bedlevel/ubl/ubl.h | 2 +- Marlin/src/gcode/lcd/M73.cpp | 2 +- Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/lcd/e3v2/creality/dwin.cpp | 4 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 59 +++++++++++----------- Marlin/src/lcd/e3v2/proui/dwin.h | 8 +-- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 2 +- Marlin/src/lcd/e3v2/proui/dwin_popup.h | 2 +- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwinui.h | 2 +- Marlin/src/lcd/e3v2/proui/endstop_diag.cpp | 2 +- Marlin/src/lcd/e3v2/proui/lockscreen.cpp | 7 ++- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 11 ++-- Marlin/src/lcd/e3v2/proui/printstats.cpp | 2 +- Marlin/src/lcd/language/language_de.h | 4 +- Marlin/src/lcd/language/language_en.h | 12 +++-- Marlin/src/lcd/language/language_gl.h | 6 +-- Marlin/src/lcd/language/language_hu.h | 4 +- Marlin/src/lcd/language/language_it.h | 4 +- Marlin/src/lcd/language/language_ro.h | 4 +- Marlin/src/lcd/language/language_ru.h | 4 +- Marlin/src/lcd/language/language_sk.h | 4 +- Marlin/src/lcd/language/language_sv.h | 4 +- Marlin/src/lcd/language/language_uk.h | 4 +- Marlin/src/lcd/language/language_zh_CN.h | 4 +- Marlin/src/lcd/menu/menu.cpp | 4 -- Marlin/src/lcd/menu/menu.h | 1 - Marlin/src/lcd/menu/menu_advanced.cpp | 1 + Marlin/src/lcd/menu/menu_bed_leveling.cpp | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 2 + Marlin/src/lcd/menu/menu_filament.cpp | 3 ++ Marlin/src/libs/BL24CXX.cpp | 10 ++-- Marlin/src/module/settings.cpp | 10 ++-- 35 files changed, 109 insertions(+), 91 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 279754aee3bd..c553f9cba010 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -321,6 +321,10 @@ bool pin_is_protected(const pin_t pin) { #pragma GCC diagnostic pop +bool printer_busy() { + return planner.movesplanned() || printingIsActive(); +} + /** * A Print Job exists when the timer is running or SD is printing */ diff --git a/Marlin/src/MarlinCore.h b/Marlin/src/MarlinCore.h index 7063c7e2de38..f80405a302ee 100644 --- a/Marlin/src/MarlinCore.h +++ b/Marlin/src/MarlinCore.h @@ -61,6 +61,8 @@ bool printJobOngoing(); bool printingIsPaused(); void startOrResumeJob(); +bool printer_busy(); + extern bool wait_for_heatup; #if HAS_RESUME_CONTINUE diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 8dad966acb84..9dd964c46cfb 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -83,7 +83,6 @@ class unified_bed_leveling { static bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) { return smart_fill_one(pos.x, pos.y, dir.x, dir.y); } - static void smart_fill_mesh(); #if ENABLED(UBL_DEVEL_DEBUGGING) static void g29_what_command(); @@ -106,6 +105,7 @@ class unified_bed_leveling { static void set_all_mesh_points_to_value(const_float_t value); static void adjust_mesh_to_mean(const bool cflag, const_float_t value); static bool sanity_check(); + static void smart_fill_mesh(); static void G29() __O0; // O0 for no optimization static void smart_fill_wlsf(const_float_t ) __O2; // O2 gives smaller code than Os on A2560 diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index 355445c573b9..a86eee4d9967 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -42,7 +42,7 @@ void GcodeSuite::M73() { #if ENABLED(DWIN_LCD_PROUI) - DWIN_Progress_Update(); + DWIN_M73(); #else diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b542c37c88dd..9e307e9444ed 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1836,7 +1836,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * LCD_BED_LEVELING requirements */ #if ENABLED(LCD_BED_LEVELING) - #if NONE(HAS_MARLINUI_MENU, DWIN_CREALITY_LCD, DWIN_LCD_PROUI) + #if !HAS_MARLINUI_MENU #error "LCD_BED_LEVELING is not supported by the selected LCD controller." #elif !(ENABLED(MESH_BED_LEVELING) || HAS_ABL_NOT_UBL) #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING." diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 05ac38d226ce..65da4cb42157 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -33,7 +33,7 @@ //#define USE_STRING_HEADINGS //#define USE_STRING_TITLES -#if ENABLED(LCD_BED_LEVELING) && DISABLED(PROBE_MANUALLY) && ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) +#if DISABLED(PROBE_MANUALLY) && ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) #define HAS_ONESTEP_LEVELING 1 #endif @@ -1366,8 +1366,6 @@ void HMI_Move_Z() { #if HAS_ZOFFSET_ITEM - bool printer_busy() { return planner.movesplanned() || printingIsActive(); } - void HMI_Zoffset() { EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); if (encoder_diffState == ENCODER_DIFF_NO) return; diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 9db6355e98bd..9e4464dec979 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -432,7 +432,7 @@ void Draw_Back_First(const bool is_sel=true) { //PopUps void Popup_window_PauseOrStop() { if (HMI_IsChinese()) { - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); if (select_print.now == PRINT_PAUSE_RESUME) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150); else if (select_print.now == PRINT_STOP) DWIN_Frame_AreaCopy(1, 221, 320, 253, 336, 98, 150); @@ -451,7 +451,7 @@ void Popup_window_PauseOrStop() { void Popup_Window_ETempTooLow() { if (HMI_IsChinese()) { HMI_SaveProcessID(WaitResponse); - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); DWINUI::Draw_Icon(ICON_TempTooLow, 102, 105); DWIN_Frame_AreaCopy(1, 103, 371, 136, 386, 69, 240); @@ -469,7 +469,7 @@ void Popup_window_PauseOrStop() { void DWIN_Popup_Temperature(const bool toohigh) { HMI_SaveProcessID(WaitResponse); if (HMI_IsChinese()) { - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); if (toohigh) { DWINUI::Draw_Icon(ICON_TempTooHigh, 102, 165); @@ -579,13 +579,13 @@ void Draw_Print_ProgressBar() { void Draw_Print_ProgressElapsed() { char buf[10]; duration_t elapsed = print_job_timer.duration(); // print timer - sprintf_P(buf, PSTR("%02i:%02i"), (uint16_t)(elapsed.value / 3600), ((uint16_t)elapsed.value % 3600) / 60); + sprintf_P(buf, PSTR("%02i:%02i "), (uint16_t)(elapsed.value / 3600), ((uint16_t)elapsed.value % 3600) / 60); DWINUI::Draw_String(HMI_data.Text_Color, HMI_data.Background_Color, 47, 192, buf); } void Draw_Print_ProgressRemain() { char buf[10]; - sprintf_P(buf, PSTR("%02i:%02i"), (uint16_t)(_remain_time / 3600), ((uint16_t)_remain_time % 3600) / 60); + sprintf_P(buf, PSTR("%02i:%02i "), (uint16_t)(_remain_time / 3600), ((uint16_t)_remain_time % 3600) / 60); DWINUI::Draw_String(HMI_data.Text_Color, HMI_data.Background_Color, 181, 192, buf); } @@ -612,7 +612,7 @@ void Draw_PrintProcess() { Title.FrameCopy(30, 1, 42, 14); // "Printing" else Title.ShowCaption(GET_TEXT_F(MSG_PRINTING)); - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); DWIN_Print_Header(sdprint ? card.longest_filename() : nullptr); Draw_Print_Labels(); DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); @@ -641,7 +641,7 @@ void Draw_PrintDone() { _remain_time = 0; Title.ShowCaption(GET_TEXT_F(MSG_PRINT_DONE)); - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); DWIN_Print_Header(nullptr); Draw_Print_ProgressBar(); Draw_Print_Labels(); @@ -663,7 +663,7 @@ void Goto_PrintDone() { } void Draw_Main_Menu() { - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); if (HMI_IsChinese()) Title.FrameCopy(2, 2, 26, 13); // "Home" etc else @@ -933,7 +933,7 @@ void Redraw_SD_List() { select_file.reset(); index_file = MROWS; - DWINUI::ClearMenuArea(); // Leave title bar unchanged + DWINUI::ClearMainArea(); // Leave title bar unchanged Draw_Back_First(); @@ -1041,7 +1041,7 @@ void DWIN_Draw_Dashboard() { } void Draw_Info_Menu() { - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); Draw_Back_First(); if (HMI_IsChinese()) Title.FrameCopy(30, 17, 28, 13); // "Info" @@ -1107,7 +1107,7 @@ void HMI_MainMenu() { case PAGE_PRINT: checkkey = SelectFile; card.mount(); - delay(300); + safe_delay(300); Draw_Print_File_Menu(); break; case PAGE_PREPARE: Draw_Prepare_Menu(); break; @@ -1349,8 +1349,8 @@ void HMI_Init() { void EachMomentUpdate() { 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)) { next_var_update_ms = ms + DWIN_VAR_UPDATE_INTERVAL; update_variable(); @@ -1439,7 +1439,7 @@ void EachMomentUpdate() { #if ENABLED(POWER_LOSS_RECOVERY) void Popup_PowerLossRecovery() { - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 160, 338, 235, 354, 98, 115); @@ -1478,7 +1478,7 @@ void EachMomentUpdate() { void Goto_PowerLossRecovery() { recovery.dwin_flag = false; - LCD_MESSAGE_F(GET_TEXT_F(MSG_CONTINUE_PRINT_JOB)); + LCD_MESSAGE(MSG_CONTINUE_PRINT_JOB); Goto_Popup(Popup_PowerLossRecovery, onClick_PowerLossRecovery); } @@ -1581,15 +1581,15 @@ void DWIN_PidTuning(pidresult_t result) { break; case PID_BAD_EXTRUDER_NUM: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooLow, F("PID Autotune failed!"), F("Bad extruder")); + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_BAD_EXTRUDER_NUM)); break; case PID_TUNING_TIMEOUT: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooHigh, F("Error"), GET_TEXT_F(MSG_PID_TIMEOUT)); + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_PID_TIMEOUT)); break; case PID_TEMP_TOO_HIGH: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooHigh, F("PID Autotune failed!"), F("Temperature too high")); + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); break; case PID_DONE: checkkey = last_checkkey; @@ -1637,7 +1637,7 @@ void DWIN_Print_Finished() { HMI_flag.pause_flag = false; wait_for_heatup = false; planner.finish_and_disable(); - thermalManager.cooldown(); + thermalManager.cooldown(); Goto_PrintDone(); } @@ -1652,7 +1652,7 @@ void DWIN_Print_Aborted() { } // Progress Bar update -void DWIN_Progress_Update() { +void DWIN_M73() { if (parser.seenval('P')) _percent_done = parser.byteval('P'); if (parser.seenval('R')) { _remain_time = parser.ulongval('R') * 60; @@ -1707,11 +1707,11 @@ void DWIN_SetDataDefaults() { TERN_(BAUD_RATE_GCODE, SetBaud250K()); } -void DWIN_StoreSettings(char *buff) { +void DWIN_CopySettingsTo(char * const buff) { memcpy(buff, &HMI_data, _MIN(sizeof(HMI_data), eeprom_data_size)); } -void DWIN_LoadSettings(const char *buff) { +void DWIN_CopySettingsFrom(const char * const buff) { // (void *)-> Avoid Warning when save data different from uintX_t in HMI_data_t struct memcpy((void *)&HMI_data, buff, _MIN(sizeof(HMI_data), eeprom_data_size)); dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); @@ -1729,6 +1729,7 @@ void DWIN_LoadSettings(const char *buff) { // Apply Led Color leds.set_color(HMI_data.Led_Color); #endif + } // Initialize or re-initialize the LCD @@ -1773,10 +1774,10 @@ void DWIN_RebootScreen() { DWIN_JPG_ShowAndCache(0); DWINUI::Draw_CenteredString(Color_White, 220, GET_TEXT_F(MSG_PLEASE_WAIT_REBOOT)); DWIN_UpdateLCD(); - delay(500); + safe_delay(500); } -void DWIN_Redraw_screen() { +void DWIN_RedrawScreen() { Draw_Main_Area(); hash_changed = true; DWIN_DrawStatusMessage(); @@ -1898,13 +1899,13 @@ void Goto_ConfirmToPrint() { void ReadEeprom() { const bool success = settings.load(); - DWIN_Redraw_screen(); + DWIN_RedrawScreen(); HMI_AudioFeedback(success); } void ResetEeprom() { settings.reset(); - DWIN_Redraw_screen(); + DWIN_RedrawScreen(); HMI_AudioFeedback(); } #endif @@ -1947,7 +1948,7 @@ void SetHome() { } #if HAS_ZOFFSET_ITEM - bool printer_busy() { return planner.movesplanned() || printingIsActive(); } + void ApplyZOffset() { TERN_(EEPROM_SETTINGS, settings.save()); } void LiveZOffset() { last_zoffset = dwin_zoffset; @@ -2066,7 +2067,7 @@ void SetPID(celsius_t t, heater_id_t h) { void ApplyBrightness() { ui.set_brightness(MenuData.Value); } void LiveBrightness() { DWIN_LCD_Brightness(MenuData.Value); } void SetBrightness() { SetIntOnClick(LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.brightness, ApplyBrightness, LiveBrightness); } - void TurnOffBacklight() { HMI_SaveProcessID(WaitResponse); ui.set_brightness(0); DWIN_Redraw_screen(); } + void TurnOffBacklight() { HMI_SaveProcessID(WaitResponse); ui.set_brightness(0); DWIN_RedrawScreen(); } #endif #if ENABLED(CASE_LIGHT_MENU) @@ -2170,7 +2171,7 @@ void SetPID(celsius_t t, heater_id_t h) { void RestoreDefaultsColors() { DWIN_SetColorDefaults(); DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); - DWIN_Redraw_screen(); + DWIN_RedrawScreen(); } void SelColor() { @@ -2981,7 +2982,7 @@ void Draw_Prepare_Menu() { } void Draw_Tramming_Menu() { - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); checkkey = Menu; if (!TrammingMenu) TrammingMenu = new MenuClass(); if (CurrentMenu != TrammingMenu) { diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index b61ed846dfcb..3219171a1160 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -115,7 +115,7 @@ void Goto_PowerLossRecovery(); void Goto_ConfirmToPrint(); void DWIN_Draw_Dashboard(const bool with_update); // Status Area void Draw_Main_Area(); // Redraw main area; -void DWIN_Redraw_screen(); // Redraw all screen elements +void DWIN_RedrawScreen(); // Redraw all screen elements void HMI_MainMenu(); // Main process screen void HMI_SelectFile(); // File page void HMI_Printing(); // Print page @@ -158,12 +158,12 @@ void DWIN_Print_Aborted(); #if HAS_FILAMENT_SENSOR void DWIN_FilamentRunout(const uint8_t extruder); #endif -void DWIN_Progress_Update(); +void DWIN_M73(); void DWIN_Print_Header(const char *text); void DWIN_SetColorDefaults(); void DWIN_ApplyColor(); -void DWIN_StoreSettings(char *buff); -void DWIN_LoadSettings(const char *buff); +void DWIN_CopySettingsTo(char * const buff); +void DWIN_CopySettingsFrom(const char * const buff); void DWIN_SetDataDefaults(); void DWIN_RebootScreen(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 4ebc2c16c6e4..1e361c8c1133 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -80,7 +80,7 @@ #define HAS_ESDIAG 1 -#if ENABLED(LED_CONTROL_MENU, HAS_COLOR_LEDS) +#if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) #define Def_Leds_Color LEDColorWhite() #endif #if ENABLED(CASELIGHT_USES_BRIGHTNESS) diff --git a/Marlin/src/lcd/e3v2/proui/dwin_popup.h b/Marlin/src/lcd/e3v2/proui/dwin_popup.h index 0d864994754b..b4503ea7866b 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_popup.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.h @@ -50,7 +50,7 @@ inline void Draw_Popup_Bkgd() { template void DWIN_Draw_Popup(const uint8_t icon, T amsg1=nullptr, U amsg2=nullptr, uint8_t button=0) { - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); if (icon) DWINUI::Draw_Icon(icon, 101, 105); if (amsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, amsg1); diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index ddc494fc8492..e190fa06fbfe 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -304,7 +304,7 @@ void DWINUI::Draw_Checkbox(uint16_t color, uint16_t bcolor, uint16_t x, uint16_t } // Clear Menu by filling the menu area with background color -void DWINUI::ClearMenuArea() { +void DWINUI::ClearMainArea() { DWIN_Draw_Rectangle(1, backcolor, 0, TITLE_HEIGHT, DWIN_WIDTH - 1, STATUS_Y - 1); } diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index 1504dcd30598..6771c77d5d81 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -593,7 +593,7 @@ namespace DWINUI { // Clear Menu by filling the area with background color // Area (0, TITLE_HEIGHT, DWIN_WIDTH, STATUS_Y - 1) - void ClearMenuArea(); + void ClearMainArea(); // Clear MenuItems array and free MenuItems elements void MenuItemsClear(); diff --git a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp index 0b450bd4c0f6..19d726037ce9 100644 --- a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp @@ -71,7 +71,7 @@ void draw_es_state(const bool is_hit) { void ESDiagClass::Draw() { Title.ShowCaption(F("End-stops Diagnostic")); - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); DWINUI::Draw_Button(BTN_Continue, 86, 250); DWINUI::cursor.y = 80; diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp index 2895c01544b0..c179856c6acb 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp @@ -50,11 +50,10 @@ void LockScreenClass::init() { } void LockScreenClass::draw() { - Title.SetCaption(PSTR("Lock Screen")); - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); DWINUI::Draw_Icon(ICON_LOGO, 71, 120); // CREALITY logo - DWINUI::Draw_CenteredString(Color_White, 180, F("Printer is Locked,")); - DWINUI::Draw_CenteredString(Color_White, 200, F("Scroll to unlock.")); + DWINUI::Draw_CenteredString(Color_White, 180, GET_TEXT_F(MSG_LOCKSCREEN_LOCKED)); + DWINUI::Draw_CenteredString(Color_White, 200, GET_TEXT_F(MSG_LOCKSCREEN_UNLOCK)); DWINUI::Draw_CenteredString(Color_White, 240, F("-> | <-")); DWIN_Draw_Box(1, HMI_data.Barfill_Color, 0, 260, DWIN_WIDTH, 20); DWIN_Draw_VLine(Color_Yellow, lock_pos * DWIN_WIDTH / 255, 260, 20); diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 0b22ae98d5ef..6121ab35d45f 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -67,7 +67,7 @@ void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8 max = (float)maxz / 100; min = (float)minz / 100; avg = avg / (100 * sizex * sizey); - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); DWIN_Draw_Rectangle(0, HMI_data.SplitLine_Color, px(0), py(0), px(sizex - 1), py(sizey - 1)); LOOP_S_L_N(x, 1, sizex - 1) DrawMeshVLine(x); LOOP_S_L_N(y, 1, sizey - 1) DrawMeshHLine(y); @@ -90,7 +90,7 @@ void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8 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");; + 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]); @@ -107,13 +107,16 @@ void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8 } void MeshViewerClass::Draw(bool withsave /*= false*/) { - Title.ShowCaption(F("Mesh Viewer")); + Title.ShowCaption(GET_TEXT_F(MSG_MESH_VIEWER)); DrawMesh(Z_VALUES_ARR, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y); if (withsave) { DWINUI::Draw_Button(BTN_Save, 26, 305); DWINUI::Draw_Button(BTN_Continue, 146, 305); Draw_Select_Highlight(HMI_flag.select_flag, 305); - } else DWINUI::Draw_Button(BTN_Continue, 86, 305); + } + else + DWINUI::Draw_Button(BTN_Continue, 86, 305); + char str_1[6], str_2[6] = ""; ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"), dtostrf(min, 1, 2, str_1), diff --git a/Marlin/src/lcd/e3v2/proui/printstats.cpp b/Marlin/src/lcd/e3v2/proui/printstats.cpp index d4ca4ca2255f..f33d0d15faa9 100644 --- a/Marlin/src/lcd/e3v2/proui/printstats.cpp +++ b/Marlin/src/lcd/e3v2/proui/printstats.cpp @@ -50,7 +50,7 @@ void PrintStatsClass::Draw() { constexpr int8_t MRG = 30; Title.ShowCaption(GET_TEXT_F(MSG_INFO_STATS_MENU)); - DWINUI::ClearMenuArea(); + DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); DWINUI::Draw_Button(BTN_Continue, 86, 250); printStatistics ps = print_job_timer.getStats(); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 0c4ba8e8dc36..f830fc982163 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -326,8 +326,8 @@ namespace Language_de { LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); LSTR MSG_PID_CYCLE = _UxGT("PID Zyklus"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID Tuning fertig"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune fehlge. Falscher Extruder"); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune fehlge. Temperatur zu hoch."); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune fehlge.! Falscher Extruder"); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune fehlge.! Temperatur zu hoch."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune fehlge.! Timeout."); LSTR MSG_SELECT = _UxGT("Auswählen"); LSTR MSG_SELECT_E = _UxGT("Auswählen *"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index ed152a4dfdd9..761209866e4f 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -54,6 +54,7 @@ namespace Language_en { LSTR MSG_YES = _UxGT("YES"); LSTR MSG_NO = _UxGT("NO"); LSTR MSG_BACK = _UxGT("Back"); + LSTR MSG_ERROR = _UxGT("Error"); LSTR MSG_MEDIA_ABORTING = _UxGT("Aborting..."); LSTR MSG_MEDIA_INSERTED = MEDIA_TYPE_EN _UxGT(" Inserted"); LSTR MSG_MEDIA_REMOVED = MEDIA_TYPE_EN _UxGT(" Removed"); @@ -340,8 +341,11 @@ namespace Language_en { LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); LSTR MSG_PID_CYCLE = _UxGT("PID Cycles"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed. Bad extruder."); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed. Temperature too high."); + LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("PID Autotune failed!"); + LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Bad extruder."); + LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temperature too high."); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed! Bad extruder."); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); LSTR MSG_SELECT = _UxGT("Select"); LSTR MSG_SELECT_E = _UxGT("Select *"); @@ -599,6 +603,9 @@ namespace Language_en { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Light Brightness"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("INCORRECT PRINTER"); + LSTR MSG_LOCKSCREEN = _UxGT("Lock Screen"); + LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Printer is Locked,"); + LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Scroll to unlock."); #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No media inserted."); LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Please wait until reboot. "); @@ -617,7 +624,6 @@ namespace Language_en { LSTR MSG_COLORS_WHITE = _UxGT("White"); LSTR MSG_UI_LANGUAGE = _UxGT("UI Language"); LSTR MSG_SOUND_ENABLE = _UxGT("Enable sound"); - LSTR MSG_LOCKSCREEN = _UxGT("Lock Screen"); #else LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No Media"); LSTR MSG_PLEASE_PREHEAT = _UxGT("Please Preheat"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index cc57545e6564..55dc03ac9d95 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -261,9 +261,9 @@ namespace Language_gl { LSTR MSG_PID_AUTOTUNE = _UxGT("Auto-Sint. PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Auto-Sint. PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Fin Auto-Sint PID"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-Sint. fallida. Extrusor danado."); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-Sint. fallida. Temperatura moi alta."); - LSTR MSG_PID_TIMEOUT = _UxGT("Auto-Sint. fallida. Tempo excedido."); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-Sint. fallida! Extrusor danado."); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-Sint. fallida! Temperatura moi alta."); + LSTR MSG_PID_TIMEOUT = _UxGT("Auto-Sint. fallida! Tempo excedido."); LSTR MSG_SELECT = _UxGT("Escolla"); LSTR MSG_SELECT_E = _UxGT("Escolla *"); LSTR MSG_ACC = _UxGT("Acel"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index a47b687f3a15..6321ed136741 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -309,8 +309,8 @@ namespace Language_hu { LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID hangolás *"); LSTR MSG_PID_CYCLE = _UxGT("PID ciklus"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID hangolás kész"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Hangolási hiba. Rossz adagoló."); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Hangolási hiba. Magas hömérséklet."); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Hangolási hiba! Rossz adagoló."); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Hangolási hiba! Magas hömérséklet."); LSTR MSG_PID_TIMEOUT = _UxGT("Hangolási hiba! Idötúllépés."); LSTR MSG_SELECT = _UxGT("Kiválaszt"); LSTR MSG_SELECT_E = _UxGT("Kiválaszt *"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 79ef5b5f9de1..3e65dde7863d 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -343,8 +343,8 @@ namespace Language_it { LSTR MSG_PID_AUTOTUNE_E = _UxGT("Calib.PID *"); LSTR MSG_PID_CYCLE = _UxGT("Ciclo PID"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Calibr.PID eseguita"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Calibrazione fallita. Estrusore errato."); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita. Temperatura troppo alta."); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Calibrazione fallita! Estrusore errato."); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita! Temperatura troppo alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Calibrazione fallita! Tempo scaduto."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss"); LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Autotune"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index c3fc37bf483d..79421752af01 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -260,8 +260,8 @@ namespace Language_ro { LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed. Bad extruder."); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed. Temperature too high."); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed! Bad extruder."); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); LSTR MSG_SELECT = _UxGT("Select"); LSTR MSG_SELECT_E = _UxGT("Select *"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 4b52c926087b..4b8d4703e453 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -390,8 +390,8 @@ namespace Language_ru { LSTR MSG_PID_AUTOTUNE = _UxGT("Автоподбор PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Автоподбор PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Подбор PID выполнен"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Сбой автоподбора. Плохой экструдер."); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Сбой автоподбора. Температура повышена."); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Сбой автоподбора! Плохой экструдер."); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Сбой автоподбора! Температура повышена."); LSTR MSG_PID_TIMEOUT = _UxGT("Сбой автоподбора! Завершение времени."); LSTR MSG_SELECT = _UxGT("Выбор"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 80cca911e53f..7ba505ede511 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -337,8 +337,8 @@ namespace Language_sk { LSTR MSG_PID_AUTOTUNE_E = _UxGT("Kalibrácia PID *"); LSTR MSG_PID_CYCLE = _UxGT("Cykly PID"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Kal. PID dokončená"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-kal. zlyhala. Zlý extrúder."); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-kal. zlyhala. Príliš vysoká tepl."); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-kal. zlyhala! Zlý extrúder."); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-kal. zlyhala! Príliš vysoká tepl."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-kal. zlyhala! Čas vypršal."); LSTR MSG_SELECT = _UxGT("Vybrať"); LSTR MSG_SELECT_E = _UxGT("Vybrať *"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index c077da1e6925..db2196fa46ae 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -290,8 +290,8 @@ namespace Language_sv { LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autojustera"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autojustera *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autojustera misslyckad. Dålig extruder."); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autojustera misslyckad. Temperatur för hög."); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autojustera misslyckad! Dålig extruder."); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autojustera misslyckad! Temperatur för hög."); LSTR MSG_PID_TIMEOUT = _UxGT("Autojustera misslyckad! Tidsgräns."); LSTR MSG_SELECT = _UxGT("Välj"); LSTR MSG_SELECT_E = _UxGT("Välj *"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 892eb57cf629..bfb74b9f6e9b 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -395,8 +395,8 @@ namespace Language_uk { LSTR MSG_PID_AUTOTUNE = _UxGT("Автопідбір PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Автопідбір PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Підбір PID виконано"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Збій автопідбору. Поганий екструдер."); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Збій автопідбору. Температура завищена."); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Збій автопідбору! Поганий екструдер."); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Збій автопідбору! Температура завищена."); LSTR MSG_PID_TIMEOUT = _UxGT("Збій автопідбору! Вичерпан час."); LSTR MSG_SELECT = _UxGT("Вибрати"); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index e947cee661b1..f2d348b3965b 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -260,8 +260,8 @@ namespace Language_zh_CN { LSTR MSG_PID_AUTOTUNE = _UxGT("自动PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("自动PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID调整完成"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("自动调失败. 坏的挤出机"); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("自动调失败. 温度太高"); + LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("自动调失败! 坏的挤出机"); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("自动调失败! 温度太高"); LSTR MSG_PID_TIMEOUT = _UxGT("自动调失败! 超时"); LSTR MSG_SELECT = _UxGT("选择"); // "Select" LSTR MSG_SELECT_E = _UxGT("选择 *"); diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index bcdff450bd4c..d56bc9b5ff1b 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -163,10 +163,6 @@ void MenuEditItemBase::goto_edit_screen( #include "../../MarlinCore.h" -bool printer_busy() { - return planner.movesplanned() || printingIsActive(); -} - /** * General function to go directly to a screen */ diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index b111236d69cd..288dd5be2fed 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -30,7 +30,6 @@ extern int8_t encoderLine, encoderTopLine, screen_items; void scroll_screen(const uint8_t limit, const bool is_menu); -bool printer_busy(); typedef void (*selectFunc_t)(); diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 184ff8cf8e61..a0c03fafeba2 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -29,6 +29,7 @@ #if HAS_MARLINUI_MENU #include "menu_item.h" +#include "../../MarlinCore.h" #include "../../module/planner.h" #if DISABLED(NO_VOLUMETRICS) diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index a47e2517aedf..f6add52f570c 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -230,7 +230,7 @@ * Mesh Z Offset: --- (Req: MESH_BED_LEVELING) * Z Probe Offset: --- (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET) * Level Bed > - * Level Corners > (if homed) + * Bed Tramming > (if homed) * Load Settings (Req: EEPROM_SETTINGS) * Save Settings (Req: EEPROM_SETTINGS) */ diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index c66df8502441..0f92ef8bd5f7 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -30,6 +30,8 @@ #include "menu_item.h" +#include "../../MarlinCore.h" + #if HAS_FILAMENT_SENSOR #include "../../feature/runout.h" #endif diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 9f432c405c4f..03ac6e512cf8 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -35,6 +35,9 @@ #if HAS_FILAMENT_SENSOR #include "../../feature/runout.h" #endif +#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) + #include "../../MarlinCore.h" +#endif // // Change Filament > Change/Unload/Load Filament diff --git a/Marlin/src/libs/BL24CXX.cpp b/Marlin/src/libs/BL24CXX.cpp index 6407fac67086..5076045e734c 100644 --- a/Marlin/src/libs/BL24CXX.cpp +++ b/Marlin/src/libs/BL24CXX.cpp @@ -54,11 +54,11 @@ #endif // IO ops -#define IIC_SCL_0() WRITE(IIC_EEPROM_SCL, LOW) -#define IIC_SCL_1() WRITE(IIC_EEPROM_SCL, HIGH) -#define IIC_SDA_0() WRITE(IIC_EEPROM_SDA, LOW) -#define IIC_SDA_1() WRITE(IIC_EEPROM_SDA, HIGH) -#define READ_SDA() READ(IIC_EEPROM_SDA) +#define IIC_SCL_0() WRITE(IIC_EEPROM_SCL, LOW) +#define IIC_SCL_1() WRITE(IIC_EEPROM_SCL, HIGH) +#define IIC_SDA_0() WRITE(IIC_EEPROM_SDA, LOW) +#define IIC_SDA_1() WRITE(IIC_EEPROM_SDA, HIGH) +#define READ_SDA() READ(IIC_EEPROM_SDA) // // Simple IIC interface via libmaple diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index bd38da46282b..656d38eb28c2 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1478,7 +1478,7 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(dwin_data); char dwin_data[eeprom_data_size] = { 0 }; - DWIN_StoreSettings(dwin_data); + DWIN_CopySettingsTo(dwin_data); EEPROM_WRITE(dwin_data); } #endif @@ -2426,7 +2426,7 @@ void MarlinSettings::postprocess() { const char dwin_data[eeprom_data_size] = { 0 }; _FIELD_TEST(dwin_data); EEPROM_READ(dwin_data); - if (!validating) DWIN_LoadSettings(dwin_data); + if (!validating) DWIN_CopySettingsFrom(dwin_data); } #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) { @@ -2843,7 +2843,6 @@ void MarlinSettings::reset() { #endif #endif - TERN_(DWIN_LCD_PROUI, DWIN_SetDataDefaults()); TERN_(DWIN_CREALITY_LCD_JYERSUI, CrealityDWIN.Reset_Settings()); // @@ -3214,6 +3213,11 @@ void MarlinSettings::reset() { // TERN_(DGUS_LCD_UI_MKS, MKS_reset_settings()); + // + // Ender-3 V2 with ProUI + // + TERN_(DWIN_LCD_PROUI, DWIN_SetDataDefaults()); + postprocess(); #if EITHER(EEPROM_CHITCHAT, DEBUG_LEVELING_FEATURE) From 7ed339cfa0a2d8298e0293cf465daaf4ac74c0f9 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Thu, 12 May 2022 06:38:05 -0400 Subject: [PATCH 291/502] =?UTF-8?q?=E2=9C=A8=20Creality=20CR-10=20SmartPro?= =?UTF-8?q?=20(#24151)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/core/boards.h | 27 ++-- Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h | 152 ++++++++++++++++++ Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 10 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h | 55 +++---- .../share/PlatformIO/ldscripts/crealityPro.ld | 14 ++ ini/stm32f1-maple.ini | 8 + ini/stm32f1.ini | 5 + 9 files changed, 222 insertions(+), 53 deletions(-) create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h create mode 100644 buildroot/share/PlatformIO/ldscripts/crealityPro.ld diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 14303754820c..ec85970ac411 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -352,19 +352,20 @@ #define BOARD_CREALITY_V431_D 4049 // Creality v4.3.1d (STM32F103RC / STM32F103RE) #define BOARD_CREALITY_V452 4050 // Creality v4.5.2 (STM32F103RC / STM32F103RE) #define BOARD_CREALITY_V453 4051 // Creality v4.5.3 (STM32F103RC / STM32F103RE) -#define BOARD_CREALITY_V24S1 4052 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender 7 -#define BOARD_CREALITY_V24S1_301 4053 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) as found in the Ender 3 S1 -#define BOARD_TRIGORILLA_PRO 4054 // Trigorilla Pro (STM32F103ZE) -#define BOARD_FLY_MINI 4055 // FLYmaker FLY MINI (STM32F103RC) -#define BOARD_FLSUN_HISPEED 4056 // FLSUN HiSpeedV1 (STM32F103VE) -#define BOARD_BEAST 4057 // STM32F103RE Libmaple-based controller -#define BOARD_MINGDA_MPX_ARM_MINI 4058 // STM32F103ZE Mingda MD-16 -#define BOARD_GTM32_PRO_VD 4059 // STM32F103VE controller -#define BOARD_ZONESTAR_ZM3E2 4060 // Zonestar ZM3E2 (STM32F103RC) -#define BOARD_ZONESTAR_ZM3E4 4061 // Zonestar ZM3E4 V1 (STM32F103VC) -#define BOARD_ZONESTAR_ZM3E4V2 4062 // Zonestar ZM3E4 V2 (STM32F103VC) -#define BOARD_ERYONE_ERY32_MINI 4063 // Eryone Ery32 mini (STM32F103VE) -#define BOARD_PANDA_PI_V29 4064 // Panda Pi V2.9 - Standalone (STM32F103RC) +#define BOARD_CREALITY_V24S1 4052 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7 +#define BOARD_CREALITY_V24S1_301 4053 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1 +#define BOARD_CREALITY_V25S1 4054 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro +#define BOARD_TRIGORILLA_PRO 4055 // Trigorilla Pro (STM32F103ZE) +#define BOARD_FLY_MINI 4056 // FLYmaker FLY MINI (STM32F103RC) +#define BOARD_FLSUN_HISPEED 4057 // FLSUN HiSpeedV1 (STM32F103VE) +#define BOARD_BEAST 4058 // STM32F103RE Libmaple-based controller +#define BOARD_MINGDA_MPX_ARM_MINI 4059 // STM32F103ZE Mingda MD-16 +#define BOARD_GTM32_PRO_VD 4060 // STM32F103VE controller +#define BOARD_ZONESTAR_ZM3E2 4061 // Zonestar ZM3E2 (STM32F103RC) +#define BOARD_ZONESTAR_ZM3E4 4062 // Zonestar ZM3E4 V1 (STM32F103VC) +#define BOARD_ZONESTAR_ZM3E4V2 4063 // Zonestar ZM3E4 V2 (STM32F103VC) +#define BOARD_ERYONE_ERY32_MINI 4064 // Eryone Ery32 mini (STM32F103VE) +#define BOARD_PANDA_PI_V29 4065 // Panda Pi V2.9 - Standalone (STM32F103RC) // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 01e5ee41e383..aecf17284ac5 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -583,6 +583,8 @@ #include "stm32f1/pins_CREALITY_V24S1.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V24S1_301) #include "stm32f1/pins_CREALITY_V24S1_301.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple +#elif MB(CREALITY_V25S1) + #include "stm32f1/pins_CREALITY_V25S1.h" // STM32F1 env:STM32F103RE_creality_smartPro env:STM32F103RE_creality_smartPro_maple #elif MB(TRIGORILLA_PRO) #include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro env:trigorilla_pro_maple #elif MB(FLY_MINI) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h index 9d7e0f695b79..0d2ad835d397 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h @@ -22,7 +22,7 @@ #pragma once /** - * Creality v2.4.S1 (STM32F103RE / STM32F103RC) v101 as found in the Ender 7 board pin assignments + * Creality v2.4.S1 (STM32F103RE / STM32F103RC) v101 as found in the Ender 7 */ #define BOARD_INFO_NAME "Creality v2.4.S1 V101" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h new file mode 100644 index 000000000000..0425a45d1d25 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h @@ -0,0 +1,152 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Creality v2.5.S1 (STM32F103RE / STM32F103RC) as found in the CR-10 Smart Pro + */ + +#include "env_validate.h" + +#if HAS_MULTI_HOTEND || E_STEPPERS > 1 + #error "Creality V2.5.S1 only supports one hotend / E-stepper. Comment out this line to continue." +#endif + +#define BOARD_INFO_NAME "Creality v2.5.S1" +#define DEFAULT_MACHINE_NAME "Creality3D" + +// +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + +// +// EEPROM +// +#if NO_EEPROM_SELECTED + #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 + //#define SDCARD_EEPROM_EMULATION + //#define FLASH_EEPROM_EMULATION +#endif + +#if ENABLED(IIC_BL24CXX_EEPROM) + #define IIC_EEPROM_SDA PA11 + #define IIC_EEPROM_SCL PA12 + #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16) +#elif EITHER(SDCARD_EEPROM_EMULATION, FLASH_EEPROM_EMULATION) + #define MARLIN_EEPROM_SIZE 0x800 // 2K +#endif + +// +// Limit Switches +// +#define X_STOP_PIN PC4 +#define Y_STOP_PIN PC5 + +#if ENABLED(BLTOUCH) + #define Z_STOP_PIN -1 + #define SERVO0_PIN PC14 // BLTouch OUT PIN + #ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PC15 // BLTouch IN PIN + #endif +#else + #define Z_STOP_PIN PC15 + #if ENABLED(PROBE_ACTIVATION_SWITCH) + #define PROBE_TARE_PIN PC14 + #define PROBE_ACTIVATION_SWITCH_PIN PB2 + #endif +#endif + +// +// Filament Runout Sensor +// +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define FIL_RUNOUT_PIN PA15 // "Pulled-high" +#endif + +// +// Steppers +// +#define X_STEP_PIN PB8 +#define X_DIR_PIN PB7 +#define X_ENABLE_PIN PC3 + +#define Y_STEP_PIN PB6 +#define Y_DIR_PIN PB5 +#define Y_ENABLE_PIN X_ENABLE_PIN + +#define Z_STEP_PIN PB4 +#define Z_DIR_PIN PB3 +#define Z_ENABLE_PIN X_ENABLE_PIN + +#define E0_STEP_PIN PC2 +#define E0_DIR_PIN PB9 +#define E0_ENABLE_PIN X_ENABLE_PIN + +// +// Temperature Sensors +// +#define TEMP_0_PIN PB1 // TH1 +#define TEMP_BED_PIN PB0 // TB1 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB14 // HEATER1 +#define HEATER_BED_PIN PB13 // HOT BED + +#define FAN_PIN PB15 // FAN +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN PC13 // FAN +#endif +#define FAN_SOFT_PWM_REQUIRED + +// +// SD Card +// +#define SD_DETECT_PIN PC7 +#define SDCARD_CONNECTION ONBOARD +#define ON_BOARD_SPI_DEVICE 1 +#define ONBOARD_SD_CS_PIN PC12 // SDSS +#define SDIO_SUPPORT +#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer + +// +// Misc. Functions +// +#define CASE_LIGHT_PIN PA7 + +// +// Suicide Power +// +#define PS_ON_PIN PA0 +#define MOTOR_CIRCUIT_PIN PA1 + +// +// Motor Protect +// +#define MOTOR_PROTECT_PIN PC0 + +// +// WiFi Reset +// +#define RESET_WIFI_PIN PB12 diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index b2534beab6db..1b95032b367f 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -40,6 +40,11 @@ #define BOARD_NO_NATIVE_USB +// +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + // // EEPROM // @@ -122,11 +127,6 @@ #endif #define E0_ENABLE_PIN X_ENABLE_PIN -// -// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role -// -#define DISABLE_DEBUG - // // Temperature Sensors // diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h index 87101ecccd54..1c9a0a8f997f 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -40,34 +40,24 @@ #define BOARD_NO_NATIVE_USB +// +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// +#define DISABLE_DEBUG + // // EEPROM // #if NO_EEPROM_SELECTED - // FLASH - //#define FLASH_EEPROM_EMULATION - - // I2C - #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 used only for display settings - #if ENABLED(IIC_BL24CXX_EEPROM) - #define IIC_EEPROM_SDA PA11 - #define IIC_EEPROM_SCL PA12 - #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16) - #else - #define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX - #define MARLIN_EEPROM_SIZE 0x800 // 2K - #endif - - // SPI - //#define SPI_EEPROM // EEPROM on SPI-0 - //#define SPI_CHAN_EEPROM1 ? - //#define SPI_EEPROM1_CS_PIN ? - - // 2K EEPROM - //#define SPI_EEPROM2_CS_PIN ? - - // 32Mb FLASH - //#define SPI_FLASH_CS_PIN ? + #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 +#endif +#if ENABLED(IIC_BL24CXX_EEPROM) + #define IIC_EEPROM_SDA PA11 + #define IIC_EEPROM_SCL PA12 + #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16) +#else + #define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX + #define MARLIN_EEPROM_SIZE 0x800 // 2K #endif // @@ -82,7 +72,9 @@ #define Y_STOP_PIN PA7 #define Z_STOP_PIN PA5 -#define Z_MIN_PROBE_PIN PA5 // BLTouch IN +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PA5 // BLTouch IN +#endif // // Filament Runout Sensor @@ -94,42 +86,37 @@ // // Steppers // -#define X_ENABLE_PIN PC3 #ifndef X_STEP_PIN #define X_STEP_PIN PC2 #endif #ifndef X_DIR_PIN #define X_DIR_PIN PB9 #endif +#define X_ENABLE_PIN PC3 -#define Y_ENABLE_PIN PC3 #ifndef Y_STEP_PIN #define Y_STEP_PIN PB8 #endif #ifndef Y_DIR_PIN #define Y_DIR_PIN PB7 #endif +#define Y_ENABLE_PIN X_ENABLE_PIN -#define Z_ENABLE_PIN PC3 #ifndef Z_STEP_PIN #define Z_STEP_PIN PB6 #endif #ifndef Z_DIR_PIN #define Z_DIR_PIN PB5 #endif +#define Z_ENABLE_PIN X_ENABLE_PIN -#define E0_ENABLE_PIN PC3 #ifndef E0_STEP_PIN #define E0_STEP_PIN PB4 #endif #ifndef E0_DIR_PIN #define E0_DIR_PIN PB3 #endif - -// -// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role -// -#define DISABLE_DEBUG +#define E0_ENABLE_PIN X_ENABLE_PIN // // Temperature Sensors diff --git a/buildroot/share/PlatformIO/ldscripts/crealityPro.ld b/buildroot/share/PlatformIO/ldscripts/crealityPro.ld new file mode 100644 index 000000000000..442c5c75078f --- /dev/null +++ b/buildroot/share/PlatformIO/ldscripts/crealityPro.ld @@ -0,0 +1,14 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - 40 + rom (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K +} + +/* Provide memory region aliases for common.inc */ +REGION_ALIAS("REGION_TEXT", rom); +REGION_ALIAS("REGION_DATA", ram); +REGION_ALIAS("REGION_BSS", ram); +REGION_ALIAS("REGION_RODATA", rom); + +/* Let common.inc handle the real work. */ +INCLUDE common.inc \ No newline at end of file diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index 9ea848f1b6b1..f0a0f9375850 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -147,6 +147,14 @@ extra_scripts = ${common_stm32f1.extra_scripts} debug_tool = jlink upload_protocol = jlink +# +# Creality (STM32F103RET6) +# +[env:STM32F103RE_creality_smartPro_maple] +extends = env:STM32F103RE_creality_maple +board_build.address = 0x08010000 +board_build.ldscript = crealityPro.ld + # # BigTree SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3) # diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 9002f81a8143..464048adcb1a 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -153,6 +153,11 @@ board = genericSTM32F103RE extends = STM32F103Rx_creality_xfer board = genericSTM32F103RE +[env:STM32F103RE_creality_smartPro] +extends = STM32F103Rx_creality +board_build.offset = 0x10000 +board_upload.offset_address = 0x08010000 + # # Creality 256K (STM32F103RC) # From a7d40ec654a3eca783a19e93e7bb6f394f2e6d29 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 May 2022 20:09:25 -0500 Subject: [PATCH 292/502] =?UTF-8?q?=E2=9C=A8=20Add=20BOARD=5FCREALITY=5FV2?= =?UTF-8?q?4S1=5F301F4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Miguel Risco-Castillo --- .github/workflows/test-builds.yml | 1 + Marlin/src/core/boards.h | 1 + Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/libs/BL24CXX.cpp | 2 +- Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f1/env_validate.h | 8 +- .../pins/stm32f1/pins_CREALITY_V24S1_301.h | 22 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 4 +- .../pins/stm32f4/pins_CREALITY_V24S1_301F4.h | 38 ++ .../boards/marlin_CREALITY_STM32F401RC.json | 65 +++ .../PeripheralPins.c | 252 +++++++++ .../MARLIN_CREALITY_STM32F401RC/PinNamesVar.h | 33 ++ .../hal_conf_custom.h | 495 ++++++++++++++++++ .../MARLIN_CREALITY_STM32F401RC/ldscript.ld | 187 +++++++ .../MARLIN_CREALITY_STM32F401RC/variant.cpp | 238 +++++++++ .../MARLIN_CREALITY_STM32F401RC/variant.h | 151 ++++++ buildroot/tests/STM32F103RE_creality | 6 - buildroot/tests/STM32F401RC_creality | 20 + ini/stm32f4.ini | 29 +- 19 files changed, 1537 insertions(+), 19 deletions(-) create mode 100644 Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h create mode 100644 buildroot/share/PlatformIO/boards/marlin_CREALITY_STM32F401RC.json create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PeripheralPins.c create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PinNamesVar.h create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/ldscript.ld create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.cpp create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.h create mode 100755 buildroot/tests/STM32F401RC_creality diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 069f36714d93..e339f856462e 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -76,6 +76,7 @@ jobs: - STM32F103RE_btt - STM32F103RE_btt_USB - STM32F103RE_creality + - STM32F401RC_creality - STM32F103VE_longer - STM32F407VE_black - STM32F401VE_STEVAL diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index ec85970ac411..653bbf1e173e 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -418,6 +418,7 @@ #define BOARD_MKS_EAGLE 4237 // MKS Eagle (STM32F407VE) #define BOARD_ARTILLERY_RUBY 4238 // Artillery Ruby (STM32F401RC) #define BOARD_FYSETC_SPIDER_V2_2 4239 // FYSETC Spider V2.2 (STM32F446VE) +#define BOARD_CREALITY_V24S1_301F4 4240 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4 // // ARM Cortex M7 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 621b33fdb747..b818c16f9493 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -488,7 +488,7 @@ #ifndef LCD_SERIAL_PORT #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO) #define LCD_SERIAL_PORT 1 - #elif MB(CREALITY_V24S1_301) + #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4) #define LCD_SERIAL_PORT 2 // Creality Ender3S1 board #else #define LCD_SERIAL_PORT 3 // Creality 4.x board diff --git a/Marlin/src/libs/BL24CXX.cpp b/Marlin/src/libs/BL24CXX.cpp index 5076045e734c..4b5a23e4c550 100644 --- a/Marlin/src/libs/BL24CXX.cpp +++ b/Marlin/src/libs/BL24CXX.cpp @@ -48,7 +48,7 @@ #ifdef __STM32F1__ #define SDA_IN() do{ PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH &= 0XFFFF0FFF; PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH |= 8 << 12; }while(0) #define SDA_OUT() do{ PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH &= 0XFFFF0FFF; PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH |= 3 << 12; }while(0) -#elif STM32F1 +#elif defined(STM32F1) || defined(STM32F4) #define SDA_IN() SET_INPUT(IIC_EEPROM_SDA) #define SDA_OUT() SET_OUTPUT(IIC_EEPROM_SDA) #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index aecf17284ac5..5db9f71d10c0 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -695,6 +695,8 @@ #include "stm32f4/pins_MKS_EAGLE.h" // STM32F4 env:mks_eagle #elif MB(ARTILLERY_RUBY) #include "stm32f4/pins_ARTILLERY_RUBY.h" // STM32F4 env:Artillery_Ruby +#elif MB(CREALITY_V24S1_301F4) + #include "stm32f4/pins_CREALITY_V24S1_301F4.h" // STM32F4 env:STM32F401RC_creality env:STM32F401RC_creality_jlink env:STM32F401RC_creality_stlink // // ARM Cortex M7 diff --git a/Marlin/src/pins/stm32f1/env_validate.h b/Marlin/src/pins/stm32f1/env_validate.h index 2e7b78517215..2d325428ac8c 100644 --- a/Marlin/src/pins/stm32f1/env_validate.h +++ b/Marlin/src/pins/stm32f1/env_validate.h @@ -22,5 +22,11 @@ #pragma once #if NOT_TARGET(__STM32F1__, STM32F1) - #error "Oops! Select an STM32F1 board in 'Tools > Board.'" + #if DISABLED(ALLOW_STM32F4) + #error "Oops! Select an STM32F1 board in 'Tools > Board.'" + #elif NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" + #endif #endif + +#undef ALLOW_STM32F4 diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h index fb7198e57c21..66ee8af61b6a 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h @@ -22,7 +22,8 @@ #pragma once /** - * Creality V24S1_301 (STM32F103RE / STM32F103RC) board pin assignments as found on Ender 3 S1 + * Creality V24S1_301 (STM32F103RE / STM32F103RC) board pin assignments as found on Ender 3 S1. + * Also supports the STM32F4 version of the board with identical pin mapping. */ #include "env_validate.h" @@ -35,8 +36,12 @@ #error "Disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN when using BLTOUCH with Creality V24S1-301." #endif -#define BOARD_INFO_NAME "Creality V24S1-301" -#define DEFAULT_MACHINE_NAME "Ender 3 S1" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Creality V24S1-301" +#endif +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME "Ender 3 S1" +#endif // // Servos @@ -70,8 +75,8 @@ // // SD Card // -#define ONBOARD_SPI_DEVICE 1 -#define ONBOARD_SD_CS_PIN PA4 // SDSS +#define ONBOARD_SPI_DEVICE 1 +#define ONBOARD_SD_CS_PIN PA4 // SDSS // // M3/M4/M5 - Spindle/Laser Control @@ -80,9 +85,10 @@ //#define HEATER_0_PIN -1 //#define HEATER_BED_PIN -1 #define FAN_PIN -1 - #define SPINDLE_LASER_ENA_PIN PA0 // FET 1 - #define SPINDLE_LASER_PWM_PIN PA0 // Bed FET - #define SPINDLE_DIR_PIN PA0 // FET 4 + #define SPINDLE_LASER_ENA_PIN PC0 // FET 1 + #define SPINDLE_LASER_PWM_PIN PC0 // Bed FET + #define SPINDLE_DIR_PIN PC0 // FET 4 + #define LASER_SOFT_PWM_PIN PC0 #endif #include "pins_CREALITY_V4.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index 1b95032b367f..5552d19ab926 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -43,7 +43,9 @@ // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // -#define DISABLE_DEBUG +#ifndef DISABLE_DEBUG + #define DISABLE_DEBUG +#endif // // EEPROM diff --git a/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h b/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h new file mode 100644 index 000000000000..883640d5772e --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h @@ -0,0 +1,38 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Creality V24S1_301F4 (STM32F401RC) board pin assignments as found on Ender 3 S1. + */ + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Creality V24S1-301F4" +#endif +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME "Ender-3 S1 F4" +#endif + +#define DISABLE_DEBUG false // DISABLE_(DEBUG|JTAG) is not supported for STM32F4. +#define ALLOW_STM32F4 + +#include "../stm32f1/pins_CREALITY_V24S1_301.h" diff --git a/buildroot/share/PlatformIO/boards/marlin_CREALITY_STM32F401RC.json b/buildroot/share/PlatformIO/boards/marlin_CREALITY_STM32F401RC.json new file mode 100644 index 000000000000..82f49fa815d6 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/marlin_CREALITY_STM32F401RC.json @@ -0,0 +1,65 @@ +{ + "build": { + "core": "stm32", + "cpu": "cortex-m4", + "extra_flags": "-DSTM32F401xx", + "f_cpu": "84000000L", + "hwids": [ + [ + "0x1EAF", + "0x0003" + ], + [ + "0x0483", + "0x3748" + ] + ], + "ldscript": "ldscript.ld", + "mcu": "stm32f401rct6", + "variant": "MARLIN_CREALITY_STM32F401RC" + }, + "debug": { + "jlink_device": "STM32F401RC", + "openocd_target": "stm32f4x", + "svd_path": "STM32F40x.svd", + "tools": { + "stlink": { + "server": { + "arguments": [ + "-f", + "scripts/interface/stlink.cfg", + "-c", + "transport select hla_swd", + "-f", + "scripts/target/stm32f4x.cfg", + "-c", + "reset_config none" + ], + "executable": "bin/openocd", + "package": "tool-openocd" + } + } + } + }, + "frameworks": [ + "arduino", + "stm32cube" + ], + "name": "STM32F401RC (64k RAM. 256k Flash)", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 65536, + "maximum_size": 262144, + "protocol": "stlink", + "protocols": [ + "stlink", + "dfu", + "jlink" + ], + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f401rc.html", + "vendor": "Generic" +} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PeripheralPins.c new file mode 100644 index 000000000000..418ef5aa7abc --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PeripheralPins.c @@ -0,0 +1,252 @@ +/* + ******************************************************************************* + * Copyright (c) 2019, STMicroelectronics + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************* + * Automatically generated from STM32F401R[(B-C)|(D-E)]Tx.xml + */ +#include "Arduino.h" +#include "PeripheralPins.h" + +/* ===== + * Note: Commented lines are alternative possibilities which are not used per default. + * If you change them, you will have to know what you do + * ===== + */ + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +WEAK const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 + {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 + {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 + {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 + {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 + {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 + {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 + {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 + {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 + {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 + {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 + {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 + {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 + {NC, NP, 0} +}; +#endif + +//*** No DAC *** + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SDA[] = { + {PB_3, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF9_I2C2)}, + {PB_4, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF9_I2C3)}, + {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_I2C_SCL[] = { + {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +WEAK const PinMap PinMap_PWM[] = { + //{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 + //{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + {PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + //{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 + //{PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 + //{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 + //{PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 + {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + //{PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + //{PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + //{PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + //{PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + //{PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 + {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_TX[] = { + {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PA_11, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_UART_RX[] = { + {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PA_12, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_UART_RTS[] = { + {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_UART_CTS[] = { + {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + //{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + //{PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + //{PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {NC, NP, 0} +}; + +WEAK const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + //{PA_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + //{PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {NC, NP, 0} +}; +#endif + +//*** No CAN *** + +//*** No ETHERNET *** + +//*** No QUADSPI *** + +//*** USB *** + +#ifdef HAL_PCD_MODULE_ENABLED +WEAK const PinMap PinMap_USB_OTG_FS[] = { +#ifndef ARDUINO_CoreBoard_F401RC + {PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF + {PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS + {PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID +#endif + {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM + {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP + {NC, NP, 0} +}; +#endif + +//*** No USB_OTG_HS *** + +//*** SD *** + +#ifdef HAL_SD_MODULE_ENABLED +WEAK const PinMap PinMap_SD[] = { + {PB_8, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D4 + {PB_9, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D5 + {PC_6, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D6 + {PC_7, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D7 + {PC_8, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D0 + {PC_9, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D1 + {PC_10, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D2 + {PC_11, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D3 + {PC_12, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CK + {PD_2, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CMD + {NC, NP, 0} +}; +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PinNamesVar.h new file mode 100644 index 000000000000..e1536bcf30f4 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PinNamesVar.h @@ -0,0 +1,33 @@ +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 + SYS_WKUP1 = PA_0, +#endif +#ifdef PWR_WAKEUP_PIN2 + SYS_WKUP2 = NC, +#endif +#ifdef PWR_WAKEUP_PIN3 + SYS_WKUP3 = NC, +#endif +#ifdef PWR_WAKEUP_PIN4 + SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 + SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 + SYS_WKUP6 = NC, +#endif +#ifdef PWR_WAKEUP_PIN7 + SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 + SYS_WKUP8 = NC, +#endif +/* USB */ +#ifdef USBCON + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, +#endif \ No newline at end of file diff --git a/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h new file mode 100644 index 000000000000..1dd047bb9005 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h @@ -0,0 +1,495 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf.h + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_CUSTOM +#define __STM32F4xx_HAL_CONF_CUSTOM + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ + /** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028) + +//#define HAL_CAN_MODULE_ENABLED +//#define HAL_CAN_LEGACY_MODULE_ENABLED +//#define HAL_CEC_MODULE_ENABLED +//#define HAL_CRYP_MODULE_ENABLED +//#define HAL_DAC_MODULE_ENABLED +//#define HAL_DCMI_MODULE_ENABLED +//#define HAL_DMA2D_MODULE_ENABLED +//#define HAL_ETH_MODULE_ENABLED +//#define HAL_NAND_MODULE_ENABLED +//#define HAL_NOR_MODULE_ENABLED +//#define HAL_PCCARD_MODULE_ENABLED +//#define HAL_SRAM_MODULE_ENABLED +//#define HAL_SDRAM_MODULE_ENABLED +//#define HAL_HASH_MODULE_ENABLED +//#define HAL_EXTI_MODULE_ENABLED +//#define HAL_SMBUS_MODULE_ENABLED +//#define HAL_I2S_MODULE_ENABLED +//#define HAL_LTDC_MODULE_ENABLED +//#define HAL_DSI_MODULE_ENABLED +//#define HAL_QSPI_MODULE_ENABLED +//#define HAL_RNG_MODULE_ENABLED +//#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +//#define HAL_UART_MODULE_ENABLED +//#define HAL_USART_MODULE_ENABLED +//#define HAL_IRDA_MODULE_ENABLED +//#define HAL_SMARTCARD_MODULE_ENABLED +//#define HAL_WWDG_MODULE_ENABLED +//#define HAL_HCD_MODULE_ENABLED +//#define HAL_FMPI2C_MODULE_ENABLED +//#define HAL_SPDIFRX_MODULE_ENABLED +//#define HAL_DFSDM_MODULE_ENABLED +//#define HAL_LPTIM_MODULE_ENABLED +//#define HAL_MMC_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#ifndef HSE_VALUE +#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#ifndef HSE_STARTUP_TIMEOUT +#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#ifndef HSI_VALUE +#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#ifndef LSI_VALUE +#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz +The real value may vary depending on the variations +in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#ifndef LSE_VALUE +#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#ifndef LSE_STARTUP_TIMEOUT +#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#ifndef EXTERNAL_CLOCK_VALUE +#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#if !defined (VDD_VALUE) +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#endif +#if !defined (TICK_INT_PRIORITY) +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ +#endif +#if !defined (USE_RTOS) +#define USE_RTOS 0U +#endif +#if !defined (PREFETCH_ENABLE) +#define PREFETCH_ENABLE 1U +#endif +#if !defined (INSTRUCTION_CACHE_ENABLE) +#define INSTRUCTION_CACHE_ENABLE 1U +#endif +#if !defined (DATA_CACHE_ENABLE) +#define DATA_CACHE_ENABLE 1U +#endif + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ +#ifndef USE_SPI_CRC +#define USE_SPI_CRC 0U +#endif + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED +#include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED +#include "stm32f4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED +#include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED +#include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED +#include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED +#include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED +#include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED +#include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED +#include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED +#include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED +#include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED +#include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED +#include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED +#include "stm32f4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED +#include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED +#include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED +#include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED +#include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED +#include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED +#include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED +#include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED +#include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED +#include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED +#include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED +#include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED +#include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED +#include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED +#include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t *file, uint32_t line); +#else +#define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_CUSTOM_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/ldscript.ld new file mode 100644 index 000000000000..004714cd6dc0 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/ldscript.ld @@ -0,0 +1,187 @@ +/* +***************************************************************************** +** + +** File : LinkerScript.ld +** +** Abstract : Linker script for STM32F401RETx Device with +** 512KByte FLASH, 96KByte RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** +** Distribution: The file is distributed as is, without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2014 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20010000; /* end of RAM */ + +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200;; /* required amount of heap */ +_Min_Stack_Size = 0x400;; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text ALIGN(4): + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} \ No newline at end of file diff --git a/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.cpp new file mode 100644 index 000000000000..71f3509ed57b --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.cpp @@ -0,0 +1,238 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "pins_arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Digital PinName array +const PinName digitalPin[] = { + PA_0, // Digital pin 0 + PA_1, // Digital pin 1 + PA_2, // Digital pin 2 + PA_3, // Digital pin 3 + PA_4, // Digital pin 4 + PA_5, // Digital pin 5 + PA_6, // Digital pin 6 + PA_7, // Digital pin 7 + PA_8, // Digital pin 8 + PA_9, // Digital pin 9 + PA_10, // Digital pin 10 + PA_11, // Digital pin 11 + PA_12, // Digital pin 12 + PA_13, // Digital pin 13 + PA_14, // Digital pin 14 + PA_15, // Digital pin 15 + + PB_0, // Digital pin 16 + PB_1, // Digital pin 17 + PB_2, // Digital pin 18 + PB_3, // Digital pin 19 + PB_4, // Digital pin 20 + PB_5, // Digital pin 21 + PB_6, // Digital pin 22 + PB_7, // Digital pin 23 + PB_8, // Digital pin 24 + PB_9, // Digital pin 25 + PB_10, // Digital pin 26 + PB_12, // Digital pin 27 + PB_13, // Digital pin 28 + PB_14, // Digital pin 29 + PB_15, // Digital pin 30 + + PC_0, // Digital pin 31 + PC_1, // Digital pin 32 + PC_2, // Digital pin 33 + PC_3, // Digital pin 34 + PC_4, // Digital pin 35 + PC_5, // Digital pin 36 + PC_6, // Digital pin 37 + PC_7, // Digital pin 38 + PC_8, // Digital pin 39 + PC_9, // Digital pin 40 + PC_10, // Digital pin 41 + PC_11, // Digital pin 42 + PC_12, // Digital pin 43 + PC_13, // Digital pin 44 + PC_14, // Digital pin 45 + PC_15, // Digital pin 46 + + PD_2, // Digital pin 47 + + PH_0, // Digital pin 48, used by the external oscillator + PH_1 // Digital pin 49, used by the external oscillator +}; + +// Analog (Ax) pin number array +const uint32_t analogInputPin[] = { + 0, // A0, PA0 + 1, // A1, PA1 + 2, // A2, PA2 + 3, // A3, PA3 + 4, // A4, PA4 + 5, // A5, PA5 + 6, // A6, PA6 + 7, // A7, PA7 + 16, // A8, PB0 + 17, // A9, PB1 + 31, // A10, PC0 + 32, // A11, PC1 + 33, // A12, PC2 + 34, // A13, PC3 + 35, // A14, PC4 + 36 // A15, PC5 +}; + +#ifdef __cplusplus +} +#endif + +// ---------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * @brief Configures the System clock source, PLL Multiplier and Divider factors, + * AHB/APBx prescalers and Flash settings + * @note This function should be called only once the RCC clock configuration + * is reset to the default reset state (done in SystemInit() function). + * @param None + * @retval None + */ + +/******************************************************************************/ +/* PLL (clocked by HSE) used as System clock source */ +/******************************************************************************/ +static uint8_t SetSysClock_PLL_HSE(uint8_t bypass) +{ + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct; + + /* 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_RCC_PWR_CLK_ENABLE(); + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); + + // Enable HSE oscillator and activate PLL with HSE as source + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + if (bypass == 0) { + RCC_OscInitStruct.HSEState = RCC_HSE_ON; // External 8 MHz xtal on OSC_IN/OSC_OUT + } else { + RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; // External 8 MHz clock on OSC_IN + } + + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE / 1000000L; // Expects an 8 MHz external clock by default. Redefine HSE_VALUE if not + RCC_OscInitStruct.PLL.PLLN = 336; // VCO output clock = 336 MHz (1 MHz * 336) + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; // PLLCLK = 84 MHz (336 MHz / 4) + RCC_OscInitStruct.PLL.PLLQ = 7; // USB clock = 48 MHz (336 MHz / 7) --> OK for USB + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + return 0; // FAIL + } + + // 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; // 84 MHz + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; // 84 MHz + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; // 42 MHz + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; // 84 MHz + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { + return 0; // FAIL + } + + /* Output clock on MCO1 pin(PA8) for debugging purpose */ + /* + if (bypass == 0) + HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_2); // 4 MHz + else + HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1); // 8 MHz + */ + + return 1; // OK +} + +/******************************************************************************/ +/* PLL (clocked by HSI) used as System clock source */ +/******************************************************************************/ +uint8_t SetSysClock_PLL_HSI(void) +{ + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct; + + /* 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_RCC_PWR_CLK_ENABLE(); + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); + + // Enable HSI oscillator and activate PLL with HSI as source + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.HSEState = RCC_HSE_OFF; + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; + RCC_OscInitStruct.PLL.PLLM = 16; // VCO input clock = 1 MHz (16 MHz / 16) + RCC_OscInitStruct.PLL.PLLN = 336; // VCO output clock = 336 MHz (1 MHz * 336) + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; // PLLCLK = 84 MHz (336 MHz / 4) + RCC_OscInitStruct.PLL.PLLQ = 7; // USB clock = 48 MHz (336 MHz / 7) --> freq is ok but not precise enough + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + return 0; // FAIL + } + + /* 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; // 84 MHz + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; // 84 MHz + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; // 42 MHz + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; // 84 MHz + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { + return 0; // FAIL + } + + /* Output clock on MCO1 pin(PA8) for debugging purpose */ + //HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI, RCC_MCODIV_1); // 16 MHz + + return 1; // OK +} + +WEAK void SystemClock_Config(void) +{ + /* 1- If fail try to start with HSE and external xtal */ + if (SetSysClock_PLL_HSE(0) == 0) { + /* 2- Try to start with HSE and external clock */ + if (SetSysClock_PLL_HSE(1) == 0) { + /* 3- If fail start with HSI clock */ + if (SetSysClock_PLL_HSI() == 0) { + Error_Handler(); + } + } + } + /* Output clock on MCO2 pin(PC9) for debugging purpose */ + //HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_SYSCLK, RCC_MCODIV_4); +} + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.h new file mode 100644 index 000000000000..b5a4e5ef80c2 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.h @@ -0,0 +1,151 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_ARDUINO_STM32_ +#define _VARIANT_ARDUINO_STM32_ + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + + +// | DIGITAL | ANALOG | USART | TWI | SPI | SPECIAL | +// |---------|--------|-----------|----------|------------------------|-----------| +#define PA0 0 // | 0 | A0 | | | | | +#define PA1 1 // | 1 | A1 | | | | | +#define PA2 2 // | 2 | A2 | USART2_TX | | | | +#define PA3 3 // | 3 | A3 | USART2_RX | | | | +#define PA4 4 // | 4 | A4 | | | SPI1_SS, (SPI3_SS) | | +#define PA5 5 // | 5 | A5 | | | SPI1_SCK | | +#define PA6 6 // | 6 | A6 | | | SPI1_MISO | | +#define PA7 7 // | 7 | A7 | | | SPI1_MOSI | | +#define PA8 8 // | 8 | | | TWI3_SCL | | | +#define PA9 9 // | 9 | | USART1_TX | | | | +#define PA10 10 // | 10 | | USART1_RX | | | | +#define PA11 11 // | 11 | | USART6_TX | | | | +#define PA12 12 // | 12 | | USART6_RX | | | | +#define PA13 13 // | 13 | | | | | SWD_SWDIO | +#define PA14 14 // | 14 | | | | | SWD_SWCLK | +#define PA15 15 // | 15 | | | | SPI3_SS, (SPI1_SS) | | +// |---------|--------|-----------|----------|------------------------|-----------| +#define PB0 16 // | 16 | A8 | | | | | +#define PB1 17 // | 17 | A9 | | | | | +#define PB2 18 // | 18 | | | | | BOOT1 | +#define PB3 19 // | 19 | | | TWI2_SDA | SPI3_SCK, (SPI1_SCK) | | +#define PB4 20 // | 20 | | | TWI3_SDA | SPI3_MISO, (SPI1_MISO) | | +#define PB5 21 // | 21 | | | | SPI3_MOSI, (SPI1_MOSI) | | +#define PB6 22 // | 22 | | USART1_TX | TWI1_SCL | | | +#define PB7 23 // | 23 | | USART1_RX | TWI1_SDA | | | +#define PB8 24 // | 24 | | | TWI1_SCL | | | +#define PB9 25 // | 25 | | | TWI1_SDA | SPI2_SS | | +#define PB10 26 // | 26 | | | TWI2_SCL | SPI2_SCK | | +#define PB12 27 // | 27 | | | | SPI2_SS | | +#define PB13 28 // | 28 | | | | SPI2_SCK | | +#define PB14 29 // | 29 | | | | SPI2_MISO | | +#define PB15 30 // | 30 | | | | SPI2_MOSI | | +// |---------|--------|-----------|----------|------------------------|-----------| +#define PC0 31 // | 31 | A10 | | | | | +#define PC1 32 // | 32 | A11 | | | | | +#define PC2 33 // | 33 | A12 | | | SPI2_MISO | | +#define PC3 34 // | 34 | A13 | | | SPI2_MOSI | | +#define PC4 35 // | 35 | A14 | | | | | +#define PC5 36 // | 36 | A15 | | | | | +#define PC6 37 // | 37 | | USART6_TX | | | | +#define PC7 38 // | 38 | | USART6_RX | | | | +#define PC8 39 // | 39 | | | | | | +#define PC9 40 // | 40 | | | TWI3_SDA | | | +#define PC10 41 // | 41 | | | | SPI3_SCK | | +#define PC11 42 // | 42 | | | | SPI3_MISO | | +#define PC12 43 // | 43 | | | | SPI3_MOSI | | +#define PC13 44 // | 44 | | | | | | +#define PC14 45 // | 45 | | | | | OSC32_IN | +#define PC15 46 // | 46 | | | | | OSC32_OUT | +// |---------|--------|-----------|----------|------------------------|-----------| +#define PD2 47 // | 47 | | | | | | +// |---------|--------|-----------|----------|------------------------|-----------| +#define PH0 48 // | 48 | | | | | OSC_IN | +#define PH1 49 // | 49 | | | | | OSC_OUT | +// |---------|--------|-----------|----------|------------------------|-----------| + +// This must be a literal +#define NUM_DIGITAL_PINS 50 +#define NUM_ANALOG_INPUTS 16 + +// SPI definitions +#define PIN_SPI_SS PA4 +#define PIN_SPI_SS1 PA4 +#define PIN_SPI_MOSI PA7 +#define PIN_SPI_MISO PA6 +#define PIN_SPI_SCK PA5 + + +// Timer Definitions +#define TIMER_TONE TIM2 +#define TIMER_SERVO TIM5 +#define TIMER_SERIAL TIM11 + +// UART Definitions +//#define ENABLE_HWSERIAL1 done automatically by the #define SERIAL_UART_INSTANCE below +#define ENABLE_HWSERIAL2 + + +// Define here Serial instance number to map on Serial generic name (if not already used by SerialUSB) +#define SERIAL_UART_INSTANCE 1 //1 for Serial = Serial1 (USART1) + +// Default pin used for 'Serial' instance +// Mandatory for Firmata +#define PIN_SERIAL_RX PA10 +#define PIN_SERIAL_TX PA9 + +// Used when user instanciate a hardware Serial using its peripheral name. +// Example: HardwareSerial mySerial(USART3); +// will use PIN_SERIAL3_RX and PIN_SERIAL3_TX if defined. +#define PIN_SERIAL1_RX PA10 +#define PIN_SERIAL1_TX PA9 +#define PIN_SERIAL2_RX PA3 +#define PIN_SERIAL2_TX PA2 + +#ifdef __cplusplus +} // extern "C" +#endif +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + // These serial port names are intended to allow libraries and architecture-neutral + // sketches to automatically default to the correct port name for a particular type + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, + // the first hardware serial port whose RX/TX pins are not dedicated to another use. + // + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor + // + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial + // + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library + // + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. + // + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX + // pins are NOT connected to anything by default. + #define SERIAL_PORT_MONITOR Serial + #define SERIAL_PORT_HARDWARE Serial1 + #define SERIAL_PORT_HARDWARE_OPEN Serial2 +#endif + +#endif /* _VARIANT_ARDUINO_STM32_ */ \ No newline at end of file diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index 6440c5679224..a5d2899dd565 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -13,12 +13,6 @@ use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_enable MARLIN_DEV_MODE BUFFER_MONITORING BLTOUCH AUTO_BED_LEVELING_BILINEAR Z_SAFE_HOMING exec_test $1 $2 "Ender 3 v2 with CrealityUI" "$3" -use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" -opt_disable DWIN_CREALITY_LCD -opt_enable BLTOUCH AUTO_BED_LEVELING_UBL Z_SAFE_HOMING INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING BAUD_RATE_GCODE \ - DWIN_LCD_PROUI SOUND_MENU_ITEM PRINTCOUNTER -exec_test $1 $2 "Ender 3 v2 with ProUI" "$3" - use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_disable DWIN_CREALITY_LCD opt_enable DWIN_CREALITY_LCD_JYERSUI AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY diff --git a/buildroot/tests/STM32F401RC_creality b/buildroot/tests/STM32F401RC_creality new file mode 100755 index 000000000000..c7cd464df066 --- /dev/null +++ b/buildroot/tests/STM32F401RC_creality @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F401RC_creality +# + +# exit on first failure +set -e + +use_example_configs "Creality/Ender-3 S1" +opt_disable DWIN_CREALITY_LCD Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN AUTO_BED_LEVELING_BILINEAR CONFIGURATION_EMBEDDING CANCEL_OBJECTS FWRETRACT +opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING \ + SOUND_MENU_ITEM PRINTCOUNTER NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_SENSOR \ + BLTOUCH Z_SAFE_HOMING AUTO_BED_LEVELING_UBL MESH_EDIT_MENU \ + LIMITED_MAX_FR_EDITING LIMITED_MAX_ACCEL_EDITING LIMITED_JERK_EDITING BAUD_RATE_GCODE +opt_set MOTHERBOARD BOARD_CREALITY_V24S1_301F4 \ + PREHEAT_3_LABEL '"CUSTOM"' PREHEAT_3_TEMP_HOTEND 240 PREHEAT_3_TEMP_BED 60 PREHEAT_3_FAN_SPEED 128 +exec_test $1 $2 "Ender-3 S1 with ProUI" "$3" + +# clean up +restore_configs diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 437dbdcd9be1..260593f8a295 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -588,4 +588,31 @@ build_flags = ${common_stm32.build_flags} -DUSB_PRODUCT=\"Artillery_3D_Printer\" -DFLASH_DATA_SECTOR=1U -DFLASH_BASE_ADDRESS=0x08004000 extra_scripts = ${common_stm32.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py + +# +# Ender-3 S1 STM32F401RC_creality +# +[env:STM32F401RC_creality] +extends = stm32_variant +board = genericSTM32F401RC +board_build.variant = MARLIN_CREALITY_STM32F401RC +board_build.offset = 0x10000 +board_upload.offset_address = 0x08010000 +build_flags = ${stm32_variant.build_flags} -DMCU_STM32F401RC -DSTM32F4 + -DSS_TIMER=4 -DTIMER_SERVO=TIM5 + -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC +extra_scripts = ${stm32_variant.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/random-bin.py +monitor_speed = 115200 + +[env:STM32F401RC_creality_jlink] +extends = env:STM32F401RC_creality +debug_tool = jlink +upload_protocol = jlink + +[env:STM32F401RC_creality_stlink] +extends = env:STM32F401RC_creality +debug_tool = stlink +upload_protocol = stlink From 7d37ae2b2b1ea6613dbc8be0ec5fa30dbd6a87de Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 13 May 2022 16:07:27 +1200 Subject: [PATCH 293/502] =?UTF-8?q?=F0=9F=94=A7=20AVR/DUE=20Serial=20Port?= =?UTF-8?q?=20pin=20conflict=20checks=20(#24148)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/HAL/AVR/inc/SanityCheck.h | 24 +++++++++++++++++++++++ Marlin/src/HAL/DUE/inc/SanityCheck.h | 24 +++++++++++++++++++++++ Marlin/src/pins/mega/pins_GT2560_V3_MC2.h | 8 ++++---- Marlin/src/pins/pins_postprocess.h | 18 +++++++++++++++++ buildroot/tests/FYSETC_F6 | 2 +- 5 files changed, 71 insertions(+), 5 deletions(-) diff --git a/Marlin/src/HAL/AVR/inc/SanityCheck.h b/Marlin/src/HAL/AVR/inc/SanityCheck.h index 15a5be4cd257..7936de8b9903 100644 --- a/Marlin/src/HAL/AVR/inc/SanityCheck.h +++ b/Marlin/src/HAL/AVR/inc/SanityCheck.h @@ -25,6 +25,30 @@ * Test AVR-specific configuration values for errors at compile-time. */ +/** + * Check for common serial pin conflicts + */ +#define CHECK_SERIAL_PIN(N) ( \ + X_STOP_PIN == N || Y_STOP_PIN == N || Z_STOP_PIN == N \ + || X_MIN_PIN == N || Y_MIN_PIN == N || Z_MIN_PIN == N \ + || X_MAX_PIN == N || Y_MAX_PIN == N || Z_MAX_PIN == N \ + || X_STEP_PIN == N || Y_STEP_PIN == N || Z_STEP_PIN == N \ + || X_DIR_PIN == N || Y_DIR_PIN == N || Z_DIR_PIN == N \ + || X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \ +) +#if CONF_SERIAL_IS(0) // D0-D1. No known conflicts. +#endif +#if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19)) + #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board." +#endif +#if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17)) + #error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board." +#endif +#if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15)) + #error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board." +#endif +#undef CHECK_SERIAL_PIN + /** * Checks for FAST PWM */ diff --git a/Marlin/src/HAL/DUE/inc/SanityCheck.h b/Marlin/src/HAL/DUE/inc/SanityCheck.h index 75480acaf2e2..dd37a7bde183 100644 --- a/Marlin/src/HAL/DUE/inc/SanityCheck.h +++ b/Marlin/src/HAL/DUE/inc/SanityCheck.h @@ -25,6 +25,30 @@ * Test Arduino Due specific configuration values for errors at compile-time. */ +/** + * Check for common serial pin conflicts + */ +#define CHECK_SERIAL_PIN(N) ( \ + X_STOP_PIN == N || Y_STOP_PIN == N || Z_STOP_PIN == N \ + || X_MIN_PIN == N || Y_MIN_PIN == N || Z_MIN_PIN == N \ + || X_MAX_PIN == N || Y_MAX_PIN == N || Z_MAX_PIN == N \ + || X_STEP_PIN == N || Y_STEP_PIN == N || Z_STEP_PIN == N \ + || X_DIR_PIN == N || Y_DIR_PIN == N || Z_DIR_PIN == N \ + || X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \ +) +#if CONF_SERIAL_IS(0) // D0-D1. No known conflicts. +#endif +#if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19)) + #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board." +#endif +#if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17)) + #error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board." +#endif +#if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15)) + #error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board." +#endif +#undef CHECK_SERIAL_PIN + /** * HARDWARE VS. SOFTWARE SPI COMPATIBILITY * diff --git a/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h b/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h index 6b22b4139b6d..e683d4dfda4b 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h @@ -27,9 +27,9 @@ #define BOARD_INFO_NAME "GT2560 V3.0 (MC2)" -#define X_MIN_PIN 22 -#define X_MAX_PIN 24 -#define Y_MIN_PIN 26 -#define Y_MAX_PIN 28 +#define X_MIN_PIN 22 +#define X_MAX_PIN 24 +#define Y_MIN_PIN 26 +#define Y_MAX_PIN 28 #include "pins_GT2560_V3.h" diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index aabe0da85873..1609c9c08326 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -1319,6 +1319,9 @@ #undef X_MAX_PIN #define X_MAX_PIN -1 #endif +#if NONE(USE_XMIN_PLUG, USE_XMAX_PLUG) + #undef X_STOP_PIN +#endif #if DISABLED(USE_YMIN_PLUG) #undef Y_MIN_PIN #define Y_MIN_PIN -1 @@ -1327,6 +1330,9 @@ #undef Y_MAX_PIN #define Y_MAX_PIN -1 #endif +#if NONE(USE_YMIN_PLUG, USE_YMAX_PLUG) + #undef Y_STOP_PIN +#endif #if DISABLED(USE_ZMIN_PLUG) #undef Z_MIN_PIN #define Z_MIN_PIN -1 @@ -1335,6 +1341,9 @@ #undef Z_MAX_PIN #define Z_MAX_PIN -1 #endif +#if NONE(USE_ZMIN_PLUG, USE_ZMAX_PLUG) + #undef Z_STOP_PIN +#endif #if DISABLED(USE_IMIN_PLUG) #undef I_MIN_PIN #define I_MIN_PIN -1 @@ -1343,6 +1352,9 @@ #undef I_MAX_PIN #define I_MAX_PIN -1 #endif +#if NONE(USE_IMIN_PLUG, USE_IMAX_PLUG) + #undef I_STOP_PIN +#endif #if DISABLED(USE_JMIN_PLUG) #undef J_MIN_PIN #define J_MIN_PIN -1 @@ -1351,6 +1363,9 @@ #undef J_MAX_PIN #define J_MAX_PIN -1 #endif +#if NONE(USE_JMIN_PLUG, USE_JMAX_PLUG) + #undef J_STOP_PIN +#endif #if DISABLED(USE_KMIN_PLUG) #undef K_MIN_PIN #define K_MIN_PIN -1 @@ -1359,6 +1374,9 @@ #undef K_MAX_PIN #define K_MAX_PIN -1 #endif +#if NONE(USE_KMIN_PLUG, USE_KMAX_PLUG) + #undef K_STOP_PIN +#endif #if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MAX #undef X2_MIN_PIN diff --git a/buildroot/tests/FYSETC_F6 b/buildroot/tests/FYSETC_F6 index 9306686af5ce..17f8eb42b1e2 100755 --- a/buildroot/tests/FYSETC_F6 +++ b/buildroot/tests/FYSETC_F6 @@ -10,7 +10,7 @@ set -e # Build with the default configurations # restore_configs -opt_set MOTHERBOARD BOARD_FYSETC_F6_13 +opt_set MOTHERBOARD BOARD_FYSETC_F6_13 LCD_SERIAL_PORT 1 opt_enable DGUS_LCD_UI_FYSETC exec_test $1 $2 "FYSETC F6 1.3 with DGUS" "$3" From a6ff63d5060c0ef68c2ae9f6ccf3bcada2ec6b6e Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Thu, 12 May 2022 22:41:38 -0700 Subject: [PATCH 294/502] =?UTF-8?q?=F0=9F=8E=A8=20Clean=20up=20warnings=20?= =?UTF-8?q?/=20extra=20check=20(#24163)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/calibrate/G76_M871.cpp | 10 +++++----- Marlin/src/inc/SanityCheck.h | 10 ---------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G76_M871.cpp b/Marlin/src/gcode/calibrate/G76_M871.cpp index ad13b20306ae..c484d4f1b770 100644 --- a/Marlin/src/gcode/calibrate/G76_M871.cpp +++ b/Marlin/src/gcode/calibrate/G76_M871.cpp @@ -82,13 +82,13 @@ * - `P` - Run probe temperature calibration. */ -static void say_waiting_for() { SERIAL_ECHOPGM("Waiting for "); } -static void say_waiting_for_probe_heating() { say_waiting_for(); SERIAL_ECHOLNPGM("probe heating."); } -static void say_successfully_calibrated() { SERIAL_ECHOPGM("Successfully calibrated"); } -static void say_failed_to_calibrate() { SERIAL_ECHOPGM("!Failed to calibrate"); } - #if BOTH(PTC_PROBE, PTC_BED) + static void say_waiting_for() { SERIAL_ECHOPGM("Waiting for "); } + static void say_waiting_for_probe_heating() { say_waiting_for(); SERIAL_ECHOLNPGM("probe heating."); } + static void say_successfully_calibrated() { SERIAL_ECHOPGM("Successfully calibrated"); } + static void say_failed_to_calibrate() { SERIAL_ECHOPGM("!Failed to calibrate"); } + void GcodeSuite::G76() { auto report_temps = [](millis_t &ntr, millis_t timeout=0) { idle_no_sleep(); diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 9e307e9444ed..1179da2355a2 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2288,16 +2288,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif -#if TEMP_SENSOR_PROBE - #if !PIN_EXISTS(TEMP_PROBE) - #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN." - #elif !HAS_TEMP_ADC_PROBE - #error "TEMP_PROBE_PIN must be an ADC pin." - #elif DISABLED(FIX_MOUNTED_PROBE) - #error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE." - #endif -#endif - #if TEMP_SENSOR_BOARD #if !PIN_EXISTS(TEMP_BOARD) #error "TEMP_SENSOR_BOARD requires TEMP_BOARD_PIN." From f9b7f00d1e1c1004e0c2a9c35e23c1c67dc47172 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 4 May 2022 19:10:14 -0500 Subject: [PATCH 295/502] =?UTF-8?q?=F0=9F=9A=9A=20Move=20speed=5Flookuptab?= =?UTF-8?q?le.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/stepper.cpp | 2 +- Marlin/src/module/stepper.h | 2 +- Marlin/src/module/{ => stepper}/speed_lookuptable.h | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename Marlin/src/module/{ => stepper}/speed_lookuptable.h (100%) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index d92d50a048ea..1821043647a1 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -84,7 +84,7 @@ Stepper stepper; // Singleton #define BABYSTEPPING_EXTRA_DIR_WAIT #ifdef __AVR__ - #include "speed_lookuptable.h" + #include "stepper/speed_lookuptable.h" #endif #include "endstops.h" diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 4f1eea702d1f..942b8cc793a6 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -46,7 +46,7 @@ #include "planner.h" #include "stepper/indirection.h" #ifdef __AVR__ - #include "speed_lookuptable.h" + #include "stepper/speed_lookuptable.h" #endif // Disable multiple steps per ISR diff --git a/Marlin/src/module/speed_lookuptable.h b/Marlin/src/module/stepper/speed_lookuptable.h similarity index 100% rename from Marlin/src/module/speed_lookuptable.h rename to Marlin/src/module/stepper/speed_lookuptable.h From dcd769b4a18bd40f9664262d081d553994d8eb78 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 4 May 2022 15:14:31 -0500 Subject: [PATCH 296/502] =?UTF-8?q?=F0=9F=8E=A8=20Nextion=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lcd/extui/nextion/nextion_extui.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp index da54fac38349..0e84fd33cf4f 100644 --- a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp +++ b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp @@ -35,25 +35,25 @@ namespace ExtUI { - void onStartup() { nextion.Startup(); } - void onIdle() { nextion.IdleLoop(); } + void onStartup() { nextion.Startup(); } + void onIdle() { nextion.IdleLoop(); } void onPrinterKilled(FSTR_P const error, FSTR_P const component) { nextion.PrinterKilled(error, component); } void onMediaInserted() {} - void onMediaError() {} - void onMediaRemoved() {} + void onMediaError() {} + void onMediaRemoved() {} void onPlayTone(const uint16_t frequency, const uint16_t duration) {} void onPrintTimerStarted() {} - void onPrintTimerPaused() {} + void onPrintTimerPaused() {} void onPrintTimerStopped() {} - void onFilamentRunout(const extruder_t) {} + void onFilamentRunout(const extruder_t) {} void onUserConfirmRequired(const char * const msg) { nextion.ConfirmationRequest(msg); } - void onStatusChanged(const char * const msg) { nextion.StatusChange(msg); } + void onStatusChanged(const char * const msg) { nextion.StatusChange(msg); } - void onHomingStart() {} + void onHomingStart() {} void onHomingDone() {} - void onPrintDone() { nextion.PrintFinished(); } + void onPrintDone() { nextion.PrintFinished(); } - void onFactoryReset() {} + void onFactoryReset() {} void onStoreSettings(char *buff) { // Called when saving to EEPROM (i.e. M500). If the ExtUI needs @@ -61,7 +61,7 @@ namespace ExtUI { // into buff. // Example: - // static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size); + // static_assert(sizeof(myDataStruct) <= eeprom_data_size); // memcpy(buff, &myDataStruct, sizeof(myDataStruct)); } @@ -71,7 +71,7 @@ namespace ExtUI { // from buff // Example: - // static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size); + // static_assert(sizeof(myDataStruct) <= eeprom_data_size); // memcpy(&myDataStruct, buff, sizeof(myDataStruct)); } @@ -97,7 +97,7 @@ namespace ExtUI { // Called when any mesh points are updated } - void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) { + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const probe_state_t state) { // Called to indicate a special condition } #endif From 63aecad7eef034d8cb2b3e81f8a22db8a148b90b Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Fri, 13 May 2022 17:29:50 -0500 Subject: [PATCH 297/502] =?UTF-8?q?=F0=9F=94=A8=20BTT=20Octopus=20ST-Link?= =?UTF-8?q?=20programming/debugging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/stm32f4.ini | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 260593f8a295..688cc1054736 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -251,11 +251,14 @@ build_unflags = ${env:BIGTREE_SKR_2_F429_USB.build_unflags} -Os -NDEBUG # BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4) # [env:BIGTREE_OCTOPUS_V1] -extends = stm32_variant -board = marlin_BigTree_Octopus_v1 -board_build.offset = 0x8000 -build_flags = ${stm32_variant.build_flags} - -DSTM32F446_5VX -DUSE_USB_HS_IN_FS +extends = stm32_variant +board = marlin_BigTree_Octopus_v1 +board_build.offset = 0x8000 +board_upload.offset_address = 0x08008000 +debug_tool = stlink +upload_protocol = stlink +build_flags = ${stm32_variant.build_flags} + -DSTM32F446_5VX -DUSE_USB_HS_IN_FS # # BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4) with USB Flash Drive Support @@ -274,11 +277,14 @@ build_flags = ${stm_flash_drive.build_flags} # BigTreeTech Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) # [env:BIGTREE_OCTOPUS_PRO_V1_F429] -extends = stm32_variant -board = marlin_BigTree_Octopus_Pro_v1_F429 -board_build.offset = 0x8000 -build_flags = ${stm32_variant.build_flags} - -DUSE_USB_HS_IN_FS +extends = stm32_variant +board = marlin_BigTree_Octopus_Pro_v1_F429 +board_build.offset = 0x8000 +board_upload.offset_address = 0x08008000 +debug_tool = stlink +upload_protocol = stlink +build_flags = ${stm32_variant.build_flags} + -DUSE_USB_HS_IN_FS # # BigTreeTech Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) with USB Flash Drive Support From 425684e2ffecf85dccab1eb4242772bc97992eb8 Mon Sep 17 00:00:00 2001 From: grauerfuchs <42082416+grauerfuchs@users.noreply.github.com> Date: Fri, 13 May 2022 20:08:50 -0400 Subject: [PATCH 298/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Mightyboard=20LED?= =?UTF-8?q?=20pin,=20fan=20override=20(#24168)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index 13ffc9448640..c44b1f449c71 100644 --- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -166,19 +166,23 @@ #ifndef E0_AUTO_FAN_PIN #define E0_AUTO_FAN_PIN MOSFET_2_PIN #else - #define FAN_PIN MOSFET_2_PIN + #ifndef FAN_PIN + #define FAN_PIN MOSFET_2_PIN + #endif #endif // EX2 FAN (Automatic Fans are disabled by default in Configuration_adv.h - comment that out for auto fans) #ifndef E1_AUTO_FAN_PIN #define E1_AUTO_FAN_PIN MOSFET_4_PIN #else - #define FAN1_PIN MOSFET_4_PIN + #ifndef FAN1_PIN + #define FAN1_PIN MOSFET_4_PIN + #endif #endif // // Misc. Functions // -#define LED_PIN MOSFET_6_PIN // B7 +#define LED_PIN 13 // B7 #define CUTOFF_RESET_PIN 16 // H1 #define CUTOFF_TEST_PIN 17 // H0 #define CUTOFF_SR_CHECK_PIN 70 // G4 (TOSC1) From 1c516bdd5e71fc3da05fb52da692c9c5ccb0c0d7 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Fri, 13 May 2022 17:17:19 -0700 Subject: [PATCH 299/502] =?UTF-8?q?=F0=9F=94=A7=20Allow=20board=20&=20prob?= =?UTF-8?q?e=20dummy=20thermistors=20(#24165)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 1179da2355a2..db4c332e810d 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2281,8 +2281,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if TEMP_SENSOR_PROBE #if !PIN_EXISTS(TEMP_PROBE) #error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN." - #elif !HAS_TEMP_ADC_PROBE - #error "TEMP_PROBE_PIN must be an ADC pin." #elif DISABLED(FIX_MOUNTED_PROBE) #error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE." #endif @@ -2291,8 +2289,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if TEMP_SENSOR_BOARD #if !PIN_EXISTS(TEMP_BOARD) #error "TEMP_SENSOR_BOARD requires TEMP_BOARD_PIN." - #elif !HAS_TEMP_ADC_BOARD - #error "TEMP_BOARD_PIN must be an ADC pin." #elif ENABLED(THERMAL_PROTECTION_BOARD) && (!defined(BOARD_MINTEMP) || !defined(BOARD_MAXTEMP)) #error "THERMAL_PROTECTION_BOARD requires BOARD_MINTEMP and BOARD_MAXTEMP." #endif From 5c25ed60c80d7b06cb91e91f98b1aca6bc648d79 Mon Sep 17 00:00:00 2001 From: Dominic <91095348+d0m1d@users.noreply.github.com> Date: Sat, 14 May 2022 02:18:04 +0200 Subject: [PATCH 300/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20AIR=5FASSIST=20(#2?= =?UTF-8?q?4162)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/spindle_laser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index 52bb471b0f7e..ef3503c40d88 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -159,8 +159,8 @@ void SpindleLaser::apply_power(const uint8_t opwr) { #if ENABLED(AIR_ASSIST) // Enable / disable air assist - void SpindleLaser::air_assist_enable() { WRITE(AIR_ASSIST_PIN, AIR_ASSIST_PIN); } // Turn ON - void SpindleLaser::air_assist_disable() { WRITE(AIR_ASSIST_PIN, !AIR_ASSIST_PIN); } // Turn OFF + void SpindleLaser::air_assist_enable() { WRITE(AIR_ASSIST_PIN, AIR_ASSIST_ACTIVE); } // Turn ON + void SpindleLaser::air_assist_disable() { WRITE(AIR_ASSIST_PIN, !AIR_ASSIST_ACTIVE); } // Turn OFF void SpindleLaser::air_assist_toggle() { TOGGLE(AIR_ASSIST_PIN); } // Toggle state #endif From a13cceaad16dd2caedbf3b05ae0854b1200cb51e Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Fri, 13 May 2022 17:27:13 -0700 Subject: [PATCH 301/502] =?UTF-8?q?=F0=9F=9A=B8=20Improve=20MKS=20SGEN=5FL?= =?UTF-8?q?=20V2,=20Robin=20Nano=20V3=20pins=20(#24147)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 18 +++++++++++++++--- .../stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 8 ++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index 0c001e6061cc..13ebbe1f2859 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -36,9 +36,7 @@ // EEPROM, MKS SGEN_L V2.0 hardware has 4K EEPROM on the board // #if NO_EEPROM_SELECTED - //#define SDCARD_EEPROM_EMULATION - //#define I2C_EEPROM // AT24C32 - #define FLASH_EEPROM_EMULATION + #define I2C_EEPROM // AT24C32 #define MARLIN_EEPROM_SIZE 0x1000 // 4K #endif @@ -103,6 +101,12 @@ #define Z_MIN_PROBE_PIN P1_24 #endif +// +// Filament Runout Sensor +// +#define FIL_RUNOUT_PIN P1_28 // X+ +#define FIL_RUNOUT2_PIN P1_26 // Y+ + // // Steppers // @@ -203,6 +207,14 @@ #define TEMP_1_PIN P0_25_A2 // Analog Input A2 (TH2) #define TEMP_2_PIN P0_26_A3 // Analog Input A3 (P0.26, No pull up) +#if HOTENDS == 1 && !REDUNDANT_TEMP_MATCH(SOURCE, E1) + #if TEMP_SENSOR_PROBE + #define TEMP_PROBE_PIN TEMP_1_PIN + #elif TEMP_SENSOR_CHAMBER + #define TEMP_CHAMBER_PIN TEMP_1_PIN + #endif +#endif + // // Heaters / Fans // diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index 22e00a4eb4a7..ead8799f5e09 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -119,6 +119,14 @@ #define TEMP_1_PIN PA2 // TH2 #define TEMP_BED_PIN PC0 // TB1 +#if HOTENDS == 1 && !REDUNDANT_TEMP_MATCH(SOURCE, E1) + #if TEMP_SENSOR_PROBE + #define TEMP_PROBE_PIN TEMP_1_PIN + #elif TEMP_SENSOR_CHAMBER + #define TEMP_CHAMBER_PIN TEMP_1_PIN + #endif +#endif + // // Heaters / Fans // From 2204f05dcaabf0e639f1e1722ffd293d4b415fe3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 13 May 2022 19:31:07 -0500 Subject: [PATCH 302/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Cla?= =?UTF-8?q?rify=20MSerialUSB,=20drop=20HardwareSerial=20workaround?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/HAL.h | 1 - Marlin/src/HAL/STM32/HAL.cpp | 2 +- Marlin/src/HAL/STM32/HAL.h | 52 +++++++++++++++++++++-------------- Marlin/src/core/serial_hook.h | 2 +- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index c7454a523477..d34604180586 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -28,7 +28,6 @@ #ifdef USBCON #include #else - #define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion #include "MarlinSerial.h" #endif diff --git a/Marlin/src/HAL/STM32/HAL.cpp b/Marlin/src/HAL/STM32/HAL.cpp index d28f506db9d3..2d8b672c3dfb 100644 --- a/Marlin/src/HAL/STM32/HAL.cpp +++ b/Marlin/src/HAL/STM32/HAL.cpp @@ -31,7 +31,7 @@ #include "../shared/Delay.h" #ifdef USBCON - DefaultSerial1 MSerial0(false, SerialUSB); + DefaultSerial1 MSerialUSB(false, SerialUSB); #endif #if ENABLED(SRAM_EEPROM_EMULATION) diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index d88342b889b5..1bd7f7604257 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -51,57 +51,67 @@ #include #include "../../core/serial_hook.h" typedef ForwardSerial1Class< decltype(SerialUSB) > DefaultSerial1; - extern DefaultSerial1 MSerial0; + extern DefaultSerial1 MSerialUSB; #endif #define _MSERIAL(X) MSerial##X #define MSERIAL(X) _MSERIAL(X) -#if SERIAL_PORT == -1 - #define MYSERIAL1 MSerial0 -#elif WITHIN(SERIAL_PORT, 1, 6) +#if WITHIN(SERIAL_PORT, 1, 6) #define MYSERIAL1 MSERIAL(SERIAL_PORT) +#elif !defined(USBCON) + #error "SERIAL_PORT must be from 1 to 6." +#elif SERIAL_PORT == -1 + #define MYSERIAL1 MSerialUSB #else - #error "SERIAL_PORT must be from 1 to 6. You can also use -1 if the board supports Native USB." + #error "SERIAL_PORT must be from 1 to 6, or -1 for Native USB." #endif #ifdef SERIAL_PORT_2 - #if SERIAL_PORT_2 == -1 - #define MYSERIAL2 MSerial0 - #elif WITHIN(SERIAL_PORT_2, 1, 6) + #if WITHIN(SERIAL_PORT_2, 1, 6) #define MYSERIAL2 MSERIAL(SERIAL_PORT_2) + #elif !defined(USBCON) + #error "SERIAL_PORT must be from 1 to 6." + #elif SERIAL_PORT_2 == -1 + #define MYSERIAL2 MSerialUSB #else - #error "SERIAL_PORT_2 must be from 1 to 6. You can also use -1 if the board supports Native USB." + #error "SERIAL_PORT_2 must be from 1 to 6, or -1 for Native USB." #endif #endif #ifdef SERIAL_PORT_3 - #if SERIAL_PORT_3 == -1 - #define MYSERIAL3 MSerial0 - #elif WITHIN(SERIAL_PORT_3, 1, 6) + #if WITHIN(SERIAL_PORT_3, 1, 6) #define MYSERIAL3 MSERIAL(SERIAL_PORT_3) + #elif !defined(USBCON) + #error "SERIAL_PORT must be from 1 to 6." + #elif SERIAL_PORT_3 == -1 + #define MYSERIAL3 MSerialUSB #else - #error "SERIAL_PORT_3 must be from 1 to 6. You can also use -1 if the board supports Native USB." + #error "SERIAL_PORT_3 must be from 1 to 6, or -1 for Native USB." #endif #endif #ifdef MMU2_SERIAL_PORT - #if MMU2_SERIAL_PORT == -1 - #define MMU2_SERIAL MSerial0 - #elif WITHIN(MMU2_SERIAL_PORT, 1, 6) + #if WITHIN(MMU2_SERIAL_PORT, 1, 6) #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT) + #elif !defined(USBCON) + #error "SERIAL_PORT must be from 1 to 6." + #elif MMU2_SERIAL_PORT == -1 + #define MMU2_SERIAL MSerialUSB #else - #error "MMU2_SERIAL_PORT must be from 1 to 6. You can also use -1 if the board supports Native USB." + #error "MMU2_SERIAL_PORT must be from 1 to 6, or -1 for Native USB." #endif #endif #ifdef LCD_SERIAL_PORT - #if LCD_SERIAL_PORT == -1 - #define LCD_SERIAL MSerial0 - #elif WITHIN(LCD_SERIAL_PORT, 1, 6) + #if WITHIN(LCD_SERIAL_PORT, 1, 6) #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT) + #elif !defined(USBCON) + #error "SERIAL_PORT must be from 1 to 6." + #elif LCD_SERIAL_PORT == -1 + #define LCD_SERIAL MSerialUSB #else - #error "LCD_SERIAL_PORT must be from 1 to 6. You can also use -1 if the board supports Native USB." + #error "LCD_SERIAL_PORT must be from 1 to 6, or -1 for Native USB." #endif #if HAS_DGUS_LCD #define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite() diff --git a/Marlin/src/core/serial_hook.h b/Marlin/src/core/serial_hook.h index 9b9fa8fa3828..3972279452ef 100644 --- a/Marlin/src/core/serial_hook.h +++ b/Marlin/src/core/serial_hook.h @@ -298,7 +298,7 @@ struct MultiSerial : public SerialBase< MultiSerial< REPEAT(NUM_SERIAL, _S_NAME) // Build the actual serial object depending on current configuration #define Serial1Class TERN(SERIAL_RUNTIME_HOOK, RuntimeSerial, BaseSerial) #define ForwardSerial1Class TERN(SERIAL_RUNTIME_HOOK, RuntimeSerial, ForwardSerial) -#ifdef HAS_MULTI_SERIAL +#if HAS_MULTI_SERIAL #define Serial2Class ConditionalSerial #if NUM_SERIAL >= 3 #define Serial3Class ConditionalSerial From 03b819bdb235c6eb2cd0a02b832bb8f108cc5962 Mon Sep 17 00:00:00 2001 From: Miguel Risco-Castillo Date: Fri, 13 May 2022 19:34:30 -0500 Subject: [PATCH 303/502] =?UTF-8?q?=F0=9F=9A=B8=20DWIN/DACAI=20for=20Creal?= =?UTF-8?q?ity=204.2.3=20(#24132)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index b818c16f9493..9c9110746257 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -488,7 +488,7 @@ #ifndef LCD_SERIAL_PORT #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO) #define LCD_SERIAL_PORT 1 - #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4) + #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423) #define LCD_SERIAL_PORT 2 // Creality Ender3S1 board #else #define LCD_SERIAL_PORT 3 // Creality 4.x board From 94ed67e36ef84cb4ecd8f3f1470041d4d72f7088 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Fri, 13 May 2022 17:50:42 -0700 Subject: [PATCH 304/502] =?UTF-8?q?=F0=9F=A9=B9=20Run=20TMC=20test=20last?= =?UTF-8?q?=20in=20setup=20(#24160)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index c553f9cba010..3f067c1dc0e2 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1561,10 +1561,6 @@ void setup() { SETUP_RUN(hostui.prompt_end()); #endif - #if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF) - SETUP_RUN(test_tmc_connection()); - #endif - #if HAS_DRIVER_SAFE_POWER_PROTECT SETUP_RUN(stepper_driver_backward_report()); #endif @@ -1622,6 +1618,10 @@ void setup() { SETUP_RUN(easythreed_ui.init()); #endif + #if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF) + SETUP_RUN(test_tmc_connection()); + #endif + marlin_state = MF_RUNNING; SETUP_LOG("setup() completed."); From c4b8339b842958faae2567c339bcf9b44434a2ce Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 13 May 2022 23:49:29 -0500 Subject: [PATCH 305/502] =?UTF-8?q?=F0=9F=8E=A8=20HAL=5FMinSerial.*=20=3D>?= =?UTF-8?q?=20MinSerial.*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/DUE/{HAL_MinSerial.cpp => MinSerial.cpp} | 2 +- Marlin/src/HAL/LPC1768/{HAL_MinSerial.cpp => MinSerial.cpp} | 2 +- Marlin/src/HAL/STM32/{HAL_MinSerial.cpp => MinSerial.cpp} | 2 +- Marlin/src/HAL/STM32F1/{HAL_MinSerial.cpp => MinSerial.cpp} | 2 +- Marlin/src/HAL/shared/{HAL_MinSerial.cpp => MinSerial.cpp} | 2 +- Marlin/src/HAL/shared/{HAL_MinSerial.h => MinSerial.h} | 0 Marlin/src/HAL/shared/backtrace/backtrace.cpp | 2 +- Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename Marlin/src/HAL/DUE/{HAL_MinSerial.cpp => MinSerial.cpp} (98%) rename Marlin/src/HAL/LPC1768/{HAL_MinSerial.cpp => MinSerial.cpp} (97%) rename Marlin/src/HAL/STM32/{HAL_MinSerial.cpp => MinSerial.cpp} (99%) rename Marlin/src/HAL/STM32F1/{HAL_MinSerial.cpp => MinSerial.cpp} (99%) rename Marlin/src/HAL/shared/{HAL_MinSerial.cpp => MinSerial.cpp} (97%) rename Marlin/src/HAL/shared/{HAL_MinSerial.h => MinSerial.h} (100%) diff --git a/Marlin/src/HAL/DUE/HAL_MinSerial.cpp b/Marlin/src/HAL/DUE/MinSerial.cpp similarity index 98% rename from Marlin/src/HAL/DUE/HAL_MinSerial.cpp rename to Marlin/src/HAL/DUE/MinSerial.cpp index 93c4ed67d63c..e5b3dbfe6f36 100644 --- a/Marlin/src/HAL/DUE/HAL_MinSerial.cpp +++ b/Marlin/src/HAL/DUE/MinSerial.cpp @@ -25,7 +25,7 @@ #if ENABLED(POSTMORTEM_DEBUGGING) -#include "../shared/HAL_MinSerial.h" +#include "../shared/MinSerial.h" #include diff --git a/Marlin/src/HAL/LPC1768/HAL_MinSerial.cpp b/Marlin/src/HAL/LPC1768/MinSerial.cpp similarity index 97% rename from Marlin/src/HAL/LPC1768/HAL_MinSerial.cpp rename to Marlin/src/HAL/LPC1768/MinSerial.cpp index 57065c49ac83..7a1c038c0b0b 100644 --- a/Marlin/src/HAL/LPC1768/HAL_MinSerial.cpp +++ b/Marlin/src/HAL/LPC1768/MinSerial.cpp @@ -26,7 +26,7 @@ #if ENABLED(POSTMORTEM_DEBUGGING) -#include "../shared/HAL_MinSerial.h" +#include "../shared/MinSerial.h" #include static void TX(char c) { _DBC(c); } diff --git a/Marlin/src/HAL/STM32/HAL_MinSerial.cpp b/Marlin/src/HAL/STM32/MinSerial.cpp similarity index 99% rename from Marlin/src/HAL/STM32/HAL_MinSerial.cpp rename to Marlin/src/HAL/STM32/MinSerial.cpp index b6e86b72daa9..d99ed9cd9b99 100644 --- a/Marlin/src/HAL/STM32/HAL_MinSerial.cpp +++ b/Marlin/src/HAL/STM32/MinSerial.cpp @@ -28,7 +28,7 @@ #if ENABLED(POSTMORTEM_DEBUGGING) -#include "../shared/HAL_MinSerial.h" +#include "../shared/MinSerial.h" #include "watchdog.h" /* Instruction Synchronization Barrier */ diff --git a/Marlin/src/HAL/STM32F1/HAL_MinSerial.cpp b/Marlin/src/HAL/STM32F1/MinSerial.cpp similarity index 99% rename from Marlin/src/HAL/STM32F1/HAL_MinSerial.cpp rename to Marlin/src/HAL/STM32F1/MinSerial.cpp index 0fc3d014d484..0f7e0d5f10c5 100644 --- a/Marlin/src/HAL/STM32F1/HAL_MinSerial.cpp +++ b/Marlin/src/HAL/STM32F1/MinSerial.cpp @@ -26,7 +26,7 @@ #if ENABLED(POSTMORTEM_DEBUGGING) -#include "../shared/HAL_MinSerial.h" +#include "../shared/MinSerial.h" #include "watchdog.h" #include diff --git a/Marlin/src/HAL/shared/HAL_MinSerial.cpp b/Marlin/src/HAL/shared/MinSerial.cpp similarity index 97% rename from Marlin/src/HAL/shared/HAL_MinSerial.cpp rename to Marlin/src/HAL/shared/MinSerial.cpp index 9dda5fdf8c67..2e718d83dc12 100644 --- a/Marlin/src/HAL/shared/HAL_MinSerial.cpp +++ b/Marlin/src/HAL/shared/MinSerial.cpp @@ -19,7 +19,7 @@ * along with this program. If not, see . * */ -#include "HAL_MinSerial.h" +#include "MinSerial.h" #if ENABLED(POSTMORTEM_DEBUGGING) diff --git a/Marlin/src/HAL/shared/HAL_MinSerial.h b/Marlin/src/HAL/shared/MinSerial.h similarity index 100% rename from Marlin/src/HAL/shared/HAL_MinSerial.h rename to Marlin/src/HAL/shared/MinSerial.h diff --git a/Marlin/src/HAL/shared/backtrace/backtrace.cpp b/Marlin/src/HAL/shared/backtrace/backtrace.cpp index ad88de8385ac..33e8e65154a0 100644 --- a/Marlin/src/HAL/shared/backtrace/backtrace.cpp +++ b/Marlin/src/HAL/shared/backtrace/backtrace.cpp @@ -25,7 +25,7 @@ #include "unwinder.h" #include "unwmemaccess.h" -#include "../HAL_MinSerial.h" +#include "../MinSerial.h" #include // Dump a backtrace entry diff --git a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp index a106ed2b05e5..deaf09d2c000 100644 --- a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp +++ b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp @@ -54,7 +54,7 @@ #include "exception_hook.h" #include "../backtrace/backtrace.h" -#include "../HAL_MinSerial.h" +#include "../MinSerial.h" #define HW_REG(X) (*((volatile unsigned long *)(X))) From 78c7fedcea34f0c630f8e9fd46bc5d3244de04c5 Mon Sep 17 00:00:00 2001 From: Marcio T Date: Mon, 16 May 2022 20:45:47 -0600 Subject: [PATCH 306/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Due=20cli/sei=20(#?= =?UTF-8?q?24182)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #23357 --- Marlin/src/HAL/DUE/HAL.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index d00c4d3da102..2f5c647aa319 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -115,8 +115,8 @@ typedef Servo hal_servo_t; // // Interrupts // -#define sei() noInterrupts() -#define cli() interrupts() +#define sei() interrupts() +#define cli() noInterrupts() #define CRITICAL_SECTION_START() const bool _irqon = hal.isr_state(); hal.isr_off() #define CRITICAL_SECTION_END() if (_irqon) hal.isr_on() From 718806761f1e9d903d61408e2039357bfe46fff8 Mon Sep 17 00:00:00 2001 From: Oliver Jean Eifler Date: Tue, 17 May 2022 06:23:03 +0200 Subject: [PATCH 307/502] =?UTF-8?q?=F0=9F=A9=B9=20Suppress=20ZERO()=20warn?= =?UTF-8?q?ing=20(#24178)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 8e52152c1453..648307656e64 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -278,7 +278,7 @@ #define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+') #define DECIMAL_SIGNED(a) (DECIMAL(a) || (a) == '-' || (a) == '+') #define COUNT(a) (sizeof(a)/sizeof(*a)) -#define ZERO(a) memset(a,0,sizeof(a)) +#define ZERO(a) memset((void*)a,0,sizeof(a)) #define COPY(a,b) do{ \ static_assert(sizeof(a[0]) == sizeof(b[0]), "COPY: '" STRINGIFY(a) "' and '" STRINGIFY(b) "' types (sizes) don't match!"); \ memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \ From 8351b1431f8bad178f2f8a3ec70b32a1d4d7ca2c Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Tue, 17 May 2022 20:01:32 +1200 Subject: [PATCH 308/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20MarlinUI=20allow-c?= =?UTF-8?q?old-extrude=20(#24176)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/lcd/menu/menu_motion.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 35b1bcad7040..e1d238bb35b8 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -157,6 +157,7 @@ void _goto_manual_move(const_float_t scale) { ui.defer_status_screen(); ui.manual_move.menu_scale = scale; ui.goto_screen(_manual_move_func_ptr); + thermalManager.set_menu_cold_override(true); } void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int8_t eindex=active_extruder) { @@ -219,7 +220,7 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int ui.goto_screen([]{ MenuItem_confirm::select_screen( GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BACK), - [] { _goto_menu_move_distance_e(); thermalManager.set_menu_cold_override(true); }, nullptr, + _goto_menu_move_distance_e, nullptr, GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!") ); }); From 268a16b1ef1c5cd462e81aef08e4e9f7d2c65658 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 17 May 2022 15:05:25 -0500 Subject: [PATCH 309/502] =?UTF-8?q?=F0=9F=9A=B8=20ProUI=20APRIL2022=20upda?= =?UTF-8?q?tes=20(#24084)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 2 + Marlin/src/gcode/probe/G30.cpp | 26 +- Marlin/src/gcode/stats/M31.cpp | 2 +- Marlin/src/lcd/e3v2/common/dwin_api.cpp | 4 +- Marlin/src/lcd/e3v2/creality/dwin.cpp | 10 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 1235 ++++++++++--------- Marlin/src/lcd/e3v2/proui/dwin.h | 90 +- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 30 +- Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp | 52 +- Marlin/src/lcd/e3v2/proui/dwin_lcd.h | 22 +- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 183 +-- Marlin/src/lcd/e3v2/proui/dwinui.h | 196 ++- Marlin/src/lcd/e3v2/proui/lockscreen.cpp | 5 +- Marlin/src/lcd/e3v2/proui/lockscreen.h | 4 +- Marlin/src/lcd/e3v2/proui/menus.cpp | 198 ++- Marlin/src/lcd/e3v2/proui/menus.h | 98 +- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 44 +- Marlin/src/lcd/e3v2/proui/meshviewer.h | 6 +- Marlin/src/lcd/e3v2/proui/printstats.cpp | 2 +- Marlin/src/lcd/e3v2/proui/ubl_tools.cpp | 255 ++++ Marlin/src/lcd/e3v2/proui/ubl_tools.h | 59 + Marlin/src/lcd/language/language_en.h | 65 +- 24 files changed, 1623 insertions(+), 969 deletions(-) create mode 100644 Marlin/src/lcd/e3v2/proui/ubl_tools.cpp create mode 100644 Marlin/src/lcd/e3v2/proui/ubl_tools.h diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 3f067c1dc0e2..9311b917baa2 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -883,7 +883,7 @@ void kill(FSTR_P const lcd_error/*=nullptr*/, FSTR_P const lcd_component/*=nullp // Echo the LCD message to serial for extra context if (lcd_error) { SERIAL_ECHO_START(); SERIAL_ECHOLNF(lcd_error); } - #if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI) + #if HAS_DISPLAY ui.kill_screen(lcd_error ?: GET_TEXT_F(MSG_KILLED), lcd_component ?: FPSTR(NUL_STR)); #else UNUSED(lcd_error); UNUSED(lcd_component); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 436a25f1860c..06cd1954702a 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -727,6 +727,7 @@ void unified_bed_leveling::shift_mesh_height() { TERN_(HAS_MARLINUI_MENU, ui.capture()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); + TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart()); save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained uint8_t count = GRID_MAX_POINTS; @@ -790,6 +791,7 @@ void unified_bed_leveling::shift_mesh_height() { ); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); + TERN_(DWIN_LCD_PROUI, DWIN_LevelingDone()); } #endif // HAS_BED_PROBE diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index 474f1f252a04..a16853bdf894 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -33,6 +33,10 @@ #include "../../feature/probe_temp_comp.h" #endif +#if ENABLED(DWIN_LCD_PROUI) + #include "../../lcd/marlinui.h" +#endif + /** * G30: Do a single Z probe at the current XY * @@ -48,20 +52,38 @@ void GcodeSuite::G30() { const xy_pos_t pos = { parser.linearval('X', current_position.x + probe.offset_xy.x), parser.linearval('Y', current_position.y + probe.offset_xy.y) }; - if (!probe.can_reach(pos)) return; + if (!probe.can_reach(pos)) { + #if ENABLED(DWIN_LCD_PROUI) + SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT)); + LCD_MESSAGE(MSG_ZPROBE_OUT); + #endif + return; + } // Disable leveling so the planner won't mess with us TERN_(HAS_LEVELING, set_bed_leveling_enabled(false)); remember_feedrate_scaling_off(); + TERN_(DWIN_LCD_PROUI, process_subcommands_now(F("G28O"))); + const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; TERN_(HAS_PTC, ptc.set_enabled(!parser.seen('C') || parser.value_bool())); const float measured_z = probe.probe_at_point(pos, raise_after, 1); TERN_(HAS_PTC, ptc.set_enabled(true)); - if (!isnan(measured_z)) + if (!isnan(measured_z)) { SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z); + #if ENABLED(DWIN_LCD_PROUI) + char msg[31], str_1[6], str_2[6], str_3[6]; + sprintf_P(msg, PSTR("X:%s, Y:%s, Z:%s"), + dtostrf(pos.x, 1, 1, str_1), + dtostrf(pos.y, 1, 1, str_2), + dtostrf(measured_z, 1, 2, str_3) + ); + ui.set_status(msg); + #endif + } restore_feedrate_and_scaling(); diff --git a/Marlin/src/gcode/stats/M31.cpp b/Marlin/src/gcode/stats/M31.cpp index 355701f6a413..1a1c13ba2f1a 100644 --- a/Marlin/src/gcode/stats/M31.cpp +++ b/Marlin/src/gcode/stats/M31.cpp @@ -33,7 +33,7 @@ void GcodeSuite::M31() { char buffer[22]; duration_t(print_job_timer.duration()).toString(buffer); - ui.set_status(buffer); + ui.set_status(buffer, ENABLED(DWIN_LCD_PROUI)); SERIAL_ECHO_MSG("Print time: ", buffer); } diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.cpp b/Marlin/src/lcd/e3v2/common/dwin_api.cpp index 63a75b89c8af..3f699465a9c8 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.cpp +++ b/Marlin/src/lcd/e3v2/common/dwin_api.cpp @@ -234,7 +234,9 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis, // *string: The string // rlimit: To limit the drawn string length void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit/*=0xFFFF*/) { - DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size)); + #if DISABLED(DWIN_LCD_PROUI) + DWIN_Draw_Rectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size)); + #endif constexpr uint8_t widthAdjust = 0; size_t i = 0; DWIN_Byte(i, 0x11); diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 65da4cb42157..b2cb1bee30ce 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -2728,7 +2728,7 @@ void HMI_Prepare() { EncoderRate.enabled = true; #else // Apply workspace offset, making the current position 0,0,0 - queue.inject(F("G92 X0 Y0 Z0")); + queue.inject(F("G92X0Y0Z0")); HMI_AudioFeedback(); #endif break; @@ -3556,9 +3556,9 @@ void HMI_AdvSet() { case ADVSET_CASE_HOMEOFF: checkkey = HomeOff; select_item.reset(); - HMI_ValueStruct.Home_OffX_scaled = home_offset[X_AXIS] * 10; - HMI_ValueStruct.Home_OffY_scaled = home_offset[Y_AXIS] * 10; - HMI_ValueStruct.Home_OffZ_scaled = home_offset[Z_AXIS] * 10; + HMI_ValueStruct.Home_OffX_scaled = home_offset.x * 10; + HMI_ValueStruct.Home_OffY_scaled = home_offset.y * 10; + HMI_ValueStruct.Home_OffZ_scaled = home_offset.z * 10; Draw_HomeOff_Menu(); break; #endif @@ -3806,7 +3806,7 @@ void HMI_Tune() { EncoderRate.enabled = true; #else // Apply workspace offset, making the current position 0,0,0 - queue.inject(F("G92 X0 Y0 Z0")); + queue.inject(F("G92X0Y0Z0")); HMI_AudioFeedback(); #endif break; diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index ae23df95e836..669ef52dba5a 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1246,7 +1246,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ if (draw) Draw_Menu_Item(row, ICON_SetHome, F("Set Home Position")); else { - gcode.process_subcommands_now(F("G92 X0 Y0 Z0")); + gcode.process_subcommands_now(F("G92X0Y0Z0")); AudioFeedback(); } break; diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 9e4464dec979..e3ab8cf8b896 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -23,8 +23,8 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.15.2 - * Date: 2022/03/01 + * Version: 3.17.2 + * Date: 2022/04/08 */ #include "../../../inc/MarlinConfig.h" @@ -64,7 +64,7 @@ #include "../../../feature/host_actions.h" #endif -#if ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) && DISABLED(PROBE_MANUALLY) +#if DISABLED(PROBE_MANUALLY) && ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) #define HAS_ONESTEP_LEVELING 1 #endif @@ -82,11 +82,11 @@ #if ANY(BABYSTEPPING, HAS_BED_PROBE, HAS_WORKSPACE_OFFSET) #define HAS_ZOFFSET_ITEM 1 - #if !HAS_BED_PROBE && ENABLED(BABYSTEPPING) - #define JUST_BABYSTEP 1 - #endif - #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) + #if ENABLED(BABYSTEPPING) #include "../../../feature/babystep.h" + #if !HAS_BED_PROBE + #define JUST_BABYSTEP 1 + #endif #endif #endif @@ -94,10 +94,6 @@ #include "../../../feature/powerloss.h" #endif -#if HAS_GCODE_PREVIEW - #include "gcode_preview.h" -#endif - #if HAS_ESDIAG #include "endstop_diag.h" #endif @@ -106,6 +102,10 @@ #include "meshviewer.h" #endif +#if ENABLED(AUTO_BED_LEVELING_UBL) + #include "ubl_tools.h" +#endif + #if ENABLED(PRINTCOUNTER) #include "printstats.h" #endif @@ -143,29 +143,26 @@ // Load and Unload limits #define MAX_LOAD_UNLOAD 500 -// Feedspeed limit (max feedspeed = DEFAULT_MAX_FEEDRATE * 2) +// Feedspeed limit (max feedspeed = MAX_FEEDRATE_EDIT_VALUES) #define MIN_MAXFEEDSPEED 1 #define MIN_MAXACCELERATION 1 #define MIN_MAXJERK 0.1 #define MIN_STEP 1 #define MAX_STEP 999.9 -// Extruder's temperature limits -#define MIN_ETEMP HEATER_0_MINTEMP -#define MAX_ETEMP (HEATER_0_MAXTEMP - HOTEND_OVERSHOOT) +// Editable temperature limits +#define MIN_ETEMP 0 +#define MAX_ETEMP (HEATER_0_MAXTEMP - (HOTEND_OVERSHOOT)) +#define MIN_BEDTEMP 0 +#define MAX_BEDTEMP BED_MAX_TARGET #define FEEDRATE_E (60) -// Minimum unit (0.1) : multiple (10) -#define UNITFDIGITS 1 -#define MINUNITMULT POW(10, UNITFDIGITS) - -#define ENCODER_WAIT_MS 20 #define DWIN_VAR_UPDATE_INTERVAL 1024 #define DWIN_SCROLL_UPDATE_INTERVAL SEC_TO_MS(2) #define DWIN_REMAIN_TIME_UPDATE_INTERVAL SEC_TO_MS(20) -#define BABY_Z_VAR TERN(HAS_BED_PROBE, probe.offset.z, dwin_zoffset) +#define BABY_Z_VAR TERN(HAS_BED_PROBE, probe.offset.z, HMI_data.ManualZOffset) // Structs HMI_value_t HMI_value; @@ -203,11 +200,11 @@ uint8_t index_file = MROWS; bool hash_changed = true; // Flag to know if message status was changed -constexpr float max_feedrate_edit_values[] = DEFAULT_MAX_FEEDRATE; -constexpr float max_acceleration_edit_values[] = DEFAULT_MAX_ACCELERATION; +constexpr float max_feedrate_edit_values[] = MAX_FEEDRATE_EDIT_VALUES; +constexpr float max_acceleration_edit_values[] = MAX_ACCEL_EDIT_VALUES; #if HAS_CLASSIC_JERK - constexpr float max_jerk_edit_values[] = { DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK, DEFAULT_EJERK }; + constexpr float max_jerk_edit_values[] = MAX_JERK_EDIT_VALUES; #endif static uint8_t _percent_done = 0; @@ -216,10 +213,6 @@ static uint32_t _remain_time = 0; // Additional Aux Host Support static bool sdprint = false; -#if HAS_ZOFFSET_ITEM - float dwin_zoffset = 0, last_zoffset = 0; -#endif - #if HAS_HOTEND float last_E = 0; #endif @@ -267,12 +260,22 @@ MenuClass *BedPIDMenu = nullptr; #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) MenuClass *HomingMenu = nullptr; #endif +#if ENABLED(FWRETRACT) + MenuClass *FWRetractMenu = nullptr; +#endif +#if HAS_MESH + MenuClass *MeshMenu = nullptr; + #if ENABLED(MESH_EDIT_MENU) + MenuClass *EditMeshMenu = nullptr; + #endif +#endif // Updatable menuitems pointers MenuItemClass *HotendTargetItem = nullptr; MenuItemClass *BedTargetItem = nullptr; MenuItemClass *FanSpeedItem = nullptr; MenuItemClass *MMeshMoveZItem = nullptr; +MenuItemClass *EditZValueItem = nullptr; #define DWIN_LANGUAGE_EEPROM_ADDRESS 0x01 // Between 0x01 and 0x63 (EEPROM_OFFSET-1) // BL24CXX::check() uses 0x00 @@ -493,6 +496,11 @@ void DWIN_DrawStatusLine(const char *text) { if (text) DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, text); } +void DWIN_DrawStatusLine(FSTR_P fstr) { + DWIN_Draw_Rectangle(1, HMI_data.StatusBg_Color, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20); + if (fstr) DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, fstr); +} + // Clear & reset status line void DWIN_ResetStatusLine() { ui.status_message[0] = 0; @@ -631,6 +639,7 @@ void Goto_PrintProcess() { else { checkkey = PrintProcess; Draw_PrintProcess(); + TERN_(DASH_REDRAW, DWIN_RedrawDash()); } DWIN_UpdateLCD(); } @@ -649,8 +658,7 @@ void Draw_PrintDone() { DWINUI::Draw_Icon(ICON_RemainTime, 150, 171); Draw_Print_ProgressElapsed(); Draw_Print_ProgressRemain(); - // show print done confirm - DWINUI::Draw_Button(BTN_Confirm, 86, 273); + DWINUI::Draw_Button(BTN_Continue, 86, 273); } void Goto_PrintDone() { @@ -746,16 +754,13 @@ void update_variable() { if (checkkey == Menu && (CurrentMenu == TuneMenu || CurrentMenu == TemperatureMenu)) { // Tune page temperature update #if HAS_HOTEND - if (_new_hotend_target) - HotendTargetItem->draw(CurrentMenu->line(HotendTargetItem->pos)); + if (_new_hotend_target) HotendTargetItem->redraw(); #endif #if HAS_HEATED_BED - if (_new_bed_target) - BedTargetItem->draw(CurrentMenu->line(BedTargetItem->pos)); + if (_new_bed_target) BedTargetItem->redraw(); #endif #if HAS_FAN - if (_new_fanspeed) - FanSpeedItem->draw(CurrentMenu->line(FanSpeedItem->pos)); + if (_new_fanspeed) FanSpeedItem->redraw(); #endif } @@ -1013,7 +1018,7 @@ void DWIN_Draw_Dashboard() { DWINUI::Draw_Icon(ICON_BedTemp, 10, 416); DWINUI::Draw_Int(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 3, 28, 417, thermalManager.wholeDegBed()); DWINUI::Draw_String(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 25 + 3 * STAT_CHR_W + 5, 417, F("/")); - DWINUI::Draw_Int(true, true, 0, DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 3, 25 + 4 * STAT_CHR_W + 6, 417, thermalManager.degTargetBed()); + DWINUI::Draw_Int(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 3, 25 + 4 * STAT_CHR_W + 6, 417, thermalManager.degTargetBed()); #endif DWINUI::Draw_Icon(ICON_Speed, 113, 383); @@ -1025,7 +1030,7 @@ void DWIN_Draw_Dashboard() { DWINUI::Draw_Int(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 3, 195 + 2 * STAT_CHR_W, 384, thermalManager.fan_speed[0]); #endif - #if HAS_ZOFFSET_ITEM + #if BOTH(BABYSTEPPING, HAS_BED_PROBE) DWINUI::Draw_Icon(planner.leveling_active ? ICON_SetZOffset : ICON_Zoffset, 187, 416); #endif @@ -1075,6 +1080,7 @@ void Draw_Print_File_Menu() { else Title.ShowCaption(GET_TEXT_F(MSG_MEDIA_MENU)); Redraw_SD_List(); + TERN_(DASH_REDRAW, DWIN_RedrawDash()); } // Main Process @@ -1285,8 +1291,6 @@ void HMI_Printing() { #include "../../../libs/buzzer.h" -void HMI_AudioFeedback(const bool success/*=true*/) { DONE_BUZZ(success); } - void Draw_Main_Area() { switch (checkkey) { case MainMenu: Draw_Main_Menu(); break; @@ -1303,7 +1307,7 @@ void Draw_Main_Area() { case SetPInt: case SetIntNoDraw: case SetFloat: - case SetPFloat: CurrentMenu->draw(); break; + case SetPFloat: ReDrawMenu(); break; default: break; } } @@ -1322,15 +1326,8 @@ void HMI_WaitForUser() { select_page.reset(); Goto_Main_Menu(); break; - #if HAS_ONESTEP_LEVELING - case Leveling: - //TERN_(ProUI, ProEx.StopLeveling()); - HMI_ReturnScreen(); - break; - #endif - default: - HMI_ReturnScreen(); - break; + TERN_(HAS_ONESTEP_LEVELING, case Leveling:) + default: HMI_ReturnScreen(); break; } } } @@ -1354,17 +1351,17 @@ void EachMomentUpdate() { if (ELAPSED(ms, next_var_update_ms)) { next_var_update_ms = ms + DWIN_VAR_UPDATE_INTERVAL; update_variable(); - switch (checkkey) { - #if HAS_ESDIAG - case ESDiagProcess: - ESDiag.Update(); - break; - #endif - default: - break; - } + #if HAS_ESDIAG + if (checkkey == ESDiagProcess) ESDiag.Update(); + #endif } + #if HAS_STATUS_MESSAGE_TIMEOUT + bool did_expire = ui.status_reset_callback && (*ui.status_reset_callback)(); + did_expire |= ui.status_message_expire_ms && ELAPSED(ms, ui.status_message_expire_ms); + if (did_expire) ui.reset_status(); + #endif + if (ELAPSED(ms, next_status_update_ms)) { next_status_update_ms = ms + 500; DWIN_DrawStatusMessage(); @@ -1402,7 +1399,7 @@ void EachMomentUpdate() { duration_t elapsed = print_job_timer.duration(); // print timer - if (sdprint && card.isPrinting()) { + if (sdprint && card.isPrinting() && !HMI_flag.percent_flag) { uint8_t percentDone = card.percentDone(); if (_percent_done != percentDone) { // print percent _percent_done = percentDone; @@ -1497,8 +1494,7 @@ void DWIN_HandleScreen() { case SelectFile: HMI_SelectFile(); break; case PrintProcess: HMI_Printing(); break; case Popup: HMI_Popup(); break; - case Leveling: //TERN_(ProUI, HMI_WaitForUser()); - break; + case Leveling: break; case Locked: HMI_LockScreen(); break; case PrintDone: TERN_(HAS_ESDIAG, case ESDiagProcess:) @@ -1541,7 +1537,10 @@ void DWIN_HomingStart() { void DWIN_HomingDone() { HMI_flag.home_flag = false; - dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); + #if ENABLED(MESH_BED_LEVELING) && EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) + planner.synchronize(); + babystep.add_mm(Z_AXIS, HMI_data.ManualZOffset); + #endif if (HMI_flag.abort_action) DWIN_Print_Aborted(); else HMI_ReturnScreen(); } @@ -1550,13 +1549,25 @@ void DWIN_LevelingStart() { HMI_SaveProcessID(Leveling); Title.ShowCaption(GET_TEXT_F(MSG_BED_LEVELING)); DWIN_Show_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT)); + #if BOTH(AUTO_BED_LEVELING_UBL, PREHEAT_BEFORE_LEVELING) + #if HAS_HOTEND + if (thermalManager.degTargetHotend(0) < LEVELING_NOZZLE_TEMP) + thermalManager.setTargetHotend(LEVELING_NOZZLE_TEMP, 0); + #endif + #if HAS_HEATED_BED + if (thermalManager.degTargetBed() < HMI_data.BedLevT) + thermalManager.setTargetBed(HMI_data.BedLevT); + #endif + TERN_(HAS_HOTEND, thermalManager.wait_for_hotend(0)); + TERN_(HAS_HEATED_BED, thermalManager.wait_for_bed_heating()); + #endif #elif ENABLED(MESH_BED_LEVELING) Draw_ManualMesh_Menu(); #endif } void DWIN_LevelingDone() { - TERN_(HAS_ONESTEP_LEVELING, if (planner.leveling_active) Goto_MeshViewer()); + TERN_(HAS_MESH, Goto_MeshViewer()); } #if HAS_MESH @@ -1606,6 +1617,7 @@ void DWIN_Print_Started(const bool sd) { sdprint = IS_SD_PRINTING() || sd; _percent_done = 0; _remain_time = 0; + HMI_flag.percent_flag = false; HMI_flag.remain_flag = false; HMI_flag.pause_flag = false; HMI_flag.pause_action = false; @@ -1653,9 +1665,12 @@ void DWIN_Print_Aborted() { // Progress Bar update void DWIN_M73() { - if (parser.seenval('P')) _percent_done = parser.byteval('P'); + if (parser.seenval('P')) { + _percent_done = parser.value_byte(); + HMI_flag.percent_flag = true; + } if (parser.seenval('R')) { - _remain_time = parser.ulongval('R') * 60; + _remain_time = parser.value_ulong() * 60; HMI_flag.remain_flag = true; } if (checkkey == PrintProcess) { @@ -1705,16 +1720,18 @@ void DWIN_SetDataDefaults() { HMI_data.BedLevT = LEVELING_BED_TEMP; #endif TERN_(BAUD_RATE_GCODE, SetBaud250K()); + #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) + leds.set_default(); + ApplyLEDColor(); + #endif } void DWIN_CopySettingsTo(char * const buff) { - memcpy(buff, &HMI_data, _MIN(sizeof(HMI_data), eeprom_data_size)); + memcpy(buff, &HMI_data, eeprom_data_size); } void DWIN_CopySettingsFrom(const char * const buff) { - // (void *)-> Avoid Warning when save data different from uintX_t in HMI_data_t struct - memcpy((void *)&HMI_data, buff, _MIN(sizeof(HMI_data), eeprom_data_size)); - dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z); + memcpy(&HMI_data, buff, sizeof(HMI_data_t)); if (HMI_data.Text_Color == HMI_data.Background_Color) DWIN_SetColorDefaults(); DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); TERN_(PREVENT_COLD_EXTRUSION, ApplyExtMinT()); @@ -1726,8 +1743,13 @@ void DWIN_CopySettingsFrom(const char * const buff) { caselight.update_brightness(); #endif #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) - // Apply Led Color - leds.set_color(HMI_data.Led_Color); + leds.set_color( + (HMI_data.LED_Color >> 16) & 0xFF, + (HMI_data.LED_Color >> 8) & 0xFF, + (HMI_data.LED_Color >> 0) & 0xFF + OPTARG(HAS_WHITE_LED, (HMI_data.LED_Color >> 24) & 0xFF) + ); + leds.update(); #endif } @@ -1742,11 +1764,17 @@ void MarlinUI::init_lcd() { void DWIN_InitScreen() { HMI_Init(); // draws boot screen - DWINUI::onCursorDraw = Draw_Menu_Cursor; - DWINUI::onCursorErase = Erase_Menu_Cursor; + onCursorDraw = Draw_Menu_Cursor; + onCursorErase = Erase_Menu_Cursor; DWINUI::onTitleDraw = Draw_Title; - DWINUI::onMenuDraw = Draw_Menu; - DWIN_DrawStatusLine(nullptr); + onMenuDraw = Draw_Menu; + checkkey = 255; + CurrentMenu = nullptr; + PreviousMenu = nullptr; + index_file = MROWS; + hash_changed = true; + last_E = 0; + DWIN_DrawStatusLine(FSTR_P(nullptr)); DWIN_Draw_Dashboard(); Goto_Main_Menu(); } @@ -1764,8 +1792,8 @@ void MarlinUI::refresh() { /* Nothing to see here */ } #endif void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) { - DWIN_Draw_Popup(ICON_BLTouch, F("Printer killed:"), lcd_error); - DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 270, F("Turn off the printer")); + DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 270, GET_TEXT_F(MSG_TURN_OFF)); DWIN_UpdateLCD(); } @@ -1777,13 +1805,17 @@ void DWIN_RebootScreen() { safe_delay(500); } -void DWIN_RedrawScreen() { - Draw_Main_Area(); +void DWIN_RedrawDash() { hash_changed = true; DWIN_DrawStatusMessage(); DWIN_Draw_Dashboard(); } +void DWIN_RedrawScreen() { + Draw_Main_Area(); + DWIN_RedrawDash(); +} + #if ENABLED(ADVANCED_PAUSE_FEATURE) void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button /*= 0*/) { HMI_SaveProcessID(button ? WaitResponse : NothingToDo); @@ -1810,15 +1842,15 @@ void DWIN_RedrawScreen() { case PAUSE_MESSAGE_OPTION: Goto_FilamentPurge(); break; case PAUSE_MESSAGE_RESUME: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; case PAUSE_MESSAGE_HEAT: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), BTN_Continue); break; - case PAUSE_MESSAGE_HEATING: LCD_MESSAGE(MSG_FILAMENT_CHANGE_HEATING); break; + case PAUSE_MESSAGE_HEATING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; case PAUSE_MESSAGE_STATUS: HMI_ReturnScreen(); break; // Exit from Pause, Load and Unload default: break; } } void Draw_Popup_FilamentPurge() { - DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), F("Purge or Continue?")); - DWINUI::Draw_Button(BTN_Confirm, 26, 280); + DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE_CONTINUE)); + DWINUI::Draw_Button(BTN_Purge, 26, 280); DWINUI::Draw_Button(BTN_Continue, 146, 280); Draw_Select_Highlight(true); } @@ -1893,21 +1925,26 @@ void Goto_ConfirmToPrint() { #if ENABLED(EEPROM_SETTINGS) void WriteEeprom() { - const bool success = settings.save(); - HMI_AudioFeedback(success); + DWIN_DrawStatusLine(GET_TEXT_F(MSG_STORE_EEPROM)); + DWIN_UpdateLCD(); + DONE_BUZZ(settings.save()); } void ReadEeprom() { const bool success = settings.load(); DWIN_RedrawScreen(); - HMI_AudioFeedback(success); + DONE_BUZZ(success); } void ResetEeprom() { settings.reset(); DWIN_RedrawScreen(); - HMI_AudioFeedback(); + DONE_BUZZ(true); } + + #if HAS_MESH + void SaveMesh() { TERN(AUTO_BED_LEVELING_UBL, UBLSaveMesh(), WriteEeprom()); } + #endif #endif // Reset Printer @@ -1919,22 +1956,24 @@ void RebootPrinter() { hal.reboot(); } -void Goto_Info_Menu(){ +void Goto_Info_Menu() { Draw_Info_Menu(); + DWIN_UpdateLCD(); HMI_SaveProcessID(WaitResponse); } void Goto_Move_Menu() { #if HAS_HOTEND gcode.process_subcommands_now(F("G92E0")); // reset extruder position - planner.synchronize(); #endif Draw_Move_Menu(); } void DisableMotors() { queue.inject(F("M84")); } -void AutoLev() { queue.inject(F("G28XYO\nG28Z\nG29")); } // Force to get the current Z home position +void AutoLev() { // Always reacquire the Z "home" position + queue.inject(F(TERN(AUTO_BED_LEVELING_UBL, "G28Z\nG29P1", "G28XYO\nG28Z\nG29"))); +} void AutoHome() { queue.inject_P(G28_STR); } void HomeX() { queue.inject(F("G28X")); } @@ -1943,49 +1982,57 @@ void HomeZ() { queue.inject(F("G28Z")); } void SetHome() { // Apply workspace offset, making the current position 0,0,0 - queue.inject(F("G92 X0 Y0 Z0")); - HMI_AudioFeedback(); + queue.inject(F("G92X0Y0Z0")); + DONE_BUZZ(true); } #if HAS_ZOFFSET_ITEM void ApplyZOffset() { TERN_(EEPROM_SETTINGS, settings.save()); } void LiveZOffset() { - last_zoffset = dwin_zoffset; - dwin_zoffset = MenuData.Value / 100.0f; #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) - if (BABYSTEP_ALLOWED()) babystep.add_mm(Z_AXIS, dwin_zoffset - last_zoffset); + const_float_t step_zoffset = round((MenuData.Value / 100.0f) * planner.settings.axis_steps_per_mm[Z_AXIS]) - babystep.accum; + if (BABYSTEP_ALLOWED()) babystep.add_steps(Z_AXIS, step_zoffset); #endif } - #if EITHER(HAS_BED_PROBE, BABYSTEPPING) + + #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) void SetZOffset() { + babystep.accum = round(planner.settings.axis_steps_per_mm[Z_AXIS] * BABY_Z_VAR); SetPFloatOnClick(Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, 2, ApplyZOffset, LiveZOffset); } #endif void SetMoveZto0() { - char cmd[48] = ""; - char str_1[5] = "", str_2[5] = ""; - sprintf_P(cmd, PSTR("G28XYO\nG28Z\nG0X%sY%sF5000\nM420S0\nG0Z0F300"), - #if ENABLED(MESH_BED_LEVELING) - dtostrf(0, 1, 1, str_1), - dtostrf(0, 1, 1, str_2) - #else - dtostrf(X_CENTER, 1, 1, str_1), - dtostrf(Y_CENTER, 1, 1, str_2) - #endif - ); - gcode.process_subcommands_now(cmd); - planner.synchronize(); - LCD_MESSAGE_F("Now adjust Z Offset"); - HMI_AudioFeedback(true); + #if ENABLED(Z_SAFE_HOMING) + char cmd[54], str_1[5], str_2[5]; + sprintf_P(cmd, PSTR("G28XYO\nG28Z\nG0X%sY%sF5000\nM420S0\nG0Z0F300\nM400"), + dtostrf(Z_SAFE_HOMING_X_POINT, 1, 1, str_1), + dtostrf(Z_SAFE_HOMING_Y_POINT, 1, 1, str_2) + ); + gcode.process_subcommands_now(cmd); + #else + gcode.process_subcommands_now(F("G28O\nM420S0\nG0Z0F300\nM400")); + #endif + ui.reset_status(); + DONE_BUZZ(true); } -#endif + + void HomeZandDisable() { + SetMoveZto0(); + DisableMotors(); + } + +#endif // HAS_ZOFFSET_ITEM #if HAS_PREHEAT void DoPreheat0() { ui.preheat_all(0); } - void DoPreheat1() { ui.preheat_all(1); } - void DoPreheat2() { ui.preheat_all(2); } + #if PREHEAT_COUNT >= 2 + void DoPreheat1() { ui.preheat_all(1); } + #if PREHEAT_COUNT >= 3 + void DoPreheat2() { ui.preheat_all(2); } + #endif + #endif #endif void DoCoolDown() { thermalManager.cooldown(); } @@ -2010,9 +2057,9 @@ void ApplyMoveE() { planner.buffer_line(current_position, MMM_TO_MMS(FEEDRATE_E)); } } -void SetMoveX() { HMI_value.axis = X_AXIS; SetPFloatOnClick(X_MIN_POS, X_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove);} -void SetMoveY() { HMI_value.axis = Y_AXIS; SetPFloatOnClick(Y_MIN_POS, Y_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove);} -void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove);} +void SetMoveX() { HMI_value.axis = X_AXIS; SetPFloatOnClick(X_MIN_POS, X_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove); } +void SetMoveY() { HMI_value.axis = Y_AXIS; SetPFloatOnClick(Y_MIN_POS, Y_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove); } +void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS, UNITFDIGITS, planner.synchronize, LiveMove); } #if HAS_HOTEND void SetMoveE() { @@ -2025,14 +2072,13 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #endif void SetPID(celsius_t t, heater_id_t h) { - char cmd[48] = ""; + char cmd[53] = ""; char str_1[5] = "", str_2[5] = ""; - sprintf_P(cmd, PSTR("G28OXY\nG0Z5F300\nG0X%sY%sF5000\nM84"), + sprintf_P(cmd, PSTR("G28OXY\nG0Z5F300\nG0X%sY%sF5000\nM84\nM400"), dtostrf(X_CENTER, 1, 1, str_1), dtostrf(Y_CENTER, 1, 1, str_2) ); gcode.process_subcommands_now(cmd); - planner.synchronize(); thermalManager.PID_autotune(t, h, HMI_data.PidCycles, true); } #if HAS_HOTEND @@ -2078,7 +2124,7 @@ void SetPID(celsius_t t, heater_id_t h) { DWIN_UpdateLCD(); } #if ENABLED(CASELIGHT_USES_BRIGHTNESS) - void LiveCaseLightBrightness() { HMI_data.CaseLight_Brightness = caselight.brightness = MenuData.Value; caselight.update_brightness(); } + void LiveCaseLightBrightness() { caselight.brightness = MenuData.Value; caselight.update_brightness(); } void SetCaseLightBrightness() { SetIntOnClick(0, 255, caselight.brightness, nullptr, LiveCaseLightBrightness); } #endif #endif @@ -2091,16 +2137,18 @@ void SetPID(celsius_t t, heater_id_t h) { DWIN_UpdateLCD(); } #endif - #if ENABLED(HAS_COLOR_LEDS) - void LiveLedColorR() { leds.color.r = MenuData.Value; HMI_data.Led_Color = leds.color; leds.update(); } - void SetLedColorR() { SetIntOnClick(0, 255, leds.color.r, nullptr, LiveLedColorR); } - void LiveLedColorG() { leds.color.g = MenuData.Value; HMI_data.Led_Color = leds.color; leds.update(); } - void SetLedColorG() { SetIntOnClick(0, 255, leds.color.g, nullptr, LiveLedColorG); } - void LiveLedColorB() { leds.color.b = MenuData.Value; HMI_data.Led_Color = leds.color; leds.update(); } - void SetLedColorB() { SetIntOnClick(0, 255, leds.color.b, nullptr, LiveLedColorB); } + #if HAS_COLOR_LEDS + void ApplyLEDColor() { HMI_data.LED_Color = TERN0(HAS_WHITE_LED, (leds.color.w << 24)) | (leds.color.r << 16) | (leds.color.g << 8) | leds.color.b; } + void LiveLEDColor(uint8_t *color) { *color = MenuData.Value; leds.update(); } + void LiveLEDColorR() { LiveLEDColor(&leds.color.r); } + void LiveLEDColorG() { LiveLEDColor(&leds.color.g); } + void LiveLEDColorB() { LiveLEDColor(&leds.color.b); } + void SetLEDColorR() { SetIntOnClick(0, 255, leds.color.r, ApplyLEDColor, LiveLEDColorR); } + void SetLEDColorG() { SetIntOnClick(0, 255, leds.color.g, ApplyLEDColor, LiveLEDColorG); } + void SetLEDColorB() { SetIntOnClick(0, 255, leds.color.b, ApplyLEDColor, LiveLEDColorB); } #if HAS_WHITE_LED - void LiveLedColorW() { leds.color.w = MenuData.Value; HMI_data.Led_Color = leds.color; leds.update(); } - void SetLedColorW() { SetIntOnClick(0, 255, leds.color.w, nullptr, LiveLedColorW); } + void LiveLEDColorW() { LiveLEDColor(&leds.color.w); } + void SetLEDColorW() { SetIntOnClick(0, 255, leds.color.w, ApplyLEDColor, LiveLEDColorW); } #endif #endif #endif @@ -2139,10 +2187,6 @@ void SetPID(celsius_t t, heater_id_t h) { } #endif - #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) - void SetBedLevT() { SetPIntOnClick(BED_MINTEMP, BED_MAX_TARGET); } - #endif - #endif #if HAS_FILAMENT_SENSOR @@ -2197,7 +2241,7 @@ void DWIN_ApplyColor() { DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); Draw_SelectColors_Menu(); hash_changed = true; - LCD_MESSAGE_F(GET_TEXT_F(MSG_COLORS_APPLIED)); + LCD_MESSAGE(MSG_COLORS_APPLIED); DWIN_Draw_Dashboard(); } @@ -2210,7 +2254,7 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } #if HAS_HEATED_BED void ApplyBedTemp() { thermalManager.setTargetBed(MenuData.Value); } - void SetBedTemp() { SetIntOnClick(BED_MINTEMP, BED_MAX_TARGET, thermalManager.degTargetBed(), ApplyBedTemp); } + void SetBedTemp() { SetIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP, thermalManager.degTargetBed(), ApplyBedTemp); } #endif #if HAS_FAN @@ -2225,18 +2269,18 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } queue.inject(F("M600 B2")); } - void ParkHead(){ + void ParkHead() { LCD_MESSAGE(MSG_FILAMENT_PARK_ENABLED); queue.inject(F("G28O\nG27")); } #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void UnloadFilament(){ + void UnloadFilament() { LCD_MESSAGE(MSG_FILAMENTUNLOAD); queue.inject(F("M702 Z20")); } - void LoadFilament(){ + void LoadFilament() { LCD_MESSAGE(MSG_FILAMENTLOAD); queue.inject(F("M701 Z20")); } @@ -2248,9 +2292,9 @@ void ApplyFlow() { planner.refresh_e_factor(0); } void SetFlow() { SetPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW, ApplyFlow); } // Bed Tramming -TERN(HAS_ONESTEP_LEVELING, float, void) Tram(uint8_t point) { +TERN(HAS_BED_PROBE, float, void) Tram(uint8_t point) { char cmd[100] = ""; - #if HAS_ONESTEP_LEVELING + #if HAS_BED_PROBE static bool inLev = false; float xpos = 0, ypos = 0, zval = 0, margin = 0; char str_1[6] = "", str_2[6] = "", str_3[6] = ""; @@ -2286,7 +2330,7 @@ TERN(HAS_ONESTEP_LEVELING, float, void) Tram(uint8_t point) { planner.synchronize(); - #if HAS_ONESTEP_LEVELING + #if HAS_BED_PROBE if (HMI_data.FullManualTramming) { planner.synchronize(); @@ -2297,15 +2341,14 @@ TERN(HAS_ONESTEP_LEVELING, float, void) Tram(uint8_t point) { queue.inject(cmd); } else { - LIMIT(xpos, X_MIN_POS, (X_MAX_POS + probe.offset.x)); - LIMIT(ypos, Y_MIN_POS, (Y_MAX_POS + probe.offset.y)); + LIMIT(xpos, MESH_MIN_X, MESH_MAX_X); + LIMIT(ypos, MESH_MIN_Y, MESH_MAX_Y); probe.stow(); gcode.process_subcommands_now(F("M420S0\nG28O")); - planner.synchronize(); inLev = true; zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW); if (isnan(zval)) - LCD_MESSAGE_F("Position Not Reachable, check offsets"); + LCD_MESSAGE(MSG_ZPROBE_OUT); else { sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"), dtostrf(xpos, 1, 1, str_1), @@ -2318,7 +2361,7 @@ TERN(HAS_ONESTEP_LEVELING, float, void) Tram(uint8_t point) { } return zval; - #else + #else // !HAS_BED_PROBE sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"), xpos, ypos); queue.inject(cmd); @@ -2332,7 +2375,7 @@ void TramBR() { Tram(2); } void TramBL() { Tram(3); } void TramC () { Tram(4); } -#if HAS_ONESTEP_LEVELING +#if HAS_BED_PROBE void Trammingwizard() { bed_mesh_t zval = {0}; @@ -2349,22 +2392,30 @@ void TramC () { Tram(4); } MeshViewer.DrawMesh(zval, 2, 2); zval[0][1] = Tram(3); MeshViewer.DrawMesh(zval, 2, 2); - char str_1[6] = "", str_2[6] = ""; - ui.status_printf(0, F("Limits minZ: %s, maxZ: %s"), - dtostrf(MeshViewer.min, 1, 2, str_1), - dtostrf(MeshViewer.max, 1, 2, str_2) - ); + + DWINUI::Draw_CenteredString(140, F("Calculating average")); + DWINUI::Draw_CenteredString(160, F("and relative heights")); + safe_delay(1000); + float avg = 0.0f; + LOOP_L_N(x, 2) LOOP_L_N(y, 2) avg += zval[x][y]; + avg /= 4.0f; + LOOP_L_N(x, 2) LOOP_L_N(y, 2) zval[x][y] -= avg; + MeshViewer.DrawMesh(zval, 2, 2); + ui.reset_status(); + if (ABS(MeshViewer.max - MeshViewer.min) < 0.05) { DWINUI::Draw_CenteredString(140,F("Corners leveled")); DWINUI::Draw_CenteredString(160,F("Tolerance achieved!")); } else { uint8_t p = 0; - float d, max = 0; + float max = 0; FSTR_P plabel; - LOOP_L_N(x,2) LOOP_L_N(y,2) { - d = ABS(zval[x][y] - MeshViewer.avg); + bool s = true; + LOOP_L_N(x, 2) LOOP_L_N(y, 2) { + const float d = ABS(zval[x][y]); if (max < d) { + s = (zval[x][y] >= 0); max = d; p = x + 2 * y; } @@ -2376,9 +2427,10 @@ void TramC () { Tram(4); } case 0b11 : plabel = GET_TEXT_F(MSG_LEVBED_BR); break; default : plabel = F(""); break; } - DWINUI::Draw_CenteredString(130, F("Corners not leveled")); - DWINUI::Draw_CenteredString(150, F("Knob adjustment required")); - DWINUI::Draw_CenteredString(Color_Green, 170, plabel); + DWINUI::Draw_CenteredString(120, F("Corners not leveled")); + DWINUI::Draw_CenteredString(140, F("Knob adjustment required")); + DWINUI::Draw_CenteredString(Color_Green, 160, s ? F("Lower") : F("Raise")); + DWINUI::Draw_CenteredString(Color_Green, 180, plabel); } DWINUI::Draw_Button(BTN_Continue, 86, 305); checkkey = Menu; @@ -2391,14 +2443,13 @@ void TramC () { Tram(4); } DWIN_UpdateLCD(); } -#endif // HAS_ONESTEP_LEVELING +#endif // HAS_BED_PROBE #if ENABLED(MESH_BED_LEVELING) - void ManualMeshStart(){ + void ManualMeshStart() { LCD_MESSAGE(MSG_UBL_BUILD_MESH_MENU); gcode.process_subcommands_now(F("G28XYO\nG28Z\nM211S0\nG29S1")); - planner.synchronize(); #ifdef MANUAL_PROBE_START_Z const uint8_t line = CurrentMenu->line(MMeshMoveZItem->pos); DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, 2, VALX - 2 * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(line), MANUAL_PROBE_START_Z); @@ -2412,15 +2463,14 @@ void TramC () { Tram(4); } planner.buffer_line(current_position, homing_feedrate(Z_AXIS)); } } - void SetMMeshMoveZ() { SetPFloatOnClick(-1, 1, 2, planner.synchronize, LiveMeshMoveZ);} + void SetMMeshMoveZ() { SetPFloatOnClick(-1, 1, 2, planner.synchronize, LiveMeshMoveZ); } - void ManualMeshContinue(){ + void ManualMeshContinue() { gcode.process_subcommands_now(F("G29S2")); - planner.synchronize(); - MMeshMoveZItem->draw(CurrentMenu->line(MMeshMoveZItem->pos)); + MMeshMoveZItem->redraw(); } - void ManualMeshSave(){ + void ManualMeshSave() { LCD_MESSAGE(MSG_UBL_STORAGE_MESH_MENU); queue.inject(F("M211S1\nM500")); } @@ -2432,7 +2482,7 @@ void TramC () { Tram(4); } void SetPreheatEndTemp() { SetPIntOnClick(MIN_ETEMP, MAX_ETEMP); } #endif #if HAS_HEATED_BED - void SetPreheatBedTemp() { SetPIntOnClick(BED_MINTEMP, BED_MAX_TARGET); } + void SetPreheatBedTemp() { SetPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } #endif #if HAS_FAN void SetPreheatFanSpeed() { SetPIntOnClick(0, 255); } @@ -2473,7 +2523,7 @@ void SetStepsZ() { HMI_value.axis = Z_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP void SetHotendPidT() { SetPIntOnClick(MIN_ETEMP, MAX_ETEMP); } #endif #if HAS_HEATED_BED - void SetBedPidT() { SetPIntOnClick(BED_MINTEMP, BED_MAX_TARGET); } + void SetBedPidT() { SetPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } #endif #if HAS_HOTEND || HAS_HEATED_BED @@ -2500,10 +2550,12 @@ void SetStepsZ() { HMI_value.axis = Z_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP #endif #if ENABLED(FWRETRACT) - void SetRetractLength() { SetPFloatOnClick( 0, 10, UNITFDIGITS); }; - void SetRetractSpeed() { SetPFloatOnClick( 1, 90, UNITFDIGITS); }; - void SetZRaise() { SetPFloatOnClick( 0, 2, 2); }; - void SetRecoverSpeed() { SetPFloatOnClick( 1, 90, UNITFDIGITS); }; + void Return_FWRetract_Menu() { (PreviousMenu == FilSetMenu) ? Draw_FilSet_Menu() : Draw_Tune_Menu(); } + void SetRetractLength() { SetPFloatOnClick( 0, 10, UNITFDIGITS); } + void SetRetractSpeed() { SetPFloatOnClick( 1, 90, UNITFDIGITS); } + void SetZRaise() { SetPFloatOnClick( 0, 2, 2); } + void SetRecoverSpeed() { SetPFloatOnClick( 1, 90, UNITFDIGITS); } + void SetAddRecover() { SetPFloatOnClick(-5, 5, UNITFDIGITS); } #endif // Special Menuitem Drawing functions ================================================= @@ -2583,7 +2635,7 @@ void onDrawAutoHome(MenuItemClass* menuitem, int8_t line) { } #if HAS_ZOFFSET_ITEM - #if EITHER(HAS_BED_PROBE, BABYSTEPPING) + #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) void onDrawZOffset(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) menuitem->SetFrame(1, 174, 164, 223, 177); onDrawPFloat2Menu(menuitem, line); @@ -2601,10 +2653,12 @@ void onDrawAutoHome(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) menuitem->SetFrame(1, 100, 89, 151, 101); onDrawMenuItem(menuitem, line); } - void onDrawPreheat2(MenuItemClass* menuitem, int8_t line) { - if (HMI_IsChinese()) menuitem->SetFrame(1, 180, 89, 233, 100); - onDrawMenuItem(menuitem, line); - } + #if PREHEAT_COUNT > 1 + void onDrawPreheat2(MenuItemClass* menuitem, int8_t line) { + if (HMI_IsChinese()) menuitem->SetFrame(1, 180, 89, 233, 100); + onDrawMenuItem(menuitem, line); + } + #endif #endif #if HAS_PREHEAT @@ -2620,32 +2674,6 @@ void onDrawLanguage(MenuItemClass* menuitem, int8_t line) { DWINUI::Draw_String(VALX, MBASE(line), HMI_IsChinese() ? F("CN") : F("EN")); } -#if ENABLED(POWER_LOSS_RECOVERY) - void onDrawPwrLossR(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, recovery.enabled); } -#endif - -#if ENABLED(BAUD_RATE_GCODE) - void onDrawBaudrate(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, HMI_data.Baud115K); } -#endif - -#if ENABLED(CASE_LIGHT_MENU) - void onDrawCaseLight(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, caselight.on); } -#endif - -#if ENABLED(LED_CONTROL_MENU) - #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) - void onDrawLedStatus(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, leds.lights_on); } - #endif -#endif - -#if ENABLED(SOUND_MENU_ITEM) - void onDrawEnableSound(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, ui.buzzer_enabled); } -#endif - -#ifdef BLTOUCH_HS_MODE - void onDrawHSMode(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, bltouch.high_speed_mode); } -#endif - void onDrawSelColorItem(MenuItemClass* menuitem, int8_t line) { const uint16_t color = *(uint16_t*)static_cast(menuitem)->value; DWIN_Draw_Rectangle(0, HMI_data.Highlight_Color, ICOX + 1, MBASE(line) - 1 + 1, ICOX + 18, MBASE(line) - 1 + 18); @@ -2737,10 +2765,12 @@ void onDrawSteps(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) menuitem->SetFrame(1, 100, 89, 178, 101); onDrawSubMenu(menuitem,line); } - void onDrawABSPreheatSubMenu(MenuItemClass* menuitem, int8_t line) { - if (HMI_IsChinese()) menuitem->SetFrame(1, 180, 89, 260, 100); - onDrawSubMenu(menuitem,line); - } + #if PREHEAT_COUNT >= 2 + void onDrawABSPreheatSubMenu(MenuItemClass* menuitem, int8_t line) { + if (HMI_IsChinese()) menuitem->SetFrame(1, 180, 89, 260, 100); + onDrawSubMenu(menuitem,line); + } + #endif #endif // HAS_PREHEAT void onDrawSpeed(MenuItemClass* menuitem, int8_t line) { @@ -2937,70 +2967,67 @@ void Draw_Prepare_Menu() { if (CurrentMenu != PrepareMenu) { CurrentMenu = PrepareMenu; SetMenuTitle({133, 1, 28, 13}, GET_TEXT_F(MSG_PREPARE)); - DWINUI::MenuItemsPrepare(13); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); + MenuItemsPrepare(13); + BACK_ITEM(Goto_Main_Menu); #if ENABLED(ADVANCED_PAUSE_FEATURE) - MENU_ITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENT_MAN), onDrawSubMenu, Draw_FilamentMan_Menu); + MENU_ITEM_F(ICON_FilMan, MSG_FILAMENT_MAN, onDrawSubMenu, Draw_FilamentMan_Menu); #endif - MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_MOVE_AXIS), onDrawMoveSubMenu, Goto_Move_Menu); - MENU_ITEM(ICON_Tram, GET_TEXT_F(MSG_BED_TRAMMING), onDrawSubMenu, Draw_Tramming_Menu); - MENU_ITEM(ICON_CloseMotor, GET_TEXT_F(MSG_DISABLE_STEPPERS), onDrawDisableMotors, DisableMotors); + MENU_ITEM_F(ICON_Axis, MSG_MOVE_AXIS, onDrawMoveSubMenu, Goto_Move_Menu); + MENU_ITEM_F(ICON_Tram, MSG_BED_TRAMMING, onDrawSubMenu, Draw_Tramming_Menu); + MENU_ITEM_F(ICON_CloseMotor, MSG_DISABLE_STEPPERS, onDrawDisableMotors, DisableMotors); #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) - MENU_ITEM(ICON_Homing, GET_TEXT_F(MSG_HOMING), onDrawSubMenu, Draw_Homing_Menu); + MENU_ITEM_F(ICON_Homing, MSG_HOMING, onDrawSubMenu, Draw_Homing_Menu); #else - MENU_ITEM(ICON_Homing, GET_TEXT_F(MSG_AUTO_HOME), onDrawAutoHome, AutoHome); + MENU_ITEM_F(ICON_Homing, MSG_AUTO_HOME, onDrawAutoHome, AutoHome); #endif #if ENABLED(MESH_BED_LEVELING) - MENU_ITEM(ICON_ManualMesh, GET_TEXT_F(MSG_MANUAL_MESH), onDrawSubMenu, Draw_ManualMesh_Menu); + MENU_ITEM_F(ICON_ManualMesh, MSG_MANUAL_MESH, onDrawSubMenu, Draw_ManualMesh_Menu); #endif #if HAS_ONESTEP_LEVELING - MENU_ITEM(ICON_Level, GET_TEXT_F(MSG_AUTO_MESH), onDrawMenuItem, AutoLev); + MENU_ITEM_F(ICON_Level, MSG_AUTO_MESH, onDrawMenuItem, AutoLev); #endif #if HAS_ZOFFSET_ITEM - #if HAS_BED_PROBE - MENU_ITEM(ICON_SetZOffset, GET_TEXT_F(MSG_PROBE_WIZARD), onDrawSubMenu, Draw_ZOffsetWiz_Menu); - #elif ENABLED(BABYSTEPPING) - EDIT_ITEM(ICON_Zoffset, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + MENU_ITEM_F(ICON_SetZOffset, MSG_PROBE_WIZARD, onDrawSubMenu, Draw_ZOffsetWiz_Menu); + #elif JUST_BABYSTEP + EDIT_ITEM_F(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); #else - MENU_ITEM(ICON_SetHome, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawHomeOffset, SetHome); + MENU_ITEM_F(ICON_SetHome, MSG_SET_HOME_OFFSETS, onDrawHomeOffset, SetHome); #endif #endif #if HAS_PREHEAT - MENU_ITEM(ICON_PLAPreheat, GET_TEXT_F(MSG_PREHEAT_1), onDrawPreheat1, DoPreheat0); + MENU_ITEM_F(ICON_PLAPreheat, MSG_PREHEAT_1, onDrawPreheat1, DoPreheat0); #if PREHEAT_COUNT > 1 - MENU_ITEM(ICON_ABSPreheat, PSTR("Preheat " PREHEAT_2_LABEL), onDrawPreheat2, DoPreheat1); - #endif - #if PREHEAT_COUNT > 2 - MENU_ITEM(ICON_CustomPreheat, GET_TEXT_F(MSG_PREHEAT_CUSTOM), onDrawMenuItem, DoPreheat2); + MENU_ITEM(ICON_ABSPreheat, F("Preheat " PREHEAT_2_LABEL), onDrawPreheat2, DoPreheat1); + #if PREHEAT_COUNT > 2 + MENU_ITEM(ICON_CustomPreheat, F("Preheat " PREHEAT_3_LABEL), onDrawMenuItem, DoPreheat2); + #endif #endif #endif - MENU_ITEM(ICON_Cool, GET_TEXT_F(MSG_COOLDOWN), onDrawCooldown, DoCoolDown); - MENU_ITEM(ICON_Language, PSTR(GET_TEXT_F(MSG_UI_LANGUAGE)), onDrawLanguage, SetLanguage); + MENU_ITEM_F(ICON_Cool, MSG_COOLDOWN, onDrawCooldown, DoCoolDown); + MENU_ITEM_F(ICON_Language, MSG_UI_LANGUAGE, onDrawLanguage, SetLanguage); } ui.reset_status(true); CurrentMenu->draw(); } void Draw_Tramming_Menu() { - DWINUI::ClearMainArea(); checkkey = Menu; - if (!TrammingMenu) TrammingMenu = new MenuClass(); - if (CurrentMenu != TrammingMenu) { - CurrentMenu = TrammingMenu; - SetMenuTitle({0}, GET_TEXT_F(MSG_BED_TRAMMING)); // TODO: Chinese, English "Bed Tramming" JPG - DWINUI::MenuItemsPrepare(8); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); - MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, TramFL); - MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FR), onDrawMenuItem, TramFR); - MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BR), onDrawMenuItem, TramBR); - MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BL), onDrawMenuItem, TramBL); - MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_C ), onDrawMenuItem, TramC ); - #if HAS_ONESTEP_LEVELING - MENU_ITEM(ICON_ProbeSet, F("Bed tramming wizard"), onDrawMenuItem, Trammingwizard); - MENU_ITEM(ICON_ProbeSet, GET_TEXT_F(MSG_BED_TRAMMING_MANUAL), onDrawManualTramming, SetManualTramming); + if (SetMenu(TrammingMenu, GET_TEXT_F(MSG_BED_TRAMMING), 8)) { + BACK_ITEM(Draw_Prepare_Menu); + #if HAS_BED_PROBE + MENU_ITEM_F(ICON_ProbeSet, MSG_TRAMMING_WIZARD, onDrawMenuItem, Trammingwizard); + EDIT_ITEM_F(ICON_ProbeSet, MSG_BED_TRAMMING_MANUAL, onDrawChkbMenu, SetManualTramming, &HMI_data.FullManualTramming); + #else + MENU_ITEM(ICON_MoveZ0, F("Home Z and disable"), onDrawMenuItem, HomeZandDisable); #endif + MENU_ITEM_F(ICON_Axis, MSG_LEVBED_FL, onDrawMenuItem, TramFL); + MENU_ITEM_F(ICON_Axis, MSG_LEVBED_FR, onDrawMenuItem, TramFR); + MENU_ITEM_F(ICON_Axis, MSG_LEVBED_BR, onDrawMenuItem, TramBR); + MENU_ITEM_F(ICON_Axis, MSG_LEVBED_BL, onDrawMenuItem, TramBL); + MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_C ), onDrawMenuItem, TramC ); } - CurrentMenu->draw(); + UpdateMenu(TrammingMenu); } void Draw_Control_Menu() { @@ -3009,27 +3036,27 @@ void Draw_Control_Menu() { if (CurrentMenu != ControlMenu) { CurrentMenu = ControlMenu; SetMenuTitle({103, 1, 28, 14}, GET_TEXT_F(MSG_CONTROL)); - DWINUI::MenuItemsPrepare(10); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); + MenuItemsPrepare(10); + BACK_ITEM(Goto_Main_Menu); + MENU_ITEM_F(ICON_Temperature, MSG_TEMPERATURE, onDrawTempSubMenu, Draw_Temperature_Menu); + MENU_ITEM_F(ICON_Motion, MSG_MOTION, onDrawMotionSubMenu, Draw_Motion_Menu); + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM_F(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawWriteEeprom, WriteEeprom); + MENU_ITEM_F(ICON_ReadEEPROM, MSG_LOAD_EEPROM, onDrawReadEeprom, ReadEeprom); + MENU_ITEM_F(ICON_ResumeEEPROM, MSG_RESTORE_DEFAULTS, onDrawResetEeprom, ResetEeprom); + #endif + MENU_ITEM_F(ICON_Reboot, MSG_RESET_PRINTER, onDrawMenuItem, RebootPrinter); #if ENABLED(CASE_LIGHT_MENU) #if ENABLED(CASELIGHT_USES_BRIGHTNESS) - MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawSubMenu, Draw_CaseLight_Menu); + MENU_ITEM_F(ICON_CaseLight, MSG_CASE_LIGHT, onDrawSubMenu, Draw_CaseLight_Menu); #else - MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); + MENU_ITEM_F(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, SetCaseLight, &caselight.on); #endif #endif #if ENABLED(LED_CONTROL_MENU) - MENU_ITEM(ICON_LedControl, GET_TEXT_F(MSG_LED_CONTROL), onDrawSubMenu, Draw_LedControl_Menu); + MENU_ITEM_F(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, Draw_LedControl_Menu); #endif - MENU_ITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawTempSubMenu, Draw_Temperature_Menu); - MENU_ITEM(ICON_Motion, GET_TEXT_F(MSG_MOTION), onDrawMotionSubMenu, Draw_Motion_Menu); - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawWriteEeprom, WriteEeprom); - MENU_ITEM(ICON_ReadEEPROM, GET_TEXT_F(MSG_LOAD_EEPROM), onDrawReadEeprom, ReadEeprom); - MENU_ITEM(ICON_ResumeEEPROM, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawResetEeprom, ResetEeprom); - #endif - MENU_ITEM(ICON_Reboot, GET_TEXT_F(MSG_RESET_PRINTER), onDrawMenuItem, RebootPrinter); - MENU_ITEM(ICON_Info, GET_TEXT_F(MSG_INFO_SCREEN), onDrawInfoSubMenu, Goto_Info_Menu); + MENU_ITEM_F(ICON_Info, MSG_INFO_SCREEN, onDrawInfoSubMenu, Goto_Info_Menu); } ui.reset_status(true); CurrentMenu->draw(); @@ -3037,57 +3064,52 @@ void Draw_Control_Menu() { void Draw_AdvancedSettings_Menu() { checkkey = Menu; - if (!AdvancedSettings) AdvancedSettings = new MenuClass(); - if (CurrentMenu != AdvancedSettings) { - CurrentMenu = AdvancedSettings; - SetMenuTitle({0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG - DWINUI::MenuItemsPrepare(17); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); + if (SetMenu(AdvancedSettings, GET_TEXT_F(MSG_ADVANCED_SETTINGS), 20)) { + BACK_ITEM(Goto_Main_Menu); #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawMenuItem, WriteEeprom); - #endif - #if HAS_HOME_OFFSET - MENU_ITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu); + MENU_ITEM_F(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); #endif #if HAS_BED_PROBE - MENU_ITEM(ICON_ProbeSet, GET_TEXT_F(MSG_ZPROBE_SETTINGS), onDrawSubMenu, Draw_ProbeSet_Menu); + MENU_ITEM_F(ICON_ProbeSet, MSG_ZPROBE_SETTINGS, onDrawSubMenu, Draw_ProbeSet_Menu); + #endif + #if HAS_MESH + MENU_ITEM_F(ICON_ProbeSet, MSG_MESH_LEVELING, onDrawSubMenu, Draw_MeshSet_Menu); + #endif + #if HAS_HOME_OFFSET + MENU_ITEM_F(ICON_HomeOffset, MSG_SET_HOME_OFFSETS, onDrawSubMenu, Draw_HomeOffset_Menu); #endif #if HAS_HOTEND - MENU_ITEM(ICON_PIDNozzle, F("Hotend PID Settings"), onDrawSubMenu, Draw_HotendPID_Menu); + MENU_ITEM(ICON_PIDNozzle, F(STR_HOTEND_PID " Settings"), onDrawSubMenu, Draw_HotendPID_Menu); #endif #if HAS_HEATED_BED - MENU_ITEM(ICON_PIDbed, F("Bed PID Settings"), onDrawSubMenu, Draw_BedPID_Menu); - #endif - #if HAS_FILAMENT_SENSOR - MENU_ITEM(ICON_FilSet, GET_TEXT_F(MSG_FILAMENT_SET), onDrawSubMenu, Draw_FilSet_Menu); + MENU_ITEM(ICON_PIDbed, F(STR_BED_PID " Settings"), onDrawSubMenu, Draw_BedPID_Menu); #endif + MENU_ITEM_F(ICON_FilSet, MSG_FILAMENT_SET, onDrawSubMenu, Draw_FilSet_Menu); #if ENABLED(POWER_LOSS_RECOVERY) - MENU_ITEM(ICON_Pwrlossr, GET_TEXT_F(MSG_OUTAGE_RECOVERY), onDrawPwrLossR, SetPwrLossr); + EDIT_ITEM_F(ICON_Pwrlossr, MSG_OUTAGE_RECOVERY, onDrawChkbMenu, SetPwrLossr, &recovery.enabled); #endif #if ENABLED(BAUD_RATE_GCODE) - MENU_ITEM(ICON_SetBaudRate, F("115K baud"), onDrawBaudrate, SetBaudRate); + EDIT_ITEM(ICON_SetBaudRate, F("115K baud"), onDrawChkbMenu, SetBaudRate, &HMI_data.Baud115K); #endif #if HAS_LCD_BRIGHTNESS - EDIT_ITEM(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS), onDrawPInt8Menu, SetBrightness, &ui.brightness); + EDIT_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); + MENU_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, TurnOffBacklight); #endif - MENU_ITEM(ICON_Scolor, GET_TEXT_F(MSG_COLORS_SELECT), onDrawSubMenu, Draw_SelectColors_Menu); + MENU_ITEM_F(ICON_Scolor, MSG_COLORS_SELECT, onDrawSubMenu, Draw_SelectColors_Menu); #if ENABLED(SOUND_MENU_ITEM) - MENU_ITEM(ICON_Sound, GET_TEXT_F(MSG_SOUND_ENABLE), onDrawEnableSound, SetEnableSound); - #endif - #if HAS_MESH - MENU_ITEM(ICON_MeshViewer, GET_TEXT_F(MSG_MESH_VIEW), onDrawSubMenu, DWIN_MeshViewer); + EDIT_ITEM_F(ICON_Sound, MSG_SOUND_ENABLE, onDrawChkbMenu, SetEnableSound, &ui.sound_on); #endif #if HAS_ESDIAG MENU_ITEM(ICON_ESDiag, F("End-stops diag."), onDrawSubMenu, Draw_EndStopDiag); #endif #if ENABLED(PRINTCOUNTER) - MENU_ITEM(ICON_PrintStats, GET_TEXT_F(MSG_INFO_STATS_MENU), onDrawSubMenu, Goto_PrintStats); - MENU_ITEM(ICON_PrintStatsReset, GET_TEXT_F(MSG_INFO_PRINT_COUNT_RESET), onDrawSubMenu, PrintStats.Reset); + MENU_ITEM_F(ICON_PrintStats, MSG_INFO_STATS_MENU, onDrawSubMenu, Goto_PrintStats); + MENU_ITEM_F(ICON_PrintStatsReset, MSG_INFO_PRINT_COUNT_RESET, onDrawSubMenu, PrintStats.Reset); #endif - MENU_ITEM(ICON_Lock, GET_TEXT_F(MSG_LOCKSCREEN), onDrawMenuItem, DWIN_LockScreen); + MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen); } ui.reset_status(true); - CurrentMenu->draw(); + UpdateMenu(AdvancedSettings); } void Draw_Move_Menu() { @@ -3096,181 +3118,146 @@ void Draw_Move_Menu() { if (CurrentMenu != MoveMenu) { CurrentMenu = MoveMenu; SetMenuTitle({192, 1, 42, 14}, GET_TEXT_F(MSG_MOVE_AXIS)); - DWINUI::MenuItemsPrepare(5); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); - EDIT_ITEM(ICON_MoveX, GET_TEXT_F(MSG_MOVE_X), onDrawMoveX, SetMoveX, ¤t_position.x); - EDIT_ITEM(ICON_MoveY, GET_TEXT_F(MSG_MOVE_Y), onDrawMoveY, SetMoveY, ¤t_position.y); - EDIT_ITEM(ICON_MoveZ, GET_TEXT_F(MSG_MOVE_Z), onDrawMoveZ, SetMoveZ, ¤t_position.z); + MenuItemsPrepare(5); + BACK_ITEM(Draw_Prepare_Menu); + EDIT_ITEM_F(ICON_MoveX, MSG_MOVE_X, onDrawMoveX, SetMoveX, ¤t_position.x); + EDIT_ITEM_F(ICON_MoveY, MSG_MOVE_Y, onDrawMoveY, SetMoveY, ¤t_position.y); + EDIT_ITEM_F(ICON_MoveZ, MSG_MOVE_Z, onDrawMoveZ, SetMoveZ, ¤t_position.z); #if HAS_HOTEND - EDIT_ITEM(ICON_Extruder, GET_TEXT_F(MSG_MOVE_E), onDrawMoveE, SetMoveE, ¤t_position.e); + EDIT_ITEM_F(ICON_Extruder, MSG_MOVE_E, onDrawMoveE, SetMoveE, ¤t_position.e); #endif } CurrentMenu->draw(); - if (!all_axes_trusted()) LCD_MESSAGE_F("WARNING: current position is unknown, home axes"); + if (!all_axes_trusted()) LCD_MESSAGE_F("WARNING: Current position unknown. Home axes."); } #if HAS_HOME_OFFSET void Draw_HomeOffset_Menu() { checkkey = Menu; - if (!HomeOffMenu) HomeOffMenu = new MenuClass(); - if (CurrentMenu != HomeOffMenu) { - CurrentMenu = HomeOffMenu; - SetMenuTitle({0}, GET_TEXT_F(MSG_SET_HOME_OFFSETS)); // TODO: Chinese, English "Set Home Offsets" JPG - DWINUI::MenuItemsPrepare(4); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); - EDIT_ITEM(ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X), onDrawPFloatMenu, SetHomeOffsetX, &home_offset[X_AXIS]); - EDIT_ITEM(ICON_HomeOffsetY, GET_TEXT_F(MSG_HOME_OFFSET_Y), onDrawPFloatMenu, SetHomeOffsetY, &home_offset[Y_AXIS]); - EDIT_ITEM(ICON_HomeOffsetZ, GET_TEXT_F(MSG_HOME_OFFSET_Z), onDrawPFloatMenu, SetHomeOffsetZ, &home_offset[Z_AXIS]); + if (SetMenu(HomeOffMenu, GET_TEXT_F(MSG_SET_HOME_OFFSETS), 4)) { + BACK_ITEM(Draw_AdvancedSettings_Menu); + EDIT_ITEM_F(ICON_HomeOffsetX, MSG_HOME_OFFSET_X, onDrawPFloatMenu, SetHomeOffsetX, &home_offset.x); + EDIT_ITEM_F(ICON_HomeOffsetY, MSG_HOME_OFFSET_Y, onDrawPFloatMenu, SetHomeOffsetY, &home_offset.y); + EDIT_ITEM_F(ICON_HomeOffsetZ, MSG_HOME_OFFSET_Z, onDrawPFloatMenu, SetHomeOffsetZ, &home_offset.z); } - CurrentMenu->draw(); + UpdateMenu(HomeOffMenu); } #endif #if HAS_BED_PROBE void Draw_ProbeSet_Menu() { checkkey = Menu; - if (!ProbeSetMenu) ProbeSetMenu = new MenuClass(); - if (CurrentMenu != ProbeSetMenu) { - CurrentMenu = ProbeSetMenu; - SetMenuTitle({0}, GET_TEXT_F(MSG_ZPROBE_SETTINGS)); // TODO: Chinese, English "Probe Settings" JPG - DWINUI::MenuItemsPrepare(9); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); - EDIT_ITEM(ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET), onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x); - EDIT_ITEM(ICON_ProbeOffsetY, GET_TEXT_F(MSG_ZPROBE_YOFFSET), onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y); - EDIT_ITEM(ICON_ProbeOffsetZ, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z); - #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) - EDIT_ITEM(ICON_Temperature, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawPIntMenu, SetBedLevT, &HMI_data.BedLevT); - #endif + if (SetMenu(ProbeSetMenu, GET_TEXT_F(MSG_ZPROBE_SETTINGS), 8)) { + BACK_ITEM(Draw_AdvancedSettings_Menu); + EDIT_ITEM_F(ICON_ProbeOffsetX, MSG_ZPROBE_XOFFSET, onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x); + EDIT_ITEM_F(ICON_ProbeOffsetY, MSG_ZPROBE_YOFFSET, onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y); + EDIT_ITEM_F(ICON_ProbeOffsetZ, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z); #ifdef BLTOUCH_HS_MODE - MENU_ITEM(ICON_HSMode, F("Enable HS mode"), onDrawHSMode, SetHSMode); + EDIT_ITEM_F(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, SetHSMode, &bltouch.high_speed_mode); #endif - MENU_ITEM(ICON_ProbeTest, GET_TEXT_F(MSG_M48_TEST), onDrawMenuItem, ProbeTest); - MENU_ITEM(ICON_ProbeStow, GET_TEXT_F(MSG_MANUAL_STOW), onDrawMenuItem, ProbeStow); - MENU_ITEM(ICON_ProbeDeploy, GET_TEXT_F(MSG_MANUAL_DEPLOY), onDrawMenuItem, ProbeDeploy); + MENU_ITEM_F(ICON_ProbeTest, MSG_M48_TEST, onDrawMenuItem, ProbeTest); + MENU_ITEM_F(ICON_ProbeStow, MSG_MANUAL_STOW, onDrawMenuItem, ProbeStow); + MENU_ITEM_F(ICON_ProbeDeploy, MSG_MANUAL_DEPLOY, onDrawMenuItem, ProbeDeploy); } - CurrentMenu->draw(); + UpdateMenu(ProbeSetMenu); } + #endif -#if HAS_FILAMENT_SENSOR - void Draw_FilSet_Menu() { - checkkey = Menu; - if (!FilSetMenu) FilSetMenu = new MenuClass(); - if (CurrentMenu != FilSetMenu) { - CurrentMenu = FilSetMenu; - CurrentMenu->MenuTitle.SetCaption(GET_TEXT_F(MSG_FILAMENT_SET)); - DWINUI::MenuItemsPrepare(10); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_AdvancedSettings_Menu); - #if HAS_FILAMENT_SENSOR - MENU_ITEM(ICON_Runout, GET_TEXT_F(MSG_RUNOUT_ENABLE), onDrawRunoutEnable, SetRunoutEnable); - #endif - #if HAS_FILAMENT_RUNOUT_DISTANCE - EDIT_ITEM(ICON_Runout, F("Runout Distance"), onDrawPFloatMenu, SetRunoutDistance, &runout.runout_distance()); - #endif - #if ENABLED(PREVENT_COLD_EXTRUSION) - EDIT_ITEM(ICON_ExtrudeMinT, F("Extrude Min Temp."), onDrawPIntMenu, SetExtMinT, &HMI_data.ExtMinT); - #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) - EDIT_ITEM(ICON_FilLoad, GET_TEXT_F(MSG_FILAMENT_LOAD), onDrawPFloatMenu, SetFilLoad, &fc_settings[0].load_length); - EDIT_ITEM(ICON_FilUnload, GET_TEXT_F(MSG_FILAMENT_UNLOAD), onDrawPFloatMenu, SetFilUnload, &fc_settings[0].unload_length); - #endif - #if ENABLED(FWRETRACT) - EDIT_ITEM(ICON_FWRetLength, GET_TEXT_F(MSG_CONTROL_RETRACT), onDrawPFloatMenu, SetRetractLength, &fwretract.settings.retract_length); - EDIT_ITEM(ICON_FWRetSpeed, GET_TEXT_F(MSG_SINGLENOZZLE_RETRACT_SPEED), onDrawPFloatMenu, SetRetractSpeed, &fwretract.settings.retract_feedrate_mm_s); - EDIT_ITEM(ICON_FWRetZRaise, GET_TEXT_F(MSG_CONTROL_RETRACT_ZHOP), onDrawPFloat2Menu, SetZRaise, &fwretract.settings.retract_zraise); - EDIT_ITEM(ICON_FWRecSpeed, GET_TEXT_F(MSG_SINGLENOZZLE_UNRETRACT_SPEED), onDrawPFloatMenu, SetRecoverSpeed, &fwretract.settings.retract_recover_feedrate_mm_s); - #endif - } - CurrentMenu->draw(); +void Draw_FilSet_Menu() { + checkkey = Menu; + if (SetMenu(FilSetMenu, GET_TEXT_F(MSG_FILAMENT_SET), 9)) { + BACK_ITEM(Draw_AdvancedSettings_Menu); + #if HAS_FILAMENT_SENSOR + EDIT_ITEM_F(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, SetRunoutEnable, &runout.enabled); + #endif + #if HAS_FILAMENT_RUNOUT_DISTANCE + EDIT_ITEM_F(ICON_Runout, MSG_RUNOUT_DISTANCE_MM, onDrawPFloatMenu, SetRunoutDistance, &runout.runout_distance()); + #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + EDIT_ITEM_F(ICON_ExtrudeMinT, MSG_EXTRUDER_MIN_TEMP, onDrawPIntMenu, SetExtMinT, &HMI_data.ExtMinT); + #endif + #if ENABLED(ADVANCED_PAUSE_FEATURE) + EDIT_ITEM_F(ICON_FilLoad, MSG_FILAMENT_LOAD, onDrawPFloatMenu, SetFilLoad, &fc_settings[0].load_length); + EDIT_ITEM_F(ICON_FilUnload, MSG_FILAMENT_UNLOAD, onDrawPFloatMenu, SetFilUnload, &fc_settings[0].unload_length); + #endif + #if ENABLED(FWRETRACT) + MENU_ITEM_F(ICON_FWRetract, MSG_FWRETRACT, onDrawSubMenu, Draw_FWRetract_Menu); + #endif } -#endif // HAS_FILAMENT_SENSOR + UpdateMenu(FilSetMenu); +} void Draw_SelectColors_Menu() { checkkey = Menu; - if (!SelectColorMenu) SelectColorMenu = new MenuClass(); - if (CurrentMenu != SelectColorMenu) { - CurrentMenu = SelectColorMenu; - SetMenuTitle({0}, GET_TEXT_F(MSG_COLORS_SELECT)); // TODO: Chinese, English "Select Color" JPG - DWINUI::MenuItemsPrepare(20); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); - MENU_ITEM(ICON_StockConfiguration, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawMenuItem, RestoreDefaultsColors); - EDIT_ITEM(0, "Screen Background", onDrawSelColorItem, SelColor, &HMI_data.Background_Color); - EDIT_ITEM(0, "Cursor", onDrawSelColorItem, SelColor, &HMI_data.Cursor_color); - EDIT_ITEM(0, "Title Background", onDrawSelColorItem, SelColor, &HMI_data.TitleBg_color); - EDIT_ITEM(0, "Title Text", onDrawSelColorItem, SelColor, &HMI_data.TitleTxt_color); - EDIT_ITEM(0, "Text", onDrawSelColorItem, SelColor, &HMI_data.Text_Color); - EDIT_ITEM(0, "Selected", onDrawSelColorItem, SelColor, &HMI_data.Selected_Color); - EDIT_ITEM(0, "Split Line", onDrawSelColorItem, SelColor, &HMI_data.SplitLine_Color); - EDIT_ITEM(0, "Highlight", onDrawSelColorItem, SelColor, &HMI_data.Highlight_Color); - EDIT_ITEM(0, "Status Background", onDrawSelColorItem, SelColor, &HMI_data.StatusBg_Color); - EDIT_ITEM(0, "Status Text", onDrawSelColorItem, SelColor, &HMI_data.StatusTxt_Color); - EDIT_ITEM(0, "Popup Background", onDrawSelColorItem, SelColor, &HMI_data.PopupBg_color); - EDIT_ITEM(0, "Popup Text", onDrawSelColorItem, SelColor, &HMI_data.PopupTxt_Color); - EDIT_ITEM(0, "Alert Background", onDrawSelColorItem, SelColor, &HMI_data.AlertBg_Color); - EDIT_ITEM(0, "Alert Text", onDrawSelColorItem, SelColor, &HMI_data.AlertTxt_Color); - EDIT_ITEM(0, "Percent Text", onDrawSelColorItem, SelColor, &HMI_data.PercentTxt_Color); - EDIT_ITEM(0, "Bar Fill", onDrawSelColorItem, SelColor, &HMI_data.Barfill_Color); - EDIT_ITEM(0, "Indicator value", onDrawSelColorItem, SelColor, &HMI_data.Indicator_Color); - EDIT_ITEM(0, "Coordinate value", onDrawSelColorItem, SelColor, &HMI_data.Coordinate_Color); - } - CurrentMenu->draw(); + if (SetMenu(SelectColorMenu, GET_TEXT_F(MSG_COLORS_SELECT), 20)) { + BACK_ITEM(Draw_AdvancedSettings_Menu); + MENU_ITEM_F(ICON_StockConfiguration, MSG_RESTORE_DEFAULTS, onDrawMenuItem, RestoreDefaultsColors); + EDIT_ITEM(0, F("Screen Background"), onDrawSelColorItem, SelColor, &HMI_data.Background_Color); + EDIT_ITEM(0, F("Cursor"), onDrawSelColorItem, SelColor, &HMI_data.Cursor_color); + EDIT_ITEM(0, F("Title Background"), onDrawSelColorItem, SelColor, &HMI_data.TitleBg_color); + EDIT_ITEM(0, F("Title Text"), onDrawSelColorItem, SelColor, &HMI_data.TitleTxt_color); + EDIT_ITEM(0, F("Text"), onDrawSelColorItem, SelColor, &HMI_data.Text_Color); + EDIT_ITEM(0, F("Selected"), onDrawSelColorItem, SelColor, &HMI_data.Selected_Color); + EDIT_ITEM(0, F("Split Line"), onDrawSelColorItem, SelColor, &HMI_data.SplitLine_Color); + EDIT_ITEM(0, F("Highlight"), onDrawSelColorItem, SelColor, &HMI_data.Highlight_Color); + EDIT_ITEM(0, F("Status Background"), onDrawSelColorItem, SelColor, &HMI_data.StatusBg_Color); + EDIT_ITEM(0, F("Status Text"), onDrawSelColorItem, SelColor, &HMI_data.StatusTxt_Color); + EDIT_ITEM(0, F("Popup Background"), onDrawSelColorItem, SelColor, &HMI_data.PopupBg_color); + EDIT_ITEM(0, F("Popup Text"), onDrawSelColorItem, SelColor, &HMI_data.PopupTxt_Color); + EDIT_ITEM(0, F("Alert Background"), onDrawSelColorItem, SelColor, &HMI_data.AlertBg_Color); + EDIT_ITEM(0, F("Alert Text"), onDrawSelColorItem, SelColor, &HMI_data.AlertTxt_Color); + EDIT_ITEM(0, F("Percent Text"), onDrawSelColorItem, SelColor, &HMI_data.PercentTxt_Color); + EDIT_ITEM(0, F("Bar Fill"), onDrawSelColorItem, SelColor, &HMI_data.Barfill_Color); + EDIT_ITEM(0, F("Indicator value"), onDrawSelColorItem, SelColor, &HMI_data.Indicator_Color); + EDIT_ITEM(0, F("Coordinate value"), onDrawSelColorItem, SelColor, &HMI_data.Coordinate_Color); + } + UpdateMenu(SelectColorMenu); } void Draw_GetColor_Menu() { checkkey = Menu; - if (!GetColorMenu) GetColorMenu = new MenuClass(); - if (CurrentMenu != GetColorMenu) { - CurrentMenu = GetColorMenu; - SetMenuTitle({0}, GET_TEXT_F(MSG_COLORS_GET)); // TODO: Chinese, English "Get Color" JPG - DWINUI::MenuItemsPrepare(5); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, DWIN_ApplyColor); - MENU_ITEM(ICON_Cancel, GET_TEXT_F(MSG_BUTTON_CANCEL), onDrawMenuItem, Draw_SelectColors_Menu); - MENU_ITEM(0, GET_TEXT_F(MSG_COLORS_RED), onDrawGetColorItem, SetRGBColor); - MENU_ITEM(1, GET_TEXT_F(MSG_COLORS_GREEN), onDrawGetColorItem, SetRGBColor); - MENU_ITEM(2, GET_TEXT_F(MSG_COLORS_BLUE), onDrawGetColorItem, SetRGBColor); - } - CurrentMenu->draw(); + if (SetMenu(GetColorMenu, GET_TEXT_F(MSG_COLORS_GET), 5)) { + BACK_ITEM(DWIN_ApplyColor); + MENU_ITEM_F(ICON_Cancel, MSG_BUTTON_CANCEL, onDrawMenuItem, Draw_SelectColors_Menu); + MENU_ITEM_F(0, MSG_COLORS_RED, onDrawGetColorItem, SetRGBColor); + MENU_ITEM_F(1, MSG_COLORS_GREEN, onDrawGetColorItem, SetRGBColor); + MENU_ITEM_F(2, MSG_COLORS_BLUE, onDrawGetColorItem, SetRGBColor); + } + UpdateMenu(GetColorMenu); DWIN_Draw_Rectangle(1, *MenuData.P_Int, 20, 315, DWIN_WIDTH - 20, 335); } #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) void Draw_CaseLight_Menu() { checkkey = Menu; - if (!CaseLightMenu) CaseLightMenu = new MenuClass(); - if (CurrentMenu != CaseLightMenu) { - CurrentMenu = CaseLightMenu; - SetMenuTitle({0}, GET_TEXT_F(MSG_CASE_LIGHT)); // TODO: Chinese, English "Case Light" JPG - DWINUI::MenuItemsPrepare(3); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); - MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); - EDIT_ITEM(ICON_Brightness, GET_TEXT_F(MSG_CASE_LIGHT_BRIGHTNESS), onDrawPInt8Menu, SetCaseLightBrightness, &caselight.brightness); + if (SetMenu(CaseLightMenu, GET_TEXT_F(MSG_CASE_LIGHT), 3)) { + BACK_ITEM(Draw_Control_Menu); + EDIT_ITEM_F(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, SetCaseLight, &caselight.on); + EDIT_ITEM_F(ICON_Brightness, MSG_CASE_LIGHT_BRIGHTNESS, onDrawPInt8Menu, SetCaseLightBrightness, &caselight.brightness); } - CurrentMenu->draw(); + UpdateMenu(CaseLightMenu); } #endif #if ENABLED(LED_CONTROL_MENU) void Draw_LedControl_Menu() { checkkey = Menu; - if (!LedControlMenu) LedControlMenu = new MenuClass(); - if (CurrentMenu != LedControlMenu) { - CurrentMenu = LedControlMenu; - SetMenuTitle({0}, GET_TEXT_F(MSG_LED_CONTROL)); // TODO: Chinese, English "LED Control" JPG - DWINUI::MenuItemsPrepare(6); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); + if (SetMenu(LedControlMenu, GET_TEXT_F(MSG_LED_CONTROL), 6)) { + BACK_ITEM(Draw_Control_Menu); #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) - MENU_ITEM(ICON_LedControl, GET_TEXT_F(MSG_LEDS), onDrawLedStatus, SetLedStatus); + EDIT_ITEM_F(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, SetLedStatus, &leds.lights_on); #endif - #if (HAS_COLOR_LEDS) - EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_RED), onDrawPInt8Menu, SetLedColorR, &leds.color.r); - EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_GREEN), onDrawPInt8Menu, SetLedColorG, &leds.color.g); - EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_BLUE), onDrawPInt8Menu, SetLedColorB, &leds.color.b); + #if HAS_COLOR_LEDS + EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_RED, onDrawPInt8Menu, SetLEDColorR, &leds.color.r); + EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_GREEN, onDrawPInt8Menu, SetLEDColorG, &leds.color.g); + EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_BLUE, onDrawPInt8Menu, SetLEDColorB, &leds.color.b); #if ENABLED(HAS_WHITE_LED) - EDIT_ITEM(ICON_LedControl, GET_TEXT_F(MSG_COLORS_WHITE), onDrawPInt8Menu, SetLedColorW, &leds.color.w); + EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_WHITE, onDrawPInt8Menu, SetLedColorW, &leds.color.w); #endif #endif } - CurrentMenu->draw(); + UpdateMenu(LedControlMenu); } #endif @@ -3280,40 +3267,37 @@ void Draw_Tune_Menu() { if (CurrentMenu != TuneMenu) { CurrentMenu = TuneMenu; SetMenuTitle({73, 2, 28, 12}, GET_TEXT_F(MSG_TUNE)); // TODO: Chinese, English "Tune" JPG - DWINUI::MenuItemsPrepare(16); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_PrintProcess); - #if ENABLED(CASE_LIGHT_MENU) - MENU_ITEM(ICON_CaseLight, GET_TEXT_F(MSG_CASE_LIGHT), onDrawCaseLight, SetCaseLight); - #elif ENABLED(LED_CONTROL_MENU) && DISABLED(CASE_LIGHT_USE_NEOPIXEL) - MENU_ITEM(ICON_LedControl, GET_TEXT_F(MSG_LEDS), onDrawLedStatus, SetLedStatus); - #endif - EDIT_ITEM(ICON_Speed, GET_TEXT_F(MSG_SPEED), onDrawSpeedItem, SetSpeed, &feedrate_percentage); + MenuItemsPrepare(16); + BACK_ITEM(Goto_PrintProcess); + EDIT_ITEM_F(ICON_Speed, MSG_SPEED, onDrawSpeedItem, SetSpeed, &feedrate_percentage); #if HAS_HOTEND - HotendTargetItem = EDIT_ITEM(ICON_HotendTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); + HotendTargetItem = EDIT_ITEM_F(ICON_HotendTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); #endif #if HAS_HEATED_BED - BedTargetItem = EDIT_ITEM(ICON_BedTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); + BedTargetItem = EDIT_ITEM_F(ICON_BedTemp, MSG_UBL_SET_TEMP_BED, onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); #endif #if HAS_FAN - FanSpeedItem = EDIT_ITEM(ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED), onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); + FanSpeedItem = EDIT_ITEM_F(ICON_FanSpeed, MSG_FAN_SPEED, onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); #endif - #if HAS_ZOFFSET_ITEM && EITHER(HAS_BED_PROBE, BABYSTEPPING) - EDIT_ITEM(ICON_Zoffset, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawZOffset, SetZOffset, &BABY_Z_VAR); - #endif - #if ENABLED(FWRETRACT) - EDIT_ITEM(ICON_FWRetLength, GET_TEXT_F(MSG_CONTROL_RETRACT), onDrawPFloatMenu, SetRetractLength, &fwretract.settings.retract_length); - EDIT_ITEM(ICON_FWRetSpeed, GET_TEXT_F(MSG_SINGLENOZZLE_RETRACT_SPEED), onDrawPFloatMenu, SetRetractSpeed, &fwretract.settings.retract_feedrate_mm_s); - EDIT_ITEM(ICON_FWRetZRaise, GET_TEXT_F(MSG_CONTROL_RETRACT_ZHOP), onDrawPFloat2Menu, SetZRaise, &fwretract.settings.retract_zraise); - EDIT_ITEM(ICON_FWRecSpeed, GET_TEXT_F(MSG_SINGLENOZZLE_UNRETRACT_SPEED), onDrawPFloatMenu, SetRecoverSpeed, &fwretract.settings.retract_recover_feedrate_mm_s); + #if HAS_ZOFFSET_ITEM && EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) + EDIT_ITEM_F(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawZOffset, SetZOffset, &BABY_Z_VAR); #endif - EDIT_ITEM(ICON_Flow, GET_TEXT_F(MSG_FLOW), onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); + EDIT_ITEM_F(ICON_Flow, MSG_FLOW, onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); #if ENABLED(ADVANCED_PAUSE_FEATURE) - MENU_ITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENTCHANGE), onDrawMenuItem, ChangeFilament); + MENU_ITEM_F(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, ChangeFilament); #endif - MENU_ITEM(ICON_Lock, GET_TEXT_F(MSG_LOCKSCREEN), onDrawMenuItem, DWIN_LockScreen); + #if ENABLED(FWRETRACT) + MENU_ITEM_F(ICON_FWRetract, MSG_FWRETRACT, onDrawSubMenu, Draw_FWRetract_Menu); + #endif + MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen); #if HAS_LCD_BRIGHTNESS - EDIT_ITEM(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS), onDrawPInt8Menu, SetBrightness, &ui.brightness); - MENU_ITEM(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS_OFF), onDrawMenuItem, TurnOffBacklight); + EDIT_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); + MENU_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, TurnOffBacklight); + #endif + #if ENABLED(CASE_LIGHT_MENU) + EDIT_ITEM_F(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, SetCaseLight, &caselight.on); + #elif ENABLED(LED_CONTROL_MENU) && DISABLED(CASE_LIGHT_USE_NEOPIXEL) + EDIT_ITEM_F(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, SetLedStatus, &leds.lights_on); #endif } CurrentMenu->draw(); @@ -3325,15 +3309,15 @@ void Draw_Motion_Menu() { if (CurrentMenu != MotionMenu) { CurrentMenu = MotionMenu; SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MOTION)); // TODO: Chinese, English "Motion" JPG - DWINUI::MenuItemsPrepare(6); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); - MENU_ITEM(ICON_MaxSpeed, GET_TEXT_F(MSG_SPEED), onDrawSpeed, Draw_MaxSpeed_Menu); - MENU_ITEM(ICON_MaxAccelerated, GET_TEXT_F(MSG_ACCELERATION), onDrawAcc, Draw_MaxAccel_Menu); + MenuItemsPrepare(6); + BACK_ITEM(Draw_Control_Menu); + MENU_ITEM_F(ICON_MaxSpeed, MSG_SPEED, onDrawSpeed, Draw_MaxSpeed_Menu); + MENU_ITEM_F(ICON_MaxAccelerated, MSG_ACCELERATION, onDrawAcc, Draw_MaxAccel_Menu); #if HAS_CLASSIC_JERK - MENU_ITEM(ICON_MaxJerk, GET_TEXT_F(MSG_JERK), onDrawJerk, Draw_MaxJerk_Menu); + MENU_ITEM_F(ICON_MaxJerk, MSG_JERK, onDrawJerk, Draw_MaxJerk_Menu); #endif - MENU_ITEM(ICON_Step, GET_TEXT_F(MSG_STEPS_PER_MM), onDrawSteps, Draw_Steps_Menu); - EDIT_ITEM(ICON_Flow, GET_TEXT_F(MSG_FLOW), onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); + MENU_ITEM_F(ICON_Step, MSG_STEPS_PER_MM, onDrawSteps, Draw_Steps_Menu); + EDIT_ITEM_F(ICON_Flow, MSG_FLOW, onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); } CurrentMenu->draw(); } @@ -3341,39 +3325,31 @@ void Draw_Motion_Menu() { #if ENABLED(ADVANCED_PAUSE_FEATURE) void Draw_FilamentMan_Menu() { checkkey = Menu; - if (!FilamentMenu) FilamentMenu = new MenuClass(); - if (CurrentMenu != FilamentMenu) { - CurrentMenu = FilamentMenu; - SetMenuTitle({0}, GET_TEXT_F(MSG_FILAMENT_MAN)); // TODO: Chinese, English "Filament Management" JPG - DWINUI::MenuItemsPrepare(5); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); - MENU_ITEM(ICON_Park, GET_TEXT_F(MSG_FILAMENT_PARK_ENABLED), onDrawMenuItem, ParkHead); - MENU_ITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENTCHANGE), onDrawMenuItem, ChangeFilament); + if (SetMenu(FilamentMenu, GET_TEXT_F(MSG_FILAMENT_MAN), 5)) { + BACK_ITEM(Draw_Prepare_Menu); + MENU_ITEM_F(ICON_Park, MSG_FILAMENT_PARK_ENABLED, onDrawMenuItem, ParkHead); + MENU_ITEM_F(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, ChangeFilament); #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - MENU_ITEM(ICON_FilUnload, GET_TEXT_F(MSG_FILAMENTUNLOAD), onDrawMenuItem, UnloadFilament); - MENU_ITEM(ICON_FilLoad, GET_TEXT_F(MSG_FILAMENTLOAD), onDrawMenuItem, LoadFilament); + MENU_ITEM_F(ICON_FilUnload, MSG_FILAMENTUNLOAD, onDrawMenuItem, UnloadFilament); + MENU_ITEM_F(ICON_FilLoad, MSG_FILAMENTLOAD, onDrawMenuItem, LoadFilament); #endif } - CurrentMenu->draw(); + UpdateMenu(FilamentMenu); } #endif #if ENABLED(MESH_BED_LEVELING) void Draw_ManualMesh_Menu() { checkkey = Menu; - if (!ManualMesh) ManualMesh = new MenuClass(); - if (CurrentMenu != ManualMesh) { - CurrentMenu = ManualMesh; - SetMenuTitle({0}, GET_TEXT_F(MSG_MANUAL_MESH)); // TODO: Chinese, English "Manual Mesh Leveling" JPG - DWINUI::MenuItemsPrepare(6); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); - MENU_ITEM(ICON_ManualMesh, GET_TEXT_F(MSG_LEVEL_BED), onDrawMenuItem, ManualMeshStart); - MMeshMoveZItem = EDIT_ITEM(ICON_Zoffset, GET_TEXT_F(MSG_MOVE_Z), onDrawMMeshMoveZ, SetMMeshMoveZ, ¤t_position.z); - MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_UBL_CONTINUE_MESH), onDrawMenuItem, ManualMeshContinue); - MENU_ITEM(ICON_MeshViewer, GET_TEXT_F(MSG_MESH_VIEW), onDrawSubMenu, DWIN_MeshViewer); - MENU_ITEM(ICON_MeshSave, GET_TEXT_F(MSG_UBL_SAVE_MESH), onDrawMenuItem, ManualMeshSave); + if (SetMenu(ManualMesh, GET_TEXT_F(MSG_UBL_MANUAL_MESH), 6)) { + BACK_ITEM(Draw_Prepare_Menu); + MENU_ITEM_F(ICON_ManualMesh, MSG_LEVEL_BED, onDrawMenuItem, ManualMeshStart); + MMeshMoveZItem = EDIT_ITEM_F(ICON_Zoffset, MSG_MOVE_Z, onDrawMMeshMoveZ, SetMMeshMoveZ, ¤t_position.z); + MENU_ITEM_F(ICON_Axis, MSG_UBL_CONTINUE_MESH, onDrawMenuItem, ManualMeshContinue); + MENU_ITEM_F(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, DWIN_MeshViewer); + MENU_ITEM_F(ICON_MeshSave, MSG_UBL_SAVE_MESH, onDrawMenuItem, ManualMeshSave); } - CurrentMenu->draw(); + UpdateMenu(ManualMesh); } #endif @@ -3384,42 +3360,43 @@ void Draw_Motion_Menu() { if (CurrentMenu != PreheatMenu) { CurrentMenu = PreheatMenu; SetMenuTitle(cn, fstr); - DWINUI::MenuItemsPrepare(5); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Temperature_Menu); + MenuItemsPrepare(5); + BACK_ITEM(Draw_Temperature_Menu); #if HAS_HOTEND - EDIT_ITEM(ICON_SetEndTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawSetPreheatHotend, SetPreheatEndTemp, &ui.material_preset[HMI_value.Preheat].hotend_temp); + EDIT_ITEM_F(ICON_SetEndTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawSetPreheatHotend, SetPreheatEndTemp, &ui.material_preset[HMI_value.Select].hotend_temp); #endif #if HAS_HEATED_BED - EDIT_ITEM(ICON_SetBedTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawSetPreheatBed, SetPreheatBedTemp, &ui.material_preset[HMI_value.Preheat].bed_temp); + EDIT_ITEM_F(ICON_SetBedTemp, MSG_UBL_SET_TEMP_BED, onDrawSetPreheatBed, SetPreheatBedTemp, &ui.material_preset[HMI_value.Select].bed_temp); #endif #if HAS_FAN - EDIT_ITEM(ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED), onDrawSetPreheatFan, SetPreheatFanSpeed, &ui.material_preset[HMI_value.Preheat].fan_speed); + EDIT_ITEM_F(ICON_FanSpeed, MSG_FAN_SPEED, onDrawSetPreheatFan, SetPreheatFanSpeed, &ui.material_preset[HMI_value.Select].fan_speed); #endif #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawWriteEeprom, WriteEeprom); + MENU_ITEM_F(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawWriteEeprom, WriteEeprom); #endif } CurrentMenu->draw(); } void Draw_Preheat1_Menu() { - HMI_value.Preheat = 0; + HMI_value.Select = 0; if (!PreheatMenu) PreheatMenu = new MenuClass(); 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) PreheatMenu = new MenuClass(); - Draw_Preheat_Menu({142, 16, 82, 14}, F(PREHEAT_2_LABEL " Preheat Settings")); // TODO: English "ABS Settings" JPG - } + #if PREHEAT_COUNT >= 2 + void Draw_Preheat2_Menu() { + HMI_value.Select = 1; + if (!PreheatMenu) PreheatMenu = new MenuClass(); + Draw_Preheat_Menu({142, 16, 82, 14}, F(PREHEAT_2_LABEL " Preheat Settings")); // TODO: English "ABS Settings" JPG + } + #endif - #ifdef PREHEAT_3_LABEL + #if PREHEAT_COUNT >= 3 void Draw_Preheat3_Menu() { - HMI_value.Preheat = 2; + HMI_value.Select = 2; if (!PreheatMenu) PreheatMenu = new MenuClass(); - #define PREHEAT_3_TITLE PREHEAT_3_LABEL " Preheat Set." - Draw_Preheat_Menu({0}, F(PREHEAT_3_TITLE)); // TODO: Chinese, English "Custom Preheat Settings" JPG + Draw_Preheat_Menu({225, 16, 82, 14}, F(PREHEAT_3_LABEL " Preheat Settings")); // TODO: English "... Settings" JPG } #endif @@ -3431,22 +3408,24 @@ void Draw_Temperature_Menu() { if (CurrentMenu != TemperatureMenu) { CurrentMenu = TemperatureMenu; SetMenuTitle({236, 2, 28, 12}, GET_TEXT_F(MSG_TEMPERATURE)); - DWINUI::MenuItemsPrepare(7); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); + MenuItemsPrepare(7); + BACK_ITEM(Draw_Control_Menu); #if HAS_HOTEND - HotendTargetItem = EDIT_ITEM(ICON_SetEndTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); + HotendTargetItem = EDIT_ITEM_F(ICON_SetEndTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); #endif #if HAS_HEATED_BED - BedTargetItem = EDIT_ITEM(ICON_SetBedTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); + BedTargetItem = EDIT_ITEM_F(ICON_SetBedTemp, MSG_UBL_SET_TEMP_BED, onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); #endif #if HAS_FAN - FanSpeedItem = EDIT_ITEM(ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED), onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); + FanSpeedItem = EDIT_ITEM_F(ICON_FanSpeed, MSG_FAN_SPEED, onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); #endif - #if HAS_HOTEND - MENU_ITEM(ICON_SetPLAPreheat, F(PREHEAT_1_LABEL " Preheat Settings"), onDrawPLAPreheatSubMenu, Draw_Preheat1_Menu); - MENU_ITEM(ICON_SetABSPreheat, F(PREHEAT_2_LABEL " Preheat Settings"), onDrawABSPreheatSubMenu, Draw_Preheat2_Menu); - #ifdef PREHEAT_3_LABEL - MENU_ITEM(ICON_SetCustomPreheat, PREHEAT_3_TITLE, onDrawSubMenu, Draw_Preheat3_Menu); + #if HAS_PREHEAT + MENU_ITEM_F(ICON_SetPLAPreheat, MSG_PREHEAT_1_SETTINGS, onDrawPLAPreheatSubMenu, Draw_Preheat1_Menu); + #if PREHEAT_COUNT >= 2 + MENU_ITEM_F(ICON_SetABSPreheat, MSG_PREHEAT_2_SETTINGS, onDrawABSPreheatSubMenu, Draw_Preheat2_Menu); + #if PREHEAT_COUNT >= 3 + MENU_ITEM_F(ICON_SetCustomPreheat, MSG_PREHEAT_3_SETTINGS, onDrawSubMenu, Draw_Preheat3_Menu); + #endif #endif #endif } @@ -3459,13 +3438,13 @@ void Draw_MaxSpeed_Menu() { if (CurrentMenu != MaxSpeedMenu) { CurrentMenu = MaxSpeedMenu; SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MAXSPEED)); - DWINUI::MenuItemsPrepare(5); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); - EDIT_ITEM(ICON_MaxSpeedX, GET_TEXT_F(MSG_MAXSPEED_X), onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); - EDIT_ITEM(ICON_MaxSpeedY, GET_TEXT_F(MSG_MAXSPEED_Y), onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); - EDIT_ITEM(ICON_MaxSpeedZ, GET_TEXT_F(MSG_MAXSPEED_Z), onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); + MenuItemsPrepare(5); + BACK_ITEM(Draw_Motion_Menu); + EDIT_ITEM_F(ICON_MaxSpeedX, MSG_MAXSPEED_X, onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedY, MSG_MAXSPEED_Y, onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedZ, MSG_MAXSPEED_Z, onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); #if HAS_HOTEND - EDIT_ITEM(ICON_MaxSpeedE, GET_TEXT_F(MSG_MAXSPEED_E), onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[E_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedE, MSG_MAXSPEED_E, onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[E_AXIS]); #endif } CurrentMenu->draw(); @@ -3477,13 +3456,13 @@ void Draw_MaxAccel_Menu() { if (CurrentMenu != MaxAccelMenu) { CurrentMenu = MaxAccelMenu; SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_ACCELERATION)); - DWINUI::MenuItemsPrepare(5); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); - EDIT_ITEM(ICON_MaxAccX, GET_TEXT_F(MSG_AMAX_A), onDrawMaxAccelX, SetMaxAccelX, &planner.settings.max_acceleration_mm_per_s2[X_AXIS]); - EDIT_ITEM(ICON_MaxAccY, GET_TEXT_F(MSG_AMAX_B), onDrawMaxAccelY, SetMaxAccelY, &planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); - EDIT_ITEM(ICON_MaxAccZ, GET_TEXT_F(MSG_AMAX_C), onDrawMaxAccelZ, SetMaxAccelZ, &planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); + MenuItemsPrepare(5); + BACK_ITEM(Draw_Motion_Menu); + EDIT_ITEM_F(ICON_MaxAccX, MSG_AMAX_A, onDrawMaxAccelX, SetMaxAccelX, &planner.settings.max_acceleration_mm_per_s2[X_AXIS]); + EDIT_ITEM_F(ICON_MaxAccY, MSG_AMAX_B, onDrawMaxAccelY, SetMaxAccelY, &planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); + EDIT_ITEM_F(ICON_MaxAccZ, MSG_AMAX_C, onDrawMaxAccelZ, SetMaxAccelZ, &planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); #if HAS_HOTEND - EDIT_ITEM(ICON_MaxAccE, GET_TEXT_F(MSG_AMAX_E), onDrawMaxAccelE, SetMaxAccelE, &planner.settings.max_acceleration_mm_per_s2[E_AXIS]); + EDIT_ITEM_F(ICON_MaxAccE, MSG_AMAX_E, onDrawMaxAccelE, SetMaxAccelE, &planner.settings.max_acceleration_mm_per_s2[E_AXIS]); #endif } CurrentMenu->draw(); @@ -3496,13 +3475,13 @@ void Draw_MaxAccel_Menu() { if (CurrentMenu != MaxJerkMenu) { CurrentMenu = MaxJerkMenu; SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_JERK)); - DWINUI::MenuItemsPrepare(5); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); - EDIT_ITEM(ICON_MaxSpeedJerkX, GET_TEXT_F(MSG_VA_JERK), onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk[X_AXIS]); - EDIT_ITEM(ICON_MaxSpeedJerkY, GET_TEXT_F(MSG_VB_JERK), onDrawMaxJerkY, SetMaxJerkY, &planner.max_jerk[Y_AXIS]); - EDIT_ITEM(ICON_MaxSpeedJerkZ, GET_TEXT_F(MSG_VC_JERK), onDrawMaxJerkZ, SetMaxJerkZ, &planner.max_jerk[Z_AXIS]); + MenuItemsPrepare(5); + BACK_ITEM(Draw_Motion_Menu); + EDIT_ITEM_F(ICON_MaxSpeedJerkX, MSG_VA_JERK, onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk[X_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedJerkY, MSG_VB_JERK, onDrawMaxJerkY, SetMaxJerkY, &planner.max_jerk[Y_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedJerkZ, MSG_VC_JERK, onDrawMaxJerkZ, SetMaxJerkZ, &planner.max_jerk[Z_AXIS]); #if HAS_HOTEND - EDIT_ITEM(ICON_MaxSpeedJerkE, GET_TEXT_F(MSG_VE_JERK), onDrawMaxJerkE, SetMaxJerkE, &planner.max_jerk[E_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedJerkE, MSG_VE_JERK, onDrawMaxJerkE, SetMaxJerkE, &planner.max_jerk[E_AXIS]); #endif } CurrentMenu->draw(); @@ -3515,13 +3494,13 @@ void Draw_Steps_Menu() { if (CurrentMenu != StepsMenu) { CurrentMenu = StepsMenu; SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_STEPS_PER_MM)); - DWINUI::MenuItemsPrepare(5); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); - EDIT_ITEM(ICON_StepX, GET_TEXT_F(MSG_A_STEPS), onDrawStepsX, SetStepsX, &planner.settings.axis_steps_per_mm[X_AXIS]); - EDIT_ITEM(ICON_StepY, GET_TEXT_F(MSG_B_STEPS), onDrawStepsY, SetStepsY, &planner.settings.axis_steps_per_mm[Y_AXIS]); - EDIT_ITEM(ICON_StepZ, GET_TEXT_F(MSG_C_STEPS), onDrawStepsZ, SetStepsZ, &planner.settings.axis_steps_per_mm[Z_AXIS]); + MenuItemsPrepare(5); + BACK_ITEM(Draw_Motion_Menu); + EDIT_ITEM_F(ICON_StepX, MSG_A_STEPS, onDrawStepsX, SetStepsX, &planner.settings.axis_steps_per_mm[X_AXIS]); + EDIT_ITEM_F(ICON_StepY, MSG_B_STEPS, onDrawStepsY, SetStepsY, &planner.settings.axis_steps_per_mm[Y_AXIS]); + EDIT_ITEM_F(ICON_StepZ, MSG_C_STEPS, onDrawStepsZ, SetStepsZ, &planner.settings.axis_steps_per_mm[Z_AXIS]); #if HAS_HOTEND - EDIT_ITEM(ICON_StepE, GET_TEXT_F(MSG_E_STEPS), onDrawStepsE, SetStepsE, &planner.settings.axis_steps_per_mm[E_AXIS]); + EDIT_ITEM_F(ICON_StepE, MSG_E_STEPS, onDrawStepsE, SetStepsE, &planner.settings.axis_steps_per_mm[E_AXIS]); #endif } CurrentMenu->draw(); @@ -3530,63 +3509,51 @@ void Draw_Steps_Menu() { #if HAS_HOTEND void Draw_HotendPID_Menu() { checkkey = Menu; - if (!HotendPIDMenu) HotendPIDMenu = new MenuClass(); - if (CurrentMenu != HotendPIDMenu) { - CurrentMenu = HotendPIDMenu; - CurrentMenu->MenuTitle.SetCaption(F("Hotend PID Settings")); - DWINUI::MenuItemsPrepare(8); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_AdvancedSettings_Menu); - MENU_ITEM(ICON_PIDNozzle, F("Hotend PID"), onDrawMenuItem, HotendPID); + if (SetMenu(HotendPIDMenu, F(STR_HOTEND_PID " Settings"),8)) { + BACK_ITEM(Draw_AdvancedSettings_Menu); + MENU_ITEM(ICON_PIDNozzle, F(STR_HOTEND_PID), onDrawMenuItem, HotendPID); EDIT_ITEM(ICON_PIDValue, F("Set" STR_KP), onDrawPFloat2Menu, SetKp, &thermalManager.temp_hotend[0].pid.Kp); EDIT_ITEM(ICON_PIDValue, F("Set" STR_KI), onDrawPIDi, SetKi, &thermalManager.temp_hotend[0].pid.Ki); EDIT_ITEM(ICON_PIDValue, F("Set" STR_KD), onDrawPIDd, SetKd, &thermalManager.temp_hotend[0].pid.Kd); - EDIT_ITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawPIntMenu, SetHotendPidT, &HMI_data.HotendPidT); - EDIT_ITEM(ICON_PIDcycles, GET_TEXT_F(MSG_PID_CYCLE), onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); + EDIT_ITEM_F(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, SetHotendPidT, &HMI_data.HotendPidT); + EDIT_ITEM_F(ICON_PIDcycles, MSG_PID_CYCLE, onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawMenuItem, WriteEeprom); + MENU_ITEM_F(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); #endif } - CurrentMenu->draw(); + UpdateMenu(HotendPIDMenu); } #endif #if HAS_HEATED_BED void Draw_BedPID_Menu() { checkkey = Menu; - if (!BedPIDMenu) BedPIDMenu = new MenuClass(); - if (CurrentMenu != BedPIDMenu) { - CurrentMenu = BedPIDMenu; - CurrentMenu->MenuTitle.SetCaption(F("Bed PID Settings")); - DWINUI::MenuItemsPrepare(8); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_AdvancedSettings_Menu); - MENU_ITEM(ICON_PIDNozzle, F("Bed PID"), onDrawMenuItem,BedPID); + if (SetMenu(BedPIDMenu, F(STR_BED_PID " Settings"),8)) { + BACK_ITEM(Draw_AdvancedSettings_Menu); + MENU_ITEM(ICON_PIDNozzle, F(STR_BED_PID), onDrawMenuItem,BedPID); EDIT_ITEM(ICON_PIDValue, F("Set" STR_KP), onDrawPFloat2Menu, SetKp, &thermalManager.temp_bed.pid.Kp); EDIT_ITEM(ICON_PIDValue, F("Set" STR_KI), onDrawPIDi, SetKi, &thermalManager.temp_bed.pid.Ki); EDIT_ITEM(ICON_PIDValue, F("Set" STR_KD), onDrawPIDd, SetKd, &thermalManager.temp_bed.pid.Kd); - EDIT_ITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawPIntMenu, SetBedPidT, &HMI_data.BedPidT); - EDIT_ITEM(ICON_PIDcycles, GET_TEXT_F(MSG_PID_CYCLE), onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); + EDIT_ITEM_F(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, SetBedPidT, &HMI_data.BedPidT); + EDIT_ITEM_F(ICON_PIDcycles, MSG_PID_CYCLE, onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawMenuItem, WriteEeprom); + MENU_ITEM_F(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); #endif } - CurrentMenu->draw(); + UpdateMenu(BedPIDMenu); } #endif -#if HAS_BED_PROBE +#if ENABLED(BABYSTEP_ZPROBE_OFFSET) void Draw_ZOffsetWiz_Menu() { checkkey = Menu; - if (!ZOffsetWizMenu) ZOffsetWizMenu = new MenuClass(); - if (CurrentMenu != ZOffsetWizMenu) { - CurrentMenu = ZOffsetWizMenu; - CurrentMenu->MenuTitle.SetCaption(GET_TEXT_F(MSG_PROBE_WIZARD)); - DWINUI::MenuItemsPrepare(4); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_Prepare_Menu); - MENU_ITEM(ICON_Homing, GET_TEXT_F(MSG_AUTO_HOME), onDrawMenuItem, AutoHome); + if (SetMenu(ZOffsetWizMenu, GET_TEXT_F(MSG_PROBE_WIZARD), 4)) { + BACK_ITEM(Draw_Prepare_Menu); + MENU_ITEM_F(ICON_Homing, MSG_AUTO_HOME, onDrawMenuItem, AutoHome); MENU_ITEM(ICON_MoveZ0, F("Move Z to Home"), onDrawMenuItem, SetMoveZto0); - EDIT_ITEM(ICON_Zoffset, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); + EDIT_ITEM_F(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); } - CurrentMenu->draw(); + UpdateMenu(ZOffsetWizMenu); if (!axis_is_trusted(Z_AXIS)) LCD_MESSAGE_F("WARNING: Z position unknown, move Z to home"); } #endif @@ -3594,19 +3561,165 @@ void Draw_Steps_Menu() { #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) void Draw_Homing_Menu() { checkkey = Menu; - if (!HomingMenu) HomingMenu = new MenuClass(); - if (CurrentMenu != HomingMenu) { - CurrentMenu = HomingMenu; - CurrentMenu->MenuTitle.SetCaption(GET_TEXT_F(MSG_HOMING)); - DWINUI::MenuItemsPrepare(5); - MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_Prepare_Menu); - MENU_ITEM(ICON_Homing, GET_TEXT_F(MSG_AUTO_HOME), onDrawMenuItem, AutoHome); - MENU_ITEM(ICON_HomeX, GET_TEXT_F(MSG_AUTO_HOME_X), onDrawMenuItem, HomeX); - MENU_ITEM(ICON_HomeY, GET_TEXT_F(MSG_AUTO_HOME_Y), onDrawMenuItem, HomeY); - MENU_ITEM(ICON_HomeZ, GET_TEXT_F(MSG_AUTO_HOME_Z), onDrawMenuItem, HomeZ); + if (SetMenu(HomingMenu, GET_TEXT_F(MSG_HOMING), 5)) { + BACK_ITEM(Draw_Prepare_Menu); + MENU_ITEM_F(ICON_Homing, MSG_AUTO_HOME, onDrawMenuItem, AutoHome); + MENU_ITEM_F(ICON_HomeX, MSG_AUTO_HOME_X, onDrawMenuItem, HomeX); + MENU_ITEM_F(ICON_HomeY, MSG_AUTO_HOME_Y, onDrawMenuItem, HomeY); + MENU_ITEM_F(ICON_HomeZ, MSG_AUTO_HOME_Z, onDrawMenuItem, HomeZ); } - CurrentMenu->draw(); + UpdateMenu(HomingMenu); + } +#endif + +#if ENABLED(FWRETRACT) + void Draw_FWRetract_Menu() { + checkkey = Menu; + if (SetMenu(FWRetractMenu, GET_TEXT_F(MSG_FWRETRACT), 6)) { + BACK_ITEM(Return_FWRetract_Menu); + EDIT_ITEM_F(ICON_FWRetLength, MSG_CONTROL_RETRACT, onDrawPFloatMenu, SetRetractLength, &fwretract.settings.retract_length); + EDIT_ITEM_F(ICON_FWRetSpeed, MSG_SINGLENOZZLE_RETRACT_SPEED, onDrawPFloatMenu, SetRetractSpeed, &fwretract.settings.retract_feedrate_mm_s); + EDIT_ITEM_F(ICON_FWRetZRaise, MSG_CONTROL_RETRACT_ZHOP, onDrawPFloat2Menu, SetZRaise, &fwretract.settings.retract_zraise); + EDIT_ITEM_F(ICON_FWRecSpeed, MSG_SINGLENOZZLE_UNRETRACT_SPEED, onDrawPFloatMenu, SetRecoverSpeed, &fwretract.settings.retract_recover_feedrate_mm_s); + EDIT_ITEM_F(ICON_FWRecExtra, MSG_CONTROL_RETRACT_RECOVER, onDrawPFloatMenu, SetAddRecover, &fwretract.settings.retract_recover_extra); + } + UpdateMenu(FWRetractMenu); + } +#endif + +//============================================================================= +// Mesh Bed Leveling +//============================================================================= + +#if HAS_MESH + + void ApplyMeshFadeHeight() { set_z_fade_height(planner.z_fade_height); } + void SetMeshFadeHeight() { SetPFloatOnClick(0, 100, 1, ApplyMeshFadeHeight); } + + void SetMeshActive() { + set_bed_leveling_enabled(!planner.leveling_active); + Draw_Chkb_Line(CurrentMenu->line(), planner.leveling_active); + DWIN_UpdateLCD(); } + + #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) + void SetBedLevT() { SetPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } + #endif + + uint8_t mesh_x = 0; + uint8_t mesh_y = 0; + #define Z_OFFSET_MIN -3 + #define Z_OFFSET_MAX 3 + + void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &Z_VALUES_ARR[HMI_value.Select ? mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : mesh_y]; EditZValueItem->redraw(); } + void ApplyEditMeshX() { mesh_x = MenuData.Value; } + void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, mesh_x, ApplyEditMeshX, LiveEditMesh); } + void ApplyEditMeshY() { mesh_y = MenuData.Value; } + void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, mesh_y, ApplyEditMeshY, LiveEditMesh); } + void SetEditZValue() { SetPFloatOnClick(Z_OFFSET_MIN, Z_OFFSET_MAX, 3); } + #endif +#if ENABLED(AUTO_BED_LEVELING_UBL) + + void ApplyUBLSlot() { ubl.storage_slot = MenuData.Value; } + void SetUBLSlot() { SetIntOnClick(0, settings.calc_num_meshes() - 1, ubl.storage_slot, ApplyUBLSlot); } + void onDrawUBLSlot(MenuItemClass* menuitem, int8_t line) { + if (ubl.storage_slot < 0) ubl.storage_slot = 0; + onDrawIntMenu(menuitem, line, ubl.storage_slot); + } + + void ApplyUBLTiltGrid() { ubl_tools.tilt_grid = MenuData.Value; } + void SetUBLTiltGrid() { SetIntOnClick(1, 3, ubl_tools.tilt_grid, ApplyUBLTiltGrid); } + + void UBLTiltMesh() { + if (ubl.storage_slot < 0) ubl.storage_slot = 0; + char buf[15]; + if (ubl_tools.tilt_grid > 1) { + sprintf_P(buf, PSTR("G28O\nG29 J%i"), ubl_tools.tilt_grid); + gcode.process_subcommands_now(buf); + } + else + gcode.process_subcommands_now(F("G28O\nG29J")); + LCD_MESSAGE(MSG_UBL_MESH_TILTED); + } + + void UBLSmartFillMesh() { + ubl.smart_fill_mesh(); + LCD_MESSAGE(MSG_UBL_MESH_FILLED); + } + + bool UBLValidMesh() { + const bool valid = ubl_tools.validate(); + if (!valid) ubl.invalidate(); + return valid; + } + + void UBLSaveMesh() { + if (ubl.storage_slot < 0) ubl.storage_slot = 0; + settings.store_mesh(ubl.storage_slot); + ui.status_printf(0, GET_TEXT_F(MSG_MESH_SAVED), ubl.storage_slot); + DONE_BUZZ(true); + } + + void UBLLoadMesh() { + if (ubl.storage_slot < 0) ubl.storage_slot = 0; + settings.load_mesh(ubl.storage_slot); + if (UBLValidMesh()) { + ui.status_printf(0, GET_TEXT_F(MSG_MESH_LOADED), ubl.storage_slot); + DONE_BUZZ(true); + } + else { + LCD_MESSAGE_F("Invalid Mesh Loaded"); + DONE_BUZZ(false); + } + } + +#endif // AUTO_BED_LEVELING_UBL + +#if HAS_MESH + void Draw_MeshSet_Menu() { + checkkey = Menu; + if (SetMenu(MeshMenu, GET_TEXT_F(MSG_MESH_LEVELING), 15)) { + BACK_ITEM(Draw_AdvancedSettings_Menu); + #if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING) + EDIT_ITEM_F(ICON_Temperature, MSG_UBL_SET_TEMP_BED, onDrawPIntMenu, SetBedLevT, &HMI_data.BedLevT); + #endif + EDIT_ITEM_F(ICON_SetZOffset, MSG_Z_FADE_HEIGHT, onDrawPFloatMenu, SetMeshFadeHeight, &planner.z_fade_height); + EDIT_ITEM_F(ICON_UBLActive, MSG_ACTIVATE_MESH, onDrawChkbMenu, SetMeshActive, &planner.leveling_active); + #if HAS_BED_PROBE + MENU_ITEM_F(ICON_Level, MSG_AUTO_MESH, onDrawMenuItem, AutoLev); + #endif + #if ENABLED(AUTO_BED_LEVELING_UBL) + EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_STORAGE_SLOT, onDrawUBLSlot, SetUBLSlot, &ubl.storage_slot); + MENU_ITEM_F(ICON_UBLActive, MSG_UBL_SAVE_MESH, onDrawMenuItem, UBLSaveMesh); + MENU_ITEM_F(ICON_UBLActive, MSG_UBL_LOAD_MESH, onDrawMenuItem, UBLLoadMesh); + EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_TILTING_GRID, onDrawPInt8Menu, SetUBLTiltGrid, &ubl_tools.tilt_grid); + MENU_ITEM_F(ICON_UBLActive, MSG_UBL_TILT_MESH, onDrawMenuItem, UBLTiltMesh); + MENU_ITEM_F(ICON_UBLActive, MSG_UBL_SMART_FILLIN, onDrawMenuItem, UBLSmartFillMesh); + #endif + #if ENABLED(MESH_EDIT_MENU) + MENU_ITEM_F(ICON_UBLActive, MSG_EDIT_MESH, onDrawSubMenu, Draw_EditMesh_Menu); + #endif + MENU_ITEM_F(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, DWIN_MeshViewer); + } + UpdateMenu(MeshMenu); + } + + #if ENABLED(MESH_EDIT_MENU) + void Draw_EditMesh_Menu() { + checkkey = Menu; + if (SetMenu(EditMeshMenu, GET_TEXT_F(MSG_EDIT_MESH), 4)) { + mesh_x = mesh_y = 0; + BACK_ITEM(Draw_MeshSet_Menu); + EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_X, onDrawPInt8Menu, SetEditMeshX, &mesh_x); + EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_Y, onDrawPInt8Menu, SetEditMeshY, &mesh_y); + EditZValueItem = EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_EDIT_Z, onDrawPFloat3Menu, SetEditZValue, &Z_VALUES_ARR[mesh_x][mesh_y]); + } + UpdateMenu(EditMeshMenu); + } + #endif + +#endif // HAS_MESH + #endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 3219171a1160..f4e550295ea5 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -24,8 +24,8 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.15.2 - * Date: 2022/03/01 + * Version: 3.17.2 + * Date: 2022/04/08 */ #include "dwin_defines.h" @@ -73,12 +73,13 @@ enum pidresult_t : uint8_t { typedef struct { int8_t Color[3]; // Color components pidresult_t pidresult = PID_DONE; - int8_t Preheat = 0; // Material Select 0: PLA, 1: ABS, 2: Custom + uint8_t Select = 0; // Auxiliary selector variable AxisEnum axis = X_AXIS; // Axis Select } HMI_value_t; typedef struct { uint8_t language; + bool percent_flag:1; // percent was override by M73 bool remain_flag:1; // remain was override by M73 bool pause_flag:1; // printing is paused bool pause_action:1; // flag a pause action @@ -103,9 +104,53 @@ extern millis_t dwin_heat_time; void Popup_PowerLossRecovery(); #endif -// SD Card -void HMI_SDCardInit(); -void HMI_SDCardUpdate(); +// Tool Functions +#if ENABLED(EEPROM_SETTINGS) + void WriteEeprom(); + void ReadEeprom(); + void ResetEeprom(); + #if HAS_MESH + void SaveMesh(); + #endif +#endif +void RebootPrinter(); +void DisableMotors(); +void AutoLev(); +void AutoHome(); +#if HAS_PREHEAT + void DoPreheat0(); + void DoPreheat1(); + void DoPreheat2(); +#endif +void DoCoolDown(); +#if HAS_HOTEND + void HotendPID(); +#endif +#if HAS_HEATED_BED + void BedPID(); +#endif +#if ENABLED(BAUD_RATE_GCODE) + void HMI_SetBaudRate(); + void SetBaud115K(); + void SetBaud250K(); +#endif +#if HAS_LCD_BRIGHTNESS + void TurnOffBacklight(); +#endif +void ApplyExtMinT(); +void ParkHead(); +#if HAS_ONESTEP_LEVELING + void Trammingwizard(); +#endif +#if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) + void ApplyLEDColor(); +#endif +#if ENABLED(AUTO_BED_LEVELING_UBL) + void UBLTiltMesh(); + bool UBLValidMesh(); + void UBLSaveMesh(); + void UBLLoadMesh(); +#endif // Other void Goto_PrintProcess(); @@ -114,29 +159,19 @@ void Goto_Info_Menu(); void Goto_PowerLossRecovery(); void Goto_ConfirmToPrint(); void DWIN_Draw_Dashboard(const bool with_update); // Status Area -void Draw_Main_Area(); // Redraw main area; -void DWIN_RedrawScreen(); // Redraw all screen elements +void Draw_Main_Area(); // Redraw main area +void DWIN_DrawStatusLine(const char *text); // Draw simple status text +void DWIN_DrawStatusLine(FSTR_P fstr); +void DWIN_RedrawDash(); // Redraw Dash and Status line +void DWIN_RedrawScreen(); // Redraw all screen elements void HMI_MainMenu(); // Main process screen void HMI_SelectFile(); // File page void HMI_Printing(); // Print page void HMI_ReturnScreen(); // Return to previous screen before popups -void ApplyExtMinT(); -void HMI_SetLanguageCache(); // Set the languaje image cache -void RebootPrinter(); -#if ENABLED(BAUD_RATE_GCODE) - void HMI_SetBaudRate(); - void SetBaud115K(); - void SetBaud250K(); -#endif -#if ENABLED(EEPROM_SETTINGS) - void WriteEeprom(); - void ReadEeprom(); - void ResetEeprom(); -#endif - void HMI_WaitForUser(); void HMI_SaveProcessID(const uint8_t id); -void HMI_AudioFeedback(const bool success=true); +void HMI_SDCardInit(); +void HMI_SDCardUpdate(); void EachMomentUpdate(); void update_variable(); void DWIN_InitScreen(); @@ -248,3 +283,12 @@ void Draw_Steps_Menu(); #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) void Draw_Homing_Menu(); #endif +#if ENABLED(FWRETRACT) + void Draw_FWRetract_Menu(); +#endif +#if HAS_MESH + void Draw_MeshSet_Menu(); + #if ENABLED(MESH_EDIT_MENU) + void Draw_EditMesh_Menu(); + #endif +#endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 1e361c8c1133..bfeb06d76341 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -34,6 +34,23 @@ #include "../../../inc/MarlinConfigPre.h" #include +#define HAS_ESDIAG 1 +#if defined(__STM32F1__) || defined(STM32F1) + #define DASH_REDRAW 1 +#endif + +#if DISABLED(LIMITED_MAX_FR_EDITING) + #error "LIMITED_MAX_FR_EDITING is required with ProUI." +#endif +#if DISABLED(LIMITED_MAX_ACCEL_EDITING) + #error "LIMITED_MAX_ACCEL_EDITING is required with ProUI." +#endif +#if ENABLED(CLASSIC_JERK) && DISABLED(LIMITED_JERK_EDITING) + #error "LIMITED_JERK_EDITING is required with ProUI." +#endif +#if DISABLED(FILAMENT_RUNOUT_SENSOR) + #error "FILAMENT_RUNOUT_SENSOR is required with ProUI." +#endif #if DISABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) #error "INDIVIDUAL_AXIS_HOMING_SUBMENU is required with ProUI." #endif @@ -81,7 +98,7 @@ #define HAS_ESDIAG 1 #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) - #define Def_Leds_Color LEDColorWhite() + #define Def_Leds_Color 0xFFFFFFFF #endif #if ENABLED(CASELIGHT_USES_BRIGHTNESS) #define Def_CaseLight_Brightness 255 @@ -128,14 +145,13 @@ typedef struct { #endif bool FullManualTramming = false; // Led - #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) - LEDColor Led_Color = Def_Leds_Color; + #if ENABLED(MESH_BED_LEVELING) + float ManualZOffset = 0; #endif - // Case Light - #if ENABLED(CASELIGHT_USES_BRIGHTNESS) - uint8_t CaseLight_Brightness = Def_CaseLight_Brightness; + #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) + uint32_t LED_Color = Def_Leds_Color; #endif } HMI_data_t; -static constexpr size_t eeprom_data_size = 64; +static constexpr size_t eeprom_data_size = sizeof(HMI_data_t); extern HMI_data_t HMI_data; diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp index 3da3fc808624..f2cefe0cb745 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp @@ -23,8 +23,8 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.9.1 - * Date: 2022/02/08 + * Version: 3.10.1 + * Date: 2022/03/06 */ #include "../../../inc/MarlinConfigPre.h" @@ -35,54 +35,6 @@ #include "dwin_lcd.h" -/*---------------------------------------- Numeric related functions ----------------------------------------*/ - -// Draw a numeric value -// bShow: true=display background color; false=don't display background color -// zeroFill: true=zero fill; false=no zero fill -// signedMode: 1=signed; 0=unsigned -// zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space -// size: Font size -// color: Character color -// bColor: Background color -// iNum: Number of digits -// fNum: Number of decimal digits -// x/y: Upper-left coordinate -// value: Integer value -void DWIN_Draw_Value(uint8_t bShow, bool signedMode, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, - uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, int32_t value) { - size_t i = 0; - DWIN_Byte(i, 0x14); - // Bit 7: bshow - // Bit 6: 1 = signed; 0 = unsigned number; - // Bit 5: zeroFill - // Bit 4: zeroMode - // Bit 3-0: size - DWIN_Byte(i, (bShow * 0x80) | (signedMode * 0x40) | (zeroFill * 0x20) | (zeroMode * 0x10) | size); - DWIN_Word(i, color); - DWIN_Word(i, bColor); - DWIN_Byte(i, signedMode && (value >= 0) ? iNum + 1 : iNum); - DWIN_Byte(i, fNum); - DWIN_Word(i, x); - DWIN_Word(i, y); - // Write a big-endian 64 bit integer - const size_t p = i + 1; - for (size_t count = 8; count--;) { // 7..0 - ++i; - DWIN_SendBuf[p + count] = value; - value >>= 8; - } - DWIN_Send(i); -} - -// Draw a numeric value -// value: positive unscaled float value -void DWIN_Draw_Value(uint8_t bShow, bool signedMode, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, - uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - const int32_t val = round(value * POW(10, fNum)); - DWIN_Draw_Value(bShow, signedMode, zeroFill, zeroMode, size, color, bColor, iNum, fNum, x, y, val); -} - /*---------------------------------------- Picture related functions ----------------------------------------*/ // Display QR code diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.h b/Marlin/src/lcd/e3v2/proui/dwin_lcd.h index cdffb96f2f30..6e0a254db4ee 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.h @@ -24,30 +24,12 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.9.1 - * Date: 2022/02/08 + * Version: 3.10.1 + * Date: 2022/03/06 */ #include "../common/dwin_api.h" -// Draw a numeric value -// bShow: true=display background color; false=don't display background color -// zeroFill: true=zero fill; false=no zero fill -// signedMode: 1=signed; 0=unsigned -// zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space -// size: Font size -// color: Character color -// bColor: Background color -// iNum: Number of digits -// fNum: Number of decimal digits -// x/y: Upper-left coordinate -// value: Integer value -void DWIN_Draw_Value(uint8_t bShow, bool signedMode, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, - uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, int32_t value); -// value: positive unscaled float value -void DWIN_Draw_Value(uint8_t bShow, bool signedMode, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, - uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value); - // Display QR code // The size of the QR code is (46*QR_Pixel)*(46*QR_Pixel) dot matrix // QR_Pixel: The pixel size occupied by each point of the QR code: 0x01-0x0F (1-16) diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index e190fa06fbfe..ecb4754a0f35 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -23,8 +23,8 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.15.1 - * Date: 2022/02/25 + * Version: 3.17.1 + * Date: 2022/04/12 */ #include "../../../inc/MarlinConfigPre.h" @@ -39,12 +39,6 @@ //#define DEBUG_OUT 1 #include "../../../core/debug_out.h" -int8_t MenuItemTotal = 0; -int8_t MenuItemCount = 0; -MenuItemClass** MenuItems = nullptr; -MenuClass *CurrentMenu = nullptr; -MenuClass *PreviousMenu = nullptr; - xy_int_t DWINUI::cursor = { 0 }; uint16_t DWINUI::pencolor = Color_White; uint16_t DWINUI::textcolor = Def_Text_Color; @@ -53,16 +47,15 @@ uint16_t DWINUI::buttoncolor = Def_Button_Color; uint8_t DWINUI::font = font8x16; FSTR_P const DWINUI::Author = F(STRING_CONFIG_H_AUTHOR); -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; +void (*DWINUI::onTitleDraw)(TitleClass* title) = nullptr; void DWINUI::init() { - TERN_(DEBUG_DWIN, SERIAL_ECHOPGM("\r\nDWIN handshake ")); delay(750); // Delay for wait to wakeup screen - const bool hs = DWIN_Handshake(); - TERN(DEBUG_DWIN, SERIAL_ECHOLNF(hs ? F("ok.") : F("error.")), UNUSED(hs)); + const bool hs = DWIN_Handshake(); UNUSED(hs); + #if ENABLED(DEBUG_DWIN) + SERIAL_ECHOPGM("DWIN_Handshake "); + SERIAL_ECHOLNF(hs ? F("ok.") : F("error.")); + #endif DWIN_Frame_SetDir(1); cursor.reset(); pencolor = Color_White; @@ -164,16 +157,19 @@ void DWINUI::Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint1 DWIN_Draw_String(bShow, size, color, bColor, x, y, string); } -// // Draw a Centered string using DWIN_WIDTH -// void DWINUI::Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, const char * const string) { -// const int8_t x = _MAX(0U, DWIN_WIDTH - strlen_P(string) * fontWidth(size)) / 2 - 1; -// DWIN_Draw_String(bShow, size, color, bColor, x, y, string); -// } +// Draw a char +// color: Character color +// x: abscissa of the display +// y: ordinate of the display +// c: ASCII code of char +void DWINUI::Draw_Char(uint16_t color, uint16_t x, uint16_t y, const char c) { + const char string[2] = { c, 0}; + DWIN_Draw_String(false, font, color, backcolor, x, y, string, 1); +} -// Draw a char at cursor position +// Draw a char at cursor position and increment cursor void DWINUI::Draw_Char(uint16_t color, const char c) { - const char string[2] = { c, 0}; - DWIN_Draw_String(false, font, color, backcolor, cursor.x, cursor.y, string, 1); + Draw_Char(color, cursor.x, cursor.y, c); MoveBy(fontWidth(font), 0); } @@ -190,6 +186,36 @@ void DWINUI::Draw_String(uint16_t color, const char * const string, uint16_t rli MoveBy(strlen(string) * fontWidth(font), 0); } +// Draw a numeric integer value +// bShow: true=display background color; false=don't display background color +// signedMode: 1=signed; 0=unsigned +// size: Font size +// color: Character color +// bColor: Background color +// iNum: Number of digits +// x/y: Upper-left coordinate +// value: Integer value +void DWINUI::Draw_Int(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, int32_t value) { + char nstr[10]; + sprintf_P(nstr, PSTR("%*li"), (signedMode ? iNum + 1 : iNum), value); + DWIN_Draw_String(bShow, size, color, bColor, x, y, nstr); +} + +// Draw a numeric float value +// bShow: true=display background color; false=don't display background color +// signedMode: 1=signed; 0=unsigned +// size: Font size +// color: Character color +// bColor: Background color +// iNum: Number of digits +// fNum: Number of decimal digits +// x/y: Upper-left coordinate +// value: float value +void DWINUI::Draw_Float(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + char nstr[10]; + DWIN_Draw_String(bShow, size, color, bColor, x, y, dtostrf(value, iNum + (signedMode ? 2:1) + fNum, fNum, nstr)); +} + // ------------------------- Buttons ------------------------------// void DWINUI::Draw_Button(uint16_t color, uint16_t bcolor, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, const char * const caption) { @@ -204,6 +230,7 @@ void DWINUI::Draw_Button(uint8_t id, uint16_t x, uint16_t y) { case BTN_Continue: Draw_Button(GET_TEXT_F(MSG_BUTTON_CONTINUE), x, y); break; case BTN_Print : Draw_Button(GET_TEXT_F(MSG_BUTTON_PRINT), x, y); break; case BTN_Save : Draw_Button(GET_TEXT_F(MSG_BUTTON_SAVE), x, y); break; + case BTN_Purge : Draw_Button(GET_TEXT_F(MSG_BUTTON_PURGE), x, y); break; default: break; } } @@ -265,7 +292,7 @@ uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t colo return RGB(R, G, B); } -// Color Interpolator through Red->Yellow->Green->Blue +// Color Interpolator through Red->Yellow->Green->Blue (Pro UI) // val : Interpolator minv..maxv // minv : Minimum value // maxv : Maximum value @@ -308,33 +335,6 @@ void DWINUI::ClearMainArea() { DWIN_Draw_Rectangle(1, backcolor, 0, TITLE_HEIGHT, DWIN_WIDTH - 1, STATUS_Y - 1); } -void DWINUI::MenuItemsClear() { - if (MenuItems == nullptr) return; - for (int8_t i = 0; i < MenuItemCount; i++) delete MenuItems[i]; - delete[] MenuItems; - MenuItems = nullptr; - MenuItemCount = 0; - MenuItemTotal = 0; -} - -void DWINUI::MenuItemsPrepare(int8_t totalitems) { - MenuItemsClear(); - MenuItemTotal = totalitems; - MenuItems = new MenuItemClass*[totalitems]; -} - -MenuItemClass* DWINUI::MenuItemsAdd(MenuItemClass* menuitem) { - if (MenuItemCount < MenuItemTotal) { - MenuItems[MenuItemCount] = menuitem; - menuitem->pos = MenuItemCount++; - return menuitem; - } - else { - delete menuitem; - return nullptr; - } -} - /* Title Class ==============================================================*/ TitleClass Title; @@ -375,85 +375,4 @@ void TitleClass::FrameCopy(uint16_t x, uint16_t y, uint16_t w, uint16_t h) { FrameCopy(1, x, y, x + w - 1, y + h - 1); } -/* Menu Class ===============================================================*/ - -MenuClass::MenuClass() { - selected = 0; - topline = 0; -} - -void MenuClass::draw() { - MenuTitle.draw(); - if (DWINUI::onMenuDraw != nullptr) (*DWINUI::onMenuDraw)(this); - for (int8_t i = 0; i < MenuItemCount; i++) - MenuItems[i]->draw(i - topline); - if (DWINUI::onCursorDraw != nullptr) DWINUI::onCursorDraw(line()); - DWIN_UpdateLCD(); -} - -void MenuClass::onScroll(bool dir) { - int8_t sel = selected; - if (dir) sel++; else sel--; - LIMIT(sel, 0, MenuItemCount - 1); - if (sel != selected) { - if (DWINUI::onCursorErase != nullptr) DWINUI::onCursorErase(line()); - if ((sel - topline) == TROWS) { - DWIN_Frame_AreaMove(1, DWIN_SCROLL_UP, MLINE, DWINUI::backcolor, 0, TITLE_HEIGHT + 1, DWIN_WIDTH, STATUS_Y - 1); - topline++; - MenuItems[sel]->draw(TROWS - 1); - } - if ((sel < topline)) { - DWIN_Frame_AreaMove(1, DWIN_SCROLL_DOWN, MLINE, DWINUI::backcolor, 0, TITLE_HEIGHT + 1, DWIN_WIDTH, STATUS_Y - 1); - topline--; - MenuItems[sel]->draw(0); - } - selected = sel; - if (DWINUI::onCursorDraw != nullptr) DWINUI::onCursorDraw(line()); - DWIN_UpdateLCD(); - } -} - -void MenuClass::onClick() { - if (MenuItems[selected]->onClick != nullptr) (*MenuItems[selected]->onClick)(); -} - -MenuItemClass *MenuClass::SelectedItem() { - return MenuItems[selected]; -} - -/* MenuItem Class ===========================================================*/ - -MenuItemClass::MenuItemClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)()) { - icon = cicon; - onClick = onclick; - onDraw = ondraw; - const uint8_t len = _MIN(sizeof(caption) - 1, strlen(text)); - memcpy(&caption[0], text, len); - caption[len] = '\0'; -} - -MenuItemClass::MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)()) { - icon = cicon; - onClick = onclick; - onDraw = ondraw; - caption[0] = '\0'; - frameid = id; - frame = { x1, y1, x2, y2 }; -} - -void MenuItemClass::SetFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) { - caption[0] = '\0'; - frameid = id; - frame = { x1, y1, x2, y2 }; -} - -void MenuItemClass::draw(int8_t line) { - if (line < 0 || line >= TROWS) return; - if (onDraw != nullptr) (*onDraw)(this, line); -}; - -MenuItemPtrClass::MenuItemPtrClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) : MenuItemClass(cicon, text, ondraw, onclick) { - value = val; -}; - #endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index 6771c77d5d81..f8ff0917694d 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -24,8 +24,8 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.15.1 - * Date: 2022/02/25 + * Version: 3.17.1 + * Date: 2022/04/12 */ #include "dwin_lcd.h" @@ -37,6 +37,7 @@ #define ICON_AdvSet ICON_Language #define ICON_BedSizeX ICON_PrintSize #define ICON_BedSizeY ICON_PrintSize +#define ICON_BedTramming ICON_SetHome #define ICON_Binary ICON_Contact #define ICON_Brightness ICON_Motion #define ICON_Cancel ICON_StockConfiguration @@ -50,10 +51,12 @@ #define ICON_FilUnload ICON_ReadEEPROM #define ICON_Flow ICON_StepE #define ICON_Folder ICON_More +#define ICON_FWRetract ICON_StepE #define ICON_FWRetLength ICON_StepE #define ICON_FWRetSpeed ICON_Setspeed #define ICON_FWRetZRaise ICON_MoveZ #define ICON_FWRecSpeed ICON_Setspeed +#define ICON_FWRecExtra ICON_StepE #define ICON_HomeX ICON_MoveX #define ICON_HomeY ICON_MoveY #define ICON_HomeZ ICON_MoveZ @@ -102,6 +105,9 @@ #define ICON_SetBaudRate ICON_Setspeed #define ICON_SetCustomPreheat ICON_SetEndTemp #define ICON_Sound ICON_Cool +#define ICON_TBSetup ICON_Contact +#define ICON_UBLActive ICON_HotendTemp + #define ICON_CaseLight ICON_Motion #define ICON_LedControl ICON_Motion @@ -111,12 +117,27 @@ #define BTN_Confirm 89 #define BTN_Print 90 #define BTN_Save 91 +#define BTN_Purge 92 // Extended and default UI Colors #define Color_Black 0 #define Color_Green RGB(0,63,0) #define Color_Aqua RGB(0,63,31) #define Color_Blue RGB(0,0,31) +#define Color_Light_White 0xBDD7 +#define Color_Light_Green 0x3460 +#define Color_Cyan 0x07FF +#define Color_Light_Cyan 0x04F3 +#define Color_Light_Blue 0x3A6A +#define Color_Magenta 0xF81F +#define Color_Light_Magenta 0x9813 +#define Color_Light_Red 0x8800 +#define Color_Orange 0xFA20 +#define Color_Light_Orange 0xFBC0 +#define Color_Light_Yellow 0x8BE0 +#define Color_Brown 0xCC27 +#define Color_Light_Brown 0x6204 +#define Color_Grey 0x18E3 // UI element defines and constants #define DWIN_FONT_MENU font8x16 @@ -130,7 +151,7 @@ #define UNITFDIGITS 1 #define MINUNITMULT POW(10, UNITFDIGITS) -constexpr uint16_t TITLE_HEIGHT = 30, // Title bar height +constexpr uint8_t TITLE_HEIGHT = 30, // Title bar height MLINE = 53, // Menu line height TROWS = (STATUS_Y - TITLE_HEIGHT) / MLINE, // Total rows MROWS = TROWS - 1, // Other-than-Back @@ -149,10 +170,6 @@ constexpr uint16_t TITLE_HEIGHT = 30, // Title bar heig // Menuitem caption Y position #define MBASE(L) (MYPOS(L) + CAPOFF) -// Create and add a MenuItem object to the menu array -#define MENU_ITEM(V...) DWINUI::MenuItemsAdd(new MenuItemClass(V)) -#define EDIT_ITEM(V...) DWINUI::MenuItemsAdd(new MenuItemPtrClass(V)) - typedef struct { uint16_t left, top, right, bottom; } rect_t; typedef struct { uint16_t x, y, w, h; } frame_rect_t; @@ -173,49 +190,6 @@ class TitleClass { }; extern TitleClass Title; -class MenuItemClass { -protected: -public: - int8_t pos = 0; - uint8_t icon = 0; - char caption[32] = ""; - uint8_t frameid = 0; - rect_t frame = {0}; - void (*onDraw)(MenuItemClass* menuitem, int8_t line) = nullptr; - void (*onClick)() = nullptr; - MenuItemClass() {}; - MenuItemClass(uint8_t cicon, const char * const text=nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr); - MenuItemClass(uint8_t cicon, FSTR_P text = nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr) : MenuItemClass(cicon, FTOP(text), ondraw, onclick){} - MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr); - void SetFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); - virtual ~MenuItemClass(){}; - virtual void draw(int8_t line); -}; - -class MenuItemPtrClass: public MenuItemClass { -public: - void *value = nullptr; - using MenuItemClass::MenuItemClass; - MenuItemPtrClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val); - MenuItemPtrClass(uint8_t cicon, FSTR_P text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) : MenuItemPtrClass(cicon, FTOP(text), ondraw, onclick, val){} -}; - -class MenuClass { -public: - int8_t topline = 0; - int8_t selected = 0; - TitleClass MenuTitle; - MenuClass(); - virtual ~MenuClass(){}; - inline int8_t line() { return selected - topline; }; - inline int8_t line(uint8_t pos) {return pos - topline; }; - void draw(); - void onScroll(bool dir); - void onClick(); - MenuItemClass* SelectedItem(); -}; -extern MenuClass *CurrentMenu; - namespace DWINUI { extern xy_int_t cursor; extern uint16_t pencolor; @@ -225,10 +199,7 @@ namespace DWINUI { extern uint8_t font; extern FSTR_P const Author; - extern void (*onCursorErase)(const int8_t line); - extern void (*onCursorDraw)(const int8_t line); extern void (*onTitleDraw)(TitleClass* title); - extern void (*onMenuDraw)(MenuClass* menu); // DWIN LCD Initialization void init(); @@ -304,129 +275,121 @@ namespace DWINUI { DWIN_ICON_Show(true, false, false, ICON, icon, x, y); } - // Draw a positive integer + // Draw a numeric integer value // bShow: true=display background color; false=don't display background color - // zeroFill: true=zero fill; false=no zero fill - // zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space + // signedMode: 1=signed; 0=unsigned // size: Font size // color: Character color // bColor: Background color // iNum: Number of digits // x/y: Upper-left coordinate // value: Integer value - inline void Draw_Int(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_Value(bShow, 0, zeroFill, zeroMode, size, color, bColor, iNum, 0, x, y, value); + void Draw_Int(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, int32_t value); + + // Draw a positive integer + inline void Draw_Int(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { + Draw_Int(bShow, 0, size, color, bColor, iNum, x, y, value); } inline void Draw_Int(uint8_t iNum, long value) { - DWIN_Draw_Value(false, 0, true, 0, font, textcolor, backcolor, iNum, 0, cursor.x, cursor.y, value); + Draw_Int(false, 0, font, textcolor, backcolor, iNum, cursor.x, cursor.y, value); MoveBy(iNum * fontWidth(font), 0); } inline void Draw_Int(uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_Value(false, 0, true, 0, font, textcolor, backcolor, iNum, 0, x, y, value); + Draw_Int(false, 0, font, textcolor, backcolor, iNum, x, y, value); } inline void Draw_Int(uint16_t color, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_Value(false, 0, true, 0, font, color, backcolor, iNum, 0, x, y, value); + Draw_Int(false, 0, font, color, backcolor, iNum, x, y, value); } inline void Draw_Int(uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_Value(true, 0, true, 0, font, color, bColor, iNum, 0, x, y, value); + Draw_Int(true, 0, font, color, bColor, iNum, x, y, value); } inline void Draw_Int(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_Value(true, 0, true, 0, size, color, bColor, iNum, 0, x, y, value); + Draw_Int(true, 0, size, color, bColor, iNum, x, y, value); } // Draw a signed integer - // bShow: true=display background color; false=don't display background color - // zeroFill: true=zero fill; false=no zero fill - // zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space - // size: Font size - // color: Character color - // bColor: Background color - // iNum: Number of digits - // x/y: Upper-left coordinate - // value: Integer value - inline void Draw_Signed_Int(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_Value(bShow, 1, zeroFill, zeroMode, size, color, bColor, iNum, 0, x, y, value); + inline void Draw_Signed_Int(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { + Draw_Int(bShow, 1, size, color, bColor, iNum, x, y, value); } inline void Draw_Signed_Int(uint8_t iNum, long value) { - DWIN_Draw_Value(false, 1, true, 0, font, textcolor, backcolor, iNum, 0, cursor.x, cursor.y, value); + Draw_Int(false, 1, font, textcolor, backcolor, iNum, cursor.x, cursor.y, value); MoveBy(iNum * fontWidth(font), 0); } inline void Draw_Signed_Int(uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_Value(false, 1, true, 0, font, textcolor, backcolor, iNum, 0, x, y, value); + Draw_Int(false, 1, font, textcolor, backcolor, iNum, x, y, value); } inline void Draw_Signed_Int(uint16_t color, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_Value(false, 1, true, 0, font, color, backcolor, iNum, 0, x, y, value); + Draw_Int(false, 1, font, color, backcolor, iNum, x, y, value); } inline void Draw_Signed_Int(uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_Value(true, 1, true, 0, font, color, bColor, iNum, 0, x, y, value); + Draw_Int(true, 1, font, color, bColor, iNum, x, y, value); } inline void Draw_Signed_Int(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - DWIN_Draw_Value(true, 1, true, 0, size, color, bColor, iNum, 0, x, y, value); + Draw_Int(true, 1, size, color, bColor, iNum, x, y, value); } - // Draw a positive floating point number + // Draw a numeric float value // bShow: true=display background color; false=don't display background color - // zeroFill: true=zero fill; false=no zero fill - // zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space + // signedMode: 1=signed; 0=unsigned // size: Font size // color: Character color // bColor: Background color - // iNum: Number of whole digits + // iNum: Number of digits // fNum: Number of decimal digits - // x/y: Upper-left point - // value: Float value - inline void Draw_Float(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_Value(bShow, 0, zeroFill, zeroMode, size, color, bColor, iNum, fNum, x, y, value); + // x/y: Upper-left coordinate + // value: float value + void Draw_Float(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value); + + // Draw a positive floating point number + inline void Draw_Float(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + Draw_Float(bShow, 0, size, color, bColor, iNum, fNum, x, y, value); } inline void Draw_Float(uint8_t iNum, uint8_t fNum, float value) { - DWIN_Draw_Value(false, 0, true, 0, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); + Draw_Float(false, 0, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); MoveBy((iNum + fNum + 1) * fontWidth(font), 0); } inline void Draw_Float(uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_Value(false, 0, true, 0, font, textcolor, backcolor, iNum, fNum, x, y, value); + Draw_Float(false, 0, font, textcolor, backcolor, iNum, fNum, x, y, value); } - inline void Draw_Float(uint16_t color, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_Value(false, 0, true, 0, font, color, backcolor, iNum, fNum, x, y, value); + inline void Draw_Float(uint8_t size, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + Draw_Float(false, 0, size, textcolor, backcolor, iNum, fNum, x, y, value); } inline void Draw_Float(uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_Value(true, 0, true, 0, font, color, bColor, iNum, fNum, x, y, value); + Draw_Float(true, 0, font, color, bColor, iNum, fNum, x, y, value); } inline void Draw_Float(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_Value(true, 0, true, 0, size, color, bColor, iNum, fNum, x, y, value); + Draw_Float(true, 0, size, color, bColor, iNum, fNum, x, y, value); } // Draw a signed floating point number - // bShow: true=display background color; false=don't display background color - // zeroFill: true=zero fill; false=no zero fill - // zeroMode: 1=leading 0 displayed as 0; 0=leading 0 displayed as a space - // size: Font size - // color: Character color - // bColor: Background color - // iNum: Number of whole digits - // fNum: Number of decimal digits - // x/y: Upper-left point - // value: Float value - inline void Draw_Signed_Float(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_Value(bShow, 1, zeroFill, zeroMode, size, color, bColor, iNum, fNum, x, y, value); + inline void Draw_Signed_Float(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + Draw_Float(bShow, 1, size, color, bColor, iNum, fNum, x, y, value); } inline void Draw_Signed_Float(uint8_t iNum, uint8_t fNum, float value) { - DWIN_Draw_Value(false, 1, true, 0, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); + Draw_Float(false, 1, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); MoveBy((iNum + fNum + 1) * fontWidth(font), 0); } inline void Draw_Signed_Float(uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_Value(false, 1, true, 0, font, textcolor, backcolor, iNum, fNum, x, y, value); + Draw_Float(false, 1, font, textcolor, backcolor, iNum, fNum, x, y, value); } inline void Draw_Signed_Float(uint8_t size, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_Value(false, 1, true, 0, size, textcolor, backcolor, iNum, fNum, x, y, value); + Draw_Float(false, 1, size, textcolor, backcolor, iNum, fNum, x, y, value); } inline void Draw_Signed_Float(uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_Value(true, 1, true, 0, font, color, bColor, iNum, fNum, x, y, value); + Draw_Float(true, 1, font, color, bColor, iNum, fNum, x, y, value); } inline void Draw_Signed_Float(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - DWIN_Draw_Value(true, 1, true, 0, size, color, bColor, iNum, fNum, x, y, value); + Draw_Float(true, 1, size, color, bColor, iNum, fNum, x, y, value); } - // Draw a char at cursor position + // Draw a char + // color: Character color + // x: abscissa of the display + // y: ordinate of the display + // c: ASCII code of char + void Draw_Char(uint16_t color, uint16_t x, uint16_t y, const char c); + inline void Draw_Char(uint16_t x, uint16_t y, const char c) { Draw_Char(textcolor, x, y, c); }; + // Draw a char at cursor position and increment cursor void Draw_Char(uint16_t color, const char c); inline void Draw_Char(const char c) { Draw_Char(textcolor, c); } @@ -591,17 +554,8 @@ namespace DWINUI { DWIN_WriteToMem(0xA5, addr, length, data); } - // Clear Menu by filling the area with background color + // Clear by filling the area with background color // Area (0, TITLE_HEIGHT, DWIN_WIDTH, STATUS_Y - 1) void ClearMainArea(); - // Clear MenuItems array and free MenuItems elements - void MenuItemsClear(); - - // Prepare MenuItems array - void MenuItemsPrepare(int8_t totalitems); - - // Add elements to the MenuItems array - MenuItemClass* MenuItemsAdd(MenuItemClass* menuitem); - }; diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp index c179856c6acb..44b595096a88 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp @@ -23,8 +23,8 @@ /** * Lock screen implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 2.1 - * Date: 2021/11/09 + * Version: 2.2.0 + * Date: 2022/04/11 */ #include "../../../inc/MarlinConfigPre.h" @@ -50,6 +50,7 @@ void LockScreenClass::init() { } void LockScreenClass::draw() { + Title.SetCaption(GET_TEXT_F(MSG_LOCKSCREEN)); DWINUI::ClearMainArea(); DWINUI::Draw_Icon(ICON_LOGO, 71, 120); // CREALITY logo DWINUI::Draw_CenteredString(Color_White, 180, GET_TEXT_F(MSG_LOCKSCREEN_LOCKED)); diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.h b/Marlin/src/lcd/e3v2/proui/lockscreen.h index ec967fe2db7c..83d5530be3e4 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.h +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.h @@ -24,8 +24,8 @@ /** * Lock screen implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 2.1 - * Date: 2021/11/09 + * Version: 2.2.0 + * Date: 2022/04/11 */ #include "../common/encoder.h" diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp index 6dfcb8595c87..6438545cb251 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.cpp +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -23,8 +23,8 @@ /** * Menu functions for ProUI * Author: Miguel A. Risco-Castillo - * Version: 1.2.1 - * Date: 2022/02/25 + * Version: 1.4.1 + * Date: 2022/04/14 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -51,6 +51,14 @@ #include "dwin.h" #include "menus.h" +int8_t MenuItemTotal = 0; +int8_t MenuItemCount = 0; +MenuItemClass** MenuItems = nullptr; +MenuClass *CurrentMenu = nullptr; +MenuClass *PreviousMenu = nullptr; +void (*onMenuDraw)(MenuClass* menu) = nullptr; +void (*onCursorErase)(const int8_t line) = nullptr; +void (*onCursorDraw)(const int8_t line) = nullptr; MenuData_t MenuData; // Menuitem Drawing functions ================================================= @@ -69,11 +77,13 @@ void Draw_Menu(MenuClass* menu) { } 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); + const uint16_t ypos = MYPOS(line); + DWINUI::Draw_Box(1, HMI_data.Cursor_color, {0, ypos, 15, MLINE - 1}); } 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); + const uint16_t ypos = MYPOS(line); + DWINUI::Draw_Box(1, HMI_data.Background_Color, {0, ypos, 15, MLINE - 1}); } void Draw_Menu_Line(const uint8_t line, const uint8_t icon /*=0*/, const char * const label /*=nullptr*/, bool more /*=false*/) { @@ -84,7 +94,7 @@ void Draw_Menu_Line(const uint8_t line, const uint8_t icon /*=0*/, const char * } void Draw_Chkb_Line(const uint8_t line, const bool checked) { - DWINUI::Draw_Checkbox(HMI_data.Text_Color, HMI_data.Background_Color, VALX + 16, MBASE(line) - 1, checked); + DWINUI::Draw_Checkbox(HMI_data.Text_Color, HMI_data.Background_Color, VALX + 3 * DWINUI::fontWidth(), MBASE(line) - 1, checked); } void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const int32_t value /*=0*/) { @@ -141,11 +151,21 @@ void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, value); } +void onDrawPFloat3Menu(MenuItemClass* menuitem, int8_t line) { + const float value = *(float*)static_cast(menuitem)->value; + onDrawFloatMenu(menuitem, line, 3, value); +} + void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line, bool checked) { onDrawMenuItem(menuitem, line); Draw_Chkb_Line(line, checked); } +void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line) { + const bool val = *(bool*)static_cast(menuitem)->value; + onDrawChkbMenu(menuitem, line, val); +} + //----------------------------------------------------------------------------- // On click functions //----------------------------------------------------------------------------- @@ -165,7 +185,7 @@ void SetOnClick(uint8_t process, const int32_t lo, const int32_t hi, uint8_t dp, MenuData.dp = dp; MenuData.Apply = Apply; MenuData.LiveUpdate = LiveUpdate; - MenuData.Value = val; + MenuData.Value = constrain(val, lo, hi); EncoderRate.enabled = true; } @@ -257,6 +277,7 @@ void HMI_Menu() { // 1 : live change // 2 : apply change int8_t HMI_GetIntNoDraw(const int32_t lo, const int32_t hi) { + const int32_t cval = MenuData.Value; EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); if (encoder_diffState != ENCODER_DIFF_NO) { if (Apply_Encoder(encoder_diffState, MenuData.Value)) { @@ -265,9 +286,8 @@ int8_t HMI_GetIntNoDraw(const int32_t lo, const int32_t hi) { return 2; } LIMIT(MenuData.Value, lo, hi); - return 1; } - return 0; + return int8_t(cval != MenuData.Value); } // Get an integer value using the encoder @@ -367,4 +387,166 @@ void HMI_SetPFloat() { } } +// Menu Classes =============================================================== + +MenuClass::MenuClass() { + selected = 0; + topline = 0; +} + +void MenuClass::draw() { + MenuTitle.draw(); + if (onMenuDraw != nullptr) onMenuDraw(this); + for (int8_t i = 0; i < MenuItemCount; i++) + MenuItems[i]->draw(i - topline); + if (onCursorDraw != nullptr) onCursorDraw(line()); + DWIN_UpdateLCD(); +} + +void MenuClass::onScroll(bool dir) { + int8_t sel = selected; + if (dir) sel++; else sel--; + LIMIT(sel, 0, MenuItemCount - 1); + if (sel != selected) { + if (onCursorErase != nullptr) onCursorErase(line()); + DWIN_UpdateLCD(); + if ((sel - topline) == TROWS) { + DWIN_Frame_AreaMove(1, DWIN_SCROLL_UP, MLINE, DWINUI::backcolor, 0, TITLE_HEIGHT + 1, DWIN_WIDTH, STATUS_Y - 1); + topline++; + MenuItems[sel]->draw(TROWS - 1); + } + if ((sel < topline)) { + DWIN_Frame_AreaMove(1, DWIN_SCROLL_DOWN, MLINE, DWINUI::backcolor, 0, TITLE_HEIGHT + 1, DWIN_WIDTH, STATUS_Y - 1); + topline--; + MenuItems[sel]->draw(0); + } + selected = sel; + if (onCursorDraw != nullptr) onCursorDraw(line()); + DWIN_UpdateLCD(); + } +} + +void MenuClass::onClick() { + if (MenuItems[selected]->onClick != nullptr) (*MenuItems[selected]->onClick)(); +} + +MenuItemClass *MenuClass::SelectedItem() { + return MenuItems[selected]; +} + +MenuItemClass** MenuClass::Items() { + return MenuItems; +} + +int8_t MenuClass::count() { + return MenuItemCount; +}; + +/* MenuItem Class ===========================================================*/ + +MenuItemClass::MenuItemClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)()) { + icon = cicon; + onClick = onclick; + onDraw = ondraw; + const uint8_t len = _MIN(sizeof(caption) - 1, strlen(text)); + memcpy(&caption[0], text, len); + caption[len] = '\0'; +} + +MenuItemClass::MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)()) { + icon = cicon; + onClick = onclick; + onDraw = ondraw; + caption[0] = '\0'; + frameid = id; + frame = { x1, y1, x2, y2 }; +} + +void MenuItemClass::SetFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) { + caption[0] = '\0'; + frameid = id; + frame = { x1, y1, x2, y2 }; +} + +void MenuItemClass::draw(int8_t line) { + if (line < 0 || line >= TROWS) return; + if (onDraw != nullptr) (*onDraw)(this, line); +}; + +void MenuItemClass::redraw() { + draw(CurrentMenu->line(this->pos)); +} + +MenuItemPtrClass::MenuItemPtrClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) : MenuItemClass(cicon, text, ondraw, onclick) { + value = val; +}; + +// Menu auxiliary functions =================================================== + +void MenuItemsClear() { + if (MenuItems == nullptr) return; + for (int8_t i = 0; i < MenuItemCount; i++) delete MenuItems[i]; + delete[] MenuItems; + MenuItems = nullptr; + MenuItemCount = 0; + MenuItemTotal = 0; +} + +void MenuItemsPrepare(int8_t totalitems) { + MenuItemsClear(); + MenuItemTotal = totalitems; + MenuItems = new MenuItemClass*[totalitems]; +} + +MenuItemClass* MenuItemsAdd(MenuItemClass* menuitem) { + MenuItems[MenuItemCount] = menuitem; + menuitem->pos = MenuItemCount++; + return menuitem; +} + +MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text/*=nullptr*/, void (*ondraw)(MenuItemClass* menuitem, int8_t line)/*=nullptr*/, void (*onclick)()/*=nullptr*/) { + if (MenuItemCount < MenuItemTotal) { + MenuItemClass* menuitem = new MenuItemClass(cicon, text, ondraw, onclick); + return MenuItemsAdd(menuitem); + } + else return nullptr; +} + +MenuItemClass* MenuItemsAdd(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line)/*=nullptr*/, void (*onclick)()/*=nullptr*/) { + if (MenuItemCount < MenuItemTotal) { + MenuItemClass* menuitem = new MenuItemClass(cicon, id, x1, y1, x2, y2, ondraw, onclick); + return MenuItemsAdd(menuitem); + } + else return nullptr; +} + +MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) { + if (MenuItemCount < MenuItemTotal) { + MenuItemClass* menuitem = new MenuItemPtrClass(cicon, text, ondraw, onclick, val); + return MenuItemsAdd(menuitem); + } + else return nullptr; +} + +bool SetMenu(MenuClass* &menu, FSTR_P title, int8_t totalitems) { + if (!menu) menu = new MenuClass(); + const bool NotCurrent = (CurrentMenu != menu); + if (NotCurrent) { + menu->MenuTitle.SetCaption(title); + MenuItemsPrepare(totalitems); + } + return NotCurrent; +} + +void UpdateMenu(MenuClass* &menu) { + if (!menu) return; + if (CurrentMenu != menu) { + PreviousMenu = CurrentMenu; + CurrentMenu = menu; + } + menu->draw(); +} + +void ReDrawMenu() { if (CurrentMenu && checkkey==Menu) CurrentMenu->draw(); } + #endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/menus.h b/Marlin/src/lcd/e3v2/proui/menus.h index 0147c1616b31..d4514d173237 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.h +++ b/Marlin/src/lcd/e3v2/proui/menus.h @@ -23,8 +23,8 @@ /** * Menu functions for ProUI * Author: Miguel A. Risco-Castillo - * Version: 1.2.1 - * Date: 2022/02/25 + * Version: 1.4.1 + * Date: 2022/04/14 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -56,8 +56,70 @@ typedef struct { } MenuData_t; extern MenuData_t MenuData; +extern void (*onCursorErase)(const int8_t line); +extern void (*onCursorDraw)(const int8_t line); + +// Auxiliary Macros =========================================================== + +// Create and add a MenuItem object to the menu array +#define BACK_ITEM(H) MenuItemsAdd(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, H) +#define MENU_ITEM(V...) MenuItemsAdd(V) +#define EDIT_ITEM(V...) MenuItemsAdd(V) +#define MENU_ITEM_F(I,L,V...) MenuItemsAdd(I, GET_TEXT_F(L), V) +#define EDIT_ITEM_F(I,L,V...) MenuItemsAdd(I, GET_TEXT_F(L), V) + +// Menu Classes =============================================================== + +class MenuItemClass { +protected: +public: + int8_t pos = 0; + uint8_t icon = 0; + char caption[32] = ""; + uint8_t frameid = 0; + rect_t frame = {0}; + void (*onDraw)(MenuItemClass* menuitem, int8_t line) = nullptr; + void (*onClick)() = nullptr; + MenuItemClass() {}; + MenuItemClass(uint8_t cicon, const char * const text=nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr); + // MenuItemClass(uint8_t cicon, FSTR_P text = nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr) : MenuItemClass(cicon, FTOP(text), ondraw, onclick){} + MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr); + void SetFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); + virtual ~MenuItemClass(){}; + virtual void draw(int8_t line); + void redraw(); +}; + +class MenuItemPtrClass: public MenuItemClass { +public: + void *value = nullptr; + using MenuItemClass::MenuItemClass; + MenuItemPtrClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val); + MenuItemPtrClass(uint8_t cicon, FSTR_P text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) : MenuItemPtrClass(cicon, FTOP(text), ondraw, onclick, val){} +}; + +class MenuClass { +public: + int8_t topline = 0; + int8_t selected = 0; + TitleClass MenuTitle; + MenuClass(); + virtual ~MenuClass(){}; + inline int8_t line() { return selected - topline; }; + inline int8_t line(uint8_t pos) {return pos - topline; }; + int8_t count(); + virtual void draw(); + virtual void onScroll(bool dir); + void onClick(); + MenuItemClass* SelectedItem(); + static MenuItemClass** Items(); +}; +extern MenuClass *CurrentMenu; +extern MenuClass *PreviousMenu; +extern void (*onMenuDraw)(MenuClass* menu); // Menuitem Drawing functions ================================================= + void Draw_Title(TitleClass* title); void Draw_Menu(MenuClass* menu); void Draw_Menu_Cursor(const int8_t line); @@ -74,9 +136,12 @@ void onDrawPInt32Menu(MenuItemClass* menuitem, int8_t line); void onDrawFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp, const float value); void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line); void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line); +void onDrawPFloat3Menu(MenuItemClass* menuitem, int8_t line); void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line, bool checked); +void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line); // On click functions ========================================================= + void SetOnClick(uint8_t process, const int32_t lo, const int32_t hi, uint8_t dp, const int32_t val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); void SetValueOnClick(uint8_t process, const int32_t lo, const int32_t hi, const int32_t val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); void SetValueOnClick(uint8_t process, const float lo, const float hi, uint8_t dp, const float val, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); @@ -86,9 +151,38 @@ void SetFloatOnClick(const float lo, const float hi, uint8_t dp, const float val void SetPFloatOnClick(const float lo, const float hi, uint8_t dp, void (*Apply)() = nullptr, void (*LiveUpdate)() = nullptr); // HMI user control functions ================================================= + void HMI_Menu(); void HMI_SetInt(); void HMI_SetPInt(); void HMI_SetIntNoDraw(); void HMI_SetFloat(); void HMI_SetPFloat(); + +// Menu auxiliary functions =================================================== + +// Create a new menu +bool SetMenu(MenuClass* &menu, FSTR_P title, int8_t totalitems); + +//Update the Menu and Draw if it is valid +void UpdateMenu(MenuClass* &menu); + +//Redraw the current Menu if it is valid +void ReDrawMenu(); + +// Clear MenuItems array and free MenuItems elements +void MenuItemsClear(); + +// Prepare MenuItems array +void MenuItemsPrepare(int8_t totalitems); + +// Add elements to the MenuItems array +MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text=nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr); +inline MenuItemClass* MenuItemsAdd(uint8_t cicon, FSTR_P text = nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr) { + return MenuItemsAdd(cicon, FTOP(text), ondraw, onclick); +} +MenuItemClass* MenuItemsAdd(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr); +MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val); +inline MenuItemClass* MenuItemsAdd(uint8_t cicon, FSTR_P text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) { + return MenuItemsAdd(cicon, FTOP(text), ondraw, onclick, val); +} diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 6121ab35d45f..5fe8b1bb104a 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -23,8 +23,8 @@ /** * Mesh Viewer for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * version: 3.12.1 - * Date: 2022/02/24 + * version: 3.14.1 + * Date: 2022/04/11 */ #include "../../../inc/MarlinConfigPre.h" @@ -41,6 +41,10 @@ #include "dwin_popup.h" #include "../../../feature/bedlevel/bedlevel.h" +#if ENABLED(AUTO_BED_LEVELING_UBL) + #include "ubl_tools.h" +#endif + MeshViewerClass MeshViewer; void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8_t sizey) { @@ -56,17 +60,15 @@ void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8 #define DrawMeshValue(xp, yp, zv) DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(xp) - 18, 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(sizey - 1), DWIN_WIDTH - 2 * my) - int16_t maxz =-32000; int16_t minz = 32000; avg = 0; + int16_t maxz =-32000; int16_t minz = 32000; LOOP_L_N(y, sizey) LOOP_L_N(x, sizex) { const float v = isnan(zval[x][y]) ? 0 : round(zval[x][y] * 100); zmesh[x][y] = v; - avg += v; NOLESS(maxz, v); NOMORE(minz, v); } max = (float)maxz / 100; min = (float)minz / 100; - avg = avg / (100 * sizex * sizey); DWINUI::ClearMainArea(); DWIN_Draw_Rectangle(0, HMI_data.SplitLine_Color, px(0), py(0), px(sizex - 1), py(sizey - 1)); LOOP_S_L_N(x, 1, sizex - 1) DrawMeshVLine(x); @@ -77,8 +79,10 @@ void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8 uint16_t color = DWINUI::RainbowInt(zmesh[x][y], _MIN(-5, minz), _MAX(5, maxz)); uint8_t radius = rm(zmesh[x][y]); DWINUI::Draw_FillCircle(color, px(x), py(y), radius); - if (sizex < 9) - DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(x) - 18, py(y) - 6, zval[x][y]); + if (sizex < 9) { + if (zmesh[x][y] == 0) DWINUI::Draw_Float(font6x12, 1, 2, px(x) - 12, py(y) - 6, 0); + else DWINUI::Draw_Signed_Float(font6x12, 1, 2, px(x) - 18, py(y) - 6, zval[x][y]); + } else { char str_1[9]; str_1[0] = 0; @@ -108,7 +112,13 @@ void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8 void MeshViewerClass::Draw(bool withsave /*= false*/) { Title.ShowCaption(GET_TEXT_F(MSG_MESH_VIEWER)); - DrawMesh(Z_VALUES_ARR, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y); + #if ENABLED(USE_UBL_VIEWER) + DWINUI::ClearMainArea(); + ubl_tools.viewer_print_value = true; + ubl_tools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT); + #else + DrawMesh(Z_VALUES_ARR, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y); + #endif if (withsave) { DWINUI::Draw_Button(BTN_Save, 26, 305); DWINUI::Draw_Button(BTN_Continue, 146, 305); @@ -117,15 +127,19 @@ void MeshViewerClass::Draw(bool withsave /*= false*/) { else DWINUI::Draw_Button(BTN_Continue, 86, 305); - char str_1[6], str_2[6] = ""; - ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"), - dtostrf(min, 1, 2, str_1), - dtostrf(max, 1, 2, str_2) - ); + #if ENABLED(USE_UBL_VIEWER) + ubl_tools.Set_Mesh_Viewer_Status(); + #else + char str_1[6], str_2[6] = ""; + ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"), + dtostrf(min, 1, 2, str_1), + dtostrf(max, 1, 2, str_2) + ); + #endif } void Draw_MeshViewer() { MeshViewer.Draw(true); } -void onClick_MeshViewer() { if (HMI_flag.select_flag) WriteEeprom(); HMI_ReturnScreen(); } -void Goto_MeshViewer() { if (leveling_is_valid()) Goto_Popup(Draw_MeshViewer, onClick_MeshViewer); else HMI_ReturnScreen(); } +void onClick_MeshViewer() { if (HMI_flag.select_flag) SaveMesh(); HMI_ReturnScreen(); } +void Goto_MeshViewer() { if (leveling_is_valid()) Goto_Popup(Draw_MeshViewer, onClick_MeshViewer); else HMI_ReturnScreen(); } #endif // DWIN_LCD_PROUI && HAS_MESH diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.h b/Marlin/src/lcd/e3v2/proui/meshviewer.h index f914bab4ae23..1e78ff2657b8 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.h +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.h @@ -27,13 +27,13 @@ /** * Mesh Viewer for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * version: 3.12.1 - * Date: 2022/02/24 + * version: 3.14.1 + * Date: 2022/04/11 */ class MeshViewerClass { public: - float avg, max, min; + float max, min; void Draw(bool withsave = false); void DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8_t sizey); }; diff --git a/Marlin/src/lcd/e3v2/proui/printstats.cpp b/Marlin/src/lcd/e3v2/proui/printstats.cpp index f33d0d15faa9..5a7b6c9c4170 100644 --- a/Marlin/src/lcd/e3v2/proui/printstats.cpp +++ b/Marlin/src/lcd/e3v2/proui/printstats.cpp @@ -71,7 +71,7 @@ void PrintStatsClass::Draw() { void PrintStatsClass::Reset() { print_job_timer.initStats(); - HMI_AudioFeedback(); + DONE_BUZZ(true); } void Goto_PrintStats() { diff --git a/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp b/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp new file mode 100644 index 000000000000..1783ee18c523 --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp @@ -0,0 +1,255 @@ +/** + * UBL Tools and Mesh Viewer for Pro UI + * Version: 1.0.0 + * Date: 2022/04/13 + * + * Original Author: Henri-J-Norden + * Original Source: https://github.com/Jyers/Marlin/pull/126 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfigPre.h" +#include "ubl_tools.h" + +#if ENABLED(DWIN_LCD_PROUI) + +#include "../../marlinui.h" +#include "../../../core/types.h" +#include "dwin.h" +#include "dwinui.h" +#include "dwin_popup.h" +#include "../../../feature/bedlevel/bedlevel.h" +#include "../../../module/probe.h" +#include "../../../gcode/gcode.h" +#include "../../../module/planner.h" +#include "../../../gcode/queue.h" +#include "../../../libs/least_squares_fit.h" +#include "../../../libs/vector_3.h" + +UBLMeshToolsClass ubl_tools; + +#if ENABLED(USE_UBL_VIEWER) + bool UBLMeshToolsClass::viewer_asymmetric_range = false; + bool UBLMeshToolsClass::viewer_print_value = false; +#endif +bool UBLMeshToolsClass::goto_mesh_value = false; +uint8_t UBLMeshToolsClass::tilt_grid = 1; + +bool drawing_mesh = false; +char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16]; + +#if ENABLED(AUTO_BED_LEVELING_UBL) + + void UBLMeshToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y, bool undefined/*=false*/) { + sprintf_P(cmd, PSTR("M421 I%i J%i Z%s %s"), mesh_x, mesh_y, dtostrf(current_position.z, 1, 3, str_1), undefined ? "N" : ""); + gcode.process_subcommands_now(cmd); + planner.synchronize(); + } + + bool UBLMeshToolsClass::create_plane_from_mesh() { + struct linear_fit_data lsf_results; + incremental_LSF_reset(&lsf_results); + GRID_LOOP(x, y) { + if (!isnan(Z_VALUES_ARR[x][y])) { + xy_pos_t rpos; + rpos.x = ubl.mesh_index_to_xpos(x); + rpos.y = ubl.mesh_index_to_ypos(y); + incremental_LSF(&lsf_results, rpos, Z_VALUES_ARR[x][y]); + } + } + + if (finish_incremental_LSF(&lsf_results)) { + SERIAL_ECHOPGM("Could not complete LSF!"); + return true; + } + + ubl.set_all_mesh_points_to_value(0); + + matrix_3x3 rotation = matrix_3x3::create_look_at(vector_3(lsf_results.A, lsf_results.B, 1)); + GRID_LOOP(i, j) { + float mx = ubl.mesh_index_to_xpos(i), + my = ubl.mesh_index_to_ypos(j), + mz = Z_VALUES_ARR[i][j]; + + if (DEBUGGING(LEVELING)) { + DEBUG_ECHOPAIR_F("before rotation = [", mx, 7); + DEBUG_CHAR(','); + DEBUG_ECHO_F(my, 7); + DEBUG_CHAR(','); + DEBUG_ECHO_F(mz, 7); + DEBUG_ECHOPGM("] ---> "); + DEBUG_DELAY(20); + } + + rotation.apply_rotation_xyz(mx, my, mz); + + if (DEBUGGING(LEVELING)) { + DEBUG_ECHOPAIR_F("after rotation = [", mx, 7); + DEBUG_CHAR(','); + DEBUG_ECHO_F(my, 7); + DEBUG_CHAR(','); + DEBUG_ECHO_F(mz, 7); + DEBUG_ECHOLNPGM("]"); + DEBUG_DELAY(20); + } + + Z_VALUES_ARR[i][j] = mz - lsf_results.D; + } + return false; + } + +#else + + void UBLMeshToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y) { + sprintf_P(cmd, PSTR("G29 I%i J%i Z%s"), mesh_x, mesh_y, dtostrf(current_position.z, 1, 3, str_1)); + gcode.process_subcommands_now(cmd); + planner.synchronize(); + } + +#endif + +void UBLMeshToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove/*=false*/) { + if (zmove) { + planner.synchronize(); + current_position.z = goto_mesh_value ? Z_VALUES_ARR[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; + planner.buffer_line(current_position, homing_feedrate(Z_AXIS), active_extruder); + planner.synchronize(); + } + else { + DWIN_Show_Popup(ICON_BLTouch, F("Moving to Point"), F("Please wait until done.")); + HMI_SaveProcessID(NothingToDo); + sprintf_P(cmd, PSTR("G0 F300 Z%s"), dtostrf(Z_CLEARANCE_BETWEEN_PROBES, 1, 3, str_1)); + gcode.process_subcommands_now(cmd); + sprintf_P(cmd, PSTR("G42 F4000 I%i J%i"), mesh_x, mesh_y); + gcode.process_subcommands_now(cmd); + planner.synchronize(); + current_position.z = goto_mesh_value ? Z_VALUES_ARR[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; + planner.buffer_line(current_position, homing_feedrate(Z_AXIS), active_extruder); + planner.synchronize(); + HMI_ReturnScreen(); + } +} + +float UBLMeshToolsClass::get_max_value() { + float max = __FLT_MIN__; + GRID_LOOP(x, y) { + if (!isnan(Z_VALUES_ARR[x][y]) && Z_VALUES_ARR[x][y] > max) + max = Z_VALUES_ARR[x][y]; + } + return max; +} + +float UBLMeshToolsClass::get_min_value() { + float min = __FLT_MAX__; + GRID_LOOP(x, y) { + if (!isnan(Z_VALUES_ARR[x][y]) && Z_VALUES_ARR[x][y] < min) + min = Z_VALUES_ARR[x][y]; + } + return min; +} + +bool UBLMeshToolsClass::validate() { + float min = __FLT_MAX__; + float max = __FLT_MIN__; + + GRID_LOOP(x, y) { + if (isnan(Z_VALUES_ARR[x][y])) return false; + if (Z_VALUES_ARR[x][y] < min) min = Z_VALUES_ARR[x][y]; + if (Z_VALUES_ARR[x][y] > max) max = Z_VALUES_ARR[x][y]; + } + return max <= UBL_Z_OFFSET_MAX && min >= UBL_Z_OFFSET_MIN; +} + +#if ENABLED(USE_UBL_VIEWER) + void UBLMeshToolsClass::Draw_Bed_Mesh(int16_t selected /*= -1*/, uint8_t gridline_width /*= 1*/, uint16_t padding_x /*= 8*/, uint16_t padding_y_top /*= 40 + 53 - 7*/) { + drawing_mesh = true; + const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x; + const uint16_t cell_width_px = total_width_px / GRID_MAX_POINTS_X; + const uint16_t cell_height_px = total_width_px / GRID_MAX_POINTS_Y; + const float v_max = abs(get_max_value()), v_min = abs(get_min_value()), range = _MAX(v_min, v_max); + + // Clear background from previous selection and select new square + DWIN_Draw_Rectangle(1, Color_Bg_Black, _MAX(0, padding_x - gridline_width), _MAX(0, padding_y_top - gridline_width), padding_x + total_width_px, padding_y_top + total_width_px); + if (selected >= 0) { + const auto selected_y = selected / GRID_MAX_POINTS_X; + const auto selected_x = selected - (GRID_MAX_POINTS_X * selected_y); + const auto start_y_px = padding_y_top + selected_y * cell_height_px; + const auto start_x_px = padding_x + selected_x * cell_width_px; + DWIN_Draw_Rectangle(1, Color_White, _MAX(0, start_x_px - gridline_width), _MAX(0, start_y_px - gridline_width), start_x_px + cell_width_px, start_y_px + cell_height_px); + } + + // Draw value square grid + char buf[8]; + GRID_LOOP(x, y) { + const auto start_x_px = padding_x + x * cell_width_px; + const auto end_x_px = start_x_px + cell_width_px - 1 - gridline_width; + const auto start_y_px = padding_y_top + (GRID_MAX_POINTS_Y - y - 1) * cell_height_px; + const auto end_y_px = start_y_px + cell_height_px - 1 - gridline_width; + DWIN_Draw_Rectangle(1, // RGB565 colors: http://www.barth-dev.de/online/rgb565-color-picker/ + isnan(Z_VALUES_ARR[x][y]) ? Color_Grey : ( // gray if undefined + (Z_VALUES_ARR[x][y] < 0 ? + (uint16_t)round(0x1F * -Z_VALUES_ARR[x][y] / (!viewer_asymmetric_range ? range : v_min)) << 11 : // red if mesh point value is negative + (uint16_t)round(0x3F * Z_VALUES_ARR[x][y] / (!viewer_asymmetric_range ? range : v_max)) << 5) | // green if mesh point value is positive + _MIN(0x1F, (((uint8_t)abs(Z_VALUES_ARR[x][y]) / 10) * 4))), // + blue stepping for every mm + start_x_px, start_y_px, end_x_px, end_y_px + ); + + safe_delay(10); + LCD_SERIAL.flushTX(); + + // Draw value text on + if (viewer_print_value) { + int8_t offset_x, offset_y = cell_height_px / 2 - 6; + if (isnan(Z_VALUES_ARR[x][y])) { // undefined + DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X")); + } + else { // has value + if (GRID_MAX_POINTS_X < 10) + sprintf_P(buf, PSTR("%s"), dtostrf(abs(Z_VALUES_ARR[x][y]), 1, 2, str_1)); + else + sprintf_P(buf, PSTR("%02i"), (uint16_t)(abs(Z_VALUES_ARR[x][y] - (int16_t)Z_VALUES_ARR[x][y]) * 100)); + offset_x = cell_width_px / 2 - 3 * (strlen(buf)) - 2; + if (!(GRID_MAX_POINTS_X < 10)) + DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px - 2 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, F(".")); + DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px + 1 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, buf); + } + safe_delay(10); + LCD_SERIAL.flushTX(); + } + } + } + + void UBLMeshToolsClass::Set_Mesh_Viewer_Status() { // TODO: draw gradient with values as a legend instead + float v_max = abs(get_max_value()), v_min = abs(get_min_value()), range = _MAX(v_min, v_max); + if (v_min > 3e+10F) v_min = 0.0000001; + if (v_max > 3e+10F) v_max = 0.0000001; + if (range > 3e+10F) range = 0.0000001; + char msg[46]; + if (viewer_asymmetric_range) { + dtostrf(-v_min, 1, 3, str_1); + dtostrf( v_max, 1, 3, str_2); + } + else { + dtostrf(-range, 1, 3, str_1); + dtostrf( range, 1, 3, str_2); + } + sprintf_P(msg, PSTR("Red %s..0..%s Green"), str_1, str_2); + ui.set_status(msg); + drawing_mesh = false; + } +#endif + +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/ubl_tools.h b/Marlin/src/lcd/e3v2/proui/ubl_tools.h new file mode 100644 index 000000000000..563794a46385 --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/ubl_tools.h @@ -0,0 +1,59 @@ +/** + * UBL Tools and Mesh Viewer for Pro UI + * Version: 1.0.0 + * Date: 2022/04/13 + * + * Original Author: Henri-J-Norden (https://github.com/Henri-J-Norden) + * Original Source: https://github.com/Jyers/Marlin/pull/135 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "../../../inc/MarlinConfigPre.h" + +//#define USE_UBL_VIEWER 1 + +#define UBL_Z_OFFSET_MIN -3.0 +#define UBL_Z_OFFSET_MAX 3.0 + +class UBLMeshToolsClass { +public: + #if ENABLED(USE_UBL_VIEWER) + static bool viewer_asymmetric_range; + static bool viewer_print_value; + #endif + static bool goto_mesh_value; + static uint8_t tilt_grid; + + #if ENABLED(AUTO_BED_LEVELING_UBL) + static void manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y, bool undefined=false); + static bool create_plane_from_mesh(); + #else + static void manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y); + #endif + static void manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove=false); + static float get_max_value(); + static float get_min_value(); + static bool validate(); + #if ENABLED(USE_UBL_VIEWER) + static void Draw_Bed_Mesh(int16_t selected = -1, uint8_t gridline_width = 1, uint16_t padding_x = 8, uint16_t padding_y_top = 40 + 53 - 7); + static void Set_Mesh_Viewer_Status(); + #endif +}; + +extern UBLMeshToolsClass ubl_tools; + +void Goto_MeshViewer(); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 761209866e4f..1358baebc38c 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -53,6 +53,8 @@ namespace Language_en { LSTR WELCOME_MSG = MACHINE_NAME _UxGT(" Ready."); LSTR MSG_YES = _UxGT("YES"); LSTR MSG_NO = _UxGT("NO"); + LSTR MSG_HIGH = _UxGT("HIGH"); + LSTR MSG_LOW = _UxGT("LOW"); LSTR MSG_BACK = _UxGT("Back"); LSTR MSG_ERROR = _UxGT("Error"); LSTR MSG_MEDIA_ABORTING = _UxGT("Aborting..."); @@ -68,6 +70,8 @@ namespace Language_en { LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Endstops"); LSTR MSG_MAIN = _UxGT("Main"); LSTR MSG_ADVANCED_SETTINGS = _UxGT("Advanced Settings"); + LSTR MSG_TOOLBAR_SETUP = _UxGT("Toolbar Setup"); + LSTR MSG_OPTION_DISABLED = _UxGT("Option Disabled"); LSTR MSG_CONFIGURATION = _UxGT("Configuration"); LSTR MSG_RUN_AUTO_FILES = _UxGT("Run Auto Files"); LSTR MSG_DISABLE_STEPPERS = _UxGT("Disable Steppers"); @@ -81,6 +85,7 @@ namespace Language_en { LSTR MSG_AUTO_HOME_Z = _UxGT("Home Z"); LSTR MSG_FILAMENT_SET = _UxGT("Filament Settings"); LSTR MSG_FILAMENT_MAN = _UxGT("Filament Management"); + LSTR MSG_MANUAL_LEVELING = _UxGT("Manual Leveling"); LSTR MSG_LEVBED_FL = _UxGT("Front Left"); LSTR MSG_LEVBED_FR = _UxGT("Front Right"); LSTR MSG_LEVBED_C = _UxGT("Center"); @@ -116,7 +121,14 @@ namespace Language_en { LSTR MSG_PREHEAT_1_ALL = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" All"); LSTR MSG_PREHEAT_1_BEDONLY = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Bed"); LSTR MSG_PREHEAT_1_SETTINGS = _UxGT("Preheat ") PREHEAT_1_LABEL _UxGT(" Conf"); - + #ifdef PREHEAT_2_LABEL + LSTR MSG_PREHEAT_2 = _UxGT("Preheat ") PREHEAT_2_LABEL; + LSTR MSG_PREHEAT_2_SETTINGS = _UxGT("Preheat ") PREHEAT_2_LABEL _UxGT(" Conf"); + #endif + #ifdef PREHEAT_3_LABEL + LSTR MSG_PREHEAT_3 = _UxGT("Preheat ") PREHEAT_3_LABEL; + LSTR MSG_PREHEAT_3_SETTINGS = _UxGT("Preheat ") PREHEAT_3_LABEL _UxGT(" Conf"); + #endif LSTR MSG_PREHEAT_M = _UxGT("Preheat $"); LSTR MSG_PREHEAT_M_H = _UxGT("Preheat $ ~"); LSTR MSG_PREHEAT_M_END = _UxGT("Preheat $ End"); @@ -163,10 +175,19 @@ namespace Language_en { LSTR MSG_MESH_VIEW = _UxGT("View Mesh"); LSTR MSG_EDITING_STOPPED = _UxGT("Mesh Editing Stopped"); LSTR MSG_NO_VALID_MESH = _UxGT("No valid mesh"); + LSTR MSG_ACTIVATE_MESH = _UxGT("Activate Leveling"); LSTR MSG_PROBING_POINT = _UxGT("Probing Point"); LSTR MSG_MESH_X = _UxGT("Index X"); LSTR MSG_MESH_Y = _UxGT("Index Y"); + LSTR MSG_MESH_INSET = _UxGT("Mesh Inset"); + LSTR MSG_MESH_MIN_X = _UxGT("Mesh X Minimum"); + LSTR MSG_MESH_MAX_X = _UxGT("Mesh X Maximum"); + LSTR MSG_MESH_MIN_Y = _UxGT("Mesh Y Minimum"); + LSTR MSG_MESH_MAX_Y = _UxGT("Mesh Y Maximum"); + LSTR MSG_MESH_AMAX = _UxGT("Maximize Area"); + LSTR MSG_MESH_CENTER = _UxGT("Center Area"); LSTR MSG_MESH_EDIT_Z = _UxGT("Z Value"); + LSTR MSG_MESH_CANCEL = _UxGT("Mesh cancelled"); LSTR MSG_CUSTOM_COMMANDS = _UxGT("Custom Commands"); LSTR MSG_M48_TEST = _UxGT("M48 Probe Test"); LSTR MSG_M48_POINT = _UxGT("M48 Point"); @@ -185,6 +206,9 @@ namespace Language_en { LSTR MSG_UBL_TOOLS = _UxGT("UBL Tools"); LSTR MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling"); LSTR MSG_LCD_TILTING_MESH = _UxGT("Tilting Point"); + LSTR MSG_UBL_TILT_MESH = _UxGT("Tilt Mesh"); + LSTR MSG_UBL_TILTING_GRID = _UxGT("Tilting Grid Size"); + LSTR MSG_UBL_MESH_TILTED = _UxGT("Mesh Tilted"); LSTR MSG_UBL_MANUAL_MESH = _UxGT("Manually Build Mesh"); LSTR MSG_UBL_MESH_WIZARD = _UxGT("UBL Mesh Wizard"); LSTR MSG_UBL_BC_INSERT = _UxGT("Place Shim & Measure"); @@ -233,6 +257,7 @@ namespace Language_en { LSTR MSG_UBL_MANUAL_FILLIN = _UxGT("Manual Fill-in"); LSTR MSG_UBL_SMART_FILLIN = _UxGT("Smart Fill-in"); LSTR MSG_UBL_FILLIN_MESH = _UxGT("Fill-in Mesh"); + LSTR MSG_UBL_MESH_FILLED = _UxGT("Missing Points Filled"); LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Invalidate All"); LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalidate Closest"); LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Fine Tune All"); @@ -241,6 +266,7 @@ namespace Language_en { LSTR MSG_UBL_STORAGE_SLOT = _UxGT("Memory Slot"); LSTR MSG_UBL_LOAD_MESH = _UxGT("Load Bed Mesh"); LSTR MSG_UBL_SAVE_MESH = _UxGT("Save Bed Mesh"); + LSTR MSG_UBL_INVALID_SLOT = _UxGT("First Select a Mesh Slot"); LSTR MSG_MESH_LOADED = _UxGT("Mesh %i Loaded"); LSTR MSG_MESH_SAVED = _UxGT("Mesh %i Saved"); LSTR MSG_UBL_NO_STORAGE = _UxGT("No Storage"); @@ -344,6 +370,7 @@ namespace Language_en { LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("PID Autotune failed!"); LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Bad extruder."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temperature too high."); + LSTR MSG_TIMEOUT = _UxGT("Timeout."); LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed! Bad extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); @@ -420,6 +447,10 @@ namespace Language_en { LSTR MSG_RESET_PRINTER = _UxGT("Reset Printer"); LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Refresh"); LSTR MSG_INFO_SCREEN = _UxGT("Info Screen"); + LSTR MSG_INFO_MACHINENAME = _UxGT("Machine Name"); + LSTR MSG_INFO_SIZE = _UxGT("Size"); + LSTR MSG_INFO_FWVERSION = _UxGT("Firmware Version"); + LSTR MSG_INFO_BUILD = _UxGT("Build Datetime"); LSTR MSG_PREPARE = _UxGT("Prepare"); LSTR MSG_TUNE = _UxGT("Tune"); LSTR MSG_POWER_MONITOR = _UxGT("Power monitor"); @@ -446,6 +477,7 @@ namespace Language_en { LSTR MSG_BUTTON_RESUME = _UxGT("Resume"); LSTR MSG_BUTTON_ADVANCED = _UxGT("Advanced"); LSTR MSG_BUTTON_SAVE = _UxGT("Save"); + LSTR MSG_BUTTON_PURGE = _UxGT("Purge"); LSTR MSG_PAUSING = _UxGT("Pausing..."); LSTR MSG_PAUSE_PRINT = _UxGT("Pause Print"); LSTR MSG_ADVANCED_PAUSE = _UxGT("Advanced Pause"); @@ -468,9 +500,12 @@ namespace Language_en { LSTR MSG_REMAINING_TIME = _UxGT("Remaining"); LSTR MSG_PRINT_ABORTED = _UxGT("Print Aborted"); LSTR MSG_PRINT_DONE = _UxGT("Print Done"); + LSTR MSG_PRINTER_KILLED = _UxGT("Printer killed!"); + LSTR MSG_TURN_OFF = _UxGT("Turn off the printer"); LSTR MSG_NO_MOVE = _UxGT("No Move."); LSTR MSG_KILLED = _UxGT("KILLED. "); LSTR MSG_STOPPED = _UxGT("STOPPED. "); + LSTR MSG_FWRETRACT = _UxGT("Firmware Retract"); LSTR MSG_CONTROL_RETRACT = _UxGT("Retract mm"); LSTR MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Re.mm"); LSTR MSG_CONTROL_RETRACTF = _UxGT("Retract V"); @@ -536,6 +571,9 @@ namespace Language_en { LSTR MSG_ZPROBE_XOFFSET = _UxGT("Probe X Offset"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Probe Y Offset"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Probe Z Offset"); + LSTR MSG_ZPROBE_MARGIN = _UxGT("Probe Margin"); + LSTR MSG_Z_FEED_RATE = _UxGT("Z Feed Rate"); + LSTR MSG_ENABLE_HS_MODE = _UxGT("Enable HS mode"); LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Move Nozzle to Bed"); LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); @@ -603,27 +641,28 @@ namespace Language_en { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Light Brightness"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("INCORRECT PRINTER"); + LSTR MSG_COLORS_GET = _UxGT("Get Color"); + LSTR MSG_COLORS_SELECT = _UxGT("Select Colors"); + LSTR MSG_COLORS_APPLIED = _UxGT("Colors applied"); + LSTR MSG_COLORS_RED = _UxGT("Red"); + LSTR MSG_COLORS_GREEN = _UxGT("Green"); + LSTR MSG_COLORS_BLUE = _UxGT("Blue"); + LSTR MSG_COLORS_WHITE = _UxGT("White"); + LSTR MSG_UI_LANGUAGE = _UxGT("UI Language"); + LSTR MSG_SOUND_ENABLE = _UxGT("Enable sound"); LSTR MSG_LOCKSCREEN = _UxGT("Lock Screen"); LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Printer is Locked,"); LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Scroll to unlock."); + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Please wait until reboot."); + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No media inserted."); - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Please wait until reboot. "); LSTR MSG_PLEASE_PREHEAT = _UxGT("Please preheat the hot end."); LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Reset Print Count"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Print Count"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Print Time"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Longest Job Time"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded Total"); - LSTR MSG_COLORS_GET = _UxGT("Get Color"); - LSTR MSG_COLORS_SELECT = _UxGT("Select Colors"); - LSTR MSG_COLORS_APPLIED = _UxGT("Colors applied"); - LSTR MSG_COLORS_RED = _UxGT("Red"); - LSTR MSG_COLORS_GREEN = _UxGT("Green"); - LSTR MSG_COLORS_BLUE = _UxGT("Blue"); - LSTR MSG_COLORS_WHITE = _UxGT("White"); - LSTR MSG_UI_LANGUAGE = _UxGT("UI Language"); - LSTR MSG_SOUND_ENABLE = _UxGT("Enable sound"); #else LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No Media"); LSTR MSG_PLEASE_PREHEAT = _UxGT("Please Preheat"); @@ -654,10 +693,14 @@ namespace Language_en { LSTR MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("RESUME OPTIONS:"); LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purge more"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Continue"); + LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Purge or Continue?"); LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozzle: "); LSTR MSG_RUNOUT_SENSOR = _UxGT("Runout Sensor"); LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Runout Dist mm"); LSTR MSG_RUNOUT_ENABLE = _UxGT("Enable Runout"); + LSTR MSG_RUNOUT_ACTIVE = _UxGT("Runout Active"); + LSTR MSG_INVERT_EXTRUDER = _UxGT("Invert Extruder"); + LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Extruder Min Temp."); LSTR MSG_FANCHECK = _UxGT("Fan Tacho Check"); LSTR MSG_KILL_HOMING_FAILED = _UxGT("Homing Failed"); LSTR MSG_LCD_PROBING_FAILED = _UxGT("Probing Failed"); From fe77fc66c0004ba9a4459dd5a12c978dd0308bb1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 18 May 2022 00:47:11 +0300 Subject: [PATCH 310/502] =?UTF-8?q?=F0=9F=94=A8=20Use=20PlatformIO=20Core?= =?UTF-8?q?=206.0=20Dev=20for=20CI=20(#24194)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-builds.yml | 5 +++-- docker/Dockerfile | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index e339f856462e..2d94b000c68c 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -138,8 +138,9 @@ jobs: - name: Install PlatformIO run: | - pip install -U https://github.com/platformio/platformio-core/archive/v5.2.5.zip - platformio update + pip install -U platformio + pio upgrade --dev + pio pkg update --global - name: Run ${{ matrix.test-platform }} Tests run: | diff --git a/docker/Dockerfile b/docker/Dockerfile index ad3e15d5de6f..7d32f9c63758 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.9.0-buster -RUN pip install -U https://github.com/platformio/platformio-core/archive/v5.2.5.zip -RUN platformio update +RUN pip install -U platformio +RUN pio upgrade --dev # To get the test platforms RUN pip install PyYaml #ENV PATH /code/buildroot/bin/:/code/buildroot/tests/:${PATH} From 02c267f542223ed0d8b098da4bec6f09710d6bc8 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 20 May 2022 02:15:57 +1200 Subject: [PATCH 311/502] =?UTF-8?q?=F0=9F=94=A8=20Require=20PIO=20>=3D=206?= =?UTF-8?q?.0.1=20(#24205)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformIO/scripts/common-dependencies.py | 6 ++-- ini/avr.ini | 2 +- ini/due.ini | 6 ++-- ini/esp32.ini | 16 +++++----- ini/lpc176x.ini | 2 +- ini/native.ini | 22 ++++++------- ini/samd51.ini | 20 ++++++------ ini/stm32-common.ini | 2 +- ini/stm32f0.ini | 12 +++---- ini/stm32f1-maple.ini | 2 +- ini/stm32f1.ini | 12 +++---- ini/teensy.ini | 32 +++++++++---------- platformio.ini | 8 ++--- 13 files changed, 71 insertions(+), 71 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.py b/buildroot/share/PlatformIO/scripts/common-dependencies.py index 24e780d9b670..e9e8c7918767 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.py +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.py @@ -15,7 +15,7 @@ FEATURE_CONFIG = {} def validate_pio(): - PIO_VERSION_MIN = (5, 0, 3) + PIO_VERSION_MIN = (6, 0, 1) try: from platformio import VERSION as PIO_VERSION weights = (1000, 100, 1) @@ -174,7 +174,7 @@ def apply_features_config(): env.SConscript(feat['extra_scripts'], exports="env") if 'src_filter' in feat: - blab("========== Adding src_filter for %s... " % feature, 2) + blab("========== Adding build_src_filter for %s... " % feature, 2) src_filter = ' '.join(env.GetProjectOption('src_filter')) # first we need to remove the references to the same folder my_srcs = re.findall(r'[+-](<.*?>)', feat['src_filter']) @@ -184,7 +184,7 @@ def apply_features_config(): src_filter = re.sub(r'[+-]' + d, '', src_filter) src_filter = feat['src_filter'] + ' ' + src_filter - set_env_field('src_filter', [src_filter]) + set_env_field('build_src_filter', [src_filter]) env.Replace(SRC_FILTER=src_filter) if 'lib_ignore' in feat: diff --git a/ini/avr.ini b/ini/avr.ini index b13596afe119..5944f8158344 100644 --- a/ini/avr.ini +++ b/ini/avr.ini @@ -16,7 +16,7 @@ platform = atmelavr@~3.4 build_flags = ${common.build_flags} -Wl,--relax board_build.f_cpu = 16000000L -src_filter = ${common.default_src_filter} + +build_src_filter = ${common.default_src_filter} + # # ATmega2560 diff --git a/ini/due.ini b/ini/due.ini index 28b68383074d..c1e2375d7c5a 100644 --- a/ini/due.ini +++ b/ini/due.ini @@ -16,9 +16,9 @@ # - RADDS # [env:DUE] -platform = atmelsam -board = due -src_filter = ${common.default_src_filter} + + +platform = atmelsam +board = due +build_src_filter = ${common.default_src_filter} + + [env:DUE_USB] extends = env:DUE diff --git a/ini/esp32.ini b/ini/esp32.ini index 4ac6b96f5c3d..05b045f16e83 100644 --- a/ini/esp32.ini +++ b/ini/esp32.ini @@ -13,14 +13,14 @@ # Espressif ESP32 # [env:esp32] -platform = espressif32@2.1.0 -board = esp32dev -build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0 -src_filter = ${common.default_src_filter} + -lib_ignore = NativeEthernet -upload_speed = 500000 -monitor_speed = 250000 -#upload_port = marlinesp.local +platform = espressif32@2.1.0 +board = esp32dev +build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0 +build_src_filter = ${common.default_src_filter} + +lib_ignore = NativeEthernet +upload_speed = 500000 +monitor_speed = 250000 +#upload_port = marlinesp.local #board_build.flash_mode = qio [env:FYSETC_E4] diff --git a/ini/lpc176x.ini b/ini/lpc176x.ini index 95f5637a5dec..0cb26628fe49 100644 --- a/ini/lpc176x.ini +++ b/ini/lpc176x.ini @@ -20,7 +20,7 @@ lib_ldf_mode = off lib_compat_mode = strict extra_scripts = ${common.extra_scripts} Marlin/src/HAL/LPC1768/upload_extra_script.py -src_filter = ${common.default_src_filter} + + +build_src_filter = ${common.default_src_filter} + + lib_deps = ${common.lib_deps} Servo custom_marlin.USES_LIQUIDCRYSTAL = arduino-libraries/LiquidCrystal@~1.0.7 diff --git a/ini/native.ini b/ini/native.ini index 02737a074638..b34945397ecf 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -13,14 +13,14 @@ # No supported Arduino libraries, base Marlin only # [env:linux_native] -platform = native -framework = -build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined -src_build_flags = -Wall -IMarlin/src/HAL/LINUX/include -build_unflags = -Wall -lib_ldf_mode = off -lib_deps = -src_filter = ${common.default_src_filter} + +platform = native +framework = +build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined +build_src_flags = -Wall -IMarlin/src/HAL/LINUX/include +build_unflags = -Wall +lib_ldf_mode = off +lib_deps = +build_src_filter = ${common.default_src_filter} + # # Native Simulation @@ -35,11 +35,11 @@ src_filter = ${common.default_src_filter} + platform = native framework = build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS -I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/u8g -src_build_flags = -Wall -Wno-expansion-to-defined -Wcast-align +build_src_flags = -Wall -Wno-expansion-to-defined -Wcast-align release_flags = -g0 -O3 -flto debug_build_flags = -fstack-protector-strong -g -g3 -ggdb lib_compat_mode = off -src_filter = ${common.default_src_filter} + +build_src_filter = ${common.default_src_filter} + lib_deps = ${common.lib_deps} MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/0.0.2.zip Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/marlin_sim_native.zip @@ -110,6 +110,6 @@ custom_gcc = g++ # [env:simulator_windows] extends = simulator_common -src_build_flags = ${simulator_common.src_build_flags} -fpermissive +build_src_flags = ${simulator_common.build_src_flags} -fpermissive build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp build_type = debug diff --git a/ini/samd51.ini b/ini/samd51.ini index 34fcc84371c8..d7d9b3a4211c 100644 --- a/ini/samd51.ini +++ b/ini/samd51.ini @@ -13,14 +13,14 @@ # Adafruit Grand Central M4 (Atmel SAMD51P20A ARM Cortex-M4) # [env:SAMD51_grandcentral_m4] -platform = atmelsam -board = adafruit_grandcentral_m4 -build_flags = ${common.build_flags} -std=gnu++17 -build_unflags = -std=gnu++11 -src_filter = ${common.default_src_filter} + -lib_deps = ${common.lib_deps} - SoftwareSerialM -extra_scripts = ${common.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py +platform = atmelsam +board = adafruit_grandcentral_m4 +build_flags = ${common.build_flags} -std=gnu++17 +build_unflags = -std=gnu++11 +build_src_filter = ${common.default_src_filter} + +lib_deps = ${common.lib_deps} + SoftwareSerialM +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py custom_marlin.SDSUPPORT = SdFat - Adafruit Fork, Adafruit SPIFlash -debug_tool = jlink +debug_tool = jlink diff --git a/ini/stm32-common.ini b/ini/stm32-common.ini index 1d3f858bf8e9..c8f28cd0e314 100644 --- a/ini/stm32-common.ini +++ b/ini/stm32-common.ini @@ -18,7 +18,7 @@ build_flags = ${common.build_flags} -DTIM_IRQ_PRIO=13 -DADC_RESOLUTION=12 build_unflags = -std=gnu++11 -src_filter = ${common.default_src_filter} + + +build_src_filter = ${common.default_src_filter} + + extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py diff --git a/ini/stm32f0.ini b/ini/stm32f0.ini index d6251344c365..d62ac3acf54f 100644 --- a/ini/stm32f0.ini +++ b/ini/stm32f0.ini @@ -43,9 +43,9 @@ build_flags = ${common_stm32.build_flags} # Malyan M300 (STM32F070CB) # [env:malyan_M300] -extends = common_stm32 -board = malyanm300_f070cb -build_flags = ${common_stm32.build_flags} - -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB - -DHAL_UART_MODULE_ENABLED -src_filter = ${common.default_src_filter} + +extends = common_stm32 +board = malyanm300_f070cb +build_flags = ${common_stm32.build_flags} + -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB + -DHAL_UART_MODULE_ENABLED +build_src_filter = ${common.default_src_filter} + diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index f0a0f9375850..bfa82876286e 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -28,7 +28,7 @@ board_build.core = maple build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py ${common.build_flags} -DARDUINO_ARCH_STM32 -DMAPLE_STM32F1 build_unflags = -std=gnu11 -std=gnu++11 -src_filter = ${common.default_src_filter} + +build_src_filter = ${common.default_src_filter} + lib_ignore = SPI, FreeRTOS701, FreeRTOS821 lib_deps = ${common.lib_deps} SoftwareSerialM diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 464048adcb1a..6bf6a1cb851c 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -249,12 +249,12 @@ build_unflags = ${stm32_variant.build_unflags} # Malyan M200 (STM32F103CB) # [env:STM32F103CB_malyan] -extends = common_stm32 -board = malyanm200_f103cb -build_flags = ${common_stm32.build_flags} - -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB - -DHAL_UART_MODULE_ENABLED -src_filter = ${common.default_src_filter} + +extends = common_stm32 +board = malyanm200_f103cb +build_flags = ${common_stm32.build_flags} + -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB + -DHAL_UART_MODULE_ENABLED +build_src_filter = ${common.default_src_filter} + # # FLYmaker FLY Mini (STM32F103RCT6) diff --git a/ini/teensy.ini b/ini/teensy.ini index ab0617b5b7b5..dac4b40c3053 100644 --- a/ini/teensy.ini +++ b/ini/teensy.ini @@ -45,36 +45,36 @@ board = teensy2pp # Teensy 3.x - 4.x # [teensy_arm] -platform = teensy@~4.12.0 -src_filter = ${common.default_src_filter} -lib_ignore = NativeEthernet +platform = teensy@~4.12.0 +build_src_filter = ${common.default_src_filter} +lib_ignore = NativeEthernet # # Teensy 3.1 / 3.2 (ARM Cortex-M4) # [env:teensy31] -extends = teensy_arm -board = teensy31 -src_filter = ${teensy_arm.src_filter} + +extends = teensy_arm +board = teensy31 +build_src_filter = ${teensy_arm.build_src_filter} + # # Teensy 3.5 / 3.6 (ARM Cortex-M4) # [env:teensy35] -extends = teensy_arm -board = teensy35 -src_filter = ${teensy_arm.src_filter} + +extends = teensy_arm +board = teensy35 +build_src_filter = ${teensy_arm.build_src_filter} + [env:teensy36] -extends = teensy_arm -board = teensy36 -src_filter = ${teensy_arm.src_filter} + +extends = teensy_arm +board = teensy36 +build_src_filter = ${teensy_arm.build_src_filter} + # # Teensy 4.0 / 4.1 (ARM Cortex-M7) # [env:teensy41] -extends = teensy_arm -board = teensy41 -src_filter = ${teensy_arm.src_filter} + -lib_ignore = +extends = teensy_arm +board = teensy41 +build_src_filter = ${teensy_arm.build_src_filter} + +lib_ignore = diff --git a/platformio.ini b/platformio.ini index 29e81782dd0d..d9fdc862e836 100644 --- a/platformio.ini +++ b/platformio.ini @@ -280,7 +280,7 @@ monitor_flags = # Just print the dependency tree # [env:include_tree] -platform = atmelavr -board = megaatmega2560 -build_flags = -c -H -std=gnu++11 -Wall -Os -D__MARLIN_FIRMWARE__ -src_filter = + +platform = atmelavr +board = megaatmega2560 +build_flags = -c -H -std=gnu++11 -Wall -Os -D__MARLIN_FIRMWARE__ +build_src_filter = + From 1e7219f4a643f8cbdbcd9685ebb5a76d02c89601 Mon Sep 17 00:00:00 2001 From: Marcio T Date: Thu, 19 May 2022 09:45:48 -0600 Subject: [PATCH 312/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20FTDI=5FEVE=5FTOUCH?= =?UTF-8?q?=5FUI=20reboot=20loop=20(#24195)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/buttons.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/buttons.h b/Marlin/src/lcd/buttons.h index 429fb971ec83..2580a71d1b82 100644 --- a/Marlin/src/lcd/buttons.h +++ b/Marlin/src/lcd/buttons.h @@ -26,7 +26,7 @@ #if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL #define HAS_ENCODER_WHEEL 1 #endif -#if HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT) +#if (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT)) && DISABLED(TOUCH_UI_FTDI_EVE) #define HAS_DIGITAL_BUTTONS 1 #endif #if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL)) From 8a301196e11d87d7e9db065d0d802910a664c5be Mon Sep 17 00:00:00 2001 From: Arthur Masson Date: Sat, 21 May 2022 21:45:30 +0200 Subject: [PATCH 313/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Polargraph=20G92?= =?UTF-8?q?=20command=20(#24223)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/geometry/G92.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/geometry/G92.cpp b/Marlin/src/gcode/geometry/G92.cpp index 3c49fe2a2640..4fc882f6ecf3 100644 --- a/Marlin/src/gcode/geometry/G92.cpp +++ b/Marlin/src/gcode/geometry/G92.cpp @@ -93,7 +93,7 @@ void GcodeSuite::G92() { v = TERN0(HAS_EXTRUDERS, i == E_AXIS) ? l : LOGICAL_TO_NATIVE(l, i), // Axis position in NATIVE space (applying the existing offset) d = v - current_position[i]; // How much is the current axis position altered by? if (!NEAR_ZERO(d)) { - #if HAS_POSITION_SHIFT && !IS_SCARA // When using workspaces... + #if HAS_POSITION_SHIFT && NONE(IS_SCARA, POLARGRAPH) // When using workspaces... if (TERN1(HAS_EXTRUDERS, i != E_AXIS)) { position_shift[i] += d; // ...most axes offset the workspace... update_workspace_offset((AxisEnum)i); From 06c4a9acdb3f08a2052ea55d00fa350e9249bcb4 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sat, 21 May 2022 16:13:00 -0700 Subject: [PATCH 314/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20FLSUN=20Hispeed=20?= =?UTF-8?q?FIL=5FRUNOUT=5FPIN,=20MKS=20Robin=20Mini=20TFT=20pins=20(#24204?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 8 ++++---- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index ada12ee3ea4b..9efae6e3a887 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -41,7 +41,7 @@ #define BOARD_NO_NATIVE_USB // Avoid conflict with TIMER_SERVO when using the STM32 HAL -#define TEMP_TIMER 5 +#define TEMP_TIMER 5 // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role @@ -92,7 +92,7 @@ #define Z_MAX_PIN PC4 // +Z #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN MT_DET_1_PIN + #define FIL_RUNOUT_PIN PA4 // MT_DET #endif // @@ -217,14 +217,14 @@ // #if ENABLED(PSU_CONTROL) #define KILL_PIN PA2 // PW_DET - #define KILL_PIN_STATE HIGH + #define KILL_PIN_STATE HIGH //#define PS_ON_PIN PA3 // PW_CN /PW_OFF #endif #if HAS_TFT_LVGL_UI #define MT_DET_1_PIN PA4 // MT_DET #define MT_DET_2_PIN PE6 - #define MT_DET_PIN_STATE LOW + #define MT_DET_PIN_STATE LOW #endif // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index d45ab1a950ec..dac09d037fc6 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -153,6 +153,9 @@ #define FSMC_CS_PIN PD7 // NE4 #define FSMC_RS_PIN PD11 // A0 + #define TFT_CS_PIN FSMC_CS_PIN + #define TFT_RS_PIN FSMC_RS_PIN + #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 From b72f9277e9e89a7dcdc12c8f11273f7c76a064d4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 19 May 2022 06:05:52 -0500 Subject: [PATCH 315/502] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Common=20Bed=20Lev?= =?UTF-8?q?eling=20object=20name,=20accessors=20(#24214)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/inc/SanityCheck.h | 6 +- Marlin/src/HAL/DUE/inc/SanityCheck.h | 6 +- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/core/utility.cpp | 8 +- Marlin/src/feature/bedlevel/abl/bbl.cpp | 4 +- Marlin/src/feature/bedlevel/abl/bbl.h | 21 ++- Marlin/src/feature/bedlevel/bedlevel.cpp | 37 +++-- Marlin/src/feature/bedlevel/bedlevel.h | 5 +- .../bedlevel/mbl/mesh_bed_leveling.cpp | 2 +- .../feature/bedlevel/mbl/mesh_bed_leveling.h | 21 ++- Marlin/src/feature/bedlevel/ubl/ubl.cpp | 2 +- Marlin/src/feature/bedlevel/ubl/ubl.h | 35 +++-- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 44 +++--- .../src/feature/bedlevel/ubl/ubl_motion.cpp | 21 ++- Marlin/src/gcode/bedlevel/G26.cpp | 16 +-- Marlin/src/gcode/bedlevel/G42.cpp | 4 +- Marlin/src/gcode/bedlevel/M420.cpp | 34 ++--- Marlin/src/gcode/bedlevel/abl/G29.cpp | 28 ++-- Marlin/src/gcode/bedlevel/abl/M421.cpp | 6 +- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 18 +-- Marlin/src/gcode/bedlevel/mbl/M421.cpp | 6 +- Marlin/src/gcode/bedlevel/ubl/G29.cpp | 2 +- Marlin/src/gcode/bedlevel/ubl/M421.cpp | 4 +- Marlin/src/gcode/control/M17_M18_M84.cpp | 2 +- Marlin/src/gcode/motion/M290.cpp | 2 +- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 16 +-- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 8 +- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 10 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 132 +++++++++--------- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 10 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 32 ++--- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 2 +- Marlin/src/lcd/e3v2/proui/ubl_tools.cpp | 65 ++++----- .../lcd/extui/dgus_reloaded/DGUSTxHandler.cpp | 4 +- Marlin/src/lcd/extui/ui_api.cpp | 6 +- Marlin/src/lcd/marlinui.cpp | 2 +- Marlin/src/lcd/menu/menu.cpp | 4 +- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 4 +- Marlin/src/lcd/menu/menu_tune.cpp | 2 +- Marlin/src/lcd/menu/menu_ubl.cpp | 26 ++-- Marlin/src/lcd/tft/touch.cpp | 4 +- Marlin/src/lcd/tft/ui_1024x600.cpp | 14 +- Marlin/src/lcd/tft/ui_320x240.cpp | 6 +- Marlin/src/lcd/tft/ui_480x320.cpp | 6 +- Marlin/src/module/motion.cpp | 12 +- Marlin/src/module/planner.cpp | 32 ++--- Marlin/src/module/settings.cpp | 89 ++++++------ 47 files changed, 389 insertions(+), 433 deletions(-) diff --git a/Marlin/src/HAL/AVR/inc/SanityCheck.h b/Marlin/src/HAL/AVR/inc/SanityCheck.h index 7936de8b9903..1c1d8d441351 100644 --- a/Marlin/src/HAL/AVR/inc/SanityCheck.h +++ b/Marlin/src/HAL/AVR/inc/SanityCheck.h @@ -37,16 +37,16 @@ || X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \ ) #if CONF_SERIAL_IS(0) // D0-D1. No known conflicts. -#endif +#endif #if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19)) #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board." -#endif +#endif #if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17)) #error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board." #endif #if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15)) #error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board." -#endif +#endif #undef CHECK_SERIAL_PIN /** diff --git a/Marlin/src/HAL/DUE/inc/SanityCheck.h b/Marlin/src/HAL/DUE/inc/SanityCheck.h index dd37a7bde183..13484f7029d1 100644 --- a/Marlin/src/HAL/DUE/inc/SanityCheck.h +++ b/Marlin/src/HAL/DUE/inc/SanityCheck.h @@ -37,16 +37,16 @@ || X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \ ) #if CONF_SERIAL_IS(0) // D0-D1. No known conflicts. -#endif +#endif #if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19)) #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board." -#endif +#endif #if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17)) #error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board." #endif #if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15)) #error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board." -#endif +#endif #undef CHECK_SERIAL_PIN /** diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 9311b917baa2..72c9a1392c1c 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -443,7 +443,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { TERN_(DISABLE_INACTIVE_K, stepper.disable_axis(K_AXIS)); TERN_(DISABLE_INACTIVE_E, stepper.disable_e_steppers()); - TERN_(AUTO_BED_LEVELING_UBL, ubl.steppers_were_disabled()); + TERN_(AUTO_BED_LEVELING_UBL, bedlevel.steppers_were_disabled()); } } else diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index 4e16e2693a4d..060e74d9fe66 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -132,10 +132,10 @@ void safe_delay(millis_t ms) { #else #if ENABLED(AUTO_BED_LEVELING_UBL) SERIAL_ECHOPGM("UBL Adjustment Z"); - const float rz = ubl.get_z_correction(current_position); + const float rz = bedlevel.get_z_correction(current_position); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) SERIAL_ECHOPGM("ABL Adjustment Z"); - const float rz = bbl.get_z_correction(current_position); + const float rz = bedlevel.get_z_correction(current_position); #endif SERIAL_ECHO(ftostr43sign(rz, '+')); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) @@ -156,11 +156,11 @@ void safe_delay(millis_t ms) { SERIAL_ECHOPGM("Mesh Bed Leveling"); if (planner.leveling_active) { SERIAL_ECHOLNPGM(" (enabled)"); - SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position), '+')); + SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(bedlevel.get_z(current_position), '+')); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) if (planner.z_fade_height) { SERIAL_ECHOPGM(" (", ftostr43sign( - mbl.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+' + bedlevel.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+' )); SERIAL_CHAR(')'); } diff --git a/Marlin/src/feature/bedlevel/abl/bbl.cpp b/Marlin/src/feature/bedlevel/abl/bbl.cpp index 9dcd66912893..be0e862cc16a 100644 --- a/Marlin/src/feature/bedlevel/abl/bbl.cpp +++ b/Marlin/src/feature/bedlevel/abl/bbl.cpp @@ -35,7 +35,7 @@ #include "../../../lcd/extui/ui_api.h" #endif -LevelingBilinear bbl; +LevelingBilinear bedlevel; xy_pos_t LevelingBilinear::grid_spacing, LevelingBilinear::grid_start; @@ -258,8 +258,8 @@ void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values /*= NULL* ); } } -#endif // ABL_BILINEAR_SUBDIVISION +#endif // ABL_BILINEAR_SUBDIVISION // Refresh after other values have been updated void LevelingBilinear::refresh_bed_level() { diff --git a/Marlin/src/feature/bedlevel/abl/bbl.h b/Marlin/src/feature/bedlevel/abl/bbl.h index fbdb22cd00c9..c2be4fee821c 100644 --- a/Marlin/src/feature/bedlevel/abl/bbl.h +++ b/Marlin/src/feature/bedlevel/abl/bbl.h @@ -24,10 +24,12 @@ #include "../../../inc/MarlinConfigPre.h" class LevelingBilinear { -private: +public: + static bed_mesh_t z_values; static xy_pos_t grid_spacing, grid_start; + +private: static xy_float_t grid_factor; - static bed_mesh_t z_values; static xy_pos_t cached_rel; static xy_int8_t cached_g; @@ -54,20 +56,15 @@ class LevelingBilinear { static void print_leveling_grid(const bed_mesh_t* _z_values = NULL); static void refresh_bed_level(); static bool has_mesh() { return !!grid_spacing.x; } - static bed_mesh_t& get_z_values() { return z_values; } - static const xy_pos_t& get_grid_spacing() { return grid_spacing; } - static const xy_pos_t& get_grid_start() { return grid_start; } - static float get_mesh_x(int16_t i) { return grid_start.x + i * grid_spacing.x; } - static float get_mesh_y(int16_t j) { return grid_start.y + j * grid_spacing.y; } + static bool mesh_is_valid() { return has_mesh(); } + static float get_mesh_x(const uint8_t i) { return grid_start.x + i * grid_spacing.x; } + static float get_mesh_y(const uint8_t j) { return grid_start.y + j * grid_spacing.y; } static float get_z_correction(const xy_pos_t &raw); + static constexpr float get_z_offset() { return 0.0f; } #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) static void line_to_destination(const_feedRate_t scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF); #endif }; -extern LevelingBilinear bbl; - -#define _GET_MESH_X(I) bbl.get_mesh_x(I) -#define _GET_MESH_Y(J) bbl.get_mesh_y(J) -#define Z_VALUES_ARR bbl.get_z_values() +extern LevelingBilinear bedlevel; diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 2405905d4e65..f9d17a69a13f 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -47,14 +47,11 @@ #endif bool leveling_is_valid() { - return TERN1(MESH_BED_LEVELING, mbl.has_mesh()) - && TERN1(AUTO_BED_LEVELING_BILINEAR, bbl.has_mesh()) - && TERN1(AUTO_BED_LEVELING_UBL, ubl.mesh_is_valid()); + return TERN1(HAS_MESH, bedlevel.mesh_is_valid()); } /** - * Turn bed leveling on or off, fixing the current - * position as-needed. + * Turn bed leveling on or off, correcting the current position. * * Disable: Current position = physical position * Enable: Current position = "unleveled" physical position @@ -65,24 +62,31 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { if (can_change && enable != planner.leveling_active) { + auto _report_leveling = []{ + if (DEBUGGING(LEVELING)) { + if (planner.leveling_active) + DEBUG_POS("Leveling ON", current_position); + else + DEBUG_POS("Leveling OFF", current_position); + } + }; + + _report_leveling(); planner.synchronize(); if (planner.leveling_active) { // leveling from on to off - if (DEBUGGING(LEVELING)) DEBUG_POS("Leveling ON", current_position); // change unleveled current_position to physical current_position without moving steppers. planner.apply_leveling(current_position); planner.leveling_active = false; // disable only AFTER calling apply_leveling - if (DEBUGGING(LEVELING)) DEBUG_POS("...Now OFF", current_position); } else { // leveling from off to on - if (DEBUGGING(LEVELING)) DEBUG_POS("Leveling OFF", current_position); planner.leveling_active = true; // enable BEFORE calling unapply_leveling, otherwise ignored // change physical current_position to unleveled current_position without moving steppers. planner.unapply_leveling(current_position); - if (DEBUGGING(LEVELING)) DEBUG_POS("...Now ON", current_position); } sync_plan_position(); + _report_leveling(); } } @@ -116,18 +120,9 @@ TemporaryBedLevelingState::TemporaryBedLevelingState(const bool enable) : saved( */ void reset_bed_level() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("reset_bed_level"); - #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.reset(); - #else - set_bed_leveling_enabled(false); - #if ENABLED(MESH_BED_LEVELING) - mbl.reset(); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bbl.reset(); - #elif ABL_PLANAR - planner.bed_level_matrix.set_to_identity(); - #endif - #endif + IF_DISABLED(AUTO_BED_LEVELING_UBL, set_bed_leveling_enabled(false)); + TERN_(HAS_MESH, bedlevel.reset()); + TERN_(ABL_PLANAR, planner.bed_level_matrix.set_to_identity()); } #if EITHER(AUTO_BED_LEVELING_BILINEAR, MESH_BED_LEVELING) diff --git a/Marlin/src/feature/bedlevel/bedlevel.h b/Marlin/src/feature/bedlevel/bedlevel.h index f295da1d037a..aeafec10d6ab 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.h +++ b/Marlin/src/feature/bedlevel/bedlevel.h @@ -69,9 +69,6 @@ class TemporaryBedLevelingState { #include "mbl/mesh_bed_leveling.h" #endif - #define Z_VALUES(X,Y) Z_VALUES_ARR[X][Y] - #define _GET_MESH_POS(M) { _GET_MESH_X(M.a), _GET_MESH_Y(M.b) } - #if EITHER(AUTO_BED_LEVELING_BILINEAR, MESH_BED_LEVELING) #include @@ -92,7 +89,7 @@ class TemporaryBedLevelingState { bool valid() const { return pos.x >= 0 && pos.y >= 0; } #if ENABLED(AUTO_BED_LEVELING_UBL) xy_pos_t meshpos() { - return { ubl.mesh_index_to_xpos(pos.x), ubl.mesh_index_to_ypos(pos.y) }; + return { bedlevel.get_mesh_x(pos.x), bedlevel.get_mesh_y(pos.y) }; } #endif operator xy_int8_t&() { return pos; } diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp index fbc3f2785e14..193cbbf7654a 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp @@ -32,7 +32,7 @@ #include "../../../lcd/extui/ui_api.h" #endif - mesh_bed_leveling mbl; + mesh_bed_leveling bedlevel; float mesh_bed_leveling::z_offset, mesh_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h index 06fae16c21e9..1a8e693e8180 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h @@ -34,9 +34,6 @@ enum MeshLevelingState : char { #define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_CELLS_X)) #define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / (GRID_MAX_CELLS_Y)) -#define _GET_MESH_X(I) mbl.index_to_xpos[I] -#define _GET_MESH_Y(J) mbl.index_to_ypos[J] -#define Z_VALUES_ARR mbl.z_values class mesh_bed_leveling { public: @@ -56,6 +53,8 @@ class mesh_bed_leveling { return false; } + static bool mesh_is_valid() { return has_mesh(); } + static void set_z(const int8_t px, const int8_t py, const_float_t z) { z_values[px][py] = z; } static void zigzag(const int8_t index, int8_t &px, int8_t &py) { @@ -70,6 +69,9 @@ class mesh_bed_leveling { set_z(px, py, z); } + static float get_mesh_x(const uint8_t i) { return index_to_xpos[i]; } + static float get_mesh_y(const uint8_t i) { return index_to_ypos[i]; } + static int8_t cell_index_x(const_float_t x) { int8_t cx = (x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST); return constrain(cx, 0, GRID_MAX_CELLS_X - 1); @@ -102,12 +104,9 @@ class mesh_bed_leveling { return z1 + delta_a * delta_z; } - static float get_z(const xy_pos_t &pos - OPTARG(ENABLE_LEVELING_FADE_HEIGHT, const_float_t factor=1.0f) - ) { - #if DISABLED(ENABLE_LEVELING_FADE_HEIGHT) - constexpr float factor = 1.0f; - #endif + static float get_z_offset() { return z_offset; } + + static float get_z_correction(const xy_pos_t &pos) { const xy_int8_t ind = cell_indexes(pos); const float x1 = index_to_xpos[ind.x], x2 = index_to_xpos[ind.x+1], y1 = index_to_xpos[ind.y], y2 = index_to_xpos[ind.y+1], @@ -115,7 +114,7 @@ class mesh_bed_leveling { z2 = calc_z0(pos.x, x1, z_values[ind.x][ind.y+1], x2, z_values[ind.x+1][ind.y+1]), zf = calc_z0(pos.y, y1, z1, y2, z2); - return z_offset + zf * factor; + return zf; } #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) @@ -123,4 +122,4 @@ class mesh_bed_leveling { #endif }; -extern mesh_bed_leveling mbl; +extern mesh_bed_leveling bedlevel; diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp index c162062f8609..2aa50be34d26 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp @@ -26,7 +26,7 @@ #include "../bedlevel.h" -unified_bed_leveling ubl; +unified_bed_leveling bedlevel; #include "../../../MarlinCore.h" #include "../../../gcode/gcode.h" diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 9dd964c46cfb..a7103d6e18c4 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -215,7 +215,7 @@ class unified_bed_leveling { return _UBL_OUTER_Z_RAISE; } - const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * RECIPROCAL(MESH_X_DIST), + const float xratio = (rx0 - get_mesh_x(x1_i)) * RECIPROCAL(MESH_X_DIST), z1 = z_values[x1_i][yi]; return z1 + xratio * (z_values[_MIN(x1_i, (GRID_MAX_POINTS_X) - 2) + 1][yi] - z1); // Don't allow x1_i+1 to be past the end of the array @@ -238,7 +238,7 @@ class unified_bed_leveling { return _UBL_OUTER_Z_RAISE; } - const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * RECIPROCAL(MESH_Y_DIST), + const float yratio = (ry0 - get_mesh_y(y1_i)) * RECIPROCAL(MESH_Y_DIST), z1 = z_values[xi][y1_i]; return z1 + yratio * (z_values[xi][_MIN(y1_i, (GRID_MAX_POINTS_Y) - 2) + 1] - z1); // Don't allow y1_i+1 to be past the end of the array @@ -264,16 +264,17 @@ class unified_bed_leveling { return UBL_Z_RAISE_WHEN_OFF_MESH; #endif - const uint8_t mx = _MIN(cx, (GRID_MAX_POINTS_X) - 2) + 1, my = _MIN(cy, (GRID_MAX_POINTS_Y) - 2) + 1; - const float z1 = calc_z0(rx0, mesh_index_to_xpos(cx), z_values[cx][cy], mesh_index_to_xpos(cx + 1), z_values[mx][cy]); - const float z2 = calc_z0(rx0, mesh_index_to_xpos(cx), z_values[cx][my], mesh_index_to_xpos(cx + 1), z_values[mx][my]); - float z0 = calc_z0(ry0, mesh_index_to_ypos(cy), z1, mesh_index_to_ypos(cy + 1), z2); + const uint8_t mx = _MIN(cx, (GRID_MAX_POINTS_X) - 2) + 1, my = _MIN(cy, (GRID_MAX_POINTS_Y) - 2) + 1, + x0 = get_mesh_x(cx), x1 = get_mesh_x(cx + 1); + const float z1 = calc_z0(rx0, x0, z_values[cx][cy], x1, z_values[mx][cy]), + z2 = calc_z0(rx0, x0, z_values[cx][my], x1, z_values[mx][my]); + float z0 = calc_z0(ry0, get_mesh_y(cy), z1, get_mesh_y(cy + 1), z2); - if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN - z0 = 0.0; // in ubl.z_values[][] and propagate through the - // calculations. If our correction is NAN, we throw it out - // because part of the Mesh is undefined and we don't have the - // information we need to complete the height correction. + if (isnan(z0)) { // If part of the Mesh is undefined, it will show up as NAN + z0 = 0.0; // in z_values[][] and propagate through the calculations. + // If our correction is NAN, we throw it out because part of + // the Mesh is undefined and we don't have the information + // needed to complete the height correction. if (DEBUGGING(MESH_ADJUST)) DEBUG_ECHOLNPGM("??? Yikes! NAN in "); } @@ -287,10 +288,12 @@ class unified_bed_leveling { } static float get_z_correction(const xy_pos_t &pos) { return get_z_correction(pos.x, pos.y); } - static float mesh_index_to_xpos(const uint8_t i) { + static constexpr float get_z_offset() { return 0.0f; } + + static float get_mesh_x(const uint8_t i) { return i < (GRID_MAX_POINTS_X) ? pgm_read_float(&_mesh_index_to_xpos[i]) : MESH_MIN_X + i * (MESH_X_DIST); } - static float mesh_index_to_ypos(const uint8_t i) { + static float get_mesh_y(const uint8_t i) { return i < (GRID_MAX_POINTS_Y) ? pgm_read_float(&_mesh_index_to_ypos[i]) : MESH_MIN_Y + i * (MESH_Y_DIST); } @@ -307,11 +310,7 @@ class unified_bed_leveling { }; // class unified_bed_leveling -extern unified_bed_leveling ubl; - -#define _GET_MESH_X(I) ubl.mesh_index_to_xpos(I) -#define _GET_MESH_Y(J) ubl.mesh_index_to_ypos(J) -#define Z_VALUES_ARR ubl.z_values +extern unified_bed_leveling bedlevel; // Prevent debugging propagating to other files #include "../../../core/debug_out.h" diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 06cd1954702a..eed9f61ebbcf 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -905,11 +905,7 @@ void set_message_with_feedback(FSTR_P const fstr) { // It doesn't matter if the probe can't reach the NAN location. This is a manual probe. if (!location.valid()) continue; - const xyz_pos_t ppos = { - mesh_index_to_xpos(lpos.x), - mesh_index_to_ypos(lpos.y), - z_clearance - }; + const xyz_pos_t ppos = { get_mesh_x(lpos.x), get_mesh_y(lpos.y), z_clearance }; if (!position_is_reachable(ppos)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points) @@ -1004,11 +1000,7 @@ void set_message_with_feedback(FSTR_P const fstr) { done_flags.mark(lpos); // Mark this location as 'adjusted' so a new // location is used on the next loop - const xyz_pos_t raw = { - mesh_index_to_xpos(lpos.x), - mesh_index_to_ypos(lpos.y), - Z_CLEARANCE_BETWEEN_PROBES - }; + const xyz_pos_t raw = { get_mesh_x(lpos.x), get_mesh_y(lpos.y), Z_CLEARANCE_BETWEEN_PROBES }; if (!position_is_reachable(raw)) break; // SHOULD NOT OCCUR (find_closest_mesh_point_of_type only returns reachable) @@ -1241,7 +1233,7 @@ mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { if (!isnan(z_values[i][j])) continue; // Skip valid mesh points // Skip unreachable points - if (!probe.can_reach(mesh_index_to_xpos(i), mesh_index_to_ypos(j))) + if (!probe.can_reach(get_mesh_x(i), get_mesh_y(j))) continue; found_a_NAN = true; @@ -1293,11 +1285,11 @@ mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { static bool test_func(uint8_t i, uint8_t j, void *data) { find_closest_t *d = (find_closest_t*)data; - if ( d->type == CLOSEST || d->type == (isnan(ubl.z_values[i][j]) ? INVALID : REAL) + if ( d->type == CLOSEST || d->type == (isnan(bedlevel.z_values[i][j]) ? INVALID : REAL) || (d->type == SET_IN_BITMAP && !d->done_flags->marked(i, j)) ) { // Found a Mesh Point of the specified type! - const xy_pos_t mpos = { ubl.mesh_index_to_xpos(i), ubl.mesh_index_to_ypos(j) }; + const xy_pos_t mpos = { bedlevel.get_mesh_x(i), bedlevel.get_mesh_y(j) }; // If using the probe as the reference there are some unreachable locations. // Also for round beds, there are grid points outside the bed the nozzle can't reach. @@ -1341,7 +1333,7 @@ mesh_index_pair unified_bed_leveling::find_closest_mesh_point_of_type(const Mesh || (type == SET_IN_BITMAP && !done_flags->marked(i, j)) ) { // Found a Mesh Point of the specified type! - const xy_pos_t mpos = { mesh_index_to_xpos(i), mesh_index_to_ypos(j) }; + const xy_pos_t mpos = { get_mesh_x(i), get_mesh_y(j) }; // If using the probe as the reference there are some unreachable locations. // Also for round beds, there are grid points outside the bed the nozzle can't reach. @@ -1397,10 +1389,10 @@ typedef struct { uint8_t sx, ex, sy, ey; bool yfirst; } smart_fill_info; void unified_bed_leveling::smart_fill_mesh() { static const smart_fill_info - info0 PROGMEM = { 0, GRID_MAX_POINTS_X, 0, GRID_MAX_POINTS_Y - 2, false }, // Bottom of the mesh looking up - info1 PROGMEM = { 0, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - 1, 0, false }, // Top of the mesh looking down - info2 PROGMEM = { 0, GRID_MAX_POINTS_X - 2, 0, GRID_MAX_POINTS_Y, true }, // Left side of the mesh looking right - info3 PROGMEM = { GRID_MAX_POINTS_X - 1, 0, 0, GRID_MAX_POINTS_Y, true }; // Right side of the mesh looking left + info0 PROGMEM = { 0, GRID_MAX_POINTS_X, 0, (GRID_MAX_POINTS_Y) - 2, false }, // Bottom of the mesh looking up + info1 PROGMEM = { 0, GRID_MAX_POINTS_X, (GRID_MAX_POINTS_Y) - 1, 0, false }, // Top of the mesh looking down + info2 PROGMEM = { 0, (GRID_MAX_POINTS_X) - 2, 0, GRID_MAX_POINTS_Y, true }, // Left side of the mesh looking right + info3 PROGMEM = { (GRID_MAX_POINTS_X) - 1, 0, 0, GRID_MAX_POINTS_Y, true }; // Right side of the mesh looking left static const smart_fill_info * const info[] PROGMEM = { &info0, &info1, &info2, &info3 }; LOOP_L_N(i, COUNT(info)) { @@ -1589,9 +1581,7 @@ void unified_bed_leveling::smart_fill_mesh() { matrix_3x3 rotation = matrix_3x3::create_look_at(vector_3(lsf_results.A, lsf_results.B, 1)); GRID_LOOP(i, j) { - float mx = mesh_index_to_xpos(i), - my = mesh_index_to_ypos(j), - mz = z_values[i][j]; + float mx = get_mesh_x(i), my = get_mesh_y(j), mz = z_values[i][j]; if (DEBUGGING(LEVELING)) { DEBUG_ECHOPAIR_F("before rotation = [", mx, 7); @@ -1688,18 +1678,18 @@ void unified_bed_leveling::smart_fill_mesh() { xy_pos_t ppos; LOOP_L_N(ix, GRID_MAX_POINTS_X) { - ppos.x = mesh_index_to_xpos(ix); + ppos.x = get_mesh_x(ix); LOOP_L_N(iy, GRID_MAX_POINTS_Y) { - ppos.y = mesh_index_to_ypos(iy); + ppos.y = get_mesh_y(iy); if (isnan(z_values[ix][iy])) { // undefined mesh point at (ppos.x,ppos.y), compute weighted LSF from original valid mesh points. incremental_LSF_reset(&lsf_results); xy_pos_t rpos; LOOP_L_N(jx, GRID_MAX_POINTS_X) { - rpos.x = mesh_index_to_xpos(jx); + rpos.x = get_mesh_x(jx); LOOP_L_N(jy, GRID_MAX_POINTS_Y) { if (TEST(bitmap[jx], jy)) { - rpos.y = mesh_index_to_ypos(jy); + rpos.y = get_mesh_y(jy); const float rz = z_values[jx][jy], w = 1.0f + weight_scaled / (rpos - ppos).magnitude(); incremental_WLSF(&lsf_results, rpos, rz, w); @@ -1758,7 +1748,7 @@ void unified_bed_leveling::smart_fill_mesh() { SERIAL_ECHOPGM("X-Axis Mesh Points at: "); LOOP_L_N(i, GRID_MAX_POINTS_X) { - SERIAL_ECHO_F(LOGICAL_X_POSITION(mesh_index_to_xpos(i)), 3); + SERIAL_ECHO_F(LOGICAL_X_POSITION(get_mesh_x(i)), 3); SERIAL_ECHOPGM(" "); serial_delay(25); } @@ -1766,7 +1756,7 @@ void unified_bed_leveling::smart_fill_mesh() { SERIAL_ECHOPGM("Y-Axis Mesh Points at: "); LOOP_L_N(i, GRID_MAX_POINTS_Y) { - SERIAL_ECHO_F(LOGICAL_Y_POSITION(mesh_index_to_ypos(i)), 3); + SERIAL_ECHO_F(LOGICAL_Y_POSITION(get_mesh_y(i)), 3); SERIAL_ECHOPGM(" "); serial_delay(25); } diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp index 3da4ed9809f9..e6eec0de63fd 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp @@ -76,8 +76,8 @@ #endif // The distance is always MESH_X_DIST so multiply by the constant reciprocal. - const float xratio = (end.x - mesh_index_to_xpos(iend.x)) * RECIPROCAL(MESH_X_DIST), - yratio = (end.y - mesh_index_to_ypos(iend.y)) * RECIPROCAL(MESH_Y_DIST), + const float xratio = (end.x - get_mesh_x(iend.x)) * RECIPROCAL(MESH_X_DIST), + yratio = (end.y - get_mesh_y(iend.y)) * RECIPROCAL(MESH_Y_DIST), z1 = z_values[iend.x][iend.y ] + xratio * (z_values[iend.x + 1][iend.y ] - z_values[iend.x][iend.y ]), z2 = z_values[iend.x][iend.y + 1] + xratio * (z_values[iend.x + 1][iend.y + 1] - z_values[iend.x][iend.y + 1]); @@ -139,7 +139,7 @@ icell.y += ineg.y; // Line going down? Just go to the bottom. while (icell.y != iend.y + ineg.y) { icell.y += iadd.y; - const float next_mesh_line_y = mesh_index_to_ypos(icell.y); + const float next_mesh_line_y = get_mesh_y(icell.y); /** * Skip the calculations for an infinite slope. @@ -155,7 +155,7 @@ // Replace NAN corrections with 0.0 to prevent NAN propagation. if (isnan(z0)) z0 = 0.0; - dest.y = mesh_index_to_ypos(icell.y); + dest.y = get_mesh_y(icell.y); /** * Without this check, it's possible to generate a zero length move, as in the case where @@ -196,7 +196,7 @@ while (icell.x != iend.x + ineg.x) { icell.x += iadd.x; - dest.x = mesh_index_to_xpos(icell.x); + dest.x = get_mesh_x(icell.x); dest.y = ratio * dest.x + c; // Calculate Y at the next X mesh line float z0 = z_correction_for_y_on_vertical_mesh_line(dest.y, icell.x, icell.y) @@ -245,8 +245,8 @@ while (cnt) { - const float next_mesh_line_x = mesh_index_to_xpos(icell.x + iadd.x), - next_mesh_line_y = mesh_index_to_ypos(icell.y + iadd.y); + const float next_mesh_line_x = get_mesh_x(icell.x + iadd.x), + next_mesh_line_y = get_mesh_y(icell.y + iadd.y); dest.y = ratio * next_mesh_line_x + c; // Calculate Y at the next X mesh line dest.x = (next_mesh_line_y - c) / ratio; // Calculate X at the next Y mesh line @@ -423,7 +423,7 @@ if (isnan(z_x0y1)) z_x0y1 = 0; // in order to avoid isnan tests per cell, if (isnan(z_x1y1)) z_x1y1 = 0; // thus guessing zero for undefined points - const xy_pos_t pos = { mesh_index_to_xpos(icell.x), mesh_index_to_ypos(icell.y) }; + const xy_pos_t pos = { get_mesh_x(icell.x), get_mesh_y(icell.y) }; xy_pos_t cell = raw - pos; const float z_xmy0 = (z_x1y0 - z_x0y0) * RECIPROCAL(MESH_X_DIST), // z slope per x along y0 (lower left to lower right) @@ -450,10 +450,7 @@ if (--segments == 0) raw = destination; // if this is last segment, use destination for exact const float z_cxcy = (z_cxy0 + z_cxym * cell.y) // interpolated mesh z height along cell.x at cell.y - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - * fade_scaling_factor // apply fade factor to interpolated mesh height - #endif - ; + TERN_(ENABLE_LEVELING_FADE_HEIGHT, * fade_scaling_factor); // apply fade factor to interpolated height const float oldz = raw.z; raw.z += z_cxcy; planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, segment_xyz_mm OPTARG(SCARA_FEEDRATE_SCALING, inv_duration) ); diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 6691d6c9ab55..21fa08fc107a 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -293,10 +293,10 @@ typedef struct { if (circle_flags.marked(p1.x, p1.y) && circle_flags.marked(p2.x, p2.y)) { xyz_pos_t s, e; - s.x = _GET_MESH_X(p1.x) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)) * dx; - e.x = _GET_MESH_X(p2.x) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)) * dx; - s.y = _GET_MESH_Y(p1.y) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)) * dy; - e.y = _GET_MESH_Y(p2.y) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)) * dy; + s.x = bedlevel.get_mesh_x(p1.x) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)) * dx; + e.x = bedlevel.get_mesh_x(p2.x) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)) * dx; + s.y = bedlevel.get_mesh_y(p1.y) + (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)) * dy; + e.y = bedlevel.get_mesh_y(p2.y) - (INTERSECTION_CIRCLE_RADIUS - (CROSSHAIRS_SIZE)) * dy; s.z = e.z = layer_height; #if HAS_ENDSTOPS @@ -448,7 +448,7 @@ typedef struct { GRID_LOOP(i, j) { if (!circle_flags.marked(i, j)) { // We found a circle that needs to be printed - const xy_pos_t m = { _GET_MESH_X(i), _GET_MESH_Y(j) }; + const xy_pos_t m = { bedlevel.get_mesh_x(i), bedlevel.get_mesh_y(j) }; // Get the distance to this intersection float f = (pos - m).magnitude(); @@ -729,7 +729,7 @@ void GcodeSuite::G26() { if (location.valid()) { TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(location.pos, ExtUI::G26_POINT_START)); - const xy_pos_t circle = _GET_MESH_POS(location.pos); + const xy_pos_t circle = { bedlevel.get_mesh_x(location.pos.a), bedlevel.get_mesh_y(location.pos.b) }; // If this mesh location is outside the printable radius, skip it. if (!position_is_reachable(circle)) continue; @@ -738,8 +738,8 @@ void GcodeSuite::G26() { // which is always drawn counter-clockwise. const xy_int8_t st = location; const bool f = st.y == 0, - r = st.x >= GRID_MAX_POINTS_X - 1, - b = st.y >= GRID_MAX_POINTS_Y - 1; + r = st.x >= (GRID_MAX_POINTS_X) - 1, + b = st.y >= (GRID_MAX_POINTS_Y) - 1; #if ENABLED(ARC_SUPPORT) diff --git a/Marlin/src/gcode/bedlevel/G42.cpp b/Marlin/src/gcode/bedlevel/G42.cpp index a2896ed6c705..cb5ed9740604 100644 --- a/Marlin/src/gcode/bedlevel/G42.cpp +++ b/Marlin/src/gcode/bedlevel/G42.cpp @@ -48,8 +48,8 @@ void GcodeSuite::G42() { // Move to current_position, as modified by I, J, P parameters destination = current_position; - if (hasI) destination.x = _GET_MESH_X(ix); - if (hasJ) destination.y = _GET_MESH_Y(iy); + if (hasI) destination.x = bedlevel.get_mesh_x(ix); + if (hasJ) destination.y = bedlevel.get_mesh_y(iy); #if HAS_PROBE_XY_OFFSET if (parser.boolval('P')) { diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index c8325b1fc5c1..277f95b9ffe1 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -71,13 +71,13 @@ void GcodeSuite::M420() { start.set(x_min, y_min); spacing.set((x_max - x_min) / (GRID_MAX_CELLS_X), (y_max - y_min) / (GRID_MAX_CELLS_Y)); - bbl.set_grid(spacing, start); + bedlevel.set_grid(spacing, start); #endif GRID_LOOP(x, y) { - Z_VALUES(x, y) = 0.001 * random(-200, 200); - TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y))); + bedlevel.z_values[x][y] = 0.001 * random(-200, 200); + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, bedlevel.z_values[x][y])); } - TERN_(AUTO_BED_LEVELING_BILINEAR, bbl.refresh_bed_level()); + TERN_(AUTO_BED_LEVELING_BILINEAR, bedlevel.refresh_bed_level()); SERIAL_ECHOPGM("Simulated " STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh "); SERIAL_ECHOPGM(" (", x_min); SERIAL_CHAR(','); SERIAL_ECHO(y_min); @@ -101,7 +101,7 @@ void GcodeSuite::M420() { set_bed_leveling_enabled(false); #if ENABLED(EEPROM_SETTINGS) - const int8_t storage_slot = parser.has_value() ? parser.value_int() : ubl.storage_slot; + const int8_t storage_slot = parser.has_value() ? parser.value_int() : bedlevel.storage_slot; const int16_t a = settings.calc_num_meshes(); if (!a) { @@ -116,7 +116,7 @@ void GcodeSuite::M420() { } settings.load_mesh(storage_slot); - ubl.storage_slot = storage_slot; + bedlevel.storage_slot = storage_slot; #else @@ -128,10 +128,10 @@ void GcodeSuite::M420() { // L or V display the map info if (parser.seen("LV")) { - ubl.display_map(parser.byteval('T')); + bedlevel.display_map(parser.byteval('T')); SERIAL_ECHOPGM("Mesh is "); - if (!ubl.mesh_is_valid()) SERIAL_ECHOPGM("in"); - SERIAL_ECHOLNPGM("valid\nStorage slot: ", ubl.storage_slot); + if (!bedlevel.mesh_is_valid()) SERIAL_ECHOPGM("in"); + SERIAL_ECHOLNPGM("valid\nStorage slot: ", bedlevel.storage_slot); } #endif // AUTO_BED_LEVELING_UBL @@ -148,7 +148,7 @@ void GcodeSuite::M420() { #if ENABLED(AUTO_BED_LEVELING_UBL) set_bed_leveling_enabled(false); - ubl.adjust_mesh_to_mean(true, cval); + bedlevel.adjust_mesh_to_mean(true, cval); #else @@ -156,7 +156,7 @@ void GcodeSuite::M420() { // Get the sum and average of all mesh values float mesh_sum = 0; - GRID_LOOP(x, y) mesh_sum += Z_VALUES(x, y); + GRID_LOOP(x, y) mesh_sum += bedlevel.z_values[x][y]; const float zmean = mesh_sum / float(GRID_MAX_POINTS); #else // midrange @@ -164,7 +164,7 @@ void GcodeSuite::M420() { // Find the low and high mesh values. float lo_val = 100, hi_val = -100; GRID_LOOP(x, y) { - const float z = Z_VALUES(x, y); + const float z = bedlevel.z_values[x][y]; NOMORE(lo_val, z); NOLESS(hi_val, z); } @@ -178,10 +178,10 @@ void GcodeSuite::M420() { set_bed_leveling_enabled(false); // Subtract the mean from all values GRID_LOOP(x, y) { - Z_VALUES(x, y) -= zmean; - TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y))); + bedlevel.z_values[x][y] -= zmean; + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, bedlevel.z_values[x][y])); } - TERN_(AUTO_BED_LEVELING_BILINEAR, bbl.refresh_bed_level()); + TERN_(AUTO_BED_LEVELING_BILINEAR, bedlevel.refresh_bed_level()); } #endif @@ -202,10 +202,10 @@ void GcodeSuite::M420() { #else if (leveling_is_valid()) { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - bbl.print_leveling_grid(); + bedlevel.print_leveling_grid(); #elif ENABLED(MESH_BED_LEVELING) SERIAL_ECHOLNPGM("Mesh Bed Level data:"); - mbl.report_mesh(); + bedlevel.report_mesh(); #endif } #endif diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index fcce26332126..d9b0179a6321 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -313,8 +313,8 @@ G29_TYPE GcodeSuite::G29() { if (!isnan(rx) && !isnan(ry)) { // Get nearest i / j from rx / ry - i = (rx - bbl.get_grid_start().x) / bbl.get_grid_spacing().x + 0.5f; - j = (ry - bbl.get_grid_start().y) / bbl.get_grid_spacing().y + 0.5f; + i = (rx - bedlevel.grid_start.x) / bedlevel.grid_spacing.x + 0.5f; + j = (ry - bedlevel.grid_start.y) / bedlevel.grid_spacing.y + 0.5f; LIMIT(i, 0, (GRID_MAX_POINTS_X) - 1); LIMIT(j, 0, (GRID_MAX_POINTS_Y) - 1); } @@ -323,8 +323,8 @@ G29_TYPE GcodeSuite::G29() { if (WITHIN(i, 0, (GRID_MAX_POINTS_X) - 1) && WITHIN(j, 0, (GRID_MAX_POINTS_Y) - 1)) { set_bed_leveling_enabled(false); - Z_VALUES_ARR[i][j] = rz; - bbl.refresh_bed_level(); + bedlevel.z_values[i][j] = rz; + bedlevel.refresh_bed_level(); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(i, j, rz)); set_bed_leveling_enabled(abl.reenable); if (abl.reenable) report_current_position(); @@ -463,7 +463,7 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) if (!abl.dryrun - && (abl.gridSpacing != bbl.get_grid_spacing() || abl.probe_position_lf != bbl.get_grid_start()) + && (abl.gridSpacing != bedlevel.grid_spacing || abl.probe_position_lf != bedlevel.grid_start) ) { // Reset grid to 0.0 or "not probed". (Also disables ABL) reset_bed_level(); @@ -473,7 +473,7 @@ G29_TYPE GcodeSuite::G29() { } // Pre-populate local Z values from the stored mesh - TERN_(IS_KINEMATIC, COPY(abl.z_values, Z_VALUES_ARR)); + TERN_(IS_KINEMATIC, COPY(abl.z_values, bedlevel.z_values)); #endif // AUTO_BED_LEVELING_BILINEAR @@ -760,14 +760,14 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) if (abl.dryrun) - bbl.print_leveling_grid(&abl.z_values); + bedlevel.print_leveling_grid(&abl.z_values); else { - bbl.set_grid(abl.gridSpacing, abl.probe_position_lf); - COPY(Z_VALUES_ARR, abl.z_values); - TERN_(IS_KINEMATIC, bbl.extrapolate_unprobed_bed_level()); - bbl.refresh_bed_level(); + bedlevel.set_grid(abl.gridSpacing, abl.probe_position_lf); + COPY(bedlevel.z_values, abl.z_values); + TERN_(IS_KINEMATIC, bedlevel.extrapolate_unprobed_bed_level()); + bedlevel.refresh_bed_level(); - bbl.print_leveling_grid(); + bedlevel.print_leveling_grid(); } #elif ENABLED(AUTO_BED_LEVELING_LINEAR) @@ -887,8 +887,8 @@ G29_TYPE GcodeSuite::G29() { // Unapply the offset because it is going to be immediately applied // and cause compensation movement in Z - const float fade_scaling_factor = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.fade_scaling_factor_for_z(current_position.z), 1); - current_position.z -= fade_scaling_factor * bbl.get_z_correction(current_position); + current_position.z -= bedlevel.get_z_correction(current_position) + TERN_(ENABLE_LEVELING_FADE_HEIGHT, * planner.fade_scaling_factor_for_z(current_position.z)); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(" corrected Z:", current_position.z); } diff --git a/Marlin/src/gcode/bedlevel/abl/M421.cpp b/Marlin/src/gcode/bedlevel/abl/M421.cpp index 0c12268cb109..3272ea1bd227 100644 --- a/Marlin/src/gcode/bedlevel/abl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/abl/M421.cpp @@ -58,11 +58,11 @@ void GcodeSuite::M421() { sy = iy >= 0 ? iy : 0, ey = iy >= 0 ? iy : GRID_MAX_POINTS_Y - 1; LOOP_S_LE_N(x, sx, ex) { LOOP_S_LE_N(y, sy, ey) { - Z_VALUES_ARR[x][y] = zval + (hasQ ? Z_VALUES_ARR[x][y] : 0); - TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, Z_VALUES_ARR[x][y])); + bedlevel.z_values[x][y] = zval + (hasQ ? bedlevel.z_values[x][y] : 0); + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, bedlevel.z_values[x][y])); } } - bbl.refresh_bed_level(); + bedlevel.refresh_bed_level(); } else SERIAL_ERROR_MSG(STR_ERR_MESH_XY); diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 74843235f437..10b044b056aa 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -93,14 +93,14 @@ void GcodeSuite::G29() { SERIAL_ECHOPGM("Mesh Bed Leveling "); if (leveling_is_valid()) { serialprintln_onoff(planner.leveling_active); - mbl.report_mesh(); + bedlevel.report_mesh(); } else SERIAL_ECHOLNPGM("has no data."); break; case MeshStart: - mbl.reset(); + bedlevel.reset(); mbl_probe_index = 0; if (!ui.wait_for_move) { queue.inject(parser.seen_test('N') ? F("G28" TERN(CAN_SET_LEVELING_AFTER_G28, "L0", "") "\nG29S2") : F("G29S2")); @@ -128,7 +128,7 @@ void GcodeSuite::G29() { } else { // Save Z for the previous mesh position - mbl.set_zigzag_z(mbl_probe_index - 1, current_position.z); + bedlevel.set_zigzag_z(mbl_probe_index - 1, current_position.z); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z)); TERN_(DWIN_LCD_PROUI, DWIN_MeshUpdate(_MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS), current_position.z)); SET_SOFT_ENDSTOP_LOOSE(false); @@ -138,8 +138,8 @@ void GcodeSuite::G29() { // Disable software endstops to allow manual adjustment // If G29 is left hanging without completion they won't be re-enabled! SET_SOFT_ENDSTOP_LOOSE(true); - mbl.zigzag(mbl_probe_index++, ix, iy); - _manual_goto_xy({ mbl.index_to_xpos[ix], mbl.index_to_ypos[iy] }); + bedlevel.zigzag(mbl_probe_index++, ix, iy); + _manual_goto_xy({ bedlevel.index_to_xpos[ix], bedlevel.index_to_ypos[iy] }); } else { // Move to the after probing position @@ -195,9 +195,9 @@ void GcodeSuite::G29() { return echo_not_entered('J'); if (parser.seenval('Z')) { - mbl.z_values[ix][iy] = parser.value_linear_units(); - TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, mbl.z_values[ix][iy])); - TERN_(DWIN_LCD_PROUI, DWIN_MeshUpdate(ix, iy, mbl.z_values[ix][iy])); + bedlevel.z_values[ix][iy] = parser.value_linear_units(); + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, bedlevel.z_values[ix][iy])); + TERN_(DWIN_LCD_PROUI, DWIN_MeshUpdate(ix, iy, bedlevel.z_values[ix][iy])); } else return echo_not_entered('Z'); @@ -205,7 +205,7 @@ void GcodeSuite::G29() { case MeshSetZOffset: if (parser.seenval('Z')) - mbl.z_offset = parser.value_linear_units(); + bedlevel.z_offset = parser.value_linear_units(); else return echo_not_entered('Z'); break; diff --git a/Marlin/src/gcode/bedlevel/mbl/M421.cpp b/Marlin/src/gcode/bedlevel/mbl/M421.cpp index 1368ab0bef98..e23683d55f34 100644 --- a/Marlin/src/gcode/bedlevel/mbl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/M421.cpp @@ -43,9 +43,9 @@ */ void GcodeSuite::M421() { const bool hasX = parser.seen('X'), hasI = parser.seen('I'); - const int8_t ix = hasI ? parser.value_int() : hasX ? mbl.probe_index_x(RAW_X_POSITION(parser.value_linear_units())) : -1; + const int8_t ix = hasI ? parser.value_int() : hasX ? bedlevel.probe_index_x(RAW_X_POSITION(parser.value_linear_units())) : -1; const bool hasY = parser.seen('Y'), hasJ = parser.seen('J'); - const int8_t iy = hasJ ? parser.value_int() : hasY ? mbl.probe_index_y(RAW_Y_POSITION(parser.value_linear_units())) : -1; + const int8_t iy = hasJ ? parser.value_int() : hasY ? bedlevel.probe_index_y(RAW_Y_POSITION(parser.value_linear_units())) : -1; const bool hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q'); if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ)) @@ -53,7 +53,7 @@ void GcodeSuite::M421() { else if (ix < 0 || iy < 0) SERIAL_ERROR_MSG(STR_ERR_MESH_XY); else - mbl.set_z(ix, iy, parser.value_linear_units() + (hasQ ? mbl.z_values[ix][iy] : 0)); + bedlevel.set_z(ix, iy, parser.value_linear_units() + (hasQ ? bedlevel.z_values[ix][iy] : 0)); } #endif // MESH_BED_LEVELING diff --git a/Marlin/src/gcode/bedlevel/ubl/G29.cpp b/Marlin/src/gcode/bedlevel/ubl/G29.cpp index 932503d72b97..90deab3d2e3e 100644 --- a/Marlin/src/gcode/bedlevel/ubl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/G29.cpp @@ -39,7 +39,7 @@ void GcodeSuite::G29() { TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_PROBE)); - ubl.G29(); + bedlevel.G29(); TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE)); } diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index c11a20ebf33c..ff74f4c6f744 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -56,7 +56,7 @@ void GcodeSuite::M421() { hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q'); - if (hasC) ij = ubl.find_closest_mesh_point_of_type(CLOSEST, current_position); + if (hasC) ij = bedlevel.find_closest_mesh_point_of_type(CLOSEST, current_position); // Test for bad parameter combinations if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN)) @@ -66,7 +66,7 @@ void GcodeSuite::M421() { else if (!WITHIN(ij.x, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(ij.y, 0, GRID_MAX_POINTS_Y - 1)) SERIAL_ERROR_MSG(STR_ERR_MESH_XY); else { - float &zval = ubl.z_values[ij.x][ij.y]; // Altering this Mesh Point + float &zval = bedlevel.z_values[ij.x][ij.y]; // Altering this Mesh Point zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); // N=NAN, Z=NEWVAL, or Q=ADDVAL TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); // Ping ExtUI in case it's showing the mesh TERN_(DWIN_LCD_PROUI, DWIN_MeshUpdate(ij.x, ij.y, zval)); diff --git a/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin/src/gcode/control/M17_M18_M84.cpp index 8350538a9281..a4738b6359b7 100644 --- a/Marlin/src/gcode/control/M17_M18_M84.cpp +++ b/Marlin/src/gcode/control/M17_M18_M84.cpp @@ -242,6 +242,6 @@ void GcodeSuite::M18_M84() { else planner.finish_and_disable(); - TERN_(AUTO_BED_LEVELING_UBL, ubl.steppers_were_disabled()); + TERN_(AUTO_BED_LEVELING_UBL, bedlevel.steppers_were_disabled()); } } diff --git a/Marlin/src/gcode/motion/M290.cpp b/Marlin/src/gcode/motion/M290.cpp index f3d7b7c8dca2..ac5cd7f27e88 100644 --- a/Marlin/src/gcode/motion/M290.cpp +++ b/Marlin/src/gcode/motion/M290.cpp @@ -111,7 +111,7 @@ void GcodeSuite::M290() { #endif #if ENABLED(MESH_BED_LEVELING) - SERIAL_ECHOLNPGM("MBL Adjust Z", mbl.z_offset); + SERIAL_ECHOLNPGM("MBL Adjust Z", bedlevel.z_offset); #endif #if ENABLED(BABYSTEP_DISPLAY_TOTAL) diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index db4bd4e19e8c..569ba31d0570 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -1281,9 +1281,9 @@ void MarlinUI::draw_status_screen() { * Show X and Y positions */ _XLABEL(_PLOT_X, 0); - lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(ubl.mesh_index_to_xpos(x_plot)))); + lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(bedlevel.get_mesh_x(x_plot)))); _YLABEL(_LCD_W_POS, 0); - lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(ubl.mesh_index_to_ypos(y_plot)))); + lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(bedlevel.get_mesh_y(y_plot)))); lcd_moveto(_PLOT_X, 0); @@ -1475,8 +1475,8 @@ void MarlinUI::draw_status_screen() { * Print Z values */ _ZLABEL(_LCD_W_POS, 1); - if (!isnan(ubl.z_values[x_plot][y_plot])) - lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot])); + if (!isnan(bedlevel.z_values[x_plot][y_plot])) + lcd_put_u8str(ftostr43sign(bedlevel.z_values[x_plot][y_plot])); else lcd_put_u8str(F(" -----")); @@ -1486,16 +1486,16 @@ void MarlinUI::draw_status_screen() { * Show all values at right of screen */ _XLABEL(_LCD_W_POS, 1); - lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(ubl.mesh_index_to_xpos(x_plot)))); + lcd_put_u8str(ftostr52(LOGICAL_X_POSITION(bedlevel.get_mesh_x(x_plot)))); _YLABEL(_LCD_W_POS, 2); - lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(ubl.mesh_index_to_ypos(y_plot)))); + lcd_put_u8str(ftostr52(LOGICAL_Y_POSITION(bedlevel.get_mesh_y(y_plot)))); /** * Show the location value */ _ZLABEL(_LCD_W_POS, 3); - if (!isnan(ubl.z_values[x_plot][y_plot])) - lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot])); + if (!isnan(bedlevel.z_values[x_plot][y_plot])) + lcd_put_u8str(ftostr43sign(bedlevel.z_values[x_plot][y_plot])); else lcd_put_u8str(F(" -----")); diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 0745397f4f99..cb278ffa1077 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -1069,15 +1069,15 @@ void MarlinUI::draw_status_screen() { // Show all values lcd.setCursor(_LCD_W_POS, 1); lcd_put_u8str(F("X:")); - lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot])))); + lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&bedlevel._mesh_index_to_xpos[x_plot])))); lcd.setCursor(_LCD_W_POS, 2); lcd_put_u8str(F("Y:")); - lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot])))); + lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&bedlevel._mesh_index_to_ypos[y_plot])))); // Show the location value lcd.setCursor(_LCD_W_POS, 3); lcd_put_u8str(F("Z:")); - if (!isnan(ubl.z_values[x_plot][y_plot])) - lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot])); + if (!isnan(bedlevel.z_values[x_plot][y_plot])) + lcd.print(ftostr43sign(bedlevel.z_values[x_plot][y_plot])); else lcd_put_u8str(F(" -----")); diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index fc862e54398b..35bcf2599255 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -574,9 +574,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop u8g.setColorIndex(1); const u8g_uint_t sx = x_offset + pixels_per_x_mesh_pnt / 2; u8g_uint_t y = y_offset + pixels_per_y_mesh_pnt / 2; - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++, y += pixels_per_y_mesh_pnt) + for (uint8_t j = 0; j < (GRID_MAX_POINTS_Y); j++, y += pixels_per_y_mesh_pnt) if (PAGE_CONTAINS(y, y)) - for (uint8_t i = 0, x = sx; i < GRID_MAX_POINTS_X; i++, x += pixels_per_x_mesh_pnt) + for (uint8_t i = 0, x = sx; i < (GRID_MAX_POINTS_X); i++, x += pixels_per_x_mesh_pnt) u8g.drawBox(x, y, 1, 1); // Fill in the Specified Mesh Point @@ -596,7 +596,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Show X and Y positions at top of screen u8g.setColorIndex(1); if (PAGE_UNDER(7)) { - const xy_pos_t pos = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }, + const xy_pos_t pos = { bedlevel.get_mesh_x(x_plot), bedlevel.get_mesh_y(y_plot) }, lpos = pos.asLogical(); lcd_put_u8str_P(5, 7, X_LBL); lcd_put_u8str(ftostr52(lpos.x)); @@ -614,8 +614,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Show the location value lcd_put_u8str_P(74, LCD_PIXEL_HEIGHT, Z_LBL); - if (!isnan(ubl.z_values[x_plot][y_plot])) - lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot])); + if (!isnan(bedlevel.z_values[x_plot][y_plot])) + lcd_put_u8str(ftostr43sign(bedlevel.z_values[x_plot][y_plot])); else lcd_put_u8str(F(" -----")); } diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 669ef52dba5a..a226b5d51aa6 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -207,11 +207,9 @@ CrealityDWINClass CrealityDWIN; struct linear_fit_data lsf_results; incremental_LSF_reset(&lsf_results); GRID_LOOP(x, y) { - if (!isnan(Z_VALUES_ARR[x][y])) { - xy_pos_t rpos; - rpos.x = ubl.mesh_index_to_xpos(x); - rpos.y = ubl.mesh_index_to_ypos(y); - incremental_LSF(&lsf_results, rpos, Z_VALUES_ARR[x][y]); + if (!isnan(bedlevel.z_values[x][y])) { + xy_pos_t rpos = { bedlevel.get_mesh_x(x), bedlevel.get_mesh_y(y) }; + incremental_LSF(&lsf_results, rpos, bedlevel.z_values[x][y]); } } @@ -220,13 +218,13 @@ CrealityDWINClass CrealityDWIN; return true; } - ubl.set_all_mesh_points_to_value(0); + bedlevel.set_all_mesh_points_to_value(0); matrix_3x3 rotation = matrix_3x3::create_look_at(vector_3(lsf_results.A, lsf_results.B, 1)); GRID_LOOP(i, j) { - float mx = ubl.mesh_index_to_xpos(i), - my = ubl.mesh_index_to_ypos(j), - mz = Z_VALUES_ARR[i][j]; + float mx = bedlevel.get_mesh_x(i), + my = bedlevel.get_mesh_y(j), + mz = bedlevel.z_values[i][j]; if (DEBUGGING(LEVELING)) { DEBUG_ECHOPAIR_F("before rotation = [", mx, 7); @@ -250,7 +248,7 @@ CrealityDWINClass CrealityDWIN; DEBUG_DELAY(20); } - Z_VALUES_ARR[i][j] = mz - lsf_results.D; + bedlevel.z_values[i][j] = mz - lsf_results.D; } return false; } @@ -268,7 +266,7 @@ CrealityDWINClass CrealityDWIN; void manual_move(bool zmove=false) { if (zmove) { planner.synchronize(); - current_position.z = goto_mesh_value ? Z_VALUES_ARR[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; + current_position.z = goto_mesh_value ? bedlevel.z_values[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; planner.buffer_line(current_position, homing_feedrate(Z_AXIS), active_extruder); planner.synchronize(); } @@ -279,7 +277,7 @@ CrealityDWINClass CrealityDWIN; sprintf_P(cmd, PSTR("G42 F4000 I%i J%i"), mesh_x, mesh_y); gcode.process_subcommands_now(cmd); planner.synchronize(); - current_position.z = goto_mesh_value ? Z_VALUES_ARR[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; + current_position.z = goto_mesh_value ? bedlevel.z_values[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; planner.buffer_line(current_position, homing_feedrate(Z_AXIS), active_extruder); planner.synchronize(); CrealityDWIN.Redraw_Menu(); @@ -289,8 +287,8 @@ CrealityDWINClass CrealityDWIN; float get_max_value() { float max = __FLT_MIN__; GRID_LOOP(x, y) { - if (!isnan(Z_VALUES_ARR[x][y]) && Z_VALUES_ARR[x][y] > max) - max = Z_VALUES_ARR[x][y]; + if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] > max) + max = bedlevel.z_values[x][y]; } return max; } @@ -298,24 +296,24 @@ CrealityDWINClass CrealityDWIN; float get_min_value() { float min = __FLT_MAX__; GRID_LOOP(x, y) { - if (!isnan(Z_VALUES_ARR[x][y]) && Z_VALUES_ARR[x][y] < min) - min = Z_VALUES_ARR[x][y]; + if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] < min) + min = bedlevel.z_values[x][y]; } return min; } void Draw_Bed_Mesh(int16_t selected = -1, uint8_t gridline_width = 1, uint16_t padding_x = 8, uint16_t padding_y_top = 40 + 53 - 7) { drawing_mesh = true; - const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x; - const uint16_t cell_width_px = total_width_px / GRID_MAX_POINTS_X; - const uint16_t cell_height_px = total_width_px / GRID_MAX_POINTS_Y; + const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x, + cell_width_px = total_width_px / (GRID_MAX_POINTS_X), + cell_height_px = total_width_px / (GRID_MAX_POINTS_Y); const float v_max = abs(get_max_value()), v_min = abs(get_min_value()), range = _MAX(v_min, v_max); // Clear background from previous selection and select new square DWIN_Draw_Rectangle(1, Color_Bg_Black, _MAX(0, padding_x - gridline_width), _MAX(0, padding_y_top - gridline_width), padding_x + total_width_px, padding_y_top + total_width_px); if (selected >= 0) { - const auto selected_y = selected / GRID_MAX_POINTS_X; - const auto selected_x = selected - (GRID_MAX_POINTS_X * selected_y); + const auto selected_y = selected / (GRID_MAX_POINTS_X); + const auto selected_x = selected - (GRID_MAX_POINTS_X) * selected_y; const auto start_y_px = padding_y_top + selected_y * cell_height_px; const auto start_x_px = padding_x + selected_x * cell_width_px; DWIN_Draw_Rectangle(1, Color_White, _MAX(0, start_x_px - gridline_width), _MAX(0, start_y_px - gridline_width), start_x_px + cell_width_px, start_y_px + cell_height_px); @@ -329,11 +327,11 @@ CrealityDWINClass CrealityDWIN; const auto start_y_px = padding_y_top + (GRID_MAX_POINTS_Y - y - 1) * cell_height_px; const auto end_y_px = start_y_px + cell_height_px - 1 - gridline_width; DWIN_Draw_Rectangle(1, // RGB565 colors: http://www.barth-dev.de/online/rgb565-color-picker/ - isnan(Z_VALUES_ARR[x][y]) ? Color_Grey : ( // gray if undefined - (Z_VALUES_ARR[x][y] < 0 ? - (uint16_t)round(0x1F * -Z_VALUES_ARR[x][y] / (!viewer_asymmetric_range ? range : v_min)) << 11 : // red if mesh point value is negative - (uint16_t)round(0x3F * Z_VALUES_ARR[x][y] / (!viewer_asymmetric_range ? range : v_max)) << 5) | // green if mesh point value is positive - _MIN(0x1F, (((uint8_t)abs(Z_VALUES_ARR[x][y]) / 10) * 4))), // + blue stepping for every mm + isnan(bedlevel.z_values[x][y]) ? Color_Grey : ( // gray if undefined + (bedlevel.z_values[x][y] < 0 ? + (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range : v_min)) << 11 : // red if mesh point value is negative + (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range : v_max)) << 5) | // green if mesh point value is positive + _MIN(0x1F, (((uint8_t)abs(bedlevel.z_values[x][y]) / 10) * 4))), // + blue stepping for every mm start_x_px, start_y_px, end_x_px, end_y_px ); @@ -343,14 +341,14 @@ CrealityDWINClass CrealityDWIN; // Draw value text on if (viewer_print_value) { int8_t offset_x, offset_y = cell_height_px / 2 - 6; - if (isnan(Z_VALUES_ARR[x][y])) { // undefined + if (isnan(bedlevel.z_values[x][y])) { // undefined DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X")); } else { // has value if (GRID_MAX_POINTS_X < 10) - sprintf_P(buf, PSTR("%s"), dtostrf(abs(Z_VALUES_ARR[x][y]), 1, 2, str_1)); + sprintf_P(buf, PSTR("%s"), dtostrf(abs(bedlevel.z_values[x][y]), 1, 2, str_1)); else - sprintf_P(buf, PSTR("%02i"), (uint16_t)(abs(Z_VALUES_ARR[x][y] - (int16_t)Z_VALUES_ARR[x][y]) * 100)); + sprintf_P(buf, PSTR("%02i"), (uint16_t)(abs(bedlevel.z_values[x][y] - (int16_t)bedlevel.z_values[x][y]) * 100)); offset_x = cell_width_px / 2 - 3 * (strlen(buf)) - 2; if (!(GRID_MAX_POINTS_X < 10)) DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px - 2 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, F(".")); @@ -417,14 +415,14 @@ void CrealityDWINClass::Draw_Float(float value, uint8_t row, bool selected/*=fal } void CrealityDWINClass::Draw_Option(uint8_t value, const char * const * options, uint8_t row, bool selected/*=false*/, bool color/*=false*/) { - uint16_t bColor = (selected) ? Select_Color : Color_Bg_Black; - uint16_t tColor = (color) ? GetColor(value, Color_White, false) : Color_White; + uint16_t bColor = (selected) ? Select_Color : Color_Bg_Black, + tColor = (color) ? GetColor(value, Color_White, false) : Color_White; DWIN_Draw_Rectangle(1, bColor, 202, MBASE(row) + 14, 258, MBASE(row) - 2); DWIN_Draw_String(false, DWIN_FONT_MENU, tColor, bColor, 202, MBASE(row) - 1, options[value]); } uint16_t CrealityDWINClass::GetColor(uint8_t color, uint16_t original, bool light/*=false*/) { - switch (color){ + switch (color) { case Default: return original; break; @@ -2842,7 +2840,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ if (draw) Draw_Menu_Item(row, ICON_Tilt, F("Autotilt Current Mesh")); else { - if (ubl.storage_slot < 0) { + if (bedlevel.storage_slot < 0) { Popup_Handler(MeshSlot); break; } @@ -2914,7 +2912,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ } #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - if (ubl.storage_slot < 0) { + if (bedlevel.storage_slot < 0) { Popup_Handler(MeshSlot); break; } @@ -2949,7 +2947,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ Draw_Menu_Item(row, ICON_Mesh, GET_TEXT(MSG_MESH_VIEW), nullptr, true); else { #if ENABLED(AUTO_BED_LEVELING_UBL) - if (ubl.storage_slot < 0) { + if (bedlevel.storage_slot < 0) { Popup_Handler(MeshSlot); break; } @@ -2967,16 +2965,16 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ case LEVELING_SLOT: if (draw) { Draw_Menu_Item(row, ICON_PrintSize, F("Mesh Slot")); - Draw_Float(ubl.storage_slot, row, false, 1); + Draw_Float(bedlevel.storage_slot, row, false, 1); } else - Modify_Value(ubl.storage_slot, 0, settings.calc_num_meshes() - 1, 1); + Modify_Value(bedlevel.storage_slot, 0, settings.calc_num_meshes() - 1, 1); break; case LEVELING_LOAD: if (draw) Draw_Menu_Item(row, ICON_ReadEEPROM, F("Load Mesh")); else { - if (ubl.storage_slot < 0) { + if (bedlevel.storage_slot < 0) { Popup_Handler(MeshSlot); break; } @@ -2989,7 +2987,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ if (draw) Draw_Menu_Item(row, ICON_WriteEEPROM, F("Save Mesh")); else { - if (ubl.storage_slot < 0) { + if (bedlevel.storage_slot < 0) { Popup_Handler(MeshSlot); break; } @@ -3098,13 +3096,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ if (draw) Draw_Menu_Item(row, ICON_Mesh, F("Zero Current Mesh")); else - ZERO(Z_VALUES_ARR); + ZERO(bedlevel.z_values); break; case LEVELING_SETTINGS_UNDEF: if (draw) Draw_Menu_Item(row, ICON_Mesh, F("Clear Current Mesh")); else - ubl.invalidate(); + bedlevel.invalidate(); break; #endif // AUTO_BED_LEVELING_UBL } @@ -3146,7 +3144,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ Draw_Menu_Item(row, ICON_Back, F("Back")); else { set_bed_leveling_enabled(level_state); - TERN_(AUTO_BED_LEVELING_BILINEAR, bbl.refresh_bed_level()); + TERN_(AUTO_BED_LEVELING_BILINEAR, bedlevel.refresh_bed_level()); Draw_Menu(Leveling, LEVELING_MANUAL); } break; @@ -3184,36 +3182,36 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ case LEVELING_M_OFFSET: if (draw) { Draw_Menu_Item(row, ICON_SetZOffset, F("Point Z Offset")); - Draw_Float(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y], row, false, 100); + Draw_Float(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y], row, false, 100); } else { - if (isnan(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y])) - Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] = 0; - Modify_Value(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y], MIN_Z_OFFSET, MAX_Z_OFFSET, 100); + if (isnan(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y])) + bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] = 0; + Modify_Value(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y], MIN_Z_OFFSET, MAX_Z_OFFSET, 100); } break; case LEVELING_M_UP: if (draw) Draw_Menu_Item(row, ICON_Axis, F("Microstep Up")); - else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] < MAX_Z_OFFSET) { - Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] += 0.01; + else if (bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] < MAX_Z_OFFSET) { + bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] += 0.01; gcode.process_subcommands_now(F("M290 Z0.01")); planner.synchronize(); current_position.z += 0.01f; sync_plan_position(); - Draw_Float(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y], row - 1, false, 100); + Draw_Float(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y], row - 1, false, 100); } break; case LEVELING_M_DOWN: if (draw) Draw_Menu_Item(row, ICON_AxisD, F("Microstep Down")); - else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] > MIN_Z_OFFSET) { - Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] -= 0.01; + else if (bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] > MIN_Z_OFFSET) { + bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] -= 0.01; gcode.process_subcommands_now(F("M290 Z-0.01")); planner.synchronize(); current_position.z -= 0.01f; sync_plan_position(); - Draw_Float(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y], row - 2, false, 100); + Draw_Float(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y], row - 2, false, 100); } break; case LEVELING_M_GOTO_VALUE: @@ -3305,36 +3303,36 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ case UBL_M_OFFSET: if (draw) { Draw_Menu_Item(row, ICON_SetZOffset, F("Point Z Offset")); - Draw_Float(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y], row, false, 100); + Draw_Float(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y], row, false, 100); } else { - if (isnan(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y])) - Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] = 0; - Modify_Value(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y], MIN_Z_OFFSET, MAX_Z_OFFSET, 100); + if (isnan(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y])) + bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] = 0; + Modify_Value(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y], MIN_Z_OFFSET, MAX_Z_OFFSET, 100); } break; case UBL_M_UP: if (draw) Draw_Menu_Item(row, ICON_Axis, F("Microstep Up")); - else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] < MAX_Z_OFFSET) { - Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] += 0.01; + else if (bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] < MAX_Z_OFFSET) { + bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] += 0.01; gcode.process_subcommands_now(F("M290 Z0.01")); planner.synchronize(); current_position.z += 0.01f; sync_plan_position(); - Draw_Float(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y], row - 1, false, 100); + Draw_Float(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y], row - 1, false, 100); } break; case UBL_M_DOWN: if (draw) Draw_Menu_Item(row, ICON_Axis, F("Microstep Down")); - else if (Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] > MIN_Z_OFFSET) { - Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y] -= 0.01; + else if (bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] > MIN_Z_OFFSET) { + bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] -= 0.01; gcode.process_subcommands_now(F("M290 Z-0.01")); planner.synchronize(); current_position.z -= 0.01f; sync_plan_position(); - Draw_Float(Z_VALUES_ARR[mesh_conf.mesh_x][mesh_conf.mesh_y], row - 2, false, 100); + Draw_Float(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y], row - 2, false, 100); } break; } @@ -3418,13 +3416,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ case MMESH_OLD: uint8_t mesh_x, mesh_y; // 0,0 -> 1,0 -> 2,0 -> 2,1 -> 1,1 -> 0,1 -> 0,2 -> 1,2 -> 2,2 - mesh_y = (gridpoint - 1) / GRID_MAX_POINTS_Y; - mesh_x = (gridpoint - 1) % GRID_MAX_POINTS_X; + mesh_y = (gridpoint - 1) / (GRID_MAX_POINTS_Y); + mesh_x = (gridpoint - 1) % (GRID_MAX_POINTS_X); if (mesh_y % 2 == 1) - mesh_x = GRID_MAX_POINTS_X - mesh_x - 1; + mesh_x = (GRID_MAX_POINTS_X) - mesh_x - 1; - const float currval = Z_VALUES_ARR[mesh_x][mesh_y]; + const float currval = bedlevel.z_values[mesh_x][mesh_y]; if (draw) { Draw_Menu_Item(row, ICON_Zoffset, F("Goto Mesh Value")); @@ -4283,7 +4281,7 @@ void CrealityDWINClass::Popup_Control() { #if ENABLED(AUTO_BED_LEVELING_UBL) case MeshSlot: - if (selection == 0) ubl.storage_slot = 0; + if (selection == 0) bedlevel.storage_slot = 0; Redraw_Menu(true, true); break; #endif diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 1730e6832759..9cc634c3064e 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -516,8 +516,8 @@ void MarlinUI::draw_status_message(const bool blink) { // Display Mesh Point Locations const dwin_coord_t sx = x_offset + pixels_per_x_mesh_pnt / 2; dwin_coord_t y = y_offset + pixels_per_y_mesh_pnt / 2; - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++, y += pixels_per_y_mesh_pnt) - for (uint8_t i = 0, x = sx; i < GRID_MAX_POINTS_X; i++, x += pixels_per_x_mesh_pnt) + for (uint8_t j = 0; j < (GRID_MAX_POINTS_Y); j++, y += pixels_per_y_mesh_pnt) + for (uint8_t i = 0, x = sx; i < (GRID_MAX_POINTS_X); i++, x += pixels_per_x_mesh_pnt) DWIN_Draw_Point(Color_White, 1, 1, x, y); // Put Relevant Text on Display @@ -525,7 +525,7 @@ void MarlinUI::draw_status_message(const bool blink) { // Show X and Y positions at top of screen dwin_font.fg = Color_White; dwin_font.solid = true; - const xy_pos_t pos = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }, + const xy_pos_t pos = { bedlevel.get_mesh_x(x_plot), bedlevel.get_mesh_y(y_plot) }, lpos = pos.asLogical(); lcd_moveto( @@ -555,8 +555,8 @@ void MarlinUI::draw_status_message(const bool blink) { // Show the location value dwin_string.set(Z_LBL); - if (!isnan(Z_VALUES_ARR[x_plot][y_plot])) - dwin_string.add(ftostr43sign(Z_VALUES_ARR[x_plot][y_plot])); + if (!isnan(bedlevel.z_values[x_plot][y_plot])) + dwin_string.add(ftostr43sign(bedlevel.z_values[x_plot][y_plot])); else dwin_string.add(PSTR(" -----")); lcd_moveto( diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index e3ab8cf8b896..e9d9ce86d619 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -3611,7 +3611,7 @@ void Draw_Steps_Menu() { #define Z_OFFSET_MIN -3 #define Z_OFFSET_MAX 3 - void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &Z_VALUES_ARR[HMI_value.Select ? mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : mesh_y]; EditZValueItem->redraw(); } + void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &bedlevel.z_values[HMI_value.Select ? mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : mesh_y]; EditZValueItem->redraw(); } void ApplyEditMeshX() { mesh_x = MenuData.Value; } void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, mesh_x, ApplyEditMeshX, LiveEditMesh); } void ApplyEditMeshY() { mesh_y = MenuData.Value; } @@ -3622,18 +3622,18 @@ void Draw_Steps_Menu() { #if ENABLED(AUTO_BED_LEVELING_UBL) - void ApplyUBLSlot() { ubl.storage_slot = MenuData.Value; } - void SetUBLSlot() { SetIntOnClick(0, settings.calc_num_meshes() - 1, ubl.storage_slot, ApplyUBLSlot); } + void ApplyUBLSlot() { bedlevel.storage_slot = MenuData.Value; } + void SetUBLSlot() { SetIntOnClick(0, settings.calc_num_meshes() - 1, bedlevel.storage_slot, ApplyUBLSlot); } void onDrawUBLSlot(MenuItemClass* menuitem, int8_t line) { - if (ubl.storage_slot < 0) ubl.storage_slot = 0; - onDrawIntMenu(menuitem, line, ubl.storage_slot); + if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + onDrawIntMenu(menuitem, line, bedlevel.storage_slot); } void ApplyUBLTiltGrid() { ubl_tools.tilt_grid = MenuData.Value; } void SetUBLTiltGrid() { SetIntOnClick(1, 3, ubl_tools.tilt_grid, ApplyUBLTiltGrid); } void UBLTiltMesh() { - if (ubl.storage_slot < 0) ubl.storage_slot = 0; + if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; char buf[15]; if (ubl_tools.tilt_grid > 1) { sprintf_P(buf, PSTR("G28O\nG29 J%i"), ubl_tools.tilt_grid); @@ -3645,28 +3645,28 @@ void Draw_Steps_Menu() { } void UBLSmartFillMesh() { - ubl.smart_fill_mesh(); + bedlevel.smart_fill_mesh(); LCD_MESSAGE(MSG_UBL_MESH_FILLED); } bool UBLValidMesh() { const bool valid = ubl_tools.validate(); - if (!valid) ubl.invalidate(); + if (!valid) bedlevel.invalidate(); return valid; } void UBLSaveMesh() { - if (ubl.storage_slot < 0) ubl.storage_slot = 0; - settings.store_mesh(ubl.storage_slot); - ui.status_printf(0, GET_TEXT_F(MSG_MESH_SAVED), ubl.storage_slot); + if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + settings.store_mesh(bedlevel.storage_slot); + ui.status_printf(0, GET_TEXT_F(MSG_MESH_SAVED), bedlevel.storage_slot); DONE_BUZZ(true); } void UBLLoadMesh() { - if (ubl.storage_slot < 0) ubl.storage_slot = 0; - settings.load_mesh(ubl.storage_slot); + if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + settings.load_mesh(bedlevel.storage_slot); if (UBLValidMesh()) { - ui.status_printf(0, GET_TEXT_F(MSG_MESH_LOADED), ubl.storage_slot); + ui.status_printf(0, GET_TEXT_F(MSG_MESH_LOADED), bedlevel.storage_slot); DONE_BUZZ(true); } else { @@ -3691,7 +3691,7 @@ void Draw_Steps_Menu() { MENU_ITEM_F(ICON_Level, MSG_AUTO_MESH, onDrawMenuItem, AutoLev); #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_STORAGE_SLOT, onDrawUBLSlot, SetUBLSlot, &ubl.storage_slot); + EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_STORAGE_SLOT, onDrawUBLSlot, SetUBLSlot, &bedlevel.storage_slot); MENU_ITEM_F(ICON_UBLActive, MSG_UBL_SAVE_MESH, onDrawMenuItem, UBLSaveMesh); MENU_ITEM_F(ICON_UBLActive, MSG_UBL_LOAD_MESH, onDrawMenuItem, UBLLoadMesh); EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_TILTING_GRID, onDrawPInt8Menu, SetUBLTiltGrid, &ubl_tools.tilt_grid); @@ -3714,7 +3714,7 @@ void Draw_Steps_Menu() { BACK_ITEM(Draw_MeshSet_Menu); EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_X, onDrawPInt8Menu, SetEditMeshX, &mesh_x); EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_Y, onDrawPInt8Menu, SetEditMeshY, &mesh_y); - EditZValueItem = EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_EDIT_Z, onDrawPFloat3Menu, SetEditZValue, &Z_VALUES_ARR[mesh_x][mesh_y]); + EditZValueItem = EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_EDIT_Z, onDrawPFloat3Menu, SetEditZValue, &bedlevel.z_values[mesh_x][mesh_y]); } UpdateMenu(EditMeshMenu); } diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 5fe8b1bb104a..ab968c44b103 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -117,7 +117,7 @@ void MeshViewerClass::Draw(bool withsave /*= false*/) { ubl_tools.viewer_print_value = true; ubl_tools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT); #else - DrawMesh(Z_VALUES_ARR, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y); + DrawMesh(bedlevel.z_values, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y); #endif if (withsave) { DWINUI::Draw_Button(BTN_Save, 26, 305); diff --git a/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp b/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp index 1783ee18c523..96a7f52becc6 100644 --- a/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp @@ -63,11 +63,9 @@ char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16]; struct linear_fit_data lsf_results; incremental_LSF_reset(&lsf_results); GRID_LOOP(x, y) { - if (!isnan(Z_VALUES_ARR[x][y])) { - xy_pos_t rpos; - rpos.x = ubl.mesh_index_to_xpos(x); - rpos.y = ubl.mesh_index_to_ypos(y); - incremental_LSF(&lsf_results, rpos, Z_VALUES_ARR[x][y]); + if (!isnan(bedlevel.z_values[x][y])) { + xy_pos_t rpos = { bedlevel.get_mesh_x(x), bedlevel.get_mesh_y(y) }; + incremental_LSF(&lsf_results, rpos, bedlevel.z_values[x][y]); } } @@ -76,13 +74,13 @@ char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16]; return true; } - ubl.set_all_mesh_points_to_value(0); + bedlevel.set_all_mesh_points_to_value(0); matrix_3x3 rotation = matrix_3x3::create_look_at(vector_3(lsf_results.A, lsf_results.B, 1)); GRID_LOOP(i, j) { - float mx = ubl.mesh_index_to_xpos(i), - my = ubl.mesh_index_to_ypos(j), - mz = Z_VALUES_ARR[i][j]; + float mx = bedlevel.get_mesh_x(i), + my = bedlevel.get_mesh_y(j), + mz = bedlevel.z_values[i][j]; if (DEBUGGING(LEVELING)) { DEBUG_ECHOPAIR_F("before rotation = [", mx, 7); @@ -106,7 +104,7 @@ char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16]; DEBUG_DELAY(20); } - Z_VALUES_ARR[i][j] = mz - lsf_results.D; + bedlevel.z_values[i][j] = mz - lsf_results.D; } return false; } @@ -124,7 +122,7 @@ char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16]; void UBLMeshToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove/*=false*/) { if (zmove) { planner.synchronize(); - current_position.z = goto_mesh_value ? Z_VALUES_ARR[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; + current_position.z = goto_mesh_value ? bedlevel.z_values[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; planner.buffer_line(current_position, homing_feedrate(Z_AXIS), active_extruder); planner.synchronize(); } @@ -136,7 +134,7 @@ void UBLMeshToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, sprintf_P(cmd, PSTR("G42 F4000 I%i J%i"), mesh_x, mesh_y); gcode.process_subcommands_now(cmd); planner.synchronize(); - current_position.z = goto_mesh_value ? Z_VALUES_ARR[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; + current_position.z = goto_mesh_value ? bedlevel.z_values[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; planner.buffer_line(current_position, homing_feedrate(Z_AXIS), active_extruder); planner.synchronize(); HMI_ReturnScreen(); @@ -146,8 +144,8 @@ void UBLMeshToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, float UBLMeshToolsClass::get_max_value() { float max = __FLT_MIN__; GRID_LOOP(x, y) { - if (!isnan(Z_VALUES_ARR[x][y]) && Z_VALUES_ARR[x][y] > max) - max = Z_VALUES_ARR[x][y]; + if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] > max) + max = bedlevel.z_values[x][y]; } return max; } @@ -155,20 +153,19 @@ float UBLMeshToolsClass::get_max_value() { float UBLMeshToolsClass::get_min_value() { float min = __FLT_MAX__; GRID_LOOP(x, y) { - if (!isnan(Z_VALUES_ARR[x][y]) && Z_VALUES_ARR[x][y] < min) - min = Z_VALUES_ARR[x][y]; + if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] < min) + min = bedlevel.z_values[x][y]; } return min; } bool UBLMeshToolsClass::validate() { - float min = __FLT_MAX__; - float max = __FLT_MIN__; + float min = __FLT_MAX__, max = __FLT_MIN__; GRID_LOOP(x, y) { - if (isnan(Z_VALUES_ARR[x][y])) return false; - if (Z_VALUES_ARR[x][y] < min) min = Z_VALUES_ARR[x][y]; - if (Z_VALUES_ARR[x][y] > max) max = Z_VALUES_ARR[x][y]; + if (isnan(bedlevel.z_values[x][y])) return false; + if (bedlevel.z_values[x][y] < min) min = bedlevel.z_values[x][y]; + if (bedlevel.z_values[x][y] > max) max = bedlevel.z_values[x][y]; } return max <= UBL_Z_OFFSET_MAX && min >= UBL_Z_OFFSET_MIN; } @@ -177,15 +174,15 @@ bool UBLMeshToolsClass::validate() { void UBLMeshToolsClass::Draw_Bed_Mesh(int16_t selected /*= -1*/, uint8_t gridline_width /*= 1*/, uint16_t padding_x /*= 8*/, uint16_t padding_y_top /*= 40 + 53 - 7*/) { drawing_mesh = true; const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x; - const uint16_t cell_width_px = total_width_px / GRID_MAX_POINTS_X; - const uint16_t cell_height_px = total_width_px / GRID_MAX_POINTS_Y; + const uint16_t cell_width_px = total_width_px / (GRID_MAX_POINTS_X); + const uint16_t cell_height_px = total_width_px / (GRID_MAX_POINTS_Y); const float v_max = abs(get_max_value()), v_min = abs(get_min_value()), range = _MAX(v_min, v_max); // Clear background from previous selection and select new square DWIN_Draw_Rectangle(1, Color_Bg_Black, _MAX(0, padding_x - gridline_width), _MAX(0, padding_y_top - gridline_width), padding_x + total_width_px, padding_y_top + total_width_px); if (selected >= 0) { - const auto selected_y = selected / GRID_MAX_POINTS_X; - const auto selected_x = selected - (GRID_MAX_POINTS_X * selected_y); + const auto selected_y = selected / (GRID_MAX_POINTS_X); + const auto selected_x = selected - (GRID_MAX_POINTS_X) * selected_y; const auto start_y_px = padding_y_top + selected_y * cell_height_px; const auto start_x_px = padding_x + selected_x * cell_width_px; DWIN_Draw_Rectangle(1, Color_White, _MAX(0, start_x_px - gridline_width), _MAX(0, start_y_px - gridline_width), start_x_px + cell_width_px, start_y_px + cell_height_px); @@ -196,14 +193,14 @@ bool UBLMeshToolsClass::validate() { GRID_LOOP(x, y) { const auto start_x_px = padding_x + x * cell_width_px; const auto end_x_px = start_x_px + cell_width_px - 1 - gridline_width; - const auto start_y_px = padding_y_top + (GRID_MAX_POINTS_Y - y - 1) * cell_height_px; + const auto start_y_px = padding_y_top + ((GRID_MAX_POINTS_Y) - y - 1) * cell_height_px; const auto end_y_px = start_y_px + cell_height_px - 1 - gridline_width; DWIN_Draw_Rectangle(1, // RGB565 colors: http://www.barth-dev.de/online/rgb565-color-picker/ - isnan(Z_VALUES_ARR[x][y]) ? Color_Grey : ( // gray if undefined - (Z_VALUES_ARR[x][y] < 0 ? - (uint16_t)round(0x1F * -Z_VALUES_ARR[x][y] / (!viewer_asymmetric_range ? range : v_min)) << 11 : // red if mesh point value is negative - (uint16_t)round(0x3F * Z_VALUES_ARR[x][y] / (!viewer_asymmetric_range ? range : v_max)) << 5) | // green if mesh point value is positive - _MIN(0x1F, (((uint8_t)abs(Z_VALUES_ARR[x][y]) / 10) * 4))), // + blue stepping for every mm + isnan(bedlevel.z_values[x][y]) ? Color_Grey : ( // gray if undefined + (bedlevel.z_values[x][y] < 0 ? + (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range : v_min)) << 11 : // red if mesh point value is negative + (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range : v_max)) << 5) | // green if mesh point value is positive + _MIN(0x1F, (((uint8_t)abs(bedlevel.z_values[x][y]) / 10) * 4))), // + blue stepping for every mm start_x_px, start_y_px, end_x_px, end_y_px ); @@ -213,14 +210,14 @@ bool UBLMeshToolsClass::validate() { // Draw value text on if (viewer_print_value) { int8_t offset_x, offset_y = cell_height_px / 2 - 6; - if (isnan(Z_VALUES_ARR[x][y])) { // undefined + if (isnan(bedlevel.z_values[x][y])) { // undefined DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X")); } else { // has value if (GRID_MAX_POINTS_X < 10) - sprintf_P(buf, PSTR("%s"), dtostrf(abs(Z_VALUES_ARR[x][y]), 1, 2, str_1)); + sprintf_P(buf, PSTR("%s"), dtostrf(abs(bedlevel.z_values[x][y]), 1, 2, str_1)); else - sprintf_P(buf, PSTR("%02i"), (uint16_t)(abs(Z_VALUES_ARR[x][y] - (int16_t)Z_VALUES_ARR[x][y]) * 100)); + sprintf_P(buf, PSTR("%02i"), (uint16_t)(abs(bedlevel.z_values[x][y] - (int16_t)bedlevel.z_values[x][y]) * 100)); offset_x = cell_width_px / 2 - 3 * (strlen(buf)) - 2; if (!(GRID_MAX_POINTS_X < 10)) DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px - 2 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, F(".")); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp index 8d5703876564..8d48037613ff 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp @@ -341,8 +341,8 @@ void DGUSTxHandler::ABLGrid(DGUS_VP &vp) { int16_t fixed; for (int i = 0; i < DGUS_LEVEL_GRID_SIZE; i++) { - point.x = i % GRID_MAX_POINTS_X; - point.y = i / GRID_MAX_POINTS_X; + point.x = i % (GRID_MAX_POINTS_X); + point.y = i / (GRID_MAX_POINTS_X); fixed = dgus_display.ToFixedPoint(ExtUI::getMeshPoint(point)); data[i] = Swap16(fixed); } diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 0dad675cb75c..e6eb3a8565c0 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -889,11 +889,11 @@ namespace ExtUI { #if HAS_MESH - bed_mesh_t& getMeshArray() { return Z_VALUES_ARR; } - float getMeshPoint(const xy_uint8_t &pos) { return Z_VALUES(pos.x, pos.y); } + bed_mesh_t& getMeshArray() { return bedlevel.z_values; } + float getMeshPoint(const xy_uint8_t &pos) { return bedlevel.z_values[pos.x][pos.y]; } void setMeshPoint(const xy_uint8_t &pos, const_float_t zoff) { if (WITHIN(pos.x, 0, (GRID_MAX_POINTS_X) - 1) && WITHIN(pos.y, 0, (GRID_MAX_POINTS_Y) - 1)) { - Z_VALUES(pos.x, pos.y) = zoff; + bedlevel.z_values[pos.x][pos.y] = zoff; TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); } } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index cf225eb2bd60..a2fde96a6f52 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -855,7 +855,7 @@ void MarlinUI::init() { void MarlinUI::external_encoder() { if (external_control && encoderDiff) { - ubl.encoder_diff += encoderDiff; // Encoder for UBL G29 mesh editing + bedlevel.encoder_diff += encoderDiff; // Encoder for UBL G29 mesh editing encoderDiff = 0; // Hide encoder events from the screen handler refresh(LCDVIEW_REDRAW_NOW); // ...but keep the refresh. } diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index d56bc9b5ff1b..2f075238e4a5 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -203,14 +203,14 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co if (on_status_screen()) { defer_status_screen(false); clear_menu_history(); - TERN_(AUTO_BED_LEVELING_UBL, ubl.lcd_map_control = false); + TERN_(AUTO_BED_LEVELING_UBL, bedlevel.lcd_map_control = false); } clear_lcd(); // Re-initialize custom characters that may be re-used #if HAS_MARLINUI_HD44780 - if (TERN1(AUTO_BED_LEVELING_UBL, !ubl.lcd_map_control)) + if (TERN1(AUTO_BED_LEVELING_UBL, !bedlevel.lcd_map_control)) set_custom_characters(on_status_screen() ? CHARSET_INFO : CHARSET_MENU); #endif diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index f6add52f570c..866f709b8e33 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -214,7 +214,7 @@ BACK_ITEM(MSG_BED_LEVELING); EDIT_ITEM(uint8, MSG_MESH_X, &xind, 0, (GRID_MAX_POINTS_X) - 1); EDIT_ITEM(uint8, MSG_MESH_Y, &yind, 0, (GRID_MAX_POINTS_Y) - 1); - EDIT_ITEM_FAST(float43, MSG_MESH_EDIT_Z, &Z_VALUES(xind, yind), -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5, refresh_planner); + EDIT_ITEM_FAST(float43, MSG_MESH_EDIT_Z, &bedlevel.z_values[xind][yind], -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5, refresh_planner); END_MENU(); } @@ -281,7 +281,7 @@ void menu_bed_leveling() { #else #define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99 #endif - EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_BED_Z, &mbl.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_BED_Z, &bedlevel.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif #if ENABLED(BABYSTEP_ZPROBE_OFFSET) diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 7954edf5a127..40513f71ab7e 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -118,7 +118,7 @@ void menu_tune() { // Manual bed leveling, Bed Z: // #if BOTH(MESH_BED_LEVELING, LCD_BED_LEVELING) - EDIT_ITEM(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); + EDIT_ITEM(float43, MSG_BED_Z, &bedlevel.z_offset, -1, 1); #endif // diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index d324e057be62..df60eaa6f5ae 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -58,7 +58,7 @@ inline float rounded_mesh_value() { /** * This screen displays the temporary mesh value and updates it based on encoder - * movement. While this screen is active ubl.fine_tune_mesh sits in a loop getting + * movement. While this screen is active bedlevel.fine_tune_mesh sits in a loop getting * the current value via ubl_mesh_value, moves the Z axis, and updates the mesh * value until the encoder button is pressed. * @@ -70,12 +70,12 @@ inline float rounded_mesh_value() { void _lcd_mesh_fine_tune(PGM_P const msg) { constexpr float mesh_edit_step = 1.0f / 200.0f; ui.defer_status_screen(); - if (ubl.encoder_diff) { + if (bedlevel.encoder_diff) { mesh_edit_accumulator += TERN(IS_TFTGLCD_PANEL, - ubl.encoder_diff * mesh_edit_step / ENCODER_PULSES_PER_STEP, - ubl.encoder_diff > 0 ? mesh_edit_step : -mesh_edit_step + bedlevel.encoder_diff * mesh_edit_step / ENCODER_PULSES_PER_STEP, + bedlevel.encoder_diff > 0 ? mesh_edit_step : -mesh_edit_step ); - ubl.encoder_diff = 0; + bedlevel.encoder_diff = 0; IF_DISABLED(IS_TFTGLCD_PANEL, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT)); } TERN_(IS_TFTGLCD_PANEL, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT)); @@ -89,7 +89,7 @@ void _lcd_mesh_fine_tune(PGM_P const msg) { } // -// Init mesh editing and go to the fine tuning screen (ubl.fine_tune_mesh) +// Init mesh editing and go to the fine tuning screen (bedlevel.fine_tune_mesh) // To capture encoder events UBL will also call ui.capture and ui.release. // void MarlinUI::ubl_mesh_edit_start(const_float_t initial) { @@ -99,7 +99,7 @@ void MarlinUI::ubl_mesh_edit_start(const_float_t initial) { } // -// Get the mesh value within a Z adjustment loop (ubl.fine_tune_mesh) +// Get the mesh value within a Z adjustment loop (bedlevel.fine_tune_mesh) // float MarlinUI::ubl_mesh_value() { return rounded_mesh_value(); } @@ -291,7 +291,7 @@ void _menu_ubl_fillin() { } void _lcd_ubl_invalidate() { - ubl.invalidate(); + bedlevel.invalidate(); SERIAL_ECHOLNPGM("Mesh invalidated."); } @@ -390,8 +390,8 @@ void _lcd_ubl_storage_mesh() { */ void _lcd_ubl_map_edit_cmd() { char ubl_lcd_gcode[50], str[10], str2[10]; - dtostrf(ubl.mesh_index_to_xpos(x_plot), 0, 2, str); - dtostrf(ubl.mesh_index_to_ypos(y_plot), 0, 2, str2); + dtostrf(bedlevel.get_mesh_x(x_plot), 0, 2, str); + dtostrf(bedlevel.get_mesh_y(y_plot), 0, 2, str2); snprintf_P(ubl_lcd_gcode, sizeof(ubl_lcd_gcode), PSTR("G29P4X%sY%sR%i"), str, str2, int(n_edit_pts)); queue.inject(ubl_lcd_gcode); } @@ -400,7 +400,7 @@ void _lcd_ubl_map_edit_cmd() { * UBL LCD Map Movement */ void ubl_map_move_to_xy() { - const xy_pos_t xy = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }; + const xy_pos_t xy = { bedlevel.get_mesh_x(x_plot), bedlevel.get_mesh_y(y_plot) }; // Some printers have unreachable areas in the mesh. Skip the move if unreachable. if (!position_is_reachable(xy)) return; @@ -459,7 +459,7 @@ void ubl_map_screen() { // Validate if needed #if IS_KINEMATIC - const xy_pos_t xy = { ubl.mesh_index_to_xpos(x), ubl.mesh_index_to_ypos(y) }; + const xy_pos_t xy = { bedlevel.get_mesh_x(x), bedlevel.get_mesh_y(y) }; if (position_is_reachable(xy)) break; // Found a valid point ui.encoderPosition += step_dir; // Test the next point #endif @@ -500,7 +500,7 @@ void _ubl_map_screen_homing() { ui.defer_status_screen(); _lcd_draw_homing(); if (all_axes_homed()) { - ubl.lcd_map_control = true; // Return to the map screen after editing Z + bedlevel.lcd_map_control = true; // Return to the map screen after editing Z ui.goto_screen(ubl_map_screen, grid_index(x_plot, y_plot)); // Pre-set the encoder value ui.manual_move.menu_scale = 0; // Immediate move ubl_map_move_to_xy(); // Move to current mesh point diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index a04715a2952d..57cd6e724e26 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -180,8 +180,8 @@ void Touch::touch(touch_control_t *control) { ui.refresh(); break; case SLIDER: hold(control); ui.encoderPosition = (x - control->x) * control->data / control->width; break; - case INCREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? ubl.encoder_diff++ : ui.encoderPosition++, ui.encoderPosition++); break; - case DECREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? ubl.encoder_diff-- : ui.encoderPosition--, ui.encoderPosition--); break; + case INCREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? bedlevel.encoder_diff++ : ui.encoderPosition++, ui.encoderPosition++); break; + case DECREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? bedlevel.encoder_diff-- : ui.encoderPosition--, ui.encoderPosition--); break; case HEATER: int8_t heater; heater = control->data; diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 7c3d04345f48..60116f7afe1a 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -501,14 +501,14 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.set_background(COLOR_BACKGROUND); tft.add_rectangle(0, 0, GRID_WIDTH, GRID_HEIGHT, COLOR_WHITE); - for (uint16_t x = 0; x < GRID_MAX_POINTS_X ; x++) - for (uint16_t y = 0; y < GRID_MAX_POINTS_Y ; y++) - if (position_is_reachable({ ubl.mesh_index_to_xpos(x), ubl.mesh_index_to_ypos(y) })) - tft.add_bar(1 + (x * 2 + 1) * (GRID_WIDTH - 4) / GRID_MAX_POINTS_X / 2, GRID_HEIGHT - 3 - ((y * 2 + 1) * (GRID_HEIGHT - 4) / GRID_MAX_POINTS_Y / 2), 2, 2, COLOR_UBL); + for (uint16_t x = 0; x < (GRID_MAX_POINTS_X); x++) + for (uint16_t y = 0; y < (GRID_MAX_POINTS_Y); y++) + if (position_is_reachable({ bedlevel.get_mesh_x(x), bedlevel.get_mesh_y(y) })) + tft.add_bar(1 + (x * 2 + 1) * (GRID_WIDTH - 4) / (GRID_MAX_POINTS_X) / 2, GRID_HEIGHT - 3 - ((y * 2 + 1) * (GRID_HEIGHT - 4) / (GRID_MAX_POINTS_Y) / 2), 2, 2, COLOR_UBL); - tft.add_rectangle((x_plot * 2 + 1) * (GRID_WIDTH - 4) / GRID_MAX_POINTS_X / 2 - 1, GRID_HEIGHT - 5 - ((y_plot * 2 + 1) * (GRID_HEIGHT - 4) / GRID_MAX_POINTS_Y / 2), 6, 6, COLOR_UBL); + tft.add_rectangle((x_plot * 2 + 1) * (GRID_WIDTH - 4) / (GRID_MAX_POINTS_X) / 2 - 1, GRID_HEIGHT - 5 - ((y_plot * 2 + 1) * (GRID_HEIGHT - 4) / (GRID_MAX_POINTS_Y) / 2), 6, 6, COLOR_UBL); - const xy_pos_t pos = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }, + const xy_pos_t pos = { bedlevel.get_mesh_x(x_plot), bedlevel.get_mesh_y(y_plot) }, lpos = pos.asLogical(); tft.canvas(320, GRID_OFFSET_Y + (GRID_HEIGHT - MENU_ITEM_HEIGHT) / 2 - MENU_ITEM_HEIGHT, 120, MENU_ITEM_HEIGHT); @@ -531,7 +531,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.set_background(COLOR_BACKGROUND); tft_string.set(Z_LBL); tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); - tft_string.set(isnan(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot])); + tft_string.set(isnan(bedlevel.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(bedlevel.z_values[x_plot][y_plot])); tft_string.trim(); tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string); diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 812a03594795..e0ed060e10c5 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -485,12 +485,12 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const for (uint16_t x = 0; x < (GRID_MAX_POINTS_X); x++) for (uint16_t y = 0; y < (GRID_MAX_POINTS_Y); y++) - if (position_is_reachable({ ubl.mesh_index_to_xpos(x), ubl.mesh_index_to_ypos(y) })) + if (position_is_reachable({ bedlevel.get_mesh_x(x), bedlevel.get_mesh_y(y) })) tft.add_bar(1 + (x * 2 + 1) * (GRID_WIDTH - 4) / (GRID_MAX_POINTS_X) / 2, GRID_HEIGHT - 3 - ((y * 2 + 1) * (GRID_HEIGHT - 4) / (GRID_MAX_POINTS_Y) / 2), 2, 2, COLOR_UBL); tft.add_rectangle((x_plot * 2 + 1) * (GRID_WIDTH - 4) / (GRID_MAX_POINTS_X) / 2 - 1, GRID_HEIGHT - 5 - ((y_plot * 2 + 1) * (GRID_HEIGHT - 4) / (GRID_MAX_POINTS_Y) / 2), 6, 6, COLOR_UBL); - const xy_pos_t pos = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }, + const xy_pos_t pos = { bedlevel.get_mesh_x(x_plot), bedlevel.get_mesh_y(y_plot) }, lpos = pos.asLogical(); tft.canvas(216, GRID_OFFSET_Y + (GRID_HEIGHT - MENU_ITEM_HEIGHT) / 2 - MENU_ITEM_HEIGHT, 96, MENU_ITEM_HEIGHT); @@ -513,7 +513,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.set_background(COLOR_BACKGROUND); tft_string.set(Z_LBL); tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); - tft_string.set(isnan(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot])); + tft_string.set(isnan(bedlevel.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(bedlevel.z_values[x_plot][y_plot])); tft_string.trim(); tft.add_text(96 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string); diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index f142dbbc06c1..5d17848aae9c 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -490,12 +490,12 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const for (uint16_t x = 0; x < (GRID_MAX_POINTS_X); x++) for (uint16_t y = 0; y < (GRID_MAX_POINTS_Y); y++) - if (position_is_reachable({ ubl.mesh_index_to_xpos(x), ubl.mesh_index_to_ypos(y) })) + if (position_is_reachable({ bedlevel.get_mesh_x(x), bedlevel.get_mesh_y(y) })) tft.add_bar(1 + (x * 2 + 1) * (GRID_WIDTH - 4) / (GRID_MAX_POINTS_X) / 2, GRID_HEIGHT - 3 - ((y * 2 + 1) * (GRID_HEIGHT - 4) / (GRID_MAX_POINTS_Y) / 2), 2, 2, COLOR_UBL); tft.add_rectangle((x_plot * 2 + 1) * (GRID_WIDTH - 4) / (GRID_MAX_POINTS_X) / 2 - 1, GRID_HEIGHT - 5 - ((y_plot * 2 + 1) * (GRID_HEIGHT - 4) / (GRID_MAX_POINTS_Y) / 2), 6, 6, COLOR_UBL); - const xy_pos_t pos = { ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot) }, + const xy_pos_t pos = { bedlevel.get_mesh_x(x_plot), bedlevel.get_mesh_y(y_plot) }, lpos = pos.asLogical(); tft.canvas(320, GRID_OFFSET_Y + (GRID_HEIGHT - MENU_ITEM_HEIGHT) / 2 - MENU_ITEM_HEIGHT, 120, MENU_ITEM_HEIGHT); @@ -518,7 +518,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.set_background(COLOR_BACKGROUND); tft_string.set(Z_LBL); tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); - tft_string.set(isnan(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot])); + tft_string.set(isnan(bedlevel.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(bedlevel.z_values[x_plot][y_plot])); tft_string.trim(); tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string); diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 4650765ae15a..919a8f29d11c 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -417,7 +417,7 @@ void line_to_current_position(const_feedRate_t fr_mm_s/*=feedrate_mm_s*/) { #if UBL_SEGMENTED // UBL segmented line will do Z-only moves in single segment - ubl.line_to_destination_segmented(scaled_fr_mm_s); + bedlevel.line_to_destination_segmented(scaled_fr_mm_s); #else if (current_position == destination) return; @@ -904,7 +904,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { * small incremental moves for DELTA or SCARA. * * For Unified Bed Leveling (Delta or Segmented Cartesian) - * the ubl.line_to_destination_segmented method replaces this. + * the bedlevel.line_to_destination_segmented method replaces this. * * For Auto Bed Leveling (Bilinear) with SEGMENT_LEVELED_MOVES * this is replaced by segmented_line_to_destination below. @@ -1060,7 +1060,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { #if HAS_MESH if (planner.leveling_active && planner.leveling_active_at_z(destination.z)) { #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about + bedlevel.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about return true; // all moves, including Z-only moves. #elif ENABLED(SEGMENT_LEVELED_MOVES) segmented_line_to_destination(scaled_fr_mm_s); @@ -1072,9 +1072,9 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { */ if (xy_pos_t(current_position) != xy_pos_t(destination)) { #if ENABLED(MESH_BED_LEVELING) - mbl.line_to_destination(scaled_fr_mm_s); + bedlevel.line_to_destination(scaled_fr_mm_s); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bbl.line_to_destination(scaled_fr_mm_s); + bedlevel.line_to_destination(scaled_fr_mm_s); #endif return true; } @@ -1272,7 +1272,7 @@ void prepare_line_to_destination() { if ( #if UBL_SEGMENTED #if IS_KINEMATIC // UBL using Kinematic / Cartesian cases as a workaround for now. - ubl.line_to_destination_segmented(MMS_SCALED(feedrate_mm_s)) + bedlevel.line_to_destination_segmented(MMS_SCALED(feedrate_mm_s)) #else line_to_destination_cartesian() #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 672ca2dde364..a686d8ebc3d3 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1581,19 +1581,12 @@ void Planner::check_axes_activity() { #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z); - #elif DISABLED(MESH_BED_LEVELING) - constexpr float fade_scaling_factor = 1.0; + if (fade_scaling_factor) raw.z += fade_scaling_factor * bedlevel.get_z_correction(raw); + #else + raw.z += bedlevel.get_z_correction(raw); #endif - raw.z += ( - #if ENABLED(MESH_BED_LEVELING) - mbl.get_z(raw OPTARG(ENABLE_LEVELING_FADE_HEIGHT, fade_scaling_factor)) - #elif ENABLED(AUTO_BED_LEVELING_UBL) - fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0 - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bbl.get_z_correction(raw) : 0.0 - #endif - ); + TERN_(MESH_BED_LEVELING, raw.z += bedlevel.get_z_offset()); #endif } @@ -1612,22 +1605,15 @@ void Planner::check_axes_activity() { #elif HAS_MESH + TERN_(MESH_BED_LEVELING, raw.z -= bedlevel.get_z_offset()); + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z); - #elif DISABLED(MESH_BED_LEVELING) - constexpr float fade_scaling_factor = 1.0; + if (fade_scaling_factor) raw.z -= fade_scaling_factor * bedlevel.get_z_correction(raw); + #else + raw.z -= bedlevel.get_z_correction(raw); #endif - raw.z -= ( - #if ENABLED(MESH_BED_LEVELING) - mbl.get_z(raw OPTARG(ENABLE_LEVELING_FADE_HEIGHT, fade_scaling_factor)) - #elif ENABLED(AUTO_BED_LEVELING_UBL) - fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0 - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - fade_scaling_factor ? fade_scaling_factor * bbl.get_z_correction(raw) : 0.0 - #endif - ); - #endif } } diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 656d38eb28c2..4e1ee716c261 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -247,9 +247,9 @@ typedef struct SettingsDataStruct { // // MESH_BED_LEVELING // - float mbl_z_offset; // mbl.z_offset + float mbl_z_offset; // bedlevel.z_offset uint8_t mesh_num_x, mesh_num_y; // GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - float mbl_z_values[TERN(MESH_BED_LEVELING, GRID_MAX_POINTS_X, 3)] // mbl.z_values + float mbl_z_values[TERN(MESH_BED_LEVELING, GRID_MAX_POINTS_X, 3)] // bedlevel.z_values [TERN(MESH_BED_LEVELING, GRID_MAX_POINTS_Y, 3)]; // @@ -287,7 +287,7 @@ typedef struct SettingsDataStruct { // AUTO_BED_LEVELING_UBL // bool planner_leveling_active; // M420 S planner.leveling_active - int8_t ubl_storage_slot; // ubl.storage_slot + int8_t ubl_storage_slot; // bedlevel.storage_slot // // SERVO_ANGLES @@ -598,7 +598,7 @@ void MarlinSettings::postprocess() { TERN_(ENABLE_LEVELING_FADE_HEIGHT, set_z_fade_height(new_z_fade_height, false)); // false = no report - TERN_(AUTO_BED_LEVELING_BILINEAR, bbl.refresh_bed_level()); + TERN_(AUTO_BED_LEVELING_BILINEAR, bedlevel.refresh_bed_level()); TERN_(HAS_MOTOR_CURRENT_PWM, stepper.refresh_motor_power()); @@ -825,7 +825,7 @@ void MarlinSettings::postprocess() { { #if ENABLED(MESH_BED_LEVELING) static_assert( - sizeof(mbl.z_values) == (GRID_MAX_POINTS) * sizeof(mbl.z_values[0][0]), + sizeof(bedlevel.z_values) == (GRID_MAX_POINTS) * sizeof(bedlevel.z_values[0][0]), "MBL Z array is the wrong size." ); #else @@ -835,12 +835,12 @@ void MarlinSettings::postprocess() { const uint8_t mesh_num_x = TERN(MESH_BED_LEVELING, GRID_MAX_POINTS_X, 3), mesh_num_y = TERN(MESH_BED_LEVELING, GRID_MAX_POINTS_Y, 3); - EEPROM_WRITE(TERN(MESH_BED_LEVELING, mbl.z_offset, dummyf)); + EEPROM_WRITE(TERN(MESH_BED_LEVELING, bedlevel.z_offset, dummyf)); EEPROM_WRITE(mesh_num_x); EEPROM_WRITE(mesh_num_y); #if ENABLED(MESH_BED_LEVELING) - EEPROM_WRITE(mbl.z_values); + EEPROM_WRITE(bedlevel.z_values); #else for (uint8_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_WRITE(dummyf); #endif @@ -877,7 +877,7 @@ void MarlinSettings::postprocess() { { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) static_assert( - sizeof(Z_VALUES_ARR) == (GRID_MAX_POINTS) * sizeof(Z_VALUES_ARR[0][0]), + sizeof(bedlevel.z_values) == (GRID_MAX_POINTS) * sizeof(bedlevel.z_values[0][0]), "Bilinear Z array is the wrong size." ); #endif @@ -887,16 +887,16 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(grid_max_x); EEPROM_WRITE(grid_max_y); #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - EEPROM_WRITE(bbl.get_grid_spacing()); - EEPROM_WRITE(bbl.get_grid_start()); + EEPROM_WRITE(bedlevel.grid_spacing); + EEPROM_WRITE(bedlevel.grid_start); #else - const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0}; + const xy_pos_t bilinear_grid_spacing{0}, bilinear_start{0}; EEPROM_WRITE(bilinear_grid_spacing); EEPROM_WRITE(bilinear_start); #endif #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - EEPROM_WRITE(Z_VALUES_ARR); // 9-256 floats + EEPROM_WRITE(bedlevel.z_values); // 9-256 floats #else dummyf = 0; for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_WRITE(dummyf); @@ -919,7 +919,7 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(planner_leveling_active); const bool ubl_active = TERN(AUTO_BED_LEVELING_UBL, planner.leveling_active, false); - const int8_t storage_slot = TERN(AUTO_BED_LEVELING_UBL, ubl.storage_slot, -1); + const int8_t storage_slot = TERN(AUTO_BED_LEVELING_UBL, bedlevel.storage_slot, -1); EEPROM_WRITE(ubl_active); EEPROM_WRITE(storage_slot); } @@ -1591,8 +1591,8 @@ void MarlinSettings::postprocess() { // UBL Mesh // #if ENABLED(UBL_SAVE_ACTIVE_ON_M500) - if (ubl.storage_slot >= 0) - store_mesh(ubl.storage_slot); + if (bedlevel.storage_slot >= 0) + store_mesh(bedlevel.storage_slot); #endif if (!eeprom_error) { @@ -1749,20 +1749,20 @@ void MarlinSettings::postprocess() { EEPROM_READ_ALWAYS(mesh_num_y); #if ENABLED(MESH_BED_LEVELING) - if (!validating) mbl.z_offset = dummyf; + if (!validating) bedlevel.z_offset = dummyf; if (mesh_num_x == (GRID_MAX_POINTS_X) && mesh_num_y == (GRID_MAX_POINTS_Y)) { // EEPROM data fits the current mesh - EEPROM_READ(mbl.z_values); + EEPROM_READ(bedlevel.z_values); } else { // EEPROM data is stale - if (!validating) mbl.reset(); + if (!validating) bedlevel.reset(); for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummyf); } #else // MBL is disabled - skip the stored data for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummyf); - #endif // MESH_BED_LEVELING + #endif } // @@ -1802,8 +1802,8 @@ void MarlinSettings::postprocess() { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) if (grid_max_x == (GRID_MAX_POINTS_X) && grid_max_y == (GRID_MAX_POINTS_Y)) { if (!validating) set_bed_leveling_enabled(false); - bbl.set_grid(spacing, start); - EEPROM_READ(Z_VALUES_ARR); // 9 to 256 floats + bedlevel.set_grid(spacing, start); + EEPROM_READ(bedlevel.z_values); // 9 to 256 floats } else // EEPROM data is stale #endif // AUTO_BED_LEVELING_BILINEAR @@ -1830,7 +1830,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(planner_leveling_active); #if ENABLED(AUTO_BED_LEVELING_UBL) const bool &planner_leveling_active = planner.leveling_active; - const int8_t &ubl_storage_slot = ubl.storage_slot; + const int8_t &ubl_storage_slot = bedlevel.storage_slot; #else bool planner_leveling_active; int8_t ubl_storage_slot; @@ -2540,11 +2540,11 @@ void MarlinSettings::postprocess() { #if ENABLED(AUTO_BED_LEVELING_UBL) if (!validating) { - ubl.report_state(); + bedlevel.report_state(); - if (!ubl.sanity_check()) { + if (!bedlevel.sanity_check()) { #if BOTH(EEPROM_CHITCHAT, DEBUG_LEVELING_FEATURE) - ubl.echo_name(); + bedlevel.echo_name(); DEBUG_ECHOLNPGM(" initialized.\n"); #endif } @@ -2552,18 +2552,18 @@ void MarlinSettings::postprocess() { eeprom_error = true; #if BOTH(EEPROM_CHITCHAT, DEBUG_LEVELING_FEATURE) DEBUG_ECHOPGM("?Can't enable "); - ubl.echo_name(); + bedlevel.echo_name(); DEBUG_ECHOLNPGM("."); #endif - ubl.reset(); + bedlevel.reset(); } - if (ubl.storage_slot >= 0) { - load_mesh(ubl.storage_slot); - DEBUG_ECHOLNPGM("Mesh ", ubl.storage_slot, " loaded from storage."); + if (bedlevel.storage_slot >= 0) { + load_mesh(bedlevel.storage_slot); + DEBUG_ECHOLNPGM("Mesh ", bedlevel.storage_slot, " loaded from storage."); } else { - ubl.reset(); + bedlevel.reset(); DEBUG_ECHOLNPGM("UBL reset"); } } @@ -2631,7 +2631,7 @@ void MarlinSettings::postprocess() { return (datasize() + EEPROM_OFFSET + 32) & 0xFFF8; } - #define MESH_STORE_SIZE sizeof(TERN(OPTIMIZED_MESH_STORAGE, mesh_store_t, ubl.z_values)) + #define MESH_STORE_SIZE sizeof(TERN(OPTIMIZED_MESH_STORAGE, mesh_store_t, bedlevel.z_values)) uint16_t MarlinSettings::calc_num_meshes() { return (meshes_end - meshes_start_index()) / MESH_STORE_SIZE; @@ -2657,10 +2657,10 @@ void MarlinSettings::postprocess() { #if ENABLED(OPTIMIZED_MESH_STORAGE) int16_t z_mesh_store[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - ubl.set_store_from_mesh(ubl.z_values, z_mesh_store); + bedlevel.set_store_from_mesh(bedlevel.z_values, z_mesh_store); uint8_t * const src = (uint8_t*)&z_mesh_store; #else - uint8_t * const src = (uint8_t*)&ubl.z_values; + uint8_t * const src = (uint8_t*)&bedlevel.z_values; #endif // Write crc to MAT along with other data, or just tack on to the beginning or end @@ -2695,7 +2695,7 @@ void MarlinSettings::postprocess() { int16_t z_mesh_store[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; uint8_t * const dest = (uint8_t*)&z_mesh_store; #else - uint8_t * const dest = into ? (uint8_t*)into : (uint8_t*)&ubl.z_values; + uint8_t * const dest = into ? (uint8_t*)into : (uint8_t*)&bedlevel.z_values; #endif persistentStore.access_start(); @@ -2705,11 +2705,11 @@ void MarlinSettings::postprocess() { #if ENABLED(OPTIMIZED_MESH_STORAGE) if (into) { float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - ubl.set_mesh_from_store(z_mesh_store, z_values); + bedlevel.set_mesh_from_store(z_mesh_store, z_values); memcpy(into, z_values, sizeof(z_values)); } else - ubl.set_mesh_from_store(z_mesh_store, ubl.z_values); + bedlevel.set_mesh_from_store(z_mesh_store, bedlevel.z_values); #endif if (status) SERIAL_ECHOLNPGM("?Unable to load mesh data."); @@ -3320,24 +3320,25 @@ void MarlinSettings::reset() { LOOP_L_N(px, GRID_MAX_POINTS_X) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" G29 S3 I", px, " J", py); - SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(mbl.z_values[px][py]), 5); + SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(bedlevel.z_values[px][py]), 5); } } CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR_F(" G29 S4 Z", LINEAR_UNIT(mbl.z_offset), 5); + SERIAL_ECHOLNPAIR_F(" G29 S4 Z", LINEAR_UNIT(bedlevel.z_offset), 5); } #elif ENABLED(AUTO_BED_LEVELING_UBL) if (!forReplay) { SERIAL_EOL(); - ubl.report_state(); - SERIAL_ECHO_MSG("Active Mesh Slot ", ubl.storage_slot); + bedlevel.report_state(); + SERIAL_ECHO_MSG("Active Mesh Slot ", bedlevel.storage_slot); SERIAL_ECHO_MSG("EEPROM can hold ", calc_num_meshes(), " meshes.\n"); } - //ubl.report_current_mesh(); // This is too verbose for large meshes. A better (more terse) - // solution needs to be found. + //bedlevel.report_current_mesh(); // This is too verbose for large meshes. A better (more terse) + // solution needs to be found. + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) if (leveling_is_valid()) { @@ -3345,7 +3346,7 @@ void MarlinSettings::reset() { LOOP_L_N(px, GRID_MAX_POINTS_X) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" G29 W I", px, " J", py); - SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(Z_VALUES_ARR[px][py]), 5); + SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, LINEAR_UNIT(bedlevel.z_values[px][py]), 5); } } } From c97cf10956ee33c80e557fb09e4cc75d30a0db82 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 21 May 2022 19:29:59 -0500 Subject: [PATCH 316/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20const=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/pinsDebug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/AVR/pinsDebug.h b/Marlin/src/HAL/AVR/pinsDebug.h index 0f564df987f3..dab4e4471524 100644 --- a/Marlin/src/HAL/AVR/pinsDebug.h +++ b/Marlin/src/HAL/AVR/pinsDebug.h @@ -74,7 +74,7 @@ #define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin void PRINT_ARRAY_NAME(uint8_t x) { - char *name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name); + PGM_P const name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[x].name); LOOP_L_N(y, MAX_NAME_LENGTH) { char temp_char = pgm_read_byte(name_mem_pointer + y); if (temp_char != 0) From 1d12e72bf697f7e3cb63995a20ba9e98fbce3eb9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 22 May 2022 16:53:12 -0500 Subject: [PATCH 317/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20SEGMENT=5FLEVELED?= =?UTF-8?q?=5FMOVES=20with=20UBL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/module/motion.cpp | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 9c9110746257..45e48439f437 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1002,7 +1002,7 @@ */ #if ENABLED(AUTO_BED_LEVELING_UBL) #undef LCD_BED_LEVELING - #if ENABLED(DELTA) + #if EITHER(DELTA, SEGMENT_LEVELED_MOVES) #define UBL_SEGMENTED 1 #endif #endif diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 919a8f29d11c..c2e56e22f65d 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -867,8 +867,6 @@ void restore_feedrate_and_scaling() { #endif // !HAS_SOFTWARE_ENDSTOPS -#if !UBL_SEGMENTED - FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { const millis_t ms = millis(); if (ELAPSED(ms, next_idle_ms)) { @@ -985,7 +983,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { #else // !IS_KINEMATIC - #if ENABLED(SEGMENT_LEVELED_MOVES) + #if ENABLED(SEGMENT_LEVELED_MOVES) && DISABLED(AUTO_BED_LEVELING_UBL) /** * Prepare a segmented move on a CARTESIAN setup. @@ -1045,7 +1043,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { planner.buffer_line(destination, fr_mm_s, active_extruder, cartesian_segment_mm OPTARG(SCARA_FEEDRATE_SCALING, inv_duration)); } - #endif // SEGMENT_LEVELED_MOVES + #endif // SEGMENT_LEVELED_MOVES && !AUTO_BED_LEVELING_UBL /** * Prepare a linear move in a Cartesian setup. @@ -1060,8 +1058,12 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { #if HAS_MESH if (planner.leveling_active && planner.leveling_active_at_z(destination.z)) { #if ENABLED(AUTO_BED_LEVELING_UBL) - bedlevel.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about - return true; // all moves, including Z-only moves. + #if UBL_SEGMENTED + return bedlevel.line_to_destination_segmented(scaled_fr_mm_s); + #else + bedlevel.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about + return true; // all moves, including Z-only moves. + #endif #elif ENABLED(SEGMENT_LEVELED_MOVES) segmented_line_to_destination(scaled_fr_mm_s); return false; // caller will update current_position @@ -1087,7 +1089,6 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { } #endif // !IS_KINEMATIC -#endif // !UBL_SEGMENTED #if HAS_DUPLICATION_MODE bool extruder_duplication_enabled; From 0ae061713c631d44cd12ad266ca9c7fdd856d72c Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Fri, 20 May 2022 09:48:34 -0700 Subject: [PATCH 318/502] =?UTF-8?q?=F0=9F=91=94=20Move=20GitHub=20template?= =?UTF-8?q?s,=20update=20README=20(#24199)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 4 +-- .github/contributing.md | 10 ++++---- .github/issue_template.md | 35 --------------------------- README.md | 17 +++++++------ buildroot/web-ui/data/www/index.html | 2 +- 6 files changed, 18 insertions(+), 52 deletions(-) delete mode 100644 .github/issue_template.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 0e6028a31df7..af4f25db776d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -14,7 +14,7 @@ body: ## Before Reporting a Bug - - Read and understand Marlin's [Code of Conduct](https://github.com/MarlinFirmware/Marlin/blob/master/.github/code_of_conduct.md). You are expected to comply with it, including treating everyone with respect. + - Read and understand Marlin's [Code of Conduct](https://github.com/MarlinFirmware/Marlin/blob/2.0.x/.github/code_of_conduct.md). You are expected to comply with it, including treating everyone with respect. - Test with the [`bugfix-2.0.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.0.x.zip) to see whether the issue still exists. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 3f5d6fe5517d..1fe68966fbba 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,7 @@ blank_issues_enabled: false contact_links: - name: 📖 Marlin Documentation - url: http://marlinfw.org/ + url: https://marlinfw.org/ about: Lots of documentation on installing and using Marlin. - name: 👤 MarlinFirmware Facebook group url: https://www.facebook.com/groups/1049718498464482 @@ -10,7 +10,7 @@ contact_links: url: https://discord.gg/n5NJ59y about: Join the Discord server for support and discussion. - name: 🔗 Marlin Discussion Forum - url: http://forums.reprap.org/list.php?415 + url: https://reprap.org/forum/list.php?415 about: A searchable web forum hosted by RepRap dot org. - name: 📺 Marlin Videos on YouTube url: https://www.youtube.com/results?search_query=marlin+firmware diff --git a/.github/contributing.md b/.github/contributing.md index 6bc7b5a00514..24b9dbdf8d0d 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -50,13 +50,13 @@ If chat is more your speed, you can join the MarlinFirmware Discord server: This section guides you through submitting a Bug Report for Marlin. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports. -Before creating a Bug Report, please test the "nightly" development branch, as you might find out that you don't need to create one. When you are creating a Bug Report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](issue_template.md), the information it asks for helps us resolve issues faster. +Before creating a Bug Report, please test the "nightly" development branch, as you might find out that you don't need to create one. When you are creating a Bug Report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](ISSUE_TEMPLATE/bug_report.yml), the information it asks for helps us resolve issues faster. > **Note:** Regressions can happen. If you find a **Closed** issue that seems like your issue, go ahead and open a new issue and include a link to the original issue in the body of your new one. All you need to create a link is the issue number, preceded by #. For example, #8888. #### How Do I Submit A (Good) Bug Report? -Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Use the New Issue button to create an issue and provide the following information by filling in [the template](issue_template.md). +Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Use the New Issue button to create an issue and provide the following information by filling in [the template](ISSUE_TEMPLATE/bug_report.yml). Explain the problem and include additional details to help maintainers reproduce the problem: @@ -88,12 +88,12 @@ Include details about your configuration and environment: This section guides you through submitting a suggestion for Marlin, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions. -Before creating a suggestion, please check [this list](#before-submitting-a-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in [the template](issue_template.md), including the steps that you imagine you would take if the feature you're requesting existed. +Before creating a suggestion, please check [this list](https://github.com/MarlinFirmware/Marlin/issues?q=is%3Aopen+is%3Aissue+label%3A%22T%3A+Feature+Request%22) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-feature-request). Fill in [the template](ISSUE_TEMPLATE/feature_request.yml), including the steps that you imagine you would take if the feature you're requesting existed. #### Before Submitting a Feature Request * **Check the [Marlin website](https://marlinfw.org/)** for tips — you might discover that the feature is already included. Most importantly, check if you're using [the latest version of Marlin](https://github.com/MarlinFirmware/Marlin/releases) and if you can get the desired behavior by changing [Marlin's config settings](https://marlinfw.org/docs/configuration/configuration.html). -* **Perform a [cursory search](https://github.com/MarlinFirmware/Marlin/issues?q=is%3Aissue)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +* **Perform a [cursory search](https://github.com/MarlinFirmware/Marlin/issues?q=is%3Aopen+is%3Aissue+label%3A%22T%3A+Feature+Request%22)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. #### How Do I Submit A (Good) Feature Request? @@ -116,7 +116,7 @@ Unsure where to begin contributing to Marlin? You can start by looking through t ### Pull Requests -Pull Requests should always be targeted to working branches (e.g., `bugfix-1.1.x` and/or `bugfix-2.0.x`) and never to release branches (e.g., `1.1.x`). If this is your first Pull Request, please read our [Guide to Pull Requests](https://marlinfw.org/docs/development/getting_started_pull_requests.html) and Github's [Pull Request](https://help.github.com/articles/creating-a-pull-request/) documentation. +Pull Requests should always be targeted to working branches (e.g., `bugfix-2.0.x` and/or `bugfix-1.1.x`) and never to release branches (e.g., `2.0.x` and/or `1.1.x`). If this is your first Pull Request, please read our [Guide to Pull Requests](https://marlinfw.org/docs/development/getting_started_pull_requests.html) and Github's [Pull Request](https://help.github.com/articles/creating-a-pull-request/) documentation. * Fill in [the required template](pull_request_template.md). * Don't include issue numbers in the PR title. diff --git a/.github/issue_template.md b/.github/issue_template.md deleted file mode 100644 index 6cb34b8f588a..000000000000 --- a/.github/issue_template.md +++ /dev/null @@ -1,35 +0,0 @@ - - -### Description - - - -### Steps to Reproduce - - - -1. [First Step] -2. [Second Step] -3. [and so on...] - -**Expected behavior:** [What you expect to happen] - -**Actual behavior:** [What actually happens] - -#### Additional Information - -* Include a ZIP file containing your `Configuration.h` and `Configuration_adv.h` files. -* Provide pictures or links to videos that clearly demonstrate the issue. -* See [How Can I Contribute](#how-can-i-contribute) for additional guidelines. diff --git a/README.md b/README.md index 72b354d4feb6..c141e889e508 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,11 @@ To build Marlin 2.0 you'll need [Arduino IDE 1.8.8 or newer](https://www.arduino Platform|MCU|Example Boards --------|---|------- [Arduino AVR](https://www.arduino.cc/)|ATmega|RAMPS, Melzi, RAMBo - [Teensy++ 2.0](http://www.microchip.com/wwwproducts/en/AT90USB1286)|AT90USB1286|Printrboard + [Teensy++ 2.0](https://www.microchip.com/en-us/product/AT90USB1286)|AT90USB1286|Printrboard [Arduino Due](https://www.arduino.cc/en/Guide/ArduinoDue)|SAM3X8E|RAMPS-FD, RADDS, RAMPS4DUE [ESP32](https://github.com/espressif/arduino-esp32)|ESP32|FYSETC E4, E4d@BOX, MRR - [LPC1768](http://www.nxp.com/products/microcontrollers-and-processors/arm-based-processors-and-mcus/lpc-cortex-m-mcus/lpc1700-cortex-m3/512kb-flash-64kb-sram-ethernet-usb-lqfp100-package:LPC1768FBD100)|ARM® Cortex-M3|MKS SBASE, Re-ARM, Selena Compact - [LPC1769](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512kb-flash-64kb-sram-ethernet-usb-lqfp100-package:LPC1769FBD100)|ARM® Cortex-M3|Smoothieboard, Azteeg X5 mini, TH3D EZBoard + [LPC1768](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512-kb-flash-64-kb-sram-ethernet-usb-lqfp100-package:LPC1768FBD100)|ARM® Cortex-M3|MKS SBASE, Re-ARM, Selena Compact + [LPC1769](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512-kb-flash-64-kb-sram-ethernet-usb-lqfp100-package:LPC1769FBD100)|ARM® Cortex-M3|Smoothieboard, Azteeg X5 mini, TH3D EZBoard [STM32F103](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html)|ARM® Cortex-M3|Malyan M200, GTM32 Pro, MKS Robin, BTT SKR Mini [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html)|ARM® Cortex-M4|ARMED, Rumba32, SKR Pro, Lerdge, FYSETC S6 [STM32F7x6](https://www.st.com/en/microcontrollers-microprocessors/stm32f7x6.html)|ARM® Cortex-M7|The Borg, RemRam V1 @@ -57,10 +57,10 @@ To build Marlin 2.0 you'll need [Arduino IDE 1.8.8 or newer](https://www.arduino The Issue Queue is reserved for Bug Reports and Feature Requests. To get help with configuration and troubleshooting, please use the following resources: -- [Marlin Documentation](http://marlinfw.org) - Official Marlin documentation +- [Marlin Documentation](https://marlinfw.org) - Official Marlin documentation - [Marlin Discord](https://discord.gg/n5NJ59y) - Discuss issues with Marlin users and developers - Facebook Group ["Marlin Firmware"](https://www.facebook.com/groups/1049718498464482/) -- RepRap.org [Marlin Forum](http://forums.reprap.org/list.php?415) +- RepRap.org [Marlin Forum](https://forums.reprap.org/list.php?415) - Facebook Group ["Marlin Firmware for 3D Printers"](https://www.facebook.com/groups/3Dtechtalk/) - [Marlin Configuration](https://www.youtube.com/results?search_query=marlin+configuration) on YouTube @@ -72,15 +72,16 @@ Marlin is constantly improving thanks to a huge number of contributors from all Regular users can open and close their own issues, but only the administrators can do project-related things like add labels, merge changes, set milestones, and kick trolls. The current Marlin admin team consists of: - - Scott Lahteine [[@thinkyhead](https://github.com/thinkyhead)] - USA - Project Maintainer   [![Donate](https://api.flattr.com/button/flattr-badge-large.png)](http://www.thinkyhead.com/donate-to-marlin) + - Scott Lahteine [[@thinkyhead](https://github.com/thinkyhead)] - USA - Project Maintainer   [💸 Donate](https://www.thinkyhead.com/donate-to-marlin) - Roxanne Neufeld [[@Roxy-3D](https://github.com/Roxy-3D)] - USA - - Keith Bennett [[@thisiskeithb](https://github.com/thisiskeithb)] - USA + - Keith Bennett [[@thisiskeithb](https://github.com/thisiskeithb)] - USA   [💸 Donate](https://github.com/sponsors/thisiskeithb) + - Peter Ellens [[@ellensp](https://github.com/ellensp)] - New Zealand - Victor Oliveira [[@rhapsodyv](https://github.com/rhapsodyv)] - Brazil - Chris Pepper [[@p3p](https://github.com/p3p)] - UK - Jason Smith [[@sjasonsmith](https://github.com/sjasonsmith)] - USA - Luu Lac [[@shitcreek](https://github.com/shitcreek)] - USA - Bob Kuhn [[@Bob-the-Kuhn](https://github.com/Bob-the-Kuhn)] - USA - - Erik van der Zalm [[@ErikZalm](https://github.com/ErikZalm)] - Netherlands   [![Flattr Erik](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=ErikZalm&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software) + - Erik van der Zalm [[@ErikZalm](https://github.com/ErikZalm)] - Netherlands   [💸 Donate](https://flattr.com/submit/auto?user_id=ErikZalm&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software) ## License diff --git a/buildroot/web-ui/data/www/index.html b/buildroot/web-ui/data/www/index.html index 54bcc13d7386..1a8db1cafb04 100644 --- a/buildroot/web-ui/data/www/index.html +++ b/buildroot/web-ui/data/www/index.html @@ -456,7 +456,7 @@
- +
From b6abc760cef73a1dfc0e186f40687d0a45c8a769 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 14 May 2022 01:45:14 -0500 Subject: [PATCH 319/502] =?UTF-8?q?=F0=9F=94=A8=20Move,=20tweak=20maple=20?= =?UTF-8?q?envs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-builds.yml | 2 +- Marlin/src/pins/pins.h | 12 +- ...F103.json => marlin_maple_CHITU_F103.json} | 2 +- ...EB_3DP.json => marlin_maple_MEEB_3DP.json} | 2 +- .../ldscripts/fysetc_stm32f103rc.ld | 18 - .../scripts/STM32F103RC_MEEB_3DP.py | 23 -- .../share/PlatformIO/scripts/mks_robin.py | 5 - .../share/PlatformIO/scripts/mks_robin_e3.py | 5 - .../share/PlatformIO/scripts/mks_robin_e3p.py | 5 - .../PlatformIO/scripts/mks_robin_lite.py | 5 - .../PlatformIO/scripts/mks_robin_lite3.py | 5 - .../PlatformIO/scripts/mks_robin_mini.py | 5 - .../PlatformIO/scripts/mks_robin_nano.py | 5 - .../PlatformIO/scripts/mks_robin_nano35.py | 5 - .../share/PlatformIO/scripts/mks_robin_pro.py | 5 - buildroot/share/PlatformIO/scripts/robin.py | 14 - .../board.cpp | 0 .../board/board.h | 0 .../ld/common.inc | 0 .../ld/extra_libs.inc | 0 .../ld/flash.ld | 0 .../ld/stm32f103z_dfu.ld | 0 .../ld/stm32f103zc.ld | 0 .../ld/stm32f103zd.ld | 0 .../ld/stm32f103ze.ld | 0 .../ld/vector_symbols.inc | 0 .../pins_arduino.h | 0 .../variant.h | 0 .../wirish/boards.cpp | 0 .../wirish/boards_setup.cpp | 0 .../wirish/start.S | 0 .../wirish/start_c.c | 0 .../wirish/syscalls.c | 0 .../board.cpp | 0 .../board/board.h | 0 .../ld/bootloader.ld | 0 .../ld/common.inc | 0 .../ld/extra_libs.inc | 0 .../ld/flash.ld | 0 .../ld/jtag.ld | 0 .../ld/mem-flash.inc | 0 .../ld/mem-jtag.inc | 0 .../ld/mem-ram.inc | 0 .../ld/ram.ld | 0 .../ld/stm32f103rb.ld | 0 .../ld/stm32f103rb_bootloader.ld | 0 .../ld/stm32f103rc.ld | 0 .../ld/stm32f103rc_bootloader.ld | 0 .../ld/stm32f103re.ld | 0 .../ld/vector_symbols.inc | 0 .../pins_arduino.h | 0 .../variant.h | 0 .../wirish/boards.cpp | 0 .../wirish/boards_setup.cpp | 0 .../wirish/start.S | 0 .../wirish/start_c.c | 0 .../wirish/syscalls.c | 0 ...TM32F103RC_meeb => STM32F103RC_meeb_maple} | 0 ini/renamed.ini | 8 + ini/stm32f1-maple.ini | 357 ++++++++---------- 60 files changed, 184 insertions(+), 299 deletions(-) rename buildroot/share/PlatformIO/boards/{marlin_CHITU_F103.json => marlin_maple_CHITU_F103.json} (95%) rename buildroot/share/PlatformIO/boards/{marlin_MEEB_3DP.json => marlin_maple_MEEB_3DP.json} (96%) delete mode 100644 buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld delete mode 100644 buildroot/share/PlatformIO/scripts/mks_robin.py delete mode 100644 buildroot/share/PlatformIO/scripts/mks_robin_e3.py delete mode 100644 buildroot/share/PlatformIO/scripts/mks_robin_e3p.py delete mode 100644 buildroot/share/PlatformIO/scripts/mks_robin_lite.py delete mode 100644 buildroot/share/PlatformIO/scripts/mks_robin_lite3.py delete mode 100644 buildroot/share/PlatformIO/scripts/mks_robin_mini.py delete mode 100644 buildroot/share/PlatformIO/scripts/mks_robin_nano.py delete mode 100644 buildroot/share/PlatformIO/scripts/mks_robin_nano35.py delete mode 100644 buildroot/share/PlatformIO/scripts/mks_robin_pro.py delete mode 100644 buildroot/share/PlatformIO/scripts/robin.py rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/board.cpp (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/board/board.h (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/ld/common.inc (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/ld/extra_libs.inc (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/ld/flash.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/ld/stm32f103z_dfu.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/ld/stm32f103zc.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/ld/stm32f103zd.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/ld/stm32f103ze.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/ld/vector_symbols.inc (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/pins_arduino.h (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/variant.h (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/wirish/boards.cpp (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/wirish/boards_setup.cpp (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/wirish/start.S (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/wirish/start_c.c (100%) rename buildroot/share/PlatformIO/variants/{marlin_CHITU_F103 => marlin_maple_CHITU_F103}/wirish/syscalls.c (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/board.cpp (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/board/board.h (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/bootloader.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/common.inc (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/extra_libs.inc (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/flash.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/jtag.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/mem-flash.inc (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/mem-jtag.inc (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/mem-ram.inc (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/ram.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/stm32f103rb.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/stm32f103rb_bootloader.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/stm32f103rc.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/stm32f103rc_bootloader.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/stm32f103re.ld (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/ld/vector_symbols.inc (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/pins_arduino.h (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/variant.h (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/wirish/boards.cpp (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/wirish/boards_setup.cpp (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/wirish/start.S (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/wirish/start_c.c (100%) rename buildroot/share/PlatformIO/variants/{marlin_MEEB_3DP => marlin_maple_MEEB_3DP}/wirish/syscalls.c (100%) rename buildroot/tests/{STM32F103RC_meeb => STM32F103RC_meeb_maple} (100%) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 2d94b000c68c..498cfc1d1f51 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -59,7 +59,7 @@ jobs: #- STM32F103RC_btt_maple - STM32F103RC_btt_USB_maple - STM32F103RC_fysetc_maple - - STM32F103RC_meeb + - STM32F103RC_meeb_maple - jgaurora_a5s_a1_maple - STM32F103VE_longer_maple #- mks_robin_maple diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 5db9f71d10c0..82c91290c24c 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -492,15 +492,15 @@ #elif MB(STM3R_MINI) #include "stm32f1/pins_STM3R_MINI.h" // STM32F103VE? env:STM32F103VE env:STM32F103RE_maple #elif MB(GTM32_PRO_VB) - #include "stm32f1/pins_GTM32_PRO_VB.h" // STM32F103VE env:STM32F103VE env:STM32F103RE_maple + #include "stm32f1/pins_GTM32_PRO_VB.h" // STM32F103VE env:STM32F103VE env:STM32F103VE_GTM32_maple #elif MB(GTM32_PRO_VD) - #include "stm32f1/pins_GTM32_PRO_VD.h" // STM32F103VE env:STM32F103VE env:STM32F103RE_maple + #include "stm32f1/pins_GTM32_PRO_VD.h" // STM32F103VE env:STM32F103VE env:STM32F103VE_GTM32_maple #elif MB(GTM32_MINI) - #include "stm32f1/pins_GTM32_MINI.h" // STM32F103VE env:STM32F103VE env:STM32F103RE_maple + #include "stm32f1/pins_GTM32_MINI.h" // STM32F103VE env:STM32F103VE env:STM32F103VE_GTM32_maple #elif MB(GTM32_MINI_A30) - #include "stm32f1/pins_GTM32_MINI_A30.h" // STM32F103VE env:STM32F103VE env:STM32F103RE_maple + #include "stm32f1/pins_GTM32_MINI_A30.h" // STM32F103VE env:STM32F103VE env:STM32F103VE_GTM32_maple #elif MB(GTM32_REV_B) - #include "stm32f1/pins_GTM32_REV_B.h" // STM32F103VE env:STM32F103VE env:STM32F103RE_maple + #include "stm32f1/pins_GTM32_REV_B.h" // STM32F103VE env:STM32F103VE env:STM32F103VE_GTM32_maple #elif MB(MORPHEUS) #include "stm32f1/pins_MORPHEUS.h" // STM32F103RE env:STM32F103RE env:STM32F103RE_maple #elif MB(CHITU3D) @@ -556,7 +556,7 @@ #elif MB(LONGER3D_LK) #include "stm32f1/pins_LONGER3D_LK.h" // STM32F1 env:STM32F103VE_longer env:STM32F103VE_longer_maple #elif MB(CCROBOT_MEEB_3DP) - #include "stm32f1/pins_CCROBOT_MEEB_3DP.h" // STM32F1 env:STM32F103RC_meeb + #include "stm32f1/pins_CCROBOT_MEEB_3DP.h" // STM32F1 env:STM32F103RC_meeb_maple #elif MB(CHITU3D_V5) #include "stm32f1/pins_CHITU3D_V5.h" // STM32F1 env:chitu_f103 env:chitu_f103_maple env:chitu_v5_gpio_init env:chitu_v5_gpio_init_maple #elif MB(CHITU3D_V6) diff --git a/buildroot/share/PlatformIO/boards/marlin_CHITU_F103.json b/buildroot/share/PlatformIO/boards/marlin_maple_CHITU_F103.json similarity index 95% rename from buildroot/share/PlatformIO/boards/marlin_CHITU_F103.json rename to buildroot/share/PlatformIO/boards/marlin_maple_CHITU_F103.json index dbfbc21cb275..45c80b3ec037 100644 --- a/buildroot/share/PlatformIO/boards/marlin_CHITU_F103.json +++ b/buildroot/share/PlatformIO/boards/marlin_maple_CHITU_F103.json @@ -15,7 +15,7 @@ ] ], "mcu": "stm32f103zet6", - "variant": "marlin_CHITU_F103" + "variant": "marlin_maple_CHITU_F103" }, "debug": { "jlink_device": "STM32F103ZE", diff --git a/buildroot/share/PlatformIO/boards/marlin_MEEB_3DP.json b/buildroot/share/PlatformIO/boards/marlin_maple_MEEB_3DP.json similarity index 96% rename from buildroot/share/PlatformIO/boards/marlin_MEEB_3DP.json rename to buildroot/share/PlatformIO/boards/marlin_maple_MEEB_3DP.json index 73ec9aaf48e2..54fd5fbed950 100644 --- a/buildroot/share/PlatformIO/boards/marlin_MEEB_3DP.json +++ b/buildroot/share/PlatformIO/boards/marlin_maple_MEEB_3DP.json @@ -18,7 +18,7 @@ "ldscript": "stm32f103xc.ld" }, "mcu": "stm32f103rct6", - "variant": "marlin_MEEB_3DP" + "variant": "marlin_maple_MEEB_3DP" }, "debug": { "jlink_device": "STM32F103RC", diff --git a/buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld b/buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld deleted file mode 100644 index 6777e5918262..000000000000 --- a/buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Linker script for Generic STM32F103RC boards, using the generic bootloader (which takes the lower 8k of memory) - */ - -MEMORY -{ - ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - rom (rx) : ORIGIN = 0x08008000, LENGTH = 256K - 32K -} - -/* Provide memory region aliases for common.inc */ -REGION_ALIAS("REGION_TEXT", rom); -REGION_ALIAS("REGION_DATA", ram); -REGION_ALIAS("REGION_BSS", ram); -REGION_ALIAS("REGION_RODATA", rom); - -/* Let common.inc handle the real work. */ -INCLUDE common.inc diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py b/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py index eccee7606804..551f4c63160b 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py +++ b/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py @@ -4,29 +4,9 @@ import pioutil if pioutil.is_pio_build(): - try: - import configparser - except ImportError: - import ConfigParser as configparser - import os Import("env", "projenv") - config = configparser.ConfigParser() - config.read("platformio.ini") - - # - # Upload actions - # - def before_upload(source, target, env): - env.Execute("pwd") - - def after_upload(source, target, env): - env.Execute("pwd") - - env.AddPreAction("upload", before_upload) - env.AddPostAction("upload", after_upload) - flash_size = 0 vect_tab_addr = 0 @@ -38,6 +18,3 @@ def after_upload(source, target, env): print('Use the {0:s} address as the marlin app entry point.'.format(vect_tab_addr)) print('Use the {0:d}KB flash version of stm32f103rct6 chip.'.format(flash_size)) - - import marlin - marlin.custom_ld_script("STM32F103RC_MEEB_3DP.ld") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin.py b/buildroot/share/PlatformIO/scripts/mks_robin.py deleted file mode 100644 index 7b423bedabc7..000000000000 --- a/buildroot/share/PlatformIO/scripts/mks_robin.py +++ /dev/null @@ -1,5 +0,0 @@ -# -# mks_robin.py -# -import robin -robin.prepare("0x08007000", "mks_robin.ld", "Robin.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_e3.py b/buildroot/share/PlatformIO/scripts/mks_robin_e3.py deleted file mode 100644 index 645230c625c2..000000000000 --- a/buildroot/share/PlatformIO/scripts/mks_robin_e3.py +++ /dev/null @@ -1,5 +0,0 @@ -# -# mks_robin_e3.py -# -import robin -robin.prepare("0x08005000", "mks_robin_e3.ld", "Robin_e3.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_e3p.py b/buildroot/share/PlatformIO/scripts/mks_robin_e3p.py deleted file mode 100644 index bb15cb5a70f2..000000000000 --- a/buildroot/share/PlatformIO/scripts/mks_robin_e3p.py +++ /dev/null @@ -1,5 +0,0 @@ -# -# mks_robin_e3p.py -# -import robin -robin.prepare("0x08007000", "mks_robin_e3p.ld", "Robin_e3p.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_lite.py b/buildroot/share/PlatformIO/scripts/mks_robin_lite.py deleted file mode 100644 index 123b043f7cfb..000000000000 --- a/buildroot/share/PlatformIO/scripts/mks_robin_lite.py +++ /dev/null @@ -1,5 +0,0 @@ -# -# mks_robin_lite.py -# -import robin -robin.prepare("0x08005000", "mks_robin_lite.ld", "mksLite.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_lite3.py b/buildroot/share/PlatformIO/scripts/mks_robin_lite3.py deleted file mode 100644 index 092231eae81f..000000000000 --- a/buildroot/share/PlatformIO/scripts/mks_robin_lite3.py +++ /dev/null @@ -1,5 +0,0 @@ -# -# mks_robin_lite3.py -# -import robin -robin.prepare("0x08005000", "mks_robin_lite.ld", "mksLite3.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_mini.py b/buildroot/share/PlatformIO/scripts/mks_robin_mini.py deleted file mode 100644 index d1d175dd1c17..000000000000 --- a/buildroot/share/PlatformIO/scripts/mks_robin_mini.py +++ /dev/null @@ -1,5 +0,0 @@ -# -# mks_robin_mini.py -# -import robin -robin.prepare("0x08007000", "mks_robin_mini.ld", "Robin_mini.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_nano.py b/buildroot/share/PlatformIO/scripts/mks_robin_nano.py deleted file mode 100644 index 32d1af23662c..000000000000 --- a/buildroot/share/PlatformIO/scripts/mks_robin_nano.py +++ /dev/null @@ -1,5 +0,0 @@ -# -# mks_robin_nano.py -# -import robin -robin.prepare("0x08007000", "mks_robin_nano.ld", "Robin_nano.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py b/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py deleted file mode 100644 index 7e635bd6ecf7..000000000000 --- a/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py +++ /dev/null @@ -1,5 +0,0 @@ -# -# mks_robin_nano35.py -# -import robin -robin.prepare("0x08007000", "mks_robin_nano.ld", "Robin_nano35.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_pro.py b/buildroot/share/PlatformIO/scripts/mks_robin_pro.py deleted file mode 100644 index 54526aeaef57..000000000000 --- a/buildroot/share/PlatformIO/scripts/mks_robin_pro.py +++ /dev/null @@ -1,5 +0,0 @@ -# -# mks_robin_pro.py -# -import robin -robin.prepare("0x08007000", "mks_robin_pro.ld", "Robin_pro.bin") diff --git a/buildroot/share/PlatformIO/scripts/robin.py b/buildroot/share/PlatformIO/scripts/robin.py deleted file mode 100644 index ffc9a43b9004..000000000000 --- a/buildroot/share/PlatformIO/scripts/robin.py +++ /dev/null @@ -1,14 +0,0 @@ -# -# robin.py -# - -# Apply customizations for a MKS Robin -def prepare(address, ldname, fwname): - import pioutil - if pioutil.is_pio_build(): - import marlin - def encrypt(source, target, env): - marlin.encrypt_mks(source, target, env, fwname) - marlin.relocate_firmware(address) - marlin.custom_ld_script(ldname) - marlin.add_post_action(encrypt); diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/board.cpp b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/board.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/board.cpp rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/board.cpp diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/board/board.h b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/board/board.h similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/board/board.h rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/board/board.h diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/common.inc b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/common.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/common.inc rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/common.inc diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/extra_libs.inc b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/extra_libs.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/extra_libs.inc rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/extra_libs.inc diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/flash.ld b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/flash.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/flash.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/flash.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103z_dfu.ld b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103z_dfu.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103z_dfu.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103z_dfu.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103zc.ld b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103zc.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103zc.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103zc.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103zd.ld b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103zd.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103zd.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103zd.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103ze.ld b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103ze.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103ze.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103ze.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/vector_symbols.inc b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/vector_symbols.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/vector_symbols.inc rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/vector_symbols.inc diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/pins_arduino.h b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/pins_arduino.h similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/pins_arduino.h rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/pins_arduino.h diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/variant.h b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/variant.h rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/variant.h diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/boards.cpp b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/boards.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/boards.cpp rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/boards.cpp diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/boards_setup.cpp b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/boards_setup.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/boards_setup.cpp rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/boards_setup.cpp diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/start.S b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/start.S similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/start.S rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/start.S diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/start_c.c b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/start_c.c similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/start_c.c rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/start_c.c diff --git a/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/syscalls.c b/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/syscalls.c similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/syscalls.c rename to buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/syscalls.c diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/board.cpp b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/board.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/board.cpp rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/board.cpp diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/board/board.h b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/board/board.h similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/board/board.h rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/board/board.h diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/bootloader.ld b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/bootloader.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/bootloader.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/bootloader.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/common.inc b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/common.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/common.inc rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/common.inc diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/extra_libs.inc b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/extra_libs.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/extra_libs.inc rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/extra_libs.inc diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/flash.ld b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/flash.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/flash.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/flash.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/jtag.ld b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/jtag.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/jtag.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/jtag.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-flash.inc b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/mem-flash.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-flash.inc rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/mem-flash.inc diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-jtag.inc b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/mem-jtag.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-jtag.inc rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/mem-jtag.inc diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-ram.inc b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/mem-ram.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-ram.inc rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/mem-ram.inc diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/ram.ld b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/ram.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/ram.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/ram.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rb.ld b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/stm32f103rb.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rb.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/stm32f103rb.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rb_bootloader.ld b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/stm32f103rb_bootloader.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rb_bootloader.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/stm32f103rb_bootloader.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rc.ld b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/stm32f103rc.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rc.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/stm32f103rc.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rc_bootloader.ld b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/stm32f103rc_bootloader.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rc_bootloader.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/stm32f103rc_bootloader.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103re.ld b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/stm32f103re.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103re.ld rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/stm32f103re.ld diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/vector_symbols.inc b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/vector_symbols.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/vector_symbols.inc rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/ld/vector_symbols.inc diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/pins_arduino.h b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/pins_arduino.h similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/pins_arduino.h rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/pins_arduino.h diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/variant.h b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/variant.h rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/variant.h diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/boards.cpp b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/wirish/boards.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/boards.cpp rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/wirish/boards.cpp diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/boards_setup.cpp b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/wirish/boards_setup.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/boards_setup.cpp rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/wirish/boards_setup.cpp diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/start.S b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/wirish/start.S similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/start.S rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/wirish/start.S diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/start_c.c b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/wirish/start_c.c similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/start_c.c rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/wirish/start_c.c diff --git a/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/syscalls.c b/buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/wirish/syscalls.c similarity index 100% rename from buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/syscalls.c rename to buildroot/share/PlatformIO/variants/marlin_maple_MEEB_3DP/wirish/syscalls.c diff --git a/buildroot/tests/STM32F103RC_meeb b/buildroot/tests/STM32F103RC_meeb_maple similarity index 100% rename from buildroot/tests/STM32F103RC_meeb rename to buildroot/tests/STM32F103RC_meeb_maple diff --git a/ini/renamed.ini b/ini/renamed.ini index b325476d2f9e..75f5dc3accc7 100644 --- a/ini/renamed.ini +++ b/ini/renamed.ini @@ -48,3 +48,11 @@ extends = renamed [env:STM32F103RC_btt_512K_USB_maple] # Renamed to STM32F103RE_btt_USB_maple extends = renamed + +[env:STM32F103RC_meeb] +# Renamed to STM32F103RC_meeb_maple +extends = renamed + +[env:STM32F103VE_GTM32] +# Renamed to STM32F103VE_GTM32_maple +extends = renamed diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index bfa82876286e..18c861ba1ebe 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -22,7 +22,7 @@ # # HAL/STM32F1 Common Environment values # -[common_stm32f1] +[STM32F1_maple] platform = ststm32@~12.1 board_build.core = maple build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py @@ -34,52 +34,62 @@ lib_deps = ${common.lib_deps} SoftwareSerialM platform_packages = tool-stm32duino extra_scripts = ${common.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py - pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py - buildroot/share/PlatformIO/scripts/offset_and_rename.py + pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py + pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py + buildroot/share/PlatformIO/scripts/custom_board.py + buildroot/share/PlatformIO/scripts/offset_and_rename.py # -# STM32F103RC +# Generic STM32F103RC environment # -[common_STM32F103RC_maple] -extends = common_stm32f1 -board = genericSTM32F103RC -monitor_speed = 115200 +[env:STM32F103RC_maple] +extends = STM32F1_maple +board = genericSTM32F103RC +monitor_speed = 115200 + +# +# Generic STM32F103RE environment +# +[env:STM32F103RE_maple] +extends = STM32F1_maple +board = genericSTM32F103RE +monitor_speed = 115200 # # MEEB_3DP (STM32F103RCT6 with 512K) # -[env:STM32F103RC_meeb] -extends = common_STM32F103RC_maple -board = marlin_MEEB_3DP -build_flags = ${common_stm32f1.build_flags} - -DDEBUG_LEVEL=0 - -DSS_TIMER=4 - -DSTM32_FLASH_SIZE=512 - -DHSE_VALUE=12000000U - -DUSE_USB_COMPOSITE - -DVECT_TAB_OFFSET=0x2000 - -DGENERIC_BOOTLOADER -extra_scripts = ${common_stm32f1.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py - buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py -lib_deps = ${common_stm32f1.lib_deps} - USBComposite for STM32F1@0.91 +[env:STM32F103RC_meeb_maple] +extends = env:STM32F103RC_maple +board = marlin_maple_MEEB_3DP +build_flags = ${STM32F1_maple.build_flags} + -DDEBUG_LEVEL=0 + -DSS_TIMER=4 + -DSTM32_FLASH_SIZE=512 + -DHSE_VALUE=12000000U + -DUSE_USB_COMPOSITE + -DVECT_TAB_OFFSET=0x2000 + -DGENERIC_BOOTLOADER +board_build.ldscript = STM32F103RC_MEEB_3DP.ld +extra_scripts = ${STM32F1_maple.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py + buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py +lib_deps = ${STM32F1_maple.lib_deps} + USBComposite for STM32F1@0.91 custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/ccccmagicboy/Adafruit_NeoPixel#meeb_3dp_use -debug_tool = stlink -upload_protocol = dfu +debug_tool = stlink +upload_protocol = dfu # # FYSETC STM32F103RC # [env:STM32F103RC_fysetc_maple] -extends = common_STM32F103RC_maple -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py -build_flags = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0 -lib_ldf_mode = chain -debug_tool = stlink -upload_protocol = serial +extends = env:STM32F103RC_maple +extra_scripts = ${STM32F1_maple.extra_scripts} + buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py +build_flags = ${STM32F1_maple.build_flags} -DDEBUG_LEVEL=0 +lib_ldf_mode = chain +debug_tool = stlink +upload_protocol = serial # # BigTree SKR Mini V1.1 / SKR Mini E3 & MZ (STM32F103RCT6 ARM Cortex-M3) @@ -88,48 +98,28 @@ upload_protocol = serial # STM32F103RC_btt_USB_maple ......... RCT6 with 256K (USB mass storage) # [env:STM32F103RC_btt_maple] -extends = common_STM32F103RC_maple +extends = env:STM32F103RC_maple board_build.address = 0x08007000 board_build.ldscript = STM32F103RC_SKR_MINI_256K.ld -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/custom_board.py -build_flags = ${common_stm32f1.build_flags} - -DDEBUG_LEVEL=0 -DSS_TIMER=4 +build_flags = ${STM32F1_maple.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 monitor_speed = 115200 [env:STM32F103RC_btt_USB_maple] -extends = env:STM32F103RC_btt_maple -build_flags = ${env:STM32F103RC_btt_maple.build_flags} -DUSE_USB_COMPOSITE -lib_deps = ${env:STM32F103RC_btt_maple.lib_deps} - USBComposite for STM32F1@0.91 - -# -# Generic STM32F103RE environment -# -[env:STM32F103RE_maple] -extends = common_stm32f1 -board = genericSTM32F103RE -monitor_speed = 115200 - -# -# Generic STM32F103RC environment -# -[env:STM32F103RC_maple] -extends = common_stm32f1 -board = genericSTM32F103RC -monitor_speed = 115200 +extends = env:STM32F103RC_btt_maple +build_flags = ${env:STM32F103RC_btt_maple.build_flags} -DUSE_USB_COMPOSITE +lib_deps = ${env:STM32F103RC_btt_maple.lib_deps} + USBComposite for STM32F1@0.91 # # Creality (STM32F103RET6) # [env:STM32F103RE_creality_maple] extends = env:STM32F103RE_maple -build_flags = ${common_stm32f1.build_flags} -DTEMP_TIMER_CHAN=4 +build_flags = ${STM32F1_maple.build_flags} -DTEMP_TIMER_CHAN=4 board_build.address = 0x08007000 board_build.ldscript = creality.ld -extra_scripts = ${common_stm32f1.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/random-bin.py - buildroot/share/PlatformIO/scripts/custom_board.py +extra_scripts = ${STM32F1_maple.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/random-bin.py debug_tool = jlink upload_protocol = jlink @@ -138,12 +128,11 @@ upload_protocol = jlink # [env:STM32F103RC_creality_maple] extends = env:STM32F103RC_maple -build_flags = ${common_stm32f1.build_flags} -DTEMP_TIMER_CHAN=4 +build_flags = ${STM32F1_maple.build_flags} -DTEMP_TIMER_CHAN=4 board_build.address = 0x08007000 board_build.ldscript = creality.ld -extra_scripts = ${common_stm32f1.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/random-bin.py - buildroot/share/PlatformIO/scripts/custom_board.py +extra_scripts = ${STM32F1_maple.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/random-bin.py debug_tool = jlink upload_protocol = jlink @@ -162,204 +151,197 @@ board_build.ldscript = crealityPro.ld # STM32F103RE_btt_USB_maple ......... RET6 (USB mass storage) # [env:STM32F103RE_btt_maple] -extends = env:STM32F103RE_maple +extends = env:STM32F103RE_maple board_build.address = 0x08007000 board_build.ldscript = STM32F103RE_SKR_MINI_512K.ld -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/custom_board.py -build_flags = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 -debug_tool = stlink -upload_protocol = stlink +build_flags = ${STM32F1_maple.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 +debug_tool = stlink +upload_protocol = stlink [env:STM32F103RE_btt_USB_maple] -extends = env:STM32F103RE_btt_maple -build_flags = ${env:STM32F103RE_btt_maple.build_flags} -DUSE_USB_COMPOSITE -lib_deps = ${common_stm32f1.lib_deps} - USBComposite for STM32F1@0.91 +extends = env:STM32F103RE_btt_maple +build_flags = ${env:STM32F103RE_btt_maple.build_flags} -DUSE_USB_COMPOSITE +lib_deps = ${STM32F1_maple.lib_deps} + USBComposite for STM32F1@0.91 # # Geeetech GTM32 (STM32F103VET6) # -[env:STM32F103VE_GTM32] -extends = common_stm32f1 +[env:STM32F103VE_GTM32_maple] +extends = STM32F1_maple board = genericSTM32F103VE -build_flags = ${common_stm32f1.build_flags} - -ffunction-sections -fdata-sections -nostdlib -MMD - -DMCU_STM32F103VE -DARDUINO_GENERIC_STM32F103V -DARDUINO_ARCH_STM32F1 -DBOARD_generic_stm32f103v - -DDEBUG_LEVEL=DEBUG_NONE -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DVECT_TAB_ADDR=0x8000000 - -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 +build_flags = ${STM32F1_maple.build_flags} + -ffunction-sections -fdata-sections -nostdlib -MMD + -DMCU_STM32F103VE -DARDUINO_GENERIC_STM32F103V -DARDUINO_ARCH_STM32F1 -DBOARD_generic_stm32f103v + -DDEBUG_LEVEL=DEBUG_NONE -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DVECT_TAB_ADDR=0x8000000 + -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 upload_protocol = serial # # Longer 3D board in Alfawise U20 (STM32F103VET6) # [env:STM32F103VE_longer_maple] -extends = common_stm32f1 -board = genericSTM32F103VE +extends = STM32F1_maple +board = genericSTM32F103VE board_build.address = 0x08010000 board_build.rename = project.bin board_build.ldscript = STM32F103VE_longer.ld -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/custom_board.py -build_flags = ${common_stm32f1.build_flags} - -DMCU_STM32F103VE -DSTM32F1xx -USERIAL_USB -DU20 -DTS_V12 -build_unflags = ${common_stm32f1.build_unflags} - -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 +build_flags = ${STM32F1_maple.build_flags} + -DMCU_STM32F103VE -DSTM32F1xx -USERIAL_USB -DU20 -DTS_V12 +build_unflags = ${STM32F1_maple.build_unflags} + -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 # # MKS Robin Mini (STM32F103VET6) # [env:mks_robin_mini_maple] -extends = common_stm32f1 -board = genericSTM32F103VE -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_robin_mini.py -build_flags = ${common_stm32f1.build_flags} - -DMCU_STM32F103VE +extends = STM32F1_maple +board = genericSTM32F103VE +board_build.address = 0x08007000 +board_build.rename = Robin_mini.bin +board_build.ldscript = mks_robin_mini.ld +build_flags = ${STM32F1_maple.build_flags} -DMCU_STM32F103VE # # MKS Robin Nano (STM32F103VET6) # [env:mks_robin_nano35_maple] -extends = common_stm32f1 -board = genericSTM32F103VE -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_robin_nano35.py -build_flags = ${common_stm32f1.build_flags} - -DMCU_STM32F103VE -DSS_TIMER=4 -debug_tool = jlink -upload_protocol = jlink +extends = STM32F1_maple +board = genericSTM32F103VE +board_build.address = 0x08007000 +board_build.rename = Robin_nano35.bin +board_build.ldscript = mks_robin_nano.ld +build_flags = ${STM32F1_maple.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 +debug_tool = jlink +upload_protocol = jlink # # MKS Robin (STM32F103ZET6) # [env:mks_robin_maple] -extends = common_stm32f1 -board = genericSTM32F103ZE -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_robin.py -build_flags = ${common_stm32f1.build_flags} - -DSS_TIMER=4 -DSTM32_XL_DENSITY +extends = STM32F1_maple +board = genericSTM32F103ZE +board_build.address = 0x08007000 +board_build.rename = Robin.bin +board_build.ldscript = mks_robin.ld +build_flags = ${STM32F1_maple.build_flags} -DSS_TIMER=4 -DSTM32_XL_DENSITY # # MKS Robin Pro (STM32F103ZET6) # [env:mks_robin_pro_maple] -extends = env:mks_robin_maple -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_robin_pro.py +extends = env:mks_robin_maple +board_build.address = 0x08007000 +board_build.rename = Robin_pro.bin +board_build.ldscript = mks_robin_pro.ld # # TRIGORILLA PRO (STM32F103ZET6) # [env:trigorilla_pro_maple] extends = env:mks_robin_maple -extra_scripts = ${common_stm32f1.extra_scripts} +extra_scripts = ${STM32F1_maple.extra_scripts} # # MKS Robin E3D (STM32F103RCT6) and # MKS Robin E3 with TMC2209 # [env:mks_robin_e3_maple] -extends = common_stm32f1 -board = genericSTM32F103RC -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_robin_e3.py -build_flags = ${common_stm32f1.build_flags} - -DDEBUG_LEVEL=0 -DSS_TIMER=4 +extends = STM32F1_maple +board = genericSTM32F103RC +board_build.address = 0x08005000 +board_build.rename = Robin_e3.bin +board_build.ldscript = mks_robin_e3.ld +build_flags = ${STM32F1_maple.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 # # MKS Robin E3p (STM32F103VET6) # - LVGL UI # [env:mks_robin_e3p_maple] -extends = common_stm32f1 -board = genericSTM32F103VE -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_robin_e3p.py -build_flags = ${common_stm32f1.build_flags} - -DMCU_STM32F103VE -DSS_TIMER=4 -debug_tool = jlink -upload_protocol = jlink +extends = STM32F1_maple +board = genericSTM32F103VE +board_build.address = 0x08007000 +board_build.rename = Robin_e3p.bin +board_build.ldscript = mks_robin_e3p.ld +build_flags = ${STM32F1_maple.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 +debug_tool = jlink +upload_protocol = jlink # # MKS Robin Lite/Lite2 (STM32F103RCT6) # [env:mks_robin_lite_maple] -extends = common_stm32f1 -board = genericSTM32F103RC -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_robin_lite.py +extends = STM32F1_maple +board = genericSTM32F103RC +board_build.address = 0x08005000 +board_build.rename = mksLite.bin +board_build.ldscript = mks_robin_lite.ld # # MKS ROBIN LITE3 (STM32F103RCT6) # [env:mks_robin_lite3_maple] -extends = common_stm32f1 -board = genericSTM32F103RC -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/mks_robin_lite3.py +extends = STM32F1_maple +board = genericSTM32F103RC +board_build.address = 0x08005000 +board_build.rename = mksLite3.bin +board_build.ldscript = mks_robin_lite.ld # # JGAurora A5S A1 (STM32F103ZET6) # [env:jgaurora_a5s_a1_maple] -extends = common_stm32f1 -board = genericSTM32F103ZE +extends = STM32F1_maple +board = genericSTM32F103ZE board_build.address = 0x0800A000 board_build.ldscript = jgaurora_a5s_a1.ld -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/custom_board.py - buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py -build_flags = ${common_stm32f1.build_flags} - -DSTM32F1xx -DSTM32_XL_DENSITY +extra_scripts = ${STM32F1_maple.extra_scripts} + buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py +build_flags = ${STM32F1_maple.build_flags} -DSTM32F1xx -DSTM32_XL_DENSITY # # Malyan M200 (STM32F103CB) # [env:STM32F103CB_malyan_maple] -extends = common_stm32f1 -board = marlin_malyanM200 -build_flags = ${common_stm32f1.build_flags} - -DMCU_STM32F103CB -D__STM32F1__=1 -std=c++1y -DSERIAL_USB -ffunction-sections -fdata-sections - -Wl,--gc-sections -DDEBUG_LEVEL=0 -D__MARLIN_FIRMWARE__ -lib_ignore = ${common_stm32f1.lib_ignore} - SoftwareSerialM +extends = STM32F1_maple +board = marlin_malyanM200 +build_flags = ${STM32F1_maple.build_flags} + -DMCU_STM32F103CB -D__STM32F1__=1 -std=c++1y -DSERIAL_USB -ffunction-sections -fdata-sections + -Wl,--gc-sections -DDEBUG_LEVEL=0 -D__MARLIN_FIRMWARE__ +lib_ignore = ${STM32F1_maple.lib_ignore} + SoftwareSerialM # # Chitu boards like Tronxy X5s (STM32F103ZET6) # [env:chitu_f103_maple] -extends = common_stm32f1 -board = marlin_CHITU_F103 -extra_scripts = ${common_stm32f1.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py - buildroot/share/PlatformIO/scripts/chitu_crypt.py -build_flags = ${common_stm32f1.build_flags} - -DSTM32F1xx -DSTM32_XL_DENSITY -build_unflags = ${common_stm32f1.build_unflags} - -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG= -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 +extends = STM32F1_maple +board = marlin_maple_CHITU_F103 +extra_scripts = ${STM32F1_maple.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py + buildroot/share/PlatformIO/scripts/chitu_crypt.py +build_flags = ${STM32F1_maple.build_flags} -DSTM32F1xx -DSTM32_XL_DENSITY +build_unflags = ${STM32F1_maple.build_unflags} + -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG= -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 # # Some Chitu V5 boards have a problem with GPIO init. # Use this target if G28 or G29 are always failing. # [env:chitu_v5_gpio_init_maple] -extends = env:chitu_f103_maple -build_flags = ${env:chitu_f103_maple.build_flags} -DCHITU_V5_Z_MIN_BUGFIX +extends = env:chitu_f103_maple +build_flags = ${env:chitu_f103_maple.build_flags} -DCHITU_V5_Z_MIN_BUGFIX # # FLYmaker FLY Mini (STM32F103RCT6) # [env:FLY_MINI_maple] -extends = common_stm32f1 -board = genericSTM32F103RC +extends = STM32F1_maple +board = genericSTM32F103RC board_build.address = 0x08005000 board_build.ldscript = fly_mini.ld -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/custom_board.py -build_flags = ${common_stm32f1.build_flags} - -DDEBUG_LEVEL=0 -DSS_TIMER=4 +build_flags = ${STM32F1_maple.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 # # Zonestar ZM3E2 V1.0 / ZM3E4 V1.0 / ZM3E4 V2.0 @@ -369,18 +351,15 @@ build_flags = ${common_stm32f1.build_flags} # STM32F103VE_ZM3E4V2_USB_maple ......... VET6 with 512K # [ZONESTAR_ZM3E_maple] -extends = common_stm32f1 +extends = STM32F1_maple platform_packages = tool-stm32duino board_build.address = 0x08005000 board_build.offset = 0x5000 board_upload.maximum_size = 237568 -extra_scripts = ${common.extra_scripts} - buildroot/share/PlatformIO/scripts/custom_board.py - buildroot/share/PlatformIO/scripts/offset_and_rename.py -build_flags = ${common_stm32f1.build_flags} - -D__STM32F1__=1 -DDEBUG_LEVEL=0 -DSS_TIMER=4 -DSERIAL_USB -lib_deps = ${common_stm32f1.lib_deps} - USBComposite for STM32F1@0.91 +build_flags = ${STM32F1_maple.build_flags} + -D__STM32F1__=1 -DDEBUG_LEVEL=0 -DSS_TIMER=4 -DSERIAL_USB +lib_deps = ${STM32F1_maple.lib_deps} + USBComposite for STM32F1@0.91 lib_ignore = Adafruit NeoPixel, SPI, SailfishLCD, SailfishRGB_LED, SlowSoftI2CMaster, TMCStepper [env:STM32F103RC_ZM3E2_USB_maple] @@ -395,26 +374,24 @@ board_build.ldscript = ZONESTAR_ZM3E_256K.ld build_flags = ${ZONESTAR_ZM3E_maple.build_flags} -DTONE_TIMER=1 -DTONE_CHANNEL=2 [env:STM32F103VE_ZM3E4V2_USB_maple] -extends = ZONESTAR_ZM3E_maple -board = genericSTM32F103VE -board_build.ldscript = ZONESTAR_ZM3E_512K.ld -build_flags = ${ZONESTAR_ZM3E_maple.build_flags} -DTONE_TIMER=1 -DTONE_CHANNEL=2 +extends = ZONESTAR_ZM3E_maple +board = genericSTM32F103VE +board_build.ldscript = ZONESTAR_ZM3E_512K.ld +build_flags = ${ZONESTAR_ZM3E_maple.build_flags} -DTONE_TIMER=1 -DTONE_CHANNEL=2 board_upload.maximum_size = 499712 # # ERYONE ERY32 Mini (STM32F103VET6) # [env:ERYONE_ERY32_MINI_maple] -extends = common_stm32f1 +extends = STM32F1_maple board = genericSTM32F103VE -build_flags = ${common_stm32f1.build_flags} - -ffunction-sections -fdata-sections -nostdlib -MMD - -DMCU_STM32F103VE -DARDUINO_GENERIC_STM32F103V -DARDUINO_ARCH_STM32F1 - -DDEBUG_LEVEL=DEBUG_NONE -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 - -DSS_TIMER=4 +build_flags = ${STM32F1_maple.build_flags} + -ffunction-sections -fdata-sections -nostdlib -MMD + -DMCU_STM32F103VE -DARDUINO_GENERIC_STM32F103V -DARDUINO_ARCH_STM32F1 + -DDEBUG_LEVEL=DEBUG_NONE -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 + -DSS_TIMER=4 board_build.variant = MARLIN_F103Vx board_build.ldscript = eryone_ery32_mini.ld board_build.address = 0x08004000 -build_unflags = ${common_stm32f1.build_unflags} -extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/custom_board.py +build_unflags = ${STM32F1_maple.build_unflags} From 1b879f0ee4e5539c237edf235b6ca38b5b2beb43 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 22 May 2022 18:42:25 -0500 Subject: [PATCH 320/502] =?UTF-8?q?=F0=9F=94=A8=20Fix=20mfprep=20string=20?= =?UTF-8?q?test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/git/mfprep | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/buildroot/share/git/mfprep b/buildroot/share/git/mfprep index 7245126de156..6a8850286153 100755 --- a/buildroot/share/git/mfprep +++ b/buildroot/share/git/mfprep @@ -18,32 +18,33 @@ DRYRUN=0 TAG1=$1 TAG2=${2:-"HEAD"} +DEST=2.1.x + # Validate that the required tags exist MTAG=`git tag | grep -e "^bf-$TAG1\$"` -[[ -n $MTAG ]] || { echo "Can't find tag bf-$TAG1" ; exit 1 ; } +[[ -n "$MTAG" ]] || { echo "Can't find tag bf-$TAG1" ; exit 1 ; } MTAG=`git tag | grep -e "^$TAG1\$"` -[[ -n $MTAG ]] || { echo "Can't find tag $TAG1" ; exit 1 ; } +[[ -n "$MTAG" ]] || { echo "Can't find tag $TAG1" ; exit 1 ; } -# Generate log of recent commits for bugfix-2.0.x and 2.0.x +# Generate log of recent commits for bugfix-2.0.x and DEST TMPDIR=`mktemp -d` LOGB="$TMPDIR/log-bf.txt" -LOG2="$TMPDIR/log-20x.txt" +LOG2="$TMPDIR/log-2x.txt" TMPF="$TMPDIR/tmp.txt" -SCRF="$TMPDIR/update-20x.sh" +SCRF="$TMPDIR/update-$DEST.sh" git checkout bugfix-2.0.x git log --pretty="[%h] %s" bf-$TAG1..$TAG2 | grep -v '\[cron\]' | $SED '1!G;h;$!d' >"$LOGB" -git checkout 2.0.x +git checkout $DEST git log --pretty="[%h] %s" $TAG1..$TAG2 | $SED '1!G;h;$!d' >"$LOG2" || { echo "Can't find tag bf-$TAG1" ; exit 1 ; } -# Go through commit text from 2.0.x removing all matches from the bugfix log +# Go through commit text from DEST removing all matches from the bugfix log cat "$LOG2" | while read line; do - #echo "... $line" - if [[ $line =~ \(((#[0-9]{5}),* *)((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?\)$ ]]; then + if [[ $line =~ \(((#[0-9]{5}),* *)((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?((#[0-9]{5}),* *)?\)$ ]]; then PATT="" for i in ${!BASH_REMATCH[@]}; do if ((i > 0 && (i % 2 == 0))); then @@ -54,16 +55,16 @@ cat "$LOG2" | while read line; do fi done #echo "... $PATT" - [[ -n $PATT ]] && { grep -vE "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } + [[ -n "$PATT" ]] && { grep -vE "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } else PATT=$( $SED -E 's/^\[[0-9a-f]{10}\]( . )?(.+)$/\2/' <<<"$line" ) - [[ -n $PATT ]] && { grep -v "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } + [[ -n "$PATT" ]] && { grep -v "$PATT" "$LOGB" >"$TMPF" ; cp "$TMPF" "$LOGB" ; } fi done # Convert remaining commits into git commands -echo -e "#!/usr/bin/env bash\nset -e\ngit checkout 2.0.x\n" >"$TMPF" +echo -e "#!/usr/bin/env bash\nset -e\ngit checkout ${DEST}\n" >"$TMPF" cat "$LOGB" | while read line; do if [[ $line =~ ^\[([0-9a-f]{10})\]\ *(.*)$ ]]; then CID=${BASH_REMATCH[1]} @@ -74,6 +75,6 @@ cat "$LOGB" | while read line; do fi done mv "$TMPF" "$SCRF" -chmod ug+x "$SCRF" +chmod +x "$SCRF" ((DRYRUN)) && rm -r "$TMPDIR" || open "$TMPDIR" From 4d65d7f142882bcd77072fc7dc5c01ca937a2e81 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 22 May 2022 19:32:28 -0700 Subject: [PATCH 321/502] =?UTF-8?q?=F0=9F=93=9D=20Add=20logo,=20helpful=20?= =?UTF-8?q?links=20to=20README=20(#24226)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 21 +++++++++++------- .../pixmaps/logo/marlin-outrun-nf-500.png | Bin 0 -> 172495 bytes 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 buildroot/share/pixmaps/logo/marlin-outrun-nf-500.png diff --git a/README.md b/README.md index c141e889e508..e54c8f093a7e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ -# Marlin 3D Printer Firmware - -![GitHub](https://img.shields.io/github/license/marlinfirmware/marlin.svg) -![GitHub contributors](https://img.shields.io/github/contributors/marlinfirmware/marlin.svg) -![GitHub Release Date](https://img.shields.io/github/release-date/marlinfirmware/marlin.svg) -[![Build Status](https://github.com/MarlinFirmware/Marlin/workflows/CI/badge.svg?branch=bugfix-2.0.x)](https://github.com/MarlinFirmware/Marlin/actions) - - +

MarlinFirmware's logo

+ +

Marlin 3D Printer Firmware

+ +

+ GPL-V3.0 License + Contributors + Last Release Date + CI Status + GitHub Sponsors +
+ Follow MarlinFirmware on Twitter +

Additional documentation can be found at the [Marlin Home Page](https://marlinfw.org/). Please test this firmware and let us know if it misbehaves in any way. Volunteers are standing by! diff --git a/buildroot/share/pixmaps/logo/marlin-outrun-nf-500.png b/buildroot/share/pixmaps/logo/marlin-outrun-nf-500.png new file mode 100644 index 0000000000000000000000000000000000000000..e36a3eb5c2165caf8d140eacd3b66dfb614053f2 GIT binary patch literal 172495 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 z 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 literal 0 HcmV?d00001 From a0fe4f48956299cb298e6e48255ea72ba93dad79 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 14 May 2022 15:31:51 -0500 Subject: [PATCH 322/502] =?UTF-8?q?=F0=9F=8E=A8=20Minor=20HAL=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/HAL.cpp | 4 +++ Marlin/src/HAL/AVR/HAL.h | 2 +- Marlin/src/HAL/DUE/HAL.cpp | 15 ++++++++--- Marlin/src/HAL/DUE/HAL_SPI.cpp | 2 -- Marlin/src/HAL/HAL.h | 1 + Marlin/src/HAL/LPC1768/HAL.h | 2 +- Marlin/src/HAL/NATIVE_SIM/HAL.h | 2 +- Marlin/src/HAL/STM32/HAL.cpp | 5 ++-- Marlin/src/HAL/STM32F1/HAL.cpp | 9 +++++-- Marlin/src/HAL/TEENSY31_32/HAL.cpp | 40 ++++++++++++++-------------- Marlin/src/HAL/TEENSY35_36/HAL.cpp | 42 +++++++++++++++--------------- Marlin/src/HAL/TEENSY35_36/HAL.h | 2 +- Marlin/src/HAL/TEENSY40_41/HAL.cpp | 40 ++++++++++++++-------------- Marlin/src/HAL/TEENSY40_41/HAL.h | 2 +- Marlin/src/inc/MarlinConfig.h | 1 - 15 files changed, 94 insertions(+), 75 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL.cpp b/Marlin/src/HAL/AVR/HAL.cpp index 7c39c5200b4d..0527f3d8c5df 100644 --- a/Marlin/src/HAL/AVR/HAL.cpp +++ b/Marlin/src/HAL/AVR/HAL.cpp @@ -88,6 +88,10 @@ void MarlinHAL::reboot() { #endif } +// ------------------------ +// Free Memory Accessor +// ------------------------ + #if ENABLED(SDSUPPORT) #include "../../sd/SdFatUtil.h" diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index d34604180586..42ae521dfc87 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -163,7 +163,7 @@ typedef Servo hal_servo_t; #define strtof strtod // ------------------------ -// Class Utilities +// Free Memory Accessor // ------------------------ #pragma GCC diagnostic push diff --git a/Marlin/src/HAL/DUE/HAL.cpp b/Marlin/src/HAL/DUE/HAL.cpp index bbd13dc05aac..39a28359e5da 100644 --- a/Marlin/src/HAL/DUE/HAL.cpp +++ b/Marlin/src/HAL/DUE/HAL.cpp @@ -40,14 +40,15 @@ uint16_t MarlinHAL::adc_result; // Public functions // ------------------------ -TERN_(POSTMORTEM_DEBUGGING, extern void install_min_serial()); +#if ENABLED(POSTMORTEM_DEBUGGING) + extern void install_min_serial(); +#endif void MarlinHAL::init() { - // Initialize the USB stack #if ENABLED(SDSUPPORT) OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up #endif - usb_task_init(); + usb_task_init(); // Initialize the USB stack TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the min serial handler } @@ -72,6 +73,10 @@ uint8_t MarlinHAL::get_reset_source() { void MarlinHAL::reboot() { rstc_start_software_reset(RSTC); } +// ------------------------ +// Free Memory Accessor +// ------------------------ + extern "C" { extern unsigned int _ebss; // end of bss section } @@ -82,6 +87,10 @@ int freeMemory() { return (int)&free_memory - (heap_end ?: (int)&_ebss); } +// ------------------------ +// Serial Ports +// ------------------------ + // Forward the default serial ports #if USING_HW_SERIAL0 DefaultSerial1 MSerial0(false, Serial); diff --git a/Marlin/src/HAL/DUE/HAL_SPI.cpp b/Marlin/src/HAL/DUE/HAL_SPI.cpp index c5e8f2433d7d..7e3fe0135645 100644 --- a/Marlin/src/HAL/DUE/HAL_SPI.cpp +++ b/Marlin/src/HAL/DUE/HAL_SPI.cpp @@ -31,8 +31,6 @@ /** * HAL for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM */ #ifdef ARDUINO_ARCH_SAM diff --git a/Marlin/src/HAL/HAL.h b/Marlin/src/HAL/HAL.h index 0cd836af2b68..2dda287ac7a1 100644 --- a/Marlin/src/HAL/HAL.h +++ b/Marlin/src/HAL/HAL.h @@ -28,6 +28,7 @@ #endif #include HAL_PATH(.,HAL.h) +extern MarlinHAL hal; #define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION) diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index 0f26509129d5..d058de8720bb 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -177,7 +177,7 @@ void flashFirmware(const int16_t); #define CPU_ST7920_DELAY_3 750 // ------------------------ -// Class Utilities +// Free Memory Accessor // ------------------------ #pragma GCC diagnostic push diff --git a/Marlin/src/HAL/NATIVE_SIM/HAL.h b/Marlin/src/HAL/NATIVE_SIM/HAL.h index 49a5b6ea560b..35fce855cbd4 100644 --- a/Marlin/src/HAL/NATIVE_SIM/HAL.h +++ b/Marlin/src/HAL/NATIVE_SIM/HAL.h @@ -186,7 +186,7 @@ constexpr inline char* strstr_constexpr(char* str, const char* target) { } // ------------------------ -// Class Utilities +// Free Memory Accessor // ------------------------ #pragma GCC diagnostic push diff --git a/Marlin/src/HAL/STM32/HAL.cpp b/Marlin/src/HAL/STM32/HAL.cpp index 2d8b672c3dfb..7e410fff8464 100644 --- a/Marlin/src/HAL/STM32/HAL.cpp +++ b/Marlin/src/HAL/STM32/HAL.cpp @@ -24,12 +24,11 @@ #ifdef HAL_STM32 -#include "HAL.h" -#include "usb_serial.h" - #include "../../inc/MarlinConfig.h" #include "../shared/Delay.h" +#include "usb_serial.h" + #ifdef USBCON DefaultSerial1 MSerialUSB(false, SerialUSB); #endif diff --git a/Marlin/src/HAL/STM32F1/HAL.cpp b/Marlin/src/HAL/STM32F1/HAL.cpp index 636dc742fcf5..43ee91e49044 100644 --- a/Marlin/src/HAL/STM32F1/HAL.cpp +++ b/Marlin/src/HAL/STM32F1/HAL.cpp @@ -83,6 +83,7 @@ // ------------------------ #if defined(SERIAL_USB) && !HAS_SD_HOST_DRIVE + USBSerial SerialUSB; DefaultSerial1 MSerial0(true, SerialUSB); @@ -211,6 +212,10 @@ void MarlinHAL::idletask() { void MarlinHAL::reboot() { nvic_sys_reset(); } +// ------------------------ +// Free Memory Accessor +// ------------------------ + extern "C" { extern unsigned int _ebss; // end of bss section } @@ -243,9 +248,9 @@ extern "C" { } */ -// +// ------------------------ // ADC -// +// ------------------------ enum ADCIndex : uint8_t { OPTITEM(HAS_TEMP_ADC_0, TEMP_0) diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.cpp b/Marlin/src/HAL/TEENSY31_32/HAL.cpp index b923ab77b1f1..28c3fdc4d6f4 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL.cpp @@ -44,25 +44,6 @@ #endif USBSerialType USBSerial(false, SerialUSB); -// ------------------------ -// Class Utilities -// ------------------------ - -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; - - int freeMemory() { - int free_memory; - if ((int)__brkval == 0) - free_memory = ((int)&free_memory) - ((int)&__bss_end); - else - free_memory = ((int)&free_memory) - ((int)__brkval); - return free_memory; - } -} - // ------------------------ // MarlinHAL Class // ------------------------ @@ -81,7 +62,9 @@ uint8_t MarlinHAL::get_reset_source() { return 0; } +// ------------------------ // ADC +// ------------------------ void MarlinHAL::adc_init() { analog_init(); @@ -102,4 +85,23 @@ void MarlinHAL::adc_start(const pin_t pin) { uint16_t MarlinHAL::adc_value() { return ADC0_RA; } +// ------------------------ +// Free Memory Accessor +// ------------------------ + +extern "C" { + extern char __bss_end; + extern char __heap_start; + extern void* __brkval; + + int freeMemory() { + int free_memory; + if ((int)__brkval == 0) + free_memory = ((int)&free_memory) - ((int)&__bss_end); + else + free_memory = ((int)&free_memory) - ((int)__brkval); + return free_memory; + } +} + #endif // __MK20DX256__ diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.cpp b/Marlin/src/HAL/TEENSY35_36/HAL.cpp index 54a5ad385536..5fbb49fd924f 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL.cpp @@ -43,33 +43,12 @@ USBSerialType USBSerial(false, SerialUSB); -// ------------------------ -// Class Utilities -// ------------------------ - -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; - - int freeMemory() { - int free_memory; - if ((int)__brkval == 0) - free_memory = ((int)&free_memory) - ((int)&__bss_end); - else - free_memory = ((int)&free_memory) - ((int)__brkval); - return free_memory; - } -} - // ------------------------ // MarlinHAL Class // ------------------------ void MarlinHAL::reboot() { _reboot_Teensyduino_(); } -// Reset - uint8_t MarlinHAL::get_reset_source() { switch (RCM_SRS0) { case 128: return RST_POWER_ON; break; @@ -82,7 +61,9 @@ uint8_t MarlinHAL::get_reset_source() { return 0; } +// ------------------------ // ADC +// ------------------------ int8_t MarlinHAL::adc_select; @@ -131,4 +112,23 @@ uint16_t MarlinHAL::adc_value() { return 0; } +// ------------------------ +// Free Memory Accessor +// ------------------------ + +extern "C" { + extern char __bss_end; + extern char __heap_start; + extern void* __brkval; + + int freeMemory() { + int free_memory; + if ((int)__brkval == 0) + free_memory = ((int)&free_memory) - ((int)&__bss_end); + else + free_memory = ((int)&free_memory) - ((int)__brkval); + return free_memory; + } +} + #endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.h b/Marlin/src/HAL/TEENSY35_36/HAL.h index c45f2aa49307..84f071d73d49 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/TEENSY35_36/HAL.h @@ -118,7 +118,7 @@ typedef int8_t pin_t; #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) // ------------------------ -// Class Utilities +// Free Memory Accessor // ------------------------ #pragma GCC diagnostic push diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.cpp b/Marlin/src/HAL/TEENSY40_41/HAL.cpp index 68bd38f72ff8..4b9c55a2ca89 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.cpp +++ b/Marlin/src/HAL/TEENSY40_41/HAL.cpp @@ -44,25 +44,6 @@ #endif USBSerialType USBSerial(false, SerialUSB); -// ------------------------ -// Class Utilities -// ------------------------ - -#define __bss_end _ebss - -extern "C" { - extern char __bss_end; - extern char __heap_start; - extern void* __brkval; - - // Doesn't work on Teensy 4.x - uint32_t freeMemory() { - uint32_t free_memory; - free_memory = ((uint32_t)&free_memory) - (((uint32_t)__brkval) ?: ((uint32_t)&__bss_end)); - return free_memory; - } -} - // ------------------------ // FastIO // ------------------------ @@ -97,7 +78,9 @@ void MarlinHAL::clear_reset_source() { SRC_SRSR = reset_source; } +// ------------------------ // ADC +// ------------------------ int8_t MarlinHAL::adc_select; @@ -180,4 +163,23 @@ uint16_t MarlinHAL::adc_value() { return 0; } +// ------------------------ +// Free Memory Accessor +// ------------------------ + +#define __bss_end _ebss + +extern "C" { + extern char __bss_end; + extern char __heap_start; + extern void* __brkval; + + // Doesn't work on Teensy 4.x + uint32_t freeMemory() { + uint32_t free_memory; + free_memory = ((uint32_t)&free_memory) - (((uint32_t)__brkval) ?: ((uint32_t)&__bss_end)); + return free_memory; + } +} + #endif // __IMXRT1062__ diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index ea874da2faea..0476a9809de0 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -140,7 +140,7 @@ typedef int8_t pin_t; bool is_output(pin_t pin); // ------------------------ -// Class Utilities +// Free Memory Accessor // ------------------------ #pragma GCC diagnostic push diff --git a/Marlin/src/inc/MarlinConfig.h b/Marlin/src/inc/MarlinConfig.h index 505a0682ebaa..8fdb4b9baeae 100644 --- a/Marlin/src/inc/MarlinConfig.h +++ b/Marlin/src/inc/MarlinConfig.h @@ -29,7 +29,6 @@ #ifndef __MARLIN_DEPS__ #include "../HAL/HAL.h" - extern MarlinHAL hal; #endif #include "../pins/pins.h" From e0deb75764938995e32bc589d646ec397c4a3019 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Thu, 19 May 2022 22:15:15 +0100 Subject: [PATCH 323/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Leveling=20apply/u?= =?UTF-8?q?napply=20(#24188)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/feature/bedlevel/bedlevel.cpp | 14 ++----- Marlin/src/gcode/bedlevel/abl/G29.cpp | 53 ++++++++++++------------ Marlin/src/module/planner.cpp | 38 +++++++++-------- 3 files changed, 52 insertions(+), 53 deletions(-) diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index f9d17a69a13f..1ca9696a3a30 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -74,16 +74,10 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { _report_leveling(); planner.synchronize(); - if (planner.leveling_active) { // leveling from on to off - // change unleveled current_position to physical current_position without moving steppers. - planner.apply_leveling(current_position); - planner.leveling_active = false; // disable only AFTER calling apply_leveling - } - else { // leveling from off to on - planner.leveling_active = true; // enable BEFORE calling unapply_leveling, otherwise ignored - // change physical current_position to unleveled current_position without moving steppers. - planner.unapply_leveling(current_position); - } + // Get the corrected leveled / unleveled position + planner.apply_modifiers(current_position); // Physical position with all modifiers + planner.leveling_active ^= true; // Toggle leveling between apply and unapply + planner.unapply_modifiers(current_position); // Logical position with modifiers removed sync_plan_position(); _report_leveling(); diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index d9b0179a6321..0d247e47673c 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -74,14 +74,18 @@ #endif #endif +static void pre_g29_return(const bool retry, const bool did) { + if (!retry) { + TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false)); + } + if (did) { + TERN_(HAS_DWIN_E3V2_BASIC, DWIN_LevelingDone()); + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); + } +} + #define G29_RETURN(retry, did) do{ \ - if (TERN(G29_RETRY_AND_RECOVER, !retry, true)) { \ - TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false)); \ - } \ - if (did) { \ - TERN_(HAS_DWIN_E3V2_BASIC, DWIN_LevelingDone()); \ - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); \ - } \ + pre_g29_return(TERN0(G29_RETRY_AND_RECOVER, retry), did); \ return TERN_(G29_RETRY_AND_RECOVER, retry); \ }while(0) @@ -326,8 +330,10 @@ G29_TYPE GcodeSuite::G29() { bedlevel.z_values[i][j] = rz; bedlevel.refresh_bed_level(); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(i, j, rz)); - set_bed_leveling_enabled(abl.reenable); - if (abl.reenable) report_current_position(); + if (abl.reenable) { + set_bed_leveling_enabled(true); + report_current_position(); + } } G29_RETURN(false, false); } // parser.seen_test('W') @@ -693,7 +699,7 @@ G29_TYPE GcodeSuite::G29() { #endif - abl.reenable = false; + abl.reenable = false; // Don't re-enable after modifying the mesh idle_no_sleep(); } // inner @@ -878,33 +884,28 @@ G29_TYPE GcodeSuite::G29() { current_position = converted; if (DEBUGGING(LEVELING)) DEBUG_POS("G29 corrected XYZ", current_position); - } - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) + abl.reenable = true; + } - if (!abl.dryrun) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("G29 uncorrected Z:", current_position.z); + // Auto Bed Leveling is complete! Enable if possible. + if (abl.reenable) { + planner.leveling_active = true; + sync_plan_position(); + } - // Unapply the offset because it is going to be immediately applied - // and cause compensation movement in Z - current_position.z -= bedlevel.get_z_correction(current_position) - TERN_(ENABLE_LEVELING_FADE_HEIGHT, * planner.fade_scaling_factor_for_z(current_position.z)); + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(" corrected Z:", current_position.z); - } + // Auto Bed Leveling is complete! Enable if possible. + if (!abl.dryrun || abl.reenable) set_bed_leveling_enabled(true); - #endif // ABL_PLANAR + #endif - // Auto Bed Leveling is complete! Enable if possible. - planner.leveling_active = !abl.dryrun || abl.reenable; } // !isnan(abl.measured_z) // Restore state after probing if (!faux) restore_feedrate_and_scaling(); - // Sync the planner from the current_position - if (planner.leveling_active) sync_plan_position(); - TERN_(HAS_BED_PROBE, probe.move_z_after_probing()); #ifdef Z_PROBE_END_SCRIPT diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index a686d8ebc3d3..dcec8e3a620a 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1592,30 +1592,34 @@ void Planner::check_axes_activity() { } void Planner::unapply_leveling(xyz_pos_t &raw) { + if (!leveling_active) return; - if (leveling_active) { - - #if ABL_PLANAR - - matrix_3x3 inverse = matrix_3x3::transpose(bed_level_matrix); + #if ABL_PLANAR - xy_pos_t d = raw - level_fulcrum; - inverse.apply_rotation_xyz(d.x, d.y, raw.z); - raw = d + level_fulcrum; + matrix_3x3 inverse = matrix_3x3::transpose(bed_level_matrix); - #elif HAS_MESH + xy_pos_t d = raw - level_fulcrum; + inverse.apply_rotation_xyz(d.x, d.y, raw.z); + raw = d + level_fulcrum; - TERN_(MESH_BED_LEVELING, raw.z -= bedlevel.get_z_offset()); + #elif HAS_MESH - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = fade_scaling_factor_for_z(raw.z); - if (fade_scaling_factor) raw.z -= fade_scaling_factor * bedlevel.get_z_correction(raw); - #else - raw.z -= bedlevel.get_z_correction(raw); - #endif + const float z_correction = bedlevel.get_z_correction(raw), + z_full_fade = DIFF_TERN(MESH_BED_LEVELING, raw.z, bedlevel.get_z_offset()), + z_no_fade = z_full_fade - z_correction; + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + if (!z_fade_height || z_no_fade <= 0.0f) // Not fading or at bed level? + raw.z = z_no_fade; // Unapply full mesh Z. + else if (z_full_fade >= z_fade_height) // Above the fade height? + raw.z = z_full_fade; // Nothing more to unapply. + else // Within the fade zone? + raw.z = z_no_fade / (1.0f - z_correction * inverse_z_fade_height); // Unapply the faded Z offset + #else + raw.z = z_no_fade; #endif - } + + #endif } #endif // HAS_LEVELING From 4831cbebd80d6e2c6bcf504446cf6d0f2441c285 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 23 May 2022 02:37:28 -0500 Subject: [PATCH 324/502] =?UTF-8?q?=F0=9F=8E=A8=20Add=20EXP1/2=20headers,?= =?UTF-8?q?=20adjust=20TFT=20pins=20(#24230)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32F1/tft/tft_spi.cpp | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 2 +- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 3 +- Marlin/src/pins/mega/pins_CNCONTROLS_11.h | 25 ++-- Marlin/src/pins/mega/pins_CNCONTROLS_12.h | 26 ++-- Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h | 2 +- Marlin/src/pins/sam/pins_RAMPS_FD_V1.h | 81 +++++++---- Marlin/src/pins/sam/pins_RURAMPS4D_11.h | 78 +++++++---- Marlin/src/pins/sam/pins_RURAMPS4D_13.h | 83 +++++++---- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 129 +++++++++++------- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 3 +- .../pins/stm32f4/pins_BTT_SKR_V2_0_common.h | 8 +- Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h | 6 +- .../stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 6 +- .../src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 5 +- Marlin/src/pins/stm32f4/pins_VAKE403D.h | 58 ++++++-- Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h | 2 - 17 files changed, 333 insertions(+), 186 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp b/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp index 9bf6bbb32bc7..f447cec81107 100644 --- a/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp @@ -30,7 +30,7 @@ SPIClass TFT_SPI::SPIx(1); void TFT_SPI::Init() { #if PIN_EXISTS(TFT_RESET) - OUT_WRITE(TFT_RST_PIN, HIGH); + OUT_WRITE(TFT_RESET_PIN, HIGH); delay(100); #endif diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index 586fb14e8eb7..901204c8110a 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -310,7 +310,7 @@ #define TFT_RESET_PIN EXP1_07_PIN #define TFT_BACKLIGHT_PIN EXP1_08_PIN - #define TFT_RST_PIN EXP2_04_PIN + //#define TFT_RST_PIN EXP2_04_PIN #define TFT_MOSI_PIN EXP2_05_PIN #define TFT_SCK_PIN EXP2_09_PIN #define TFT_MISO_PIN EXP2_10_PIN diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index 13ebbe1f2859..4cff5d59e17d 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -339,9 +339,10 @@ #define KILL_PIN -1 // NC #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI + #define TFT_CS_PIN EXP1_04_PIN - #define TFT_A0_PIN EXP1_03_PIN #define TFT_DC_PIN EXP1_03_PIN + #define TFT_A0_PIN TFT_DC_PIN #define TFT_MISO_PIN EXP2_10_PIN #define TFT_BACKLIGHT_PIN EXP1_08_PIN #define TFT_RESET_PIN EXP1_07_PIN diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h index 6f9e5e8e6c47..5f7a534d115b 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h @@ -135,17 +135,20 @@ // // LCD / Controller // -#define BEEPER_PIN 6 - -// Pins for DOGM SPI LCD Support -#define DOGLCD_A0 26 -#define DOGLCD_CS 24 -#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h -#define DOGLCD_SCK -1 - -#define BTN_EN1 23 -#define BTN_EN2 25 -#define BTN_ENC 27 +#if HAS_WIRED_LCD + #define BEEPER_PIN 6 + + #define BTN_EN1 23 + #define BTN_EN2 25 + #define BTN_ENC 27 + + #if HAS_MARLINUI_U8GLIB + #define DOGLCD_A0 26 + #define DOGLCD_CS 24 + #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h + #define DOGLCD_SCK -1 + #endif +#endif // Hardware buttons for manual movement of XYZ #define SHIFT_OUT_PIN 19 diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h index 137650eeed58..0aa0b59ca945 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h @@ -140,18 +140,20 @@ // // LCD / Controller // -#define BEEPER_PIN 16 - -// Pins for DOGM SPI LCD Support -#define DOGLCD_A0 39 -#define DOGLCD_CS 35 -#define DOGLCD_MOSI 48 -#define DOGLCD_SCK 49 - -// The encoder and click button -#define BTN_EN1 36 -#define BTN_EN2 34 -#define BTN_ENC 38 +#if HAS_WIRED_LCD + #define BEEPER_PIN 16 + + #define BTN_EN1 36 + #define BTN_EN2 34 + #define BTN_ENC 38 + + #if HAS_MARLINUI_U8GLIB + #define DOGLCD_A0 39 + #define DOGLCD_CS 35 + #define DOGLCD_MOSI 48 + #define DOGLCD_SCK 49 + #endif +#endif // Hardware buttons for manual movement of XYZ #define SHIFT_OUT_PIN 42 diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h index c2896146e64f..e3baea76e4de 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h @@ -158,7 +158,7 @@ #if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN #undef DOGLCD_A0 // Steal pin 44 for the case light; if you have a Viki2 and have connected it #define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments - // as the wiring diagram uses pin 44 for DOGLCD_A0 + // as the wiring diagram uses pin 44 for DOGLCD_A0. #endif // diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index 30f209ad3713..980a957a505a 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -134,71 +134,98 @@ #define SDSS 4 #define LED_PIN 13 +/** ------ ------ + * 37 |10 9 | 35 (MISO) 50 |10 9 | 76 (SCK) + * 29 | 8 7 | 27 (EN2) 31 | 8 7 | 4 (SD_SS) + * 25 6 5 | 23 (EN1) 33 6 5 | 75 (MOSI) + * 16 | 4 3 | 17 (SDD) 49 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN 17 +#define EXP1_04_PIN 16 +#define EXP1_05_PIN 23 +#define EXP1_06_PIN 25 +#define EXP1_07_PIN 27 +#define EXP1_08_PIN 29 +#define EXP1_09_PIN 35 +#define EXP1_10_PIN 37 + +#define EXP2_03_PIN -1 +#define EXP2_04_PIN 49 +#define EXP2_05_PIN 75 +#define EXP2_06_PIN 33 +#define EXP2_07_PIN 4 +#define EXP2_08_PIN 31 +#define EXP2_09_PIN 76 +#define EXP2_10_PIN 74 + // // LCD / Controller // #if HAS_WIRED_LCD // ramps-fd lcd adaptor - #define BEEPER_PIN 37 - #define BTN_EN1 33 - #define BTN_EN2 31 - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 + #define BEEPER_PIN EXP1_10_PIN + #define BTN_EN1 EXP2_06_PIN + #define BTN_EN2 EXP2_08_PIN + #define BTN_ENC EXP1_09_PIN + #define SD_DETECT_PIN EXP2_04_PIN #if IS_NEWPANEL - #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN #endif #if ENABLED(FYSETC_MINI_12864) #define DOGLCD_CS LCD_PINS_ENABLE #define DOGLCD_A0 LCD_PINS_RS - #define DOGLCD_SCK 76 - #define DOGLCD_MOSI 75 + #define DOGLCD_SCK EXP2_09_PIN + #define DOGLCD_MOSI EXP2_05_PIN //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 25 + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 27 + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 29 + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 25 + #define NEOPIXEL_PIN EXP1_06_PIN #endif #elif IS_NEWPANEL - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(MINIPANEL) - #define DOGLCD_CS 25 - #define DOGLCD_A0 27 + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_A0 EXP1_07_PIN #endif #endif #if ANY(VIKI2, miniVIKI) - #define DOGLCD_A0 16 + #define DOGLCD_A0 EXP1_04_PIN #define KILL_PIN 51 - #define STAT_LED_BLUE_PIN 29 - #define STAT_LED_RED_PIN 23 - #define DOGLCD_CS 17 - #define DOGLCD_SCK 76 // SCK_PIN - Required for DUE Hardware SPI - #define DOGLCD_MOSI 75 // MOSI_PIN - #define DOGLCD_MISO 74 // MISO_PIN + #define STAT_LED_BLUE_PIN EXP1_08_PIN + #define STAT_LED_RED_PIN EXP1_05_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_SCK EXP2_09_PIN // SCK_PIN - Required for DUE Hardware SPI + #define DOGLCD_MOSI EXP2_05_PIN // MOSI_PIN + #define DOGLCD_MISO EXP2_10_PIN // MISO_PIN #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 643c68ae4fad..9d24828ce3aa 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -153,7 +153,7 @@ // SPI for MAX Thermocouple /* #if DISABLED(SDSUPPORT) - #define TEMP_0_CS_PIN 53 + #define TEMP_0_CS_PIN EXP1_03_PIN #else #define TEMP_0_CS_PIN 49 #endif @@ -190,59 +190,87 @@ // 32Mb FLASH //#define SPI_FLASH_CS_PIN ? +/** + * ------ ------ + * (BEEPER) 62 |10 9 | 40 (BTN_ENC) (MISO) 74 |10 9 | 76 (SCK) + * (LCD_EN) 64 | 8 7 | 63 (LCD_RS) (BTN_EN1) 44 | 8 7 | 10 (SD_SS) + * (LCD_D4) 48 | 6 5 50 (LCD_D5) (BTN_EN2) 42 | 6 5 75 (MOSI) + * (LCD_D6) 52 | 4 3 | 53 (LCD_D7) (SD_DETECT) 51 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN 53 +#define EXP1_04_PIN 52 +#define EXP1_05_PIN 50 +#define EXP1_06_PIN 48 +#define EXP1_07_PIN 63 +#define EXP1_08_PIN 64 +#define EXP1_09_PIN 40 +#define EXP1_10_PIN 62 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN 51 +#define EXP2_05_PIN 75 // MOSI +#define EXP2_06_PIN 42 +#define EXP2_07_PIN 10 +#define EXP2_08_PIN 44 +#define EXP2_09_PIN 76 // SCK +#define EXP2_10_PIN 74 // MISO + // // LCD / Controller // #if HAS_WIRED_LCD #if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC) - #define BEEPER_PIN 62 - #define LCD_PINS_D4 48 - #define LCD_PINS_D5 50 - #define LCD_PINS_D6 52 - #define LCD_PINS_D7 53 - #define SD_DETECT_PIN 51 + #define BEEPER_PIN EXP1_10_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + #define SD_DETECT_PIN EXP2_04_PIN #endif #if EITHER(RADDS_DISPLAY, IS_RRD_SC) - #define LCD_PINS_RS 63 - #define LCD_PINS_ENABLE 64 + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN #elif IS_RRD_FG_SC - #define LCD_PINS_RS 52 - #define LCD_PINS_ENABLE 53 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN #elif HAS_U8GLIB_I2C_OLED - #define BEEPER_PIN 62 - #define LCD_SDSS 10 - #define SD_DETECT_PIN 51 + #define BEEPER_PIN EXP1_10_PIN + #define LCD_SDSS EXP2_07_PIN + #define SD_DETECT_PIN EXP2_04_PIN #elif ENABLED(FYSETC_MINI_12864) - #define BEEPER_PIN 62 - #define DOGLCD_CS 64 - #define DOGLCD_A0 63 + #define BEEPER_PIN EXP1_10_PIN + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN 48 // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 50 // D5 + #define RGB_LED_R_PIN EXP1_05_PIN // D5 #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 52 // D6 + #define RGB_LED_G_PIN EXP1_04_PIN // D6 #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 53 // D7 + #define RGB_LED_B_PIN EXP1_03_PIN // D7 #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 50 // D5 + #define NEOPIXEL_PIN EXP1_05_PIN // D5 #endif #elif ENABLED(SPARK_FULL_GRAPHICS) @@ -259,9 +287,9 @@ #endif // SPARK_FULL_GRAPHICS #if IS_NEWPANEL - #define BTN_EN1 44 - #define BTN_EN2 42 - #define BTN_ENC 40 + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index ee741dcbf540..cc919d0a4fdc 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -173,74 +173,101 @@ // 32Mb FLASH //#define SPI_FLASH_CS_PIN ? +/** + * ------ ------ + * (BEEPER) 62 |10 9 | 40 (BTN_ENC) (MISO) 74 |10 9 | 76 (SCK) + * (LCD_EN) 64 | 8 7 | 63 (LCD_RS) (BTN_EN1) 44 | 8 7 | 10 (SD_SS) + * (LCD_D4) 48 | 6 5 50 (LCD_D5) (BTN_EN2) 42 | 6 5 75 (MOSI) + * (LCD_D6) 52 | 4 3 | 53 (LCD_D7) (SD_DETECT) 51 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN 53 +#define EXP1_04_PIN 52 +#define EXP1_05_PIN 50 +#define EXP1_06_PIN 48 +#define EXP1_07_PIN 63 +#define EXP1_08_PIN 64 +#define EXP1_09_PIN 40 +#define EXP1_10_PIN 62 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN 51 +#define EXP2_05_PIN 75 // MOSI +#define EXP2_06_PIN 42 +#define EXP2_07_PIN 10 +#define EXP2_08_PIN 44 +#define EXP2_09_PIN 76 // SCK +#define EXP2_10_PIN 74 // MISO + // // LCD / Controller // #if HAS_WIRED_LCD #if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC) - #define BEEPER_PIN 62 - #define LCD_PINS_D4 48 - #define LCD_PINS_D5 50 - #define LCD_PINS_D6 52 - #define LCD_PINS_D7 53 - #define SD_DETECT_PIN 51 + #define BEEPER_PIN EXP1_10_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + #define SD_DETECT_PIN EXP2_04_PIN #endif #if EITHER(RADDS_DISPLAY, IS_RRD_SC) - #define LCD_PINS_RS 63 - #define LCD_PINS_ENABLE 64 + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN #elif IS_RRD_FG_SC - #define LCD_PINS_RS 52 - #define LCD_PINS_ENABLE 53 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN #elif HAS_U8GLIB_I2C_OLED - #define BEEPER_PIN 62 - #define LCD_SDSS 10 - #define SD_DETECT_PIN 51 + #define BEEPER_PIN EXP1_10_PIN + #define LCD_SDSS EXP2_07_PIN + #define SD_DETECT_PIN EXP2_04_PIN #elif ENABLED(FYSETC_MINI_12864) - #define BEEPER_PIN 62 - #define DOGLCD_CS 64 - #define DOGLCD_A0 63 + #define BEEPER_PIN EXP1_10_PIN + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN 48 // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 50 // D5 + #define RGB_LED_R_PIN EXP1_05_PIN // D5 #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 52 // D6 + #define RGB_LED_G_PIN EXP1_04_PIN // D6 #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 53 // D7 + #define RGB_LED_B_PIN EXP1_03_PIN // D7 #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN 50 // D5 + #define NEOPIXEL_PIN EXP1_05_PIN // D5 #endif #elif ENABLED(MKS_MINI_12864) + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN - #define DOGLCD_A0 52 - #define DOGLCD_CS 50 - - #define SD_DETECT_PIN 51 + #define SD_DETECT_PIN EXP2_04_PIN #endif #if IS_NEWPANEL - #define BTN_EN1 44 - #define BTN_EN2 42 - #define BTN_ENC 40 + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index ef800b15c7a3..7a9595b90961 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -205,6 +205,34 @@ //#define LED_PIN PB2 +/** + * ------ ------ + * PC5 |10 9 | PE13 PA6 |10 9 | PA5 + * PD13 | 8 7 | PC6 PE8 | 8 7 | PE10 + * PE14 | 6 5 PE15 PE11 | 6 5 PA7 + * PD11 | 4 3 | PD10 PE12 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | 3.3V + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN PD10 +#define EXP1_04_PIN PD11 +#define EXP1_05_PIN PE15 +#define EXP1_06_PIN PE14 +#define EXP1_07_PIN PC6 +#define EXP1_08_PIN PD13 +#define EXP1_09_PIN PE13 +#define EXP1_10_PIN PC5 + +#define EXP2_03_PIN -1 +#define EXP2_04_PIN PE12 +#define EXP2_05_PIN PA7 +#define EXP2_06_PIN PE11 +#define EXP2_07_PIN PE10 +#define EXP2_08_PIN PE8 +#define EXP2_09_PIN PA5 +#define EXP2_10_PIN PA6 + // // SD Card // @@ -219,11 +247,11 @@ #define ONBOARD_SD_CS_PIN PC11 #elif SD_CONNECTION_IS(LCD) #define ENABLE_SPI1 - #define SDSS PE10 - #define SD_SCK_PIN PA5 - #define SD_MISO_PIN PA6 - #define SD_MOSI_PIN PA7 - #define SD_DETECT_PIN PE12 + #define SDSS EXP2_07_PIN + #define SD_SCK_PIN EXP2_09_PIN + #define SD_MISO_PIN EXP2_10_PIN + #define SD_MOSI_PIN EXP2_05_PIN + #define SD_DETECT_PIN EXP2_04_PIN #endif // @@ -240,27 +268,26 @@ // Shared SPI TFT - #define LCD_BACKLIGHT_PIN PD13 + #define LCD_BACKLIGHT_PIN EXP1_08_PIN - #define TOUCH_CS_PIN PE14 // SPI1_NSS - #define TOUCH_SCK_PIN PA5 // SPI1_SCK - #define TOUCH_MISO_PIN PA6 // SPI1_MISO - #define TOUCH_MOSI_PIN PA7 // SPI1_MOSI + #define TOUCH_CS_PIN EXP1_06_PIN // SPI1_NSS + #define TOUCH_SCK_PIN EXP2_09_PIN // SPI1_SCK + #define TOUCH_MISO_PIN EXP2_10_PIN // SPI1_MISO + #define TOUCH_MOSI_PIN EXP2_05_PIN // SPI1_MOSI - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 - #define BTN_ENC PE13 + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN - #define TFT_CS_PIN PD11 - #define TFT_SCK_PIN PA5 - #define TFT_MISO_PIN PA6 - #define TFT_MOSI_PIN PA7 - #define TFT_DC_PIN PD10 - #define TFT_RST_PIN PC6 + #define TFT_CS_PIN EXP1_04_PIN + #define TFT_SCK_PIN EXP2_09_PIN + #define TFT_MISO_PIN EXP2_10_PIN + #define TFT_MOSI_PIN EXP2_05_PIN + #define TFT_DC_PIN EXP1_03_PIN #define TFT_A0_PIN TFT_DC_PIN - #define TFT_RESET_PIN PC6 - #define TFT_BACKLIGHT_PIN PD13 + #define TFT_RESET_PIN EXP1_07_PIN + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 @@ -271,22 +298,22 @@ #if ENABLED(TFT_CLASSIC_UI) // Emulated DOGM SPI - #define LCD_PINS_ENABLE PD13 - #define LCD_PINS_RS PC6 - #define BTN_ENC PE13 - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN #elif ENABLED(TFT_COLOR_UI) #define TFT_BUFFER_SIZE 14400 #endif #if HAS_WIRED_LCD && !HAS_SPI_TFT - #define BEEPER_PIN PC5 - #define BTN_ENC PE13 - #define LCD_PINS_ENABLE PD13 - #define LCD_PINS_RS PC6 - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 + #define BEEPER_PIN EXP1_10_PIN + #define BTN_ENC EXP1_09_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN #define LCD_BACKLIGHT_PIN -1 #if ENABLED(MKS_MINI_12864) @@ -296,18 +323,18 @@ #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN -1 - #define DOGLCD_A0 PD11 - #define DOGLCD_CS PE15 - #define DOGLCD_SCK PA5 - #define DOGLCD_MOSI PA7 + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN + #define DOGLCD_SCK EXP2_09_PIN + #define DOGLCD_MOSI EXP2_05_PIN #elif IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define PIN_SPI_SCK PA5 - #define PIN_TFT_MISO PA6 - #define PIN_TFT_MOSI PA7 - #define TFTGLCD_CS PE8 + #define PIN_SPI_SCK EXP2_09_PIN + #define PIN_TFT_MISO EXP2_10_PIN + #define PIN_TFT_MOSI EXP2_05_PIN + #define TFTGLCD_CS EXP2_08_PIN #endif #ifndef BEEPER_PIN @@ -315,14 +342,14 @@ #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define LCD_PINS_DC PC6 - #define DOGLCD_CS PD13 + #define LCD_PINS_DC EXP1_07_PIN + #define DOGLCD_CS EXP1_08_PIN #define DOGLCD_A0 DOGLCD_A0 #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN PE14 - #define NEOPIXEL_PIN PE15 - #define DOGLCD_MOSI PA7 - #define DOGLCD_SCK PA5 + #define LCD_RESET_PIN EXP1_06_PIN + #define NEOPIXEL_PIN EXP1_05_PIN + #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_SCK EXP2_09_PIN #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif @@ -330,11 +357,11 @@ #else // !MKS_MINI_12864 - #define LCD_PINS_D4 PE14 + #define LCD_PINS_D4 EXP1_06_PIN #if IS_ULTIPANEL - #define LCD_PINS_D5 PE15 - #define LCD_PINS_D6 PD11 - #define LCD_PINS_D7 PD10 + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -360,7 +387,7 @@ #endif #ifndef BEEPER_PIN - #define BEEPER_PIN PC5 + #define BEEPER_PIN EXP1_10_PIN #endif #if ENABLED(SPEAKER) && BEEPER_PIN == PC5 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 49fe59577edc..6e11e1bcd351 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -282,11 +282,10 @@ #define TFT_MISO_PIN PA6 #define TFT_MOSI_PIN PA7 #define TFT_DC_PIN PD10 - #define TFT_RST_PIN PC6 #define TFT_A0_PIN TFT_DC_PIN #define TFT_RESET_PIN PC6 - #define TFT_BACKLIGHT_PIN PD13 + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 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 d526c75b6396..4e311d48628a 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 @@ -527,6 +527,11 @@ #endif #if HAS_SPI_TFT + + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN + // // e.g., BTT_TFT35_SPI_V1_0 (480x320, 3.5", SPI Stock Display with Rotary Encoder in BIQU B1 SE) // @@ -542,9 +547,6 @@ #define TOUCH_SCK_PIN EXP1_06_PIN #define TOUCH_CS_PIN EXP1_07_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN #endif // diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h index 124923fef841..736c79b6e034 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h @@ -289,16 +289,16 @@ #define TFT_MISO_PIN EXP2_10_PIN #define TFT_MOSI_PIN EXP2_05_PIN #define TFT_DC_PIN EXP1_03_PIN - #define TFT_RST_PIN EXP1_07_PIN #define TFT_A0_PIN TFT_DC_PIN #define TFT_RESET_PIN EXP1_07_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN + + #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 - #define LCD_BACKLIGHT_PIN EXP1_08_PIN #ifndef TFT_WIDTH #define TFT_WIDTH 480 #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index ead8799f5e09..989010e47f36 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -283,16 +283,16 @@ #define TFT_MISO_PIN EXP2_10_PIN #define TFT_MOSI_PIN EXP2_05_PIN #define TFT_DC_PIN EXP1_03_PIN - #define TFT_RST_PIN EXP1_07_PIN #define TFT_A0_PIN TFT_DC_PIN #define TFT_RESET_PIN EXP1_07_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN + + #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 - #define LCD_BACKLIGHT_PIN EXP1_08_PIN #ifndef TFT_WIDTH #define TFT_WIDTH 480 #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index fde2682dc097..ff020f9c9c5a 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -305,16 +305,15 @@ #define TFT_MISO_PIN EXP2_10_PIN #define TFT_MOSI_PIN EXP2_05_PIN #define TFT_DC_PIN EXP1_03_PIN - #define TFT_RST_PIN EXP1_07_PIN #define TFT_A0_PIN TFT_DC_PIN #define TFT_RESET_PIN EXP1_07_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN + #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 - #define LCD_BACKLIGHT_PIN EXP1_08_PIN #ifndef TFT_WIDTH #define TFT_WIDTH 480 #endif diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h index 813944d3cb43..089231e3aa51 100644 --- a/Marlin/src/pins/stm32f4/pins_VAKE403D.h +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -161,27 +161,61 @@ #define POWER_LOSS_PIN PA4 // ?? Power loss / nAC_FAULT #if ENABLED(SDSUPPORT) - #define SD_DETECT_PIN PB7 - #define SD_SS_PIN PB_15 // USD_CS -> CS for onboard SD + #define SD_DETECT_PIN EXP2_04_PIN + #define SD_SS_PIN PB15 // USD_CS -> CS for onboard SD #endif +/** + * ------ ------ + * PC9 |10 9 | PB12 ? |10 9 | ? + * PD7 | 8 7 | PC12 PD6 | 8 7 | ? + * PD1 | 6 5 PD2 PD0 | 6 5 ? + * PD3 | 4 3 | PD4 PB7 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | 3.3V + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN PD4 +#define EXP1_04_PIN PD3 +#define EXP1_05_PIN PD2 +#define EXP1_06_PIN PD1 +#define EXP1_07_PIN PC12 +#define EXP1_08_PIN PD7 +#define EXP1_09_PIN PB12 +#define EXP1_10_PIN PC9 + +#define EXP2_03_PIN -1 +#define EXP2_04_PIN PB7 +//#define EXP2_05_PIN ? +#define EXP2_06_PIN PD0 +//#define EXP2_07_PIN ? +#define EXP2_08_PIN PD6 +//#define EXP2_09_PIN ? +//#define EXP2_10_PIN ? + // // LCD / Controller // #if HAS_WIRED_LCD + #if ENABLED(SDSUPPORT) #define SDSS PB6 // CS for SD card in LCD #endif - #define BEEPER_PIN PC9 - #define LCD_PINS_RS PC12 - #define LCD_PINS_ENABLE PD7 - #define LCD_PINS_D4 PD1 - #define LCD_PINS_D5 PD2 - #define LCD_PINS_D6 PD3 - #define LCD_PINS_D7 PD4 - #define BTN_EN1 PD6 - #define BTN_EN2 PD0 - #define BTN_ENC PB12 + + #define BEEPER_PIN EXP1_10_PIN + + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN + + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_RS EXP1_07_PIN + + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + #endif // Alter timing for graphical display diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h index f48c007d8cec..5a772eb21b09 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h @@ -50,8 +50,6 @@ #define LED_PIN PA13 #define BEEPER_PIN PA14 -#define TFT_BACKLIGHT_PIN PB5 - #define POWER_MONITOR_PIN PB0 #define RPI_POWER_PIN PE5 From 0daaef589c956d152c846760dfc157fdd1b7975b Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 25 May 2022 07:49:57 +1200 Subject: [PATCH 325/502] =?UTF-8?q?=F0=9F=93=8C=20Use=20MarlinSimUI/bugfix?= =?UTF-8?q?-2.0.x=20(#24232)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/native.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ini/native.ini b/ini/native.ini index b34945397ecf..e860a55958f2 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -41,7 +41,7 @@ debug_build_flags = -fstack-protector-strong -g -g3 -ggdb lib_compat_mode = off build_src_filter = ${common.default_src_filter} + lib_deps = ${common.lib_deps} - MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/0.0.2.zip + MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/refs/heads/bugfix-2.0.x.zip Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/marlin_sim_native.zip LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/master.zip extra_scripts = ${common.extra_scripts} From 4a6ae1b64df5fa8824e20688399683bf11b840e2 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 25 May 2022 08:31:29 +1200 Subject: [PATCH 326/502] =?UTF-8?q?=F0=9F=8E=A8=20Remove=20MKS=20custom=20?= =?UTF-8?q?pins,=20TinyBee=20cleanup=20(#24186)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp | 21 +++---- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h | 78 +++++++++--------------- 2 files changed, 37 insertions(+), 62 deletions(-) diff --git a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp index 5437e8181b95..a445035b2b43 100644 --- a/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp +++ b/Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp @@ -23,24 +23,17 @@ */ #ifdef ARDUINO_ARCH_ESP32 -#include "../../inc/MarlinConfigPre.h" +#include "../../inc/MarlinConfig.h" #if EITHER(MKS_MINI_12864, FYSETC_MINI_12864_2_1) #include -#include "Arduino.h" #include "../shared/HAL_SPI.h" #include "HAL.h" #include "SPI.h" static SPISettings spiConfig; -#define MDOGLCD_MOSI 23 -#define MDOGLCD_SCK 18 -#define MLCD_RESET_PIN 0 -#define MLCD_PINS_DC 4 -#define MDOGLCD_CS 21 -#define MDOGLCD_A0 4 #ifndef LCD_SPI_SPEED #ifdef SD_SPI_SPEED @@ -61,24 +54,24 @@ uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_pt case U8G_COM_MSG_STOP: break; case U8G_COM_MSG_INIT: - OUT_WRITE(MDOGLCD_CS, HIGH); - OUT_WRITE(MDOGLCD_A0, HIGH); - OUT_WRITE(MLCD_RESET_PIN, HIGH); + OUT_WRITE(DOGLCD_CS, HIGH); + OUT_WRITE(DOGLCD_A0, HIGH); + OUT_WRITE(LCD_RESET_PIN, HIGH); u8g_Delay(5); spiBegin(); spiInit(LCD_SPI_SPEED); break; case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ - WRITE(MDOGLCD_A0, arg_val ? HIGH : LOW); + WRITE(DOGLCD_A0, arg_val ? HIGH : LOW); break; case U8G_COM_MSG_CHIP_SELECT: /* arg_val == 0 means HIGH level of U8G_PI_CS */ - WRITE(MDOGLCD_CS, arg_val ? LOW : HIGH); + WRITE(DOGLCD_CS, arg_val ? LOW : HIGH); break; case U8G_COM_MSG_RESET: - WRITE(MLCD_RESET_PIN, arg_val); + WRITE(LCD_RESET_PIN, arg_val); break; case U8G_COM_MSG_WRITE_BYTE: diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 68b8ed4ac800..025650fef552 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -116,17 +116,7 @@ // // ADC Reference Voltage // -#define ADC_REFERENCE_VOLTAGE 2.5 // 2.5V reference VDDA - -// -// MicroSD card -// -#define SD_MOSI_PIN 23 -#define SD_MISO_PIN 19 -#define SD_SCK_PIN 18 -#define SDSS 5 -#define SD_DETECT_PIN 34 // IO34 default is SD_DET signal (Jump to SDDET) -#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers +#define ADC_REFERENCE_VOLTAGE 2.5 // 2.5V reference VDDA /** * ------ ------ @@ -157,56 +147,48 @@ #define EXP2_09_PIN 18 #define EXP2_10_PIN 19 -#if HAS_WIRED_LCD +// +// MicroSD card +// +//#define SD_MOSI_PIN EXP2_05_PIN // uses esp32 default 23 +//#define SD_MISO_PIN EXP2_10_PIN // uses esp32 default 19 +//#define SD_SCK_PIN EXP2_09_PIN // uses esp32 default 18 +#define SDSS EXP2_07_PIN +#define SD_DETECT_PIN EXP2_04_PIN // IO34 default is SD_DET signal (Jump to SDDET) +#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers - #define BEEPER_PIN 149 - #define BTN_ENC 13 - #define LCD_PINS_ENABLE 21 - #define LCD_PINS_RS 4 - #define BTN_EN1 14 - #define BTN_EN2 12 +#if HAS_WIRED_LCD + #define BEEPER_PIN EXP1_10_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN #define LCD_BACKLIGHT_PIN -1 - // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) #if ENABLED(MKS_MINI_12864) - - //#define LCD_BACKLIGHT_PIN -1 - //#define LCD_RESET_PIN -1 - #define DOGLCD_A0 15 - #define DOGLCD_CS 16 - //#define DOGLCD_SCK 19 - //#define DOGLCD_MOSI 23 - - // Required for MKS_MINI_12864 with this board - //#define MKS_LCD12864B - - #elif ENABLED(MKS_MINI_12864_V3) - - #define LCD_PINS_DC EXP1_07_PIN + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #define DOGLCD_CS EXP1_05_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define LCD_RESET_PIN -1 + #elif ENABLED(FYSETC_MINI_12864_2_1) + // MKS_MINI_12864_V3, BTT_MINI_12864_V1, FYSETC_MINI_12864_2_1 #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 LCD_PINS_DC - #define LCD_BACKLIGHT_PIN -1 + #define DOGLCD_A0 EXP1_07_PIN #define LCD_RESET_PIN EXP1_06_PIN #define NEOPIXEL_PIN EXP1_05_PIN - #define DOGLCD_MOSI EXP2_05_PIN - #define DOGLCD_SCK EXP2_09_PIN #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif - - #else // !MKS_MINI_12864 - - #define LCD_PINS_D4 0 + #else + #define LCD_PINS_D4 EXP1_06_PIN #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define LCD_PINS_D5 16 - #define LCD_PINS_D6 15 - #define LCD_PINS_D7 17 + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN #endif - #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 600 - - #endif // !MKS_MINI_12864 - + #endif #endif // HAS_WIRED_LCD From d19179ce281cec58865fcbc99185abeb48a611b9 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Thu, 26 May 2022 16:07:10 -0700 Subject: [PATCH 327/502] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20some=20mothe?= =?UTF-8?q?rboard=20checks=20(#24238)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/pins.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 82c91290c24c..a6e0fb6128f7 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -841,8 +841,8 @@ #elif MB(RAMPS_LONGER3D_LK4PRO) #error "BOARD_RAMPS_LONGER3D_LK4PRO is now BOARD_LONGER3D_LKx_PRO. Please update your configuration." #elif MB(BTT_SKR_V2_0) - #error "BTT_SKR_V2_0 is now BTT_SKR_V2_0_REV_A or BTT_SKR_V2_0_REV_B. See https://bit.ly/3t5d9JQ for more information. Please update your configuration." - #elif MB(BOARD_TH3D_EZBOARD_LITE_V2) + #error "BOARD_BTT_SKR_V2_0 is now BOARD_BTT_SKR_V2_0_REV_A or BOARD_BTT_SKR_V2_0_REV_B. See https://bit.ly/3t5d9JQ for more information. Please update your configuration." + #elif MB(TH3D_EZBOARD_LITE_V2) #error "BOARD_TH3D_EZBOARD_LITE_V2 is now BOARD_TH3D_EZBOARD_V2. Please update your configuration." #elif defined(MOTHERBOARD) #error "Unknown MOTHERBOARD value set in Configuration.h." @@ -873,6 +873,7 @@ #undef BOARD_RAMPS_DAGOMA #undef BOARD_RAMPS_LONGER3D_LK4PRO #undef BOARD_BTT_SKR_V2_0 + #undef BOARD_TH3D_EZBOARD_LITE_V2 #endif From ccf39b1c42fa787f645fbf0ac075cc47b72b18d3 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 27 May 2022 12:02:42 +1200 Subject: [PATCH 328/502] =?UTF-8?q?=F0=9F=94=A8=20Add=20src=5Ffilter=20for?= =?UTF-8?q?=20I2C=5FAMMETER=20(#24242)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/features.ini | 1 + platformio.ini | 1 + 2 files changed, 2 insertions(+) diff --git a/ini/features.ini b/ini/features.ini index 81dad8e03556..c55af9ca3237 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -32,6 +32,7 @@ LIB_INTERNAL_MAX31865 = src_filter=+ NEOPIXEL_LED = adafruit/Adafruit NeoPixel@~1.8.0 src_filter=+ I2C_AMMETER = peterus/INA226Lib@1.1.2 + src_filter=+ USES_LIQUIDCRYSTAL = LiquidCrystal=https://github.com/MarlinFirmware/New-LiquidCrystal/archive/1.5.1.zip USES_LIQUIDCRYSTAL_I2C = marcoschwartz/LiquidCrystal_I2C@1.1.4 USES_LIQUIDTWI2 = LiquidTWI2@1.2.7 diff --git a/platformio.ini b/platformio.ini index d9fdc862e836..028bd3802989 100644 --- a/platformio.ini +++ b/platformio.ini @@ -96,6 +96,7 @@ default_src_filter = + - - + - - - - + - - - - - From 800a936caae83f4e5ca5dd2c2660518bd6fc43b2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 26 May 2022 18:18:41 -0500 Subject: [PATCH 329/502] =?UTF-8?q?=F0=9F=8E=A8=20Combine=20serial=20echos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/DUE/eeprom_flash.cpp | 36 +++++++------------ Marlin/src/feature/mmu/mmu2.cpp | 3 +- Marlin/src/gcode/probe/M951.cpp | 14 ++++---- .../archim2-flash/flash_storage.cpp | 13 ++++--- .../ftdi_eve_lib/basic/commands.cpp | 4 +-- .../ftdi_eve_lib/extended/dl_cache.cpp | 18 ++++------ 6 files changed, 33 insertions(+), 55 deletions(-) diff --git a/Marlin/src/HAL/DUE/eeprom_flash.cpp b/Marlin/src/HAL/DUE/eeprom_flash.cpp index 7ce4a84df531..607764155b0a 100644 --- a/Marlin/src/HAL/DUE/eeprom_flash.cpp +++ b/Marlin/src/HAL/DUE/eeprom_flash.cpp @@ -199,8 +199,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) { for (i = 0; i > 2; i++) pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i])); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM PageWrite ", page); + DEBUG_ECHO_MSG("EEPROM PageWrite ", page); DEBUG_ECHOLNPGM(" in FLASH address ", (uint32_t)addrflash); DEBUG_ECHOLNPGM(" base address ", (uint32_t)getFlashStorage(0)); DEBUG_FLUSH(); @@ -245,8 +244,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) { // Reenable interrupts __enable_irq(); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Unlock failure for page ", page); + DEBUG_ECHO_MSG("EEPROM Unlock failure for page ", page); return false; } @@ -270,8 +268,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) { // Reenable interrupts __enable_irq(); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Write failure for page ", page); + DEBUG_ECHO_MSG("EEPROM Write failure for page ", page); return false; } @@ -286,8 +283,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) { if (memcmp(getFlashStorage(page),data,PageSize)) { #ifdef EE_EMU_DEBUG - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Verify Write failure for page ", page); + DEBUG_ECHO_MSG("EEPROM Verify Write failure for page ", page); ee_Dump( page, (uint32_t *)addrflash); ee_Dump(-page, data); @@ -325,8 +321,7 @@ static bool ee_PageErase(uint16_t page) { uint16_t i; uint32_t addrflash = uint32_t(getFlashStorage(page)); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM PageErase ", page); + DEBUG_ECHO_MSG("EEPROM PageErase ", page); DEBUG_ECHOLNPGM(" in FLASH address ", (uint32_t)addrflash); DEBUG_ECHOLNPGM(" base address ", (uint32_t)getFlashStorage(0)); DEBUG_FLUSH(); @@ -370,8 +365,7 @@ static bool ee_PageErase(uint16_t page) { // Reenable interrupts __enable_irq(); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Unlock failure for page ",page); + DEBUG_ECHO_MSG("EEPROM Unlock failure for page ",page); return false; } @@ -394,8 +388,7 @@ static bool ee_PageErase(uint16_t page) { // Reenable interrupts __enable_irq(); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Erase failure for page ",page); + DEBUG_ECHO_MSG("EEPROM Erase failure for page ",page); return false; } @@ -410,8 +403,7 @@ static bool ee_PageErase(uint16_t page) { uint32_t * aligned_src = (uint32_t *) addrflash; for (i = 0; i < PageSize >> 2; i++) { if (*aligned_src++ != 0xFFFFFFFF) { - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Verify Erase failure for page ",page); + DEBUG_ECHO_MSG("EEPROM Verify Erase failure for page ",page); ee_Dump(page, (uint32_t *)addrflash); return false; } @@ -921,8 +913,7 @@ static void ee_Init() { // If all groups seem to be used, default to first group if (curGroup >= GroupCount) curGroup = 0; - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Current Group: ",curGroup); + DEBUG_ECHO_MSG("EEPROM Current Group: ",curGroup); DEBUG_FLUSH(); // Now, validate that all the other group pages are empty @@ -931,8 +922,7 @@ static void ee_Init() { for (int page = 0; page < PagesPerGroup; page++) { if (!ee_IsPageClean(grp * PagesPerGroup + page)) { - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Page ", page, " not clean on group ", grp); + DEBUG_ECHO_MSG("EEPROM Page ", page, " not clean on group ", grp); DEBUG_FLUSH(); ee_PageErase(grp * PagesPerGroup + page); } @@ -948,15 +938,13 @@ static void ee_Init() { } } - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Active page: ", curPage); + DEBUG_ECHO_MSG("EEPROM Active page: ", curPage); DEBUG_FLUSH(); // Make sure the pages following the first clean one are also clean for (int page = curPage + 1; page < PagesPerGroup; page++) { if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) { - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("EEPROM Page ", page, " not clean on active group ", curGroup); + DEBUG_ECHO_MSG("EEPROM Page ", page, " not clean on active group ", curGroup); DEBUG_FLUSH(); ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page)); ee_PageErase(curGroup * PagesPerGroup + page); diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp index a469c988c9cf..2544995c6d18 100644 --- a/Marlin/src/feature/mmu/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -1031,8 +1031,7 @@ void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) { const float es = pgm_read_float(&(step->extrude)); const feedRate_t fr_mm_m = pgm_read_float(&(step->feedRate)); - DEBUG_ECHO_START(); - DEBUG_ECHOLNPGM("E step ", es, "/", fr_mm_m); + DEBUG_ECHO_MSG("E step ", es, "/", fr_mm_m); current_position.e += es; line_to_current_position(MMM_TO_MMS(fr_mm_m)); diff --git a/Marlin/src/gcode/probe/M951.cpp b/Marlin/src/gcode/probe/M951.cpp index c6a9cfbe206c..7a06400e3336 100644 --- a/Marlin/src/gcode/probe/M951.cpp +++ b/Marlin/src/gcode/probe/M951.cpp @@ -32,13 +32,13 @@ mpe_settings_t mpe_settings; inline void mpe_settings_report() { SERIAL_ECHO_MSG("Magnetic Parking Extruder"); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("L: Left parking :", mpe_settings.parking_xpos[0]); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("R: Right parking :", mpe_settings.parking_xpos[1]); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("I: Grab Offset :", mpe_settings.grab_distance); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("J: Normal speed :", long(MMS_TO_MMM(mpe_settings.slow_feedrate))); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("H: High speed :", long(MMS_TO_MMM(mpe_settings.fast_feedrate))); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("D: Distance trav.:", mpe_settings.travel_distance); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("C: Compenstion :", mpe_settings.compensation_factor); + SERIAL_ECHO_MSG("L: Left parking :", mpe_settings.parking_xpos[0]); + SERIAL_ECHO_MSG("R: Right parking :", mpe_settings.parking_xpos[1]); + SERIAL_ECHO_MSG("I: Grab Offset :", mpe_settings.grab_distance); + SERIAL_ECHO_MSG("J: Normal speed :", long(MMS_TO_MMM(mpe_settings.slow_feedrate))); + SERIAL_ECHO_MSG("H: High speed :", long(MMS_TO_MMM(mpe_settings.fast_feedrate))); + SERIAL_ECHO_MSG("D: Distance trav.:", mpe_settings.travel_distance); + SERIAL_ECHO_MSG("C: Compenstion :", mpe_settings.compensation_factor); } void mpe_settings_init() { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp index dbee1e034b07..a23ad6e37e76 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp @@ -178,9 +178,9 @@ bool UIFlashStorage::is_present = false; if (!is_known) { SERIAL_ECHO_MSG("Unable to locate supported SPI Flash Memory."); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(" Manufacturer ID, got: ", manufacturer_id); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(" Device Type , got: ", device_type); - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(" Capacity , got: ", capacity); + SERIAL_ECHO_MSG(" Manufacturer ID, got: ", manufacturer_id); + SERIAL_ECHO_MSG(" Device Type , got: ", device_type); + SERIAL_ECHO_MSG(" Capacity , got: ", capacity); } return is_known; @@ -247,7 +247,7 @@ bool UIFlashStorage::is_present = false; case 0xFFFFFFFFul: return read_offset; case delimiter: read_offset = offset; break; default: - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Invalid delimiter in Flash: ", delim); + SERIAL_ECHO_MSG("Invalid delimiter in Flash: ", delim); return -1; } } @@ -325,8 +325,7 @@ bool UIFlashStorage::is_present = false; } SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Writing UI settings to SPI Flash (offset ", write_addr); - SERIAL_ECHOPGM(")..."); + SERIAL_ECHOPGM("Writing UI settings to SPI Flash (offset ", write_addr, ")..."); const uint32_t delim = delimiter; write_addr = write(write_addr, &delim, sizeof(delim)); @@ -509,7 +508,7 @@ bool UIFlashStorage::is_present = false; bytes_remaining = get_media_file_size(slot); if (bytes_remaining != 0xFFFFFFFFUL) { - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Boot media file size:", bytes_remaining); + SERIAL_ECHO_MSG("Boot media file size:", bytes_remaining); addr = get_media_file_start(slot); return true; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp index 8e788421ad25..a796c8edcf5f 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp @@ -1024,9 +1024,7 @@ template bool CLCD::CommandFifo::write(T data, uint16_t len) { uint16_t Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; if (Command_Space < (len + padding)) { #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Waiting for ", len + padding); - SERIAL_ECHOLNPGM(" bytes in command queue, now free: ", Command_Space); + SERIAL_ECHO_MSG("Waiting for ", len + padding, " bytes in command queue, now free: ", Command_Space); #endif do { Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp index 1ee73c140e3a..f947a352b1f1 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp @@ -131,9 +131,7 @@ bool DLCache::store(uint32_t min_bytes /* = 0*/) { if (dl_size > dl_slot_size) { // Not enough memory to cache the display list. #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM ("Not enough space in GRAM to cache display list, free space: ", dl_slot_size); - SERIAL_ECHOLNPGM(" Required: ", dl_size); + SERIAL_ECHO_MSG("Not enough space in GRAM to cache display list, free space: ", dl_slot_size, " Required: ", dl_size); #endif dl_slot_used = 0; save_slot(); @@ -141,9 +139,7 @@ bool DLCache::store(uint32_t min_bytes /* = 0*/) { } else { #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM ("Saving DL to RAMG cache, bytes: ", dl_slot_used); - SERIAL_ECHOLNPGM(" Free space: ", dl_slot_size); + SERIAL_ECHO_MSG("Saving DL to RAMG cache, bytes: ", dl_slot_used, " Free space: ", dl_slot_size); #endif dl_slot_used = dl_size; save_slot(); @@ -160,9 +156,9 @@ void DLCache::save_slot(uint8_t indx, uint32_t addr, uint16_t size, uint16_t use } void DLCache::load_slot(uint8_t indx, uint32_t &addr, uint16_t &size, uint16_t &used) { - addr = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 0); - size = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 4); - used = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 8); + addr = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 0); + size = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 4); + used = CLCD::mem_read_32(DL_CACHE_START + indx * 12 + 8); } void DLCache::append() { @@ -171,9 +167,7 @@ void DLCache::append() { #if ENABLED(TOUCH_UI_DEBUG) cmd.execute(); wait_until_idle(); - SERIAL_ECHO_START(); - SERIAL_ECHOPGM ("Appending to DL from RAMG cache, bytes: ", dl_slot_used); - SERIAL_ECHOLNPGM(" REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL)); + SERIAL_ECHO_MSG("Appending to DL from RAMG cache, bytes: ", dl_slot_used, " REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL)); #endif } From 915bce495cdc5168c982274f6deabc92e052c2c7 Mon Sep 17 00:00:00 2001 From: Simon Pilepich Date: Sat, 28 May 2022 08:08:24 +1000 Subject: [PATCH 330/502] =?UTF-8?q?=F0=9F=93=9D=20Fix=20Mightyboard=20MOSF?= =?UTF-8?q?ET=20comments=20(#24183)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index c44b1f449c71..3bcece400f96 100644 --- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -149,8 +149,8 @@ #define MOSFET_1_PIN 6 // Plug EX1 Pin 1-2 -> PH3 #15 -> Logical 06 #define MOSFET_2_PIN 7 // Plug EX1 Pin 3-4 -> PH4 #16 -> Logical 07 -#define MOSFET_3_PIN 11 // Plug EX2 1-2 -> PB6 #24 -> Logical 11 -#define MOSFET_4_PIN 12 // Plug EX2 3-4 -> PB5 #25 -> Logical 12 +#define MOSFET_3_PIN 11 // Plug EX2 1-2 -> PB5 #24 -> Logical 11 +#define MOSFET_4_PIN 12 // Plug EX2 3-4 -> PB6 #25 -> Logical 12 #define MOSFET_5_PIN 45 // Plug HBD 1-2 -> PL4 #39 -> Logical 45 #define MOSFET_6_PIN 44 // Plug Extra 1-2 -> PL5 #40 -> Logical 44 (FET not soldered in all boards) From 57f0ac88af9e8c5eb398c8367edf471900a5171f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 28 May 2022 14:41:50 -0500 Subject: [PATCH 331/502] =?UTF-8?q?=F0=9F=8E=A8=20=20Misc.=20boards/pins?= =?UTF-8?q?=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 38 ++++++++++++------------- Marlin/src/pins/pins.h | 8 +++--- Marlin/src/pins/sam/pins_RURAMPS4D_11.h | 9 +----- 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 653bbf1e173e..20ec0298d528 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -228,33 +228,33 @@ #define BOARD_RAMPS_14_RE_ARM_EFF 2002 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1) #define BOARD_RAMPS_14_RE_ARM_EEF 2003 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan) #define BOARD_RAMPS_14_RE_ARM_SF 2004 // Re-ARM with RAMPS 1.4 (Power outputs: Spindle, Controller Fan) -#define BOARD_MKS_SBASE 2005 // MKS-Sbase (Power outputs: Hotend0, Hotend1, Bed, Fan) +#define BOARD_MKS_SBASE 2005 // MKS-Sbase #define BOARD_AZSMZ_MINI 2006 // AZSMZ Mini -#define BOARD_BIQU_BQ111_A4 2007 // BIQU BQ111-A4 (Power outputs: Hotend, Fan, Bed) -#define BOARD_SELENA_COMPACT 2008 // Selena Compact (Power outputs: Hotend0, Hotend1, Bed0, Bed1, Fan0, Fan1) -#define BOARD_BIQU_B300_V1_0 2009 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver) -#define BOARD_MKS_SGEN_L 2010 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan) +#define BOARD_BIQU_BQ111_A4 2007 // BIQU BQ111-A4 +#define BOARD_SELENA_COMPACT 2008 // Selena Compact +#define BOARD_BIQU_B300_V1_0 2009 // BIQU B300_V1.0 +#define BOARD_MKS_SGEN_L 2010 // MKS-SGen-L #define BOARD_GMARSH_X6_REV1 2011 // GMARSH X6, revision 1 prototype -#define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed) -#define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed) -#define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed) +#define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1 +#define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3 +#define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4 // // LPC1769 ARM Cortex M3 // -#define BOARD_MKS_SGEN 2500 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_AZTEEG_X5_GT 2501 // Azteeg X5 GT (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_AZTEEG_X5_MINI 2502 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan) -#define BOARD_AZTEEG_X5_MINI_WIFI 2503 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan) +#define BOARD_MKS_SGEN 2500 // MKS-SGen +#define BOARD_AZTEEG_X5_GT 2501 // Azteeg X5 GT +#define BOARD_AZTEEG_X5_MINI 2502 // Azteeg X5 Mini +#define BOARD_AZTEEG_X5_MINI_WIFI 2503 // Azteeg X5 Mini Wifi #define BOARD_COHESION3D_REMIX 2504 // Cohesion3D ReMix #define BOARD_COHESION3D_MINI 2505 // Cohesion3D Mini #define BOARD_SMOOTHIEBOARD 2506 // Smoothieboard #define BOARD_TH3D_EZBOARD 2507 // TH3D EZBoard v1.0 -#define BOARD_BTT_SKR_V1_4_TURBO 2508 // BigTreeTech SKR v1.4 TURBO (Power outputs: Hotend0, Hotend1, Fan, Bed) -#define BOARD_MKS_SGEN_L_V2 2509 // MKS SGEN_L V2 (Power outputs: Hotend0, Hotend1, Bed, Fan) -#define BOARD_BTT_SKR_E3_TURBO 2510 // BigTreeTech SKR E3 Turbo (Power outputs: Hotend0, Hotend1, Bed, Fan0, Fan1) -#define BOARD_FLY_CDY 2511 // FLYmaker FLY CDY (Power outputs: Hotend0, Hotend1, Hotend2, Bed, Fan0, Fan1, Fan2) +#define BOARD_BTT_SKR_V1_4_TURBO 2508 // BigTreeTech SKR v1.4 TURBO +#define BOARD_MKS_SGEN_L_V2 2509 // MKS SGEN_L V2 +#define BOARD_BTT_SKR_E3_TURBO 2510 // BigTreeTech SKR E3 Turbo +#define BOARD_FLY_CDY 2511 // FLYmaker FLY CDY // // SAM3X8E ARM Cortex M3 @@ -280,8 +280,8 @@ #define BOARD_RAMPS4DUE_EFF 3017 // RAMPS4DUE (Power outputs: Hotend, Fan0, Fan1) #define BOARD_RAMPS4DUE_EEF 3018 // RAMPS4DUE (Power outputs: Hotend0, Hotend1, Fan) #define BOARD_RAMPS4DUE_SF 3019 // RAMPS4DUE (Power outputs: Spindle, Controller Fan) -#define BOARD_RURAMPS4D_11 3020 // RuRAMPS4Duo v1.1 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) -#define BOARD_RURAMPS4D_13 3021 // RuRAMPS4Duo v1.3 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) +#define BOARD_RURAMPS4D_11 3020 // RuRAMPS4Duo v1.1 +#define BOARD_RURAMPS4D_13 3021 // RuRAMPS4Duo v1.3 #define BOARD_ULTRATRONICS_PRO 3022 // ReprapWorld Ultratronics Pro V1.0 #define BOARD_ARCHIM1 3023 // UltiMachine Archim1 (with DRV8825 drivers) #define BOARD_ARCHIM2 3024 // UltiMachine Archim2 (with TMC2130 drivers) @@ -293,7 +293,7 @@ // SAM3X8C ARM Cortex M3 // -#define BOARD_PRINTRBOARD_G2 3100 // PRINTRBOARD G2 +#define BOARD_PRINTRBOARD_G2 3100 // Printrboard G2 #define BOARD_ADSK 3101 // Arduino DUE Shield Kit (ADSK) // diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index a6e0fb6128f7..da2075911433 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -464,14 +464,14 @@ #include "sam/pins_ARCHIM2.h" // SAM3X8E env:DUE_archim env:DUE_archim_debug #elif MB(ALLIGATOR) #include "sam/pins_ALLIGATOR_R2.h" // SAM3X8E env:DUE env:DUE_debug -#elif MB(ADSK) - #include "sam/pins_ADSK.h" // SAM3X8E env:DUE env:DUE_debug -#elif MB(PRINTRBOARD_G2) - #include "sam/pins_PRINTRBOARD_G2.h" // SAM3X8C env:DUE_USB #elif MB(CNCONTROLS_15D) #include "sam/pins_CNCONTROLS_15D.h" // SAM3X8E env:DUE env:DUE_USB #elif MB(KRATOS32) #include "sam/pins_KRATOS32.h" // SAM3X8E env:DUE env:DUE_USB +#elif MB(PRINTRBOARD_G2) + #include "sam/pins_PRINTRBOARD_G2.h" // SAM3X8C env:DUE_USB +#elif MB(ADSK) + #include "sam/pins_ADSK.h" // SAM3X8C env:DUE env:DUE_debug // // STM32 ARM Cortex-M0 diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 9d24828ce3aa..064ce2751ab3 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -18,19 +18,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Ported sys0724 & Vynt */ #pragma once /** * Arduino Mega? or Due with RuRAMPS4DUE pin assignments - * - * Applies to the following boards: - * RURAMPS4DUE (Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) - * - * Differences between - * RADDS | RuRAMPS4DUE - * | + * Ported by sys0724 & Vynt */ #include "env_validate.h" From deb1ba73bbdd3aacaeec6c7d9540c41e93ddfdfe Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 28 May 2022 15:11:43 -0500 Subject: [PATCH 332/502] =?UTF-8?q?=F0=9F=8E=A8=20Use=20pos.set=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/ui_api.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index e6eb3a8565c0..2aa3f44a8380 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -906,12 +906,10 @@ namespace ExtUI { if (x_target != current_position.x || y_target != current_position.y) { // If moving across bed, raise nozzle to safe height over bed feedrate_mm_s = Z_PROBE_FEEDRATE_FAST; - destination = current_position; - destination.z = Z_CLEARANCE_BETWEEN_PROBES; + destination.set(current_position.x, current_position.y, Z_CLEARANCE_BETWEEN_PROBES); prepare_line_to_destination(); feedrate_mm_s = XY_PROBE_FEEDRATE; - destination.x = x_target; - destination.y = y_target; + destination.set(x_target, y_target); prepare_line_to_destination(); } feedrate_mm_s = Z_PROBE_FEEDRATE_FAST; From bed0788f723a0695726eab52e8da0b48298c619f Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Thu, 2 Jun 2022 21:28:07 +1200 Subject: [PATCH 333/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20G60/G61=20debug=20?= =?UTF-8?q?code=20(#24231)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/feature/pause/G60.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/gcode/feature/pause/G60.cpp b/Marlin/src/gcode/feature/pause/G60.cpp index d4770577a65f..01b7d31e3e50 100644 --- a/Marlin/src/gcode/feature/pause/G60.cpp +++ b/Marlin/src/gcode/feature/pause/G60.cpp @@ -48,12 +48,12 @@ void GcodeSuite::G60() { #if ENABLED(SAVED_POSITIONS_DEBUG) { - DEBUG_ECHOPGM(STR_SAVED_POS " S", slot); + DEBUG_ECHOPGM(STR_SAVED_POS " S", slot, " :"); const xyze_pos_t &pos = stored_position[slot]; - DEBUG_ECHOLNPAIR_F_P( + DEBUG_ECHOLNPGM_P( LIST_N(DOUBLE(LINEAR_AXES), PSTR(" : X"), pos.x, SP_Y_STR, pos.y, SP_Z_STR, pos.z, SP_I_STR, pos.i, SP_J_STR, pos.j, SP_K_STR, pos.k) #if HAS_EXTRUDERS - , SP_E_STR, pos.e + , SP_E_LBL, pos.e #endif ); } From 0ae982188c23ddab4e3a2d819c679166a7e19532 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 4 May 2022 23:19:18 -0500 Subject: [PATCH 334/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20M203=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/config/M200-M205.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index fb4c9b8af347..77cd5f7855ab 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -194,7 +194,7 @@ void GcodeSuite::M203_report(const bool forReplay/*=true*/) { ); #if ENABLED(DISTINCT_E_FACTORS) LOOP_L_N(i, E_STEPPERS) { - SERIAL_ECHO_START(); + if (!forReplay) SERIAL_ECHO_START(); SERIAL_ECHOLNPGM_P( PSTR(" M203 T"), i , SP_E_STR, VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS_N(i)]) From 9ab654adcb15ba23b42ed1f13ca34130e422dbc2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Jun 2022 22:06:32 -0500 Subject: [PATCH 335/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20min/max=20temp=20e?= =?UTF-8?q?valuation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #24257 --- Marlin/src/module/temperature.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index b9d24963b8e4..7c49f857489a 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -2388,13 +2388,15 @@ void Temperature::init() { #if HAS_HOTEND #define _TEMP_MIN_E(NR) do{ \ - const celsius_t tmin = _MAX(HEATER_##NR##_MINTEMP, TERN(TEMP_SENSOR_##NR##_IS_CUSTOM, 0, (int)pgm_read_word(&TEMPTABLE_##NR [TEMP_SENSOR_##NR##_MINTEMP_IND].celsius))); \ + const celsius_t tmin_tmp = TERN(TEMP_SENSOR_##NR##_IS_CUSTOM, 0, int16_t(pgm_read_word(&TEMPTABLE_##NR [TEMP_SENSOR_##NR##_MINTEMP_IND].celsius))), \ + tmin = _MAX(HEATER_##NR##_MINTEMP, tmin_tmp); \ temp_range[NR].mintemp = tmin; \ while (analog_to_celsius_hotend(temp_range[NR].raw_min, NR) < tmin) \ temp_range[NR].raw_min += TEMPDIR(NR) * (OVERSAMPLENR); \ }while(0) #define _TEMP_MAX_E(NR) do{ \ - const celsius_t tmax = _MIN(HEATER_##NR##_MAXTEMP, TERN(TEMP_SENSOR_##NR##_IS_CUSTOM, 2000, (int)pgm_read_word(&TEMPTABLE_##NR [TEMP_SENSOR_##NR##_MAXTEMP_IND].celsius) - 1)); \ + const celsius_t tmax_tmp = TERN(TEMP_SENSOR_##NR##_IS_CUSTOM, 2000, int16_t(pgm_read_word(&TEMPTABLE_##NR [TEMP_SENSOR_##NR##_MAXTEMP_IND].celsius)) - 1), \ + tmax = _MIN(HEATER_##NR##_MAXTEMP, tmax_tmp); \ temp_range[NR].maxtemp = tmax; \ while (analog_to_celsius_hotend(temp_range[NR].raw_max, NR) > tmax) \ temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \ From 8eccfd4a6f90da93a4f13b8aa7fbd88a1f8cca46 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 May 2022 23:35:38 -0500 Subject: [PATCH 336/502] =?UTF-8?q?=F0=9F=94=A7=20Bed/Chamber=20PID=20Auto?= =?UTF-8?q?tune=20menus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Derived from MarlinFirmware/Marlin#23983 --- Marlin/Configuration.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index a8713da860ae..b2606f085cac 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -598,8 +598,6 @@ #define PID_K1 0.95 // Smoothing factor within any PID loop #if ENABLED(PIDTEMP) - //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) - //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) // Set/get with gcode: M301 E[extruder number, 0-2] @@ -708,6 +706,9 @@ //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of flash) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of flash) #endif // @section extruder From 2086cc9f4e21dfc060c1ff034856ad4e6219f5f8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 May 2022 23:37:40 -0500 Subject: [PATCH 337/502] =?UTF-8?q?=F0=9F=93=9D=20Refer=20to=20'PROGMEM'?= =?UTF-8?q?=20as=20'flash'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- Marlin/Configuration_adv.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b2606f085cac..e66613937da8 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1854,7 +1854,7 @@ * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) */ //#define EEPROM_SETTINGS // Persistent storage with M500 and M501 -//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +//#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release! #define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. #define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load #if ENABLED(EEPROM_SETTINGS) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index a0d84092dfa0..6d55be811893 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1662,11 +1662,11 @@ //#define XYZ_NO_FRAME #define XYZ_HOLLOW_FRAME - // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM. + // A bigger font is available for edit items. Costs 3120 bytes of flash. // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. //#define USE_BIG_EDIT_FONT - // A smaller font may be used on the Info Screen. Costs 2434 bytes of PROGMEM. + // A smaller font may be used on the Info Screen. Costs 2434 bytes of flash. // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. //#define USE_SMALL_INFOFONT @@ -1711,7 +1711,7 @@ //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar - //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of PROGMEM. + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash. // Frivolous Game Options //#define MARLIN_BRICKOUT @@ -2257,7 +2257,7 @@ #define BUFSIZE 4 // Transmission to Host Buffer Size -// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To save 386 bytes of flash (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. // To buffer a simple "ok" you need 4 bytes. // For ADVANCED_OK (M105) you need 32 bytes. // For debug-echo: 128 bytes for the optimal speed. From b2b5b85045e689d311e472d803817e08b49ccaec Mon Sep 17 00:00:00 2001 From: Robert Brenckman Date: Sun, 10 Apr 2022 01:24:07 -0400 Subject: [PATCH 338/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Tool=20Change=20pr?= =?UTF-8?q?iming=20(#21142)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 14 +- Marlin/src/gcode/config/M217.cpp | 40 ++-- Marlin/src/inc/SanityCheck.h | 2 + Marlin/src/lcd/menu/menu_configuration.cpp | 4 +- Marlin/src/module/tool_change.cpp | 225 ++++++++++++++------- Marlin/src/module/tool_change.h | 24 ++- buildroot/tests/BIGTREE_GTR_V1_0 | 2 +- 7 files changed, 199 insertions(+), 112 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6d55be811893..aeb868153d1b 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2442,12 +2442,16 @@ #define TOOLCHANGE_FS_FAN_SPEED 255 // 0-255 #define TOOLCHANGE_FS_FAN_TIME 10 // (seconds) - // Swap uninitialized extruder (using TOOLCHANGE_FS_PRIME_SPEED feedrate) - // (May break filament if not retracted beforehand.) - //#define TOOLCHANGE_FS_INIT_BEFORE_SWAP + // Use TOOLCHANGE_FS_PRIME_SPEED feedrate the first time each extruder is primed + //#define TOOLCHANGE_FS_SLOW_FIRST_PRIME - // Prime on the first T0 (For other tools use TOOLCHANGE_FS_INIT_BEFORE_SWAP) - // Enable with M217 V1 before printing to avoid unwanted priming on host connect + /** + * Prime T0 the first time T0 is sent to the printer: + * [ Power-On -> T0 { Activate & Prime T0 } -> T1 { Retract T0, Activate & Prime T1 } ] + * If disabled, no priming on T0 until switching back to T0 from another extruder: + * [ Power-On -> T0 { T0 Activated } -> T1 { Activate & Prime T1 } -> T0 { Retract T1, Activate & Prime T0 } ] + * Enable with M217 V1 before printing to avoid unwanted priming on host connect. + */ //#define TOOLCHANGE_FS_PRIME_FIRST_USED /** diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index 344adc34e320..80c9cef65c40 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -34,28 +34,28 @@ #include "../../MarlinCore.h" // for SP_X_STR, etc. /** - * M217 - Set SINGLENOZZLE toolchange parameters + * M217 - Set toolchange parameters * * // Tool change command * Q Prime active tool and exit * * // Tool change settings - * S[linear] Swap length - * B[linear] Extra Swap length - * E[linear] Prime length - * P[linear/m] Prime speed - * R[linear/m] Retract speed - * U[linear/m] UnRetract speed - * V[linear] 0/1 Enable auto prime first extruder used - * W[linear] 0/1 Enable park & Z Raise - * X[linear] Park X (Requires TOOLCHANGE_PARK) - * Y[linear] Park Y (Requires TOOLCHANGE_PARK) - * I[linear] Park I (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 4) - * J[linear] Park J (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 5) - * K[linear] Park K (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 6) - * Z[linear] Z Raise - * F[linear] Fan Speed 0-255 - * G[linear/s] Fan time + * S[linear] Swap length + * B[linear] Extra Swap resume length + * E[linear] Extra Prime length (as used by M217 Q) + * P[linear/min] Prime speed + * R[linear/min] Retract speed + * U[linear/min] UnRetract speed + * V[linear] 0/1 Enable auto prime first extruder used + * W[linear] 0/1 Enable park & Z Raise + * X[linear] Park X (Requires TOOLCHANGE_PARK) + * Y[linear] Park Y (Requires TOOLCHANGE_PARK) + * I[linear] Park I (Requires TOOLCHANGE_PARK and NUM_AXES >= 4) + * J[linear] Park J (Requires TOOLCHANGE_PARK and NUM_AXES >= 5) + * K[linear] Park K (Requires TOOLCHANGE_PARK and NUM_AXES >= 6) + * Z[linear] Z Raise + * F[speed] Fan Speed 0-255 + * D[seconds] Fan time * * Tool migration settings * A[0|1] Enable auto-migration on runout @@ -79,8 +79,8 @@ void GcodeSuite::M217() { if (parser.seenval('R')) { const int16_t v = parser.value_linear_units(); toolchange_settings.retract_speed = constrain(v, 10, 5400); } if (parser.seenval('U')) { const int16_t v = parser.value_linear_units(); toolchange_settings.unretract_speed = constrain(v, 10, 5400); } #if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN - if (parser.seenval('F')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_speed = constrain(v, 0, 255); } - if (parser.seenval('G')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_time = constrain(v, 1, 30); } + if (parser.seenval('F')) { const uint16_t v = parser.value_ushort(); toolchange_settings.fan_speed = constrain(v, 0, 255); } + if (parser.seenval('D')) { const uint16_t v = parser.value_ushort(); toolchange_settings.fan_time = constrain(v, 1, 30); } #endif #endif @@ -159,7 +159,7 @@ void GcodeSuite::M217_report(const bool forReplay/*=true*/) { SERIAL_ECHOPGM(" R", LINEAR_UNIT(toolchange_settings.retract_speed), " U", LINEAR_UNIT(toolchange_settings.unretract_speed), " F", toolchange_settings.fan_speed, - " G", toolchange_settings.fan_time); + " D", toolchange_settings.fan_time); #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) SERIAL_ECHOPGM(" A", migration.automode); diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index db4c332e810d..606675cc0acd 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -390,6 +390,8 @@ #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]." #elif defined(RETRACT_ZLIFT) #error "RETRACT_ZLIFT is now RETRACT_ZRAISE." +#elif defined(TOOLCHANGE_FS_INIT_BEFORE_SWAP) + #error "TOOLCHANGE_FS_INIT_BEFORE_SWAP is now TOOLCHANGE_FS_SLOW_FIRST_PRIME." #elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT) #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE." #elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE) diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 0f92ef8bd5f7..62fea30427ed 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -124,8 +124,8 @@ void menu_advanced_settings(); EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_UNRETRACT_SPEED, &toolchange_settings.unretract_speed, 10, 5400); EDIT_ITEM(float3, MSG_FILAMENT_PURGE_LENGTH, &toolchange_settings.extra_prime, 0, max_extrude); EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_PRIME_SPEED, &toolchange_settings.prime_speed, 10, 5400); - EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_FAN_SPEED, &toolchange_settings.fan_speed, 0, 255); - EDIT_ITEM_FAST(int4, MSG_SINGLENOZZLE_FAN_TIME, &toolchange_settings.fan_time, 1, 30); + EDIT_ITEM_FAST(uint8, MSG_SINGLENOZZLE_FAN_SPEED, &toolchange_settings.fan_speed, 0, 255); + EDIT_ITEM_FAST(uint8, MSG_SINGLENOZZLE_FAN_TIME, &toolchange_settings.fan_time, 1, 30); #endif EDIT_ITEM(float3, MSG_TOOL_CHANGE_ZLIFT, &toolchange_settings.z_raise, 0, 10); END_MENU(); diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 0142428bc3e0..eda4d97d4e9f 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -32,6 +32,7 @@ #include "../MarlinCore.h" //#define DEBUG_TOOL_CHANGE +//#define DEBUG_TOOLCHANGE_FILAMENT_SWAP #define DEBUG_OUT ENABLED(DEBUG_TOOL_CHANGE) #include "../core/debug_out.h" @@ -42,7 +43,6 @@ #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) migration_settings_t migration = migration_defaults; - bool enable_first_prime; #endif #if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP) @@ -150,6 +150,7 @@ #endif // SWITCHING_NOZZLE +// Move to position routines void _line_to_current(const AxisEnum fr_axis, const float fscale=1) { line_to_current_position(planner.settings.max_feedrate_mm_s[fr_axis] * fscale); } @@ -899,10 +900,135 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. */ #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #ifdef DEBUG_TOOLCHANGE_FILAMENT_SWAP + #define FS_DEBUG(V...) SERIAL_ECHOLNPGM("DEBUG: " V) + #else + #define FS_DEBUG(...) NOOP + #endif + + // Define any variables required + static Flags extruder_was_primed; // Extruders primed status + + #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED) + bool enable_first_prime; // As set by M217 V + #endif + + // Cool down with fan + inline void filament_swap_cooling() { + #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 + thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed; + gcode.dwell(SEC_TO_MS(toolchange_settings.fan_time)); + thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0; + #endif + } + + /** + * Check if too cold to move the specified tool + * + * Returns TRUE if too cold to move (also echos message: STR_ERR_HOTEND_TOO_COLD) + * Returns FALSE if able to move. + */ + bool too_cold(uint8_t toolID){ + if (TERN0(PREVENT_COLD_EXTRUSION, !DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(toolID))) { + SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD); + return true; + } + return false; + } + + /** + * Cutting recovery -- Recover from cutting retraction that occurs at the end of nozzle priming + * + * If the active_extruder is up to temp (!too_cold): + * Extrude filament distance = toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT + * current_position.e = e; + * sync_plan_position_e(); + */ + void extruder_cutting_recover(const_float_t e) { + if (!too_cold(active_extruder)) { + const float dist = toolchange_settings.extra_resume + (TOOLCHANGE_FS_WIPE_RETRACT); + FS_DEBUG("Performing Cutting Recover | Distance: ", dist, " | Speed: ", MMM_TO_MMS(toolchange_settings.unretract_speed), "mm/s"); + unscaled_e_move(dist, MMM_TO_MMS(toolchange_settings.unretract_speed)); + planner.synchronize(); + FS_DEBUG("Set position to: ", e); + current_position.e = e; + sync_plan_position_e(); // Resume new E Position + } + } + + /** + * Prime the currently selected extruder (Filament loading only) + * + * If too_cold(toolID) returns TRUE -> returns without moving extruder. + * Extruders filament = swap_length + extra prime, then performs cutting retraction if enabled. + * If cooling fan is enabled, calls filament_swap_cooling(); + */ + void extruder_prime() { + + if (too_cold(active_extruder)) { + FS_DEBUG("Priming Aborted - Nozzle Too Cold!"); + return; // Extruder too cold to prime + } + + float fr = toolchange_settings.unretract_speed; // Set default speed for unretract + + #if ENABLED(TOOLCHANGE_FS_SLOW_FIRST_PRIME) + /* + * Perform first unretract movement at the slower Prime_Speed to avoid breakage on first prime + */ + static Flags extruder_did_first_prime; // Extruders first priming status + if (!extruder_did_first_prime[active_extruder]) { + extruder_did_first_prime.set(active_extruder); // Log first prime complete + // new nozzle - prime at user-specified speed. + FS_DEBUG("First time priming T", active_extruder, ", reducing speed from ", MMM_TO_MMS(fr), " to ", MMM_TO_MMS(toolchange_settings.prime_speed), "mm/s"); + fr = toolchange_settings.prime_speed; + unscaled_e_move(0, MMM_TO_MMS(fr)); // Init planner with 0 length move + } + #endif + + //Calculate and perform the priming distance + if (toolchange_settings.extra_prime >= 0) { + // Positive extra_prime value + // - Return filament at speed (fr) then extra_prime at prime speed + FS_DEBUG("Loading Filament for T", active_extruder, " | Distance: ", toolchange_settings.swap_length, " | Speed: ", MMM_TO_MMS(fr), "mm/s"); + unscaled_e_move(toolchange_settings.swap_length, MMM_TO_MMS(fr)); // Prime (Unretract) filament by extruding equal to Swap Length (Unretract) + + if (toolchange_settings.extra_prime > 0) { + FS_DEBUG("Performing Extra Priming for T", active_extruder, " | Distance: ", toolchange_settings.extra_prime, " | Speed: ", MMM_TO_MMS(toolchange_settings.prime_speed), "mm/s"); + unscaled_e_move(toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed)); // Extra Prime Distance + } + } + else { + // Negative extra_prime value + // - Unretract distance (swap length) is reduced by the value of extra_prime + const float eswap = toolchange_settings.swap_length + toolchange_settings.extra_prime; + FS_DEBUG("Negative ExtraPrime value - Swap Return Length has been reduced from ", toolchange_settings.swap_length, " to ", eswap); + FS_DEBUG("Loading Filament for T", active_extruder, " | Distance: ", eswap, " | Speed: ", MMM_TO_MMS(fr), "mm/s"); + unscaled_e_move(eswap, MMM_TO_MMS(fr)); + } + + extruder_was_primed.set(active_extruder); // Log that this extruder has been primed + + // Cutting retraction + #if TOOLCHANGE_FS_WIPE_RETRACT + FS_DEBUG("Performing Cutting Retraction | Distance: ", -(TOOLCHANGE_FS_WIPE_RETRACT), " | Speed: ", MMM_TO_MMS(toolchange_settings.retract_speed), "mm/s"); + unscaled_e_move(-(TOOLCHANGE_FS_WIPE_RETRACT), MMM_TO_MMS(toolchange_settings.retract_speed)); + #endif + + // Cool down with fan + filament_swap_cooling(); + + } + + /** + * Sequence to Prime the currently selected extruder + * Raise Z, move the ToolChange_Park if enabled, prime the extruder, move back. + */ void tool_change_prime() { - if (toolchange_settings.extra_prime > 0 - && TERN(PREVENT_COLD_EXTRUSION, !thermalManager.targetTooColdToExtrude(active_extruder), 1) - ) { + + FS_DEBUG(">>> tool_change_prime()"); + + if (!too_cold(active_extruder)) { destination = current_position; // Remember the old position const bool ok = TERN1(TOOLCHANGE_PARK, all_axes_homed() && toolchange_settings.enable_park); @@ -931,20 +1057,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. } #endif - // Prime (All distances are added and slowed down to ensure secure priming in all circumstances) - unscaled_e_move(toolchange_settings.swap_length + toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed)); - - // Cutting retraction - #if TOOLCHANGE_FS_WIPE_RETRACT - unscaled_e_move(-(TOOLCHANGE_FS_WIPE_RETRACT), MMM_TO_MMS(toolchange_settings.retract_speed)); - #endif - - // Cool down with fan - #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 - thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed; - gcode.dwell(SEC_TO_MS(toolchange_settings.fan_time)); - thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0; - #endif + extruder_prime(); // Move back #if ENABLED(TOOLCHANGE_PARK) @@ -958,13 +1071,11 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. } #endif - // Cutting recover - unscaled_e_move(toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT, MMM_TO_MMS(toolchange_settings.unretract_speed)); - - // Resume at the old E position - current_position.e = destination.e; - sync_plan_position_e(); + extruder_cutting_recover(destination.e); // Cutting recover } + + FS_DEBUG("<<< tool_change_prime"); + } #endif // TOOLCHANGE_FILAMENT_SWAP @@ -1041,12 +1152,10 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { TEMPORARY_BED_LEVELING_STATE(false); #endif - // First tool priming. To prime again, reboot the machine. + // First tool priming. To prime again, reboot the machine. -- Should only occur for first T0 after powerup! #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED) - static bool first_tool_is_primed = false; - if (new_tool == old_tool && !first_tool_is_primed && enable_first_prime) { + if (enable_first_prime && old_tool == 0 && new_tool == 0 && !extruder_was_primed[0]) { tool_change_prime(); - first_tool_is_primed = true; TERN_(TOOLCHANGE_FS_INIT_BEFORE_SWAP, toolchange_extruder_ready.set(old_tool)); // Primed and initialized } #endif @@ -1072,20 +1181,17 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { // Unload / Retract #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - const bool should_swap = can_move_away && toolchange_settings.swap_length, - too_cold = TERN0(PREVENT_COLD_EXTRUSION, - !DEBUGGING(DRYRUN) && (thermalManager.targetTooColdToExtrude(old_tool) || thermalManager.targetTooColdToExtrude(new_tool)) - ); + const bool should_swap = can_move_away && toolchange_settings.swap_length; if (should_swap) { - if (too_cold) { - SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD); + if (too_cold(old_tool)) { + // If SingleNozzle setup is too cold, unable to perform tool_change. if (ENABLED(SINGLENOZZLE)) { active_extruder = new_tool; return; } } - else { - // For first new tool, change without unloading the old. 'Just prime/init the new' - if (TERN1(TOOLCHANGE_FS_PRIME_FIRST_USED, first_tool_is_primed)) - unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed)); - TERN_(TOOLCHANGE_FS_PRIME_FIRST_USED, first_tool_is_primed = true); // The first new tool will be primed by toolchanging + else if (extruder_was_primed[old_tool]) { + // Retract the old extruder if it was previously primed + // To-Do: Should SingleNozzle always retract? + FS_DEBUG("Retracting Filament for T", old_tool, ". | Distance: ", toolchange_settings.swap_length, " | Speed: ", MMM_TO_MMS(toolchange_settings.retract_speed), "mm/s"); + unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed)); } } #endif @@ -1190,36 +1296,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #endif #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - if (should_swap && !too_cold) { - - float fr = toolchange_settings.unretract_speed; - - #if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP) - if (!toolchange_extruder_ready[new_tool]) { - toolchange_extruder_ready.set(new_tool); - fr = toolchange_settings.prime_speed; // Next move is a prime - unscaled_e_move(0, MMM_TO_MMS(fr)); // Init planner with 0 length move - } - #endif - - // Unretract (or Prime) - unscaled_e_move(toolchange_settings.swap_length, MMM_TO_MMS(fr)); - - // Extra Prime - unscaled_e_move(toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed)); - - // Cutting retraction - #if TOOLCHANGE_FS_WIPE_RETRACT - unscaled_e_move(-(TOOLCHANGE_FS_WIPE_RETRACT), MMM_TO_MMS(toolchange_settings.retract_speed)); - #endif - - // Cool down with fan - #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 - thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed; - gcode.dwell(SEC_TO_MS(toolchange_settings.fan_time)); - thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0; - #endif - } + if (should_swap && !too_cold(active_extruder)) + extruder_prime(); // Prime selected Extruder #endif // Prevent a move outside physical bounds @@ -1260,11 +1338,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { else DEBUG_ECHOLNPGM("Move back skipped"); #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - if (should_swap && !too_cold) { - // Cutting recover - unscaled_e_move(toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT, MMM_TO_MMS(toolchange_settings.unretract_speed)); - current_position.e = 0; - sync_plan_position_e(); // New extruder primed and set to 0 + if (should_swap && !too_cold(active_extruder)) { + extruder_cutting_recover(0); // New extruder primed and set to 0 // Restart Fan #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0 @@ -1322,7 +1397,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #endif } - SERIAL_ECHO_MSG(STR_ACTIVE_EXTRUDER, active_extruder); + SERIAL_ECHOLNPGM(STR_ACTIVE_EXTRUDER, active_extruder); #endif // HAS_MULTI_EXTRUDER } diff --git a/Marlin/src/module/tool_change.h b/Marlin/src/module/tool_change.h index 73798265edfd..48af9405fd7d 100644 --- a/Marlin/src/module/tool_change.h +++ b/Marlin/src/module/tool_change.h @@ -29,24 +29,30 @@ typedef struct { #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - float swap_length, extra_prime, extra_resume; - int16_t prime_speed, retract_speed, unretract_speed, fan, fan_speed, fan_time; + float swap_length; // M217 S + float extra_prime; // M217 E + float extra_resume; // M217 B + int16_t prime_speed; // M217 P + int16_t retract_speed; // M217 R + int16_t unretract_speed; // M217 U + uint8_t fan_speed; // M217 F + uint8_t fan_time; // M217 D #endif #if ENABLED(TOOLCHANGE_PARK) - bool enable_park; - xy_pos_t change_point; + bool enable_park; // M217 W + xyz_pos_t change_point; // M217 X Y I J K #endif - float z_raise; + float z_raise; // M217 Z } toolchange_settings_t; extern toolchange_settings_t toolchange_settings; - #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - void tool_change_prime(); + #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED) + extern bool enable_first_prime; // M217 V #endif - #if ENABLED(TOOLCHANGE_FS_PRIME_FIRST_USED) - extern bool enable_first_prime; + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + void tool_change_prime(); // Prime the currently selected extruder #endif #if ENABLED(TOOLCHANGE_FS_INIT_BEFORE_SWAP) diff --git a/buildroot/tests/BIGTREE_GTR_V1_0 b/buildroot/tests/BIGTREE_GTR_V1_0 index 4f1a4a690a9c..919822733b00 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0 +++ b/buildroot/tests/BIGTREE_GTR_V1_0 @@ -24,7 +24,7 @@ opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \ EXTRUDERS 5 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 \ NUM_Z_STEPPER_DRIVERS 4 \ DEFAULT_Kp_LIST '{ 22.2, 20.0, 21.0, 19.0, 18.0 }' DEFAULT_Ki_LIST '{ 1.08 }' DEFAULT_Kd_LIST '{ 114.0, 112.0, 110.0, 108.0 }' -opt_enable TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_MIGRATION_FEATURE TOOLCHANGE_FS_INIT_BEFORE_SWAP TOOLCHANGE_FS_PRIME_FIRST_USED \ +opt_enable TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_MIGRATION_FEATURE TOOLCHANGE_FS_SLOW_FIRST_PRIME TOOLCHANGE_FS_PRIME_FIRST_USED \ PID_PARAMS_PER_HOTEND Z_MULTI_ENDSTOPS exec_test $1 $2 "BigTreeTech GTR | 6 Extruders | Quad Z + Endstops" "$3" From 3443a9e18bf2c9797037f141d68ab409d6b3c00b Mon Sep 17 00:00:00 2001 From: Pauli Jokela Date: Thu, 12 May 2022 05:23:16 +0300 Subject: [PATCH 339/502] =?UTF-8?q?=E2=9C=A8=20SOUND=5FON=5FDEFAULT=20opti?= =?UTF-8?q?on=20(#24102)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 1 + Marlin/src/MarlinCore.cpp | 6 ++-- Marlin/src/feature/spindle_laser.h | 4 +-- Marlin/src/inc/Conditionals_post.h | 4 +-- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 2 +- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 2 +- Marlin/src/lcd/e3v2/common/encoder.cpp | 6 +--- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 10 +++---- Marlin/src/lcd/e3v2/proui/dwin.cpp | 4 +-- .../src/lcd/extui/anycubic_chiron/Tunes.cpp | 9 +++--- .../extui/anycubic_i3mega/anycubic_extui.cpp | 4 +-- Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp | 9 ++---- Marlin/src/lcd/marlinui.cpp | 15 +++++----- Marlin/src/lcd/marlinui.h | 20 ++++++------- Marlin/src/lcd/menu/menu_bed_corners.cpp | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- Marlin/src/lcd/tft/ui_1024x600.cpp | 2 +- Marlin/src/lcd/tft/ui_320x240.cpp | 2 +- Marlin/src/lcd/tft/ui_480x320.cpp | 2 +- Marlin/src/libs/buzzer.cpp | 8 ++--- Marlin/src/libs/buzzer.h | 30 ++++++++++--------- Marlin/src/module/settings.cpp | 12 ++++---- Marlin/src/module/temperature.cpp | 14 ++++----- 23 files changed, 79 insertions(+), 91 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index aeb868153d1b..ce6e58834acb 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1321,6 +1321,7 @@ #if ANY(HAS_DISPLAY, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) //#define SOUND_MENU_ITEM // Add a mute option to the LCD menu + #define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state #endif #if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 72c9a1392c1c..234bed1eed8e 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -97,7 +97,7 @@ #include "feature/host_actions.h" #endif -#if USE_BEEPER +#if HAS_BEEPER #include "libs/buzzer.h" #endif @@ -824,7 +824,7 @@ void idle(bool no_stepper_sleep/*=false*/) { TERN_(PRINTCOUNTER, print_job_timer.tick()); // Update the Beeper queue - TERN_(USE_BEEPER, buzzer.tick()); + TERN_(HAS_BEEPER, buzzer.tick()); // Handle UI input / draw events TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update()); @@ -1275,7 +1275,7 @@ void setup() { calibrate_delay_loop(); // Init buzzer pin(s) - #if USE_BEEPER + #if HAS_BEEPER SETUP_RUN(buzzer.init()); #endif diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index e948d2d37b73..1f9bec7bf0f9 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -30,7 +30,7 @@ #include "spindle_laser_types.h" -#if USE_BEEPER +#if HAS_BEEPER #include "../libs/buzzer.h" #endif @@ -272,7 +272,7 @@ class SpindleLaser { * If not set defaults to 80% power */ static void test_fire_pulse() { - TERN_(USE_BEEPER, buzzer.tone(30, 3000)); + TERN_(HAS_BEEPER, buzzer.tone(30, 3000)); enable_forward(); // Turn Laser on (Spindle speak but same funct) delay(testPulse); // Delay for time set by user in pulse ms menu screen. disable(); // Turn laser off diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index c311790a9f81..0095042c1da0 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -3301,9 +3301,9 @@ * Buzzer/Speaker */ #if PIN_EXISTS(BEEPER) - #define USE_BEEPER 1 + #define HAS_BEEPER 1 #endif -#if USE_BEEPER || ANY(LCD_USE_I2C_BUZZER, PCA9632_BUZZER) +#if ANY(HAS_BEEPER, LCD_USE_I2C_BUZZER, PCA9632_BUZZER) #define HAS_BUZZER 1 #endif diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 569ba31d0570..6c6ff4737793 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -121,7 +121,7 @@ static void createChar_P(const char c, const byte * const ptr) { #if ENABLED(LCD_USE_I2C_BUZZER) void MarlinUI::buzz(const long duration, const uint16_t freq) { - if (!buzzer_enabled) return; + if (!sound_on) return; lcd.buzz(duration, freq); } #endif diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index cb278ffa1077..5e418e2fe3fd 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -301,7 +301,7 @@ uint8_t MarlinUI::read_slow_buttons() { // Duration in ms, freq in Hz void MarlinUI::buzz(const long duration, const uint16_t freq) { if (!PanelDetected) return; - if (!buzzer_enabled) return; + if (!sound_on) return; #if ENABLED(TFTGLCD_PANEL_SPI) WRITE(TFTGLCD_CS, LOW); SPI_SEND_ONE(BUZZER); diff --git a/Marlin/src/lcd/e3v2/common/encoder.cpp b/Marlin/src/lcd/e3v2/common/encoder.cpp index edfaf60aae1e..9922b70b29df 100644 --- a/Marlin/src/lcd/e3v2/common/encoder.cpp +++ b/Marlin/src/lcd/e3v2/common/encoder.cpp @@ -51,11 +51,7 @@ ENCODER_Rate EncoderRate; // TODO: Replace with ui.quick_feedback void Encoder_tick() { #if PIN_EXISTS(BEEPER) - if (ui.buzzer_enabled) { - WRITE(BEEPER_PIN, HIGH); - delay(10); - WRITE(BEEPER_PIN, LOW); - } + if (ui.sound_on) buzzer.click(10); #endif } diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index a226b5d51aa6..bd88cf5861e2 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -2585,11 +2585,11 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ case ADVANCED_BEEPER: if (draw) { Draw_Menu_Item(row, ICON_Version, F("LCD Beeper")); - Draw_Checkbox(row, ui.buzzer_enabled); + Draw_Checkbox(row, ui.sound_on); } else { - ui.buzzer_enabled = !ui.buzzer_enabled; - Draw_Checkbox(row, ui.buzzer_enabled); + ui.sound_on = !ui.sound_on; + Draw_Checkbox(row, ui.sound_on); } break; #endif @@ -4600,7 +4600,7 @@ void CrealityDWINClass::Screen_Update() { } void CrealityDWINClass::AudioFeedback(const bool success/*=true*/) { - if (ui.buzzer_enabled) + if (ui.sound_on) DONE_BUZZ(success); else Update_Status(success ? "Success" : "Failed"); @@ -4644,7 +4644,7 @@ void CrealityDWINClass::Reset_Settings() { eeprom_settings.coordinates_split_line = 0; TERN_(AUTO_BED_LEVELING_UBL, mesh_conf.tilt_grid = eeprom_settings.tilt_grid_size + 1); corner_pos = eeprom_settings.corner_pos / 10.0f; - TERN_(SOUND_MENU_ITEM, ui.buzzer_enabled = true); + TERN_(SOUND_MENU_ITEM, ui.sound_on = ENABLED(SOUND_ON_DEFAULT)); Redraw_Screen(); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index e9d9ce86d619..122136c1a082 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -2155,8 +2155,8 @@ void SetPID(celsius_t t, heater_id_t h) { #if ENABLED(SOUND_MENU_ITEM) void SetEnableSound() { - ui.buzzer_enabled = !ui.buzzer_enabled; - Draw_Chkb_Line(CurrentMenu->line(), ui.buzzer_enabled); + ui.sound_on = !ui.sound_on; + Draw_Chkb_Line(CurrentMenu->line(), ui.sound_on); DWIN_UpdateLCD(); } #endif diff --git a/Marlin/src/lcd/extui/anycubic_chiron/Tunes.cpp b/Marlin/src/lcd/extui/anycubic_chiron/Tunes.cpp index f228c471c9ca..adbf98e3bb82 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/Tunes.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/Tunes.cpp @@ -35,6 +35,8 @@ #include "../../../inc/MarlinConfigPre.h" +// TODO: Use Marlin's built-in tone player instead. + #if ENABLED(ANYCUBIC_LCD_CHIRON) #include "Tunes.h" @@ -44,15 +46,12 @@ namespace Anycubic { void PlayTune(uint8_t beeperPin, const uint16_t *tune, uint8_t speed=1) { uint8_t pos = 1; - uint16_t wholenotelen = tune[0] / speed; + const uint16_t wholenotelen = tune[0] / speed; do { - uint16_t freq = tune[pos]; - uint16_t notelen = wholenotelen / tune[pos + 1]; - + const uint16_t freq = tune[pos], notelen = wholenotelen / tune[pos + 1]; ::tone(beeperPin, freq, notelen); ExtUI::delay_ms(notelen); pos += 2; - if (pos >= MAX_TUNE_LENGTH) break; } while (tune[pos] != n_END); } diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp index 469202ee222b..40a670b5b073 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp @@ -42,9 +42,7 @@ namespace ExtUI { void onMediaError() { AnycubicTFT.OnSDCardError(); } void onMediaRemoved() { AnycubicTFT.OnSDCardStateChange(false); } void onPlayTone(const uint16_t frequency, const uint16_t duration) { - #if ENABLED(SPEAKER) - ::tone(BEEPER_PIN, frequency, duration); - #endif + TERN_(SPEAKER, ::tone(BEEPER_PIN, frequency, duration)); } void onPrintTimerStarted() { AnycubicTFT.OnPrintTimerStarted(); } void onPrintTimerPaused() { AnycubicTFT.OnPrintTimerPaused(); } diff --git a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp index a14fa4d1dfb2..c679751ebe90 100644 --- a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp +++ b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp @@ -160,6 +160,8 @@ #endif } + #include "../../../libs/buzzer.h" + void init_test_gpio() { endstops.init(); @@ -201,12 +203,7 @@ #endif } - void mks_test_beeper() { - WRITE(BEEPER_PIN, HIGH); - delay(100); - WRITE(BEEPER_PIN, LOW); - delay(100); - } + void mks_test_beeper() { buzzer.click(100); } #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index a2fde96a6f52..5a850350828e 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -118,19 +118,18 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif #if ENABLED(SOUND_MENU_ITEM) - bool MarlinUI::buzzer_enabled = true; + bool MarlinUI::sound_on = ENABLED(SOUND_ON_DEFAULT); #endif -#if EITHER(PCA9632_BUZZER, USE_BEEPER) - #include "../libs/buzzer.h" // for BUZZ() macro +#if EITHER(PCA9632_BUZZER, HAS_BEEPER) #if ENABLED(PCA9632_BUZZER) #include "../feature/leds/pca9632.h" #endif void MarlinUI::buzz(const long duration, const uint16_t freq) { - if (!buzzer_enabled) return; + if (!sound_on) return; #if ENABLED(PCA9632_BUZZER) PCA9632_buzz(duration, freq); - #elif USE_BEEPER + #elif HAS_BEEPER buzzer.tone(duration, freq); #endif } @@ -685,7 +684,7 @@ void MarlinUI::init() { const millis_t ms = millis(); #endif if (ELAPSED(ms, next_beep)) { - buzz(FEEDRATE_CHANGE_BEEP_DURATION, FEEDRATE_CHANGE_BEEP_FREQUENCY); + BUZZ(FEEDRATE_CHANGE_BEEP_DURATION, FEEDRATE_CHANGE_BEEP_FREQUENCY); next_beep = ms + 500UL; } #endif @@ -739,7 +738,7 @@ void MarlinUI::init() { #if HAS_CHIRP chirp(); // Buzz and wait. Is the delay needed for buttons to settle? - #if BOTH(HAS_MARLINUI_MENU, USE_BEEPER) + #if BOTH(HAS_MARLINUI_MENU, HAS_BEEPER) for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } #elif HAS_MARLINUI_MENU delay(10); @@ -1632,7 +1631,7 @@ void MarlinUI::init() { void MarlinUI::flow_fault() { LCD_ALERTMESSAGE(MSG_FLOWMETER_FAULT); - TERN_(HAS_BUZZER, buzz(1000, 440)); + BUZZ(1000, 440); TERN_(HAS_MARLINUI_MENU, return_to_status()); } diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index b9c4e72371b4..36891b201eae 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -21,15 +21,12 @@ */ #pragma once +#include "../inc/MarlinConfig.h" #include "../sd/cardreader.h" #include "../module/motion.h" -#include "buttons.h" +#include "../libs/buzzer.h" -#include "../inc/MarlinConfig.h" - -#if HAS_BUZZER - #include "../libs/buzzer.h" -#endif +#include "buttons.h" #if ENABLED(TOUCH_SCREEN_CALIBRATION) #include "tft_io/touch_calibration.h" @@ -192,6 +189,9 @@ typedef bool (*statusResetFunc_t)(); //////////// MarlinUI Singleton //////////// //////////////////////////////////////////// +class MarlinUI; +extern MarlinUI ui; + class MarlinUI { public: @@ -225,9 +225,9 @@ class MarlinUI { #endif #if ENABLED(SOUND_MENU_ITEM) - static bool buzzer_enabled; // Initialized by settings.load() + static bool sound_on; // Initialized by settings.load() #else - static constexpr bool buzzer_enabled = true; + static constexpr bool sound_on = true; #endif #if HAS_BUZZER @@ -235,7 +235,7 @@ class MarlinUI { #endif FORCE_INLINE static void chirp() { - TERN_(HAS_CHIRP, buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ)); + TERN_(HAS_CHIRP, TERN(HAS_BUZZER, buzz, BUZZ)(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ)); } #if ENABLED(LCD_HAS_STATUS_INDICATORS) @@ -778,8 +778,6 @@ class MarlinUI { #endif }; -extern MarlinUI ui; - #define LCD_MESSAGE_F(S) ui.set_status(F(S)) #define LCD_MESSAGE(M) ui.set_status(GET_TEXT_F(M)) #define LCD_ALERTMESSAGE_F(S) ui.set_alert_status(F(S)) diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index e3f5c460ed24..163a2a751a34 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -247,7 +247,7 @@ static void _lcd_level_bed_corners_get_next_position() { probe_triggered = PROBE_TRIGGERED(); if (probe_triggered) { endstops.hit_on_purpose(); - TERN_(LEVEL_CORNERS_AUDIO_FEEDBACK, ui.buzz(200, 600)); + TERN_(LEVEL_CORNERS_AUDIO_FEEDBACK, BUZZ(200, 600)); } idle(); } diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 62fea30427ed..034484a14830 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -574,7 +574,7 @@ void menu_configuration() { #endif #if ENABLED(SOUND_MENU_ITEM) - EDIT_ITEM(bool, MSG_SOUND, &ui.buzzer_enabled, []{ ui.chirp(); }); + EDIT_ITEM(bool, MSG_SOUND, &ui.sound_on, []{ ui.chirp(); }); #endif #if ENABLED(EEPROM_SETTINGS) diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 60116f7afe1a..3fbb26b69ddf 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -596,7 +596,7 @@ MotionAxisState motionAxisState; static void quick_feedback() { #if HAS_CHIRP ui.chirp(); // Buzz and wait. Is the delay needed for buttons to settle? - #if BOTH(HAS_MARLINUI_MENU, USE_BEEPER) + #if BOTH(HAS_MARLINUI_MENU, HAS_BEEPER) for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } #elif HAS_MARLINUI_MENU delay(10); diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index e0ed060e10c5..b1a781fad10a 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -578,7 +578,7 @@ MotionAxisState motionAxisState; static void quick_feedback() { #if HAS_CHIRP ui.chirp(); // Buzz and wait. Is the delay needed for buttons to settle? - #if BOTH(HAS_MARLINUI_MENU, USE_BEEPER) + #if BOTH(HAS_MARLINUI_MENU, HAS_BEEPER) for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } #elif HAS_MARLINUI_MENU delay(10); diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 5d17848aae9c..6f7327f1e8a2 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -583,7 +583,7 @@ MotionAxisState motionAxisState; static void quick_feedback() { #if HAS_CHIRP ui.chirp(); // Buzz and wait. Is the delay needed for buttons to settle? - #if BOTH(HAS_MARLINUI_MENU, USE_BEEPER) + #if BOTH(HAS_MARLINUI_MENU, HAS_BEEPER) for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } #elif HAS_MARLINUI_MENU delay(10); diff --git a/Marlin/src/libs/buzzer.cpp b/Marlin/src/libs/buzzer.cpp index 57ed5fb41910..a3c838ebc0a3 100644 --- a/Marlin/src/libs/buzzer.cpp +++ b/Marlin/src/libs/buzzer.cpp @@ -22,7 +22,7 @@ #include "../inc/MarlinConfig.h" -#if USE_BEEPER +#if HAS_BEEPER #include "buzzer.h" #include "../module/temperature.h" @@ -45,7 +45,7 @@ Buzzer buzzer; * @param frequency Frequency of the tone in hertz */ void Buzzer::tone(const uint16_t duration, const uint16_t frequency/*=0*/) { - if (!ui.buzzer_enabled) return; + if (!ui.sound_on) return; while (buffer.isFull()) { tick(); thermalManager.manage_heater(); @@ -55,7 +55,7 @@ void Buzzer::tone(const uint16_t duration, const uint16_t frequency/*=0*/) { } void Buzzer::tick() { - if (!ui.buzzer_enabled) return; + if (!ui.sound_on) return; const millis_t now = millis(); if (!state.endtime) { @@ -81,4 +81,4 @@ void Buzzer::tick() { else if (ELAPSED(now, state.endtime)) reset(); } -#endif // USE_BEEPER +#endif // HAS_BEEPER diff --git a/Marlin/src/libs/buzzer.h b/Marlin/src/libs/buzzer.h index 73406c0591be..b1c286a66222 100644 --- a/Marlin/src/libs/buzzer.h +++ b/Marlin/src/libs/buzzer.h @@ -23,7 +23,7 @@ #include "../inc/MarlinConfig.h" -#if USE_BEEPER +#if HAS_BEEPER #include "circularqueue.h" @@ -61,18 +61,6 @@ */ FORCE_INLINE static void invert() { TOGGLE(BEEPER_PIN); } - /** - * @brief Turn off a digital PIN - * @details Alias of digitalWrite(PIN, LOW) using FastIO - */ - FORCE_INLINE static void off() { WRITE(BEEPER_PIN, LOW); } - - /** - * @brief Turn on a digital PIN - * @details Alias of digitalWrite(PIN, HIGH) using FastIO - */ - FORCE_INLINE static void on() { WRITE(BEEPER_PIN, HIGH); } - /** * @brief Resets the state of the class * @details Brings the class state to a known one. @@ -91,6 +79,20 @@ reset(); } + /** + * @brief Turn on a digital PIN + * @details Alias of digitalWrite(PIN, HIGH) using FastIO + */ + FORCE_INLINE static void on() { WRITE(BEEPER_PIN, HIGH); } + + /** + * @brief Turn off a digital PIN + * @details Alias of digitalWrite(PIN, LOW) using FastIO + */ + FORCE_INLINE static void off() { WRITE(BEEPER_PIN, LOW); } + + static void click(const uint16_t duration) { on(); delay(duration); off(); } + /** * @brief Add a tone to the queue * @details Adds a tone_t structure to the ring buffer, will block IO if the @@ -118,8 +120,8 @@ #elif HAS_BUZZER // Buzz indirectly via the MarlinUI instance - #include "../lcd/marlinui.h" #define BUZZ(d,f) ui.buzz(d,f) + #include "../lcd/marlinui.h" #else diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 4e1ee716c261..982368d13193 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -531,7 +531,7 @@ typedef struct SettingsDataStruct { // Buzzer enable/disable // #if ENABLED(SOUND_MENU_ITEM) - bool buzzer_enabled; + bool sound_on; #endif // @@ -1537,7 +1537,7 @@ void MarlinSettings::postprocess() { // Buzzer enable/disable // #if ENABLED(SOUND_MENU_ITEM) - EEPROM_WRITE(ui.buzzer_enabled); + EEPROM_WRITE(ui.sound_on); #endif // @@ -2479,8 +2479,8 @@ void MarlinSettings::postprocess() { // Buzzer enable/disable // #if ENABLED(SOUND_MENU_ITEM) - _FIELD_TEST(buzzer_enabled); - EEPROM_READ(ui.buzzer_enabled); + _FIELD_TEST(sound_on); + EEPROM_READ(ui.sound_on); #endif // @@ -2858,7 +2858,9 @@ void MarlinSettings::reset() { // // Buzzer enable/disable // - TERN_(SOUND_MENU_ITEM, ui.buzzer_enabled = true); + #if ENABLED(SOUND_MENU_ITEM) + ui.sound_on = ENABLED(SOUND_ON_DEFAULT); + #endif // // Magnetic Parking Extruder diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 7c49f857489a..b538fb0b8b71 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -173,7 +173,7 @@ #include "tool_change.h" #endif -#if USE_BEEPER +#if HAS_BEEPER #include "../libs/buzzer.h" #endif @@ -986,18 +986,14 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) { inline void loud_kill(FSTR_P const lcd_msg, const heater_id_t heater_id) { marlin_state = MF_KILLED; thermalManager.disable_all_heaters(); - #if USE_BEEPER + #if HAS_BEEPER for (uint8_t i = 20; i--;) { - WRITE(BEEPER_PIN, HIGH); - delay(25); watchdog_refresh(); - WRITE(BEEPER_PIN, LOW); - delay(40); - watchdog_refresh(); - delay(40); + buzzer.click(25); + delay(80); watchdog_refresh(); } - WRITE(BEEPER_PIN, HIGH); + buzzer.on(); #endif #if ENABLED(NOZZLE_PARK_FEATURE) if (!homing_needed_error()) { From 21c838cb1b86c3ffd5958c68d82f6c0c25e78dbe Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Fri, 1 Apr 2022 08:14:14 +0100 Subject: [PATCH 340/502] =?UTF-8?q?=E2=9A=97=EF=B8=8F=20Temperature=20Mode?= =?UTF-8?q?l=20Predictive=20Control=20(#23751)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 48 ++- Marlin/src/HAL/ESP32/HAL.cpp | 26 +- Marlin/src/gcode/gcode.cpp | 4 + Marlin/src/gcode/gcode.h | 6 + Marlin/src/gcode/temp/M306.cpp | 86 +++++ Marlin/src/inc/SanityCheck.h | 20 ++ .../lcd/extui/anycubic_chiron/chiron_tft.cpp | 2 +- .../anycubic_i3mega/anycubic_i3mega_lcd.cpp | 2 +- Marlin/src/module/settings.cpp | 61 ++++ Marlin/src/module/temperature.cpp | 300 +++++++++++++++++- Marlin/src/module/temperature.h | 41 ++- ini/features.ini | 1 + platformio.ini | 1 + 13 files changed, 566 insertions(+), 32 deletions(-) create mode 100644 Marlin/src/gcode/temp/M306.cpp diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index e66613937da8..cce5e2f7e937 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -589,10 +589,12 @@ //=========================================================================== //============================= PID Settings ================================ //=========================================================================== -// PID Tuning Guide here: https://reprap.org/wiki/PID_Tuning -// Comment the following line to disable PID and enable bang-bang. -#define PIDTEMP +// Enable PIDTEMP for PID control or MPCTEMP for Predictive Model. +// temperature control. Disable both for bang-bang heating. +#define PIDTEMP // See the PID Tuning Guide at https://reprap.org/wiki/PID_Tuning +//#define MPCTEMP // ** EXPERIMENTAL ** + #define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current #define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current #define PID_K1 0.95 // Smoothing factor within any PID loop @@ -612,7 +614,45 @@ #define DEFAULT_Ki 1.08 #define DEFAULT_Kd 114.00 #endif -#endif // PIDTEMP +#endif + +/** + * Model Predictive Control for hotend + * + * Use a physical model of the hotend to control temperature. When configured correctly + * this gives better responsiveness and stability than PID and it also removes the need + * for PID_EXTRUSION_SCALING and PID_FAN_SCALING. Use M306 to autotune the model. + */ +#if ENABLED(MPCTEMP) + #define MPC_MAX BANG_MAX // (0..255) Current to nozzle while MPC is active. + #define MPC_HEATER_POWER { 40.0f } // (W) Heat cartridge powers. + + #define MPC_INCLUDE_FAN // Model the fan speed? + + // Measured physical constants from M306 + #define MPC_BLOCK_HEAT_CAPACITY { 16.7f } // (J/K) Heat block heat capacities. + #define MPC_SENSOR_RESPONSIVENESS { 0.22f } // (K/s per ∆K) Rate of change of sensor temperature from heat block. + #define MPC_AMBIENT_XFER_COEFF { 0.068f } // (W/K) Heat transfer coefficients from heat block to room air with fan off. + #if ENABLED(MPC_INCLUDE_FAN) + #define MPC_AMBIENT_XFER_COEFF_FAN255 { 0.097f } // (W/K) Heat transfer coefficients from heat block to room air with fan on full. + #endif + + // For one fan and multiple hotends MPC needs to know how to apply the fan cooling effect. + #if ENABLED(MPC_INCLUDE_FAN) + //#define MPC_FAN_0_ALL_HOTENDS + //#define MPC_FAN_0_ACTIVE_HOTEND + #endif + + #define FILAMENT_HEAT_CAPACITY_PERMM 5.6e-3f // 0.0056 J/K/mm for 1.75mm PLA (0.0149 J/K/mm for 2.85mm PLA). + //#define FILAMENT_HEAT_CAPACITY_PERMM 3.6e-3f // 0.0036 J/K/mm for 1.75mm PETG (0.0094 J/K/mm for 2.85mm PETG). + + // Advanced options + #define MPC_SMOOTHING_FACTOR 0.5f // (0.0...1.0) Noisy temperature sensors may need a lower value for stabilization. + #define MPC_MIN_AMBIENT_CHANGE 1.0f // (K/s) Modeled ambient temperature rate of change, when correcting model inaccuracies. + #define MPC_STEADYSTATE 0.5f // (K/s) Temperature change rate for steady state logic to be enforced. + + #define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center just above the surface. +#endif //=========================================================================== //====================== PID > Bed Temperature Control ====================== diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index fbb3eac0db17..767f65d341bc 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -209,19 +209,19 @@ void MarlinHAL::adc_init() { adc1_config_width(ADC_WIDTH_12Bit); // Configure channels only if used as (re-)configuring a pin for ADC that is used elsewhere might have adverse effects - TERN_(HAS_TEMP_ADC_0, adc1_set_attenuation(get_channel(TEMP_0_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_ADC_1, adc1_set_attenuation(get_channel(TEMP_1_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_ADC_2, adc1_set_attenuation(get_channel(TEMP_2_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_ADC_3, adc1_set_attenuation(get_channel(TEMP_3_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_ADC_4, adc1_set_attenuation(get_channel(TEMP_4_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_ADC_5, adc1_set_attenuation(get_channel(TEMP_5_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_ADC_6, adc2_set_attenuation(get_channel(TEMP_6_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_ADC_7, adc3_set_attenuation(get_channel(TEMP_7_PIN), ADC_ATTEN_11db)); - TERN_(HAS_HEATED_BED, adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_CHAMBER, adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_PROBE, adc1_set_attenuation(get_channel(TEMP_PROBE_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_COOLER, adc1_set_attenuation(get_channel(TEMP_COOLER_PIN), ADC_ATTEN_11db)); - TERN_(HAS_TEMP_BOARD, adc1_set_attenuation(get_channel(TEMP_BOARD_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_0, adc1_set_attenuation(get_channel(TEMP_0_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_1, adc1_set_attenuation(get_channel(TEMP_1_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_2, adc1_set_attenuation(get_channel(TEMP_2_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_3, adc1_set_attenuation(get_channel(TEMP_3_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_4, adc1_set_attenuation(get_channel(TEMP_4_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_5, adc1_set_attenuation(get_channel(TEMP_5_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_6, adc2_set_attenuation(get_channel(TEMP_6_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_ADC_7, adc3_set_attenuation(get_channel(TEMP_7_PIN), ADC_ATTEN_11db)); + TERN_(HAS_HEATED_BED, adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_CHAMBER, adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_PROBE, adc1_set_attenuation(get_channel(TEMP_PROBE_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_COOLER, adc1_set_attenuation(get_channel(TEMP_COOLER_PIN), ADC_ATTEN_11db)); + TERN_(HAS_TEMP_BOARD, adc1_set_attenuation(get_channel(TEMP_BOARD_PIN), ADC_ATTEN_11db)); TERN_(FILAMENT_WIDTH_SENSOR, adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db)); // Note that adc2 is shared with the WiFi module, which has higher priority, so the conversion may fail. diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index d26a79b69af8..4f23db2e37cd 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -787,6 +787,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 305: M305(); break; // M305: Set user thermistor parameters #endif + #if ENABLED(MPCTEMP) + case 306: M306(); break; // M306: MPC autotune + #endif + #if ENABLED(REPETIER_GCODE_M360) case 360: M360(); break; // M360: Firmware settings #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 61fe6cb9d96f..d60427a31ad2 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -215,6 +215,7 @@ * M303 - PID relay autotune S sets the target temperature. Default 150C. (Requires PIDTEMP) * M304 - Set bed PID parameters P I and D. (Requires PIDTEMPBED) * M305 - Set user thermistor parameters R T and P. (Requires TEMP_SENSOR_x 1000) + * M306 - MPC autotune. (Requires MPCTEMP) * M309 - Set chamber PID parameters P I and D. (Requires PIDTEMPCHAMBER) * M350 - Set microstepping mode. (Requires digital microstepping pins.) * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.) @@ -928,6 +929,11 @@ class GcodeSuite { static void M305(); #endif + #if ENABLED(MPCTEMP) + static void M306(); + static void M306_report(const bool forReplay=true); + #endif + #if ENABLED(PIDTEMPCHAMBER) static void M309(); static void M309_report(const bool forReplay=true); diff --git a/Marlin/src/gcode/temp/M306.cpp b/Marlin/src/gcode/temp/M306.cpp new file mode 100644 index 000000000000..9e1a8dd8ef07 --- /dev/null +++ b/Marlin/src/gcode/temp/M306.cpp @@ -0,0 +1,86 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(MPCTEMP) + +#include "../gcode.h" +#include "../../module/temperature.h" + +/** + * M306: MPC settings and autotune + * + * T Autotune the active extruder. + * + * A Ambient heat transfer coefficient (no fan). + * C Block heat capacity. + * E Extruder number to set. (Default: E0) + * F Ambient heat transfer coefficient (fan on full). + * P Heater power. + * R Sensor responsiveness (= transfer coefficient / heat capcity). + */ + +void GcodeSuite::M306() { + if (parser.seen_test('T')) { thermalManager.MPC_autotune(); return; } + + if (parser.seen("ACFPR")) { + const heater_id_t hid = (heater_id_t)parser.intval('E', 0); + MPC_t &constants = thermalManager.temp_hotend[hid].constants; + if (parser.seenval('P')) constants.heater_power = parser.value_float(); + if (parser.seenval('C')) constants.block_heat_capacity = parser.value_float(); + if (parser.seenval('R')) constants.sensor_responsiveness = parser.value_float(); + if (parser.seenval('A')) constants.ambient_xfer_coeff_fan0 = parser.value_float(); + #if ENABLED(MPC_INCLUDE_FAN) + if (parser.seenval('F')) constants.fan255_adjustment = parser.value_float() - constants.ambient_xfer_coeff_fan0; + #endif + return; + } + + HOTEND_LOOP() { + SERIAL_ECHOLNPGM("MPC constants for hotend ", e); + MPC_t& constants = thermalManager.temp_hotend[e].constants; + SERIAL_ECHOLNPGM("Heater power: ", constants.heater_power); + SERIAL_ECHOLNPGM("Heatblock heat capacity: ", constants.block_heat_capacity); + SERIAL_ECHOLNPAIR_F("Sensor responsivness: ", constants.sensor_responsiveness, 4); + SERIAL_ECHOLNPAIR_F("Ambient heat transfer coeff. (no fan): ", constants.ambient_xfer_coeff_fan0, 4); + #if ENABLED(MPC_INCLUDE_FAN) + SERIAL_ECHOLNPAIR_F("Ambient heat transfer coeff. (full fan): ", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); + #endif + } +} + +void GcodeSuite::M306_report(const bool forReplay/*=true*/) { + report_heading(forReplay, F("Model predictive control")); + HOTEND_LOOP() { + report_echo_start(forReplay); + MPC_t& constants = thermalManager.temp_hotend[e].constants; + SERIAL_ECHOPGM(" M306 E", e); + SERIAL_ECHOPAIR_F(" P", constants.heater_power, 2); + SERIAL_ECHOPAIR_F(" C", constants.block_heat_capacity, 2); + SERIAL_ECHOPAIR_F(" R", constants.sensor_responsiveness, 4); + SERIAL_ECHOPAIR_F(" A", constants.ambient_xfer_coeff_fan0, 4); + SERIAL_ECHOLNPAIR_F(" F", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); + } +} + +#endif // MPCTEMP diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 606675cc0acd..35722a6ee227 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1401,6 +1401,26 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "You must set DISPLAY_CHARSET_HD44780 to JAPANESE, WESTERN or CYRILLIC for your LCD controller." #endif +/** + * Extruder temperature control algorithm - There can be only one! + */ +#if BOTH(PIDTEMP, MPCTEMP) + #error "Only enable PIDTEMP or MPCTEMP, but not both." +#endif + +#if ENABLED(MPC_INCLUDE_FAN) + #if FAN_COUNT < 1 + #error "MPC_INCLUDE_FAN requires at least one fan." + #endif + #if FAN_COUNT < HOTENDS + #if COUNT_ENABLED(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) > 1 + #error "Enable either MPC_FAN_0_ALL_HOTENDS or MPC_FAN_0_ACTIVE_HOTEND, not both." + #elif NONE(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) + #error "MPC_INCLUDE_FAN requires MPC_FAN_0_ALL_HOTENDS or MPC_FAN_0_ACTIVE_HOTEND for one fan with multiple hotends." + #endif + #endif +#endif + /** * Bed Heating Options - PID vs Limit Switching */ diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp index fa85de2a8e84..7561c89d79bf 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp @@ -85,7 +85,7 @@ void ChironTFT::Startup() { // opt_enable FIL_RUNOUT_PULLUP TFTSer.begin(115200); - // wait for the TFT panel to initialise and finish the animation + // Wait for the TFT panel to initialize and finish the animation safe_delay(1000); // There are different panels for the Chiron with slightly different commands diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 729d4547a862..c382af3fe2e5 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -85,7 +85,7 @@ void AnycubicTFTClass::OnSetup() { SENDLINE_DBG_PGM("J17", "TFT Serial Debug: Main board reset... J17"); // J17 Main board reset delay_ms(10); - // initialise the state of the key pins running on the tft + // Init the state of the key pins running on the TFT #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 982368d13193..e9e69782daf7 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -555,6 +555,13 @@ typedef struct SettingsDataStruct { uint8_t ui_language; // M414 S #endif + // + // Model predictive control + // + #if ENABLED(MPCTEMP) + MPC_t mpc_constants[HOTENDS]; // M306 + #endif + } SettingsData; //static_assert(sizeof(SettingsData) <= MARLIN_EEPROM_SIZE, "EEPROM too small to contain SettingsData!"); @@ -1564,6 +1571,14 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(ui.language); #endif + // + // Model predictive control + // + #if ENABLED(MPCTEMP) + HOTEND_LOOP() + EEPROM_WRITE(thermalManager.temp_hotend[e].constants); + #endif + // // Report final CRC and Data Size // @@ -2514,6 +2529,16 @@ void MarlinSettings::postprocess() { } #endif + // + // Model predictive control + // + #if ENABLED(MPCTEMP) + { + HOTEND_LOOP() + EEPROM_READ(thermalManager.temp_hotend[e].constants); + } + #endif + // // Validate Final Size and CRC // @@ -3220,6 +3245,37 @@ void MarlinSettings::reset() { // TERN_(DWIN_LCD_PROUI, DWIN_SetDataDefaults()); + // + // Model predictive control + // + #if ENABLED(MPCTEMP) + constexpr float _mpc_heater_power[] = MPC_HEATER_POWER; + constexpr float _mpc_block_heat_capacity[] = MPC_BLOCK_HEAT_CAPACITY; + constexpr float _mpc_sensor_responsiveness[] = MPC_SENSOR_RESPONSIVENESS; + constexpr float _mpc_ambient_xfer_coeff[] = MPC_AMBIENT_XFER_COEFF; + #if ENABLED(MPC_INCLUDE_FAN) + constexpr float _mpc_ambient_xfer_coeff_fan255[] = MPC_AMBIENT_XFER_COEFF_FAN255; + #endif + + static_assert(COUNT(_mpc_heater_power) == HOTENDS, "MPC_HEATER_POWER must have HOTENDS items."); + static_assert(COUNT(_mpc_block_heat_capacity) == HOTENDS, "MPC_BLOCK_HEAT_CAPACITY must have HOTENDS items."); + static_assert(COUNT(_mpc_sensor_responsiveness) == HOTENDS, "MPC_SENSOR_RESPONSIVENESS must have HOTENDS items."); + static_assert(COUNT(_mpc_ambient_xfer_coeff) == HOTENDS, "MPC_AMBIENT_XFER_COEFF must have HOTENDS items."); + #if ENABLED(MPC_INCLUDE_FAN) + static_assert(COUNT(_mpc_ambient_xfer_coeff_fan255) == HOTENDS, "MPC_AMBIENT_XFER_COEFF_FAN255 must have HOTENDS items."); + #endif + + HOTEND_LOOP() { + thermalManager.temp_hotend[e].constants.heater_power = _mpc_heater_power[e]; + thermalManager.temp_hotend[e].constants.block_heat_capacity = _mpc_block_heat_capacity[e]; + thermalManager.temp_hotend[e].constants.sensor_responsiveness = _mpc_sensor_responsiveness[e]; + thermalManager.temp_hotend[e].constants.ambient_xfer_coeff_fan0 = _mpc_ambient_xfer_coeff[e]; + #if ENABLED(MPC_INCLUDE_FAN) + thermalManager.temp_hotend[e].constants.fan255_adjustment = _mpc_ambient_xfer_coeff_fan255[e] - _mpc_ambient_xfer_coeff[e]; + #endif + } + #endif + postprocess(); #if EITHER(EEPROM_CHITCHAT, DEBUG_LEVELING_FEATURE) @@ -3506,6 +3562,11 @@ void MarlinSettings::reset() { #endif TERN_(HAS_MULTI_LANGUAGE, gcode.M414_report(forReplay)); + + // + // Model predictive control + // + TERN_(MPCTEMP, gcode.M306_report(forReplay)); } #endif // !DISABLE_M503 diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index b538fb0b8b71..134f7d26e3b6 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -141,7 +141,8 @@ #endif #endif -#if ENABLED(PID_EXTRUSION_SCALING) +#if EITHER(MPCTEMP, PID_EXTRUSION_SCALING) + #include #include "stepper.h" #endif @@ -509,10 +510,14 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); volatile bool Temperature::raw_temps_ready = false; #if ENABLED(PID_EXTRUSION_SCALING) - int32_t Temperature::last_e_position, Temperature::lpq[LPQ_MAX_LEN]; + int32_t Temperature::pes_e_position, Temperature::lpq[LPQ_MAX_LEN]; lpq_ptr_t Temperature::lpq_ptr = 0; #endif +#if ENABLED(MPCTEMP) + int32_t Temperature::mpc_e_position; // = 0 +#endif + #define TEMPDIR(N) ((TEMP_SENSOR_##N##_RAW_LO_TEMP) < (TEMP_SENSOR_##N##_RAW_HI_TEMP) ? 1 : -1) #define TP_CMP(S,A,B) (TEMPDIR(S) < 0 ? ((A)<(B)) : ((A)>(B))) @@ -587,8 +592,8 @@ volatile bool Temperature::raw_temps_ready = false; PID_t tune_pid = { 0, 0, 0 }; celsius_float_t maxT = 0, minT = 10000; - const bool isbed = (heater_id == H_BED); - const bool ischamber = (heater_id == H_CHAMBER); + const bool isbed = (heater_id == H_BED), + ischamber = (heater_id == H_CHAMBER); #if ENABLED(PIDTEMPCHAMBER) #define C_TERN(T,A,B) ((T) ? (A) : (B)) @@ -846,6 +851,198 @@ volatile bool Temperature::raw_temps_ready = false; #endif // HAS_PID_HEATING +#if ENABLED(MPCTEMP) + + void Temperature::MPC_autotune() { + auto housekeeping = [] (millis_t& ms, celsius_float_t& current_temp, millis_t& next_report_ms) { + ms = millis(); + + if (updateTemperaturesIfReady()) { // temp sample ready + current_temp = degHotend(active_extruder); + TERN_(HAS_FAN_LOGIC, manage_extruder_fans(ms)); + } + + if (ELAPSED(ms, next_report_ms)) { + next_report_ms += 1000UL; + SERIAL_ECHOLNPGM("Temperature ", current_temp); + } + + hal.idletask(); + }; + + SERIAL_ECHOLNPGM("Measuring MPC constants for E", active_extruder); + MPCHeaterInfo& hotend = temp_hotend[active_extruder]; + MPC_t& constants = hotend.constants; + + // move to center of bed, just above bed height and cool with max fan + SERIAL_ECHOLNPGM("Moving to tuning position"); + TERN_(HAS_FAN, zero_fan_speeds()); + disable_all_heaters(); + TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255)); + TERN_(HAS_FAN, planner.sync_fan_speeds(fan_speed)); + gcode.home_all_axes(true); + const xyz_pos_t tuningpos = MPC_TUNING_POS; + do_blocking_move_to(tuningpos); + + SERIAL_ECHOLNPGM("Cooling to ambient"); + millis_t ms = millis(), next_report_ms = ms, next_test_ms = ms + 10000UL; + celsius_float_t current_temp = degHotend(active_extruder), + ambient_temp = current_temp; + + wait_for_heatup = true; // Can be interrupted with M108 + while (wait_for_heatup) { + housekeeping(ms, current_temp, next_report_ms); + + if (ELAPSED(ms, next_test_ms)) { + if (current_temp >= ambient_temp) { + ambient_temp = (ambient_temp + current_temp) / 2.0f; + break; + } + ambient_temp = current_temp; + next_test_ms += 10000UL; + } + } + TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0)); + TERN_(HAS_FAN, planner.sync_fan_speeds(fan_speed)); + + hotend.modeled_ambient_temp = ambient_temp; + + SERIAL_ECHOLNPGM("Heating to 200C"); + hotend.soft_pwm_amount = MPC_MAX >> 1; + const millis_t heat_start_time = ms; + next_test_ms = ms; + celsius_float_t temp_samples[16]; + uint8_t sample_count = 0; + uint16_t sample_distance = 1; + float t1_time = 0; + + while (wait_for_heatup) { + housekeeping(ms, current_temp, next_report_ms); + + if (ELAPSED(ms, next_test_ms)) { + // record samples between 100C and 200C + if (current_temp >= 100.0f) { + // if there are too many samples, space them more widely + if (sample_count == COUNT(temp_samples)) { + for (uint8_t i = 0; i < COUNT(temp_samples) / 2; i++) + temp_samples[i] = temp_samples[i*2]; + sample_count /= 2; + sample_distance *= 2; + } + + if (sample_count == 0) t1_time = float(ms - heat_start_time) / 1000.0f; + temp_samples[sample_count++] = current_temp; + } + + if (current_temp >= 200.0f) break; + + next_test_ms += 1000UL * sample_distance; + } + } + hotend.soft_pwm_amount = 0; + + // calculate physical constants from three equally spaced samples + sample_count = (sample_count + 1) / 2 * 2 - 1; + const float t1 = temp_samples[0], + t2 = temp_samples[(sample_count - 1) >> 1], + t3 = temp_samples[sample_count - 1], + asymp_temp = (t2 * t2 - t1 * t3) / (2 * t2 - t1 - t3), + block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); + + constants.ambient_xfer_coeff_fan0 = constants.heater_power * MPC_MAX / 255 / (asymp_temp - ambient_temp); + constants.fan255_adjustment = 0.0f; + constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness; + constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); + + hotend.modeled_block_temp = asymp_temp + (ambient_temp - asymp_temp) * exp(-block_responsiveness * (ms - heat_start_time) / 1000.0f); + hotend.modeled_sensor_temp = current_temp; + + // let the system stabilise under MPC control then get a better measure of ambient loss without and with fan + SERIAL_ECHOLNPGM("Measuring ambient heatloss at target ", hotend.modeled_block_temp); + hotend.target = hotend.modeled_block_temp; + next_test_ms = ms + MPC_dT * 1000; + constexpr millis_t settle_time = 20000UL, + test_length = 20000UL; + millis_t settle_end_ms = ms + settle_time, + test_end_ms = settle_end_ms + test_length; + float total_energy_fan0 = 0.0f; + #if HAS_FAN + bool fan0_done = false; + float total_energy_fan255 = 0.0f; + #endif + float last_temp = current_temp; + + while (wait_for_heatup) { + housekeeping(ms, current_temp, next_report_ms); + + if (ELAPSED(ms, next_test_ms)) { + // use MPC to control the temperature, let it settle for 30s and then track power output for 10s + hotend.soft_pwm_amount = (int)get_pid_output_hotend(active_extruder) >> 1; + + if (ELAPSED(ms, settle_end_ms) && !ELAPSED(ms, test_end_ms) && TERN1(HAS_FAN, !fan0_done)) + total_energy_fan0 += constants.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * constants.block_heat_capacity; + #if HAS_FAN + else if (ELAPSED(ms, test_end_ms) && !fan0_done) { + SERIAL_ECHOLNPGM("Measuring ambient heatloss with full fan"); + set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); + planner.sync_fan_speeds(fan_speed); + settle_end_ms = ms + settle_time; + test_end_ms = settle_end_ms + test_length; + fan0_done = true; + } + else if (ELAPSED(ms, settle_end_ms) && !ELAPSED(ms, test_end_ms)) + total_energy_fan255 += constants.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * constants.block_heat_capacity; + #endif + else if (ELAPSED(ms, test_end_ms)) break; + + last_temp = current_temp; + next_test_ms += MPC_dT * 1000; + } + + if (!WITHIN(current_temp, hotend.target - 15.0f, hotend.target + 15.0f)) { + SERIAL_ECHOLNPGM("Temperature error while measuring ambient loss"); + break; + } + } + + const float power_fan0 = total_energy_fan0 * 1000 / test_length; + constants.ambient_xfer_coeff_fan0 = power_fan0 / (hotend.target - ambient_temp); + + #if HAS_FAN + const float power_fan255 = total_energy_fan255 * 1000 / test_length, + ambient_xfer_coeff_fan255 = power_fan255 / (hotend.target - ambient_temp); + constants.fan255_adjustment = ambient_xfer_coeff_fan255 - constants.ambient_xfer_coeff_fan0; + #endif + + hotend.target = 0.0f; + hotend.soft_pwm_amount = 0; + TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0)); + TERN_(HAS_FAN, planner.sync_fan_speeds(fan_speed)); + + if (!wait_for_heatup) SERIAL_ECHOLNPGM("Test was interrupted"); + + wait_for_heatup = false; + + SERIAL_ECHOLNPGM("Done"); + + /* <-- add a slash to enable + SERIAL_ECHOLNPGM("t1_time ", t1_time); + SERIAL_ECHOLNPGM("sample_count ", sample_count); + SERIAL_ECHOLNPGM("sample_distance ", sample_distance); + for (uint8_t i = 0; i < sample_count; i++) + SERIAL_ECHOLNPGM("sample ", i, " : ", temp_samples[i]); + SERIAL_ECHOLNPGM("t1 ", t1, " t2 ", t2, " t3 ", t3); + SERIAL_ECHOLNPGM("asymp_temp ", asymp_temp); + SERIAL_ECHOLNPAIR_F("block_responsiveness ", block_responsiveness, 4); + //*/ + SERIAL_ECHOLNPGM("MPC_BLOCK_HEAT_CAPACITY ", constants.block_heat_capacity); + SERIAL_ECHOLNPAIR_F("MPC_SENSOR_RESPONSIVENESS ", constants.sensor_responsiveness, 4); + SERIAL_ECHOLNPAIR_F("MPC_AMBIENT_XFER_COEFF ", constants.ambient_xfer_coeff_fan0, 4); + TERN_(HAS_FAN, SERIAL_ECHOLNPAIR_F("MPC_AMBIENT_XFER_COEFF_FAN255 ", ambient_xfer_coeff_fan255, 4)); + } + +#endif // MPCTEMP + int16_t Temperature::getHeaterPower(const heater_id_t heater_id) { switch (heater_id) { #if HAS_HEATED_BED @@ -1101,7 +1298,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { pid_reset.set(ee); } else if (pid_error > PID_FUNCTIONAL_RANGE) { - pid_output = BANG_MAX; + pid_output = PID_MAX; pid_reset.set(ee); } else { @@ -1128,9 +1325,9 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { work_pid[ee].Kc = 0; if (this_hotend) { const long e_position = stepper.position(E_AXIS); - if (e_position > last_e_position) { - lpq[lpq_ptr] = e_position - last_e_position; - last_e_position = e_position; + if (e_position > pes_e_position) { + lpq[lpq_ptr] = e_position - pes_e_position; + pes_e_position = e_position; } else lpq[lpq_ptr] = 0; @@ -1173,7 +1370,86 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { } #endif - #else // No PID enabled + #elif ENABLED(MPCTEMP) + MPCHeaterInfo& hotend = temp_hotend[ee]; + MPC_t& constants = hotend.constants; + + // At startup, initialize modeled temperatures + if (isnan(hotend.modeled_block_temp)) { + hotend.modeled_ambient_temp = min(30.0f, hotend.celsius); // cap initial value at reasonable max room temperature of 30C + hotend.modeled_block_temp = hotend.modeled_sensor_temp = hotend.celsius; + } + + #if HOTENDS == 1 + constexpr bool this_hotend = true; + #else + const bool this_hotend = (ee == active_extruder); + #endif + + float ambient_xfer_coeff = constants.ambient_xfer_coeff_fan0; + #if ENABLED(MPC_INCLUDE_FAN) + const uint8_t fan_index = ANY(MPC_FAN_0_ACTIVE_HOTEND, MPC_FAN_0_ALL_HOTENDS) ? 0 : ee; + const float fan_fraction = TERN_(MPC_FAN_0_ACTIVE_HOTEND, !this_hotend ? 0.0f : ) fan_speed[fan_index] * RECIPROCAL(255); + ambient_xfer_coeff += fan_fraction * constants.fan255_adjustment; + #endif + + if (this_hotend) { + const int32_t e_position = stepper.position(E_AXIS); + const float e_speed = (e_position - mpc_e_position) * planner.mm_per_step[E_AXIS] / MPC_dT; + + // the position can appear to make big jumps when, e.g. homing + if (fabs(e_speed) > planner.settings.max_feedrate_mm_s[E_AXIS]) + mpc_e_position = e_position; + else if (e_speed > 0.0f) { // ignore retract/recover moves + ambient_xfer_coeff += e_speed * FILAMENT_HEAT_CAPACITY_PERMM; + mpc_e_position = e_position; + } + } + + // update the modeled temperatures + float blocktempdelta = hotend.soft_pwm_amount * constants.heater_power * (MPC_dT / 127) / constants.block_heat_capacity; + blocktempdelta += (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff * MPC_dT / constants.block_heat_capacity; + hotend.modeled_block_temp += blocktempdelta; + + const float sensortempdelta = (hotend.modeled_block_temp - hotend.modeled_sensor_temp) * (constants.sensor_responsiveness * MPC_dT); + hotend.modeled_sensor_temp += sensortempdelta; + + // Any delta between hotend.modeled_sensor_temp and hotend.celsius is either model + // error diverging slowly or (fast) noise. Slowly correct towards this temperature and noise will average out. + const float delta_to_apply = (hotend.celsius - hotend.modeled_sensor_temp) * (MPC_SMOOTHING_FACTOR); + hotend.modeled_block_temp += delta_to_apply; + hotend.modeled_sensor_temp += delta_to_apply; + + // only correct ambient when close to steady state (output power is not clipped or asymptotic temperature is reached) + if (WITHIN(hotend.soft_pwm_amount, 1, 126) || fabs(blocktempdelta + delta_to_apply) < (MPC_STEADYSTATE * MPC_dT)) + hotend.modeled_ambient_temp += delta_to_apply > 0.f ? max(delta_to_apply, MPC_MIN_AMBIENT_CHANGE * MPC_dT) : min(delta_to_apply, -MPC_MIN_AMBIENT_CHANGE * MPC_dT); + + float power = 0.0; + if (hotend.target != 0 && TERN1(HEATER_IDLE_HANDLER, !heater_idle[ee].timed_out)) { + // plan power level to get to target temperature in 2 seconds + power = (hotend.target - hotend.modeled_block_temp) * constants.block_heat_capacity / 2.0f; + power -= (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff; + } + + float pid_output = power * 254.0f / constants.heater_power + 1.0f; // ensure correct quantization into a range of 0 to 127 + pid_output = constrain(pid_output, 0, MPC_MAX); + + /* <-- add a slash to enable + static uint32_t nexttime = millis() + 1000; + if (ELAPSED(millis(), nexttime)) { + nexttime += 1000; + SERIAL_ECHOLNPGM("block temp ", hotend.modeled_block_temp, + ", celsius ", hotend.celsius, + ", blocktempdelta ", blocktempdelta, + ", delta_to_apply ", delta_to_apply, + ", ambient ", hotend.modeled_ambient_temp, + ", power ", power, + ", pid_output ", pid_output, + ", pwm ", (int)pid_output >> 1); + } + //*/ + + #else // No PID or MPC enabled const bool is_idling = TERN0(HEATER_IDLE_HANDLER, heater_idle[ee].timed_out); const float pid_output = (!is_idling && temp_hotend[ee].celsius < temp_hotend[ee].target) ? BANG_MAX : 0; @@ -2178,7 +2454,7 @@ void Temperature::init() { TERN_(PROBING_HEATERS_OFF, paused_for_probing = false); #if BOTH(PIDTEMP, PID_EXTRUSION_SCALING) - last_e_position = 0; + pes_e_position = 0; #endif // Init (and disable) SPI thermocouples @@ -2248,6 +2524,10 @@ void Temperature::init() { )); #endif + #if ENABLED(MPCTEMP) + HOTEND_LOOP() temp_hotend[e].modeled_block_temp = NAN; + #endif + #if HAS_HEATER_0 #ifdef BOARD_OPENDRAIN_MOSFETS OUT_WRITE_OD(HEATER_0_PIN, HEATER_0_INVERTING); diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 0358d32297b9..a9980f4890e4 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -94,6 +94,18 @@ hotend_pid_t; #define _PID_Kf(H) 0 #endif +#if ENABLED(MPCTEMP) + typedef struct { + float heater_power; // M306 P + float block_heat_capacity; // M306 C + float sensor_responsiveness; // M306 R + float ambient_xfer_coeff_fan0; // M306 A + #if ENABLED(MPC_INCLUDE_FAN) + float fan255_adjustment; // M306 F + #endif + } MPC_t; +#endif + /** * States for ADC reading in the ISR */ @@ -177,7 +189,7 @@ enum ADCSensorState : char { #if HAS_PID_HEATING #define PID_K2 (1-float(PID_K1)) - #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / TEMP_TIMER_FREQUENCY) + #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (TEMP_TIMER_FREQUENCY)) // Apply the scale factors to the PID values #define scalePID_i(i) ( float(i) * PID_dT ) @@ -186,6 +198,10 @@ enum ADCSensorState : char { #define unscalePID_d(d) ( float(d) * PID_dT ) #endif +#if ENABLED(MPCTEMP) + #define MPC_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (TEMP_TIMER_FREQUENCY)) +#endif + #if ENABLED(G26_MESH_VALIDATION) && EITHER(HAS_MARLINUI_MENU, EXTENSIBLE_UI) #define G26_CLICK_CAN_CANCEL 1 #endif @@ -223,8 +239,19 @@ struct PIDHeaterInfo : public HeaterInfo { T pid; // Initialized by settings.load() }; +#if ENABLED(MPCTEMP) + struct MPCHeaterInfo : public HeaterInfo { + MPC_t constants; + float modeled_ambient_temp, + modeled_block_temp, + modeled_sensor_temp; + }; +#endif + #if ENABLED(PIDTEMP) typedef struct PIDHeaterInfo hotend_info_t; +#elif ENABLED(MPCTEMP) + typedef struct MPCHeaterInfo hotend_info_t; #else typedef heater_info_t hotend_info_t; #endif @@ -489,10 +516,14 @@ class Temperature { #endif #if ENABLED(PID_EXTRUSION_SCALING) - static int32_t last_e_position, lpq[LPQ_MAX_LEN]; + static int32_t pes_e_position, lpq[LPQ_MAX_LEN]; static lpq_ptr_t lpq_ptr; #endif + #if ENABLED(MPCTEMP) + static int32_t mpc_e_position; + #endif + #if HAS_HOTEND static temp_range_t temp_range[HOTENDS]; #endif @@ -932,12 +963,16 @@ class Temperature { */ #if ENABLED(PIDTEMP) static void updatePID() { - TERN_(PID_EXTRUSION_SCALING, last_e_position = 0); + TERN_(PID_EXTRUSION_SCALING, pes_e_position = 0); } #endif #endif + #if ENABLED(MPCTEMP) + void MPC_autotune(); + #endif + #if ENABLED(PROBING_HEATERS_OFF) static void pause_heaters(const bool p); #endif diff --git a/ini/features.ini b/ini/features.ini index c55af9ca3237..e8ce7f7040a6 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -219,6 +219,7 @@ HAS_EXTRUDERS = src_filter=+ HAS_COOLER = src_filter=+ AUTO_REPORT_TEMPERATURES = src_filter=+ +MPCTEMP = src_filter=+ INCH_MODE_SUPPORT = src_filter=+ TEMPERATURE_UNITS_SUPPORT = src_filter=+ NEED_HEX_PRINT = src_filter=+ diff --git a/platformio.ini b/platformio.ini index 028bd3802989..ae50293e3f2b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -240,6 +240,7 @@ default_src_filter = + - - + - - - + - - - - From a6ce9bf559d963c3cdcb6db7f57a572bc58016ea Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Apr 2022 03:58:58 -0500 Subject: [PATCH 341/502] =?UTF-8?q?=E2=9C=A8=20Autoreport=20Redundant=20Se?= =?UTF-8?q?nsor=20option=20(#24014)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 3 +++ Marlin/src/module/temperature.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index ce6e58834acb..def5d06c4523 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3745,6 +3745,9 @@ * Auto-report temperatures with M155 S */ #define AUTO_REPORT_TEMPERATURES +#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT + //#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report +#endif /** * Auto-report position with M154 S diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 134f7d26e3b6..94231f6dfc19 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -3911,7 +3911,10 @@ void Temperature::isr() { #if ENABLED(AUTO_REPORT_TEMPERATURES) AutoReporter Temperature::auto_reporter; - void Temperature::AutoReportTemp::report() { print_heater_states(active_extruder); SERIAL_EOL(); } + void Temperature::AutoReportTemp::report() { + print_heater_states(active_extruder OPTARG(HAS_TEMP_REDUNDANT, ENABLED(AUTO_REPORT_REDUNDANT))); + SERIAL_EOL(); + } #endif #if HAS_HOTEND && HAS_STATUS_MESSAGE From 6c557a248016f2e89e259d2d5ee8e000521099bb Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Mon, 4 Apr 2022 01:44:45 +0200 Subject: [PATCH 342/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Bed/Chamber=20PID?= =?UTF-8?q?=20Autotune=20with=20MPCTEMP=20(#23983)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 8 +++- Marlin/src/core/language.h | 22 +++++---- Marlin/src/feature/bltouch.cpp | 15 ++---- Marlin/src/gcode/temp/M303.cpp | 1 + Marlin/src/inc/SanityCheck.h | 12 ++--- Marlin/src/lcd/menu/menu_advanced.cpp | 67 ++++++++++----------------- Marlin/src/module/probe.cpp | 25 +++++++--- Marlin/src/module/probe.h | 2 + Marlin/src/module/temperature.cpp | 36 +++++++------- 9 files changed, 92 insertions(+), 96 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 234bed1eed8e..a4bf4a111a16 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -417,7 +417,9 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { if (do_reset_timeout) gcode.reset_stepper_timeout(ms); if (gcode.stepper_max_timed_out(ms)) { - SERIAL_ERROR_MSG(STR_KILL_INACTIVE_TIME, parser.command_ptr); + SERIAL_ERROR_START(); + SERIAL_ECHOPGM(STR_KILL_PRE); + SERIAL_ECHOLNPGM(STR_KILL_INACTIVE_TIME, parser.command_ptr); kill(); } @@ -475,7 +477,9 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { // KILL the machine // ---------------------------------------------------------------- if (killCount >= KILL_DELAY) { - SERIAL_ERROR_MSG(STR_KILL_BUTTON); + SERIAL_ERROR_START(); + SERIAL_ECHOPGM(STR_KILL_PRE); + SERIAL_ECHOLNPGM(STR_KILL_BUTTON); kill(); } #endif diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 8e0784f70d76..0b13161976b3 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -199,16 +199,20 @@ #define STR_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108" #define STR_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume" -#define STR_STOP_BLTOUCH "!! STOP called because of BLTouch error - restart with M999" -#define STR_STOP_UNHOMED "!! STOP called because of unhomed error - restart with M999" -#define STR_KILL_INACTIVE_TIME "!! KILL caused by too much inactive time - current command: " -#define STR_KILL_BUTTON "!! KILL caused by KILL button/pin" +#define STR_STOP_PRE "!! STOP called because of " +#define STR_STOP_POST " error - restart with M999" +#define STR_STOP_BLTOUCH "BLTouch" +#define STR_STOP_UNHOMED "unhomed" +#define STR_KILL_PRE "!! KILL caused by " +#define STR_KILL_INACTIVE_TIME "too much inactive time - current command: " +#define STR_KILL_BUTTON "KILL button/pin" // temperature.cpp strings -#define STR_PID_AUTOTUNE_START "PID Autotune start" -#define STR_PID_BAD_HEATER_ID "PID Autotune failed! Bad heater id" -#define STR_PID_TEMP_TOO_HIGH "PID Autotune failed! Temperature too high" -#define STR_PID_TIMEOUT "PID Autotune failed! timeout" +#define STR_PID_AUTOTUNE "PID Autotune" +#define STR_PID_AUTOTUNE_START " start" +#define STR_PID_BAD_HEATER_ID " failed! Bad heater id" +#define STR_PID_TEMP_TOO_HIGH " failed! Temperature too high" +#define STR_PID_TIMEOUT " failed! timeout" #define STR_BIAS " bias: " #define STR_D_COLON " d: " #define STR_T_MIN " min: " @@ -219,7 +223,7 @@ #define STR_KP " Kp: " #define STR_KI " Ki: " #define STR_KD " Kd: " -#define STR_PID_AUTOTUNE_FINISHED "PID Autotune finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" +#define STR_PID_AUTOTUNE_FINISHED " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" #define STR_PID_DEBUG " PID_DEBUG " #define STR_PID_DEBUG_INPUT ": Input " #define STR_PID_DEBUG_OUTPUT " Output " diff --git a/Marlin/src/feature/bltouch.cpp b/Marlin/src/feature/bltouch.cpp index b1cc30bee0d9..d911fae6ae75 100644 --- a/Marlin/src/feature/bltouch.cpp +++ b/Marlin/src/feature/bltouch.cpp @@ -111,11 +111,8 @@ bool BLTouch::deploy_proc() { // Last attempt to DEPLOY if (_deploy_query_alarm()) { // The deploy might have failed or the probe is actually triggered (nozzle too low?) again - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Recovery Failed"); - - SERIAL_ERROR_MSG(STR_STOP_BLTOUCH); // Tell the user something is wrong, needs action - stop(); // but it's not too bad, no need to kill, allow restart - + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Deploy Failed"); + probe.probe_error_stop(); // Something is wrong, needs action, but not too bad, allow restart return true; // Tell our caller we goofed in case he cares to know } } @@ -153,12 +150,8 @@ bool BLTouch::stow_proc() { // But one more STOW will catch that // Last attempt to STOW if (_stow_query_alarm()) { // so if there is now STILL an ALARM condition: - - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Recovery Failed"); - - SERIAL_ERROR_MSG(STR_STOP_BLTOUCH); // Tell the user something is wrong, needs action - stop(); // but it's not too bad, no need to kill, allow restart - + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Stow Failed"); + probe.probe_error_stop(); // Something is wrong, needs action, but not too bad, allow restart return true; // Tell our caller we goofed in case he cares to know } } diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index c1e400511c91..ce362984a6ca 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -71,6 +71,7 @@ void GcodeSuite::M303() { case H_CHAMBER: default_temp = PREHEAT_1_TEMP_CHAMBER; break; #endif default: + SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM)); TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_BAD_EXTRUDER_NUM)); diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 35722a6ee227..88ba2bb2b6f4 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2854,10 +2854,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if ENABLED(DWIN_CREALITY_LCD) #if DISABLED(SDSUPPORT) #error "DWIN_CREALITY_LCD requires SDSUPPORT to be enabled." - #elif ENABLED(PID_EDIT_MENU) - #error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU." - #elif ENABLED(PID_AUTOTUNE_MENU) - #error "DWIN_CREALITY_LCD does not support PID_AUTOTUNE_MENU." + #elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU) + #error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU." #elif ENABLED(LEVEL_BED_CORNERS) #error "DWIN_CREALITY_LCD does not support LEVEL_BED_CORNERS." #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) @@ -2866,10 +2864,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif ENABLED(DWIN_LCD_PROUI) #if DISABLED(SDSUPPORT) #error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled." - #elif ENABLED(PID_EDIT_MENU) - #error "DWIN_LCD_PROUI does not support PID_EDIT_MENU." - #elif ENABLED(PID_AUTOTUNE_MENU) - #error "DWIN_LCD_PROUI does not support PID_AUTOTUNE_MENU." + #elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU) + #error "DWIN_LCD_PROUI does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU." #elif ENABLED(LEVEL_BED_CORNERS) #error "DWIN_LCD_PROUI does not support LEVEL_BED_CORNERS." #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index a0c03fafeba2..21fa01f2aa4b 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -211,7 +211,7 @@ void menu_backlash(); // Helpers for editing PID Ki & Kd values // grab the PID value out of the temp variable; scale it; then update the PID driver - void copy_and_scalePID_i(int16_t e) { + void copy_and_scalePID_i(const int8_t e) { switch (e) { #if ENABLED(PIDTEMPBED) case H_BED: thermalManager.temp_bed.pid.Ki = scalePID_i(raw_Ki); break; @@ -227,7 +227,7 @@ void menu_backlash(); break; } } - void copy_and_scalePID_d(int16_t e) { + void copy_and_scalePID_d(const int8_t e) { switch (e) { #if ENABLED(PIDTEMPBED) case H_BED: thermalManager.temp_bed.pid.Kd = scalePID_d(raw_Kd); break; @@ -243,30 +243,6 @@ void menu_backlash(); break; } } - - #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \ - void copy_and_scalePID_i_E##N() { copy_and_scalePID_i(N); } \ - void copy_and_scalePID_d_E##N() { copy_and_scalePID_d(N); } - -#else - - #define _DEFINE_PIDTEMP_BASE_FUNCS(N) // - -#endif - -#if ENABLED(PID_AUTOTUNE_MENU) - #define DEFINE_PIDTEMP_FUNCS(N) \ - _DEFINE_PIDTEMP_BASE_FUNCS(N); \ - void lcd_autotune_callback_E##N() { _lcd_autotune(heater_id_t(N)); } -#else - #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N); -#endif - -#if HAS_HOTEND - DEFINE_PIDTEMP_FUNCS(0); - #if ENABLED(PID_PARAMS_PER_HOTEND) - REPEAT_S(1, HOTENDS, DEFINE_PIDTEMP_FUNCS) - #endif #endif #if BOTH(AUTOTEMP, HAS_TEMP_HOTEND) || EITHER(PID_AUTOTUNE_MENU, PID_EDIT_MENU) @@ -281,6 +257,7 @@ void menu_backlash(); void menu_advanced_temperature() { START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); + // // Autotemp, Min, Max, Fact // @@ -300,14 +277,7 @@ void menu_backlash(); // PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5 // - #if ENABLED(PID_EDIT_MENU) - #define _PID_EDIT_ITEMS_TMPL(N,T) \ - raw_Ki = unscalePID_i(T.pid.Ki); \ - raw_Kd = unscalePID_d(T.pid.Kd); \ - EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_P_E, &T.pid.Kp, 1, 9990); \ - EDIT_ITEM_FAST_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \ - EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); }) - + #if BOTH(PIDTEMP, PID_EDIT_MENU) #define __PID_HOTEND_MENU_ITEMS(N) \ raw_Ki = unscalePID_i(PID_PARAM(Ki, N)); \ raw_Kd = unscalePID_d(PID_PARAM(Kd, N)); \ @@ -337,17 +307,28 @@ void menu_backlash(); #endif - #if ENABLED(PID_AUTOTUNE_MENU) - #define HOTEND_PID_EDIT_MENU_ITEMS(N) \ - _HOTEND_PID_EDIT_MENU_ITEMS(N); \ - EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.hotend_max_target(N), []{ _lcd_autotune(heater_id_t(MenuItemBase::itemIndex)); }); - #else - #define HOTEND_PID_EDIT_MENU_ITEMS(N) _HOTEND_PID_EDIT_MENU_ITEMS(N); + #if ENABLED(PID_EDIT_MENU) && EITHER(PIDTEMPBED, PIDTEMPCHAMBER) + #define _PID_EDIT_ITEMS_TMPL(N,T) \ + raw_Ki = unscalePID_i(T.pid.Ki); \ + raw_Kd = unscalePID_d(T.pid.Kd); \ + EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_P_E, &T.pid.Kp, 1, 9990); \ + EDIT_ITEM_FAST_N(float52sign, N, MSG_PID_I_E, &raw_Ki, 0.01f, 9990, []{ copy_and_scalePID_i(N); }); \ + EDIT_ITEM_FAST_N(float41sign, N, MSG_PID_D_E, &raw_Kd, 1, 9990, []{ copy_and_scalePID_d(N); }) #endif - HOTEND_PID_EDIT_MENU_ITEMS(0); - #if ENABLED(PID_PARAMS_PER_HOTEND) - REPEAT_S(1, HOTENDS, HOTEND_PID_EDIT_MENU_ITEMS) + #if ENABLED(PIDTEMP) + #if ENABLED(PID_AUTOTUNE_MENU) + #define HOTEND_PID_EDIT_MENU_ITEMS(N) \ + _HOTEND_PID_EDIT_MENU_ITEMS(N); \ + EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.hotend_max_target(N), []{ _lcd_autotune(heater_id_t(MenuItemBase::itemIndex)); }); + #else + #define HOTEND_PID_EDIT_MENU_ITEMS(N) _HOTEND_PID_EDIT_MENU_ITEMS(N); + #endif + + HOTEND_PID_EDIT_MENU_ITEMS(0); + #if ENABLED(PID_PARAMS_PER_HOTEND) + REPEAT_S(1, HOTENDS, HOTEND_PID_EDIT_MENU_ITEMS); + #endif #endif #if ENABLED(PIDTEMPBED) diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 5b0bd77d0de7..9318559499fd 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -415,6 +415,21 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { #endif +/** + * Print an error and stop() + */ +void Probe::probe_error_stop() { + SERIAL_ERROR_START(); + SERIAL_ECHOPGM(STR_STOP_PRE); + #if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY) + SERIAL_ECHOPGM(STR_STOP_UNHOMED); + #elif ENABLED(BLTOUCH) + SERIAL_ECHOPGM(STR_STOP_BLTOUCH); + #endif + SERIAL_ECHOLNPGM(STR_STOP_POST); + stop(); +} + /** * Attempt to deploy or stow the probe * @@ -443,8 +458,7 @@ bool Probe::set_deployed(const bool deploy) { #if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY) if (homing_needed_error(TERN_(Z_PROBE_SLED, _BV(X_AXIS)))) { - SERIAL_ERROR_MSG(STR_STOP_UNHOMED); - stop(); + probe_error_stop(); return true; } #endif @@ -484,15 +498,12 @@ bool Probe::set_deployed(const bool deploy) { } /** - * @brief Used by run_z_probe to do a single Z probe move. + * @brief Move down until the probe triggers or the low limit is reached + * Used by run_z_probe to do a single Z probe move. * * @param z Z destination * @param fr_mm_s Feedrate in mm/s * @return true to indicate an error - */ - -/** - * @brief Move down until the probe triggers or the low limit is reached * * @details Used by run_z_probe to get each bed Z height measurement. * Sets current_position.z to the height where the probe triggered diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index f2fca10a8038..a65f982bb633 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -78,6 +78,8 @@ class Probe { static void preheat_for_probing(const celsius_t hotend_temp, const celsius_t bed_temp); #endif + static void probe_error_stop(); + static bool set_deployed(const bool deploy); #if IS_KINEMATIC diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 94231f6dfc19..6b002e52d9f3 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -638,6 +638,7 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(isbed ? PID_BED_START : PID_EXTR_START)); if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - (HOTEND_OVERSHOOT))) { + SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); @@ -645,6 +646,7 @@ volatile bool Temperature::raw_temps_ready = false; return; } + SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_AUTOTUNE_START); disable_all_heaters(); @@ -660,10 +662,11 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = false); - // PID Tuning loop - wait_for_heatup = true; // Can be interrupted with M108 LCD_MESSAGE(MSG_HEATING); - while (wait_for_heatup) { + + // PID Tuning loop + wait_for_heatup = true; + while (wait_for_heatup) { // Can be interrupted with M108 const millis_t ms = millis(); @@ -729,6 +732,7 @@ volatile bool Temperature::raw_temps_ready = false; #define MAX_OVERSHOOT_PID_AUTOTUNE 30 #endif if (current_temp > target + MAX_OVERSHOOT_PID_AUTOTUNE) { + SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); @@ -771,11 +775,13 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TUNING_TIMEOUT)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TIMEOUT))); + SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TIMEOUT); break; } if (cycles > ncycles && cycles > 2) { + SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_AUTOTUNE_FINISHED); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE))); @@ -875,7 +881,6 @@ volatile bool Temperature::raw_temps_ready = false; MPC_t& constants = hotend.constants; // move to center of bed, just above bed height and cool with max fan - SERIAL_ECHOLNPGM("Moving to tuning position"); TERN_(HAS_FAN, zero_fan_speeds()); disable_all_heaters(); TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255)); @@ -902,6 +907,7 @@ volatile bool Temperature::raw_temps_ready = false; next_test_ms += 10000UL; } } + TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0)); TERN_(HAS_FAN, planner.sync_fan_speeds(fan_speed)); @@ -909,8 +915,7 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOLNPGM("Heating to 200C"); hotend.soft_pwm_amount = MPC_MAX >> 1; - const millis_t heat_start_time = ms; - next_test_ms = ms; + const millis_t heat_start_time = next_test_ms = ms; celsius_float_t temp_samples[16]; uint8_t sample_count = 0; uint16_t sample_distance = 1; @@ -941,7 +946,7 @@ volatile bool Temperature::raw_temps_ready = false; } hotend.soft_pwm_amount = 0; - // calculate physical constants from three equally spaced samples + // Calculate physical constants from three equally-spaced samples sample_count = (sample_count + 1) / 2 * 2 - 1; const float t1 = temp_samples[0], t2 = temp_samples[(sample_count - 1) >> 1], @@ -957,14 +962,13 @@ volatile bool Temperature::raw_temps_ready = false; hotend.modeled_block_temp = asymp_temp + (ambient_temp - asymp_temp) * exp(-block_responsiveness * (ms - heat_start_time) / 1000.0f); hotend.modeled_sensor_temp = current_temp; - // let the system stabilise under MPC control then get a better measure of ambient loss without and with fan + // Allow the system to stabilize under MPC, then get a better measure of ambient loss with and without fan SERIAL_ECHOLNPGM("Measuring ambient heatloss at target ", hotend.modeled_block_temp); hotend.target = hotend.modeled_block_temp; next_test_ms = ms + MPC_dT * 1000; - constexpr millis_t settle_time = 20000UL, - test_length = 20000UL; + constexpr millis_t settle_time = 20000UL, test_duration = 20000UL; millis_t settle_end_ms = ms + settle_time, - test_end_ms = settle_end_ms + test_length; + test_end_ms = settle_end_ms + test_duration; float total_energy_fan0 = 0.0f; #if HAS_FAN bool fan0_done = false; @@ -987,7 +991,7 @@ volatile bool Temperature::raw_temps_ready = false; set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); planner.sync_fan_speeds(fan_speed); settle_end_ms = ms + settle_time; - test_end_ms = settle_end_ms + test_length; + test_end_ms = settle_end_ms + test_duration; fan0_done = true; } else if (ELAPSED(ms, settle_end_ms) && !ELAPSED(ms, test_end_ms)) @@ -1005,11 +1009,11 @@ volatile bool Temperature::raw_temps_ready = false; } } - const float power_fan0 = total_energy_fan0 * 1000 / test_length; + const float power_fan0 = total_energy_fan0 * 1000 / test_duration; constants.ambient_xfer_coeff_fan0 = power_fan0 / (hotend.target - ambient_temp); #if HAS_FAN - const float power_fan255 = total_energy_fan255 * 1000 / test_length, + const float power_fan255 = total_energy_fan255 * 1000 / test_duration, ambient_xfer_coeff_fan255 = power_fan255 / (hotend.target - ambient_temp); constants.fan255_adjustment = ambient_xfer_coeff_fan255 - constants.ambient_xfer_coeff_fan0; #endif @@ -1371,8 +1375,8 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { #endif #elif ENABLED(MPCTEMP) - MPCHeaterInfo& hotend = temp_hotend[ee]; - MPC_t& constants = hotend.constants; + MPCHeaterInfo &hotend = temp_hotend[ee]; + MPC_t &constants = hotend.constants; // At startup, initialize modeled temperatures if (isnan(hotend.modeled_block_temp)) { From ce0af56d0aa4371620b142ba5b2ed3b455813a5d Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Sun, 10 Apr 2022 07:20:05 +0100 Subject: [PATCH 343/502] =?UTF-8?q?=F0=9F=9A=B8=20Improve=20MPC=20tuning,?= =?UTF-8?q?=20add=20menu=20items=20(#23984,=20#24018,=20#24049,=20#24059)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 4 + Marlin/src/core/language.h | 8 ++ Marlin/src/gcode/temp/M306.cpp | 16 +-- Marlin/src/inc/SanityCheck.h | 4 + Marlin/src/lcd/language/language_en.h | 8 ++ Marlin/src/lcd/menu/menu_advanced.cpp | 52 ++++++++- Marlin/src/module/temperature.cpp | 145 ++++++++++++++++---------- buildroot/tests/BIGTREE_GTR_V1_0 | 12 ++- buildroot/tests/STM32F103RC_btt | 1 - buildroot/tests/STM32F103RC_btt_maple | 1 - buildroot/tests/mega2560 | 5 +- 11 files changed, 181 insertions(+), 75 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index cce5e2f7e937..2a6400044905 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -624,6 +624,9 @@ * for PID_EXTRUSION_SCALING and PID_FAN_SCALING. Use M306 to autotune the model. */ #if ENABLED(MPCTEMP) + //#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1300 bytes of flash) + //#define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash) + #define MPC_MAX BANG_MAX // (0..255) Current to nozzle while MPC is active. #define MPC_HEATER_POWER { 40.0f } // (W) Heat cartridge powers. @@ -652,6 +655,7 @@ #define MPC_STEADYSTATE 0.5f // (K/s) Temperature change rate for steady state logic to be enforced. #define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center just above the surface. + #define MPC_TUNING_END_Z 10.0f // (mm) M306 Autotuning final Z position. #endif //=========================================================================== diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 0b13161976b3..78e30fe50462 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -232,6 +232,14 @@ #define STR_PID_DEBUG_DTERM " dTerm " #define STR_PID_DEBUG_CTERM " cTerm " #define STR_INVALID_EXTRUDER_NUM " - Invalid extruder number !" +#define STR_MPC_AUTOTUNE "MPC Autotune" +#define STR_MPC_AUTOTUNE_START " start for " STR_E +#define STR_MPC_AUTOTUNE_INTERRUPTED " interrupted!" +#define STR_MPC_AUTOTUNE_FINISHED " finished! Put the constants below into Configuration.h" +#define STR_MPC_COOLING_TO_AMBIENT "Cooling to ambient" +#define STR_MPC_HEATING_PAST_200 "Heating to over 200C" +#define STR_MPC_MEASURING_AMBIENT "Measuring ambient heatloss at " +#define STR_MPC_TEMPERATURE_ERROR "Temperature error" #define STR_HEATER_BED "bed" #define STR_HEATER_CHAMBER "chamber" diff --git a/Marlin/src/gcode/temp/M306.cpp b/Marlin/src/gcode/temp/M306.cpp index 9e1a8dd8ef07..0f286e73b236 100644 --- a/Marlin/src/gcode/temp/M306.cpp +++ b/Marlin/src/gcode/temp/M306.cpp @@ -56,17 +56,7 @@ void GcodeSuite::M306() { return; } - HOTEND_LOOP() { - SERIAL_ECHOLNPGM("MPC constants for hotend ", e); - MPC_t& constants = thermalManager.temp_hotend[e].constants; - SERIAL_ECHOLNPGM("Heater power: ", constants.heater_power); - SERIAL_ECHOLNPGM("Heatblock heat capacity: ", constants.block_heat_capacity); - SERIAL_ECHOLNPAIR_F("Sensor responsivness: ", constants.sensor_responsiveness, 4); - SERIAL_ECHOLNPAIR_F("Ambient heat transfer coeff. (no fan): ", constants.ambient_xfer_coeff_fan0, 4); - #if ENABLED(MPC_INCLUDE_FAN) - SERIAL_ECHOLNPAIR_F("Ambient heat transfer coeff. (full fan): ", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); - #endif - } + M306_report(true); } void GcodeSuite::M306_report(const bool forReplay/*=true*/) { @@ -79,7 +69,9 @@ void GcodeSuite::M306_report(const bool forReplay/*=true*/) { SERIAL_ECHOPAIR_F(" C", constants.block_heat_capacity, 2); SERIAL_ECHOPAIR_F(" R", constants.sensor_responsiveness, 4); SERIAL_ECHOPAIR_F(" A", constants.ambient_xfer_coeff_fan0, 4); - SERIAL_ECHOLNPAIR_F(" F", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); + #if ENABLED(MPC_INCLUDE_FAN) + SERIAL_ECHOLNPAIR_F(" F", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); + #endif } } diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 88ba2bb2b6f4..02e32c83eac3 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2856,6 +2856,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "DWIN_CREALITY_LCD requires SDSUPPORT to be enabled." #elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU) #error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU." + #elif EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU) + #error "DWIN_CREALITY_LCD does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU." #elif ENABLED(LEVEL_BED_CORNERS) #error "DWIN_CREALITY_LCD does not support LEVEL_BED_CORNERS." #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) @@ -2866,6 +2868,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "DWIN_LCD_PROUI requires SDSUPPORT to be enabled." #elif EITHER(PID_EDIT_MENU, PID_AUTOTUNE_MENU) #error "DWIN_LCD_PROUI does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU." + #elif EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU) + #error "DWIN_LCD_PROUI does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU." #elif ENABLED(LEVEL_BED_CORNERS) #error "DWIN_LCD_PROUI does not support LEVEL_BED_CORNERS." #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 1358baebc38c..2ba729d6d3eb 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -374,6 +374,14 @@ namespace Language_en { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed! Bad extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); + LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss"); + LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Autotune"); + LSTR MSG_MPC_EDIT = _UxGT("Edit * MPC"); + LSTR MSG_MPC_POWER_E = _UxGT("Power *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Block C *"); + LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor res *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient h *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN255_E= _UxGT("Amb. h fan *"); LSTR MSG_SELECT = _UxGT("Select"); LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 21fa01f2aa4b..bd4ec49889e5 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -245,7 +245,7 @@ void menu_backlash(); } #endif -#if BOTH(AUTOTEMP, HAS_TEMP_HOTEND) || EITHER(PID_AUTOTUNE_MENU, PID_EDIT_MENU) +#if BOTH(AUTOTEMP, HAS_TEMP_HOTEND) || ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU, MPC_AUTOTUNE_MENU, MPC_EDIT_MENU) #define SHOW_MENU_ADVANCED_TEMPERATURE 1 #endif @@ -254,7 +254,17 @@ void menu_backlash(); // #if SHOW_MENU_ADVANCED_TEMPERATURE + #if ENABLED(MPC_EDIT_MENU) + #define MPC_EDIT_DEFS(N) \ + MPC_t &c = thermalManager.temp_hotend[N].constants; \ + TERN_(MPC_INCLUDE_FAN, editable.decimal = c.ambient_xfer_coeff_fan0 + c.fan255_adjustment) + #endif + void menu_advanced_temperature() { + #if ENABLED(MPC_EDIT_MENU) && !HAS_MULTI_HOTEND + MPC_EDIT_DEFS(0); + #endif + START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); @@ -331,6 +341,46 @@ void menu_backlash(); #endif #endif + #if ENABLED(MPC_EDIT_MENU) + + #define _MPC_EDIT_ITEMS(N) \ + EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_POWER_E, &c.heater_power, 1, 200); \ + EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_BLOCK_HEAT_CAPACITY_E, &c.block_heat_capacity, 0, 40); \ + EDIT_ITEM_FAST_N(float43, N, MSG_SENSOR_RESPONSIVENESS_E, &c.sensor_responsiveness, 0, 1); \ + EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_E, &c.ambient_xfer_coeff_fan0, 0, 1) + + #if ENABLED(MPC_INCLUDE_FAN) + #define MPC_EDIT_ITEMS(N) \ + _MPC_EDIT_ITEMS(N); \ + EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN255_E, &editable.decimal, 0, 1, []{ \ + MPC_t &c = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \ + c.fan255_adjustment = editable.decimal - c.ambient_xfer_coeff_fan0; \ + }) + #else + #define MPC_EDIT_ITEMS _MPC_EDIT_ITEMS + #endif + + #if HAS_MULTI_HOTEND + static auto mpc_edit_hotend = [](const uint8_t e) { + MPC_EDIT_DEFS(e); + START_MENU(); + BACK_ITEM(MSG_TEMPERATURE); + MPC_EDIT_ITEMS(e); + END_MENU(); + }; + #define MPC_ENTRY(N) SUBMENU_N(N, MSG_MPC_EDIT, []{ mpc_edit_hotend(MenuItemBase::itemIndex); }); + #else + #define MPC_ENTRY MPC_EDIT_ITEMS + #endif + + REPEAT(HOTENDS, MPC_ENTRY); + + #endif // MPC_EDIT_MENU + + #if ENABLED(MPC_AUTOTUNE_MENU) + ACTION_ITEM(MSG_MPC_AUTOTUNE, []{ queue.inject(F("M306 T")); ui.return_to_status(); }); + #endif + #if ENABLED(PIDTEMPBED) #if ENABLED(PID_EDIT_MENU) _PID_EDIT_ITEMS_TMPL(H_BED, thermalManager.temp_bed); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 6b002e52d9f3..df1e3f6fc832 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -141,8 +141,12 @@ #endif #endif -#if EITHER(MPCTEMP, PID_EXTRUSION_SCALING) +#if ENABLED(MPCTEMP) #include + #include "probe.h" +#endif + +#if EITHER(MPCTEMP, PID_EXTRUSION_SCALING) #include "stepper.h" #endif @@ -870,33 +874,65 @@ volatile bool Temperature::raw_temps_ready = false; if (ELAPSED(ms, next_report_ms)) { next_report_ms += 1000UL; - SERIAL_ECHOLNPGM("Temperature ", current_temp); + + print_heater_states(active_extruder); + SERIAL_EOL(); } hal.idletask(); + TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update()); + + if (!wait_for_heatup) { + SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); + SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_INTERRUPTED); + return false; + } + + return true; }; - SERIAL_ECHOLNPGM("Measuring MPC constants for E", active_extruder); - MPCHeaterInfo& hotend = temp_hotend[active_extruder]; - MPC_t& constants = hotend.constants; + struct OnExit { + ~OnExit() { + wait_for_heatup = false; + + ui.reset_status(); + + temp_hotend[active_extruder].target = 0.0f; + temp_hotend[active_extruder].soft_pwm_amount = 0; + #if HAS_FAN + set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); + planner.sync_fan_speeds(fan_speed); + #endif - // move to center of bed, just above bed height and cool with max fan - TERN_(HAS_FAN, zero_fan_speeds()); + do_z_clearance(MPC_TUNING_END_Z); + } + } on_exit; + + SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); + SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_START, active_extruder); + MPCHeaterInfo &hotend = temp_hotend[active_extruder]; + MPC_t &constants = hotend.constants; + + // Move to center of bed, just above bed height and cool with max fan disable_all_heaters(); - TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255)); - TERN_(HAS_FAN, planner.sync_fan_speeds(fan_speed)); + #if HAS_FAN + zero_fan_speeds(); + set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); + planner.sync_fan_speeds(fan_speed); + #endif gcode.home_all_axes(true); const xyz_pos_t tuningpos = MPC_TUNING_POS; do_blocking_move_to(tuningpos); - SERIAL_ECHOLNPGM("Cooling to ambient"); + SERIAL_ECHOLNPGM(STR_MPC_COOLING_TO_AMBIENT); + LCD_MESSAGE(MSG_COOLING); millis_t ms = millis(), next_report_ms = ms, next_test_ms = ms + 10000UL; celsius_float_t current_temp = degHotend(active_extruder), ambient_temp = current_temp; - wait_for_heatup = true; // Can be interrupted with M108 - while (wait_for_heatup) { - housekeeping(ms, current_temp, next_report_ms); + wait_for_heatup = true; + for (;;) { // Can be interrupted with M108 + if (!housekeeping(ms, current_temp, next_report_ms)) return; if (ELAPSED(ms, next_test_ms)) { if (current_temp >= ambient_temp) { @@ -908,12 +944,16 @@ volatile bool Temperature::raw_temps_ready = false; } } - TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0)); - TERN_(HAS_FAN, planner.sync_fan_speeds(fan_speed)); + #if HAS_FAN + set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); + planner.sync_fan_speeds(fan_speed); + #endif hotend.modeled_ambient_temp = ambient_temp; - SERIAL_ECHOLNPGM("Heating to 200C"); + SERIAL_ECHOLNPGM(STR_MPC_HEATING_PAST_200); + LCD_MESSAGE(MSG_HEATING); + hotend.target = 200.0f; // So M105 looks nice hotend.soft_pwm_amount = MPC_MAX >> 1; const millis_t heat_start_time = next_test_ms = ms; celsius_float_t temp_samples[16]; @@ -921,13 +961,13 @@ volatile bool Temperature::raw_temps_ready = false; uint16_t sample_distance = 1; float t1_time = 0; - while (wait_for_heatup) { - housekeeping(ms, current_temp, next_report_ms); + for (;;) { // Can be interrupted with M108 + if (!housekeeping(ms, current_temp, next_report_ms)) return; if (ELAPSED(ms, next_test_ms)) { - // record samples between 100C and 200C + // Record samples between 100C and 200C if (current_temp >= 100.0f) { - // if there are too many samples, space them more widely + // If there are too many samples, space them more widely if (sample_count == COUNT(temp_samples)) { for (uint8_t i = 0; i < COUNT(temp_samples) / 2; i++) temp_samples[i] = temp_samples[i*2]; @@ -950,9 +990,9 @@ volatile bool Temperature::raw_temps_ready = false; sample_count = (sample_count + 1) / 2 * 2 - 1; const float t1 = temp_samples[0], t2 = temp_samples[(sample_count - 1) >> 1], - t3 = temp_samples[sample_count - 1], - asymp_temp = (t2 * t2 - t1 * t3) / (2 * t2 - t1 - t3), - block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); + t3 = temp_samples[sample_count - 1]; + float asymp_temp = (t2 * t2 - t1 * t3) / (2 * t2 - t1 - t3), + block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); constants.ambient_xfer_coeff_fan0 = constants.heater_power * MPC_MAX / 255 / (asymp_temp - ambient_temp); constants.fan255_adjustment = 0.0f; @@ -963,7 +1003,8 @@ volatile bool Temperature::raw_temps_ready = false; hotend.modeled_sensor_temp = current_temp; // Allow the system to stabilize under MPC, then get a better measure of ambient loss with and without fan - SERIAL_ECHOLNPGM("Measuring ambient heatloss at target ", hotend.modeled_block_temp); + SERIAL_ECHOLNPGM(STR_MPC_MEASURING_AMBIENT, hotend.modeled_block_temp); + LCD_MESSAGE(MSG_MPC_MEASURING_AMBIENT); hotend.target = hotend.modeled_block_temp; next_test_ms = ms + MPC_dT * 1000; constexpr millis_t settle_time = 20000UL, test_duration = 20000UL; @@ -976,18 +1017,16 @@ volatile bool Temperature::raw_temps_ready = false; #endif float last_temp = current_temp; - while (wait_for_heatup) { - housekeeping(ms, current_temp, next_report_ms); + for (;;) { // Can be interrupted with M108 + if (!housekeeping(ms, current_temp, next_report_ms)) return; if (ELAPSED(ms, next_test_ms)) { - // use MPC to control the temperature, let it settle for 30s and then track power output for 10s hotend.soft_pwm_amount = (int)get_pid_output_hotend(active_extruder) >> 1; if (ELAPSED(ms, settle_end_ms) && !ELAPSED(ms, test_end_ms) && TERN1(HAS_FAN, !fan0_done)) total_energy_fan0 += constants.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * constants.block_heat_capacity; #if HAS_FAN else if (ELAPSED(ms, test_end_ms) && !fan0_done) { - SERIAL_ECHOLNPGM("Measuring ambient heatloss with full fan"); set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); planner.sync_fan_speeds(fan_speed); settle_end_ms = ms + settle_time; @@ -1003,8 +1042,8 @@ volatile bool Temperature::raw_temps_ready = false; next_test_ms += MPC_dT * 1000; } - if (!WITHIN(current_temp, hotend.target - 15.0f, hotend.target + 15.0f)) { - SERIAL_ECHOLNPGM("Temperature error while measuring ambient loss"); + if (!WITHIN(current_temp, t3 - 15.0f, hotend.target + 15.0f)) { + SERIAL_ECHOLNPGM(STR_MPC_TEMPERATURE_ERROR); break; } } @@ -1018,16 +1057,14 @@ volatile bool Temperature::raw_temps_ready = false; constants.fan255_adjustment = ambient_xfer_coeff_fan255 - constants.ambient_xfer_coeff_fan0; #endif - hotend.target = 0.0f; - hotend.soft_pwm_amount = 0; - TERN_(HAS_FAN, set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0)); - TERN_(HAS_FAN, planner.sync_fan_speeds(fan_speed)); - - if (!wait_for_heatup) SERIAL_ECHOLNPGM("Test was interrupted"); - - wait_for_heatup = false; + // Calculate a new and better asymptotic temperature and re-evaluate the other constants + asymp_temp = ambient_temp + constants.heater_power / constants.ambient_xfer_coeff_fan0; + block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); + constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness; + constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); - SERIAL_ECHOLNPGM("Done"); + SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); + SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_FINISHED); /* <-- add a slash to enable SERIAL_ECHOLNPGM("t1_time ", t1_time); @@ -1380,7 +1417,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { // At startup, initialize modeled temperatures if (isnan(hotend.modeled_block_temp)) { - hotend.modeled_ambient_temp = min(30.0f, hotend.celsius); // cap initial value at reasonable max room temperature of 30C + hotend.modeled_ambient_temp = min(30.0f, hotend.celsius); // Cap initial value at reasonable max room temperature of 30C hotend.modeled_block_temp = hotend.modeled_sensor_temp = hotend.celsius; } @@ -1401,16 +1438,16 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { const int32_t e_position = stepper.position(E_AXIS); const float e_speed = (e_position - mpc_e_position) * planner.mm_per_step[E_AXIS] / MPC_dT; - // the position can appear to make big jumps when, e.g. homing + // The position can appear to make big jumps when, e.g. homing if (fabs(e_speed) > planner.settings.max_feedrate_mm_s[E_AXIS]) mpc_e_position = e_position; - else if (e_speed > 0.0f) { // ignore retract/recover moves + else if (e_speed > 0.0f) { // Ignore retract/recover moves ambient_xfer_coeff += e_speed * FILAMENT_HEAT_CAPACITY_PERMM; mpc_e_position = e_position; } } - // update the modeled temperatures + // Update the modeled temperatures float blocktempdelta = hotend.soft_pwm_amount * constants.heater_power * (MPC_dT / 127) / constants.block_heat_capacity; blocktempdelta += (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff * MPC_dT / constants.block_heat_capacity; hotend.modeled_block_temp += blocktempdelta; @@ -1424,18 +1461,18 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { hotend.modeled_block_temp += delta_to_apply; hotend.modeled_sensor_temp += delta_to_apply; - // only correct ambient when close to steady state (output power is not clipped or asymptotic temperature is reached) + // Only correct ambient when close to steady state (output power is not clipped or asymptotic temperature is reached) if (WITHIN(hotend.soft_pwm_amount, 1, 126) || fabs(blocktempdelta + delta_to_apply) < (MPC_STEADYSTATE * MPC_dT)) hotend.modeled_ambient_temp += delta_to_apply > 0.f ? max(delta_to_apply, MPC_MIN_AMBIENT_CHANGE * MPC_dT) : min(delta_to_apply, -MPC_MIN_AMBIENT_CHANGE * MPC_dT); float power = 0.0; if (hotend.target != 0 && TERN1(HEATER_IDLE_HANDLER, !heater_idle[ee].timed_out)) { - // plan power level to get to target temperature in 2 seconds + // Plan power level to get to target temperature in 2 seconds power = (hotend.target - hotend.modeled_block_temp) * constants.block_heat_capacity / 2.0f; power -= (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff; } - float pid_output = power * 254.0f / constants.heater_power + 1.0f; // ensure correct quantization into a range of 0 to 127 + float pid_output = power * 254.0f / constants.heater_power + 1.0f; // Ensure correct quantization into a range of 0 to 127 pid_output = constrain(pid_output, 0, MPC_MAX); /* <-- add a slash to enable @@ -2081,7 +2118,7 @@ void Temperature::manage_heater() { - (t.beta_recip * t.res_25_log) - (t.sh_c_coeff * cu(t.res_25_log)); } - // maximum adc value .. take into account the over sampling + // Maximum ADC value .. take into account the over sampling constexpr raw_adc_t adc_max = MAX_RAW_THERMISTOR_VALUE; const raw_adc_t adc_raw = constrain(raw, 1, adc_max - 1); // constrain to prevent divide-by-zero @@ -3081,7 +3118,7 @@ void Temperature::disable_all_heaters() { spiInit(MAX_TC_SPEED_BITS); #endif - MAXTC_CS_WRITE(LOW); // enable MAXTC + MAXTC_CS_WRITE(LOW); // Enable MAXTC DELAY_NS(100); // Ensure 100ns delay // Read a big-endian temperature value without using a library @@ -3090,7 +3127,7 @@ void Temperature::disable_all_heaters() { if (i > 0) max_tc_temp <<= 8; // shift left if not the last byte } - MAXTC_CS_WRITE(HIGH); // disable MAXTC + MAXTC_CS_WRITE(HIGH); // Disable MAXTC #else #if HAS_MAX6675_LIBRARY MAX6675 &max6675ref = THERMO_SEL(max6675_0, max6675_1); @@ -3301,7 +3338,7 @@ void Temperature::isr() { static ADCSensorState adc_sensor_state = StartupDelay; static uint8_t pwm_count = _BV(SOFT_PWM_SCALE); - // avoid multiple loads of pwm_count + // Avoid multiple loads of pwm_count uint8_t pwm_count_tmp = pwm_count; #if HAS_ADC_BUTTONS @@ -3579,8 +3616,8 @@ void Temperature::isr() { // 5: / 4 = 244.1406 Hz pwm_count = pwm_count_tmp + _BV(SOFT_PWM_SCALE); - // increment slow_pwm_count only every 64th pwm_count, - // i.e. yielding a PWM frequency of 16/128 Hz (8s). + // Increment slow_pwm_count only every 64th pwm_count, + // i.e., yielding a PWM frequency of 16/128 Hz (8s). if (((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0) { slow_pwm_count++; slow_pwm_count &= 0x7F; @@ -4036,7 +4073,7 @@ void Temperature::isr() { // Prevent a wait-forever situation if R is misused i.e. M109 R0 if (wants_to_cool) { - // break after MIN_COOLING_SLOPE_TIME seconds + // Break after MIN_COOLING_SLOPE_TIME seconds // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { if (old_temp - temp < float(MIN_COOLING_SLOPE_DEG)) break; @@ -4058,7 +4095,7 @@ void Temperature::isr() { wait_for_heatup = false; #if HAS_DWIN_E3V2_BASIC HMI_flag.heat_flag = 0; - duration_t elapsed = print_job_timer.duration(); // print timer + duration_t elapsed = print_job_timer.duration(); // Print timer dwin_heat_time = elapsed.value; #else ui.reset_status(); diff --git a/buildroot/tests/BIGTREE_GTR_V1_0 b/buildroot/tests/BIGTREE_GTR_V1_0 index 919822733b00..93342ed4a472 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0 +++ b/buildroot/tests/BIGTREE_GTR_V1_0 @@ -32,9 +32,15 @@ restore_configs opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \ EXTRUDERS 3 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 \ SERVO_DELAY '{ 300, 300, 300 }' \ - SWITCHING_TOOLHEAD_X_POS '{ 215, 0 ,0 }' -opt_enable SWITCHING_TOOLHEAD TOOL_SENSOR -exec_test $1 $2 "BigTreeTech GTR | Switching Toolhead | Tool Sensors" "$3" + SWITCHING_TOOLHEAD_X_POS '{ 215, 0 ,0 }' \ + MPC_HEATER_POWER '{ 40.0f, 40.0f, 40.0f }' \ + MPC_BLOCK_HEAT_CAPACITY '{ 16.7f, 16.7f, 16.7f }' \ + MPC_SENSOR_RESPONSIVENESS '{ 0.22f, 0.22f, 0.22f }' \ + MPC_AMBIENT_XFER_COEFF '{ 0.068f, 0.068f, 0.068f }' \ + MPC_AMBIENT_XFER_COEFF_FAN255 '{ 0.097f, 0.097f, 0.097f }' +opt_enable SWITCHING_TOOLHEAD TOOL_SENSOR MPCTEMP MPC_EDIT_MENU MPC_AUTOTUNE_MENU +opt_disable PIDTEMP +exec_test $1 $2 "BigTreeTech GTR | MPC | Switching Toolhead | Tool Sensors" "$3" # clean up restore_configs diff --git a/buildroot/tests/STM32F103RC_btt b/buildroot/tests/STM32F103RC_btt index e76060aee82f..16419cbfa232 100755 --- a/buildroot/tests/STM32F103RC_btt +++ b/buildroot/tests/STM32F103RC_btt @@ -13,7 +13,6 @@ restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_0 SERIAL_PORT 1 SERIAL_PORT_2 -1 \ X_DRIVER_TYPE TMC2209 Y_DRIVER_TYPE TMC2209 Z_DRIVER_TYPE TMC2209 E0_DRIVER_TYPE TMC2209 opt_enable PINS_DEBUGGING Z_IDLE_HEIGHT - exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" "$3" # clean up diff --git a/buildroot/tests/STM32F103RC_btt_maple b/buildroot/tests/STM32F103RC_btt_maple index e74e5902132c..90e33ab52925 100755 --- a/buildroot/tests/STM32F103RC_btt_maple +++ b/buildroot/tests/STM32F103RC_btt_maple @@ -13,7 +13,6 @@ restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_0 SERIAL_PORT 1 SERIAL_PORT_2 -1 \ X_DRIVER_TYPE TMC2209 Y_DRIVER_TYPE TMC2209 Z_DRIVER_TYPE TMC2209 E0_DRIVER_TYPE TMC2209 opt_enable PINS_DEBUGGING Z_IDLE_HEIGHT - exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" "$3" # clean up diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560 index 0321e451c4b2..3677abf60ef0 100755 --- a/buildroot/tests/mega2560 +++ b/buildroot/tests/mega2560 @@ -181,7 +181,6 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_C AXIS_RELATIVE_MODES '{ false, false, false }' opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \ LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER MEATPACK_ON_SERIAL_PORT_1 - exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 12864 LCD | meatpack | SERIAL_PORT_2 " "$3" # @@ -196,7 +195,6 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_C AXIS_RELATIVE_MODES '{ false, false, false }' opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT PRINTCOUNTER \ LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER I2C_AMMETER - exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 44780 LCD " "$3" # @@ -207,7 +205,8 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 1 \ TEMP_SENSOR_0 -2 TEMP_SENSOR_REDUNDANT -2 \ TEMP_SENSOR_REDUNDANT_SOURCE E1 TEMP_SENSOR_REDUNDANT_TARGET E0 \ TEMP_0_CS_PIN 11 TEMP_1_CS_PIN 12 - +opt_enable MPCTEMP +opt_disable PIDTEMP exec_test $1 $2 "MEGA2560 RAMPS | Redundant temperature sensor | 2x MAX6675" "$3" # From 4ae54a6229d1704bfc54a85233af40b69e924246 Mon Sep 17 00:00:00 2001 From: Ludy Date: Mon, 18 Apr 2022 11:43:34 +0200 Subject: [PATCH 344/502] =?UTF-8?q?=F0=9F=90=9B=20Update=20German=20langua?= =?UTF-8?q?ge,=20Fix=20FTDI=20(#24047,=20#24048,=20#24227)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- .../bioprinter/advanced_settings.cpp | 76 +++++-------------- .../bioprinter/advanced_settings.h | 6 +- .../bioprinter/confirm_home_e.cpp | 6 +- .../bioprinter/confirm_home_e.h | 6 +- .../bioprinter/confirm_home_xyz.cpp | 6 +- .../bioprinter/confirm_home_xyz.h | 6 +- .../bioprinter/main_menu.cpp | 14 ++-- .../ftdi_eve_touch_ui/bioprinter/main_menu.h | 6 +- .../bioprinter/printing_dialog_box.cpp | 6 +- .../bioprinter/printing_dialog_box.h | 6 +- .../ftdi_eve_touch_ui/bioprinter/screens.h | 14 ++-- .../bioprinter/status_screen.cpp | 6 +- .../bioprinter/status_screen.h | 6 +- .../bioprinter/tune_menu.cpp | 14 ++-- .../ftdi_eve_touch_ui/bioprinter/tune_menu.h | 6 +- .../bioprinter/ui_landscape.h | 3 + .../bioprinter/ui_portrait.h | 3 + .../cocoa_press/advanced_settings_menu.cpp | 10 +-- .../cocoa_press/leveling_menu.cpp | 6 +- .../cocoa_press/main_menu.cpp | 6 +- .../cocoa_press/preheat_menu.cpp | 2 +- .../ftdi_eve_lib/extended/unicode/unicode.cpp | 2 +- .../generic/advanced_settings_menu.cpp | 2 +- .../generic/custom_user_menus.cpp | 4 +- .../generic/developer_menu.cpp | 4 +- .../generic/endstop_state_screen.cpp | 24 ++---- .../generic/filament_menu.cpp | 4 +- .../generic/files_screen.cpp | 4 +- .../generic/interface_settings_screen.cpp | 11 +-- .../ftdi_eve_touch_ui/generic/kill_screen.cpp | 9 +-- .../generic/language_menu.cpp | 2 +- .../generic/leveling_menu.cpp | 4 +- .../ftdi_eve_touch_ui/generic/lock_screen.cpp | 14 +--- .../ftdi_eve_touch_ui/generic/main_menu.cpp | 10 +-- .../generic/status_screen.cpp | 24 ++---- .../generic/touch_registers_screen.cpp | 7 +- .../ftdi_eve_touch_ui/generic/tune_menu.cpp | 9 +-- Marlin/src/lcd/language/language_de.h | 11 +++ Marlin/src/lcd/language/language_en.h | 2 +- Marlin/src/lcd/language/language_it.h | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- Marlin/src/pins/rambo/pins_EINSY_RETRO.h | 2 +- 43 files changed, 155 insertions(+), 214 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index bd88cf5861e2..e8d6abab0ca4 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -2882,7 +2882,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ mesh_conf.goto_mesh_value = true; mesh_conf.mesh_x = mesh_conf.mesh_y = 0; Popup_Handler(MoveWait); - mesh_conf.manual_move();; + mesh_conf.manual_move(); Draw_Menu(UBLMesh); #endif #elif HAS_BED_PROBE diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp index 40ec16a9dfe6..6d42fd41e4dd 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp @@ -1,6 +1,6 @@ -/***************************** - * bio_advanced_settings.cpp * - *****************************/ +/************************* + * advanced_settings.cpp * + *************************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * @@ -28,6 +28,9 @@ using namespace FTDI; using namespace Theme; +#define GRID_COLS 2 +#define GRID_ROWS 9 + void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { if (what & BACKGROUND) { CommandProcessor cmd; @@ -38,58 +41,30 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { if (what & FOREGROUND) { CommandProcessor cmd; cmd.colors(normal_btn) - .font(Theme::font_medium) - #define GRID_ROWS 9 - #define GRID_COLS 2 + .font(Theme::font_medium) .tag(2) .button(BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) - .enabled( - #if HAS_TRINAMIC_CONFIG - 1 - #endif - ) + .enabled(ENABLED(HAS_TRINAMIC_CONFIG)) .tag(3) .button(BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT)) - .enabled( - #if HAS_TRINAMIC_CONFIG - 1 - #endif - ) + .enabled(ENABLED(HAS_TRINAMIC_CONFIG)) .tag(4) .button(BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS)) .tag(5) .button(BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) - .enabled( - #if HAS_MULTI_HOTEND - 1 - #endif - ) + .enabled(ENABLED(HAS_MULTI_HOTEND)) .tag(6) .button(BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) .tag(7) .button(BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) .tag(8) .button(BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) .tag(9) .button(BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) - #if HAS_JUNCTION_DEVIATION - .tag(10) .button(BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION)) - #else - .tag(10) .button(BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK)) - #endif - .enabled( - #if ENABLED(BACKLASH_GCODE) - 1 - #endif - ) + .tag(10) .button(BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) + .enabled(ENABLED(BACKLASH_GCODE)) .tag(11) .button(BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH)) - .enabled( - #if ENABLED(LIN_ADVANCE) - 1 - #endif - ) + .enabled(ENABLED(LIN_ADVANCE)) .tag(12) .button(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE)) .tag(13) .button(BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE)) .tag(14) .button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS)) - .colors(action_btn) + .colors(action_btn) .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); - #undef GRID_COLS - #undef GRID_ROWS } } @@ -100,35 +75,26 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; case 2: GOTO_SCREEN(DisplayTuningScreen); break; #if HAS_TRINAMIC_CONFIG - case 3: GOTO_SCREEN(StepperCurrentScreen); break; - case 4: GOTO_SCREEN(StepperBumpSensitivityScreen); break; + case 3: GOTO_SCREEN(StepperCurrentScreen); break; + case 4: GOTO_SCREEN(StepperBumpSensitivityScreen); break; #endif case 5: GOTO_SCREEN(EndstopStatesScreen); break; #if HAS_MULTI_HOTEND - case 6: GOTO_SCREEN(NozzleOffsetScreen); break; + case 6: GOTO_SCREEN(NozzleOffsetScreen); break; #endif - case 7: GOTO_SCREEN(StepsScreen); break; case 8: GOTO_SCREEN(MaxVelocityScreen); break; case 9: GOTO_SCREEN(DefaultAccelerationScreen); break; - case 10: - #if HAS_JUNCTION_DEVIATION - GOTO_SCREEN(JunctionDeviationScreen); - #else - GOTO_SCREEN(JerkScreen); - #endif - break; + case 10: GOTO_SCREEN(TERN(HAS_JUNCTION_DEVIATION, JunctionDeviationScreen, JerkScreen)); break; #if ENABLED(BACKLASH_GCODE) - case 11: GOTO_SCREEN(BacklashCompensationScreen); break; + case 11: GOTO_SCREEN(BacklashCompensationScreen); break; #endif #if ENABLED(LIN_ADVANCE) - case 12: GOTO_SCREEN(LinearAdvanceScreen); break; + case 12: GOTO_SCREEN(LinearAdvanceScreen); break; #endif case 13: GOTO_SCREEN(InterfaceSettingsScreen); break; case 14: GOTO_SCREEN(RestoreFailsafeDialogBox); break; - - default: - return false; + default: return false; } return true; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.h index 29a21fe5d992..fc30093b762f 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.h @@ -1,6 +1,6 @@ -/*************************** - * bio_advanced_settings.h * - ***************************/ +/*********************** + * advanced_settings.h * + ***********************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_e.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_e.cpp index a5511f94b9eb..b614eada07e1 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_e.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_e.cpp @@ -1,6 +1,6 @@ -/**************************** - * bio_confirm_home_xyz.cpp * - ****************************/ +/************************ + * confirm_home_xyz.cpp * + ************************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_e.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_e.h index 151b784b935b..34895c9d017d 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_e.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_e.h @@ -1,6 +1,6 @@ -/**************************** - * bio_confirm_home_e.h * - ****************************/ +/******************** + * confirm_home_e.h * + ********************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_xyz.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_xyz.cpp index e34df42b84d3..8aab34002105 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_xyz.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_xyz.cpp @@ -1,6 +1,6 @@ -/**************************** - * bio_confirm_home_xyz.cpp * - ****************************/ +/************************ + * confirm_home_xyz.cpp * + ************************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_xyz.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_xyz.h index d8cb1cdb6742..1c1aa369e875 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_xyz.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/confirm_home_xyz.h @@ -1,6 +1,6 @@ -/************************** - * bio_confirm_home_xyz.h * - **************************/ +/********************** + * confirm_home_xyz.h * + **********************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/main_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/main_menu.cpp index adc84dfa25ff..edae2cb04295 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/main_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/main_menu.cpp @@ -1,6 +1,6 @@ -/********************* - * bio_main_menu.cpp * - *********************/ +/***************** + * main_menu.cpp * + *****************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * @@ -28,9 +28,10 @@ using namespace FTDI; using namespace Theme; +#define GRID_COLS 2 +#define GRID_ROWS 10 + void MainMenu::onRedraw(draw_mode_t what) { - #define GRID_ROWS 10 - #define GRID_COLS 2 if (what & BACKGROUND) { CommandProcessor cmd; @@ -56,9 +57,6 @@ void MainMenu::onRedraw(draw_mode_t what) { .colors(action_btn) .tag(1).button(BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); } - - #undef GRID_COLS - #undef GRID_ROWS } bool MainMenu::onTouchEnd(uint8_t tag) { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/main_menu.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/main_menu.h index fdf977fcbfd9..37bbe3dd5e66 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/main_menu.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/main_menu.h @@ -1,6 +1,6 @@ -/********************* - * bio_main_menu.cpp * - *********************/ +/***************** + * main_menu.cpp * + *****************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp index 6d177c5a7b4c..79a49c79a631 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp @@ -1,6 +1,6 @@ -/******************************* - * bio_printing_dialog_box.cpp * - *******************************/ +/*************************** + * printing_dialog_box.cpp * + ***************************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.h index b55038bef282..f260b7441354 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.h @@ -1,6 +1,6 @@ -/***************************** - * bio_printing_dialog_box.h * - *****************************/ +/************************* + * printing_dialog_box.h * + *************************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/screens.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/screens.h index 7294c4aa0b10..81d47179f4f6 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/screens.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/screens.h @@ -96,10 +96,10 @@ enum { #include "../generic/z_offset_screen.h" #include "../generic/files_screen.h" -#include "bio_status_screen.h" -#include "bio_main_menu.h" -#include "bio_tune_menu.h" -#include "bio_advanced_settings.h" -#include "bio_printing_dialog_box.h" -#include "bio_confirm_home_xyz.h" -#include "bio_confirm_home_e.h" +#include "status_screen.h" +#include "main_menu.h" +#include "tune_menu.h" +#include "advanced_settings.h" +#include "printing_dialog_box.h" +#include "confirm_home_xyz.h" +#include "confirm_home_e.h" diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp index 6e4668eb36f5..a6674bed90b6 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp @@ -1,6 +1,6 @@ -/************************* - * bio_status_screen.cpp * - *************************/ +/********************* + * status_screen.cpp * + *********************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.h index 458ddd19a0bd..d074e82de6da 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.h @@ -1,6 +1,6 @@ -/************************* - * bio_status_screen.cpp * - *************************/ +/********************* + * status_screen.cpp * + *********************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/tune_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/tune_menu.cpp index 48eff0a66149..d5b3897c4d2d 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/tune_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/tune_menu.cpp @@ -1,6 +1,6 @@ -/********************* - * bio_tune_menu.cpp * - *********************/ +/***************** + * tune_menu.cpp * + *****************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * @@ -29,10 +29,10 @@ using namespace FTDI; using namespace Theme; using namespace ExtUI; -void TuneMenu::onRedraw(draw_mode_t what) { - #define GRID_ROWS 8 - #define GRID_COLS 2 +#define GRID_COLS 2 +#define GRID_ROWS 8 +void TuneMenu::onRedraw(draw_mode_t what) { if (what & BACKGROUND) { CommandProcessor cmd; cmd.cmd(CLEAR_COLOR_RGB(bg_color)) @@ -56,8 +56,6 @@ void TuneMenu::onRedraw(draw_mode_t what) { .enabled(!isPrinting()).tag(7).button(BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS)) .colors(action_btn) .tag(1).button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); } - #undef GRID_COLS - #undef GRID_ROWS } bool TuneMenu::onTouchEnd(uint8_t tag) { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/tune_menu.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/tune_menu.h index 52fe694f37bb..8677bb5e2d56 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/tune_menu.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/tune_menu.h @@ -1,6 +1,6 @@ -/******************* - * bio_tune_menu.h * - *******************/ +/*************** + * tune_menu.h * + ***************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/ui_landscape.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/ui_landscape.h index 754f6e93e11d..dc70f6c0fc18 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/ui_landscape.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/ui_landscape.h @@ -1,3 +1,6 @@ +/****************** + * ui_landscape.h * + ******************/ /**************************************************************************** * This program is free software: you can redistribute it and/or modify * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/ui_portrait.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/ui_portrait.h index e8b42811224f..7aaf62b7b8cb 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/ui_portrait.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/ui_portrait.h @@ -1,3 +1,6 @@ +/***************** + * ui_portrait.h * + *****************/ /**************************************************************************** * This program is free software: you can redistribute it and/or modify * diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp index 7549e8d54e93..888f2c2cdd24 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp @@ -29,8 +29,8 @@ using namespace FTDI; using namespace ExtUI; using namespace Theme; -#define GRID_ROWS 4 #define GRID_COLS 3 +#define GRID_ROWS 4 #define STEPS_PER_MM_POS BTN_POS(1,1), BTN_SIZE(1,1) #define TMC_CURRENT_POS BTN_POS(2,1), BTN_SIZE(1,1) #define LIN_ADVANCE_POS BTN_POS(3,1), BTN_SIZE(1,1) @@ -53,11 +53,11 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { if (what & FOREGROUND) { CommandProcessor cmd; cmd.colors(normal_btn) - .font(Theme::font_medium) + .font(Theme::font_medium) .tag(2) .button(STEPS_PER_MM_POS, GET_TEXT_F(MSG_STEPS_PER_MM)) - .enabled(ENABLED(HAS_TRINAMIC_CONFIG)) + .enabled(ENABLED(HAS_TRINAMIC_CONFIG)) .tag(3) .button(TMC_CURRENT_POS, GET_TEXT_F(MSG_TMC_CURRENT)) - .enabled(ENABLED(LIN_ADVANCE)) + .enabled(ENABLED(LIN_ADVANCE)) .tag(4) .button(LIN_ADVANCE_POS, GET_TEXT_F(MSG_LINEAR_ADVANCE)) .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) .tag(6) .button(ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) @@ -66,7 +66,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(9) .button(INTERFACE_POS, GET_TEXT_F(MSG_INTERFACE)) .tag(10).button(DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) .tag(11).button(RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS)) - .colors(action_btn) + .colors(action_btn) .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)); } } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp index 5ea9eed0372f..5e61bdb12f18 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp @@ -33,8 +33,8 @@ using namespace FTDI; using namespace ExtUI; using namespace Theme; -#define GRID_ROWS 5 #define GRID_COLS 3 +#define GRID_ROWS 5 #define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(3,1) #define PROBE_BED_POS BTN_POS(1,2), BTN_SIZE(1,1) #define SHOW_MESH_POS BTN_POS(2,2), BTN_SIZE(1,1) @@ -60,9 +60,9 @@ void LevelingMenu::onRedraw(draw_mode_t what) { .text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH)) .font(font_medium).colors(normal_btn) .tag(2).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED)) - .enabled(ENABLED(HAS_MESH)) + .enabled(ENABLED(HAS_MESH)) .tag(3).button(SHOW_MESH_POS, GET_TEXT_F(MSG_MESH_VIEW)) - .enabled(ENABLED(HAS_MESH)) + .enabled(ENABLED(HAS_MESH)) .tag(4).button(EDIT_MESH_POS, GET_TEXT_F(MSG_EDIT_MESH)) #undef GRID_COLS #define GRID_COLS 2 diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp index 2d404aff6c98..ee299a7f64d6 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp @@ -29,8 +29,8 @@ using namespace FTDI; using namespace Theme; -#define GRID_ROWS 6 #define GRID_COLS 2 +#define GRID_ROWS 6 #define ZPROBE_ZOFFSET_POS BTN_POS(1,1), BTN_SIZE(1,1) #define MOVE_XYZ_POS BTN_POS(1,2), BTN_SIZE(1,1) @@ -57,14 +57,14 @@ void MainMenu::onRedraw(draw_mode_t what) { .font(Theme::font_medium) .tag( 2).button(MOVE_XYZ_POS, GET_TEXT_F(MSG_XYZ_MOVE)) .tag( 3).button(TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) - .enabled(BOTH(HAS_LEVELING, HAS_BED_PROBE)) + .enabled(BOTH(HAS_LEVELING, HAS_BED_PROBE)) .tag( 4).button(ZPROBE_ZOFFSET_POS, GET_TEXT_F(MSG_ZPROBE_ZOFFSET)) .tag( 5).button(MOVE_E_POS, GET_TEXT_F(MSG_E_MOVE)) .tag( 6).button(SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) .tag( 7).button(FLOW_POS, GET_TEXT_F(MSG_FLOW)) .tag( 8).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) .tag( 9).button(DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS)) - .enabled(HAS_LEVELING) + .enabled(ENABLED(HAS_LEVELING)) .tag(10).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) .tag(11).button(ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) .colors(action_btn) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp index b5ce10810636..b01aa81dd441 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp @@ -28,8 +28,8 @@ using namespace FTDI; using namespace ExtUI; using namespace Theme; -#define GRID_ROWS 5 #define GRID_COLS 2 +#define GRID_ROWS 5 void PreheatMenu::onRedraw(draw_mode_t what) { const int16_t w = TERN0(COCOA_PRESS_EXTRA_HEATER, has_extra_heater() ? BTN_W(1) : BTN_W(2)); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp index d428f686b7bb..ab52a59b9acc 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -74,7 +74,7 @@ return val; } - utf8_char_t FTDI::get_utf8_char_and_inc(char *&c) { + utf8_char_t FTDI::get_utf8_char_and_inc(const char *&c) { utf8_char_t val = *(uint8_t*)c++; if ((val & 0xC0) == 0xC0) while ((*c & 0xC0) == 0x80) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp index a83cc075156c..8e0a01e1c8a3 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp @@ -64,8 +64,8 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { #define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1) #endif #else - #define GRID_ROWS 6 #define GRID_COLS 3 + #define GRID_ROWS 6 #define ZPROBE_ZOFFSET_POS BTN_POS(1,1), BTN_SIZE(1,1) #define CASE_LIGHT_POS BTN_POS(1,4), BTN_SIZE(1,1) #define STEPS_PER_MM_POS BTN_POS(2,1), BTN_SIZE(1,1) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/custom_user_menus.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/custom_user_menus.cpp index bcdcad17be03..2fc6aec09582 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/custom_user_menus.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/custom_user_menus.cpp @@ -54,8 +54,8 @@ void CustomUserMenus::onRedraw(draw_mode_t what) { #endif #if ENABLED(TOUCH_UI_PORTRAIT) - #define GRID_ROWS 11 #define GRID_COLS (1 + _MORE_THAN_TEN) + #define GRID_ROWS 11 #define USER_ITEM_POS(N) BTN_POS((1+((N-1)/10)), ((N-1) % 10 + 1)), BTN_SIZE(1,1) #define BACK_POS BTN_POS(1,11), BTN_SIZE(1,1) #else @@ -64,8 +64,8 @@ void CustomUserMenus::onRedraw(draw_mode_t what) { #else #define _MORE_THAN_FIVE 0 #endif - #define GRID_ROWS 6 #define GRID_COLS (1 + _MORE_THAN_FIVE + _MORE_THAN_TEN + _MORE_THAN_FIFTEEN) + #define GRID_ROWS 6 #define USER_ITEM_POS(N) BTN_POS((1+((N-1)/5)), ((N-1) % 5 + 1)), BTN_SIZE(1,1) #define BACK_POS BTN_POS(1,6), BTN_SIZE(GRID_COLS,1) #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/developer_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/developer_menu.cpp index 34c754d53566..2ec8a3bbd19f 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/developer_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/developer_menu.cpp @@ -52,8 +52,8 @@ void DeveloperMenu::onRedraw(draw_mode_t what) { cmd.cmd(COLOR_RGB(bg_text_enabled)); #if ENABLED(TOUCH_UI_PORTRAIT) - #define GRID_ROWS 10 #define GRID_COLS 1 + #define GRID_ROWS 10 cmd.font(font_large) .text ( BTN_POS(1,1), BTN_SIZE(1,1), F("Developer Menu")) .colors(normal_btn) .tag(2).font(font_medium) .button(BTN_POS(1,2), BTN_SIZE(1,1), F("Show All Widgets")) @@ -68,8 +68,8 @@ void DeveloperMenu::onRedraw(draw_mode_t what) { .tag(1).colors(action_btn) .button(BTN_POS(1,10), BTN_SIZE(1,1), F("Back")); #else - #define GRID_ROWS 6 #define GRID_COLS 2 + #define GRID_ROWS 6 cmd.font(font_medium) .text ( BTN_POS(1,1), BTN_SIZE(2,1), F("Developer Menu")) .colors(normal_btn) .tag(2).font(font_small) .button(BTN_POS(1,2), BTN_SIZE(1,1), F("Show All Widgets")) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/endstop_state_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/endstop_state_screen.cpp index c7042e760e48..f7e57cf0b9a0 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/endstop_state_screen.cpp @@ -37,6 +37,13 @@ void EndstopStatesScreen::onExit() { BaseScreen::onExit(); } +#define GRID_COLS 6 +#define GRID_ROWS 7 + +#define PIN_BTN(X,Y,PIN,LABEL) button(BTN_POS(X,Y), BTN_SIZE(2,1), LABEL) +#define PIN_ENABLED(X,Y,LABEL,PIN,INV) cmd.enabled(1).colors(READ(PIN##_PIN) != INV ? action_btn : normal_btn).PIN_BTN(X,Y,PIN,LABEL); +#define PIN_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL); + void EndstopStatesScreen::onRedraw(draw_mode_t) { CommandProcessor cmd; cmd.cmd(CLEAR_COLOR_RGB(bg_color)) @@ -44,20 +51,7 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { .cmd(CLEAR(true,true,true)) .tag(0); - #define GRID_ROWS 7 - #define GRID_COLS 6 - - #define PIN_BTN(X,Y,PIN,LABEL) button(BTN_POS(X,Y), BTN_SIZE(2,1), LABEL) - #define PIN_ENABLED(X,Y,LABEL,PIN,INV) cmd.enabled(1).colors(READ(PIN##_PIN) != INV ? action_btn : normal_btn).PIN_BTN(X,Y,PIN,LABEL); - #define PIN_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL); - - cmd.font( - #if ENABLED(TOUCH_UI_PORTRAIT) - font_large - #else - font_medium - #endif - ) + cmd.font(TERN(TOUCH_UI_PORTRAIT, font_large, font_medium)) .text(BTN_POS(1,1), BTN_SIZE(6,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) .font(font_tiny); #if HAS_X_MAX @@ -121,8 +115,6 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { cmd.font(font_medium) .colors(action_btn) .tag(1).button(BTN_POS(1,7), BTN_SIZE(6,1), GET_TEXT_F(MSG_BUTTON_DONE)); - #undef GRID_COLS - #undef GRID_ROWS } bool EndstopStatesScreen::onTouchEnd(uint8_t tag) { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_menu.cpp index 9c9e70cebfc1..777698c39860 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_menu.cpp @@ -30,15 +30,15 @@ using namespace ExtUI; using namespace Theme; #if ENABLED(TOUCH_UI_PORTRAIT) - #define GRID_ROWS 9 #define GRID_COLS 2 + #define GRID_ROWS 9 #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) #define RUNOUT_SENSOR_POS BTN_POS(1,2), BTN_SIZE(2,1) #define LIN_ADVANCE_POS BTN_POS(1,3), BTN_SIZE(2,1) #define BACK_POS BTN_POS(1,9), BTN_SIZE(2,1) #else - #define GRID_ROWS 6 #define GRID_COLS 2 + #define GRID_ROWS 6 #define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) #define RUNOUT_SENSOR_POS BTN_POS(1,2), BTN_SIZE(2,1) #define LIN_ADVANCE_POS BTN_POS(1,3), BTN_SIZE(2,1) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp index 6f428fa17487..00768dbaf7de 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp @@ -28,7 +28,7 @@ #if ENABLED(TOUCH_UI_PORTRAIT) #define GRID_COLS 6 - #define GRID_ROWS 15 + #define GRID_ROWS 15 #define FILES_PER_PAGE 11 #define PREV_DIR LEFT #define NEXT_DIR RIGHT @@ -40,7 +40,7 @@ #define BTN1_POS BTN_POS(1,14), BTN_SIZE(3,2) #define BTN2_POS BTN_POS(4,14), BTN_SIZE(3,2) #else - #define GRID_COLS 12 + #define GRID_COLS 12 #define GRID_ROWS 8 #define FILES_PER_PAGE 6 #define PREV_DIR UP diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/interface_settings_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/interface_settings_screen.cpp index 5b160c80dfa6..fa4516daab1d 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/interface_settings_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/interface_settings_screen.cpp @@ -52,14 +52,13 @@ void InterfaceSettingsScreen::onEntry() { BaseScreen::onEntry(); } +#define GRID_COLS 4 +#define GRID_ROWS TERN(TOUCH_UI_PORTRAIT, 7, 6) + void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { CommandProcessor cmd; if (what & BACKGROUND) { - - #define GRID_COLS 4 - #define GRID_ROWS TERN(TOUCH_UI_PORTRAIT, 7, 6) - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) .cmd(CLEAR(true,true,true)) .cmd(COLOR_RGB(bg_text_enabled)) @@ -128,7 +127,7 @@ bool InterfaceSettingsScreen::onTouchEnd(uint8_t tag) { LockScreen::disable(); break; #endif - case 5: UIData::enable_animations(!UIData::animations_enabled());; break; + case 5: UIData::enable_animations(!UIData::animations_enabled()); break; case 6: GOTO_SCREEN(InterfaceSoundsScreen); return true; default: return false; @@ -148,8 +147,6 @@ bool InterfaceSettingsScreen::onTouchStart(uint8_t tag) { } #undef EDGE_R #define EDGE_R 0 - #undef GRID_COLS - #undef GRID_ROWS return true; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/kill_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/kill_screen.cpp index bb44a8717693..61f8caa277f5 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/kill_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/kill_screen.cpp @@ -27,6 +27,9 @@ using namespace FTDI; +#define GRID_COLS 4 +#define GRID_ROWS 8 + // The kill screen is an oddball that happens after Marlin has killed the events // loop. So we only have a show() method rather than onRedraw(). The KillScreen // should not be used as a model for other UI screens as it is an exception. @@ -39,18 +42,12 @@ void KillScreen::show(const char *message) { .cmd(CLEAR(true,true,true)) .tag(0); - #define GRID_COLS 4 - #define GRID_ROWS 8 - cmd.font(Theme::font_large) .cmd(COLOR_RGB(Theme::bg_text_enabled)) .text(BTN_POS(1,2), BTN_SIZE(4,1), message) .text(BTN_POS(1,3), BTN_SIZE(4,1), GET_TEXT_F(MSG_HALTED)) .text(BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_PLEASE_RESET)); - #undef GRID_COLS - #undef GRID_ROWS - cmd.cmd(DL::DL_DISPLAY) .cmd(CMD_SWAP) .execute(); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/language_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/language_menu.cpp index ce6045018b10..499f741540ab 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/language_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/language_menu.cpp @@ -37,8 +37,8 @@ void LanguageMenu::onRedraw(draw_mode_t) { .colors(normal_btn) .font(Theme::font_medium); - #define GRID_ROWS 8 #define GRID_COLS 1 + #define GRID_ROWS 8 cmd.tag(1).button(BTN_POS(1,1), BTN_SIZE(1,1), GET_LANGUAGE_NAME(1)); cmd.tag(2).button(BTN_POS(1,2), BTN_SIZE(1,1), GET_LANGUAGE_NAME(2)); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/leveling_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/leveling_menu.cpp index 11db21aca9c2..2fb9d18498c0 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/leveling_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/leveling_menu.cpp @@ -34,8 +34,8 @@ using namespace ExtUI; using namespace Theme; #if ENABLED(TOUCH_UI_PORTRAIT) - #define GRID_ROWS 8 #define GRID_COLS 2 + #define GRID_ROWS 8 #define LEVELING_TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) #define LEVEL_AXIS_POS BTN_POS(1,2), BTN_SIZE(2,1) #define BED_MESH_TITLE_POS BTN_POS(1,3), BTN_SIZE(2,1) @@ -48,8 +48,8 @@ using namespace Theme; #define BLTOUCH_TEST_POS BTN_POS(2,7), BTN_SIZE(1,1) #define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1) #else - #define GRID_ROWS 6 #define GRID_COLS 3 + #define GRID_ROWS 6 #define LEVELING_TITLE_POS BTN_POS(1,1), BTN_SIZE(3,1) #define LEVEL_AXIS_POS BTN_POS(1,2), BTN_SIZE(3,1) #define BED_MESH_TITLE_POS BTN_POS(1,3), BTN_SIZE(2,1) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/lock_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/lock_screen.cpp index df8eabbe61be..82b9b2bd19f5 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/lock_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/lock_screen.cpp @@ -39,6 +39,9 @@ void LockScreen::onEntry() { BaseScreen::onEntry(); } +#define GRID_COLS 1 +#define GRID_ROWS TERN(TOUCH_UI_PORTRAIT, 10, 7) + void LockScreen::onRedraw(draw_mode_t what) { CommandProcessor cmd; @@ -50,14 +53,6 @@ void LockScreen::onRedraw(draw_mode_t what) { } if (what & FOREGROUND) { - #if ENABLED(TOUCH_UI_PORTRAIT) - #define GRID_COLS 1 - #define GRID_ROWS 10 - #else - #define GRID_COLS 1 - #define GRID_ROWS 7 - #endif - #undef MARGIN_T #undef MARGIN_B #define MARGIN_T 3 @@ -108,9 +103,6 @@ void LockScreen::onRedraw(draw_mode_t what) { #undef MARGIN_B #define MARGIN_T MARGIN_DEFAULT #define MARGIN_B MARGIN_DEFAULT - - #undef GRID_COLS - #undef GRID_ROWS } } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp index 6ccda405fcc3..001f97490b1d 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp @@ -37,8 +37,8 @@ void MainMenu::onRedraw(draw_mode_t what) { } #if ENABLED(TOUCH_UI_PORTRAIT) - #define GRID_ROWS 8 #define GRID_COLS 2 + #define GRID_ROWS 8 #define ABOUT_PRINTER_POS BTN_POS(1,1), BTN_SIZE(2,1) #define ADVANCED_SETTINGS_POS BTN_POS(1,2), BTN_SIZE(2,1) #if ENABLED(CUSTOM_MENU_MAIN) @@ -55,8 +55,8 @@ void MainMenu::onRedraw(draw_mode_t what) { #define CLEAN_NOZZLE_POS BTN_POS(2,7), BTN_SIZE(1,1) #define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1) #else - #define GRID_ROWS 5 #define GRID_COLS 6 + #define GRID_ROWS 5 #define ADVANCED_SETTINGS_POS BTN_POS(1,1), BTN_SIZE(3,1) #define ABOUT_PRINTER_POS BTN_POS(4,1), BTN_SIZE(3,1) #define AUTO_HOME_POS BTN_POS(1,2), BTN_SIZE(3,1) @@ -80,15 +80,15 @@ void MainMenu::onRedraw(draw_mode_t what) { cmd.colors(normal_btn) .font(Theme::font_medium) .tag( 2).button(AUTO_HOME_POS, GET_TEXT_F(MSG_AUTO_HOME)) - .enabled(ENABLED(NOZZLE_CLEAN_FEATURE)) + .enabled(ENABLED(NOZZLE_CLEAN_FEATURE)) .tag( 3).button(CLEAN_NOZZLE_POS, GET_TEXT_F(MSG_CLEAN_NOZZLE)) .tag( 4).button(MOVE_AXIS_POS, GET_TEXT_F(MSG_MOVE_AXIS)) .tag( 5).button(DISABLE_STEPPERS_POS,GET_TEXT_F(MSG_DISABLE_STEPPERS)) .tag( 6).button(TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE)) - .enabled(IF_DISABLED(TOUCH_UI_LULZBOT_BIO, 1)) + .enabled(DISABLED(TOUCH_UI_LULZBOT_BIO)) .tag( 7).button(FILAMENTCHANGE_POS, GET_TEXT_F(MSG_FILAMENTCHANGE)) .tag( 8).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) - .enabled(TERN_(HAS_LEVELING, 1)) + .enabled(ENABLED(HAS_LEVELING)) .tag( 9).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) .tag(10).button(ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) #if ENABLED(CUSTOM_MENU_MAIN) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp index 7310577995e5..43f33fb3bf0b 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp @@ -31,17 +31,12 @@ using namespace FTDI; using namespace Theme; -#if ENABLED(TOUCH_UI_PORTRAIT) - #define GRID_ROWS 16 -#else - #define GRID_ROWS 16 -#endif +#define GRID_COLS 3 +#define GRID_ROWS 16 void StatusScreen::draw_axis_position(draw_mode_t what) { CommandProcessor cmd; - #define GRID_COLS 3 - #if ENABLED(TOUCH_UI_PORTRAIT) #define X_LBL_POS BTN_POS(1, 9), BTN_SIZE(1,2) #define Y_LBL_POS BTN_POS(1,11), BTN_SIZE(1,2) @@ -106,15 +101,10 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { .text(Y_VAL_POS, y_str) .text(Z_VAL_POS, z_str); } - - #undef GRID_COLS } -#if ENABLED(TOUCH_UI_PORTRAIT) - #define GRID_COLS 8 -#else - #define GRID_COLS 12 -#endif +#undef GRID_COLS +#define GRID_COLS TERN(TOUCH_UI_PORTRAIT, 8, 12) void StatusScreen::draw_temperature(draw_mode_t what) { using namespace Theme; @@ -293,11 +283,10 @@ void StatusScreen::draw_progress(draw_mode_t what) { .text(PROGRESS_POS, progress_str); #endif } - - #undef GRID_COLS } void StatusScreen::draw_interaction_buttons(draw_mode_t what) { + #undef GRID_COLS #define GRID_COLS 4 if (what & FOREGROUND) { using namespace ExtUI; @@ -321,10 +310,10 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) { .colors(!has_media ? action_btn : normal_btn) .tag(4).button(MENU_BTN_POS, GET_TEXT_F(MSG_BUTTON_MENU)); } - #undef GRID_COLS } void StatusScreen::draw_status_message(draw_mode_t what, const char *message) { + #undef GRID_COLS #define GRID_COLS 1 #if ENABLED(TOUCH_UI_PORTRAIT) @@ -341,7 +330,6 @@ void StatusScreen::draw_status_message(draw_mode_t what, const char *message) { draw_text_box(cmd, STATUS_POS, message, OPT_CENTER, font_large); } - #undef GRID_COLS } void StatusScreen::setStatusMessage(FSTR_P message) { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/touch_registers_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/touch_registers_screen.cpp index 5475d67a80b7..6ef8bb452549 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/touch_registers_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/touch_registers_screen.cpp @@ -28,6 +28,9 @@ using namespace FTDI; using namespace Theme; +#define GRID_COLS 2 +#define GRID_ROWS 7 + void TouchRegistersScreen::onRedraw(draw_mode_t) { const uint32_t T_Transform_A = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_A); const uint32_t T_Transform_B = CLCD::mem_read_32(CLCD::REG::TOUCH_TRANSFORM_B); @@ -42,8 +45,6 @@ void TouchRegistersScreen::onRedraw(draw_mode_t) { .cmd(CLEAR(true,true,true)) .tag(0); - #define GRID_ROWS 7 - #define GRID_COLS 2 cmd.tag(0) .font(font_xsmall) .fgcolor(transformA) .button(BTN_POS(1,1), BTN_SIZE(1,1), F("TOUCH_XFORM_A")) @@ -69,8 +70,6 @@ void TouchRegistersScreen::onRedraw(draw_mode_t) { cmd.colors(action_btn).font(font_medium) .tag(1).button(BTN_POS(2,7), BTN_SIZE(1,1), F("Back")); - #undef GRID_COLS - #undef GRID_ROWS } bool TouchRegistersScreen::onTouchEnd(uint8_t tag) { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/tune_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/tune_menu.cpp index 98150ceccb3d..0370c4417478 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/tune_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/tune_menu.cpp @@ -30,6 +30,9 @@ using namespace FTDI; using namespace Theme; +#define GRID_COLS 2 +#define GRID_ROWS TERN(TOUCH_UI_PORTRAIT, 9, 5) + void TuneMenu::onRedraw(draw_mode_t what) { if (what & BACKGROUND) { CommandProcessor cmd; @@ -38,8 +41,6 @@ void TuneMenu::onRedraw(draw_mode_t what) { } #if ENABLED(TOUCH_UI_PORTRAIT) - #define GRID_ROWS 9 - #define GRID_COLS 2 #define TEMPERATURE_POS BTN_POS(1,1), BTN_SIZE(2,1) #define FIL_CHANGE_POS BTN_POS(1,2), BTN_SIZE(2,1) #define FILAMENT_POS BTN_POS(1,3), BTN_SIZE(2,1) @@ -51,8 +52,6 @@ void TuneMenu::onRedraw(draw_mode_t what) { #define ADVANCED_SETTINGS_POS BTN_POS(1,9), BTN_SIZE(1,1) #define BACK_POS BTN_POS(2,9), BTN_SIZE(1,1) #else - #define GRID_ROWS 5 - #define GRID_COLS 2 #define TEMPERATURE_POS BTN_POS(1,1), BTN_SIZE(1,1) #define NUDGE_NOZ_POS BTN_POS(2,1), BTN_SIZE(1,1) #define FIL_CHANGE_POS BTN_POS(1,2), BTN_SIZE(1,1) @@ -94,8 +93,6 @@ void TuneMenu::onRedraw(draw_mode_t what) { .tag(1).colors(action_btn) .button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)); } - #undef GRID_COLS - #undef GRID_ROWS } bool TuneMenu::onTouchEnd(uint8_t tag) { diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index f830fc982163..111608dd4671 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -87,6 +87,9 @@ namespace Language_de { LSTR MSG_HOME_OFFSET_I = _UxGT("Homeversatz ") STR_I; LSTR MSG_HOME_OFFSET_J = _UxGT("Homeversatz ") STR_J; LSTR MSG_HOME_OFFSET_K = _UxGT("Homeversatz ") STR_K; + LSTR MSG_HOME_OFFSET_U = _UxGT("Homeversatz ") STR_U; + LSTR MSG_HOME_OFFSET_V = _UxGT("Homeversatz ") STR_V; + LSTR MSG_HOME_OFFSET_W = _UxGT("Homeversatz ") STR_W; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Homeversatz aktiv"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Assistent"); LSTR MSG_SELECT_ORIGIN = _UxGT("Wählen Sie Ursprung"); @@ -329,6 +332,14 @@ namespace Language_de { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune fehlge.! Falscher Extruder"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune fehlge.! Temperatur zu hoch."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune fehlge.! Timeout."); + LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("teste Wärmeverlust"); + LSTR MSG_MPC_AUTOTUNE = _UxGT("Autotune MPC"); + LSTR MSG_MPC_EDIT = _UxGT("MPC * bearbeiten"); + LSTR MSG_MPC_POWER_E = _UxGT("* Leistung"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Block C *"); + LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor res *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient h *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Amb. h fan *"); LSTR MSG_SELECT = _UxGT("Auswählen"); LSTR MSG_SELECT_E = _UxGT("Auswählen *"); LSTR MSG_ACC = _UxGT("Beschleunigung"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 2ba729d6d3eb..9906f78c6060 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -381,7 +381,7 @@ namespace Language_en { LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Block C *"); LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor res *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient h *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN255_E= _UxGT("Amb. h fan *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Amb. h fan *"); LSTR MSG_SELECT = _UxGT("Select"); LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 3e65dde7863d..82c595aa8c22 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -353,7 +353,7 @@ namespace Language_it { LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("C blocco *"); LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Reattiv.Sens. *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H ambiente *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN255_E= _UxGT("H Amb. vent. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("H Amb. vent. *"); LSTR MSG_SELECT = _UxGT("Seleziona"); LSTR MSG_SELECT_E = _UxGT("Seleziona *"); LSTR MSG_ACC = _UxGT("Accel"); diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index bd4ec49889e5..504097252561 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -352,7 +352,7 @@ void menu_backlash(); #if ENABLED(MPC_INCLUDE_FAN) #define MPC_EDIT_ITEMS(N) \ _MPC_EDIT_ITEMS(N); \ - EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN255_E, &editable.decimal, 0, 1, []{ \ + EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN_E, &editable.decimal, 0, 1, []{ \ MPC_t &c = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \ c.fan255_adjustment = editable.decimal - c.ambient_xfer_coeff_fan0; \ }) diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h index 8bc0a90c0586..413eb8c98cc6 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h @@ -84,7 +84,7 @@ #endif #define Z_MAX_PIN 7 -#ifndef Z_MIN_PIN 7 +#ifndef Z_MIN_PIN #define Z_MIN_PIN 10 // Z- #endif From dbd00d992705a07b3da769549495d6505cb96b43 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 4 Apr 2022 15:57:03 -0500 Subject: [PATCH 345/502] =?UTF-8?q?=E2=9C=A8=20DOGM=20Display=20Sleep=20(#?= =?UTF-8?q?23992)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: borland1 --- Marlin/Configuration_adv.h | 11 ++++ Marlin/src/core/language.h | 1 + Marlin/src/gcode/gcode.h | 6 +++ Marlin/src/gcode/lcd/M255.cpp | 58 ++++++++++++++++++++++ Marlin/src/inc/Conditionals_adv.h | 6 +++ Marlin/src/inc/SanityCheck.h | 11 ++++ Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 5 ++ Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/lcd/marlinui.cpp | 14 ++++++ Marlin/src/lcd/marlinui.h | 8 +++ Marlin/src/lcd/menu/menu_configuration.cpp | 2 + Marlin/src/module/settings.cpp | 17 ++++++- ini/features.ini | 3 +- 13 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 Marlin/src/gcode/lcd/M255.cpp diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index def5d06c4523..4fdec050b572 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1671,6 +1671,17 @@ // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. //#define USE_SMALL_INFOFONT + /** + * Graphical Display Sleep + * + * The U8G library provides sleep / wake functions for SH1106, SSD1306, + * SSD1309, and some other DOGM displays. + * Enable this option to save energy and prevent OLED pixel burn-in. + * Adds the menu item Configuration > LCD Timeout (m) to set a wait period + * from 0 (disabled) to 99 minutes. + */ + //#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen + /** * ST7920-based LCDs can emulate a 16 x 4 character display using * the ST7920 character-generator for very fast screen updates. diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 78e30fe50462..fe89a3536f1b 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -315,6 +315,7 @@ #define STR_MATERIAL_HEATUP "Material heatup parameters" #define STR_LCD_CONTRAST "LCD Contrast" #define STR_LCD_BRIGHTNESS "LCD Brightness" +#define STR_DISPLAY_SLEEP "Display Sleep" #define STR_UI_LANGUAGE "UI Language" #define STR_Z_PROBE_OFFSET "Z-Probe Offset" #define STR_TEMPERATURE_UNITS "Temperature Units" diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index d60427a31ad2..fe03879a0c36 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -202,6 +202,7 @@ * M226 - Wait until a pin is in a given state: "M226 P S" (Requires DIRECT_PIN_CONTROL) * M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE) * M250 - Set LCD contrast: "M250 C" (0-63). (Requires LCD support) + * M255 - Set LCD sleep time: "M255 S" (0-99). (Requires an LCD with brightness or sleep/wake) * M256 - Set LCD brightness: "M256 B" (0-255). (Requires an LCD with brightness control) * M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS) * M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS) @@ -878,6 +879,11 @@ class GcodeSuite { static void M250_report(const bool forReplay=true); #endif + #if HAS_DISPLAY_SLEEP + static void M255(); + static void M255_report(const bool forReplay=true); + #endif + #if HAS_LCD_BRIGHTNESS static void M256(); static void M256_report(const bool forReplay=true); diff --git a/Marlin/src/gcode/lcd/M255.cpp b/Marlin/src/gcode/lcd/M255.cpp new file mode 100644 index 000000000000..cfdf27b8a1fc --- /dev/null +++ b/Marlin/src/gcode/lcd/M255.cpp @@ -0,0 +1,58 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include "../../inc/MarlinConfig.h" + +#if HAS_GCODE_M255 + +#include "../gcode.h" +#include "../../lcd/marlinui.h" + +/** + * M255: Set the LCD sleep timeout (in minutes) + * S - Period of inactivity required for display / backlight sleep + */ +void GcodeSuite::M255() { + if (parser.seenval('S')) { + #if HAS_DISPLAY_SLEEP + const int m = parser.value_int(); + ui.sleep_timeout_minutes = constrain(m, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX); + #else + const int s = parser.value_int() * 60; + ui.lcd_backlight_timeout = constrain(s, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX); + #endif + } + else + M255_report(); +} + +void GcodeSuite::M255_report(const bool forReplay/*=true*/) { + report_heading_etc(forReplay, F(STR_DISPLAY_SLEEP)); + SERIAL_ECHOLNPGM(" M255 S", + #if HAS_DISPLAY_SLEEP + ui.sleep_timeout_minutes, " ; (minutes)" + #else + ui.lcd_backlight_timeout, " ; (seconds)" + #endif + ); +} + +#endif // HAS_GCODE_M255 diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index f3ad41eabb89..f82bd9b7408c 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -628,6 +628,12 @@ #if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, SDSUPPORT) #define HAS_LEDS_OFF_FLAG 1 #endif +#ifdef DISPLAY_SLEEP_MINUTES + #define HAS_DISPLAY_SLEEP 1 +#endif +#if HAS_DISPLAY_SLEEP || LCD_BACKLIGHT_TIMEOUT + #define HAS_GCODE_M255 1 +#endif #if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451) #define HAS_MOTOR_CURRENT_I2C 1 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 02e32c83eac3..4b7317d96a5c 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2885,6 +2885,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif +/** + * Display Sleep is not supported by these common displays + */ +#if HAS_DISPLAY_SLEEP + #if ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI, ENDER2_STOCKDISPLAY, MINIPANEL) + #error "DISPLAY_SLEEP_MINUTES is not supported by your display." + #elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255) + #error "DISPLAY_SLEEP_MINUTES must be between 0 and 255." + #endif +#endif + /** * Some boards forbid the use of -1 Native USB */ diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 35bcf2599255..eacd3d0afb74 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -342,6 +342,11 @@ void MarlinUI::draw_kill_screen() { void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop +#if HAS_DISPLAY_SLEEP + void MarlinUI::sleep_on() { u8g.sleepOn(); } + void MarlinUI::sleep_off() { u8g.sleepOff(); } +#endif + #if HAS_LCD_BRIGHTNESS void MarlinUI::_set_brightness() { diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 9906f78c6060..90607e82459a 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -442,6 +442,7 @@ namespace Language_en { LSTR MSG_CONTRAST = _UxGT("LCD Contrast"); LSTR MSG_BRIGHTNESS = _UxGT("LCD Brightness"); LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("LCD Timeout (s)"); + LSTR MSG_SCREEN_TIMEOUT = _UxGT("LCD Timeout (m)"); LSTR MSG_BRIGHTNESS_OFF = _UxGT("Backlight Off"); LSTR MSG_STORE_EEPROM = _UxGT("Store Settings"); LSTR MSG_LOAD_EEPROM = _UxGT("Load Settings"); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 5a850350828e..940b5b42eb1d 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -191,6 +191,15 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; WRITE(LCD_BACKLIGHT_PIN, HIGH); } +#elif HAS_DISPLAY_SLEEP + + uint8_t MarlinUI::sleep_timeout_minutes; // Initialized by settings.load() + millis_t MarlinUI::screen_timeout_millis = 0; + void MarlinUI::refresh_screen_timeout() { + screen_timeout_millis = sleep_timeout_minutes ? millis() + sleep_timeout_minutes * 60UL * 1000UL : 0; + sleep_off(); + } + #endif void MarlinUI::init() { @@ -1060,6 +1069,8 @@ void MarlinUI::init() { #if LCD_BACKLIGHT_TIMEOUT refresh_backlight_timeout(); + #elif HAS_DISPLAY_SLEEP + refresh_screen_timeout(); #endif refresh(LCDVIEW_REDRAW_NOW); @@ -1171,6 +1182,9 @@ void MarlinUI::init() { WRITE(LCD_BACKLIGHT_PIN, LOW); // Backlight off backlight_off_ms = 0; } + #elif HAS_DISPLAY_SLEEP + if (screen_timeout_millis && ELAPSED(ms, screen_timeout_millis)) + sleep_on(); #endif // Change state of drawing flag between screen updates diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 36891b201eae..c27ced6fdd16 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -279,6 +279,14 @@ class MarlinUI { static uint16_t lcd_backlight_timeout; static millis_t backlight_off_ms; static void refresh_backlight_timeout(); + #elif HAS_DISPLAY_SLEEP + #define SLEEP_TIMEOUT_MIN 0 + #define SLEEP_TIMEOUT_MAX 99 + static uint8_t sleep_timeout_minutes; + static millis_t screen_timeout_millis; + static void refresh_screen_timeout(); + static void sleep_on(); + static void sleep_off(); #endif #if HAS_DWIN_E3V2_BASIC diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 034484a14830..d755706b1612 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -549,6 +549,8 @@ void menu_configuration() { // #if LCD_BACKLIGHT_TIMEOUT && LCD_BKL_TIMEOUT_MIN < LCD_BKL_TIMEOUT_MAX EDIT_ITEM(uint16_4, MSG_LCD_TIMEOUT_SEC, &ui.lcd_backlight_timeout, LCD_BKL_TIMEOUT_MIN, LCD_BKL_TIMEOUT_MAX, ui.refresh_backlight_timeout); + #elif HAS_DISPLAY_SLEEP + EDIT_ITEM(uint8, MSG_SCREEN_TIMEOUT, &ui.sleep_timeout_minutes, SLEEP_TIMEOUT_MIN, SLEEP_TIMEOUT_MAX, ui.refresh_screen_timeout); #endif #if ENABLED(FWRETRACT) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index e9e69782daf7..bde60098abcd 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -402,7 +402,9 @@ typedef struct SettingsDataStruct { // Display Sleep // #if LCD_BACKLIGHT_TIMEOUT - uint16_t lcd_backlight_timeout; // (G-code needed) + uint16_t lcd_backlight_timeout; // M255 S + #elif HAS_DISPLAY_SLEEP + uint8_t sleep_timeout_minutes; // M255 S #endif // @@ -631,6 +633,8 @@ void MarlinSettings::postprocess() { #if LCD_BACKLIGHT_TIMEOUT ui.refresh_backlight_timeout(); + #elif HAS_DISPLAY_SLEEP + ui.refresh_screen_timeout(); #endif } @@ -1146,6 +1150,8 @@ void MarlinSettings::postprocess() { // #if LCD_BACKLIGHT_TIMEOUT EEPROM_WRITE(ui.lcd_backlight_timeout); + #elif HAS_DISPLAY_SLEEP + EEPROM_WRITE(ui.sleep_timeout_minutes); #endif // @@ -2077,6 +2083,8 @@ void MarlinSettings::postprocess() { // #if LCD_BACKLIGHT_TIMEOUT EEPROM_READ(ui.lcd_backlight_timeout); + #elif HAS_DISPLAY_SLEEP + EEPROM_READ(ui.sleep_timeout_minutes); #endif // @@ -3128,6 +3136,8 @@ void MarlinSettings::reset() { // #if LCD_BACKLIGHT_TIMEOUT ui.lcd_backlight_timeout = LCD_BACKLIGHT_TIMEOUT; + #elif HAS_DISPLAY_SLEEP + ui.sleep_timeout_minutes = DISPLAY_SLEEP_MINUTES; #endif // @@ -3464,6 +3474,11 @@ void MarlinSettings::reset() { // TERN_(HAS_LCD_CONTRAST, gcode.M250_report(forReplay)); + // + // Display Sleep + // + TERN_(HAS_GCODE_M255, gcode.M255_report(forReplay)); + // // LCD Brightness // diff --git a/ini/features.ini b/ini/features.ini index e8ce7f7040a6..355544029e0c 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -38,7 +38,7 @@ USES_LIQUIDCRYSTAL_I2C = marcoschwartz/LiquidCrystal_I2C@1.1.4 USES_LIQUIDTWI2 = LiquidTWI2@1.2.7 HAS_LCDPRINT = src_filter=+ HAS_MARLINUI_HD44780 = src_filter=+ -HAS_MARLINUI_U8GLIB = U8glib-HAL@~0.5.0 +HAS_MARLINUI_U8GLIB = U8glib-HAL@~0.5.2 src_filter=+ HAS_(FSMC|SPI|LTDC)_TFT = src_filter=+ + + HAS_FSMC_TFT = src_filter=+ + @@ -203,6 +203,7 @@ HAS_RESUME_CONTINUE = src_filter=+ LCD_SET_PROGRESS_MANUALLY = src_filter=+ HAS_STATUS_MESSAGE = src_filter=+ HAS_LCD_CONTRAST = src_filter=+ +HAS_GCODE_M255 = src_filter=+ HAS_LCD_BRIGHTNESS = src_filter=+ HAS_BUZZER = src_filter=+ TOUCH_SCREEN_CALIBRATION = src_filter=+ From 209c792ef7e97dc48bf3517c9f8f56e6be80e97f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 20 May 2022 11:27:09 -0500 Subject: [PATCH 346/502] =?UTF-8?q?=F0=9F=94=A7=20Remove=20LCD=5FSERIAL=5F?= =?UTF-8?q?PORT=20defaults,=20warn=20on=20auto-assign=20(#24170)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 7 ------- Marlin/Configuration_adv.h | 1 - Marlin/src/inc/Conditionals_LCD.h | 9 --------- Marlin/src/inc/Conditionals_adv.h | 18 ++++++++++++++++++ Marlin/src/inc/SanityCheck.h | 2 ++ Marlin/src/inc/Warnings.cpp | 4 ++++ 6 files changed, 24 insertions(+), 17 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 2a6400044905..a3c762a72eb2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2674,9 +2674,6 @@ // Touch-screen LCD for Malyan M200/M300 printers // //#define MALYAN_LCD -#if ENABLED(MALYAN_LCD) - #define LCD_SERIAL_PORT 1 // Default is 1 for Malyan M200 -#endif // // Touch UI for FTDI EVE (FT800/FT810) displays @@ -2690,7 +2687,6 @@ //#define ANYCUBIC_LCD_I3MEGA //#define ANYCUBIC_LCD_CHIRON #if EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON) - #define LCD_SERIAL_PORT 3 // Default is 3 for Anycubic //#define ANYCUBIC_LCD_DEBUG #endif @@ -2698,9 +2694,6 @@ // 320x240 Nextion 2.8" serial TFT Resistive Touch Screen NX3224T028 // //#define NEXTION_TFT -#if ENABLED(NEXTION_TFT) - #define LCD_SERIAL_PORT 1 // Default is 1 for Nextion -#endif // // Third-party or vendor-customized controller interfaces. diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 4fdec050b572..ab0b7cdf20e5 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1748,7 +1748,6 @@ // Additional options for DGUS / DWIN displays // #if HAS_DGUS_LCD - #define LCD_SERIAL_PORT 3 #define LCD_BAUDRATE 115200 #define DGUS_RX_BUFFER_SIZE 128 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 45e48439f437..52c6e34f22fd 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -485,15 +485,6 @@ // E3V2 extras #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI #define SERIAL_CATCHALL 0 - #ifndef LCD_SERIAL_PORT - #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO) - #define LCD_SERIAL_PORT 1 - #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423) - #define LCD_SERIAL_PORT 2 // Creality Ender3S1 board - #else - #define LCD_SERIAL_PORT 3 // Creality 4.x board - #endif - #endif #define HAS_LCD_BRIGHTNESS 1 #define LCD_BRIGHTNESS_MAX 250 #if ENABLED(DWIN_LCD_PROUI) diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index f82bd9b7408c..7a0c5dd934e3 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1012,6 +1012,24 @@ #define HAS_USER_ITEM(N) 0 #endif +/** + * LCD_SERIAL_PORT must be defined ahead of HAL.h + */ +#ifndef LCD_SERIAL_PORT + #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI + #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO) + #define LCD_SERIAL_PORT 1 + #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423) + #define LCD_SERIAL_PORT 2 // Creality Ender3S1 board + #else + #define LCD_SERIAL_PORT 3 // Creality 4.x board + #endif + #endif + #ifdef LCD_SERIAL_PORT + #define AUTO_ASSIGNED_LCD_SERIAL 1 + #endif +#endif + #if !HAS_MULTI_SERIAL #undef MEATPACK_ON_SERIAL_PORT_2 #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 4b7317d96a5c..b4259bf53ad7 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2941,6 +2941,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined." #elif ENABLED(MALYAN_LCD) #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined." + #elif ENABLED(NEXTION_LCD) + #error "NEXTION_LCD requires LCD_SERIAL_PORT to be defined." #endif #endif diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 7b4371e70080..ff38c47a37bb 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -67,6 +67,10 @@ #ifndef NO_AUTO_ASSIGN_WARNING + #if AUTO_ASSIGNED_LCD_SERIAL + #warning "Note: Auto-assigned LCD_SERIAL_PORT. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" + #endif + #if AUTO_ASSIGNED_X2_STEPPER #warning "Note: Auto-assigned X2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" #endif From 07cd248b91a59db8e2bc7ad10bbf160852af34fb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 22 May 2022 20:45:37 -0500 Subject: [PATCH 347/502] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Move=20watchdog=20?= =?UTF-8?q?to=20MarlinHAL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/HAL.cpp | 53 ++++++++ Marlin/src/HAL/AVR/HAL.h | 5 +- Marlin/src/HAL/AVR/watchdog.cpp | 70 ----------- Marlin/src/HAL/AVR/watchdog.h | 31 ----- Marlin/src/HAL/DUE/HAL.cpp | 95 ++++++++++++++- Marlin/src/HAL/DUE/HAL.h | 11 +- Marlin/src/HAL/DUE/watchdog.cpp | 114 ------------------ Marlin/src/HAL/DUE/watchdog.h | 33 ----- Marlin/src/HAL/ESP32/HAL.cpp | 25 ++++ Marlin/src/HAL/ESP32/HAL.h | 11 +- Marlin/src/HAL/ESP32/watchdog.cpp | 42 ------- Marlin/src/HAL/ESP32/watchdog.h | 38 ------ Marlin/src/HAL/HAL.h | 4 - Marlin/src/HAL/LINUX/HAL.h | 10 +- Marlin/src/HAL/LINUX/watchdog.cpp | 37 ------ Marlin/src/HAL/LINUX/watchdog.h | 25 ---- Marlin/src/HAL/LPC1768/HAL.cpp | 54 +++++++-- Marlin/src/HAL/LPC1768/HAL.h | 11 +- Marlin/src/HAL/LPC1768/watchdog.cpp | 72 ----------- Marlin/src/HAL/LPC1768/watchdog.h | 28 ----- Marlin/src/HAL/NATIVE_SIM/HAL.h | 5 +- Marlin/src/HAL/NATIVE_SIM/watchdog.h | 27 ----- Marlin/src/HAL/SAMD51/HAL.cpp | 34 ++++++ Marlin/src/HAL/SAMD51/HAL.h | 5 +- Marlin/src/HAL/SAMD51/watchdog.cpp | 54 --------- Marlin/src/HAL/SAMD51/watchdog.h | 31 ----- Marlin/src/HAL/STM32/HAL.cpp | 23 ++++ Marlin/src/HAL/STM32/HAL.h | 9 +- Marlin/src/HAL/STM32/MinSerial.cpp | 3 +- Marlin/src/HAL/STM32/msc_sd.cpp | 8 +- Marlin/src/HAL/STM32/sdio.cpp | 8 +- Marlin/src/HAL/STM32/watchdog.cpp | 52 -------- Marlin/src/HAL/STM32/watchdog.h | 25 ---- Marlin/src/HAL/STM32F1/HAL.cpp | 41 +++++++ Marlin/src/HAL/STM32F1/HAL.h | 5 +- Marlin/src/HAL/STM32F1/MinSerial.cpp | 3 +- Marlin/src/HAL/STM32F1/watchdog.cpp | 66 ---------- Marlin/src/HAL/STM32F1/watchdog.h | 35 ------ Marlin/src/HAL/TEENSY31_32/HAL.cpp | 22 ++++ Marlin/src/HAL/TEENSY31_32/HAL.h | 5 +- Marlin/src/HAL/TEENSY31_32/watchdog.cpp | 40 ------ Marlin/src/HAL/TEENSY31_32/watchdog.h | 34 ------ Marlin/src/HAL/TEENSY35_36/HAL.cpp | 22 ++++ Marlin/src/HAL/TEENSY35_36/HAL.h | 5 +- Marlin/src/HAL/TEENSY35_36/watchdog.cpp | 40 ------ Marlin/src/HAL/TEENSY35_36/watchdog.h | 30 ----- Marlin/src/HAL/TEENSY40_41/HAL.cpp | 25 ++++ Marlin/src/HAL/TEENSY40_41/HAL.h | 5 +- Marlin/src/HAL/TEENSY40_41/watchdog.cpp | 52 -------- Marlin/src/HAL/TEENSY40_41/watchdog.h | 30 ----- .../shared/cpu_exception/exception_arm.cpp | 2 +- Marlin/src/MarlinCore.cpp | 8 +- Marlin/src/gcode/config/M43.cpp | 10 +- Marlin/src/gcode/feature/L6470/M916-M918.cpp | 1 - Marlin/src/gcode/gcode_d.cpp | 4 +- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 2 +- .../src/lcd/extui/mks_ui/draw_print_file.cpp | 2 +- .../lcd/extui/mks_ui/draw_z_offset_wizard.cpp | 4 +- Marlin/src/lcd/extui/mks_ui/pic_manager.cpp | 22 ++-- .../extui/mks_ui/tft_lvgl_configuration.cpp | 12 +- Marlin/src/lcd/extui/mks_ui/wifi_module.cpp | 12 +- Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp | 6 +- Marlin/src/module/temperature.cpp | 10 +- Marlin/src/sd/Sd2Card.cpp | 8 +- 64 files changed, 510 insertions(+), 1106 deletions(-) delete mode 100644 Marlin/src/HAL/AVR/watchdog.cpp delete mode 100644 Marlin/src/HAL/AVR/watchdog.h delete mode 100644 Marlin/src/HAL/DUE/watchdog.cpp delete mode 100644 Marlin/src/HAL/DUE/watchdog.h delete mode 100644 Marlin/src/HAL/ESP32/watchdog.cpp delete mode 100644 Marlin/src/HAL/ESP32/watchdog.h delete mode 100644 Marlin/src/HAL/LINUX/watchdog.cpp delete mode 100644 Marlin/src/HAL/LINUX/watchdog.h delete mode 100644 Marlin/src/HAL/LPC1768/watchdog.cpp delete mode 100644 Marlin/src/HAL/LPC1768/watchdog.h delete mode 100644 Marlin/src/HAL/NATIVE_SIM/watchdog.h delete mode 100644 Marlin/src/HAL/SAMD51/watchdog.cpp delete mode 100644 Marlin/src/HAL/SAMD51/watchdog.h delete mode 100644 Marlin/src/HAL/STM32/watchdog.cpp delete mode 100644 Marlin/src/HAL/STM32/watchdog.h delete mode 100644 Marlin/src/HAL/STM32F1/watchdog.cpp delete mode 100644 Marlin/src/HAL/STM32F1/watchdog.h delete mode 100644 Marlin/src/HAL/TEENSY31_32/watchdog.cpp delete mode 100644 Marlin/src/HAL/TEENSY31_32/watchdog.h delete mode 100644 Marlin/src/HAL/TEENSY35_36/watchdog.cpp delete mode 100644 Marlin/src/HAL/TEENSY35_36/watchdog.h delete mode 100644 Marlin/src/HAL/TEENSY40_41/watchdog.cpp delete mode 100644 Marlin/src/HAL/TEENSY40_41/watchdog.h diff --git a/Marlin/src/HAL/AVR/HAL.cpp b/Marlin/src/HAL/AVR/HAL.cpp index 0527f3d8c5df..5382eb36a2bd 100644 --- a/Marlin/src/HAL/AVR/HAL.cpp +++ b/Marlin/src/HAL/AVR/HAL.cpp @@ -23,6 +23,7 @@ #include "../../inc/MarlinConfig.h" #include "HAL.h" +#include #ifdef USBCON DefaultSerial1 MSerial0(false, Serial); @@ -88,6 +89,58 @@ void MarlinHAL::reboot() { #endif } +// ------------------------ +// Watchdog Timer +// ------------------------ + +#if ENABLED(USE_WATCHDOG) + + #include + #include "../../MarlinCore.h" + + // Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s. + void MarlinHAL::watchdog_init() { + #if ENABLED(WATCHDOG_DURATION_8S) && defined(WDTO_8S) + #define WDTO_NS WDTO_8S + #else + #define WDTO_NS WDTO_4S + #endif + #if ENABLED(WATCHDOG_RESET_MANUAL) + // Enable the watchdog timer, but only for the interrupt. + // Take care, as this requires the correct order of operation, with interrupts disabled. + // See the datasheet of any AVR chip for details. + wdt_reset(); + cli(); + _WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE); + _WD_CONTROL_REG = _BV(WDIE) | (WDTO_NS & 0x07) | ((WDTO_NS & 0x08) << 2); // WDTO_NS directly does not work. bit 0-2 are consecutive in the register but the highest value bit is at bit 5 + // So worked for up to WDTO_2S + sei(); + wdt_reset(); + #else + wdt_enable(WDTO_NS); // The function handles the upper bit correct. + #endif + //delay(10000); // test it! + } + + //=========================================================================== + //=================================== ISR =================================== + //=========================================================================== + + // Watchdog timer interrupt, called if main program blocks >4sec and manual reset is enabled. + #if ENABLED(WATCHDOG_RESET_MANUAL) + ISR(WDT_vect) { + sei(); // With the interrupt driven serial we need to allow interrupts. + SERIAL_ERROR_MSG(STR_WATCHDOG_FIRED); + minkill(); // interrupt-safe final kill and infinite loop + } + #endif + + // Reset watchdog. MUST be called at least every 4 seconds after the + // first watchdog_init or AVR will go into emergency procedures. + void MarlinHAL::watchdog_refresh() { wdt_reset(); } + +#endif // USE_WATCHDOG + // ------------------------ // Free Memory Accessor // ------------------------ diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index 42ae521dfc87..7185142175dc 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -22,7 +22,6 @@ #include "../shared/Marduino.h" #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #include "math.h" #ifdef USBCON @@ -185,6 +184,10 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + static void init(); // Called early in setup() static void init_board() {} // Called less early in setup() static void reboot(); // Restart the firmware from 0x0 diff --git a/Marlin/src/HAL/AVR/watchdog.cpp b/Marlin/src/HAL/AVR/watchdog.cpp deleted file mode 100644 index 3f10c4adff81..000000000000 --- a/Marlin/src/HAL/AVR/watchdog.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifdef __AVR__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -#include "../../MarlinCore.h" - -// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s. -void watchdog_init() { - #if ENABLED(WATCHDOG_DURATION_8S) && defined(WDTO_8S) - #define WDTO_NS WDTO_8S - #else - #define WDTO_NS WDTO_4S - #endif - #if ENABLED(WATCHDOG_RESET_MANUAL) - // Enable the watchdog timer, but only for the interrupt. - // Take care, as this requires the correct order of operation, with interrupts disabled. - // See the datasheet of any AVR chip for details. - wdt_reset(); - cli(); - _WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE); - _WD_CONTROL_REG = _BV(WDIE) | (WDTO_NS & 0x07) | ((WDTO_NS & 0x08) << 2); // WDTO_NS directly does not work. bit 0-2 are consecutive in the register but the highest value bit is at bit 5 - // So worked for up to WDTO_2S - sei(); - wdt_reset(); - #else - wdt_enable(WDTO_NS); // The function handles the upper bit correct. - #endif - //delay(10000); // test it! -} - -//=========================================================================== -//=================================== ISR =================================== -//=========================================================================== - -// Watchdog timer interrupt, called if main program blocks >4sec and manual reset is enabled. -#if ENABLED(WATCHDOG_RESET_MANUAL) - ISR(WDT_vect) { - sei(); // With the interrupt driven serial we need to allow interrupts. - SERIAL_ERROR_MSG(STR_WATCHDOG_FIRED); - minkill(); // interrupt-safe final kill and infinite loop - } -#endif - -#endif // USE_WATCHDOG -#endif // __AVR__ diff --git a/Marlin/src/HAL/AVR/watchdog.h b/Marlin/src/HAL/AVR/watchdog.h deleted file mode 100644 index a16c88b35e87..000000000000 --- a/Marlin/src/HAL/AVR/watchdog.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include - -// Initialize watchdog with a 4 second interrupt time -void watchdog_init(); - -// Reset watchdog. MUST be called at least every 4 seconds after the -// first watchdog_init or AVR will go into emergency procedures. -inline void HAL_watchdog_refresh() { wdt_reset(); } diff --git a/Marlin/src/HAL/DUE/HAL.cpp b/Marlin/src/HAL/DUE/HAL.cpp index 39a28359e5da..4353f1649732 100644 --- a/Marlin/src/HAL/DUE/HAL.cpp +++ b/Marlin/src/HAL/DUE/HAL.cpp @@ -25,7 +25,7 @@ #ifdef ARDUINO_ARCH_SAM #include "../../inc/MarlinConfig.h" -#include "HAL.h" +#include "../../MarlinCore.h" #include #include "usb/usb_task.h" @@ -73,6 +73,99 @@ uint8_t MarlinHAL::get_reset_source() { void MarlinHAL::reboot() { rstc_start_software_reset(RSTC); } +// ------------------------ +// Watchdog Timer +// ------------------------ + +#if ENABLED(USE_WATCHDOG) + + // Initialize watchdog - On SAM3X, Watchdog was already configured + // and enabled or disabled at startup, so no need to reconfigure it + // here. + void MarlinHAL::watchdog_init() { WDT_Restart(WDT); } // Reset watchdog to start clean + + // Reset watchdog. MUST be called at least every 4 seconds after the + // first watchdog_init or AVR will go into emergency procedures. + void MarlinHAL::watchdog_refresh() { watchdogReset(); } + +#endif + +// Override Arduino runtime to either config or disable the watchdog +// +// We need to configure the watchdog as soon as possible in the boot +// process, because watchdog initialization at hardware reset on SAM3X8E +// is unreliable, and there is risk of unintended resets if we delay +// that initialization to a later time. +void watchdogSetup() { + + #if ENABLED(USE_WATCHDOG) + + // 4 seconds timeout + uint32_t timeout = TERN(WATCHDOG_DURATION_8S, 8000, 4000); + + // Calculate timeout value in WDT counter ticks: This assumes + // the slow clock is running at 32.768 kHz watchdog + // frequency is therefore 32768 / 128 = 256 Hz + timeout = (timeout << 8) / 1000; + if (timeout == 0) + timeout = 1; + else if (timeout > 0xFFF) + timeout = 0xFFF; + + // We want to enable the watchdog with the specified timeout + uint32_t value = + WDT_MR_WDV(timeout) | // With the specified timeout + WDT_MR_WDD(timeout) | // and no invalid write window + #if !(SAMV70 || SAMV71 || SAME70 || SAMS70) + WDT_MR_WDRPROC | // WDT fault resets processor only - We want + // to keep PIO controller state + #endif + WDT_MR_WDDBGHLT | // WDT stops in debug state. + WDT_MR_WDIDLEHLT; // WDT stops in idle state. + + #if ENABLED(WATCHDOG_RESET_MANUAL) + // We enable the watchdog timer, but only for the interrupt. + + // Configure WDT to only trigger an interrupt + value |= WDT_MR_WDFIEN; // Enable WDT fault interrupt. + + // Disable WDT interrupt (just in case, to avoid triggering it!) + NVIC_DisableIRQ(WDT_IRQn); + + // We NEED memory barriers to ensure Interrupts are actually disabled! + // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) + __DSB(); + __ISB(); + + // Initialize WDT with the given parameters + WDT_Enable(WDT, value); + + // Configure and enable WDT interrupt. + NVIC_ClearPendingIRQ(WDT_IRQn); + NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups + NVIC_EnableIRQ(WDT_IRQn); + + #else + + // a WDT fault triggers a reset + value |= WDT_MR_WDRSTEN; + + // Initialize WDT with the given parameters + WDT_Enable(WDT, value); + + #endif + + // Reset the watchdog + WDT_Restart(WDT); + + #else + + // Make sure to completely disable the Watchdog + WDT_Disable(WDT); + + #endif +} + // ------------------------ // Free Memory Accessor // ------------------------ diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index 2f5c647aa319..4d3f4823a517 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -32,7 +32,6 @@ #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #include @@ -176,9 +175,13 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} - static void init(); // Called early in setup() - static void init_board(); // Called less early in setup() - static void reboot(); // Software reset + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + + static void init(); // Called early in setup() + static void init_board(); // Called less early in setup() + static void reboot(); // Restart the firmware // Interrupts static bool isr_state() { return !__get_PRIMASK(); } diff --git a/Marlin/src/HAL/DUE/watchdog.cpp b/Marlin/src/HAL/DUE/watchdog.cpp deleted file mode 100644 index e144db8291e3..000000000000 --- a/Marlin/src/HAL/DUE/watchdog.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifdef ARDUINO_ARCH_SAM - -#include "../../inc/MarlinConfig.h" -#include "../../MarlinCore.h" -#include "watchdog.h" - -// Override Arduino runtime to either config or disable the watchdog -// -// We need to configure the watchdog as soon as possible in the boot -// process, because watchdog initialization at hardware reset on SAM3X8E -// is unreliable, and there is risk of unintended resets if we delay -// that initialization to a later time. -void watchdogSetup() { - - #if ENABLED(USE_WATCHDOG) - - // 4 seconds timeout - uint32_t timeout = TERN(WATCHDOG_DURATION_8S, 8000, 4000); - - // Calculate timeout value in WDT counter ticks: This assumes - // the slow clock is running at 32.768 kHz watchdog - // frequency is therefore 32768 / 128 = 256 Hz - timeout = (timeout << 8) / 1000; - if (timeout == 0) - timeout = 1; - else if (timeout > 0xFFF) - timeout = 0xFFF; - - // We want to enable the watchdog with the specified timeout - uint32_t value = - WDT_MR_WDV(timeout) | // With the specified timeout - WDT_MR_WDD(timeout) | // and no invalid write window - #if !(SAMV70 || SAMV71 || SAME70 || SAMS70) - WDT_MR_WDRPROC | // WDT fault resets processor only - We want - // to keep PIO controller state - #endif - WDT_MR_WDDBGHLT | // WDT stops in debug state. - WDT_MR_WDIDLEHLT; // WDT stops in idle state. - - #if ENABLED(WATCHDOG_RESET_MANUAL) - // We enable the watchdog timer, but only for the interrupt. - - // Configure WDT to only trigger an interrupt - value |= WDT_MR_WDFIEN; // Enable WDT fault interrupt. - - // Disable WDT interrupt (just in case, to avoid triggering it!) - NVIC_DisableIRQ(WDT_IRQn); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - // Initialize WDT with the given parameters - WDT_Enable(WDT, value); - - // Configure and enable WDT interrupt. - NVIC_ClearPendingIRQ(WDT_IRQn); - NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups - NVIC_EnableIRQ(WDT_IRQn); - - #else - - // a WDT fault triggers a reset - value |= WDT_MR_WDRSTEN; - - // Initialize WDT with the given parameters - WDT_Enable(WDT, value); - - #endif - - // Reset the watchdog - WDT_Restart(WDT); - - #else - - // Make sure to completely disable the Watchdog - WDT_Disable(WDT); - - #endif -} - -#if ENABLED(USE_WATCHDOG) - // Initialize watchdog - On SAM3X, Watchdog was already configured - // and enabled or disabled at startup, so no need to reconfigure it - // here. - void watchdog_init() { - // Reset watchdog to start clean - WDT_Restart(WDT); - } -#endif // USE_WATCHDOG - -#endif diff --git a/Marlin/src/HAL/DUE/watchdog.h b/Marlin/src/HAL/DUE/watchdog.h deleted file mode 100644 index 5725a10007a7..000000000000 --- a/Marlin/src/HAL/DUE/watchdog.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -// Arduino Due core now has watchdog support - -#include "HAL.h" - -// Initialize watchdog with a 4 second interrupt time -void watchdog_init(); - -// Reset watchdog. MUST be called at least every 4 seconds after the -// first watchdog_init or AVR will go into emergency procedures. -inline void HAL_watchdog_refresh() { watchdogReset(); } diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index 767f65d341bc..65af39786eeb 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -179,6 +179,31 @@ void _delay_ms(int delay_ms) { delay(delay_ms); } // return free memory between end of heap (or end bss) and whatever is current int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); } +// ------------------------ +// Watchdog Timer +// ------------------------ + +#if ENABLED(USE_WATCHDOG) + + #define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout + + extern "C" { + esp_err_t esp_task_wdt_reset(); + } + + void watchdogSetup() { + // do whatever. don't remove this function. + } + + void MarlinHAL::watchdog_init() { + // TODO + } + + // Reset watchdog. + void MarlinHAL::watchdog_refresh() { esp_task_wdt_reset(); } + +#endif + // ------------------------ // ADC // ------------------------ diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index ba3627b1fd31..a07303d4891f 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -32,7 +32,6 @@ #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #include "i2s.h" #if ENABLED(WIFISUPPORT) @@ -172,9 +171,13 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} - static void init() {} // Called early in setup() - static void init_board(); // Called less early in setup() - static void reboot(); // Restart the firmware + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + + static void init() {} // Called early in setup() + static void init_board(); // Called less early in setup() + static void reboot(); // Restart the firmware // Interrupts static portMUX_TYPE spinlock; diff --git a/Marlin/src/HAL/ESP32/watchdog.cpp b/Marlin/src/HAL/ESP32/watchdog.cpp deleted file mode 100644 index 5ec03c46079b..000000000000 --- a/Marlin/src/HAL/ESP32/watchdog.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifdef ARDUINO_ARCH_ESP32 - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout - -#include "watchdog.h" - -void watchdogSetup() { - // do whatever. don't remove this function. -} - -void watchdog_init() { - // TODO -} - -#endif // USE_WATCHDOG - -#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/ESP32/watchdog.h b/Marlin/src/HAL/ESP32/watchdog.h deleted file mode 100644 index 43db8130763f..000000000000 --- a/Marlin/src/HAL/ESP32/watchdog.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#ifdef __cplusplus - extern "C" { -#endif - - esp_err_t esp_task_wdt_reset(); - -#ifdef __cplusplus - } -#endif - -// Initialize watchdog with a 4 second interrupt time -void watchdog_init(); - -// Reset watchdog. -inline void HAL_watchdog_refresh() { esp_task_wdt_reset(); } diff --git a/Marlin/src/HAL/HAL.h b/Marlin/src/HAL/HAL.h index 2dda287ac7a1..518657801905 100644 --- a/Marlin/src/HAL/HAL.h +++ b/Marlin/src/HAL/HAL.h @@ -45,7 +45,3 @@ extern MarlinHAL hal; #ifndef PGMSTR #define PGMSTR(NAM,STR) const char NAM[] = STR #endif - -inline void watchdog_refresh() { - TERN_(USE_WATCHDOG, HAL_watchdog_refresh()); -} diff --git a/Marlin/src/HAL/LINUX/HAL.h b/Marlin/src/HAL/LINUX/HAL.h index 43899c632de5..22c3e521f086 100644 --- a/Marlin/src/HAL/LINUX/HAL.h +++ b/Marlin/src/HAL/LINUX/HAL.h @@ -21,6 +21,8 @@ */ #pragma once +#include "../../inc/MarlinConfigPre.h" + #include #include #include @@ -29,12 +31,10 @@ #include #include "hardware/Clock.h" - #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #include "serial.h" // ------------------------ @@ -106,9 +106,13 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} + // Watchdog + static void watchdog_init() {} + static void watchdog_refresh() {} + static void init() {} // Called early in setup() static void init_board() {} // Called less early in setup() - static void reboot(); // Reset the application state and GPIO + static void reboot(); // Reset the application state and GPIO // Interrupts static bool isr_state() { return true; } diff --git a/Marlin/src/HAL/LINUX/watchdog.cpp b/Marlin/src/HAL/LINUX/watchdog.cpp deleted file mode 100644 index 84202e48b6c5..000000000000 --- a/Marlin/src/HAL/LINUX/watchdog.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifdef __PLAT_LINUX__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout - -void watchdog_init() {} -void HAL_watchdog_refresh() {} - -#endif - -#endif // __PLAT_LINUX__ diff --git a/Marlin/src/HAL/LINUX/watchdog.h b/Marlin/src/HAL/LINUX/watchdog.h deleted file mode 100644 index 49a0d9c631d8..000000000000 --- a/Marlin/src/HAL/LINUX/watchdog.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -void watchdog_init(); -void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/LPC1768/HAL.cpp b/Marlin/src/HAL/LPC1768/HAL.cpp index 541848b08acc..9ff3a6ba598f 100644 --- a/Marlin/src/HAL/LPC1768/HAL.cpp +++ b/Marlin/src/HAL/LPC1768/HAL.cpp @@ -25,10 +25,6 @@ #include "../shared/Delay.h" #include "../../../gcode/parser.h" -#if ENABLED(USE_WATCHDOG) - #include "watchdog.h" -#endif - DefaultSerial1 USBSerial(false, UsbSerial); uint32_t MarlinHAL::adc_result = 0; @@ -61,9 +57,7 @@ uint8_t MarlinHAL::get_reset_source() { return RST_POWER_ON; } -void MarlinHAL::clear_reset_source() { - TERN_(USE_WATCHDOG, watchdog_clear_timeout_flag()); -} +void MarlinHAL::clear_reset_source() { watchdog_clear_timeout_flag(); } void flashFirmware(const int16_t) { delay(500); // Give OS time to disconnect @@ -72,6 +66,52 @@ void flashFirmware(const int16_t) { hal.reboot(); } +#if ENABLED(USE_WATCHDOG) + + #include + + #define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout + + void MarlinHAL::watchdog_init() { + #if ENABLED(WATCHDOG_RESET_MANUAL) + // We enable the watchdog timer, but only for the interrupt. + + // Configure WDT to only trigger an interrupt + // Disable WDT interrupt (just in case, to avoid triggering it!) + NVIC_DisableIRQ(WDT_IRQn); + + // We NEED memory barriers to ensure Interrupts are actually disabled! + // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) + __DSB(); + __ISB(); + + // Configure WDT to only trigger an interrupt + // Initialize WDT with the given parameters + WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_INT_ONLY); + + // Configure and enable WDT interrupt. + NVIC_ClearPendingIRQ(WDT_IRQn); + NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups + NVIC_EnableIRQ(WDT_IRQn); + #else + WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET); + #endif + WDT_Start(WDT_TIMEOUT_US); + } + + void MarlinHAL::watchdog_refresh() { + WDT_Feed(); + #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) + TOGGLE(LED_PIN); // heartbeat indicator + #endif + } + + // Timeout state + bool MarlinHAL::watchdog_timed_out() { return TEST(WDT_ReadTimeOutFlag(), 0); } + void MarlinHAL::watchdog_clear_timeout_flag() { WDT_ClrTimeOutFlag(); } + +#endif // USE_WATCHDOG + // For M42/M43, scan command line for pin code // return index into pin map array if found and the pin is valid. // return dval if not found or not a valid pin. diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index d058de8720bb..b0eeb983b445 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -38,7 +38,6 @@ extern "C" volatile uint32_t _millis; #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #include "MarlinSerial.h" #include @@ -199,9 +198,9 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} - static void init(); // Called early in setup() + static void init(); // Called early in setup() static void init_board() {} // Called less early in setup() - static void reboot(); // Restart the firmware from 0x0 + static void reboot(); // Restart the firmware from 0x0 // Interrupts static bool isr_state() { return !__get_PRIMASK(); } @@ -210,6 +209,12 @@ class MarlinHAL { static void delay_ms(const int ms) { _delay_ms(ms); } + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + static bool watchdog_timed_out() IF_DISABLED(USE_WATCHDOG, { return false; }); + static void watchdog_clear_timeout_flag() IF_DISABLED(USE_WATCHDOG, {}); + // Tasks, called from idle() static void idletask(); diff --git a/Marlin/src/HAL/LPC1768/watchdog.cpp b/Marlin/src/HAL/LPC1768/watchdog.cpp deleted file mode 100644 index f23ccf5b512d..000000000000 --- a/Marlin/src/HAL/LPC1768/watchdog.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include -#include "watchdog.h" - -#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout - -void watchdog_init() { - #if ENABLED(WATCHDOG_RESET_MANUAL) - // We enable the watchdog timer, but only for the interrupt. - - // Configure WDT to only trigger an interrupt - // Disable WDT interrupt (just in case, to avoid triggering it!) - NVIC_DisableIRQ(WDT_IRQn); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - // Configure WDT to only trigger an interrupt - // Initialize WDT with the given parameters - WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_INT_ONLY); - - // Configure and enable WDT interrupt. - NVIC_ClearPendingIRQ(WDT_IRQn); - NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups - NVIC_EnableIRQ(WDT_IRQn); - #else - WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET); - #endif - WDT_Start(WDT_TIMEOUT_US); -} - -void HAL_watchdog_refresh() { - WDT_Feed(); - #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) - TOGGLE(LED_PIN); // heartbeat indicator - #endif -} - -// Timeout state -bool watchdog_timed_out() { return TEST(WDT_ReadTimeOutFlag(), 0); } -void watchdog_clear_timeout_flag() { WDT_ClrTimeOutFlag(); } - -#endif // USE_WATCHDOG -#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/LPC1768/watchdog.h b/Marlin/src/HAL/LPC1768/watchdog.h deleted file mode 100644 index c843f0ed5571..000000000000 --- a/Marlin/src/HAL/LPC1768/watchdog.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -void watchdog_init(); -void HAL_watchdog_refresh(); - -bool watchdog_timed_out(); -void watchdog_clear_timeout_flag(); diff --git a/Marlin/src/HAL/NATIVE_SIM/HAL.h b/Marlin/src/HAL/NATIVE_SIM/HAL.h index 35fce855cbd4..66203611447f 100644 --- a/Marlin/src/HAL/NATIVE_SIM/HAL.h +++ b/Marlin/src/HAL/NATIVE_SIM/HAL.h @@ -45,7 +45,6 @@ uint8_t _getc(); #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #include "serial.h" // ------------------------ @@ -208,6 +207,10 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + static void init() {} // Called early in setup() static void init_board() {} // Called less early in setup() static void reboot(); // Restart the firmware from 0x0 diff --git a/Marlin/src/HAL/NATIVE_SIM/watchdog.h b/Marlin/src/HAL/NATIVE_SIM/watchdog.h deleted file mode 100644 index 4e404c3887da..000000000000 --- a/Marlin/src/HAL/NATIVE_SIM/watchdog.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#define WDT_TIMEOUT 4000000 // 4 second timeout - -void watchdog_init(); -void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/SAMD51/HAL.cpp b/Marlin/src/HAL/SAMD51/HAL.cpp index 14b6a437dccc..648e0a4f144b 100644 --- a/Marlin/src/HAL/SAMD51/HAL.cpp +++ b/Marlin/src/HAL/SAMD51/HAL.cpp @@ -203,6 +203,40 @@ enum ADCIndex { ADC_COUNT }; +#if ENABLED(USE_WATCHDOG) + + #define WDT_TIMEOUT_REG TERN(WATCHDOG_DURATION_8S, WDT_CONFIG_PER_CYC8192, WDT_CONFIG_PER_CYC4096) // 4 or 8 second timeout + + void MarlinHAL::watchdog_init() { + // The low-power oscillator used by the WDT runs at 32,768 Hz with + // a 1:32 prescale, thus 1024 Hz, though probably not super precise. + + // Setup WDT clocks + MCLK->APBAMASK.bit.OSC32KCTRL_ = true; + MCLK->APBAMASK.bit.WDT_ = true; + OSC32KCTRL->OSCULP32K.bit.EN1K = true; // Enable out 1K (this is what WDT uses) + + WDT->CTRLA.bit.ENABLE = false; // Disable watchdog for config + SYNC(WDT->SYNCBUSY.bit.ENABLE); + + WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt + WDT->CONFIG.reg = WDT_TIMEOUT_REG; // Set a 4s or 8s period for chip reset + + hal.watchdog_refresh(); + + WDT->CTRLA.reg = WDT_CTRLA_ENABLE; // Start watchdog now in normal mode + SYNC(WDT->SYNCBUSY.bit.ENABLE); + } + + // Reset watchdog. MUST be called at least every 4 seconds after the + // first watchdog_init or SAMD will go into emergency procedures. + void MarlinHAL::watchdog_refresh() { + SYNC(WDT->SYNCBUSY.bit.CLEAR); // Test first if previous is 'ongoing' to save time waiting for command execution + WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY; + } + +#endif + // ------------------------ // Types // ------------------------ diff --git a/Marlin/src/HAL/SAMD51/HAL.h b/Marlin/src/HAL/SAMD51/HAL.h index abcc28098776..79ba8021f4fd 100644 --- a/Marlin/src/HAL/SAMD51/HAL.h +++ b/Marlin/src/HAL/SAMD51/HAL.h @@ -26,7 +26,6 @@ #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #ifdef ADAFRUIT_GRAND_CENTRAL_M4 #include "MarlinSerial_AGCM4.h" @@ -157,6 +156,10 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + static void init(); // Called early in setup() static void init_board() {} // Called less early in setup() static void reboot(); // Restart the firmware from 0x0 diff --git a/Marlin/src/HAL/SAMD51/watchdog.cpp b/Marlin/src/HAL/SAMD51/watchdog.cpp deleted file mode 100644 index 9de451836aeb..000000000000 --- a/Marlin/src/HAL/SAMD51/watchdog.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifdef __SAMD51__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -#define WDT_TIMEOUT_REG TERN(WATCHDOG_DURATION_8S, WDT_CONFIG_PER_CYC8192, WDT_CONFIG_PER_CYC4096) // 4 or 8 second timeout - -void watchdog_init() { - // The low-power oscillator used by the WDT runs at 32,768 Hz with - // a 1:32 prescale, thus 1024 Hz, though probably not super precise. - - // Setup WDT clocks - MCLK->APBAMASK.bit.OSC32KCTRL_ = true; - MCLK->APBAMASK.bit.WDT_ = true; - OSC32KCTRL->OSCULP32K.bit.EN1K = true; // Enable out 1K (this is what WDT uses) - - WDT->CTRLA.bit.ENABLE = false; // Disable watchdog for config - SYNC(WDT->SYNCBUSY.bit.ENABLE); - - WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt - WDT->CONFIG.reg = WDT_TIMEOUT_REG; // Set a 4s or 8s period for chip reset - - HAL_watchdog_refresh(); - - WDT->CTRLA.reg = WDT_CTRLA_ENABLE; // Start watchdog now in normal mode - SYNC(WDT->SYNCBUSY.bit.ENABLE); -} - -#endif // USE_WATCHDOG - -#endif // __SAMD51__ diff --git a/Marlin/src/HAL/SAMD51/watchdog.h b/Marlin/src/HAL/SAMD51/watchdog.h deleted file mode 100644 index 2cd4788229b0..000000000000 --- a/Marlin/src/HAL/SAMD51/watchdog.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -// Initialize watchdog with a 4 second interrupt time -void watchdog_init(); - -// Reset watchdog. MUST be called at least every 4 seconds after the -// first watchdog_init or SAMD will go into emergency procedures. -inline void HAL_watchdog_refresh() { - SYNC(WDT->SYNCBUSY.bit.CLEAR); // Test first if previous is 'ongoing' to save time waiting for command execution - WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY; -} diff --git a/Marlin/src/HAL/STM32/HAL.cpp b/Marlin/src/HAL/STM32/HAL.cpp index 7e410fff8464..aff52f597f4d 100644 --- a/Marlin/src/HAL/STM32/HAL.cpp +++ b/Marlin/src/HAL/STM32/HAL.cpp @@ -140,6 +140,29 @@ uint8_t MarlinHAL::get_reset_source() { void MarlinHAL::clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } +// ------------------------ +// Watchdog Timer +// ------------------------ + +#if ENABLED(USE_WATCHDOG) + + #define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout + + #include + + void MarlinHAL::watchdog_init() { + IF_DISABLED(DISABLE_WATCHDOG_INIT, IWatchdog.begin(WDT_TIMEOUT_US)); + } + + void MarlinHAL::watchdog_refresh() { + IWatchdog.reload(); + #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) + TOGGLE(LED_PIN); // heartbeat indicator + #endif + } + +#endif + extern "C" { extern unsigned int _ebss; // end of bss section } diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index 1bd7f7604257..3e85aca293d2 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -30,7 +30,6 @@ #include "../shared/HAL_SPI.h" #include "fastio.h" #include "Servo.h" -#include "watchdog.h" #include "MarlinSerial.h" #include "../../inc/MarlinConfigPre.h" @@ -218,9 +217,13 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} - static void init(); // Called early in setup() + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + + static void init(); // Called early in setup() static void init_board() {} // Called less early in setup() - static void reboot(); // Restart the firmware from 0x0 + static void reboot(); // Restart the firmware from 0x0 // Interrupts static bool isr_state() { return !__get_PRIMASK(); } diff --git a/Marlin/src/HAL/STM32/MinSerial.cpp b/Marlin/src/HAL/STM32/MinSerial.cpp index d99ed9cd9b99..b0fcff20c172 100644 --- a/Marlin/src/HAL/STM32/MinSerial.cpp +++ b/Marlin/src/HAL/STM32/MinSerial.cpp @@ -29,7 +29,6 @@ #if ENABLED(POSTMORTEM_DEBUGGING) #include "../shared/MinSerial.h" -#include "watchdog.h" /* Instruction Synchronization Barrier */ #define isb() __asm__ __volatile__ ("isb" : : : "memory") @@ -120,7 +119,7 @@ static void TX(char c) { #if WITHIN(SERIAL_PORT, 1, 6) constexpr uint32_t usart_sr_txe = _BV(7); while (!(regs->SR & usart_sr_txe)) { - TERN_(USE_WATCHDOG, HAL_watchdog_refresh()); + hal.watchdog_refresh(); sw_barrier(); } regs->DR = c; diff --git a/Marlin/src/HAL/STM32/msc_sd.cpp b/Marlin/src/HAL/STM32/msc_sd.cpp index 4f85af0d446a..a40bec9d644d 100644 --- a/Marlin/src/HAL/STM32/msc_sd.cpp +++ b/Marlin/src/HAL/STM32/msc_sd.cpp @@ -57,7 +57,7 @@ class Sd2CardUSBMscHandler : public USBMscHandler { auto sd2card = diskIODriver(); // single block if (blkLen == 1) { - watchdog_refresh(); + hal.watchdog_refresh(); sd2card->writeBlock(blkAddr, pBuf); return true; } @@ -65,7 +65,7 @@ class Sd2CardUSBMscHandler : public USBMscHandler { // multi block optimization sd2card->writeStart(blkAddr, blkLen); while (blkLen--) { - watchdog_refresh(); + hal.watchdog_refresh(); sd2card->writeData(pBuf); pBuf += BLOCK_SIZE; } @@ -77,7 +77,7 @@ class Sd2CardUSBMscHandler : public USBMscHandler { auto sd2card = diskIODriver(); // single block if (blkLen == 1) { - watchdog_refresh(); + hal.watchdog_refresh(); sd2card->readBlock(blkAddr, pBuf); return true; } @@ -85,7 +85,7 @@ class Sd2CardUSBMscHandler : public USBMscHandler { // multi block optimization sd2card->readStart(blkAddr); while (blkLen--) { - watchdog_refresh(); + hal.watchdog_refresh(); sd2card->readData(pBuf); pBuf += BLOCK_SIZE; } diff --git a/Marlin/src/HAL/STM32/sdio.cpp b/Marlin/src/HAL/STM32/sdio.cpp index 0af5f9040e54..b26ec768e8cd 100644 --- a/Marlin/src/HAL/STM32/sdio.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -208,7 +208,7 @@ bool SDIO_Init() { uint8_t retry_Cnt = retryCnt; for (;;) { - TERN_(USE_WATCHDOG, HAL_watchdog_refresh()); + hal.watchdog_refresh(); status = (bool) HAL_SD_Init(&hsd); if (!status) break; if (!--retry_Cnt) return false; // return failing status if retries are exhausted @@ -219,7 +219,7 @@ bool SDIO_Init() { #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined retry_Cnt = retryCnt; for (;;) { - TERN_(USE_WATCHDOG, HAL_watchdog_refresh()); + hal.watchdog_refresh(); if (!HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B)) break; // some cards are only 1 bit wide so a pass here is not required if (!--retry_Cnt) break; } @@ -228,7 +228,7 @@ bool SDIO_Init() { SD_LowLevel_Init(); retry_Cnt = retryCnt; for (;;) { - TERN_(USE_WATCHDOG, HAL_watchdog_refresh()); + hal.watchdog_refresh(); status = (bool) HAL_SD_Init(&hsd); if (!status) break; if (!--retry_Cnt) return false; // return failing status if retries are exhausted @@ -243,7 +243,7 @@ bool SDIO_Init() { static bool SDIO_ReadWriteBlock_DMA(uint32_t block, const uint8_t *src, uint8_t *dst) { if (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) return false; - TERN_(USE_WATCHDOG, HAL_watchdog_refresh()); + hal.watchdog_refresh(); HAL_StatusTypeDef ret; if (src) { diff --git a/Marlin/src/HAL/STM32/watchdog.cpp b/Marlin/src/HAL/STM32/watchdog.cpp deleted file mode 100644 index 1eccdec4985d..000000000000 --- a/Marlin/src/HAL/STM32/watchdog.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#include "../platforms.h" - -#ifdef HAL_STM32 - -#include "../../inc/MarlinConfigPre.h" - -#if ENABLED(USE_WATCHDOG) - -#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout - -#include "../../inc/MarlinConfig.h" - -#include "watchdog.h" -#include - -void watchdog_init() { - #if DISABLED(DISABLE_WATCHDOG_INIT) - IWatchdog.begin(WDT_TIMEOUT_US); - #endif -} - -void HAL_watchdog_refresh() { - IWatchdog.reload(); - #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) - TOGGLE(LED_PIN); // heartbeat indicator - #endif -} - -#endif // USE_WATCHDOG -#endif // HAL_STM32 diff --git a/Marlin/src/HAL/STM32/watchdog.h b/Marlin/src/HAL/STM32/watchdog.h deleted file mode 100644 index 49a0d9c631d8..000000000000 --- a/Marlin/src/HAL/STM32/watchdog.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -void watchdog_init(); -void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/STM32F1/HAL.cpp b/Marlin/src/HAL/STM32F1/HAL.cpp index 43ee91e49044..4d3140001e82 100644 --- a/Marlin/src/HAL/STM32F1/HAL.cpp +++ b/Marlin/src/HAL/STM32F1/HAL.cpp @@ -113,6 +113,47 @@ #endif #endif +// ------------------------ +// Watchdog Timer +// ------------------------ + +#if ENABLED(USE_WATCHDOG) + + #include + + void watchdogSetup() { + // do whatever. don't remove this function. + } + + /** + * The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0). + */ + #define STM32F1_WD_RELOAD TERN(WATCHDOG_DURATION_8S, 1250, 625) // 4 or 8 second timeout + + /** + * @brief Initialize the independent hardware watchdog. + * + * @return No return + * + * @details The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0). + */ + void MarlinHAL::watchdog_init() { + #if DISABLED(DISABLE_WATCHDOG_INIT) + iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD); + #endif + } + + // Reset watchdog. MUST be called every 4 or 8 seconds after the + // first watchdog_init or the STM32F1 will reset. + void MarlinHAL::watchdog_refresh() { + #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) + TOGGLE(LED_PIN); // heartbeat indicator + #endif + iwdg_feed(); + } + +#endif // USE_WATCHDOG + // ------------------------ // ADC // ------------------------ diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index a42dd89b8d27..b14b5f7e7926 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -34,7 +34,6 @@ #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #include #include @@ -247,6 +246,10 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + static void init(); // Called early in setup() static void init_board() {} // Called less early in setup() static void reboot(); // Restart the firmware from 0x0 diff --git a/Marlin/src/HAL/STM32F1/MinSerial.cpp b/Marlin/src/HAL/STM32F1/MinSerial.cpp index 0f7e0d5f10c5..6cf68d8d8f45 100644 --- a/Marlin/src/HAL/STM32F1/MinSerial.cpp +++ b/Marlin/src/HAL/STM32F1/MinSerial.cpp @@ -27,7 +27,6 @@ #if ENABLED(POSTMORTEM_DEBUGGING) #include "../shared/MinSerial.h" -#include "watchdog.h" #include #include @@ -82,7 +81,7 @@ static void TX(char c) { #if WITHIN(SERIAL_PORT, 1, 6) struct usart_dev* dev = MYSERIAL1.c_dev(); while (!(dev->regs->SR & USART_SR_TXE)) { - TERN_(USE_WATCHDOG, HAL_watchdog_refresh()); + hal.watchdog_refresh(); sw_barrier(); } dev->regs->DR = c; diff --git a/Marlin/src/HAL/STM32F1/watchdog.cpp b/Marlin/src/HAL/STM32F1/watchdog.cpp deleted file mode 100644 index b812a4fa6403..000000000000 --- a/Marlin/src/HAL/STM32F1/watchdog.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) - */ - -#ifdef __STM32F1__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include -#include "watchdog.h" - -/** - * The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0). - */ -#define STM32F1_WD_RELOAD TERN(WATCHDOG_DURATION_8S, 1250, 625) // 4 or 8 second timeout - -void HAL_watchdog_refresh() { - #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) - TOGGLE(LED_PIN); // heartbeat indicator - #endif - iwdg_feed(); -} - -void watchdogSetup() { - // do whatever. don't remove this function. -} - -/** - * @brief Initialized the independent hardware watchdog. - * - * @return No return - * - * @details The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0). - */ -void watchdog_init() { - #if DISABLED(DISABLE_WATCHDOG_INIT) - iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD); - #endif -} - -#endif // USE_WATCHDOG -#endif // __STM32F1__ diff --git a/Marlin/src/HAL/STM32F1/watchdog.h b/Marlin/src/HAL/STM32F1/watchdog.h deleted file mode 100644 index 68920f8cb692..000000000000 --- a/Marlin/src/HAL/STM32F1/watchdog.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -/** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) - */ - -#include - -// Initialize watchdog with a 4 or 8 second countdown time -void watchdog_init(); - -// Reset watchdog. MUST be called every 4 or 8 seconds after the -// first watchdog_init or the STM32F1 will reset. -void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.cpp b/Marlin/src/HAL/TEENSY31_32/HAL.cpp index 28c3fdc4d6f4..2892368967e4 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL.cpp @@ -62,6 +62,28 @@ uint8_t MarlinHAL::get_reset_source() { return 0; } +// ------------------------ +// Watchdog Timer +// ------------------------ + +#if ENABLED(USE_WATCHDOG) + + #define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout + + void MarlinHAL::watchdog_init() { + WDOG_TOVALH = 0; + WDOG_TOVALL = WDT_TIMEOUT_MS; + WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN; + } + + void MarlinHAL::watchdog_refresh() { + // Watchdog refresh sequence + WDOG_REFRESH = 0xA602; + WDOG_REFRESH = 0xB480; + } + +#endif + // ------------------------ // ADC // ------------------------ diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.h b/Marlin/src/HAL/TEENSY31_32/HAL.h index dc0d2d3fa939..a7aa9f0da211 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/TEENSY31_32/HAL.h @@ -32,7 +32,6 @@ #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #include @@ -135,6 +134,10 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + static void init() {} // Called early in setup() static void init_board() {} // Called less early in setup() static void reboot(); // Restart the firmware from 0x0 diff --git a/Marlin/src/HAL/TEENSY31_32/watchdog.cpp b/Marlin/src/HAL/TEENSY31_32/watchdog.cpp deleted file mode 100644 index 5e21236129db..000000000000 --- a/Marlin/src/HAL/TEENSY31_32/watchdog.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifdef __MK20DX256__ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout - -void watchdog_init() { - WDOG_TOVALH = 0; - WDOG_TOVALL = WDT_TIMEOUT_MS; - WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN; -} - -#endif // USE_WATCHDOG - -#endif // __MK20DX256__ diff --git a/Marlin/src/HAL/TEENSY31_32/watchdog.h b/Marlin/src/HAL/TEENSY31_32/watchdog.h deleted file mode 100644 index b8b46a403013..000000000000 --- a/Marlin/src/HAL/TEENSY31_32/watchdog.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include "HAL.h" - -// Arduino Due core now has watchdog support - -void watchdog_init(); - -inline void HAL_watchdog_refresh() { - // Watchdog refresh sequence - WDOG_REFRESH = 0xA602; - WDOG_REFRESH = 0xB480; -} diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.cpp b/Marlin/src/HAL/TEENSY35_36/HAL.cpp index 5fbb49fd924f..bc02ac1c4524 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL.cpp @@ -61,6 +61,28 @@ uint8_t MarlinHAL::get_reset_source() { return 0; } +// ------------------------ +// Watchdog Timer +// ------------------------ + +#if ENABLED(USE_WATCHDOG) + + #define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout + + void MarlinHAL::watchdog_init() { + WDOG_TOVALH = 0; + WDOG_TOVALL = WDT_TIMEOUT_MS; + WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN; + } + + void MarlinHAL::watchdog_refresh() { + // Watchdog refresh sequence + WDOG_REFRESH = 0xA602; + WDOG_REFRESH = 0xB480; + } + +#endif + // ------------------------ // ADC // ------------------------ diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.h b/Marlin/src/HAL/TEENSY35_36/HAL.h index 84f071d73d49..2a192e47189d 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/TEENSY35_36/HAL.h @@ -32,7 +32,6 @@ #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #include #include @@ -140,6 +139,10 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + static void init() {} // Called early in setup() static void init_board() {} // Called less early in setup() static void reboot(); // Restart the firmware from 0x0 diff --git a/Marlin/src/HAL/TEENSY35_36/watchdog.cpp b/Marlin/src/HAL/TEENSY35_36/watchdog.cpp deleted file mode 100644 index 3825e2792869..000000000000 --- a/Marlin/src/HAL/TEENSY35_36/watchdog.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#if defined(__MK64FX512__) || defined(__MK66FX1M0__) - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout - -void watchdog_init() { - WDOG_TOVALH = 0; - WDOG_TOVALL = WDT_TIMEOUT_MS; - WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN; -} - -#endif // USE_WATCHDOG - -#endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin/src/HAL/TEENSY35_36/watchdog.h b/Marlin/src/HAL/TEENSY35_36/watchdog.h deleted file mode 100644 index 981b1f0bd20b..000000000000 --- a/Marlin/src/HAL/TEENSY35_36/watchdog.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -void watchdog_init(); - -inline void HAL_watchdog_refresh() { - // Watchdog refresh sequence - WDOG_REFRESH = 0xA602; - WDOG_REFRESH = 0xB480; -} diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.cpp b/Marlin/src/HAL/TEENSY40_41/HAL.cpp index 4b9c55a2ca89..1d02ab8575c3 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.cpp +++ b/Marlin/src/HAL/TEENSY40_41/HAL.cpp @@ -78,6 +78,31 @@ void MarlinHAL::clear_reset_source() { SRC_SRSR = reset_source; } +// ------------------------ +// Watchdog Timer +// ------------------------ + +#if ENABLED(USE_WATCHDOG) + + #define WDT_TIMEOUT TERN(WATCHDOG_DURATION_8S, 8, 4) // 4 or 8 second timeout + + constexpr uint8_t timeoutval = (WDT_TIMEOUT - 0.5f) / 0.5f; + + void MarlinHAL::watchdog_init() { + CCM_CCGR3 |= CCM_CCGR3_WDOG1(3); // enable WDOG1 clocks + WDOG1_WMCR = 0; // disable power down PDE + WDOG1_WCR |= WDOG_WCR_SRS | WDOG_WCR_WT(timeoutval); + WDOG1_WCR |= WDOG_WCR_WDE | WDOG_WCR_WDT | WDOG_WCR_SRE; + } + + void MarlinHAL::watchdog_refresh() { + // Watchdog refresh sequence + WDOG1_WSR = 0x5555; + WDOG1_WSR = 0xAAAA; + } + +#endif + // ------------------------ // ADC // ------------------------ diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index 0476a9809de0..c54a2e8a0b64 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -32,7 +32,6 @@ #include "../shared/HAL_SPI.h" #include "fastio.h" -#include "watchdog.h" #include #include @@ -162,6 +161,10 @@ class MarlinHAL { // Earliest possible init, before setup() MarlinHAL() {} + // Watchdog + static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {}); + static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {}); + static void init() {} // Called early in setup() static void init_board() {} // Called less early in setup() static void reboot(); // Restart the firmware from 0x0 diff --git a/Marlin/src/HAL/TEENSY40_41/watchdog.cpp b/Marlin/src/HAL/TEENSY40_41/watchdog.cpp deleted file mode 100644 index dd7c0aa92f09..000000000000 --- a/Marlin/src/HAL/TEENSY40_41/watchdog.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#ifdef __IMXRT1062__ - -/** - * HAL Watchdog for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) - */ - -#include "../../inc/MarlinConfig.h" - -#if ENABLED(USE_WATCHDOG) - -#include "watchdog.h" - -#define WDT_TIMEOUT TERN(WATCHDOG_DURATION_8S, 8, 4) // 4 or 8 second timeout - -constexpr uint8_t timeoutval = (WDT_TIMEOUT - 0.5f) / 0.5f; - -void watchdog_init() { - CCM_CCGR3 |= CCM_CCGR3_WDOG1(3); // enable WDOG1 clocks - WDOG1_WMCR = 0; // disable power down PDE - WDOG1_WCR |= WDOG_WCR_SRS | WDOG_WCR_WT(timeoutval); - WDOG1_WCR |= WDOG_WCR_WDE | WDOG_WCR_WDT | WDOG_WCR_SRE; -} - -void HAL_watchdog_refresh() { - // Watchdog refresh sequence - WDOG1_WSR = 0x5555; - WDOG1_WSR = 0xAAAA; -} - -#endif // USE_WATCHDOG -#endif // __IMXRT1062__ diff --git a/Marlin/src/HAL/TEENSY40_41/watchdog.h b/Marlin/src/HAL/TEENSY40_41/watchdog.h deleted file mode 100644 index 03ab151b0706..000000000000 --- a/Marlin/src/HAL/TEENSY40_41/watchdog.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -/** - * HAL Watchdog for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) - */ - -void watchdog_init(); - -void HAL_watchdog_refresh(); diff --git a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp index deaf09d2c000..e54661c77071 100644 --- a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp +++ b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp @@ -221,7 +221,7 @@ bool resume_from_fault() { // So we'll just need to refresh the watchdog for a while and then stop for the system to reboot uint32_t last = start; while (PENDING(last, end)) { - watchdog_refresh(); + hal.watchdog_refresh(); while (millis() == last) { /* nada */ } last = millis(); MinSerial::TX('.'); diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index a4bf4a111a16..e25c3a49119c 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -931,18 +931,18 @@ void minkill(const bool steppers_off/*=false*/) { // Wait for both KILL and ENC to be released while (TERN0(HAS_KILL, kill_state()) || TERN0(SOFT_RESET_ON_KILL, ui.button_pressed())) - watchdog_refresh(); + hal.watchdog_refresh(); // Wait for either KILL or ENC to be pressed again while (TERN1(HAS_KILL, !kill_state()) && TERN1(SOFT_RESET_ON_KILL, !ui.button_pressed())) - watchdog_refresh(); + hal.watchdog_refresh(); // Reboot the board hal.reboot(); #else - for (;;) watchdog_refresh(); // Wait for RESET button or power-cycle + for (;;) hal.watchdog_refresh(); // Wait for RESET button or power-cycle #endif } @@ -1549,7 +1549,7 @@ void setup() { #endif #if ENABLED(USE_WATCHDOG) - SETUP_RUN(watchdog_init()); // Reinit watchdog after hal.get_reset_source call + SETUP_RUN(hal.watchdog_init()); // Reinit watchdog after hal.get_reset_source call #endif #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index 0fc5edc54e98..de76b8e97936 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -69,7 +69,7 @@ inline void toggle_pins() { SERIAL_EOL(); } else { - watchdog_refresh(); + hal.watchdog_refresh(); report_pin_state_extended(pin, ignore_protection, true, F("Pulsing ")); #ifdef __STM32F1__ const auto prior_mode = _GET_MODE(i); @@ -98,10 +98,10 @@ inline void toggle_pins() { { pinMode(pin, OUTPUT); for (int16_t j = 0; j < repeat; j++) { - watchdog_refresh(); extDigitalWrite(pin, 0); safe_delay(wait); - watchdog_refresh(); extDigitalWrite(pin, 1); safe_delay(wait); - watchdog_refresh(); extDigitalWrite(pin, 0); safe_delay(wait); - watchdog_refresh(); + hal.watchdog_refresh(); extDigitalWrite(pin, 0); safe_delay(wait); + hal.watchdog_refresh(); extDigitalWrite(pin, 1); safe_delay(wait); + hal.watchdog_refresh(); extDigitalWrite(pin, 0); safe_delay(wait); + hal.watchdog_refresh(); } } #ifdef __STM32F1__ diff --git a/Marlin/src/gcode/feature/L6470/M916-M918.cpp b/Marlin/src/gcode/feature/L6470/M916-M918.cpp index 8d614603eda0..9e1f1b98da34 100644 --- a/Marlin/src/gcode/feature/L6470/M916-M918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-M918.cpp @@ -309,7 +309,6 @@ void GcodeSuite::M917() { } DEBUG_ECHOLNPGM("."); reset_stepper_timeout(); // keep steppers powered - watchdog_refresh(); safe_delay(5000); status_composite_temp = 0; for (j = 0; j < driver_count; j++) { diff --git a/Marlin/src/gcode/gcode_d.cpp b/Marlin/src/gcode/gcode_d.cpp index 2dd1de00013b..2ebe38bbcf19 100644 --- a/Marlin/src/gcode/gcode_d.cpp +++ b/Marlin/src/gcode/gcode_d.cpp @@ -214,7 +214,7 @@ void GcodeSuite::D(const int16_t dcode) { c = 1024 * 4; while (c--) { - TERN_(USE_WATCHDOG, watchdog_refresh()); + hal.watchdog_refresh(); card.write(buf, COUNT(buf)); } SERIAL_ECHOLNPGM(" done"); @@ -231,7 +231,7 @@ void GcodeSuite::D(const int16_t dcode) { __attribute__((aligned(sizeof(size_t)))) uint8_t buf[512]; uint16_t c = 1024 * 4; while (c--) { - TERN_(USE_WATCHDOG, watchdog_refresh()); + hal.watchdog_refresh(); card.read(buf, COUNT(buf)); bool error = false; for (uint16_t i = 0; i < COUNT(buf); i++) { diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index ab968c44b103..c2d01a07eb76 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -74,7 +74,7 @@ void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8 LOOP_S_L_N(x, 1, sizex - 1) DrawMeshVLine(x); LOOP_S_L_N(y, 1, sizey - 1) DrawMeshHLine(y); LOOP_L_N(y, sizey) { - watchdog_refresh(); + hal.watchdog_refresh(); LOOP_L_N(x, sizex) { uint16_t color = DWINUI::RainbowInt(zmesh[x][y], _MIN(-5, minz), _MAX(5, maxz)); uint8_t radius = rm(zmesh[x][y]); diff --git a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp index ebad70859741..5d6a99191034 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp @@ -402,7 +402,7 @@ void lv_gcode_file_read(uint8_t *data_buf) { char temp_test[200]; volatile uint16_t *p_index; - watchdog_refresh(); + hal.watchdog_refresh(); memset(public_buf, 0, 200); while (card.isFileOpen()) { diff --git a/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp b/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp index d95efd862ba9..d143234fd53e 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp @@ -104,7 +104,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { sync_plan_position(); // Raise Z as if it was homed do_z_clearance(Z_POST_CLEARANCE); - watchdog_refresh(); + hal.watchdog_refresh(); draw_return_ui(); return; case ID_M_RETURN: @@ -117,7 +117,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { #else // Otherwise do a Z clearance move like after Homing do_z_clearance(Z_POST_CLEARANCE); #endif - watchdog_refresh(); + hal.watchdog_refresh(); draw_return_ui(); return; } diff --git a/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp index ba2df10ecbd9..c618127980bb 100644 --- a/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp @@ -267,12 +267,12 @@ void spiFlashErase_PIC() { W25QXX.init(SPI_QUARTER_SPEED); // erase 0x001000 -64K for (pic_sectorcnt = 0; pic_sectorcnt < (64 - 4) / 4; pic_sectorcnt++) { - watchdog_refresh(); + hal.watchdog_refresh(); W25QXX.SPI_FLASH_SectorErase(PICINFOADDR + pic_sectorcnt * 4 * 1024); } // erase 64K -- 6M for (pic_sectorcnt = 0; pic_sectorcnt < (PIC_SIZE_xM * 1024 / 64 - 1); pic_sectorcnt++) { - watchdog_refresh(); + hal.watchdog_refresh(); W25QXX.SPI_FLASH_BlockErase((pic_sectorcnt + 1) * 64 * 1024); } } @@ -282,7 +282,7 @@ void spiFlashErase_PIC() { volatile uint32_t Font_sectorcnt = 0; W25QXX.init(SPI_QUARTER_SPEED); for (Font_sectorcnt = 0; Font_sectorcnt < 32 - 1; Font_sectorcnt++) { - watchdog_refresh(); + hal.watchdog_refresh(); W25QXX.SPI_FLASH_BlockErase(FONTINFOADDR + Font_sectorcnt * 64 * 1024); } } @@ -414,7 +414,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { return; } - watchdog_refresh(); + hal.watchdog_refresh(); disp_assets_update_progress(fn); W25QXX.init(SPI_QUARTER_SPEED); @@ -427,21 +427,21 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { totalSizeLoaded += pfileSize; if (assetType == ASSET_TYPE_LOGO) { do { - watchdog_refresh(); + hal.watchdog_refresh(); pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); Pic_Logo_Write((uint8_t*)fn, public_buf, pbr); } while (pbr >= BMP_WRITE_BUF_LEN); } else if (assetType == ASSET_TYPE_TITLE_LOGO) { do { - watchdog_refresh(); + hal.watchdog_refresh(); pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); Pic_TitleLogo_Write((uint8_t*)fn, public_buf, pbr); } while (pbr >= BMP_WRITE_BUF_LEN); } else if (assetType == ASSET_TYPE_G_PREVIEW) { do { - watchdog_refresh(); + hal.watchdog_refresh(); pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); default_view_Write(public_buf, pbr); } while (pbr >= BMP_WRITE_BUF_LEN); @@ -451,7 +451,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { SPIFlash.beginWrite(Pic_Write_Addr); #if HAS_SPI_FLASH_COMPRESSION do { - watchdog_refresh(); + hal.watchdog_refresh(); pbr = file.read(public_buf, SPI_FLASH_PageSize); TERN_(MARLIN_DEV_MODE, totalSizes += pbr); SPIFlash.writeData(public_buf, SPI_FLASH_PageSize); @@ -472,7 +472,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { else if (assetType == ASSET_TYPE_FONT) { Pic_Write_Addr = UNIGBK_FLASH_ADDR; do { - watchdog_refresh(); + hal.watchdog_refresh(); pbr = file.read(public_buf, BMP_WRITE_BUF_LEN); W25QXX.SPI_FLASH_BufferWrite(public_buf, Pic_Write_Addr, pbr); Pic_Write_Addr += pbr; @@ -493,11 +493,11 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { disp_assets_update(); disp_assets_update_progress(F("Erasing pics...")); - watchdog_refresh(); + hal.watchdog_refresh(); spiFlashErase_PIC(); #if HAS_SPI_FLASH_FONT disp_assets_update_progress(F("Erasing fonts...")); - watchdog_refresh(); + hal.watchdog_refresh(); spiFlashErase_FONT(); #endif diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp index 6e852a748703..378521031509 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -125,13 +125,13 @@ void tft_lvgl_init() { ui_cfg_init(); disp_language_init(); - watchdog_refresh(); // LVGL init takes time + hal.watchdog_refresh(); // LVGL init takes time // Init TFT first! SPI_TFT.spi_init(SPI_FULL_SPEED); SPI_TFT.LCD_init(); - watchdog_refresh(); // LVGL init takes time + hal.watchdog_refresh(); // LVGL init takes time #if ENABLED(USB_FLASH_DRIVE_SUPPORT) uint16_t usb_flash_loop = 1000; @@ -142,21 +142,21 @@ void tft_lvgl_init() { #endif do { card.media_driver_usbFlash.idle(); - watchdog_refresh(); + hal.watchdog_refresh(); delay(2); } while (!card.media_driver_usbFlash.isInserted() && usb_flash_loop--); card.mount(); #elif HAS_LOGO_IN_FLASH delay(1000); - watchdog_refresh(); + hal.watchdog_refresh(); delay(1000); #endif - watchdog_refresh(); // LVGL init takes time + hal.watchdog_refresh(); // LVGL init takes time #if ENABLED(SDSUPPORT) UpdateAssets(); - watchdog_refresh(); // LVGL init takes time + hal.watchdog_refresh(); // LVGL init takes time TERN_(MKS_TEST, mks_test_get()); #endif diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp index df90321c895d..73a76323fd2b 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp @@ -123,7 +123,7 @@ uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick) { void wifi_delay(int n) { const uint32_t start = getWifiTick(); while (getWifiTickDiff(start, getWifiTick()) < (uint32_t)n) - watchdog_refresh(); + hal.watchdog_refresh(); } void wifi_reset() { @@ -1882,7 +1882,7 @@ void wifi_rcv_handle() { void wifi_looping() { do { wifi_rcv_handle(); - watchdog_refresh(); + hal.watchdog_refresh(); } while (wifi_link_state == WIFI_TRANS_FILE); } @@ -1897,7 +1897,7 @@ void mks_esp_wifi_init() { esp_state = TRANSFER_IDLE; esp_port_begin(1); - watchdog_refresh(); + hal.watchdog_refresh(); wifi_reset(); #if 0 @@ -1950,14 +1950,14 @@ void mks_esp_wifi_init() { } void mks_wifi_firmware_update() { - watchdog_refresh(); + hal.watchdog_refresh(); card.openFileRead((char *)ESP_FIRMWARE_FILE); if (card.isFileOpen()) { card.closefile(); wifi_delay(2000); - watchdog_refresh(); + hal.watchdog_refresh(); if (usartFifoAvailable((SZ_USART_FIFO *)&WifiRxFifo) < 20) return; clear_cur_ui(); @@ -1965,7 +1965,7 @@ void mks_wifi_firmware_update() { lv_draw_dialog(DIALOG_TYPE_UPDATE_ESP_FIRMWARE); lv_task_handler(); - watchdog_refresh(); + hal.watchdog_refresh(); if (wifi_upload(0) >= 0) { card.removeFile((char *)ESP_FIRMWARE_FILE_RENAME); diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp index 675e0eb666d2..c07cc47a3689 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp @@ -265,7 +265,7 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t EspUploadResult stat; //IWDG_ReloadCounter(); - watchdog_refresh(); + hal.watchdog_refresh(); if (getWifiTickDiff(startTime, getWifiTick()) > msTimeout) return timeout; @@ -445,7 +445,7 @@ EspUploadResult Sync(uint16_t timeout) { for (;;) { size_t bodyLen; EspUploadResult rc = readPacket(ESP_SYNC, 0, &bodyLen, defaultTimeout); - watchdog_refresh(); + hal.watchdog_refresh(); if (rc != success || bodyLen != 2) break; } } @@ -673,7 +673,7 @@ int32_t wifi_upload(int type) { while (esp_upload.state != upload_idle) { upload_spin(); - watchdog_refresh(); + hal.watchdog_refresh(); } ResetWiFiForUpload(1); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index df1e3f6fc832..2a2b47d40b6c 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1226,10 +1226,10 @@ inline void loud_kill(FSTR_P const lcd_msg, const heater_id_t heater_id) { thermalManager.disable_all_heaters(); #if HAS_BEEPER for (uint8_t i = 20; i--;) { - watchdog_refresh(); + hal.watchdog_refresh(); buzzer.click(25); delay(80); - watchdog_refresh(); + hal.watchdog_refresh(); } buzzer.on(); #endif @@ -1274,7 +1274,7 @@ void Temperature::_temp_error(const heater_id_t heater_id, FSTR_P const serial_m } disable_all_heaters(); // always disable (even for bogus temp) - watchdog_refresh(); + hal.watchdog_refresh(); #if BOGUS_TEMPERATURE_GRACE_PERIOD const millis_t ms = millis(); @@ -1638,7 +1638,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { * - Update the heated bed PID output value */ void Temperature::manage_heater() { - if (marlin_state == MF_INITIALIZING) return watchdog_refresh(); // If Marlin isn't started, at least reset the watchdog! + if (marlin_state == MF_INITIALIZING) return hal.watchdog_refresh(); // If Marlin isn't started, at least reset the watchdog! static bool no_reentry = false; // Prevent recursion if (no_reentry) return; @@ -2387,7 +2387,7 @@ void Temperature::manage_heater() { */ void Temperature::updateTemperaturesFromRawValues() { - watchdog_refresh(); // Reset because raw_temps_ready was set by the interrupt + hal.watchdog_refresh(); // Reset because raw_temps_ready was set by the interrupt TERN_(TEMP_SENSOR_0_IS_MAX_TC, temp_hotend[0].setraw(READ_MAX_TC(0))); TERN_(TEMP_SENSOR_1_IS_MAX_TC, temp_hotend[1].setraw(READ_MAX_TC(1))); diff --git a/Marlin/src/sd/Sd2Card.cpp b/Marlin/src/sd/Sd2Card.cpp index 3402bfaee382..2d84c95a3d19 100644 --- a/Marlin/src/sd/Sd2Card.cpp +++ b/Marlin/src/sd/Sd2Card.cpp @@ -249,7 +249,7 @@ bool DiskIODriver_SPI_SD::init(const uint8_t sckRateID, const pin_t chipSelectPi const millis_t init_timeout = millis() + SD_INIT_TIMEOUT; uint32_t arg; - watchdog_refresh(); // In case init takes too long + hal.watchdog_refresh(); // In case init takes too long // Set pin modes #if ENABLED(ZONESTAR_12864OLED) @@ -270,7 +270,7 @@ bool DiskIODriver_SPI_SD::init(const uint8_t sckRateID, const pin_t chipSelectPi // Must supply min of 74 clock cycles with CS high. LOOP_L_N(i, 10) spiSend(0xFF); - watchdog_refresh(); // In case init takes too long + hal.watchdog_refresh(); // In case init takes too long // Command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { @@ -284,7 +284,7 @@ bool DiskIODriver_SPI_SD::init(const uint8_t sckRateID, const pin_t chipSelectPi crcSupported = (cardCommand(CMD59, 1) == R1_IDLE_STATE); #endif - watchdog_refresh(); // In case init takes too long + hal.watchdog_refresh(); // In case init takes too long // check SD version for (;;) { @@ -306,7 +306,7 @@ bool DiskIODriver_SPI_SD::init(const uint8_t sckRateID, const pin_t chipSelectPi } } - watchdog_refresh(); // In case init takes too long + hal.watchdog_refresh(); // In case init takes too long // Initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0x40000000 : 0; From 9a74bcd4cf13efa2d7cfb365182d7e097eaa1f1d Mon Sep 17 00:00:00 2001 From: John Robertson Date: Tue, 31 May 2022 23:09:44 +0100 Subject: [PATCH 348/502] =?UTF-8?q?=E2=9C=A8=20Laser=20Safety=20Timeout=20?= =?UTF-8?q?(#24189)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 10 +++++ Marlin/src/MarlinCore.cpp | 47 ++++++++++++------------ Marlin/src/feature/spindle_laser.cpp | 4 +- Marlin/src/feature/spindle_laser.h | 3 +- Marlin/src/gcode/control/M17_M18_M84.cpp | 11 +++++- Marlin/src/gcode/control/M3-M5.cpp | 4 ++ Marlin/src/gcode/control/M85.cpp | 9 ++++- Marlin/src/gcode/gcode.cpp | 7 +++- Marlin/src/gcode/gcode.h | 16 +++++--- Marlin/src/inc/Conditionals_adv.h | 4 ++ Marlin/src/inc/SanityCheck.h | 6 +++ Marlin/src/module/temperature.cpp | 13 +++++++ buildroot/tests/BIGTREE_SKR_PRO | 2 +- buildroot/tests/mega2560 | 8 ++-- 14 files changed, 104 insertions(+), 40 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index ab0b7cdf20e5..1202f1f51793 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3544,6 +3544,16 @@ #define LASER_TEST_PULSE_MIN 1 // Used with Laser Control Menu #define LASER_TEST_PULSE_MAX 999 // Caution: Menu may not show more than 3 characters + /** + * Laser Safety Timeout + * + * The laser should be turned off when there is no movement for a period of time. + * Consider material flammability, cut rate, and G-code order when setting this + * value. Too low and it could turn off during a very slow move; too high and + * the material could ignite. + */ + #define LASER_SAFETY_TIMEOUT_MS 1000 // (ms) + /** * Enable inline laser power to be handled in the planner / stepper routines. * Inline power is specified by the I (inline) flag in an M3 command (e.g., M3 S20 I) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index e25c3a49119c..76bc988483c2 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -423,34 +423,35 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { kill(); } + const bool has_blocks = planner.has_blocks_queued(); // Any moves in the planner? + if (has_blocks) gcode.reset_stepper_timeout(ms); // Reset timeout for M18/M84, M85 max 'kill', and laser. + // M18 / M84 : Handle steppers inactive time timeout - if (gcode.stepper_inactive_time) { + #if HAS_DISABLE_INACTIVE_AXIS + if (gcode.stepper_inactive_time) { - static bool already_shutdown_steppers; // = false + static bool already_shutdown_steppers; // = false - // Any moves in the planner? Resets both the M18/M84 - // activity timeout and the M85 max 'kill' timeout - if (planner.has_blocks_queued()) - gcode.reset_stepper_timeout(ms); - else if (!do_reset_timeout && gcode.stepper_inactive_timeout()) { - if (!already_shutdown_steppers) { - already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this - - // Individual axes will be disabled if configured - TERN_(DISABLE_INACTIVE_X, stepper.disable_axis(X_AXIS)); - TERN_(DISABLE_INACTIVE_Y, stepper.disable_axis(Y_AXIS)); - TERN_(DISABLE_INACTIVE_Z, stepper.disable_axis(Z_AXIS)); - TERN_(DISABLE_INACTIVE_I, stepper.disable_axis(I_AXIS)); - TERN_(DISABLE_INACTIVE_J, stepper.disable_axis(J_AXIS)); - TERN_(DISABLE_INACTIVE_K, stepper.disable_axis(K_AXIS)); - TERN_(DISABLE_INACTIVE_E, stepper.disable_e_steppers()); - - TERN_(AUTO_BED_LEVELING_UBL, bedlevel.steppers_were_disabled()); + if (!has_blocks && !do_reset_timeout && gcode.stepper_inactive_timeout()) { + if (!already_shutdown_steppers) { + already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this + + // Individual axes will be disabled if configured + TERN_(DISABLE_INACTIVE_X, stepper.disable_axis(X_AXIS)); + TERN_(DISABLE_INACTIVE_Y, stepper.disable_axis(Y_AXIS)); + TERN_(DISABLE_INACTIVE_Z, stepper.disable_axis(Z_AXIS)); + TERN_(DISABLE_INACTIVE_I, stepper.disable_axis(I_AXIS)); + TERN_(DISABLE_INACTIVE_J, stepper.disable_axis(J_AXIS)); + TERN_(DISABLE_INACTIVE_K, stepper.disable_axis(K_AXIS)); + TERN_(DISABLE_INACTIVE_E, stepper.disable_e_steppers()); + + TERN_(AUTO_BED_LEVELING_UBL, bedlevel.steppers_were_disabled()); + } } + else + already_shutdown_steppers = false; } - else - already_shutdown_steppers = false; - } + #endif #if ENABLED(PHOTO_GCODE) && PIN_EXISTS(CHDK) // Check if CHDK should be set to LOW (after M240 set it HIGH) diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index ef3503c40d88..8f70816c9942 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -39,7 +39,8 @@ #endif SpindleLaser cutter; -uint8_t SpindleLaser::power; +uint8_t SpindleLaser::power, + SpindleLaser::last_power_applied; // = 0 // Basic power state tracking #if ENABLED(LASER_FEATURE) cutter_test_pulse_t SpindleLaser::testPulse = 50; // Test fire Pulse time ms value. #endif @@ -113,7 +114,6 @@ void SpindleLaser::init() { * @param opwr Power value. Range 0 to MAX. When 0 disable spindle/laser. */ void SpindleLaser::apply_power(const uint8_t opwr) { - static uint8_t last_power_applied = 0; if (opwr == last_power_applied) return; last_power_applied = opwr; power = opwr; diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 1f9bec7bf0f9..a9dc7794c4e9 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -91,7 +91,8 @@ class SpindleLaser { #endif static bool isReady; // Ready to apply power setting from the UI to OCR - static uint8_t power; + static uint8_t power, + last_power_applied; // Basic power state tracking #if ENABLED(MARLIN_DEV_MODE) static cutter_frequency_t frequency; // Set PWM frequency; range: 2K-50K diff --git a/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin/src/gcode/control/M17_M18_M84.cpp index a4738b6359b7..ac3a602687a9 100644 --- a/Marlin/src/gcode/control/M17_M18_M84.cpp +++ b/Marlin/src/gcode/control/M17_M18_M84.cpp @@ -213,7 +213,16 @@ void try_to_disable(const stepper_flags_t to_disable) { void GcodeSuite::M18_M84() { if (parser.seenval('S')) { reset_stepper_timeout(); - stepper_inactive_time = parser.value_millis_from_seconds(); + #if HAS_DISABLE_INACTIVE_AXIS + const millis_t ms = parser.value_millis_from_seconds(); + #if LASER_SAFETY_TIMEOUT_MS > 0 + if (ms && ms <= LASER_SAFETY_TIMEOUT_MS) { + SERIAL_ECHO_MSG("M18 timeout must be > ", MS_TO_SEC(LASER_SAFETY_TIMEOUT_MS + 999), " s for laser safety."); + return; + } + #endif + stepper_inactive_time = ms; + #endif } else { if (parser.seen_axis()) { diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index 2cf22e81ce0c..a619b1b76208 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -66,6 +66,10 @@ * PWM duty cycle goes from 0 (off) to 255 (always on). */ void GcodeSuite::M3_M4(const bool is_M4) { + #if LASER_SAFETY_TIMEOUT_MS > 0 + reset_stepper_timeout(); // Reset timeout to allow subsequent G-code to power the laser (imm.) + #endif + #if EITHER(SPINDLE_LASER_USE_PWM, SPINDLE_SERVO) auto get_s_power = [] { if (parser.seenval('S')) { diff --git a/Marlin/src/gcode/control/M85.cpp b/Marlin/src/gcode/control/M85.cpp index 9c8c02c59aa0..ee868349ed75 100644 --- a/Marlin/src/gcode/control/M85.cpp +++ b/Marlin/src/gcode/control/M85.cpp @@ -29,7 +29,14 @@ void GcodeSuite::M85() { if (parser.seen('S')) { reset_stepper_timeout(); - max_inactive_time = parser.value_millis_from_seconds(); + const millis_t ms = parser.value_millis_from_seconds(); + #if LASER_SAFETY_TIMEOUT_MS > 0 + if (ms && ms <= LASER_SAFETY_TIMEOUT_MS) { + SERIAL_ECHO_MSG("M85 timeout must be > ", MS_TO_SEC(LASER_SAFETY_TIMEOUT_MS + 999), " s for laser safety."); + return; + } + #endif + max_inactive_time = ms; } } diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 4f23db2e37cd..70e2f36f2f74 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -73,8 +73,11 @@ GcodeSuite gcode; // Inactivity shutdown millis_t GcodeSuite::previous_move_ms = 0, - GcodeSuite::max_inactive_time = 0, - GcodeSuite::stepper_inactive_time = SEC_TO_MS(DEFAULT_STEPPER_DEACTIVE_TIME); + GcodeSuite::max_inactive_time = 0; + +#if HAS_DISABLE_INACTIVE_AXIS + millis_t GcodeSuite::stepper_inactive_time = SEC_TO_MS(DEFAULT_STEPPER_DEACTIVE_TIME); +#endif // Relative motion mode for each logical axis static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES; diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index fe03879a0c36..772accba5dc0 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -395,14 +395,20 @@ class GcodeSuite { static bool select_coordinate_system(const int8_t _new); #endif - static millis_t previous_move_ms, max_inactive_time, stepper_inactive_time; - FORCE_INLINE static void reset_stepper_timeout(const millis_t ms=millis()) { previous_move_ms = ms; } + static millis_t previous_move_ms, max_inactive_time; FORCE_INLINE static bool stepper_max_timed_out(const millis_t ms=millis()) { return max_inactive_time && ELAPSED(ms, previous_move_ms + max_inactive_time); } - FORCE_INLINE static bool stepper_inactive_timeout(const millis_t ms=millis()) { - return ELAPSED(ms, previous_move_ms + stepper_inactive_time); - } + FORCE_INLINE static void reset_stepper_timeout(const millis_t ms=millis()) { previous_move_ms = ms; } + + #if HAS_DISABLE_INACTIVE_AXIS + static millis_t stepper_inactive_time; + FORCE_INLINE static bool stepper_inactive_timeout(const millis_t ms=millis()) { + return ELAPSED(ms, previous_move_ms + stepper_inactive_time); + } + #else + static bool stepper_inactive_timeout(const millis_t) { return false; } + #endif static void report_echo_start(const bool forReplay); static void report_heading(const bool forReplay, FSTR_P const fstr, const bool eol=true); diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 7a0c5dd934e3..309648a69d83 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1042,3 +1042,7 @@ #undef CONFIGURATION_EMBEDDING #define CANNOT_EMBED_CONFIGURATION defined(__AVR__) #endif + +#if ANY(DISABLE_INACTIVE_X, DISABLE_INACTIVE_Y, DISABLE_INACTIVE_Z, DISABLE_INACTIVE_I, DISABLE_INACTIVE_J, DISABLE_INACTIVE_K, DISABLE_INACTIVE_U, DISABLE_INACTIVE_V, DISABLE_INACTIVE_W, DISABLE_INACTIVE_E) + #define HAS_DISABLE_INACTIVE_AXIS 1 +#endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b4259bf53ad7..dadbf27273da 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3680,6 +3680,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "Enabled an inline laser feature without inline laser power being enabled." #endif #endif + #define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN) #if BOTH(SPINDLE_FEATURE, LASER_FEATURE) #error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE." @@ -3747,6 +3748,11 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #endif #endif #undef _PIN_CONFLICT + + #ifdef LASER_SAFETY_TIMEOUT_MS + static_assert(LASER_SAFETY_TIMEOUT_MS < (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL, "LASER_SAFETY_TIMEOUT_MS must be less than DEFAULT_STEPPER_DEACTIVE_TIME (" STRINGIFY(DEFAULT_STEPPER_DEACTIVE_TIME) " seconds)"); + #endif + #endif #if ENABLED(COOLANT_MIST) && !PIN_EXISTS(COOLANT_MIST) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 2a2b47d40b6c..ce84b5923369 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -71,6 +71,10 @@ #include "../libs/nozzle.h" #endif +#if LASER_SAFETY_TIMEOUT_MS > 0 + #include "../feature/spindle_laser.h" +#endif + // MAX TC related macros #define TEMP_SENSOR_IS_MAX(n, M) (ENABLED(TEMP_SENSOR_##n##_IS_MAX##M) || (ENABLED(TEMP_SENSOR_REDUNDANT_IS_MAX##M) && REDUNDANT_TEMP_MATCH(SOURCE, E##n))) #define TEMP_SENSOR_IS_ANY_MAX_TC(n) (ENABLED(TEMP_SENSOR_##n##_IS_MAX_TC) || (ENABLED(TEMP_SENSOR_REDUNDANT_IS_MAX_TC) && REDUNDANT_TEMP_MATCH(SOURCE, E##n))) @@ -3325,6 +3329,7 @@ class SoftPWM { /** * Handle various ~1kHz tasks associated with temperature + * - Check laser safety timeout * - Heater PWM (~1kHz with scaler) * - LCD Button polling (~500Hz) * - Start / Read one ADC sensor @@ -3334,6 +3339,14 @@ class SoftPWM { */ void Temperature::isr() { + // Shut down the laser if steppers are inactive for > LASER_SAFETY_TIMEOUT_MS ms + #if LASER_SAFETY_TIMEOUT_MS > 0 + if (cutter.last_power_applied && ELAPSED(millis(), gcode.previous_move_ms + (LASER_SAFETY_TIMEOUT_MS))) { + cutter.power = 0; // Prevent planner idle from re-enabling power + cutter.apply_power(0); + } + #endif + static int8_t temp_count = -1; static ADCSensorState adc_sensor_state = StartupDelay; static uint8_t pwm_count = _BV(SOFT_PWM_SCALE); diff --git a/buildroot/tests/BIGTREE_SKR_PRO b/buildroot/tests/BIGTREE_SKR_PRO index 2503b28544ad..2f1075c7ef22 100755 --- a/buildroot/tests/BIGTREE_SKR_PRO +++ b/buildroot/tests/BIGTREE_SKR_PRO @@ -26,7 +26,7 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_PRO_V1_1 SERIAL_PORT -1 \ CUTTER_POWER_UNIT PERCENT \ SPINDLE_LASER_PWM_PIN HEATER_1_PIN SPINDLE_LASER_ENA_PIN HEATER_2_PIN \ TEMP_SENSOR_COOLER 1000 TEMP_COOLER_PIN PD13 -opt_enable LASER_FEATURE REPRAP_DISCOUNT_SMART_CONTROLLER +opt_enable LASER_FEATURE LASER_SAFETY_TIMEOUT_MS REPRAP_DISCOUNT_SMART_CONTROLLER exec_test $1 $2 "BigTreeTech SKR Pro | Laser (Percent) | Cooling | LCD" "$3" # clean up diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560 index 3677abf60ef0..fc24cf212509 100755 --- a/buildroot/tests/mega2560 +++ b/buildroot/tests/mega2560 @@ -179,8 +179,8 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_C DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ AXIS_RELATIVE_MODES '{ false, false, false }' -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \ - LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER MEATPACK_ON_SERIAL_PORT_1 +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT MEATPACK_ON_SERIAL_PORT_1 \ + LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 12864 LCD | meatpack | SERIAL_PORT_2 " "$3" # @@ -193,8 +193,8 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_C DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ AXIS_RELATIVE_MODES '{ false, false, false }' -opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT PRINTCOUNTER \ - LASER_FEATURE AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_COOLANT_FLOW_METER I2C_AMMETER +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT PRINTCOUNTER I2C_AMMETER \ + LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Flowmeter | 44780 LCD " "$3" # From 28f8646aa64b8baf6f93197d04b0802580272e40 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 22 May 2022 19:56:46 -0500 Subject: [PATCH 349/502] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Apply=20F()=20to?= =?UTF-8?q?=20more=20LCD=20code=20(#24228)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/multi_language.h | 1 + Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 40 +-- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 49 ++-- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 32 +-- .../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 12 +- Marlin/src/lcd/e3v2/common/dwin_api.h | 2 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 4 +- Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp | 8 +- Marlin/src/lcd/e3v2/marlinui/dwin_string.h | 13 +- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 36 +-- .../bioprinter/advanced_settings.cpp | 2 +- Marlin/src/lcd/marlinui.cpp | 48 ++-- Marlin/src/lcd/marlinui.h | 6 +- Marlin/src/lcd/menu/menu.cpp | 20 +- Marlin/src/lcd/menu/menu.h | 56 ++-- Marlin/src/lcd/menu/menu_advanced.cpp | 4 +- Marlin/src/lcd/menu/menu_bed_corners.cpp | 18 +- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 14 +- Marlin/src/lcd/menu/menu_cancelobject.cpp | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 50 ++-- Marlin/src/lcd/menu/menu_delta_calibrate.cpp | 6 +- Marlin/src/lcd/menu/menu_filament.cpp | 104 ++++---- Marlin/src/lcd/menu/menu_info.cpp | 56 ++-- Marlin/src/lcd/menu/menu_item.h | 244 +++++++++--------- Marlin/src/lcd/menu/menu_language.cpp | 10 +- Marlin/src/lcd/menu/menu_main.cpp | 56 ++-- Marlin/src/lcd/menu/menu_media.cpp | 26 +- Marlin/src/lcd/menu/menu_mixer.cpp | 10 +- Marlin/src/lcd/menu/menu_motion.cpp | 88 +++---- Marlin/src/lcd/menu/menu_password.cpp | 12 +- Marlin/src/lcd/menu/menu_probe_offset.cpp | 10 +- Marlin/src/lcd/menu/menu_spindle_laser.cpp | 2 +- Marlin/src/lcd/menu/menu_tmc.cpp | 8 +- Marlin/src/lcd/menu/menu_tramming.cpp | 2 +- Marlin/src/lcd/menu/menu_tune.cpp | 10 +- Marlin/src/lcd/menu/menu_ubl.cpp | 58 ++--- Marlin/src/lcd/menu/menu_x_twist.cpp | 18 +- Marlin/src/lcd/tft/tft_string.cpp | 8 +- Marlin/src/lcd/tft/tft_string.h | 12 +- Marlin/src/lcd/tft/touch.cpp | 18 +- Marlin/src/lcd/tft/ui_1024x600.cpp | 22 +- Marlin/src/lcd/tft/ui_320x240.cpp | 14 +- Marlin/src/lcd/tft/ui_480x320.cpp | 14 +- Marlin/src/lcd/tft/ui_common.cpp | 16 +- 44 files changed, 627 insertions(+), 614 deletions(-) diff --git a/Marlin/src/core/multi_language.h b/Marlin/src/core/multi_language.h index a605a6f02441..05a713e435de 100644 --- a/Marlin/src/core/multi_language.h +++ b/Marlin/src/core/multi_language.h @@ -45,6 +45,7 @@ typedef const char Language_Str[]; // Set unused languages equal to each other so the // compiler can optimize away the conditionals. +#define LCD_LANGUAGE_1 LCD_LANGUAGE #ifndef LCD_LANGUAGE_2 #define LCD_LANGUAGE_2 LCD_LANGUAGE #endif diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 6c6ff4737793..f70b5b01749f 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -410,7 +410,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); } // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line void lcd_scroll(const lcd_uint_t col, const lcd_uint_t line, FSTR_P const ftxt, const uint8_t len, const int16_t time) { - uint8_t slen = utf8_strlen_P(FTOP(ftxt)); + uint8_t slen = utf8_strlen(ftxt); if (slen < len) { lcd_put_u8str_max(col, line, ftxt, len); for (; slen < len; ++slen) lcd_put_wchar(' '); @@ -437,10 +437,10 @@ void MarlinUI::clear_lcd() { lcd.clear(); } } } - static void logo_lines(PGM_P const extra) { - int16_t indent = (LCD_WIDTH - 8 - utf8_strlen_P(extra)) / 2; + static void logo_lines(FSTR_P const extra) { + int16_t indent = (LCD_WIDTH - 8 - utf8_strlen(extra)) / 2; lcd_put_wchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" )); lcd_put_wchar('\x01'); - lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str_P(extra); + lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str(extra); lcd_put_wchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" )); lcd_put_wchar('\x03'); } @@ -468,7 +468,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); } // // Show the Marlin logo, splash line1, and splash line 2 // - logo_lines(PSTR(" " SHORT_BUILD_VERSION)); + logo_lines(F(" " SHORT_BUILD_VERSION)); CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 2000); } else { @@ -476,7 +476,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); } // Show the Marlin logo and short build version // After a delay show the website URL // - logo_lines(NUL_STR); + logo_lines(FPSTR(NUL_STR)); CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500); CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500); #ifdef STRING_SPLASH_LINE3 @@ -1067,33 +1067,33 @@ void MarlinUI::draw_status_screen() { #endif // ADVANCED_PAUSE_FEATURE // Draw a static item with no left-right margin required. Centered by default. - void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { int8_t n = LCD_WIDTH; lcd_moveto(0, row); - const int8_t plen = pstr ? utf8_strlen_P(pstr) : 0, + const int8_t plen = fstr ? utf8_strlen(fstr) : 0, vlen = vstr ? utf8_strlen(vstr) : 0; if (style & SS_CENTER) { int8_t pad = (LCD_WIDTH - plen - vlen) / 2; while (--pad >= 0) { lcd_put_wchar(' '); n--; } } - if (plen) n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n); + if (plen) n = lcd_put_u8str_ind(fstr, itemIndex, itemString, n); if (vlen) n -= lcd_put_u8str_max(vstr, n); for (; n > 0; --n) lcd_put_wchar(' '); } // Draw a generic menu item with pre_char (if selected) and post_char - void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) { lcd_put_wchar(0, row, sel ? pre_char : ' '); - uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2); + uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2); for (; n; --n) lcd_put_wchar(' '); lcd_put_wchar(post_char); } // Draw a menu item with a (potentially) editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const inStr, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0; lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen); + uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen); if (vlen) { lcd_put_wchar(':'); for (; n; --n) lcd_put_wchar(' '); @@ -1102,9 +1102,9 @@ void MarlinUI::draw_status_screen() { } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); - uint8_t n = lcd_put_u8str_ind_P(0, 1, pstr, itemIndex, itemString, LCD_WIDTH - 1); + uint8_t n = lcd_put_u8str_ind(0, 1, fstr, itemIndex, itemString, LCD_WIDTH - 1); if (value) { lcd_put_wchar(':'); n--; const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space @@ -1115,21 +1115,21 @@ void MarlinUI::draw_status_screen() { } // The Select Screen presents a prompt and two "buttons" - void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { + void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { ui.draw_select_screen_prompt(pref, string, suff); if (no) { SETCURSOR(0, LCD_HEIGHT - 1); - lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd_put_wchar(yesno ? ' ' : ']'); + lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str(no); lcd_put_wchar(yesno ? ' ' : ']'); } if (yes) { - SETCURSOR_RJ(utf8_strlen_P(yes) + 2, LCD_HEIGHT - 1); - lcd_put_wchar(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd_put_wchar(yesno ? ']' : ' '); + SETCURSOR_RJ(utf8_strlen(yes) + 2, LCD_HEIGHT - 1); + lcd_put_wchar(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd_put_wchar(yesno ? ']' : ' '); } } #if ENABLED(SDSUPPORT) - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); constexpr uint8_t maxlen = LCD_WIDTH - 2; uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 5e418e2fe3fd..ca830960cb8f 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -380,13 +380,10 @@ void MarlinUI::clear_lcd() { void MarlinUI::_set_contrast() { lcd.setContrast(contrast); } #endif -static void center_text_P(PGM_P pstart, uint8_t y) { - uint8_t len = utf8_strlen_P(pstart); - if (len < LCD_WIDTH) - lcd.setCursor((LCD_WIDTH - len) / 2, y); - else - lcd.setCursor(0, y); - lcd_put_u8str_P(pstart); +static void center_text(FSTR_P const fstart, const uint8_t y) { + const uint8_t len = utf8_strlen(fstart); + lcd.setCursor(len < LCD_WIDTH ? (LCD_WIDTH - len) / 2 : 0, y); + lcd_put_u8str(fstart); } #if ENABLED(SHOW_BOOTSCREEN) @@ -402,8 +399,8 @@ static void center_text_P(PGM_P pstart, uint8_t y) { lcd.setCursor(indent, 0); lcd.write(TLC); lcd_put_u8str(F("------")); lcd.write(TRC); lcd.setCursor(indent, 1); lcd.write(LR); lcd_put_u8str(F("Marlin")); lcd.write(LR); lcd.setCursor(indent, 2); lcd.write(BLC); lcd_put_u8str(F("------")); lcd.write(BRC); - center_text_P(PSTR(SHORT_BUILD_VERSION), 3); - center_text_P(PSTR(MARLIN_WEBSITE_URL), 4); + center_text(F(SHORT_BUILD_VERSION), 3); + center_text(F(MARLIN_WEBSITE_URL), 4); picBits = ICON_LOGO; lcd.print_screen(); } @@ -420,8 +417,8 @@ void MarlinUI::draw_kill_screen() { lcd.setCursor(0, 3); lcd.write(COLOR_ERROR); lcd.setCursor((LCD_WIDTH - utf8_strlen(status_message)) / 2 + 1, 3); lcd_put_u8str(status_message); - center_text_P(GET_TEXT(MSG_HALTED), 5); - center_text_P(GET_TEXT(MSG_PLEASE_RESET), 6); + center_text(GET_TEXT_F(MSG_HALTED), 5); + center_text(GET_TEXT_F(MSG_PLEASE_RESET), 6); lcd.print_screen(); } @@ -940,38 +937,38 @@ void MarlinUI::draw_status_screen() { #endif // Draw a static item with no left-right margin required. Centered by default. - void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) { if (!PanelDetected) return; uint8_t n = LCD_WIDTH; lcd.setCursor(0, row); if ((style & SS_CENTER) && !valstr) { - int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; + int8_t pad = (LCD_WIDTH - utf8_strlen(fstr)) / 2; while (--pad >= 0) { lcd.write(' '); n--; } } - n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n); + n = lcd_put_u8str_ind(fstr, itemIndex, itemString, n); if (valstr) n -= lcd_put_u8str_max(valstr, n); for (; n; --n) lcd.write(' '); lcd.print_line(); } // Draw a generic menu item with pre_char (if selected) and post_char - void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) { if (!PanelDetected) return; lcd.setCursor(0, row); lcd.write(sel ? pre_char : ' '); - uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2); + uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2); for (; n; --n) lcd.write(' '); lcd.write(post_char); lcd.print_line(); } // Draw a menu item with a (potentially) editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const data, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const data, const bool pgm) { if (!PanelDetected) return; const uint8_t vlen = data ? (pgm ? utf8_strlen_P(data) : utf8_strlen(data)) : 0; lcd.setCursor(0, row); lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - uint8_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen); + uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen); if (vlen) { lcd.write(':'); for (; n; --n) lcd.write(' '); @@ -982,13 +979,13 @@ void MarlinUI::draw_status_screen() { // Low-level draw_edit_screen can be used to draw an edit screen from anyplace // This line moves to the last line of the screen for UBL plot screen on the panel side - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { if (!PanelDetected) return; ui.encoder_direction_normal(); const uint8_t y = TERN0(AUTO_BED_LEVELING_UBL, ui.external_control) ? LCD_HEIGHT - 1 : MIDDLE_Y; lcd.setCursor(0, y); lcd.write(COLOR_EDIT); - lcd_put_u8str_P(pstr); + lcd_put_u8str(fstr); if (value) { lcd.write(':'); lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), y); // Right-justified, padded by spaces @@ -1000,24 +997,24 @@ void MarlinUI::draw_status_screen() { } // The Select Screen presents a prompt and two "buttons" - void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff) { + void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string, FSTR_P const suff) { if (!PanelDetected) return; ui.draw_select_screen_prompt(pref, string, suff); lcd.write(COLOR_EDIT); if (no) { lcd.setCursor(0, MIDDLE_Y); - lcd.write(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd.write(yesno ? ' ' : ']'); + lcd.write(yesno ? ' ' : '['); lcd_put_u8str(no); lcd.write(yesno ? ' ' : ']'); } if (yes) { - lcd.setCursor(LCD_WIDTH - utf8_strlen_P(yes) - 3, MIDDLE_Y); - lcd.write(yesno ? '[' : ' '); lcd_put_u8str_P(yes); lcd.write(yesno ? ']' : ' '); + lcd.setCursor(LCD_WIDTH - utf8_strlen(yes) - 3, MIDDLE_Y); + lcd.write(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd.write(yesno ? ']' : ' '); } lcd.print_line(); } #if ENABLED(SDSUPPORT) - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (!PanelDetected) return; lcd.setCursor(0, row); lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); @@ -1081,7 +1078,7 @@ void MarlinUI::draw_status_screen() { else lcd_put_u8str(F(" -----")); - center_text_P(GET_TEXT(MSG_UBL_FINE_TUNE_MESH), 8); + center_text(GET_TEXT_F(MSG_UBL_FINE_TUNE_MESH), 8); lcd.print_screen(); } diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index eacd3d0afb74..3b40343628b0 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -412,28 +412,28 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } // Draw a static line of text in the same idiom as a menu item - void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { if (mark_as_selected(row, style & SS_INVERT)) { pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed - const int plen = pstr ? calculateWidth(pstr) : 0, + const int plen = fstr ? calculateWidth(FTOP(fstr)) : 0, vlen = vstr ? utf8_strlen(vstr) : 0; if (style & SS_CENTER) { int pad = (LCD_PIXEL_WIDTH - plen - vlen * MENU_FONT_WIDTH) / MENU_FONT_WIDTH / 2; while (--pad >= 0) n -= lcd_put_wchar(' '); } - if (plen) n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); + if (plen) n = lcd_put_u8str_ind(fstr, itemIndex, itemString, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); if (vlen) n -= lcd_put_u8str_max(vstr, n); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); } } // Draw a generic menu item - void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char, const char post_char) { if (mark_as_selected(row, sel)) { - pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 1) * (MENU_FONT_WIDTH); + pixel_len_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 1) * (MENU_FONT_WIDTH); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char); lcd_put_wchar(' '); @@ -441,13 +441,13 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } // Draw a menu item with an editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const inStr, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { if (mark_as_selected(row, sel)) { const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen((char*)inStr)), pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)inStr)); const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; - pixel_len_t n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH); + pixel_len_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH); if (vallen) { lcd_put_wchar(':'); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); @@ -457,11 +457,11 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } } - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; - const u8g_uint_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value); + const u8g_uint_t labellen = utf8_strlen(fstr), vallen = utf8_strlen(value); bool extra_row = labellen * prop > LCD_WIDTH - 2 - vallen * prop; #if ENABLED(USE_BIG_EDIT_FONT) @@ -490,7 +490,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Assume the label is alpha-numeric (with a descender) bool onpage = PAGE_CONTAINS(baseline - (EDIT_FONT_ASCENT - 1), baseline + EDIT_FONT_DESCENT); - if (onpage) lcd_put_u8str_ind_P(0, baseline, pstr, itemIndex, itemString); + if (onpage) lcd_put_u8str_ind(0, baseline, fstr, itemIndex, itemString); // If a value is included, print a colon, then print the value right-justified if (value) { @@ -508,8 +508,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop TERN_(USE_BIG_EDIT_FONT, ui.set_font(FONT_MENU)); } - inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, PGM_P const pstr, const bool inv) { - const u8g_uint_t len = utf8_strlen_P(pstr), + inline void draw_boxed_string(const u8g_uint_t x, const u8g_uint_t y, FSTR_P const fstr, const bool inv) { + const u8g_uint_t len = utf8_strlen(fstr), by = (y + 1) * (MENU_FONT_HEIGHT); const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; const pixel_len_t bw = len * prop * (MENU_FONT_WIDTH), bx = x * prop * (MENU_FONT_WIDTH); @@ -518,19 +518,19 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop u8g.drawBox(bx / prop - 1, by - (MENU_FONT_ASCENT), bw + 2, MENU_FONT_HEIGHT); u8g.setColorIndex(0); } - lcd_put_u8str_P(bx / prop, by, pstr); + lcd_put_u8str(bx / prop, by, fstr); if (inv) u8g.setColorIndex(1); } - void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { + void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { ui.draw_select_screen_prompt(pref, string, suff); if (no) draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno); - if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen_P(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno); + if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno); } #if ENABLED(SDSUPPORT) - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (mark_as_selected(row, sel)) { const uint8_t maxlen = LCD_WIDTH - isDir; if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]); diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index 4a794f500007..f1bf9d032ec8 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -517,14 +517,14 @@ U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT, drawCross(x, y, TFT_MARLINBG_COLOR); } - const char *str = nullptr; + FSTR_P str = nullptr; if (calibration_stage < CALIBRATION_SUCCESS) { // handle current state switch (calibration_stage) { - case CALIBRATION_TOP_LEFT: str = GET_TEXT(MSG_TOP_LEFT); break; - case CALIBRATION_BOTTOM_LEFT: str = GET_TEXT(MSG_BOTTOM_LEFT); break; - case CALIBRATION_TOP_RIGHT: str = GET_TEXT(MSG_TOP_RIGHT); break; - case CALIBRATION_BOTTOM_RIGHT: str = GET_TEXT(MSG_BOTTOM_RIGHT); break; + case CALIBRATION_TOP_LEFT: str = GET_TEXT_F(MSG_TOP_LEFT); break; + case CALIBRATION_BOTTOM_LEFT: str = GET_TEXT_F(MSG_BOTTOM_LEFT); break; + case CALIBRATION_TOP_RIGHT: str = GET_TEXT_F(MSG_TOP_RIGHT); break; + case CALIBRATION_BOTTOM_RIGHT: str = GET_TEXT_F(MSG_BOTTOM_RIGHT); break; default: break; } @@ -534,7 +534,7 @@ U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT, } else { // end calibration - str = calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED); + str = calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT_F(MSG_CALIBRATION_COMPLETED) : GET_TEXT_F(MSG_CALIBRATION_FAILED); defer_status_screen(false); touch_calibration.calibration_end(); TERN_(HAS_TOUCH_BUTTONS, redrawTouchButtons = true); diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.h b/Marlin/src/lcd/e3v2/common/dwin_api.h index 37b1525ba34a..81724c6edf97 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.h +++ b/Marlin/src/lcd/e3v2/common/dwin_api.h @@ -74,7 +74,7 @@ inline void DWIN_Text(size_t &i, const char * const string, uint16_t rlimit=0xFF inline void DWIN_Text(size_t &i, FSTR_P string, uint16_t rlimit=0xFFFF) { if (!string) return; - const size_t len = _MIN(sizeof(DWIN_SendBuf) - i, _MIN(rlimit, strlen_P((PGM_P)string))); // cast to PGM_P (const char*) measure with strlen_P. + const size_t len = _MIN(sizeof(DWIN_SendBuf) - i, _MIN(rlimit, strlen_P(FTOP(string)))); if (len == 0) return; memcpy_P(&DWIN_SendBuf[i+1], string, len); i += len; diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index e8d6abab0ca4..9fed9fee83d9 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -2944,7 +2944,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_VIEW: if (draw) - Draw_Menu_Item(row, ICON_Mesh, GET_TEXT(MSG_MESH_VIEW), nullptr, true); + Draw_Menu_Item(row, ICON_Mesh, GET_TEXT_F(MSG_MESH_VIEW), nullptr, true); else { #if ENABLED(AUTO_BED_LEVELING_UBL) if (bedlevel.storage_slot < 0) { @@ -3017,7 +3017,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; case LEVELING_VIEW_MESH: if (draw) - Draw_Menu_Item(row, ICON_PrintSize, GET_TEXT(MSG_MESH_VIEW), nullptr, true); + Draw_Menu_Item(row, ICON_PrintSize, GET_TEXT_F(MSG_MESH_VIEW), nullptr, true); else Draw_Menu(MeshViewer); break; diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp b/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp index e08d5360db53..4231c4d75f02 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp @@ -43,13 +43,13 @@ uint8_t read_byte(uint8_t *byte) { return *byte; } /** * Add a string, applying substitutions for the following characters: * - * $ displays the clipped C-string given by the itemString argument + * $ displays the clipped C-string given by the inStr argument * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) * @ displays an axis name such as XYZUVW, or E for an extruder */ -void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/*=nullptr*/) { +void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *inStr/*=nullptr*/) { wchar_t wchar; while (*string) { @@ -67,8 +67,8 @@ void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/* else add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED)); } - else if (ch == '$' && itemString) - add(itemString); + else if (ch == '$' && inStr) + add(inStr); else if (ch == '@') add_character(axis_codes[index]); else diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h index 64676dddfdaf..d013d56a870e 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h @@ -61,15 +61,20 @@ class DWIN_String { //static void add(uint8_t character) { add_character(character); eol(); } static void add(wchar_t character); static void add(uint8_t *string, uint8_t max_len=MAX_STRING_LENGTH); - static void add(uint8_t *string, const int8_t index, uint8_t *itemString=nullptr); + static void add(uint8_t *string, const int8_t index, uint8_t *inStr=nullptr); static void set(uint8_t *string) { set(); add(string); } static void set(wchar_t character) { set(); add(character); } - static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); } - static void set(FSTR_P fstring) { set((uint8_t *)fstring); } + static void set(uint8_t *string, int8_t index, const char *inStr=nullptr) { set(); add(string, index, (uint8_t *)inStr); } static void set(const char *string) { set((uint8_t *)string); } - static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } + static void set(const char *string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)string, index, inStr); } static void add(const char *string) { add((uint8_t *)string); } + static void add(FSTR_P const string, uint8_t max_len=MAX_STRING_LENGTH) { add((uint8_t *)FTOP(string), max_len); } + static void add(FSTR_P const string, int8_t index, uint8_t *inStr=nullptr) { add((uint8_t *)FTOP(string), index, inStr); } + static void set(FSTR_P const string) { set((uint8_t *)FTOP(string)); } + static void set(FSTR_P const string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)FTOP(string), index, inStr); } + static void add(FSTR_P const string) { add((uint8_t *)FTOP(string)); } + static void trim(const uint8_t character=0x20); static void rtrim(const uint8_t character=0x20); static void ltrim(const uint8_t character=0x20); diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 9cc634c3064e..d124c5294640 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -311,7 +311,7 @@ void MarlinUI::draw_status_message(const bool blink) { // Draw a static line of text in the same idiom as a menu item - void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { // Call mark_as_selected to draw a bigger selection box // and draw the text without a background if (mark_as_selected(row, (bool)(style & SS_INVERT), true)) { @@ -320,14 +320,14 @@ void MarlinUI::draw_status_message(const bool blink) { dwin_font.fg = Color_White; dwin_string.set(); - const int8_t plen = pstr ? utf8_strlen_P(pstr) : 0, + const int8_t plen = fstr ? utf8_strlen(fstr) : 0, vlen = vstr ? utf8_strlen(vstr) : 0; if (style & SS_CENTER) { int8_t pad = (LCD_WIDTH - 1 - plen - vlen) / 2; while (--pad) dwin_string.add(' '); } - if (plen) dwin_string.add((uint8_t*)pstr, itemIndex, (uint8_t*)itemString); + if (plen) dwin_string.add((uint8_t*)FTOP(fstr), itemIndex, (uint8_t*)FTOP(itemString)); if (vlen) dwin_string.add((uint8_t*)vstr); if (style & SS_CENTER) { int8_t pad = (LCD_WIDTH - 1 - plen - vlen) / 2; @@ -340,13 +340,13 @@ void MarlinUI::draw_status_message(const bool blink) { } // Draw a generic menu item - void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char, const char post_char) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char, const char post_char) { if (mark_as_selected(row, sel)) { ui.set_font(DWIN_FONT_MENU); dwin_font.solid = false; dwin_font.fg = Color_White; - dwin_string.set(pstr, itemIndex, itemString); + dwin_string.set(fstr, itemIndex, FTOP(itemString)); pixel_len_t n = LCD_WIDTH - 1 - dwin_string.length(); while (--n > 1) dwin_string.add(' '); @@ -361,15 +361,15 @@ void MarlinUI::draw_status_message(const bool blink) { // // Draw a menu item with an editable value // - void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { if (mark_as_selected(row, sel)) { ui.set_font(DWIN_FONT_MENU); dwin_font.solid = false; dwin_font.fg = Color_White; - const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen(S(data))); + const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen(S(inStr))); - dwin_string.set(pstr, itemIndex, itemString); + dwin_string.set(fstr, itemIndex, FTOP(itemString)); if (vallen) dwin_string.add(':'); lcd_moveto(1, row); @@ -377,7 +377,7 @@ void MarlinUI::draw_status_message(const bool blink) { if (vallen) { dwin_font.fg = Color_Yellow; - dwin_string.set(data); + dwin_string.set(inStr); lcd_moveto(LCD_WIDTH - vallen - 1, row); lcd_put_dwin_string(); } @@ -387,13 +387,13 @@ void MarlinUI::draw_status_message(const bool blink) { // // Draw an edit screen with label and current value // - void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char* const value/*=nullptr*/) { ui.encoder_direction_normal(); - const dwin_coord_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value); + const dwin_coord_t labellen = utf8_strlen(fstr), vallen = utf8_strlen(value); dwin_string.set(); - dwin_string.add((uint8_t*)pstr, itemIndex); + dwin_string.add((uint8_t*)FTOP(fstr), itemIndex); if (vallen) dwin_string.add(':'); // If a value is included, add a colon // Assume the label is alpha-numeric (with a descender) @@ -430,19 +430,19 @@ void MarlinUI::draw_status_message(const bool blink) { } } - inline void draw_boxed_string(const bool yesopt, PGM_P const pstr, const bool inv) { - const uint8_t len = utf8_strlen_P(pstr), + inline void draw_boxed_string(const bool yesopt, FSTR_P const fstr, const bool inv) { + const uint8_t len = utf8_strlen(fstr), mar = TERN(DWIN_MARLINUI_PORTRAIT, 1, 4), col = yesopt ? LCD_WIDTH - mar - len : mar, row = (LCD_HEIGHT >= 8 ? LCD_HEIGHT / 2 + 3 : LCD_HEIGHT - 1); lcd_moveto(col, row); DWIN_Draw_Box(1, inv ? Select_Color : Color_Bg_Black, cursor.x - dwin_font.width, cursor.y + 1, dwin_font.width * (len + 2), dwin_font.height + 2); - lcd_put_u8str_P(col, row, pstr); + lcd_put_u8str(col, row, fstr); } void MenuItem_confirm::draw_select_screen( - PGM_P const yes, PGM_P const no, const bool yesno, - PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/ + FSTR_P const yes, FSTR_P const no, const bool yesno, + FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/ ) { ui.set_font(DWIN_FONT_MENU); dwin_font.solid = false; @@ -454,7 +454,7 @@ void MarlinUI::draw_status_message(const bool blink) { #if ENABLED(SDSUPPORT) - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (mark_as_selected(row, sel)) { dwin_string.set(); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp index 6d42fd41e4dd..e9df264c1dd2 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp @@ -64,7 +64,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(13) .button(BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE)) .tag(14) .button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS)) .colors(action_btn) - .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); + .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); } } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 940b5b42eb1d..af1286c48b00 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -140,12 +140,12 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; preheat_t MarlinUI::material_preset[PREHEAT_COUNT]; // Initialized by settings.load() - PGM_P MarlinUI::get_preheat_label(const uint8_t m) { + FSTR_P MarlinUI::get_preheat_label(const uint8_t m) { #define _PDEF(N) static PGMSTR(preheat_##N##_label, PREHEAT_##N##_LABEL); #define _PLBL(N) preheat_##N##_label, REPEAT_1(PREHEAT_COUNT, _PDEF); static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT_1(PREHEAT_COUNT, _PLBL) }; - return (PGM_P)pgm_read_ptr(&preheat_labels[m]); + return FPSTR((PGM_P)pgm_read_ptr(&preheat_labels[m])); } void MarlinUI::apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e/*=active_extruder*/) { @@ -454,20 +454,20 @@ void MarlinUI::init() { } } - void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { - const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0; + void MarlinUI::draw_select_screen_prompt(FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { + const uint8_t plen = utf8_strlen(pref), slen = suff ? utf8_strlen(suff) : 0; uint8_t col = 0, row = 0; if (!string && plen + slen <= LCD_WIDTH) { col = (LCD_WIDTH - plen - slen) / 2; row = LCD_HEIGHT > 3 ? 1 : 0; } if (LCD_HEIGHT >= 8) row = LCD_HEIGHT / 2 - 2; - wrap_string_P(col, row, pref, true); + wrap_string_P(col, row, FTOP(pref), true); if (string) { if (col) { col = 0; row++; } // Move to the start of the next line wrap_string(col, row, string); } - if (suff) wrap_string_P(col, row, suff); + if (suff) wrap_string_P(col, row, FTOP(suff)); } #endif // !HAS_GRAPHICAL_TFT @@ -484,17 +484,17 @@ void MarlinUI::init() { #if HAS_MARLINUI_MENU && !HAS_ADC_BUTTONS - void lcd_move_x(); - void lcd_move_y(); - void lcd_move_z(); - void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) { ui.manual_move.menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; ui.encoderPosition = dir; switch (axis) { - case X_AXIS: lcd_move_x(); break; - case Y_AXIS: lcd_move_y(); break; - case Z_AXIS: lcd_move_z(); + case X_AXIS: { void lcd_move_x(); lcd_move_x(); } break; + #if HAS_Y_AXIS + case Y_AXIS: { void lcd_move_y(); lcd_move_y(); } break; + #endif + #if HAS_Z_AXIS + case Z_AXIS: { void lcd_move_z(); lcd_move_z(); } break; + #endif default: break; } } @@ -1651,7 +1651,7 @@ void MarlinUI::init() { void MarlinUI::pause_print() { #if HAS_MARLINUI_MENU - synchronize(GET_TEXT(MSG_PAUSING)); + synchronize(GET_TEXT_F(MSG_PAUSING)); defer_status_screen(); #endif @@ -1855,12 +1855,12 @@ void MarlinUI::init() { #if DISABLED(EEPROM_AUTO_INIT) - static inline PGM_P eeprom_err(const uint8_t msgid) { + static inline FSTR_P eeprom_err(const uint8_t msgid) { switch (msgid) { default: - case 0: return GET_TEXT(MSG_ERR_EEPROM_CRC); - case 1: return GET_TEXT(MSG_ERR_EEPROM_INDEX); - case 2: return GET_TEXT(MSG_ERR_EEPROM_VERSION); + case 0: return GET_TEXT_F(MSG_ERR_EEPROM_CRC); + case 1: return GET_TEXT_F(MSG_ERR_EEPROM_INDEX); + case 2: return GET_TEXT_F(MSG_ERR_EEPROM_VERSION); } } @@ -1868,17 +1868,17 @@ void MarlinUI::init() { #if HAS_MARLINUI_MENU editable.uint8 = msgid; goto_screen([]{ - PGM_P const restore_msg = GET_TEXT(MSG_INIT_EEPROM); - char msg[utf8_strlen_P(restore_msg) + 1]; - strcpy_P(msg, restore_msg); + FSTR_P const restore_msg = GET_TEXT_F(MSG_INIT_EEPROM); + char msg[utf8_strlen(restore_msg) + 1]; + strcpy_P(msg, FTOP(restore_msg)); MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_RESET), GET_TEXT(MSG_BUTTON_IGNORE), + GET_TEXT_F(MSG_BUTTON_RESET), GET_TEXT_F(MSG_BUTTON_IGNORE), init_eeprom, return_to_status, - eeprom_err(editable.uint8), msg, PSTR("?") + eeprom_err(editable.uint8), msg, F("?") ); }); #else - set_status(FPSTR(eeprom_err(msgid))); + set_status(eeprom_err(msgid)); #endif } diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index c27ced6fdd16..66e5e0c26181 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -520,7 +520,7 @@ class MarlinUI { #if HAS_PREHEAT enum PreheatTarget : uint8_t { PT_HOTEND, PT_BED, PT_FAN, PT_CHAMBER, PT_ALL = 0xFF }; static preheat_t material_preset[PREHEAT_COUNT]; - static PGM_P get_preheat_label(const uint8_t m); + static FSTR_P get_preheat_label(const uint8_t m); static void apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e=active_extruder); static void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, _BV(PT_FAN))); } static void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, _BV(PT_HOTEND))); } @@ -559,7 +559,7 @@ class MarlinUI { static void set_selection(const bool sel) { selection = sel; } static bool update_selection(); - static void synchronize(PGM_P const msg=nullptr); + static void synchronize(FSTR_P const msg=nullptr); static screenFunc_t currentScreen; static bool screen_changed; @@ -605,7 +605,7 @@ class MarlinUI { static float ubl_mesh_value(); #endif - static void draw_select_screen_prompt(PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr); + static void draw_select_screen_prompt(FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr); #else diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 2f075238e4a5..92be24aa0642 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -69,11 +69,11 @@ menuPosition screen_history[6]; uint8_t screen_history_depth = 0; int8_t MenuItemBase::itemIndex; // Index number for draw and action -PGM_P MenuItemBase::itemString; // A PSTR for substitution +FSTR_P MenuItemBase::itemString; // A string for substitution chimera_t editable; // Value Editing // Menu Edit Items -PGM_P MenuEditItemBase::editLabel; +FSTR_P MenuEditItemBase::editLabel; void* MenuEditItemBase::editValue; int32_t MenuEditItemBase::minEditValue, MenuEditItemBase::maxEditValue; @@ -134,7 +134,7 @@ void MenuEditItemBase::edit_screen(strfunc_t strfunc, loadfunc_t loadfunc) { // Going to an edit screen sets up some persistent values first void MenuEditItemBase::goto_edit_screen( - PGM_P const el, // Edit label + FSTR_P const el, // Edit label void * const ev, // Edit value pointer const int32_t minv, // Encoder minimum const int32_t maxv, // Encoder maximum @@ -232,8 +232,8 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co // Display a "synchronize" screen with a custom message until // all moves are finished. Go back to calling screen when done. // -void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) { - static PGM_P sync_message = msg ?: GET_TEXT(MSG_MOVING); +void MarlinUI::synchronize(FSTR_P const fmsg/*=nullptr*/) { + static FSTR_P sync_message = fmsg ?: GET_TEXT_F(MSG_MOVING); push_current_screen(); goto_screen([]{ if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message); @@ -319,12 +319,12 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { } if (ui.should_draw()) { if (do_probe) { - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z)); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z)); TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, ui.zoffset_overlay(probe.offset.z)); } else { #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_HOTEND_OFFSET_Z), ftostr54sign(hotend_offset[active_extruder].z)); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_HOTEND_OFFSET_Z), ftostr54sign(hotend_offset[active_extruder].z)); #endif } } @@ -335,7 +335,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { void _lcd_draw_homing() { if (ui.should_draw()) { constexpr uint8_t line = (LCD_HEIGHT - 1) / 2; - MenuItem_static::draw(line, GET_TEXT(MSG_LEVEL_BED_HOMING)); + MenuItem_static::draw(line, GET_TEXT_F(MSG_LEVEL_BED_HOMING)); } } @@ -357,9 +357,9 @@ bool MarlinUI::update_selection() { } void MenuItem_confirm::select_screen( - PGM_P const yes, PGM_P const no, + FSTR_P const yes, FSTR_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, - PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/ + FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/ ) { ui.defer_status_screen(); const bool ui_selection = !yes ? false : !no || ui.update_selection(), diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 288dd5be2fed..fbee2c8501f4 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -54,72 +54,72 @@ class MenuItemBase { static int8_t itemIndex; // An optional pointer for use in display or by the action - static PGM_P itemString; + static FSTR_P itemString; // Store the index of the item ahead of use by indexed items - FORCE_INLINE static void init(const int8_t ind=0, PGM_P const pstr=nullptr) { itemIndex = ind; itemString = pstr; } + FORCE_INLINE static void init(const int8_t ind=0, FSTR_P const fstr=nullptr) { itemIndex = ind; itemString = fstr; } // Implementation-specific: // Draw an item either selected (pre_char) or not (space) with post_char // Menus may set up itemIndex, itemString and pass them to string-building or string-emitting functions - static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char); + static void _draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char); // Draw an item either selected ('>') or not (space) with post_char - FORCE_INLINE static void _draw(const bool sel, const uint8_t row, PGM_P const pstr, const char post_char) { - _draw(sel, row, pstr, '>', post_char); + FORCE_INLINE static void _draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char post_char) { + _draw(sel, row, fstr, '>', post_char); } }; // STATIC_ITEM(LABEL,...) class MenuItem_static : public MenuItemBase { public: - static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr); + static void draw(const uint8_t row, FSTR_P const fstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr); }; // BACK_ITEM(LABEL) class MenuItem_back : public MenuItemBase { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr) { - _draw(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr) { + _draw(sel, row, fstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); } // Back Item action goes back one step in history - FORCE_INLINE static void action(PGM_P const=nullptr) { ui.go_back(); } + FORCE_INLINE static void action(FSTR_P const=nullptr) { ui.go_back(); } }; // CONFIRM_ITEM(LABEL,Y,N,FY,FN,...), // YESNO_ITEM(LABEL,FY,FN,...) class MenuItem_confirm : public MenuItemBase { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) { + _draw(sel, row, fstr, '>', LCD_STR_ARROW_RIGHT[0]); } // Implemented for HD44780 and DOGM // Draw the prompt, buttons, and state static void draw_select_screen( - PGM_P const yes, // Right option label - PGM_P const no, // Left option label + FSTR_P const yes, // Right option label + FSTR_P const no, // Left option label const bool yesno, // Is "yes" selected? - PGM_P const pref, // Prompt prefix + FSTR_P const pref, // Prompt prefix const char * const string, // Prompt runtime string - PGM_P const suff // Prompt suffix + FSTR_P const suff // Prompt suffix ); static void select_screen( - PGM_P const yes, PGM_P const no, + FSTR_P const yes, FSTR_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, - PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr + FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr ); static void select_screen( - PGM_P const yes, PGM_P const no, + FSTR_P const yes, FSTR_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, - PGM_P const pref, FSTR_P const string, PGM_P const suff=nullptr + FSTR_P const pref, FSTR_P const string, FSTR_P const suff=nullptr ) { char str[strlen_P(FTOP(string)) + 1]; strcpy_P(str, FTOP(string)); select_screen(yes, no, yesFunc, noFunc, pref, str, suff); } // Shortcut for prompt with "NO"/ "YES" labels - FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr) { - select_screen(GET_TEXT(MSG_YES), GET_TEXT(MSG_NO), yesFunc, noFunc, pref, string, suff); + FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr) { + select_screen(GET_TEXT_F(MSG_YES), GET_TEXT_F(MSG_NO), yesFunc, noFunc, pref, string, suff); } }; @@ -148,7 +148,7 @@ class MenuEditItemBase : public MenuItemBase { // The action() method acts like the instantiator. The entire lifespan // of a menu item is within its declaration, so all these values decompose // into behavior and unused items get optimized out. - static PGM_P editLabel; + static FSTR_P editLabel; static void *editValue; static int32_t minEditValue, maxEditValue; // Encoder value range static screenFunc_t callbackFunc; @@ -157,7 +157,7 @@ class MenuEditItemBase : public MenuItemBase { typedef const char* (*strfunc_t)(const int32_t); typedef void (*loadfunc_t)(void *, const int32_t); static void goto_edit_screen( - PGM_P const el, // Edit label + FSTR_P const el, // Edit label void * const ev, // Edit value pointer const int32_t minv, // Encoder minimum const int32_t maxv, // Encoder maximum @@ -170,11 +170,15 @@ class MenuEditItemBase : public MenuItemBase { public: // Implementation-specific: // Draw the current item at specified row with edit data - static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const inStr, const bool pgm=false); + static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm=false); + + static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, FSTR_P const inStr) { + draw(sel, row, fstr, FTOP(inStr), true); + } // Implementation-specific: // This low-level method is good to draw from anywhere - static void draw_edit_screen(PGM_P const pstr, const char * const value); + static void draw_edit_screen(FSTR_P const fstr, const char * const value); // This method is for the current menu item static void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); } @@ -185,7 +189,7 @@ class MenuEditItemBase : public MenuItemBase { class MenuItem_sdbase { public: // Implemented for HD44780 and DOGM - static void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir); + static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard, const bool isDir); }; #endif diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 504097252561..a4677952d620 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -83,7 +83,7 @@ void menu_backlash(); void menu_pwm() { START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_P(long5, PSTR(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power) + #define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_F(long5, F(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power) #if ANY_PIN(MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y) EDIT_CURRENT_PWM(STR_A STR_B, 0); #endif @@ -705,7 +705,7 @@ void menu_advanced_settings() { CONFIRM_ITEM(MSG_INIT_EEPROM, MSG_BUTTON_INIT, MSG_BUTTON_CANCEL, ui.init_eeprom, nullptr, - GET_TEXT(MSG_INIT_EEPROM), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_INIT_EEPROM), (const char *)nullptr, F("?") ); #endif diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 163a2a751a34..b37e05f3a4b3 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -168,7 +168,7 @@ static void _lcd_level_bed_corners_get_next_position() { TERN_(HAS_MARLINUI_U8GLIB, ui.set_font(FONT_MENU)); // Set up the font for extra info - MenuItem_static::draw(0, GET_TEXT(MSG_PROBING_POINT), SS_INVERT); // "Probing Mesh" heading + MenuItem_static::draw(0, GET_TEXT_F(MSG_PROBING_POINT), SS_INVERT); // "Probing Mesh" heading uint8_t cy = TERN(TFT_COLOR_UI, 3, LCD_HEIGHT - 1), y = LCD_ROW_Y(cy); @@ -197,10 +197,10 @@ static void _lcd_level_bed_corners_get_next_position() { void _lcd_draw_raise() { if (!ui.should_draw()) return; MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_DONE), GET_TEXT(MSG_BUTTON_SKIP) + GET_TEXT_F(MSG_BUTTON_DONE), GET_TEXT_F(MSG_BUTTON_SKIP) , []{ corner_probing_done = true; wait_for_probe = false; } , []{ wait_for_probe = false; } - , GET_TEXT(MSG_BED_TRAMMING_RAISE) + , GET_TEXT_F(MSG_BED_TRAMMING_RAISE) , (const char*)nullptr, NUL_STR ); } @@ -208,11 +208,11 @@ static void _lcd_level_bed_corners_get_next_position() { void _lcd_draw_level_prompt() { if (!ui.should_draw()) return; MenuItem_confirm::select_screen( - GET_TEXT(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE)), - TERN(HAS_LEVELING, GET_TEXT(MSG_BUTTON_BACK), nullptr) + GET_TEXT_F(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE)), + TERN(HAS_LEVELING, GET_TEXT_F(MSG_BUTTON_BACK), nullptr) , []{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); } , TERN(HAS_LEVELING, ui.goto_previous_screen_no_defer, []{}) - , GET_TEXT(MSG_BED_TRAMMING_IN_RANGE) + , GET_TEXT_F(MSG_BED_TRAMMING_IN_RANGE) , (const char*)nullptr, NUL_STR ); } @@ -332,15 +332,15 @@ static void _lcd_level_bed_corners_homing() { bed_corner = 0; ui.goto_screen([]{ MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_NEXT), GET_TEXT(MSG_BUTTON_DONE) + GET_TEXT_F(MSG_BUTTON_NEXT), GET_TEXT_F(MSG_BUTTON_DONE) , _lcd_goto_next_corner , []{ line_to_z(LEVEL_CORNERS_Z_HOP); // Raise Z off the bed when done TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); ui.goto_previous_screen_no_defer(); } - , GET_TEXT(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER)) - , (const char*)nullptr, PSTR("?") + , GET_TEXT_F(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER)) + , (const char*)nullptr, F("?") ); }); ui.set_selection(true); diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 866f709b8e33..142da1696af8 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -71,12 +71,12 @@ #if Z_AFTER_PROBING > 0 && DISABLED(MESH_BED_LEVELING) // Display "Done" screen and wait for moves to complete line_to_z(Z_AFTER_PROBING); - ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE)); + ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE)); #endif ui.goto_previous_screen_no_defer(); ui.completion_feedback(); } - if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_LEVEL_BED_DONE)); + if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT_F(MSG_LEVEL_BED_DONE)); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); } @@ -127,7 +127,7 @@ // if (ui.should_draw()) { const float v = current_position.z; - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); } } @@ -138,7 +138,7 @@ if (ui.should_draw()) { char msg[10]; sprintf_P(msg, PSTR("%i / %u"), int(manual_probe_index + 1), total_probe_points); - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), msg); } ui.refresh(LCDVIEW_CALL_NO_REDRAW); if (!ui.wait_for_move) ui.goto_screen(_lcd_level_bed_get_z); @@ -165,7 +165,7 @@ // void _lcd_level_bed_homing_done() { if (ui.should_draw()) { - MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING)); + MenuItem_static::draw(1, GET_TEXT_F(MSG_LEVEL_BED_WAITING)); // Color UI needs a control to detect a touch #if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT) touch.add_control(CLICK, 0, 0, TFT_WIDTH, TFT_HEIGHT); @@ -243,7 +243,7 @@ void menu_bed_leveling() { // Auto Home if not using manual probing #if NONE(PROBE_MANUALLY, MESH_BED_LEVELING) - if (!is_homed) GCODES_ITEM(MSG_AUTO_HOME, G28_STR); + if (!is_homed) GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR)); #endif // Level Bed @@ -252,7 +252,7 @@ void menu_bed_leveling() { SUBMENU(MSG_LEVEL_BED, _lcd_level_bed_continue); #else // Automatic leveling can just run the G-code - GCODES_ITEM(MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G29N")); + GCODES_ITEM(MSG_LEVEL_BED, is_homed ? F("G29") : F("G29N")); #endif #if ENABLED(MESH_EDIT_MENU) diff --git a/Marlin/src/lcd/menu/menu_cancelobject.cpp b/Marlin/src/lcd/menu/menu_cancelobject.cpp index 8db698d300f2..b2d36bf8c30d 100644 --- a/Marlin/src/lcd/menu/menu_cancelobject.cpp +++ b/Marlin/src/lcd/menu/menu_cancelobject.cpp @@ -48,7 +48,7 @@ static void lcd_cancel_object_confirm() { ui.goto_previous_screen(); }, nullptr, - GET_TEXT(MSG_CANCEL_OBJECT), item_num, PSTR("?") + GET_TEXT_F(MSG_CANCEL_OBJECT), item_num, F("?") ); } diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index d755706b1612..cb36f4bc98a2 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -78,7 +78,7 @@ void menu_advanced_settings(); bar_percent += (int8_t)ui.encoderPosition; LIMIT(bar_percent, 0, 100); ui.encoderPosition = 0; - MenuItem_static::draw(0, GET_TEXT(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT); + MenuItem_static::draw(0, GET_TEXT_F(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT); lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_wchar('%'); lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent); } @@ -137,7 +137,7 @@ void menu_advanced_settings(); #include "../../gcode/queue.h" void menu_toolchange_migration() { - PGM_P const msg_migrate = GET_TEXT(MSG_TOOL_MIGRATION_SWAP); + FSTR_P const msg_migrate = GET_TEXT_F(MSG_TOOL_MIGRATION_SWAP); START_MENU(); BACK_ITEM(MSG_CONFIGURATION); @@ -149,7 +149,7 @@ void menu_advanced_settings(); // Migrate to a chosen extruder EXTRUDER_LOOP() { if (e != active_extruder) { - ACTION_ITEM_N_P(e, msg_migrate, []{ + ACTION_ITEM_N_F(e, msg_migrate, []{ char cmd[12]; sprintf_P(cmd, PSTR("M217 T%i"), int(MenuItemBase::itemIndex)); queue.inject(cmd); @@ -199,16 +199,16 @@ void menu_advanced_settings(); START_MENU(); BACK_ITEM(MSG_CONFIGURATION); - GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, PSTR("M605S1\nG28X\nG1X0")); + GCODES_ITEM(MSG_IDEX_MODE_AUTOPARK, F("M605S1\nG28X\nG1X0")); GCODES_ITEM(MSG_IDEX_MODE_DUPLICATE, need_g28 - ? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0") // If Y or Z is not homed, do a full G28 first - : PSTR("M605S1\nT0\nM605S2\nG28X\nG1X0") + ? F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0") // If Y or Z is not homed, do a full G28 first + : F("M605S1\nT0\nM605S2\nG28X\nG1X0") ); GCODES_ITEM(MSG_IDEX_MODE_MIRRORED_COPY, need_g28 - ? PSTR("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3") // If Y or Z is not homed, do a full G28 first - : PSTR("M605S1\nT0\nM605S2\nG28 X\nG1X0\nM605S3") + ? F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3") // If Y or Z is not homed, do a full G28 first + : F("M605S1\nT0\nM605S2\nG28 X\nG1X0\nM605S3") ); - GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, PSTR("M605S0\nG28X")); + GCODES_ITEM(MSG_IDEX_MODE_FULL_CTRL, F("M605S0\nG28X")); EDIT_ITEM(float42_52, MSG_IDEX_DUPE_GAP, &duplicate_extruder_x_offset, (X2_MIN_POS) - (X1_MIN_POS), (X_BED_SIZE) - 20); @@ -246,11 +246,11 @@ void menu_advanced_settings(); EDIT_ITEM(bool, MSG_BLTOUCH_SPEED_MODE, &bltouch.high_speed_mode); #endif #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU) - CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); - CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); + CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE)); + CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE)); ACTION_ITEM(MSG_BLTOUCH_MODE_STORE, bltouch._mode_store); - CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); - CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); + CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE)); + CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, nullptr, GET_TEXT_F(MSG_BLTOUCH_MODE_CHANGE)); ACTION_ITEM(MSG_BLTOUCH_MODE_ECHO, bltouch_report); #endif END_MENU(); @@ -264,10 +264,10 @@ void menu_advanced_settings(); ui.defer_status_screen(); START_MENU(); BACK_ITEM(MSG_CONFIGURATION); - GCODES_ITEM(MSG_TOUCHMI_INIT, PSTR("M851 Z0\nG28\nG1 F200 Z0")); + GCODES_ITEM(MSG_TOUCHMI_INIT, F("M851 Z0\nG28\nG1 F200 Z0")); SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - GCODES_ITEM(MSG_TOUCHMI_SAVE, PSTR("M500\nG1 F200 Z10")); - GCODES_ITEM(MSG_TOUCHMI_ZTEST, PSTR("G28\nG1 F200 Z0")); + GCODES_ITEM(MSG_TOUCHMI_SAVE, F("M500\nG1 F200 Z10")); + GCODES_ITEM(MSG_TOUCHMI_ZTEST, F("G28\nG1 F200 Z0")); END_MENU(); } @@ -329,7 +329,7 @@ void menu_advanced_settings(); #define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0) const uint8_t m = MenuItemBase::itemIndex; START_MENU(); - STATIC_ITEM_P(ui.get_preheat_label(m), SS_DEFAULT|SS_INVERT); + STATIC_ITEM_F(ui.get_preheat_label(m), SS_DEFAULT|SS_INVERT); BACK_ITEM(MSG_CONFIGURATION); #if HAS_FAN editable.uint8 = uint8_t(ui.material_preset[m].fan_speed); @@ -369,13 +369,13 @@ void menu_advanced_settings(); #define _DONE_SCRIPT "" #endif #define GCODE_LAMBDA_CONF(N) []{ _lcd_custom_menus_configuration_gcode(F(CONFIG_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); } - #define _CUSTOM_ITEM_CONF(N) ACTION_ITEM_P(PSTR(CONFIG_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_CONF(N)); - #define _CUSTOM_ITEM_CONF_CONFIRM(N) \ - SUBMENU_P(PSTR(CONFIG_MENU_ITEM_##N##_DESC), []{ \ - MenuItem_confirm::confirm_screen( \ - GCODE_LAMBDA_CONF(N), nullptr, \ - PSTR(CONFIG_MENU_ITEM_##N##_DESC "?") \ - ); \ + #define _CUSTOM_ITEM_CONF(N) ACTION_ITEM_F(F(CONFIG_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_CONF(N)); + #define _CUSTOM_ITEM_CONF_CONFIRM(N) \ + SUBMENU_F(F(CONFIG_MENU_ITEM_##N##_DESC), []{ \ + MenuItem_confirm::confirm_screen( \ + GCODE_LAMBDA_CONF(N), nullptr, \ + F(CONFIG_MENU_ITEM_##N##_DESC "?") \ + ); \ }) #define CUSTOM_ITEM_CONF(N) do{ \ @@ -483,7 +483,7 @@ void menu_configuration() { #if ENABLED(CUSTOM_MENU_CONFIG) if (TERN1(CUSTOM_MENU_CONFIG_ONLY_IDLE, !busy)) { #ifdef CUSTOM_MENU_CONFIG_TITLE - SUBMENU_P(PSTR(CUSTOM_MENU_CONFIG_TITLE), custom_menus_configuration); + SUBMENU_F(F(CUSTOM_MENU_CONFIG_TITLE), custom_menus_configuration); #else SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_configuration); #endif diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index f491c5b576ee..76d5677a806f 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -107,12 +107,12 @@ void lcd_delta_settings() { START_MENU(); BACK_ITEM(MSG_DELTA_CALIBRATE); EDIT_ITEM(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings); - #define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_endstop_adj.N, -5, 0, _recalc_delta_settings) + #define EDIT_ENDSTOP_ADJ(LABEL,N) EDIT_ITEM_F(float43, F(LABEL), &delta_endstop_adj.N, -5, 0, _recalc_delta_settings) EDIT_ENDSTOP_ADJ("Ex", a); EDIT_ENDSTOP_ADJ("Ey", b); EDIT_ENDSTOP_ADJ("Ez", c); EDIT_ITEM(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); - #define EDIT_ANGLE_TRIM(LABEL,N) EDIT_ITEM_P(float43, PSTR(LABEL), &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings) + #define EDIT_ANGLE_TRIM(LABEL,N) EDIT_ITEM_F(float43, F(LABEL), &delta_tower_angle_trim.N, -5, 5, _recalc_delta_settings) EDIT_ANGLE_TRIM("Tx", a); EDIT_ANGLE_TRIM("Ty", b); EDIT_ANGLE_TRIM("Tz", c); @@ -129,7 +129,7 @@ void menu_delta_calibrate() { BACK_ITEM(MSG_MAIN); #if ENABLED(DELTA_AUTO_CALIBRATION) - GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, PSTR("G33")); + GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, F("G33")); #if ENABLED(EEPROM_SETTINGS) ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings); diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 03ac6e512cf8..5e4e11669695 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -45,22 +45,22 @@ static PauseMode _change_filament_mode; // = PAUSE_MODE_PAUSE_PRINT static int8_t _change_filament_extruder; // = 0 -inline PGM_P _change_filament_command() { +inline FSTR_P _change_filament_command() { switch (_change_filament_mode) { - case PAUSE_MODE_LOAD_FILAMENT: return PSTR("M701 T%d"); + case PAUSE_MODE_LOAD_FILAMENT: return F("M701 T%d"); case PAUSE_MODE_UNLOAD_FILAMENT: return _change_filament_extruder >= 0 - ? PSTR("M702 T%d") : PSTR("M702 ;%d"); + ? F("M702 T%d") : F("M702 ;%d"); case PAUSE_MODE_CHANGE_FILAMENT: case PAUSE_MODE_PAUSE_PRINT: default: break; } - return PSTR("M600 B0 T%d"); + return F("M600 B0 T%d"); } // Initiate Filament Load/Unload/Change at the specified temperature static void _change_filament_with_temp(const uint16_t celsius) { char cmd[11]; - sprintf_P(cmd, _change_filament_command(), _change_filament_extruder); + sprintf_P(cmd, FTOP(_change_filament_command()), _change_filament_extruder); thermalManager.setTargetHotend(celsius, _change_filament_extruder); queue.inject(cmd); } @@ -77,13 +77,13 @@ static void _change_filament_with_custom() { // Menu to choose the temperature and start Filament Change // -inline PGM_P change_filament_header(const PauseMode mode) { +inline FSTR_P change_filament_header(const PauseMode mode) { switch (mode) { - case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT(MSG_FILAMENTLOAD); - case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT(MSG_FILAMENTUNLOAD); + case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENTLOAD); + case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENTUNLOAD); default: break; } - return GET_TEXT(MSG_FILAMENTCHANGE); + return GET_TEXT_F(MSG_FILAMENTCHANGE); } void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { @@ -91,7 +91,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { _change_filament_extruder = extruder; const int8_t old_index = MenuItemBase::itemIndex; START_MENU(); - if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_DEFAULT|SS_INVERT); + if (LCD_HEIGHT >= 4) STATIC_ITEM_F(change_filament_header(mode), SS_DEFAULT|SS_INVERT); BACK_ITEM(MSG_BACK); #if HAS_PREHEAT LOOP_L_N(m, PREHEAT_COUNT) @@ -132,18 +132,18 @@ void menu_change_filament() { // Change filament #if E_STEPPERS == 1 - PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE); + FSTR_P const msg = GET_TEXT_F(MSG_FILAMENTCHANGE); if (thermalManager.targetTooColdToExtrude(active_extruder)) - SUBMENU_P(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); }); + SUBMENU_F(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); }); else - GCODES_ITEM_P(msg, PSTR("M600 B0")); + GCODES_ITEM_F(msg, F("M600 B0")); #else - PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE_E); + FSTR_P const msg = GET_TEXT_F(MSG_FILAMENTCHANGE_E); LOOP_L_N(s, E_STEPPERS) { if (thermalManager.targetTooColdToExtrude(s)) - SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); }); + SUBMENU_N_F(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); }); else { - ACTION_ITEM_N_P(s, msg, []{ + ACTION_ITEM_N_F(s, msg, []{ PGM_P const cmdpstr = PSTR("M600 B0 T%i"); char cmd[strlen_P(cmdpstr) + 3 + 1]; sprintf_P(cmd, cmdpstr, int(MenuItemBase::itemIndex)); @@ -157,18 +157,18 @@ void menu_change_filament() { if (!is_busy) { // Load filament #if E_STEPPERS == 1 - PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD); + FSTR_P const msg_load = GET_TEXT_F(MSG_FILAMENTLOAD); if (thermalManager.targetTooColdToExtrude(active_extruder)) - SUBMENU_P(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); }); + SUBMENU_F(msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, 0); }); else - GCODES_ITEM_P(msg_load, PSTR("M701")); + GCODES_ITEM_F(msg_load, F("M701")); #else - PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD_E); + FSTR_P const msg_load = GET_TEXT_F(MSG_FILAMENTLOAD_E); LOOP_L_N(s, E_STEPPERS) { if (thermalManager.targetTooColdToExtrude(s)) - SUBMENU_N_P(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); }); + SUBMENU_N_F(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); }); else { - ACTION_ITEM_N_P(s, msg_load, []{ + ACTION_ITEM_N_F(s, msg_load, []{ char cmd[12]; sprintf_P(cmd, PSTR("M701 T%i"), int(MenuItemBase::itemIndex)); queue.inject(cmd); @@ -179,24 +179,24 @@ void menu_change_filament() { // Unload filament #if E_STEPPERS == 1 - PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD); + FSTR_P const msg_unload = GET_TEXT_F(MSG_FILAMENTUNLOAD); if (thermalManager.targetTooColdToExtrude(active_extruder)) - SUBMENU_P(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); }); + SUBMENU_F(msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, 0); }); else - GCODES_ITEM_P(msg_unload, PSTR("M702")); + GCODES_ITEM_F(msg_unload, F("M702")); #else #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) if (too_cold) SUBMENU(MSG_FILAMENTUNLOAD_ALL, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, -1); }); else - GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); + GCODES_ITEM(MSG_FILAMENTUNLOAD_ALL, F("M702")); #endif - PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD_E); + FSTR_P const msg_unload = GET_TEXT_F(MSG_FILAMENTUNLOAD_E); LOOP_L_N(s, E_STEPPERS) { if (thermalManager.targetTooColdToExtrude(s)) - SUBMENU_N_P(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); }); + SUBMENU_N_F(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); }); else { - ACTION_ITEM_N_P(s, msg_unload, []{ + ACTION_ITEM_N_F(s, msg_unload, []{ char cmd[12]; sprintf_P(cmd, PSTR("M702 T%i"), int(MenuItemBase::itemIndex)); queue.inject(cmd); @@ -221,21 +221,21 @@ void menu_change_filament() { static uint8_t hotend_status_extruder = 0; -static PGM_P pause_header() { +static FSTR_P pause_header() { switch (pause_mode) { - case PAUSE_MODE_CHANGE_FILAMENT: return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER); - case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_LOAD); - case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); + case PAUSE_MODE_CHANGE_FILAMENT: return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER); + case PAUSE_MODE_LOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_LOAD); + case PAUSE_MODE_UNLOAD_FILAMENT: return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); default: break; } - return GET_TEXT(MSG_FILAMENT_CHANGE_HEADER_PAUSE); + return GET_TEXT_F(MSG_FILAMENT_CHANGE_HEADER_PAUSE); } // Portions from STATIC_ITEM... #define HOTEND_STATUS_ITEM() do { \ if (_menuLineNr == _thisItemNr) { \ if (ui.should_draw()) { \ - IF_DISABLED(HAS_GRAPHICAL_TFT, MenuItem_static::draw(_lcdLineNr, GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT)); \ + IF_DISABLED(HAS_GRAPHICAL_TFT, MenuItem_static::draw(_lcdLineNr, GET_TEXT_F(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT)); \ ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \ } \ if (_skipStatic && encoderLine <= _thisItemNr) { \ @@ -273,39 +273,39 @@ void menu_pause_option() { // // Warning: msg must have three null bytes to delimit lines! // -void _lcd_pause_message(PGM_P const msg) { - PGM_P const msg1 = msg; +void _lcd_pause_message(FSTR_P const msg) { + PGM_P const msg1 = FTOP(msg); PGM_P const msg2 = msg1 + strlen_P(msg1) + 1; PGM_P const msg3 = msg2 + strlen_P(msg2) + 1; const bool has2 = msg2[0], has3 = msg3[0], skip1 = !has2 && (LCD_HEIGHT) >= 5; START_SCREEN(); - STATIC_ITEM_P(pause_header(), SS_DEFAULT|SS_INVERT); // 1: Header + STATIC_ITEM_F(pause_header(), SS_DEFAULT|SS_INVERT); // 1: Header if (skip1) SKIP_ITEM(); // Move a single-line message down - STATIC_ITEM_P(msg1); // 2: Message Line 1 - if (has2) STATIC_ITEM_P(msg2); // 3: Message Line 2 - if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_P(msg3); // 4: Message Line 3 (if LCD has 5 lines) + STATIC_ITEM_F(FPSTR(msg1)); // 2: Message Line 1 + if (has2) STATIC_ITEM_F(FPSTR(msg2)); // 3: Message Line 2 + if (has3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_F(FPSTR(msg3)); // 4: Message Line 3 (if LCD has 5 lines) if (skip1 + 1 + has2 + has3 < (LCD_HEIGHT) - 2) SKIP_ITEM(); // Push Hotend Status down, if needed HOTEND_STATUS_ITEM(); // 5: Hotend Status END_SCREEN(); } -void lcd_pause_parking_message() { _lcd_pause_message(GET_TEXT(MSG_PAUSE_PRINT_PARKING)); } -void lcd_pause_changing_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INIT)); } -void lcd_pause_unload_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_UNLOAD)); } -void lcd_pause_heating_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING)); } -void lcd_pause_heat_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT)); } -void lcd_pause_insert_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_INSERT)); } -void lcd_pause_load_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD)); } -void lcd_pause_waiting_message() { _lcd_pause_message(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING)); } -void lcd_pause_resume_message() { _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME)); } +void lcd_pause_parking_message() { _lcd_pause_message(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); } +void lcd_pause_changing_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); } +void lcd_pause_unload_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); } +void lcd_pause_heating_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); } +void lcd_pause_heat_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); } +void lcd_pause_insert_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); } +void lcd_pause_load_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); } +void lcd_pause_waiting_message() { _lcd_pause_message(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); } +void lcd_pause_resume_message() { _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); } void lcd_pause_purge_message() { #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_CONT_PURGE)); + _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_CONT_PURGE)); #else - _lcd_pause_message(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE)); + _lcd_pause_message(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)); #endif } diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index 3a23cf004884..101861074d95 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -35,7 +35,7 @@ #endif #define VALUE_ITEM(MSG, VALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy(msg + 2, VALUE); STATIC_ITEM(MSG, STYL, msg); }while(0) -#define VALUE_ITEM_P(MSG, PVALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy_P(msg + 2, PSTR(PVALUE)); STATIC_ITEM(MSG, STYL, msg); }while(0) +#define VALUE_ITEM_F(MSG, PVALUE, STYL) do{ char msg[21]; strcpy_P(msg, PSTR(": ")); strcpy_P(msg + 2, PSTR(PVALUE)); STATIC_ITEM(MSG, STYL, msg); }while(0) #if ENABLED(PRINTCOUNTER) @@ -56,35 +56,35 @@ VALUE_ITEM(MSG_INFO_COMPLETED_PRINTS, i16tostr3left(stats.finishedPrints), SS_LEFT); // Completed : 666 STATIC_ITEM(MSG_INFO_PRINT_TIME, SS_LEFT); // Total print Time: - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.printTime).toString(buffer)); // > 99y 364d 23h 59m 59s + STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.printTime).toString(buffer)); // > 99y 364d 23h 59m 59s STATIC_ITEM(MSG_INFO_PRINT_LONGEST, SS_LEFT); // Longest job time: - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.longestPrint).toString(buffer)); // > 99y 364d 23h 59m 59s + STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.longestPrint).toString(buffer)); // > 99y 364d 23h 59m 59s STATIC_ITEM(MSG_INFO_PRINT_FILAMENT, SS_LEFT); // Extruded total: sprintf_P(buffer, PSTR("%ld.%im") , long(stats.filamentUsed / 1000) , int16_t(stats.filamentUsed / 100) % 10 ); - STATIC_ITEM_P(PSTR("> "), SS_LEFT, buffer); // > 125m + STATIC_ITEM_F(F("> "), SS_LEFT, buffer); // > 125m #if SERVICE_INTERVAL_1 > 0 || SERVICE_INTERVAL_2 > 0 || SERVICE_INTERVAL_3 > 0 strcpy_P(buffer, GET_TEXT(MSG_SERVICE_IN)); #endif #if SERVICE_INTERVAL_1 > 0 - STATIC_ITEM_P(PSTR(SERVICE_NAME_1 " "), SS_LEFT, buffer); // Service X in: - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService1).toString(buffer)); // > 7d 12h 11m 10s + STATIC_ITEM_F(F(SERVICE_NAME_1 " "), SS_LEFT, buffer); // Service X in: + STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService1).toString(buffer)); // > 7d 12h 11m 10s #endif #if SERVICE_INTERVAL_2 > 0 - STATIC_ITEM_P(PSTR(SERVICE_NAME_2 " "), SS_LEFT, buffer); - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService2).toString(buffer)); + STATIC_ITEM_F(F(SERVICE_NAME_2 " "), SS_LEFT, buffer); + STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService2).toString(buffer)); #endif #if SERVICE_INTERVAL_3 > 0 - STATIC_ITEM_P(PSTR(SERVICE_NAME_3 " "), SS_LEFT, buffer); - STATIC_ITEM_P(PSTR("> "), SS_LEFT, duration_t(stats.nextService3).toString(buffer)); + STATIC_ITEM_F(F(SERVICE_NAME_3 " "), SS_LEFT, buffer); + STATIC_ITEM_F(F("> "), SS_LEFT, duration_t(stats.nextService3).toString(buffer)); #endif END_SCREEN(); @@ -103,7 +103,7 @@ void menu_info_thermistors() { #if HAS_EXTRUDERS #define THERMISTOR_ID TEMP_SENSOR_0 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E0 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E0 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_0_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_0_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -113,7 +113,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_1 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E1 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E1 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_1_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_1_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -123,7 +123,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_2 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E2 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E2 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_2_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_2_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -133,7 +133,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_3 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E3 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E3 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_3_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_3_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -143,7 +143,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_4 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E4 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E4 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_4_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_4_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -153,7 +153,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_5 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E5 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E5 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_5_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -163,7 +163,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_6 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E6 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E6 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_6_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_6_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -173,7 +173,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_7 #include "../thermistornames.h" - STATIC_ITEM_P(PSTR(STR_E7 ": " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F(STR_E7 ": " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_7_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_7_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -183,7 +183,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_BED #include "../thermistornames.h" - STATIC_ITEM_P(PSTR("BED: " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F("BED: " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_BED, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -193,7 +193,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_CHAMBER #include "../thermistornames.h" - STATIC_ITEM_P(PSTR("CHAM: " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F("CHAM: " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(CHAMBER_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(CHAMBER_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_CHAMBER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -203,7 +203,7 @@ void menu_info_thermistors() { #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_COOLER #include "../thermistornames.h" - STATIC_ITEM_P(PSTR("COOL: " THERMISTOR_NAME), SS_INVERT); + STATIC_ITEM_F(F("COOL: " THERMISTOR_NAME), SS_INVERT); PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(COOLER_MINTEMP), SS_LEFT); PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(COOLER_MAXTEMP), SS_LEFT); STATIC_ITEM(TERN(WATCH_COOLER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_LEFT); @@ -219,9 +219,9 @@ void menu_info_board() { if (ui.use_click()) return ui.go_back(); START_SCREEN(); - STATIC_ITEM_P(PSTR(BOARD_INFO_NAME), SS_DEFAULT|SS_INVERT); // MyPrinterController + STATIC_ITEM_F(F(BOARD_INFO_NAME), SS_DEFAULT|SS_INVERT); // MyPrinterController #ifdef BOARD_WEBSITE_URL - STATIC_ITEM_P(PSTR(BOARD_WEBSITE_URL), SS_LEFT); // www.my3dprinter.com + STATIC_ITEM_F(F(BOARD_WEBSITE_URL), SS_LEFT); // www.my3dprinter.com #endif PSTRING_ITEM(MSG_INFO_BAUDRATE, STRINGIFY(BAUDRATE), SS_CENTER); // Baud: 250000 PSTRING_ITEM(MSG_INFO_PROTOCOL, PROTOCOL_VERSION, SS_CENTER); // Protocol: 1.0 @@ -251,11 +251,11 @@ void menu_info_board() { void menu_info_printer() { if (ui.use_click()) return ui.go_back(); START_SCREEN(); - STATIC_ITEM(MSG_MARLIN, SS_DEFAULT|SS_INVERT); // Marlin - STATIC_ITEM_P(PSTR(SHORT_BUILD_VERSION)); // x.x.x-Branch - STATIC_ITEM_P(PSTR(STRING_DISTRIBUTION_DATE)); // YYYY-MM-DD HH:MM - STATIC_ITEM_P(PSTR(MACHINE_NAME), SS_DEFAULT|SS_INVERT); // My3DPrinter - STATIC_ITEM_P(PSTR(WEBSITE_URL)); // www.my3dprinter.com + STATIC_ITEM(MSG_MARLIN, SS_DEFAULT|SS_INVERT); // Marlin + STATIC_ITEM_F(F(SHORT_BUILD_VERSION)); // x.x.x-Branch + STATIC_ITEM_F(F(STRING_DISTRIBUTION_DATE)); // YYYY-MM-DD HH:MM + STATIC_ITEM_F(F(MACHINE_NAME), SS_DEFAULT|SS_INVERT); // My3DPrinter + STATIC_ITEM_F(F(WEBSITE_URL)); // www.my3dprinter.com PSTRING_ITEM(MSG_INFO_EXTRUDERS, STRINGIFY(EXTRUDERS), SS_CENTER); // Extruders: 2 #if HAS_LEVELING STATIC_ITEM( diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index fcde9f580193..80a0872da652 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -36,36 +36,36 @@ void lcd_move_z(); // SUBMENU(LABEL, screen_handler) class MenuItem_submenu : public MenuItemBase { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) { + _draw(sel, row, fstr, '>', LCD_STR_ARROW_RIGHT[0]); } - static void action(PGM_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); } + static void action(FSTR_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); } }; // Any menu item that invokes an immediate action class MenuItem_button : public MenuItemBase { public: // Button-y Items are selectable lines with no other indicator - static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', ' '); + static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) { + _draw(sel, row, fstr, '>', ' '); } }; // ACTION_ITEM(LABEL, FUNC) class MenuItem_function : public MenuItem_button { public: - //static void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); }; - static void action(PGM_P const, const menuAction_t func) { if (func) (*func)(); }; + //static void action(FSTR_P const, const uint8_t, const menuAction_t func) { (*func)(); }; + static void action(FSTR_P const, const menuAction_t func) { if (func) (*func)(); }; }; // GCODES_ITEM(LABEL, GCODES) class MenuItem_gcode : public MenuItem_button { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { - _draw(sel, row, pstr, '>', ' '); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) { + _draw(sel, row, fstr, '>', ' '); } - static void action(PGM_P const, PGM_P const pgcode) { queue.inject(FPSTR(pgcode)); } - static void action(PGM_P const pstr, const uint8_t, PGM_P const pgcode) { action(pstr, pgcode); } + static void action(FSTR_P const, FSTR_P const fgcode) { queue.inject(fgcode); } + static void action(FSTR_P const fstr, const uint8_t, FSTR_P const fgcode) { action(fstr, fgcode); } }; //////////////////////////////////////////// @@ -82,16 +82,16 @@ class TMenuEditItem : MenuEditItemBase { static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); } static void load(void *ptr, const int32_t value) { *((type_t*)ptr) = unscale(value); } public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t * const data, ...) { - MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(*(data))); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, type_t * const data, ...) { + MenuEditItemBase::draw(sel, row, fstr, NAME::strfunc(*(data))); } - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, type_t (*pget)(), ...) { - MenuEditItemBase::draw(sel, row, pstr, NAME::strfunc(pget())); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, type_t (*pget)(), ...) { + MenuEditItemBase::draw(sel, row, fstr, NAME::strfunc(pget())); } // Edit screen for this type of item static void edit_screen() { MenuEditItemBase::edit_screen(to_string, load); } static void action( - PGM_P const pstr, // Edit label + FSTR_P const fstr, // Edit label type_t * const ptr, // Value pointer const type_t minValue, // Value range const type_t maxValue, @@ -101,7 +101,7 @@ class TMenuEditItem : MenuEditItemBase { // Make sure minv and maxv fit within int32_t const int32_t minv = _MAX(scale(minValue), INT32_MIN), maxv = _MIN(scale(maxValue), INT32_MAX); - goto_edit_screen(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv, + goto_edit_screen(fstr, ptr, minv, maxv - minv, scale(*ptr) - minv, edit_screen, callback, live); } }; @@ -168,16 +168,16 @@ DEFINE_MENU_EDIT_ITEM_TYPE(long5_25 ,uint32_t ,ftostr5rj , 0.04f ); class MenuItem_bool : public MenuEditItemBase { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, const bool onoff) { - MenuEditItemBase::draw(sel, row, pstr, onoff ? GET_TEXT(MSG_LCD_ON) : GET_TEXT(MSG_LCD_OFF), true); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, const bool onoff) { + MenuEditItemBase::draw(sel, row, fstr, onoff ? GET_TEXT_F(MSG_LCD_ON) : GET_TEXT_F(MSG_LCD_OFF)); } - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, bool * const data, ...) { - draw(sel, row, pstr, *data); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, bool * const data, ...) { + draw(sel, row, fstr, *data); } - FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, PGM_P const, bool (*pget)(), ...) { - draw(sel, row, pstr, pget()); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, FSTR_P const, bool (*pget)(), ...) { + draw(sel, row, fstr, pget()); } - static void action(PGM_P const pstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr) { + static void action(FSTR_P const fstr, bool * const ptr, const screenFunc_t callbackFunc=nullptr) { *ptr ^= true; ui.refresh(); if (callbackFunc) (*callbackFunc)(); } @@ -250,16 +250,16 @@ class MenuItem_bool : public MenuEditItemBase { * * Examples: * BACK_ITEM(MSG_INFO_SCREEN) - * MenuItem_back::action(plabel, ...) - * MenuItem_back::draw(sel, row, plabel, ...) + * MenuItem_back::action(flabel, ...) + * MenuItem_back::draw(sel, row, flabel, ...) * * ACTION_ITEM(MSG_PAUSE_PRINT, lcd_sdcard_pause) - * MenuItem_function::action(plabel, lcd_sdcard_pause) - * MenuItem_function::draw(sel, row, plabel, lcd_sdcard_pause) + * MenuItem_function::action(flabel, lcd_sdcard_pause) + * MenuItem_function::draw(sel, row, flabel, lcd_sdcard_pause) * * EDIT_ITEM(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * MenuItem_int3::action(plabel, &feedrate_percentage, 10, 999) - * MenuItem_int3::draw(sel, row, plabel, &feedrate_percentage, 10, 999) + * MenuItem_int3::action(flabel, &feedrate_percentage, 10, 999) + * MenuItem_int3::draw(sel, row, flabel, &feedrate_percentage, 10, 999) */ #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -268,19 +268,19 @@ class MenuItem_bool : public MenuEditItemBase { #define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER) #endif -#define _MENU_INNER_P(TYPE, USE_MULTIPLIER, PLABEL, V...) do { \ - PGM_P const plabel = PLABEL; \ +#define _MENU_INNER_P(TYPE, USE_MULTIPLIER, FLABEL, V...) do { \ + FSTR_P const flabel = FLABEL; \ if (encoderLine == _thisItemNr && ui.use_click()) { \ _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ - MenuItem_##TYPE::action(plabel, ##V); \ + MenuItem_##TYPE::action(flabel, ##V); \ if (ui.screen_changed) return; \ } \ if (ui.should_draw()) \ MenuItem_##TYPE::draw \ - (encoderLine == _thisItemNr, _lcdLineNr, plabel, ##V); \ + (encoderLine == _thisItemNr, _lcdLineNr, flabel, ##V); \ }while(0) -#define _MENU_ITEM_P(TYPE, V...) do { \ +#define _MENU_ITEM_F(TYPE, V...) do { \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ _MENU_INNER_P(TYPE, ##V); \ @@ -289,7 +289,7 @@ class MenuItem_bool : public MenuEditItemBase { }while(0) // Indexed items set a global index value and optional data -#define _MENU_ITEM_N_S_P(TYPE, N, S, V...) do{ \ +#define _MENU_ITEM_N_S_F(TYPE, N, S, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ MenuItemBase::init(N, S); \ @@ -299,7 +299,7 @@ class MenuItem_bool : public MenuEditItemBase { }while(0) // Indexed items set a global index value -#define _MENU_ITEM_N_P(TYPE, N, V...) do{ \ +#define _MENU_ITEM_N_F(TYPE, N, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ MenuItemBase::itemIndex = N; \ @@ -309,7 +309,7 @@ class MenuItem_bool : public MenuEditItemBase { }while(0) // Items with a unique string -#define _MENU_ITEM_S_P(TYPE, S, V...) do{ \ +#define _MENU_ITEM_S_F(TYPE, S, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ MenuItemBase::itemString = S; \ @@ -321,25 +321,25 @@ class MenuItem_bool : public MenuEditItemBase { // STATIC_ITEM draws a styled string with no highlight. // Parameters: label [, style [, char *value] ] -#define STATIC_ITEM_INNER_P(PLABEL, V...) do{ \ +#define STATIC_ITEM_INNER_F(FLABEL, V...) do{ \ if (_skipStatic && encoderLine <= _thisItemNr) { \ ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ ++encoderLine; \ } \ if (ui.should_draw()) \ - MenuItem_static::draw(_lcdLineNr, PLABEL, ##V); \ + MenuItem_static::draw(_lcdLineNr, FLABEL, ##V); \ } while(0) -#define STATIC_ITEM_P(PLABEL, V...) do{ \ +#define STATIC_ITEM_F(FLABEL, V...) do{ \ if (_menuLineNr == _thisItemNr) \ - STATIC_ITEM_INNER_P(PLABEL, ##V); \ + STATIC_ITEM_INNER_F(FLABEL, ##V); \ NEXT_ITEM(); \ } while(0) -#define STATIC_ITEM_N_P(PLABEL, N, V...) do{ \ +#define STATIC_ITEM_N_F(FLABEL, N, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ MenuItemBase::init(N); \ - STATIC_ITEM_INNER_P(PLABEL, ##V); \ + STATIC_ITEM_INNER_F(FLABEL, ##V); \ } \ NEXT_ITEM(); \ }while(0) @@ -347,124 +347,124 @@ class MenuItem_bool : public MenuEditItemBase { // PSTRING_ITEM is like STATIC_ITEM but it takes // two PSTRs with the style as the last parameter. -#define PSTRING_ITEM_P(PLABEL, PVAL, STYL) do{ \ +#define PSTRING_ITEM_F(FLABEL, PVAL, STYL) do{ \ constexpr int m = 20; \ char msg[m+1]; \ msg[0] = ':'; msg[1] = ' '; \ strncpy_P(msg+2, PSTR(PVAL), m-2); \ if (msg[m-1] & 0x80) msg[m-1] = '\0'; \ - STATIC_ITEM_P(PLABEL, STYL, msg); \ + STATIC_ITEM_F(FLABEL, STYL, msg); \ }while(0) -#define PSTRING_ITEM(LABEL, V...) PSTRING_ITEM_P(GET_TEXT(LABEL), ##V) +#define PSTRING_ITEM(LABEL, V...) PSTRING_ITEM_F(GET_TEXT_F(LABEL), ##V) -#define STATIC_ITEM(LABEL, V...) STATIC_ITEM_P(GET_TEXT(LABEL), ##V) -#define STATIC_ITEM_N(LABEL, N, V...) STATIC_ITEM_N_P(GET_TEXT(LABEL), N, ##V) +#define STATIC_ITEM(LABEL, V...) STATIC_ITEM_F(GET_TEXT_F(LABEL), ##V) +#define STATIC_ITEM_N(LABEL, N, V...) STATIC_ITEM_N_F(GET_TEXT_F(LABEL), N, ##V) -#define MENU_ITEM_N_S_P(TYPE, N, S, PLABEL, V...) _MENU_ITEM_N_S_P(TYPE, N, S, false, PLABEL, ##V) -#define MENU_ITEM_N_S(TYPE, N, S, LABEL, V...) MENU_ITEM_N_S_P(TYPE, N, S, GET_TEXT(LABEL), ##V) -#define MENU_ITEM_S_P(TYPE, S, PLABEL, V...) _MENU_ITEM_S_P(TYPE, S, false, PLABEL, ##V) -#define MENU_ITEM_S(TYPE, S, LABEL, V...) MENU_ITEM_S_P(TYPE, S, GET_TEXT(LABEL), ##V) -#define MENU_ITEM_N_P(TYPE, N, PLABEL, V...) _MENU_ITEM_N_P(TYPE, N, false, PLABEL, ##V) -#define MENU_ITEM_N(TYPE, N, LABEL, V...) MENU_ITEM_N_P(TYPE, N, GET_TEXT(LABEL), ##V) -#define MENU_ITEM_P(TYPE, PLABEL, V...) _MENU_ITEM_P(TYPE, false, PLABEL, ##V) -#define MENU_ITEM(TYPE, LABEL, V...) MENU_ITEM_P(TYPE, GET_TEXT(LABEL), ##V) +#define MENU_ITEM_N_S_F(TYPE, N, S, FLABEL, V...) _MENU_ITEM_N_S_F(TYPE, N, S, false, FLABEL, ##V) +#define MENU_ITEM_N_S(TYPE, N, S, LABEL, V...) MENU_ITEM_N_S_F(TYPE, N, S, GET_TEXT_F(LABEL), ##V) +#define MENU_ITEM_S_F(TYPE, S, FLABEL, V...) _MENU_ITEM_S_F(TYPE, S, false, FLABEL, ##V) +#define MENU_ITEM_S(TYPE, S, LABEL, V...) MENU_ITEM_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V) +#define MENU_ITEM_N_F(TYPE, N, FLABEL, V...) _MENU_ITEM_N_F(TYPE, N, false, FLABEL, ##V) +#define MENU_ITEM_N(TYPE, N, LABEL, V...) MENU_ITEM_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V) +#define MENU_ITEM_F(TYPE, FLABEL, V...) _MENU_ITEM_F(TYPE, false, FLABEL, ##V) +#define MENU_ITEM(TYPE, LABEL, V...) MENU_ITEM_F(TYPE, GET_TEXT_F(LABEL), ##V) -#define BACK_ITEM_P(PLABEL) MENU_ITEM_P(back, PLABEL) +#define BACK_ITEM_F(FLABEL) MENU_ITEM_F(back, FLABEL) #define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL) -#define ACTION_ITEM_N_S_P(N, S, PLABEL, ACTION) MENU_ITEM_N_S_P(function, N, S, PLABEL, ACTION) -#define ACTION_ITEM_N_S(N, S, LABEL, ACTION) ACTION_ITEM_N_S_P(N, S, GET_TEXT(LABEL), ACTION) -#define ACTION_ITEM_S_P(S, PLABEL, ACTION) MENU_ITEM_S_P(function, S, PLABEL, ACTION) -#define ACTION_ITEM_S(S, LABEL, ACTION) ACTION_ITEM_S_P(S, GET_TEXT(LABEL), ACTION) -#define ACTION_ITEM_N_P(N, PLABEL, ACTION) MENU_ITEM_N_P(function, N, PLABEL, ACTION) -#define ACTION_ITEM_N(N, LABEL, ACTION) ACTION_ITEM_N_P(N, GET_TEXT(LABEL), ACTION) -#define ACTION_ITEM_P(PLABEL, ACTION) MENU_ITEM_P(function, PLABEL, ACTION) -#define ACTION_ITEM(LABEL, ACTION) ACTION_ITEM_P(GET_TEXT(LABEL), ACTION) - -#define GCODES_ITEM_N_S_P(N, S, PLABEL, GCODES) MENU_ITEM_N_S_P(gcode, N, S, PLABEL, GCODES) -#define GCODES_ITEM_N_S(N, S, LABEL, GCODES) GCODES_ITEM_N_S_P(N, S, GET_TEXT(LABEL), GCODES) -#define GCODES_ITEM_S_P(S, PLABEL, GCODES) MENU_ITEM_S_P(gcode, S, PLABEL, GCODES) -#define GCODES_ITEM_S(S, LABEL, GCODES) GCODES_ITEM_S_P(S, GET_TEXT(LABEL), GCODES) -#define GCODES_ITEM_N_P(N, PLABEL, GCODES) MENU_ITEM_N_P(gcode, N, PLABEL, GCODES) -#define GCODES_ITEM_N(N, LABEL, GCODES) GCODES_ITEM_N_P(N, GET_TEXT(LABEL), GCODES) -#define GCODES_ITEM_P(PLABEL, GCODES) MENU_ITEM_P(gcode, PLABEL, GCODES) -#define GCODES_ITEM(LABEL, GCODES) GCODES_ITEM_P(GET_TEXT(LABEL), GCODES) - -#define SUBMENU_N_S_P(N, S, PLABEL, DEST) MENU_ITEM_N_S_P(submenu, N, S, PLABEL, DEST) -#define SUBMENU_N_S(N, S, LABEL, DEST) SUBMENU_N_S_P(N, S, GET_TEXT(LABEL), DEST) -#define SUBMENU_S_P(S, PLABEL, DEST) MENU_ITEM_S_P(submenu, S, PLABEL, DEST) -#define SUBMENU_S(S, LABEL, DEST) SUBMENU_S_P(S, GET_TEXT(LABEL), DEST) -#define SUBMENU_N_P(N, PLABEL, DEST) MENU_ITEM_N_P(submenu, N, PLABEL, DEST) -#define SUBMENU_N(N, LABEL, DEST) SUBMENU_N_P(N, GET_TEXT(LABEL), DEST) -#define SUBMENU_P(PLABEL, DEST) MENU_ITEM_P(submenu, PLABEL, DEST) -#define SUBMENU(LABEL, DEST) SUBMENU_P(GET_TEXT(LABEL), DEST) - -#define EDIT_ITEM_N_S_P(TYPE, N, S, PLABEL, V...) MENU_ITEM_N_S_P(TYPE, N, S, PLABEL, ##V) -#define EDIT_ITEM_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_N_S_P(TYPE, N, S, GET_TEXT(LABEL), ##V) -#define EDIT_ITEM_S_P(TYPE, S, PLABEL, V...) MENU_ITEM_S_P(TYPE, S, PLABEL, ##V) -#define EDIT_ITEM_S(TYPE, S, LABEL, V...) EDIT_ITEM_S_P(TYPE, S, GET_TEXT(LABEL), ##V) -#define EDIT_ITEM_N_P(TYPE, N, PLABEL, V...) MENU_ITEM_N_P(TYPE, N, PLABEL, ##V) -#define EDIT_ITEM_N(TYPE, N, LABEL, V...) EDIT_ITEM_N_P(TYPE, N, GET_TEXT(LABEL), ##V) -#define EDIT_ITEM_P(TYPE, PLABEL, V...) MENU_ITEM_P(TYPE, PLABEL, ##V) -#define EDIT_ITEM(TYPE, LABEL, V...) EDIT_ITEM_P(TYPE, GET_TEXT(LABEL), ##V) - -#define EDIT_ITEM_FAST_N_S_P(TYPE, N, S, PLABEL, V...) _MENU_ITEM_N_S_P(TYPE, N, S, true, PLABEL, ##V) -#define EDIT_ITEM_FAST_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_FAST_N_S_P(TYPE, N, S, true, GET_TEXT(LABEL), ##V) -#define EDIT_ITEM_FAST_S_P(TYPE, S, PLABEL, V...) _MENU_ITEM_S_P(TYPE, S, true, PLABEL, ##V) -#define EDIT_ITEM_FAST_S(TYPE, S, LABEL, V...) EDIT_ITEM_FAST_S_P(TYPE, S, GET_TEXT(LABEL), ##V) -#define EDIT_ITEM_FAST_N_P(TYPE, N, PLABEL, V...) _MENU_ITEM_N_P(TYPE, N, true, PLABEL, ##V) -#define EDIT_ITEM_FAST_N(TYPE, N, LABEL, V...) EDIT_ITEM_FAST_N_P(TYPE, N, GET_TEXT(LABEL), ##V) -#define EDIT_ITEM_FAST_P(TYPE, PLABEL, V...) _MENU_ITEM_P(TYPE, true, PLABEL, ##V) -#define EDIT_ITEM_FAST(TYPE, LABEL, V...) EDIT_ITEM_FAST_P(TYPE, GET_TEXT(LABEL), ##V) - -#define _CONFIRM_ITEM_INNER_P(PLABEL, V...) do { \ +#define ACTION_ITEM_N_S_F(N, S, FLABEL, ACTION) MENU_ITEM_N_S_F(function, N, S, FLABEL, ACTION) +#define ACTION_ITEM_N_S(N, S, LABEL, ACTION) ACTION_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ACTION) +#define ACTION_ITEM_S_F(S, FLABEL, ACTION) MENU_ITEM_S_F(function, S, FLABEL, ACTION) +#define ACTION_ITEM_S(S, LABEL, ACTION) ACTION_ITEM_S_F(S, GET_TEXT_F(LABEL), ACTION) +#define ACTION_ITEM_N_F(N, FLABEL, ACTION) MENU_ITEM_N_F(function, N, FLABEL, ACTION) +#define ACTION_ITEM_N(N, LABEL, ACTION) ACTION_ITEM_N_F(N, GET_TEXT_F(LABEL), ACTION) +#define ACTION_ITEM_F(FLABEL, ACTION) MENU_ITEM_F(function, FLABEL, ACTION) +#define ACTION_ITEM(LABEL, ACTION) ACTION_ITEM_F(GET_TEXT_F(LABEL), ACTION) + +#define GCODES_ITEM_N_S_F(N, S, FLABEL, GCODES) MENU_ITEM_N_S_F(gcode, N, S, FLABEL, GCODES) +#define GCODES_ITEM_N_S(N, S, LABEL, GCODES) GCODES_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), GCODES) +#define GCODES_ITEM_S_F(S, FLABEL, GCODES) MENU_ITEM_S_F(gcode, S, FLABEL, GCODES) +#define GCODES_ITEM_S(S, LABEL, GCODES) GCODES_ITEM_S_F(S, GET_TEXT_F(LABEL), GCODES) +#define GCODES_ITEM_N_F(N, FLABEL, GCODES) MENU_ITEM_N_F(gcode, N, FLABEL, GCODES) +#define GCODES_ITEM_N(N, LABEL, GCODES) GCODES_ITEM_N_F(N, GET_TEXT_F(LABEL), GCODES) +#define GCODES_ITEM_F(FLABEL, GCODES) MENU_ITEM_F(gcode, FLABEL, GCODES) +#define GCODES_ITEM(LABEL, GCODES) GCODES_ITEM_F(GET_TEXT_F(LABEL), GCODES) + +#define SUBMENU_N_S_F(N, S, FLABEL, DEST) MENU_ITEM_N_S_F(submenu, N, S, FLABEL, DEST) +#define SUBMENU_N_S(N, S, LABEL, DEST) SUBMENU_N_S_F(N, S, GET_TEXT_F(LABEL), DEST) +#define SUBMENU_S_F(S, FLABEL, DEST) MENU_ITEM_S_F(submenu, S, FLABEL, DEST) +#define SUBMENU_S(S, LABEL, DEST) SUBMENU_S_F(S, GET_TEXT_F(LABEL), DEST) +#define SUBMENU_N_F(N, FLABEL, DEST) MENU_ITEM_N_F(submenu, N, FLABEL, DEST) +#define SUBMENU_N(N, LABEL, DEST) SUBMENU_N_F(N, GET_TEXT_F(LABEL), DEST) +#define SUBMENU_F(FLABEL, DEST) MENU_ITEM_F(submenu, FLABEL, DEST) +#define SUBMENU(LABEL, DEST) SUBMENU_F(GET_TEXT_F(LABEL), DEST) + +#define EDIT_ITEM_N_S_F(TYPE, N, S, FLABEL, V...) MENU_ITEM_N_S_F(TYPE, N, S, FLABEL, ##V) +#define EDIT_ITEM_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_N_S_F(TYPE, N, S, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_S_F(TYPE, S, FLABEL, V...) MENU_ITEM_S_F(TYPE, S, FLABEL, ##V) +#define EDIT_ITEM_S(TYPE, S, LABEL, V...) EDIT_ITEM_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_N_F(TYPE, N, FLABEL, V...) MENU_ITEM_N_F(TYPE, N, FLABEL, ##V) +#define EDIT_ITEM_N(TYPE, N, LABEL, V...) EDIT_ITEM_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_F(TYPE, FLABEL, V...) MENU_ITEM_F(TYPE, FLABEL, ##V) +#define EDIT_ITEM(TYPE, LABEL, V...) EDIT_ITEM_F(TYPE, GET_TEXT_F(LABEL), ##V) + +#define EDIT_ITEM_FAST_N_S_F(TYPE, N, S, FLABEL, V...) _MENU_ITEM_N_S_F(TYPE, N, S, true, FLABEL, ##V) +#define EDIT_ITEM_FAST_N_S(TYPE, N, S, LABEL, V...) EDIT_ITEM_FAST_N_S_F(TYPE, N, S, true, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_FAST_S_F(TYPE, S, FLABEL, V...) _MENU_ITEM_S_F(TYPE, S, true, FLABEL, ##V) +#define EDIT_ITEM_FAST_S(TYPE, S, LABEL, V...) EDIT_ITEM_FAST_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_FAST_N_F(TYPE, N, FLABEL, V...) _MENU_ITEM_N_F(TYPE, N, true, FLABEL, ##V) +#define EDIT_ITEM_FAST_N(TYPE, N, LABEL, V...) EDIT_ITEM_FAST_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_FAST_F(TYPE, FLABEL, V...) _MENU_ITEM_F(TYPE, true, FLABEL, ##V) +#define EDIT_ITEM_FAST(TYPE, LABEL, V...) EDIT_ITEM_FAST_F(TYPE, GET_TEXT_F(LABEL), ##V) + +#define _CONFIRM_ITEM_INNER_F(FLABEL, V...) do { \ if (encoderLine == _thisItemNr && ui.use_click()) { \ ui.push_current_screen(); \ ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \ return; \ } \ if (ui.should_draw()) MenuItem_confirm::draw \ - (encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ##V); \ + (encoderLine == _thisItemNr, _lcdLineNr, FLABEL, ##V); \ }while(0) // Indexed items set a global index value and optional data -#define _CONFIRM_ITEM_P(PLABEL, V...) do { \ +#define _CONFIRM_ITEM_F(FLABEL, V...) do { \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ - _CONFIRM_ITEM_INNER_P(PLABEL, ##V); \ + _CONFIRM_ITEM_INNER_F(FLABEL, ##V); \ } \ NEXT_ITEM(); \ }while(0) // Indexed items set a global index value -#define _CONFIRM_ITEM_N_S_P(N, S, V...) do{ \ +#define _CONFIRM_ITEM_N_S_F(N, S, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ MenuItemBase::init(N, S); \ - _CONFIRM_ITEM_INNER_P(TYPE, ##V); \ + _CONFIRM_ITEM_INNER_F(TYPE, ##V); \ } \ NEXT_ITEM(); \ }while(0) // Indexed items set a global index value -#define _CONFIRM_ITEM_N_P(N, V...) _CONFIRM_ITEM_N_S_P(N, nullptr, V) +#define _CONFIRM_ITEM_N_F(N, V...) _CONFIRM_ITEM_N_S_F(N, nullptr, V) -#define CONFIRM_ITEM_P(PLABEL,A,B,V...) _CONFIRM_ITEM_P(PLABEL, GET_TEXT(A), GET_TEXT(B), ##V) -#define CONFIRM_ITEM(LABEL, V...) CONFIRM_ITEM_P(GET_TEXT(LABEL), ##V) +#define CONFIRM_ITEM_F(FLABEL,A,B,V...) _CONFIRM_ITEM_F(FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V) +#define CONFIRM_ITEM(LABEL, V...) CONFIRM_ITEM_F(GET_TEXT_F(LABEL), ##V) -#define YESNO_ITEM_P(PLABEL, V...) CONFIRM_ITEM_P(PLABEL, MSG_YES, MSG_NO, ##V) -#define YESNO_ITEM(LABEL, V...) YESNO_ITEM_P(GET_TEXT(LABEL), ##V) +#define YESNO_ITEM_F(FLABEL, V...) CONFIRM_ITEM_F(FLABEL, MSG_YES, MSG_NO, ##V) +#define YESNO_ITEM(LABEL, V...) YESNO_ITEM_F(GET_TEXT_F(LABEL), ##V) -#define CONFIRM_ITEM_N_S_P(N,S,PLABEL,A,B,V...) _CONFIRM_ITEM_N_S_P(N, S, PLABEL, GET_TEXT(A), GET_TEXT(B), ##V) -#define CONFIRM_ITEM_N_S(N,S,LABEL,V...) CONFIRM_ITEM_N_S_P(N, S, GET_TEXT(LABEL), ##V) -#define CONFIRM_ITEM_N_P(N,PLABEL,A,B,V...) _CONFIRM_ITEM_N_P(N, PLABEL, GET_TEXT(A), GET_TEXT(B), ##V) -#define CONFIRM_ITEM_N(N,LABEL, V...) CONFIRM_ITEM_N_P(N, GET_TEXT(LABEL), ##V) +#define CONFIRM_ITEM_N_S_F(N,S,FLABEL,A,B,V...) _CONFIRM_ITEM_N_S_F(N, S, FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V) +#define CONFIRM_ITEM_N_S(N,S,LABEL,V...) CONFIRM_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ##V) +#define CONFIRM_ITEM_N_F(N,FLABEL,A,B,V...) _CONFIRM_ITEM_N_F(N, FLABEL, GET_TEXT_F(A), GET_TEXT_F(B), ##V) +#define CONFIRM_ITEM_N(N,LABEL, V...) CONFIRM_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V) -#define YESNO_ITEM_N_S_P(N,S,PLABEL, V...) _CONFIRM_ITEM_N_S_P(N, S, PLABEL, MSG_YES, MSG_NO, ##V) -#define YESNO_ITEM_N_S(N,S,LABEL, V...) YESNO_ITEM_N_S_P(N, S, GET_TEXT(LABEL), ##V) -#define YESNO_ITEM_N_P(N,PLABEL, V...) CONFIRM_ITEM_N_P(N, PLABEL, MSG_YES, MSG_NO, ##V) -#define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_P(N, GET_TEXT(LABEL), ##V) +#define YESNO_ITEM_N_S_F(N,S,FLABEL, V...) _CONFIRM_ITEM_N_S_F(N, S, FLABEL, MSG_YES, MSG_NO, ##V) +#define YESNO_ITEM_N_S(N,S,LABEL, V...) YESNO_ITEM_N_S_F(N, S, GET_TEXT_F(LABEL), ##V) +#define YESNO_ITEM_N_F(N,FLABEL, V...) CONFIRM_ITEM_N_F(N, FLABEL, MSG_YES, MSG_NO, ##V) +#define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V) #if ENABLED(LEVEL_BED_CORNERS) void _lcd_level_bed_corners(); diff --git a/Marlin/src/lcd/menu/menu_language.cpp b/Marlin/src/lcd/menu/menu_language.cpp index 4c4b7880f2c3..2ea4359c6bb7 100644 --- a/Marlin/src/lcd/menu/menu_language.cpp +++ b/Marlin/src/lcd/menu/menu_language.cpp @@ -41,14 +41,14 @@ void menu_language() { START_MENU(); BACK_ITEM(MSG_MAIN); - MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE )::LANGUAGE, []{ set_lcd_language(0); }); - MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_2)::LANGUAGE, []{ set_lcd_language(1); }); + MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(1)), []{ set_lcd_language(0); }); + MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(2)), []{ set_lcd_language(1); }); #if NUM_LANGUAGES > 2 - MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_3)::LANGUAGE, []{ set_lcd_language(2); }); + MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(3)), []{ set_lcd_language(2); }); #if NUM_LANGUAGES > 3 - MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_4)::LANGUAGE, []{ set_lcd_language(3); }); + MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(4)), []{ set_lcd_language(3); }); #if NUM_LANGUAGES > 4 - MENU_ITEM_P(function, GET_LANG(LCD_LANGUAGE_5)::LANGUAGE, []{ set_lcd_language(4); }); + MENU_ITEM_F(function, FPSTR(GET_LANGUAGE_NAME(5)), []{ set_lcd_language(4); }); #endif #endif #endif diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index a15653589523..fdedddb6ddda 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -124,13 +124,13 @@ void menu_configuration(); #define _DONE_SCRIPT "" #endif #define GCODE_LAMBDA_MAIN(N) []{ _lcd_custom_menu_main_gcode(F(MAIN_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); } - #define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N)); - #define _CUSTOM_ITEM_MAIN_CONFIRM(N) \ - SUBMENU_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), []{ \ - MenuItem_confirm::confirm_screen( \ - GCODE_LAMBDA_MAIN(N), nullptr, \ - PSTR(MAIN_MENU_ITEM_##N##_DESC "?") \ - ); \ + #define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_F(F(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N)); + #define _CUSTOM_ITEM_MAIN_CONFIRM(N) \ + SUBMENU_F(F(MAIN_MENU_ITEM_##N##_DESC), []{ \ + MenuItem_confirm::confirm_screen( \ + GCODE_LAMBDA_MAIN(N), nullptr, \ + F(MAIN_MENU_ITEM_##N##_DESC "?") \ + ); \ }) #define CUSTOM_ITEM_MAIN(N) do{ \ @@ -247,10 +247,10 @@ void menu_main() { if (card_detected) { if (!card_open) { #if PIN_EXISTS(SD_DETECT) - GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21")); // M21 Change Media - #else // - or - - ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media - queue.inject(PSTR("M22")); + GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21")); // M21 Change Media + #else // - or - + ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media + queue.inject(F("M22")); #if ENABLED(TFT_COLOR_UI) // Menu display issue on item removal with multi language selection menu if (encoderTopLine > 0) encoderTopLine--; @@ -258,14 +258,14 @@ void menu_main() { #endif }); #endif - SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First) + SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First) } } else { #if PIN_EXISTS(SD_DETECT) - ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media" + ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media" #else - GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21")); // M21 Attach Media + GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21")); // M21 Attach Media #endif } }; @@ -279,9 +279,9 @@ void menu_main() { #if MACHINE_CAN_STOP SUBMENU(MSG_STOP_PRINT, []{ MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_STOP), GET_TEXT(MSG_BACK), + GET_TEXT_F(MSG_BUTTON_STOP), GET_TEXT_F(MSG_BACK), ui.abort_print, nullptr, - GET_TEXT(MSG_STOP_PRINT), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_STOP_PRINT), (const char *)nullptr, F("?") ); }); #endif @@ -342,7 +342,7 @@ void menu_main() { #if ENABLED(CUSTOM_MENU_MAIN) if (TERN1(CUSTOM_MENU_MAIN_ONLY_IDLE, !busy)) { #ifdef CUSTOM_MENU_MAIN_TITLE - SUBMENU_P(PSTR(CUSTOM_MENU_MAIN_TITLE), custom_menus_main); + SUBMENU_F(F(CUSTOM_MENU_MAIN_TITLE), custom_menus_main); #else SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_main); #endif @@ -353,7 +353,7 @@ void menu_main() { #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES) YESNO_ITEM(MSG_FILAMENTCHANGE, menu_change_filament, nullptr, - GET_TEXT(MSG_FILAMENTCHANGE), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?") ); #else SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament); @@ -377,13 +377,13 @@ void menu_main() { CONFIRM_ITEM(MSG_SWITCH_PS_OFF, MSG_YES, MSG_NO, ui.poweroff, nullptr, - GET_TEXT(MSG_SWITCH_PS_OFF), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_SWITCH_PS_OFF), (const char *)nullptr, F("?") ); #else ACTION_ITEM(MSG_SWITCH_PS_OFF, ui.poweroff); #endif else - GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80")); + GCODES_ITEM(MSG_SWITCH_PS_ON, F("M80")); #endif #if ENABLED(SDSUPPORT) && DISABLED(MEDIA_MENU_AT_TOP) @@ -398,24 +398,24 @@ void menu_main() { ui.return_to_status(); }; #if SERVICE_INTERVAL_1 > 0 - CONFIRM_ITEM_P(PSTR(SERVICE_NAME_1), + CONFIRM_ITEM_F(F(SERVICE_NAME_1), MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, []{ _service_reset(1); }, nullptr, - GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_1), PSTR("?") + GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_1), F("?") ); #endif #if SERVICE_INTERVAL_2 > 0 - CONFIRM_ITEM_P(PSTR(SERVICE_NAME_2), + CONFIRM_ITEM_F(F(SERVICE_NAME_2), MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, []{ _service_reset(2); }, nullptr, - GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_2), PSTR("?") + GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_2), F("?") ); #endif #if SERVICE_INTERVAL_3 > 0 - CONFIRM_ITEM_P(PSTR(SERVICE_NAME_3), + CONFIRM_ITEM_F(F(SERVICE_NAME_3), MSG_BUTTON_RESET, MSG_BUTTON_CANCEL, []{ _service_reset(3); }, nullptr, - GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_3), PSTR("?") + GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_3), F("?") ); #endif #endif @@ -451,9 +451,9 @@ void menu_main() { #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) SUBMENU(MSG_HOST_SHUTDOWN, []{ MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BUTTON_CANCEL), + GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BUTTON_CANCEL), []{ ui.return_to_status(); hostui.shutdown(); }, nullptr, - GET_TEXT(MSG_HOST_SHUTDOWN), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_HOST_SHUTDOWN), (const char *)nullptr, F("?") ); }); #endif diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index db1baa9bee6f..e979f04e119d 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -61,10 +61,10 @@ inline void sdcard_start_selected_file() { class MenuItem_sdfile : public MenuItem_sdbase { public: - static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { - MenuItem_sdbase::draw(sel, row, pstr, theCard, false); + static inline void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard) { + MenuItem_sdbase::draw(sel, row, fstr, theCard, false); } - static void action(PGM_P const pstr, CardReader &) { + static void action(FSTR_P const fstr, CardReader &) { #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) // Save menu state for the selected file sd_encoder_position = ui.encoderPosition; @@ -72,30 +72,30 @@ class MenuItem_sdfile : public MenuItem_sdbase { sd_items = screen_items; #endif #if ENABLED(SD_MENU_CONFIRM_START) - MenuItem_submenu::action(pstr, []{ + MenuItem_submenu::action(fstr, []{ char * const longest = card.longest_filename(); char buffer[strlen(longest) + 2]; buffer[0] = ' '; strcpy(buffer + 1, longest); MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_PRINT), GET_TEXT(MSG_BUTTON_CANCEL), + GET_TEXT_F(MSG_BUTTON_PRINT), GET_TEXT_F(MSG_BUTTON_CANCEL), sdcard_start_selected_file, nullptr, - GET_TEXT(MSG_START_PRINT), buffer, PSTR("?") + GET_TEXT_F(MSG_START_PRINT), buffer, F("?") ); }); #else sdcard_start_selected_file(); - UNUSED(pstr); + UNUSED(fstr); #endif } }; class MenuItem_sdfolder : public MenuItem_sdbase { public: - static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { - MenuItem_sdbase::draw(sel, row, pstr, theCard, true); + static inline void draw(const bool sel, const uint8_t row, FSTR_P const fstr, CardReader &theCard) { + MenuItem_sdbase::draw(sel, row, fstr, theCard, true); } - static void action(PGM_P const, CardReader &theCard) { + static void action(FSTR_P const, CardReader &theCard) { card.cd(theCard.filename); encoderTopLine = 0; ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM); @@ -119,7 +119,7 @@ void menu_media_filelist() { #if ENABLED(MULTI_VOLUME) ACTION_ITEM(MSG_BACK, []{ ui.goto_screen(menu_media); }); #else - BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK)); + BACK_ITEM_F(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT_F(MSG_MAIN) : GET_TEXT_F(MSG_BACK)); #endif if (card.flag.workDirIsRoot) { #if !PIN_EXISTS(SD_DETECT) @@ -127,7 +127,7 @@ void menu_media_filelist() { #endif } else if (card.isMounted()) - ACTION_ITEM_P(PSTR(LCD_STR_FOLDER " .."), lcd_sd_updir); + ACTION_ITEM_F(F(LCD_STR_FOLDER " .."), lcd_sd_updir); if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) { if (_menuLineNr == _thisItemNr) { @@ -146,7 +146,7 @@ void menu_media_filelist() { #if ENABLED(MULTI_VOLUME) void menu_media_select() { START_MENU(); - BACK_ITEM_P(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT(MSG_MAIN) : GET_TEXT(MSG_BACK)); + BACK_ITEM_F(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT_F(MSG_MAIN) : GET_TEXT_F(MSG_BACK)); #if ENABLED(VOLUME_SD_ONBOARD) ACTION_ITEM(MSG_SD_CARD, []{ card.changeMedia(&card.media_driver_sdcard); card.mount(); ui.goto_screen(menu_media_filelist); }); #endif diff --git a/Marlin/src/lcd/menu/menu_mixer.cpp b/Marlin/src/lcd/menu/menu_mixer.cpp index f91f62ef8393..feb4c59f181c 100644 --- a/Marlin/src/lcd/menu/menu_mixer.cpp +++ b/Marlin/src/lcd/menu/menu_mixer.cpp @@ -89,15 +89,15 @@ char tmp[18]; - PGM_P const slabel = GET_TEXT(MSG_START_Z); - SUBMENU_P(slabel, []{ _lcd_mixer_gradient_z_edit(false); }); + FSTR_P const slabel = GET_TEXT_F(MSG_START_Z); + SUBMENU_F(slabel, []{ _lcd_mixer_gradient_z_edit(false); }); MENU_ITEM_ADDON_START_RJ(11); sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10); lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); - PGM_P const elabel = GET_TEXT(MSG_END_Z); - SUBMENU_P(elabel, []{ _lcd_mixer_gradient_z_edit(true); }); + FSTR_P const elabel = GET_TEXT_F(MSG_END_Z); + SUBMENU_F(elabel, []{ _lcd_mixer_gradient_z_edit(true); }); MENU_ITEM_ADDON_START_RJ(11); sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10); lcd_put_u8str(tmp); @@ -257,7 +257,7 @@ void menu_mixer() { ui.return_to_status(); }, nullptr, - GET_TEXT(MSG_RESET_VTOOLS), (const char *)nullptr, PSTR("?") + GET_TEXT_F(MSG_RESET_VTOOLS), (const char *)nullptr, F("?") ); #if ENABLED(GRADIENT_MIX) diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index e1d238bb35b8..2cfdb078efc9 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -57,7 +57,7 @@ // "Motion" > "Move Axis" submenu // -static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { +static void _lcd_move_xyz(FSTR_P const name, const AxisEnum axis) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); if (ui.encoderPosition && !ui.manual_move.processing) { // Get motion limit from software endstops, if any @@ -90,21 +90,21 @@ static void _lcd_move_xyz(PGM_P const name, const AxisEnum axis) { MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? (LARGE_AREA_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos)); } } -void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); } +void lcd_move_x() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_X), X_AXIS); } #if HAS_Y_AXIS - void lcd_move_y() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Y), Y_AXIS); } + void lcd_move_y() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_Y), Y_AXIS); } #endif #if HAS_Z_AXIS - void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); } + void lcd_move_z() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_Z), Z_AXIS); } #endif #if HAS_I_AXIS - void lcd_move_i() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_I), I_AXIS); } + void lcd_move_i() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_I), I_AXIS); } #endif #if HAS_J_AXIS - void lcd_move_j() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_J), J_AXIS); } + void lcd_move_j() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_J), J_AXIS); } #endif #if HAS_K_AXIS - void lcd_move_k() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_K), K_AXIS); } + void lcd_move_k() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_K), K_AXIS); } #endif #if E_MANUAL @@ -123,7 +123,7 @@ void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); } if (ui.should_draw()) { TERN_(MULTI_E_MANUAL, MenuItemBase::init(eindex)); MenuEditItemBase::draw_edit_screen( - GET_TEXT(TERN(MULTI_E_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)), + GET_TEXT_F(TERN(MULTI_E_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)), ftostr41sign(current_position.e PLUS_TERN0(IS_KINEMATIC, ui.manual_move.offset) MINUS_TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin) @@ -195,12 +195,12 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int char tmp[strlen_P(label) + 10 + 1], numstr[10]; sprintf_P(tmp, label, dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); #if DISABLED(HAS_GRAPHICAL_TFT) - SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); + SUBMENU_F(FPSTR(NUL_STR), []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); #else - SUBMENU_P(tmp, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); + SUBMENU_F(FPSTR(tmp), []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); #endif } } @@ -219,9 +219,9 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int if (too_cold) { ui.goto_screen([]{ MenuItem_confirm::select_screen( - GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BACK), + GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BACK), _goto_menu_move_distance_e, nullptr, - GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!") + GET_TEXT_F(MSG_HOTEND_TOO_COLD), (const char *)nullptr, F("!") ); }); return; @@ -266,41 +266,41 @@ void menu_move() { #endif } else - GCODES_ITEM(MSG_AUTO_HOME, G28_STR); + GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR)); #if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, MAGNETIC_SWITCHING_TOOLHEAD) #if EXTRUDERS >= 4 switch (active_extruder) { - case 0: GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); break; - case 1: GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); break; - case 2: GCODES_ITEM_N(3, MSG_SELECT_E, PSTR("T3")); break; - case 3: GCODES_ITEM_N(2, MSG_SELECT_E, PSTR("T2")); break; + case 0: GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); break; + case 1: GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); break; + case 2: GCODES_ITEM_N(3, MSG_SELECT_E, F("T3")); break; + case 3: GCODES_ITEM_N(2, MSG_SELECT_E, F("T2")); break; #if EXTRUDERS == 6 - case 4: GCODES_ITEM_N(5, MSG_SELECT_E, PSTR("T5")); break; - case 5: GCODES_ITEM_N(4, MSG_SELECT_E, PSTR("T4")); break; + case 4: GCODES_ITEM_N(5, MSG_SELECT_E, F("T5")); break; + case 5: GCODES_ITEM_N(4, MSG_SELECT_E, F("T4")); break; #endif } #elif EXTRUDERS == 3 if (active_extruder < 2) { if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); + GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); else - GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); + GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); } #else if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); + GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); else - GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); + GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); #endif #elif ENABLED(DUAL_X_CARRIAGE) if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, PSTR("T0")); + GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); else - GCODES_ITEM_N(1, MSG_SELECT_E, PSTR("T1")); + GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); #endif @@ -338,22 +338,22 @@ void menu_move() { START_MENU(); BACK_ITEM(MSG_MOTION); - GCODES_ITEM(MSG_AUTO_HOME, G28_STR); - GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, PSTR("G28X")); + GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR)); + GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, F("G28X")); #if HAS_Y_AXIS - GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, PSTR("G28Y")); + GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, F("G28Y")); #endif #if HAS_Z_AXIS - GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, PSTR("G28Z")); + GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, F("G28Z")); #endif #if HAS_I_AXIS - GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_I)); + GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, F("G28" STR_I)); #endif #if HAS_J_AXIS - GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_J)); + GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, F("G28" STR_J)); #endif #if HAS_K_AXIS - GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_K)); + GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, F("G28" STR_K)); #endif END_MENU(); @@ -390,23 +390,23 @@ void menu_motion() { #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) SUBMENU(MSG_HOMING, menu_home); #else - GCODES_ITEM(MSG_AUTO_HOME, G28_STR); + GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR)); #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) - GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, PSTR("G28X")); + GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, F("G28X")); #if HAS_Y_AXIS - GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, PSTR("G28Y")); + GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, F("G28Y")); #endif #if HAS_Z_AXIS - GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, PSTR("G28Z")); + GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, F("G28Z")); #endif #if HAS_I_AXIS - GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_I)); + GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, F("G28" STR_I)); #endif #if HAS_J_AXIS - GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_J)); + GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, F("G28" STR_J)); #endif #if HAS_K_AXIS - GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, PSTR("G28" STR_K)); + GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, F("G28" STR_K)); #endif #endif #endif @@ -415,14 +415,14 @@ void menu_motion() { // Auto-calibration // #if ENABLED(CALIBRATION_GCODE) - GCODES_ITEM(MSG_AUTO_CALIBRATE, PSTR("G425")); + GCODES_ITEM(MSG_AUTO_CALIBRATE, F("G425")); #endif // // Auto Z-Align // #if EITHER(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) - GCODES_ITEM(MSG_AUTO_Z_ALIGN, PSTR("G34")); + GCODES_ITEM(MSG_AUTO_Z_ALIGN, F("G34")); #endif // @@ -447,7 +447,7 @@ void menu_motion() { #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) #if DISABLED(PROBE_MANUALLY) - GCODES_ITEM(MSG_LEVEL_BED, PSTR("G29N")); + GCODES_ITEM(MSG_LEVEL_BED, F("G29N")); #endif if (all_axes_homed() && leveling_is_valid()) { @@ -467,13 +467,13 @@ void menu_motion() { #endif #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - GCODES_ITEM(MSG_M48_TEST, PSTR("G28O\nM48 P10")); + GCODES_ITEM(MSG_M48_TEST, F("G28O\nM48 P10")); #endif // // Disable Steppers // - GCODES_ITEM(MSG_DISABLE_STEPPERS, PSTR("M84")); + GCODES_ITEM(MSG_DISABLE_STEPPERS, F("M84")); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_password.cpp b/Marlin/src/lcd/menu/menu_password.cpp index 32059103b3f4..89ea42d70477 100644 --- a/Marlin/src/lcd/menu/menu_password.cpp +++ b/Marlin/src/lcd/menu/menu_password.cpp @@ -49,18 +49,18 @@ void Password::menu_password_entry() { START_MENU(); // "Login" or "New Code" - STATIC_ITEM_P(authenticating ? GET_TEXT(MSG_LOGIN_REQUIRED) : GET_TEXT(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT); + STATIC_ITEM_F(authenticating ? GET_TEXT_F(MSG_LOGIN_REQUIRED) : GET_TEXT_F(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT); - STATIC_ITEM_P(NUL_STR, SS_CENTER, string); + STATIC_ITEM_F(FPSTR(NUL_STR), SS_CENTER, string); #if HAS_MARLINUI_U8GLIB - STATIC_ITEM_P(NUL_STR, SS_CENTER, ""); + STATIC_ITEM_F(FPSTR(NUL_STR), SS_CENTER, ""); #endif // Make the digit edit item look like a sub-menu - PGM_P const label = GET_TEXT(MSG_ENTER_DIGIT); - EDIT_ITEM_P(uint8, label, &editable.uint8, 0, 9, digit_entered); - MENU_ITEM_ADDON_START(utf8_strlen_P(label) + 1); + FSTR_P const label = GET_TEXT_F(MSG_ENTER_DIGIT); + EDIT_ITEM_F(uint8, label, &editable.uint8, 0, 9, digit_entered); + MENU_ITEM_ADDON_START(utf8_strlen(label) + 1); lcd_put_wchar(' '); lcd_put_wchar('1' + digit_no); SETCURSOR_X(LCD_WIDTH - 2); diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index 79db47005d0a..6271b314f404 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -62,7 +62,7 @@ void probe_offset_wizard_menu() { if (LCD_HEIGHT >= 4) STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT); - STATIC_ITEM_P(PSTR("Z"), SS_CENTER, ftostr42_52(current_position.z)); + STATIC_ITEM_F(F("Z"), SS_CENTER, ftostr42_52(current_position.z)); STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset)); SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); }); @@ -75,12 +75,12 @@ void probe_offset_wizard_menu() { !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); #if DISABLED(HAS_GRAPHICAL_TFT) - SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); + SUBMENU_F(FPSTR(NUL_STR), []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); #else - SUBMENU_P(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); + SUBMENU_F(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); #endif } @@ -107,7 +107,7 @@ void probe_offset_wizard_menu() { void prepare_for_probe_offset_wizard() { #if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE - if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_PROBE_WIZARD_PROBING)); + if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT_F(MSG_PROBE_WIZARD_PROBING)); if (ui.wait_for_move) return; @@ -133,7 +133,7 @@ void prepare_for_probe_offset_wizard() { ui.wait_for_move = true; current_position += probe.offset_xy; line_to_current_position(MMM_TO_MMS(XY_PROBE_FEEDRATE)); - ui.synchronize(GET_TEXT(MSG_PROBE_WIZARD_MOVING)); + ui.synchronize(GET_TEXT_F(MSG_PROBE_WIZARD_MOVING)); ui.wait_for_move = false; SET_SOFT_ENDSTOP_LOOSE(true); // Disable soft endstops for free Z movement diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp index 306d3d6c57df..9efd68ca005d 100644 --- a/Marlin/src/lcd/menu/menu_spindle_laser.cpp +++ b/Marlin/src/lcd/menu/menu_spindle_laser.cpp @@ -64,7 +64,7 @@ #if ENABLED(SPINDLE_CHANGE_DIR) if (!is_enabled) { editable.state = is_rev; - ACTION_ITEM_P(is_rev ? GET_TEXT(MSG_CUTTER(REVERSE)) : GET_TEXT(MSG_CUTTER(FORWARD)), []{ cutter.set_reverse(!editable.state); }); + ACTION_ITEM_F(is_rev ? GET_TEXT_F(MSG_CUTTER(REVERSE)) : GET_TEXT_F(MSG_CUTTER(FORWARD)), []{ cutter.set_reverse(!editable.state); }); } #endif diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index 7e206e8d7990..00d77d164e7e 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -32,7 +32,7 @@ #include "../../module/stepper/indirection.h" #include "../../feature/tmc_util.h" -#define TMC_EDIT_STORED_I_RMS(ST,STR) EDIT_ITEM_P(uint16_4, PSTR(STR), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); }) +#define TMC_EDIT_STORED_I_RMS(ST,STR) EDIT_ITEM_F(uint16_4, F(STR), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); }) void menu_tmc_current() { START_MENU(); @@ -90,7 +90,7 @@ void menu_tmc_current() { #if ENABLED(HYBRID_THRESHOLD) - #define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_P(uint8, PSTR(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); }); + #define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_F(uint8, F(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); }); void menu_tmc_hybrid_thrs() { START_MENU(); @@ -118,7 +118,7 @@ void menu_tmc_current() { #if ENABLED(SENSORLESS_HOMING) - #define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_P(int4, PSTR(STR_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); }); + #define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_F(int4, F(STR_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); }); void menu_tmc_homing_thrs() { START_MENU(); @@ -141,7 +141,7 @@ void menu_tmc_current() { #if HAS_STEALTHCHOP - #define TMC_EDIT_STEP_MODE(ST, STR) EDIT_ITEM_P(bool, PSTR(STR), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); }) + #define TMC_EDIT_STEP_MODE(ST, STR) EDIT_ITEM_F(bool, F(STR), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); }) void menu_tmc_step_mode() { START_MENU(); diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming.cpp index cd7a4c677a10..1dd8a1cab6fd 100644 --- a/Marlin/src/lcd/menu/menu_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_tramming.cpp @@ -83,7 +83,7 @@ static void tramming_wizard_menu() { // Draw a menu item for each tramming point for (tram_index = 0; tram_index < G35_PROBE_COUNT; tram_index++) - SUBMENU_P((char*)pgm_read_ptr(&tramming_point_name[tram_index]), _menu_single_probe); + SUBMENU_F(FPSTR(pgm_read_ptr(&tramming_point_name[tram_index])), _menu_single_probe); ACTION_ITEM(MSG_BUTTON_DONE, []{ probe.stow(); // Stow before exiting Tramming Wizard diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 40513f71ab7e..5d4c3a4bfb47 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -50,7 +50,7 @@ #include "../dogm/marlinui_DOGM.h" #endif - void _lcd_babystep(const AxisEnum axis, PGM_P const msg) { + void _lcd_babystep(const AxisEnum axis, FSTR_P const fmsg) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); if (ui.encoderPosition) { const int16_t steps = int16_t(ui.encoderPosition) * ( @@ -66,7 +66,7 @@ } if (ui.should_draw()) { const float mps = planner.mm_per_step[axis]; - MenuEditItemBase::draw_edit_screen(msg, BABYSTEP_TO_STR(mps * babystep.accum)); + MenuEditItemBase::draw_edit_screen(fmsg, BABYSTEP_TO_STR(mps * babystep.accum)); #if ENABLED(BABYSTEP_DISPLAY_TOTAL) const bool in_view = TERN1(HAS_MARLINUI_U8GLIB, PAGE_CONTAINS(LCD_PIXEL_HEIGHT - MENU_FONT_HEIGHT, LCD_PIXEL_HEIGHT - 1)); if (in_view) { @@ -94,12 +94,12 @@ } #if ENABLED(BABYSTEP_XY) - void _lcd_babystep_x() { _lcd_babystep(X_AXIS, GET_TEXT(MSG_BABYSTEP_X)); } - void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, GET_TEXT(MSG_BABYSTEP_Y)); } + void _lcd_babystep_x() { _lcd_babystep(X_AXIS, GET_TEXT_F(MSG_BABYSTEP_X)); } + void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, GET_TEXT_F(MSG_BABYSTEP_Y)); } #endif #if DISABLED(BABYSTEP_ZPROBE_OFFSET) - void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, GET_TEXT(MSG_BABYSTEP_Z)); } + void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, GET_TEXT_F(MSG_BABYSTEP_Z)); } void lcd_babystep_z() { _lcd_babystep_go(_lcd_babystep_z); } #endif diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index df60eaa6f5ae..297325348d23 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -67,7 +67,7 @@ inline float rounded_mesh_value() { * - Draw the graphical overlay, if enabled. * - Update the 'refresh' state according to the display type */ -void _lcd_mesh_fine_tune(PGM_P const msg) { +void _lcd_mesh_fine_tune(FSTR_P const fmsg) { constexpr float mesh_edit_step = 1.0f / 200.0f; ui.defer_status_screen(); if (bedlevel.encoder_diff) { @@ -82,7 +82,7 @@ void _lcd_mesh_fine_tune(PGM_P const msg) { if (ui.should_draw()) { const float rounded_f = rounded_mesh_value(); - MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(rounded_f)); + MenuEditItemBase::draw_edit_screen(fmsg, ftostr43sign(rounded_f)); TERN_(MESH_EDIT_GFX_OVERLAY, ui.zoffset_overlay(rounded_f)); TERN_(HAS_GRAPHICAL_TFT, ui.refresh(LCDVIEW_NONE)); } @@ -95,7 +95,7 @@ void _lcd_mesh_fine_tune(PGM_P const msg) { void MarlinUI::ubl_mesh_edit_start(const_float_t initial) { TERN_(HAS_GRAPHICAL_TFT, clear_lcd()); mesh_edit_accumulator = initial; - goto_screen([]{ _lcd_mesh_fine_tune(GET_TEXT(MSG_MESH_EDIT_Z)); }); + goto_screen([]{ _lcd_mesh_fine_tune(GET_TEXT_F(MSG_MESH_EDIT_Z)); }); } // @@ -176,8 +176,8 @@ void _menu_ubl_height_adjust() { void _lcd_ubl_edit_mesh() { START_MENU(); BACK_ITEM(MSG_UBL_TOOLS); - GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, PSTR("G29P4RT")); - GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29P4T")); + GCODES_ITEM(MSG_UBL_FINE_TUNE_ALL, F("G29P4RT")); + GCODES_ITEM(MSG_UBL_FINE_TUNE_CLOSEST, F("G29P4T")); SUBMENU(MSG_UBL_MESH_HEIGHT_ADJUST, _menu_ubl_height_adjust); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); @@ -211,10 +211,10 @@ void _lcd_ubl_edit_mesh() { #if HAS_PREHEAT #if HAS_HEATED_BED #define VALIDATE_MESH_GCODE_ITEM(M) \ - GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPI" STRINGIFY(M))); + GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPI" STRINGIFY(M))); #else #define VALIDATE_MESH_GCODE_ITEM(M) \ - GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPB0I" STRINGIFY(M))); + GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPB0I" STRINGIFY(M))); #endif REPEAT(PREHEAT_COUNT, VALIDATE_MESH_GCODE_ITEM) #endif @@ -255,7 +255,7 @@ void _lcd_ubl_grid_level() { void _lcd_ubl_mesh_leveling() { START_MENU(); BACK_ITEM(MSG_UBL_TOOLS); - GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29J0")); + GCODES_ITEM(MSG_UBL_3POINT_MESH_LEVELING, F("G29J0")); SUBMENU(MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); @@ -284,8 +284,8 @@ void _menu_ubl_fillin() { START_MENU(); BACK_ITEM(MSG_UBL_BUILD_MESH_MENU); EDIT_ITEM(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd); - GCODES_ITEM(MSG_UBL_SMART_FILLIN, PSTR("G29P3T0")); - GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, PSTR("G29P2BT0")); + GCODES_ITEM(MSG_UBL_SMART_FILLIN, F("G29P3T0")); + GCODES_ITEM(MSG_UBL_MANUAL_FILLIN, F("G29P2BT0")); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); } @@ -318,7 +318,7 @@ void _lcd_ubl_build_mesh() { #define PREHEAT_BED_GCODE(M) "" #endif #define BUILD_MESH_GCODE_ITEM(M) GCODES_ITEM_S(ui.get_preheat_label(M), MSG_UBL_BUILD_MESH_M, \ - PSTR( \ + F( \ "G28\n" \ PREHEAT_BED_GCODE(M) \ "M109I" STRINGIFY(M) "\n" \ @@ -342,11 +342,11 @@ void _lcd_ubl_build_mesh() { #endif // HAS_PREHEAT SUBMENU(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh); - GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, PSTR("G29NP1")); + GCODES_ITEM(MSG_UBL_BUILD_COLD_MESH, F("G29NP1")); SUBMENU(MSG_UBL_FILLIN_MESH, _menu_ubl_fillin); - GCODES_ITEM(MSG_UBL_CONTINUE_MESH, PSTR("G29P1C")); + GCODES_ITEM(MSG_UBL_CONTINUE_MESH, F("G29P1C")); ACTION_ITEM(MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate); - GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29I")); + GCODES_ITEM(MSG_UBL_INVALIDATE_CLOSEST, F("G29I")); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU(); } @@ -354,14 +354,14 @@ void _lcd_ubl_build_mesh() { /** * UBL Load / Save Mesh Commands */ -inline void _lcd_ubl_load_save_cmd(const char loadsave, PGM_P const msg) { +inline void _lcd_ubl_load_save_cmd(const char loadsave, FSTR_P const fmsg) { char ubl_lcd_gcode[40]; sprintf_P(ubl_lcd_gcode, PSTR("G29%c%i\nM117 "), loadsave, ubl_storage_slot); - sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], msg, ubl_storage_slot); + sprintf_P(&ubl_lcd_gcode[strlen(ubl_lcd_gcode)], FTOP(fmsg), ubl_storage_slot); gcode.process_subcommands_now(ubl_lcd_gcode); } -void _lcd_ubl_load_mesh_cmd() { _lcd_ubl_load_save_cmd('L', GET_TEXT(MSG_MESH_LOADED)); } -void _lcd_ubl_save_mesh_cmd() { _lcd_ubl_load_save_cmd('S', GET_TEXT(MSG_MESH_SAVED)); } +void _lcd_ubl_load_mesh_cmd() { _lcd_ubl_load_save_cmd('L', GET_TEXT_F(MSG_MESH_LOADED)); } +void _lcd_ubl_save_mesh_cmd() { _lcd_ubl_load_save_cmd('S', GET_TEXT_F(MSG_MESH_SAVED)); } /** * UBL Mesh Storage submenu @@ -531,9 +531,9 @@ void _ubl_goto_map_screen() { void _lcd_ubl_output_map() { START_MENU(); BACK_ITEM(MSG_UBL_LEVEL_BED); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29T0")); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29T1")); - GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29S-1")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_HOST, F("G29T0")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_CSV, F("G29T1")); + GCODES_ITEM(MSG_UBL_OUTPUT_MAP_BACKUP, F("G29S-1")); END_MENU(); } @@ -550,7 +550,7 @@ void _menu_ubl_tools() { START_MENU(); BACK_ITEM(MSG_UBL_LEVEL_BED); SUBMENU(MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); - GCODES_ITEM(MSG_UBL_MANUAL_MESH, PSTR("G29I999\nG29P2BT0")); + GCODES_ITEM(MSG_UBL_MANUAL_MESH, F("G29I999\nG29P2BT0")); #if ENABLED(G26_MESH_VALIDATION) SUBMENU(MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); #endif @@ -576,12 +576,12 @@ void _menu_ubl_tools() { void _lcd_ubl_step_by_step() { START_MENU(); BACK_ITEM(MSG_UBL_LEVEL_BED); - GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, PSTR("G29NP1")); - GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, PSTR("G29P3T0")); + GCODES_ITEM(MSG_UBL_1_BUILD_COLD_MESH, F("G29NP1")); + GCODES_ITEM(MSG_UBL_2_SMART_FILLIN, F("G29P3T0")); SUBMENU(MSG_UBL_3_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, PSTR("G29P4RT")); + GCODES_ITEM(MSG_UBL_4_FINE_TUNE_ALL, F("G29P4RT")); SUBMENU(MSG_UBL_5_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, PSTR("G29P4RT")); + GCODES_ITEM(MSG_UBL_6_FINE_TUNE_ALL, F("G29P4RT")); ACTION_ITEM(MSG_UBL_7_SAVE_MESH, _lcd_ubl_save_mesh_cmd); END_MENU(); } @@ -650,9 +650,9 @@ void _lcd_ubl_level_bed() { START_MENU(); BACK_ITEM(MSG_MOTION); if (planner.leveling_active) - GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, PSTR("G29D")); + GCODES_ITEM(MSG_UBL_DEACTIVATE_MESH, F("G29D")); else - GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, PSTR("G29A")); + GCODES_ITEM(MSG_UBL_ACTIVATE_MESH, F("G29A")); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) editable.decimal = planner.z_fade_height; EDIT_ITEM_FAST(float3, MSG_Z_FADE_HEIGHT, &editable.decimal, 0, 100, []{ set_z_fade_height(editable.decimal); }); @@ -667,7 +667,7 @@ void _lcd_ubl_level_bed() { SUBMENU(MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); SUBMENU(MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); SUBMENU(MSG_UBL_TOOLS, _menu_ubl_tools); - GCODES_ITEM(MSG_UBL_INFO_UBL, PSTR("G29W")); + GCODES_ITEM(MSG_UBL_INFO_UBL, F("G29W")); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_x_twist.cpp b/Marlin/src/lcd/menu/menu_x_twist.cpp index ce46053dfc34..eba22cca620c 100644 --- a/Marlin/src/lcd/menu/menu_x_twist.cpp +++ b/Marlin/src/lcd/menu/menu_x_twist.cpp @@ -51,7 +51,7 @@ void xatc_wizard_done() { ui.goto_screen(menu_advanced_settings); } if (ui.should_draw()) - MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_XATC_DONE)); + MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT_F(MSG_XATC_DONE)); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); } @@ -62,14 +62,14 @@ void xatc_wizard_goto_next_point(); // void xatc_wizard_update_z_offset() { MenuItem_confirm::select_screen( - GET_TEXT(MSG_YES), GET_TEXT(MSG_NO) + GET_TEXT_F(MSG_YES), GET_TEXT_F(MSG_NO) , []{ probe.offset.z = z_offset; ui.goto_screen(xatc_wizard_done); } , xatc_wizard_done - , GET_TEXT(MSG_XATC_UPDATE_Z_OFFSET) - , ftostr42_52(z_offset), PSTR("?") + , GET_TEXT_F(MSG_XATC_UPDATE_Z_OFFSET) + , ftostr42_52(z_offset), F("?") ); } @@ -93,7 +93,7 @@ void xatc_wizard_menu() { if (LCD_HEIGHT >= 4) STATIC_ITEM(MSG_MOVE_NOZZLE_TO_BED, SS_CENTER|SS_INVERT); - STATIC_ITEM_P(PSTR("Z="), SS_CENTER, ftostr42_52(current_position.z)); + STATIC_ITEM_F(F("Z="), SS_CENTER, ftostr42_52(current_position.z)); STATIC_ITEM(MSG_ZPROBE_ZOFFSET, SS_LEFT, ftostr42_52(calculated_z_offset)); SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); }); @@ -106,12 +106,12 @@ void xatc_wizard_menu() { !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); #if DISABLED(HAS_GRAPHICAL_TFT) - SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); + SUBMENU_F(FPSTR(NUL_STR), []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); #else - SUBMENU_P(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); + SUBMENU_F(FPSTR(tmp), []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); #endif } @@ -127,7 +127,7 @@ void xatc_wizard_moving() { if (ui.should_draw()) { char msg[10]; sprintf_P(msg, PSTR("%i / %u"), manual_probe_index + 1, XATC_MAX_POINTS); - MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), msg); } ui.refresh(LCDVIEW_CALL_NO_REDRAW); if (!ui.wait_for_move) ui.goto_screen(xatc_wizard_menu); @@ -180,7 +180,7 @@ void xatc_wizard_goto_next_point() { // void xatc_wizard_homing_done() { if (ui.should_draw()) { - MenuItem_static::draw(1, GET_TEXT(MSG_LEVEL_BED_WAITING)); + MenuItem_static::draw(1, GET_TEXT_F(MSG_LEVEL_BED_WAITING)); // Color UI needs a control to detect a touch #if BOTH(TOUCH_SCREEN, HAS_GRAPHICAL_TFT) diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp index d5ccfe323a1a..7dca9c589d60 100644 --- a/Marlin/src/lcd/tft/tft_string.cpp +++ b/Marlin/src/lcd/tft/tft_string.cpp @@ -89,13 +89,13 @@ uint8_t read_byte(uint8_t *byte) { return *byte; } /** * Add a string, applying substitutions for the following characters: * - * $ displays an inserted C-string given by the itemString parameter + * $ displays an inserted C-string given by the inStr parameter * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) * @ displays an axis name such as XYZUVW, or E for an extruder */ -void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString/*=nullptr*/) { +void TFT_String::add(uint8_t *string, int8_t index, uint8_t *inStr/*=nullptr*/) { wchar_t wchar; while (*string) { @@ -113,8 +113,8 @@ void TFT_String::add(uint8_t *string, int8_t index, uint8_t *itemString/*=nullpt else add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED)); } - else if (ch == '$' && itemString) - add(itemString); + else if (ch == '$' && inStr) + add(inStr); else if (ch == '@') add_character(axis_codes[index]); else diff --git a/Marlin/src/lcd/tft/tft_string.h b/Marlin/src/lcd/tft/tft_string.h index e486c2ee91c8..7fd87bdf5277 100644 --- a/Marlin/src/lcd/tft/tft_string.h +++ b/Marlin/src/lcd/tft/tft_string.h @@ -86,13 +86,19 @@ class TFT_String { static void set(); static void add(uint8_t character) { add_character(character); eol(); } static void add(uint8_t *string, uint8_t max_len=MAX_STRING_LENGTH); - static void add(uint8_t *string, int8_t index, uint8_t *itemString=nullptr); + static void add(uint8_t *string, int8_t index, uint8_t *inStr=nullptr); static void set(uint8_t *string) { set(); add(string); }; - static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); }; + static void set(uint8_t *string, int8_t index, const char *inStr=nullptr) { set(); add(string, index, (uint8_t *)inStr); }; static void set(const char *string) { set((uint8_t *)string); } - static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } + static void set(const char *string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)string, index, inStr); } static void add(const char *string) { add((uint8_t *)string); } + static void add(FSTR_P const string, uint8_t max_len=MAX_STRING_LENGTH) { add((uint8_t *)FTOP(string), max_len); } + static void add(FSTR_P const string, int8_t index, uint8_t *inStr=nullptr) { add((uint8_t *)FTOP(string), index, inStr); } + static void set(FSTR_P const string) { set((uint8_t *)FTOP(string)); } + static void set(FSTR_P const string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)FTOP(string), index, inStr); } + static void add(FSTR_P const string) { add((uint8_t *)FTOP(string)); } + static void trim(uint8_t character=0x20); static void rtrim(uint8_t character=0x20); static void ltrim(uint8_t character=0x20); diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 57cd6e724e26..a152907a9dde 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -189,26 +189,26 @@ void Touch::touch(touch_control_t *control) { #if HAS_HOTEND if (heater >= 0) { // HotEnd #if HOTENDS == 1 - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_NOZZLE), &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); }); + MenuItem_int3::action(GET_TEXT_F(MSG_NOZZLE), &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); }); #else MenuItemBase::itemIndex = heater; - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_NOZZLE_N), &thermalManager.temp_hotend[heater].target, 0, thermalManager.hotend_max_target(heater), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }); + MenuItem_int3::action(GET_TEXT_F(MSG_NOZZLE_N), &thermalManager.temp_hotend[heater].target, 0, thermalManager.hotend_max_target(heater), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); }); #endif } #endif #if HAS_HEATED_BED else if (heater == H_BED) { - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_BED), &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed); + MenuItem_int3::action(GET_TEXT_F(MSG_BED), &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed); } #endif #if HAS_HEATED_CHAMBER else if (heater == H_CHAMBER) { - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_CHAMBER), &thermalManager.temp_chamber.target, 0, CHAMBER_MAX_TARGET, thermalManager.start_watching_chamber); + MenuItem_int3::action(GET_TEXT_F(MSG_CHAMBER), &thermalManager.temp_chamber.target, 0, CHAMBER_MAX_TARGET, thermalManager.start_watching_chamber); } #endif #if HAS_COOLER else if (heater == H_COOLER) { - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_COOLER), &thermalManager.temp_cooler.target, 0, COOLER_MAX_TARGET, thermalManager.start_watching_cooler); + MenuItem_int3::action(GET_TEXT_F(MSG_COOLER), &thermalManager.temp_cooler.target, 0, COOLER_MAX_TARGET, thermalManager.start_watching_cooler); } #endif @@ -218,19 +218,19 @@ void Touch::touch(touch_control_t *control) { static uint8_t fan, fan_speed; fan = 0; fan_speed = thermalManager.fan_speed[fan]; - MenuItem_percent::action((const char *)GET_TEXT_F(MSG_FIRST_FAN_SPEED), &fan_speed, 0, 255, []{ thermalManager.set_fan_speed(fan, fan_speed); }); + MenuItem_percent::action(GET_TEXT_F(MSG_FIRST_FAN_SPEED), &fan_speed, 0, 255, []{ thermalManager.set_fan_speed(fan, fan_speed); }); break; case FEEDRATE: ui.clear_lcd(); - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_SPEED), &feedrate_percentage, 10, 999); + MenuItem_int3::action(GET_TEXT_F(MSG_SPEED), &feedrate_percentage, 10, 999); break; case FLOWRATE: ui.clear_lcd(); MenuItemBase::itemIndex = control->data; #if EXTRUDERS == 1 - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_FLOW), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); + MenuItem_int3::action(GET_TEXT_F(MSG_FLOW), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); #else - MenuItem_int3::action((const char *)GET_TEXT_F(MSG_FLOW_N), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); + MenuItem_int3::action(GET_TEXT_F(MSG_FLOW_N), &planner.flow_percentage[MenuItemBase::itemIndex], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); #endif break; diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 3fbb26b69ddf..e8ba4737a80f 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -105,12 +105,12 @@ void MarlinUI::draw_kill_screen() { line++; menu_line(line++, COLOR_KILL_SCREEN_BG); - tft_string.set(GET_TEXT(MSG_HALTED)); + tft_string.set(GET_TEXT_F(MSG_HALTED)); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string); menu_line(line++, COLOR_KILL_SCREEN_BG); - tft_string.set(GET_TEXT(MSG_PLEASE_RESET)); + tft_string.set(GET_TEXT_F(MSG_PLEASE_RESET)); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_MENU_TEXT, tft_string); @@ -352,14 +352,14 @@ void MarlinUI::draw_status_screen() { } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace -void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { +void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); TERN_(TOUCH_SCREEN, touch.clear()); uint16_t line = 1; menu_line(line++); - tft_string.set(pstr, itemIndex, itemString); + tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString)); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -421,7 +421,7 @@ void TFT::draw_edit_screen_buttons() { } // The Select Screen presents a prompt and two "buttons" -void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { +void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { uint16_t line = 1; if (!string) line++; @@ -473,7 +473,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const #endif menu_line(row); - tft_string.set(GET_TEXT(MSG_FILAMENT_CHANGE_NOZZLE)); + tft_string.set(GET_TEXT_F(MSG_FILAMENT_CHANGE_NOZZLE)); tft_string.add('E'); tft_string.add((char)('1' + extruder)); tft_string.add(' '); @@ -693,18 +693,18 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { drawAxisValue(axis); } else { - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } #elif HAS_BED_PROBE // only change probe.offset.z probe.offset.z += diff; if (direction < 0 && current_position[axis] < Z_PROBE_OFFSET_RANGE_MIN) { current_position[axis] = Z_PROBE_OFFSET_RANGE_MIN; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } else if (direction > 0 && current_position[axis] > Z_PROBE_OFFSET_RANGE_MAX) { current_position[axis] = Z_PROBE_OFFSET_RANGE_MAX; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } else { drawMessage(""); // clear the error @@ -733,7 +733,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { #if IS_KINEMATIC UNUSED(limited); #else - PGM_P const msg = limited ? GET_TEXT(MSG_LCD_SOFT_ENDSTOPS) : NUL_STR; + FSTR_P const msg = limited ? GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS) : FPSTR(NUL_STR); drawMessage(msg); #endif @@ -766,7 +766,7 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } static void do_home() { quick_feedback(); - drawMessage(GET_TEXT(MSG_LEVEL_BED_HOMING)); + drawMessage(GET_TEXT_F(MSG_LEVEL_BED_HOMING)); queue.inject_P(G28_STR); // Disable touch until home is done TERN_(TOUCH_SCREEN, touch.disable()); diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index b1a781fad10a..148d5d3964c1 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -347,14 +347,14 @@ void MarlinUI::draw_status_screen() { } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace -void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { +void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); TERN_(TOUCH_SCREEN, touch.clear()); uint16_t line = 1; menu_line(line++); - tft_string.set(pstr, itemIndex, itemString); + tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString)); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -416,7 +416,7 @@ void TFT::draw_edit_screen_buttons() { } // The Select Screen presents a prompt and two "buttons" -void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { +void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { uint16_t line = 1; if (!string) line++; @@ -621,7 +621,7 @@ static void drawCurESelection() { tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection)); } -static void drawMessage(const char *msg) { +static void drawMessage(PGM_P const msg) { tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 29, (TFT_WIDTH / 2) - (BTN_WIDTH / 2) - X_MARGIN, 20); tft.set_background(COLOR_BACKGROUND); tft.add_text(0, 0, COLOR_YELLOW, msg); @@ -652,7 +652,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage("Too cold"); + drawMessage(PSTR("Too cold")); return; } #endif @@ -675,7 +675,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { probe.offset.z = new_offs; else TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP); - drawMessage(""); // clear the error + drawMessage(NUL_STR); // clear the error drawAxisValue(axis); } else { @@ -693,7 +693,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); } else { - drawMessage(""); // clear the error + drawMessage(NUL_STR); // clear the error } drawAxisValue(axis); #endif diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 6f7327f1e8a2..34502df54026 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -352,14 +352,14 @@ void MarlinUI::draw_status_screen() { } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace -void MenuEditItemBase::draw_edit_screen(PGM_P const pstr, const char * const value/*=nullptr*/) { +void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); TERN_(TOUCH_SCREEN, touch.clear()); uint16_t line = 1; menu_line(line++); - tft_string.set(pstr, itemIndex, itemString); + tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString)); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -421,7 +421,7 @@ void TFT::draw_edit_screen_buttons() { } // The Select Screen presents a prompt and two "buttons" -void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { +void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { uint16_t line = 1; if (!string) line++; @@ -622,7 +622,7 @@ static void drawCurESelection() { tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection)); } -static void drawMessage(const char *msg) { +static void drawMessage(PGM_P const msg) { tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 34, TFT_HEIGHT / 2, 34); tft.set_background(COLOR_BACKGROUND); tft.add_text(0, 0, COLOR_YELLOW, msg); @@ -653,7 +653,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage("Too cold"); + drawMessage(PSTR("Too cold")); return; } #endif @@ -676,7 +676,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { probe.offset.z = new_offs; else TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP); - drawMessage(""); // clear the error + drawMessage(NUL_STR); // clear the error drawAxisValue(axis); } else { @@ -694,7 +694,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); } else { - drawMessage(""); // clear the error + drawMessage(NUL_STR); // clear the error } drawAxisValue(axis); #endif diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index acc91f51fa83..023ff59ca6d6 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -130,10 +130,10 @@ void lcd_put_int(const int i) { // // Draw a generic menu item with pre_char (if selected) and post_char -void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) { +void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) { menu_item(row, sel); - uint8_t *string = (uint8_t *)pstr; + uint8_t *string = (uint8_t *)FTOP(fstr); MarlinImage image = noImage; switch (*string) { case 0x01: image = imgRefresh; break; // LCD_STR_REFRESH @@ -147,15 +147,15 @@ void MenuItemBase::_draw(const bool sel, const uint8_t row, PGM_P const pstr, co tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, image, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); } - tft_string.set(string, itemIndex, itemString); + tft_string.set(string, itemIndex, FTOP(itemString)); tft.add_text(offset, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); } // Draw a menu item with a (potentially) editable value -void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, const char * const data, const bool pgm) { +void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const data, const bool pgm) { menu_item(row, sel); - tft_string.set(pstr, itemIndex, itemString); + tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString)); tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); if (data) { tft_string.set(data); @@ -164,16 +164,16 @@ void MenuEditItemBase::draw(const bool sel, const uint8_t row, PGM_P const pstr, } // Draw a static item with no left-right margin required. Centered by default. -void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { +void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { menu_item(row); - tft_string.set(pstr, itemIndex, itemString); + tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString)); if (vstr) tft_string.add(vstr); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string); } #if ENABLED(SDSUPPORT) - void MenuItem_sdbase::draw(const bool sel, const uint8_t row, PGM_P const, CardReader &theCard, const bool isDir) { + void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { menu_item(row, sel); if (isDir) tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, imgDirectory, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); constexpr uint8_t maxlen = (MENU_ITEM_HEIGHT) - (MENU_TEXT_Y_OFFSET) + 1; From 74596ad4d7f9117e06829b5657d7402f27a445ce Mon Sep 17 00:00:00 2001 From: Robby Candra Date: Mon, 23 May 2022 09:13:17 +0700 Subject: [PATCH 350/502] =?UTF-8?q?=F0=9F=A9=B9=20Adjust=20manage=5Fmedia?= =?UTF-8?q?=20for=20slow/late=20media=20init=20(USB=20FD)=20(#24015)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/sd/cardreader.cpp | 38 ++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index ec5f1a970913..0aa06e47c9f4 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -472,29 +472,32 @@ void CardReader::mount() { #endif void CardReader::manage_media() { - static uint8_t prev_stat = 2; // First call, no prior state + static uint8_t prev_stat = 2; // At boot we don't know if media is present or not uint8_t stat = uint8_t(IS_SD_INSERTED()); - if (stat == prev_stat) return; + if (stat == prev_stat) return; // Already checked and still no change? - DEBUG_SECTION(mm, "CardReader::manage_media", true); - DEBUG_ECHOLNPGM("SD Status ", prev_stat, " -> ", stat); - - flag.workDirIsRoot = true; // Return to root on mount/release + DEBUG_SECTION(cmm, "CardReader::manage_media()", true); + DEBUG_ECHOLNPGM("Media present: ", prev_stat, " -> ", stat); if (!ui.detected()) { DEBUG_ECHOLNPGM("SD: No UI Detected."); return; } - uint8_t old_stat = prev_stat; - prev_stat = stat; // Change now to prevent re-entry + flag.workDirIsRoot = true; // Return to root on mount/release/init + + const uint8_t old_stat = prev_stat; + prev_stat = stat; // Change now to prevent re-entry in safe_delay if (stat) { // Media Inserted safe_delay(500); // Some boards need a delay to get settled // Try to mount the media (only later with SD_IGNORE_AT_STARTUP) if (TERN1(SD_IGNORE_AT_STARTUP, old_stat != 2)) mount(); - if (!isMounted()) stat = 0; // Not mounted? + if (!isMounted()) { // Not mounted? + stat = 0; + IF_DISABLED(SD_IGNORE_AT_STARTUP, prev_stat = 0); + } TERN_(RESET_STEPPERS_ON_MEDIA_INSERT, reset_stepper_drivers()); // Workaround for Cheetah bug } @@ -504,16 +507,25 @@ void CardReader::manage_media() { #endif } - ui.media_changed(old_stat, stat); // Update the UI + ui.media_changed(old_stat, stat); // Update the UI or flag an error if (!stat) return; // Exit if no media is present - TERN_(SDCARD_EEPROM_EMULATION, settings.first_load()); - - if (old_stat != 2) return; // First mount? + static bool did_first_insert = false; + if (did_first_insert) return; // Did a media insert already happen? + did_first_insert = true; // Definitely handling this media insert... DEBUG_ECHOLNPGM("First mount."); + // Load settings the first time media is inserted (not just during init) + TERN_(SDCARD_EEPROM_EMULATION, settings.first_load()); + + #if HAS_USB_FLASH_DRIVE + const millis_t ms = millis(); + DEBUG_ECHOLNPGM("USB mount waiting time = ", ms); + if (ms > 5000) return; // Too late to be considered "already inserted"? + #endif + bool do_auto = true; UNUSED(do_auto); // Check for PLR file. From 6fc4dbbbc4b3b1e6820f4f18b81602451bb1786c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 28 May 2022 17:05:09 -0500 Subject: [PATCH 351/502] =?UTF-8?q?=F0=9F=9A=B8=20Change=20M201=20G=20to?= =?UTF-8?q?=20S?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/config/M200-M205.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 77cd5f7855ab..08b50b968029 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -108,12 +108,21 @@ #endif // !NO_VOLUMETRICS /** - * M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) + * M201: Set max acceleration in units/s^2 for print moves. * - * With multiple extruders use T to specify which one. + * X : Max Acceleration for X + * Y : Max Acceleration for Y + * Z : Max Acceleration for Z + * ... : etc + * E : Max Acceleration for Extruder + * T : Extruder index to set + * + * With XY_FREQUENCY_LIMIT: + * F : Frequency limit for XY...IJKUVW + * S : Speed factor percentage. */ void GcodeSuite::M201() { - if (!parser.seen("T" LOGICAL_AXES_STRING)) + if (!parser.seen("T" LOGICAL_AXES_STRING TERN_(XY_FREQUENCY_LIMIT, "FS"))) return M201_report(); const int8_t target_extruder = get_target_extruder_from_command(); @@ -121,7 +130,7 @@ void GcodeSuite::M201() { #ifdef XY_FREQUENCY_LIMIT if (parser.seenval('F')) planner.set_frequency_limit(parser.value_byte()); - if (parser.seenval('G')) planner.xy_freq_min_speed_factor = constrain(parser.value_float(), 1, 100) / 100; + if (parser.seenval('S')) planner.xy_freq_min_speed_factor = constrain(parser.value_float(), 1, 100) / 100; #endif LOOP_LOGICAL_AXES(i) { From 9799907dc9a53810e87fd5b54e2194d30e70eff8 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 31 May 2022 14:28:01 -0700 Subject: [PATCH 352/502] =?UTF-8?q?=F0=9F=91=94=20Configs=20required=20to?= =?UTF-8?q?=20submit=20a=20Bug=20Report=20(#24256)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yml | 29 +++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index af4f25db776d..d4dc730a5744 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -50,6 +50,8 @@ body: Describe the bug in this section. Tell us what you were trying to do and what happened that you did not expect. Provide a clear and concise description of the problem and include as many details as possible. + + When pasting formatted text don't forget to put ` ``` ` (on its own line) before and after to make it readable. placeholder: | Marlin doesn't work. validations: @@ -147,23 +149,20 @@ body: - Same as my slicer - Other (explain below) - - type: markdown + - type: checkboxes attributes: - value: >- - ## Other things to include - - Please also be sure to include these items to help with troubleshooting: - - * **A ZIP file** containing your `Configuration.h` and `Configuration_adv.h`. - (Please don't paste lengthy configuration text here.) - * **Log output** from the host. (`M111 S247` for maximum logging.) - * **Images or videos** demonstrating the problem, if it helps to make it clear. - * **A G-Code file** that exposes the problem, if not affecting _all_ G-code. - - If you've made any other modifications to the firmware, please describe them in detail in the space provided. - - When pasting formatted text into the box below don't forget to put ` ``` ` (on its own line) before and after to make it readable. + label: Other things to include + options: + - label: A ZIP file containing your `Configuration.h` and `Configuration_adv.h`. + required: true + - label: Log output from the host. (`M111 S247` for maximum logging.) + - label: Images or videos demonstrating the problem, if it helps to make it clear. + - label: A G-Code file that exposes the problem, if not affecting _all_ G-code. - type: textarea attributes: label: Additional information & file uploads + description: >- + If you've made any other modifications to the firmware, please describe them in detail. + + When pasting formatted text don't forget to put ` ``` ` (on its own line) before and after to make it readable. From fc1a620b878b45675b9a7972be6c1fb2882b8092 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Sat, 28 May 2022 23:40:08 +0100 Subject: [PATCH 353/502] =?UTF-8?q?=F0=9F=9A=A9=20MPC=20update=20(#24253)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 6 +++--- Marlin/src/gcode/temp/M306.cpp | 8 ++++++-- Marlin/src/module/settings.cpp | 3 +++ Marlin/src/module/temperature.cpp | 6 +++--- Marlin/src/module/temperature.h | 11 ++++++----- buildroot/tests/BIGTREE_GTR_V1_0 | 3 ++- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index a3c762a72eb2..96bfc59428fa 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -646,15 +646,15 @@ //#define MPC_FAN_0_ACTIVE_HOTEND #endif - #define FILAMENT_HEAT_CAPACITY_PERMM 5.6e-3f // 0.0056 J/K/mm for 1.75mm PLA (0.0149 J/K/mm for 2.85mm PLA). - //#define FILAMENT_HEAT_CAPACITY_PERMM 3.6e-3f // 0.0036 J/K/mm for 1.75mm PETG (0.0094 J/K/mm for 2.85mm PETG). + #define FILAMENT_HEAT_CAPACITY_PERMM { 5.6e-3f } // 0.0056 J/K/mm for 1.75mm PLA (0.0149 J/K/mm for 2.85mm PLA). + //#define FILAMENT_HEAT_CAPACITY_PERMM { 3.6e-3f } // 0.0036 J/K/mm for 1.75mm PETG (0.0094 J/K/mm for 2.85mm PETG). // Advanced options #define MPC_SMOOTHING_FACTOR 0.5f // (0.0...1.0) Noisy temperature sensors may need a lower value for stabilization. #define MPC_MIN_AMBIENT_CHANGE 1.0f // (K/s) Modeled ambient temperature rate of change, when correcting model inaccuracies. #define MPC_STEADYSTATE 0.5f // (K/s) Temperature change rate for steady state logic to be enforced. - #define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center just above the surface. + #define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center at first layer height. #define MPC_TUNING_END_Z 10.0f // (mm) M306 Autotuning final Z position. #endif diff --git a/Marlin/src/gcode/temp/M306.cpp b/Marlin/src/gcode/temp/M306.cpp index 0f286e73b236..4286b2017e22 100644 --- a/Marlin/src/gcode/temp/M306.cpp +++ b/Marlin/src/gcode/temp/M306.cpp @@ -36,6 +36,7 @@ * C Block heat capacity. * E Extruder number to set. (Default: E0) * F Ambient heat transfer coefficient (fan on full). + * H Filament heat capacity per mm. * P Heater power. * R Sensor responsiveness (= transfer coefficient / heat capcity). */ @@ -43,7 +44,7 @@ void GcodeSuite::M306() { if (parser.seen_test('T')) { thermalManager.MPC_autotune(); return; } - if (parser.seen("ACFPR")) { + if (parser.seen("ACFPRH")) { const heater_id_t hid = (heater_id_t)parser.intval('E', 0); MPC_t &constants = thermalManager.temp_hotend[hid].constants; if (parser.seenval('P')) constants.heater_power = parser.value_float(); @@ -53,6 +54,7 @@ void GcodeSuite::M306() { #if ENABLED(MPC_INCLUDE_FAN) if (parser.seenval('F')) constants.fan255_adjustment = parser.value_float() - constants.ambient_xfer_coeff_fan0; #endif + if (parser.seenval('H')) constants.filament_heat_capacity_permm = parser.value_float(); return; } @@ -70,8 +72,10 @@ void GcodeSuite::M306_report(const bool forReplay/*=true*/) { SERIAL_ECHOPAIR_F(" R", constants.sensor_responsiveness, 4); SERIAL_ECHOPAIR_F(" A", constants.ambient_xfer_coeff_fan0, 4); #if ENABLED(MPC_INCLUDE_FAN) - SERIAL_ECHOLNPAIR_F(" F", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); + SERIAL_ECHOPAIR_F(" F", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); #endif + SERIAL_ECHOPAIR_F(" M", constants.filament_heat_capacity_permm, 4); + SERIAL_EOL(); } } diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index bde60098abcd..dd360e9cd8a0 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -3266,6 +3266,7 @@ void MarlinSettings::reset() { #if ENABLED(MPC_INCLUDE_FAN) constexpr float _mpc_ambient_xfer_coeff_fan255[] = MPC_AMBIENT_XFER_COEFF_FAN255; #endif + constexpr float _filament_heat_capacity_permm[] = FILAMENT_HEAT_CAPACITY_PERMM; static_assert(COUNT(_mpc_heater_power) == HOTENDS, "MPC_HEATER_POWER must have HOTENDS items."); static_assert(COUNT(_mpc_block_heat_capacity) == HOTENDS, "MPC_BLOCK_HEAT_CAPACITY must have HOTENDS items."); @@ -3274,6 +3275,7 @@ void MarlinSettings::reset() { #if ENABLED(MPC_INCLUDE_FAN) static_assert(COUNT(_mpc_ambient_xfer_coeff_fan255) == HOTENDS, "MPC_AMBIENT_XFER_COEFF_FAN255 must have HOTENDS items."); #endif + static_assert(COUNT(_filament_heat_capacity_permm) == HOTENDS, "FILAMENT_HEAT_CAPACITY_PERMM must have HOTENDS items."); HOTEND_LOOP() { thermalManager.temp_hotend[e].constants.heater_power = _mpc_heater_power[e]; @@ -3283,6 +3285,7 @@ void MarlinSettings::reset() { #if ENABLED(MPC_INCLUDE_FAN) thermalManager.temp_hotend[e].constants.fan255_adjustment = _mpc_ambient_xfer_coeff_fan255[e] - _mpc_ambient_xfer_coeff[e]; #endif + thermalManager.temp_hotend[e].constants.filament_heat_capacity_permm = _filament_heat_capacity_permm[e]; } #endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index ce84b5923369..f65de00f61ef 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -998,7 +998,7 @@ volatile bool Temperature::raw_temps_ready = false; float asymp_temp = (t2 * t2 - t1 * t3) / (2 * t2 - t1 - t3), block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); - constants.ambient_xfer_coeff_fan0 = constants.heater_power * MPC_MAX / 255 / (asymp_temp - ambient_temp); + constants.ambient_xfer_coeff_fan0 = constants.heater_power * (MPC_MAX) / 255 / (asymp_temp - ambient_temp); constants.fan255_adjustment = 0.0f; constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness; constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); @@ -1062,7 +1062,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif // Calculate a new and better asymptotic temperature and re-evaluate the other constants - asymp_temp = ambient_temp + constants.heater_power / constants.ambient_xfer_coeff_fan0; + asymp_temp = ambient_temp + constants.heater_power * (MPC_MAX) / 255 / constants.ambient_xfer_coeff_fan0; block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness; constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); @@ -1446,7 +1446,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { if (fabs(e_speed) > planner.settings.max_feedrate_mm_s[E_AXIS]) mpc_e_position = e_position; else if (e_speed > 0.0f) { // Ignore retract/recover moves - ambient_xfer_coeff += e_speed * FILAMENT_HEAT_CAPACITY_PERMM; + ambient_xfer_coeff += e_speed * constants.filament_heat_capacity_permm; mpc_e_position = e_position; } } diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index a9980f4890e4..9dc41129b28c 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -96,13 +96,14 @@ hotend_pid_t; #if ENABLED(MPCTEMP) typedef struct { - float heater_power; // M306 P - float block_heat_capacity; // M306 C - float sensor_responsiveness; // M306 R - float ambient_xfer_coeff_fan0; // M306 A + float heater_power; // M306 P + float block_heat_capacity; // M306 C + float sensor_responsiveness; // M306 R + float ambient_xfer_coeff_fan0; // M306 A #if ENABLED(MPC_INCLUDE_FAN) - float fan255_adjustment; // M306 F + float fan255_adjustment; // M306 F #endif + float filament_heat_capacity_permm; // M306 M } MPC_t; #endif diff --git a/buildroot/tests/BIGTREE_GTR_V1_0 b/buildroot/tests/BIGTREE_GTR_V1_0 index 93342ed4a472..13ec7ca3a2f7 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0 +++ b/buildroot/tests/BIGTREE_GTR_V1_0 @@ -37,7 +37,8 @@ opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \ MPC_BLOCK_HEAT_CAPACITY '{ 16.7f, 16.7f, 16.7f }' \ MPC_SENSOR_RESPONSIVENESS '{ 0.22f, 0.22f, 0.22f }' \ MPC_AMBIENT_XFER_COEFF '{ 0.068f, 0.068f, 0.068f }' \ - MPC_AMBIENT_XFER_COEFF_FAN255 '{ 0.097f, 0.097f, 0.097f }' + MPC_AMBIENT_XFER_COEFF_FAN255 '{ 0.097f, 0.097f, 0.097f }' \ + FILAMENT_HEAT_CAPACITY_PERMM '{ 5.6e-3f, 3.6e-3f, 5.6e-3f }' opt_enable SWITCHING_TOOLHEAD TOOL_SENSOR MPCTEMP MPC_EDIT_MENU MPC_AUTOTUNE_MENU opt_disable PIDTEMP exec_test $1 $2 "BigTreeTech GTR | MPC | Switching Toolhead | Tool Sensors" "$3" From 8b8b2a7ed35908b6a49d5b3badb230d3283792bb Mon Sep 17 00:00:00 2001 From: ledzepman71 Date: Thu, 2 Jun 2022 02:49:48 -0600 Subject: [PATCH 354/502] =?UTF-8?q?=F0=9F=93=8C=20Tenlog=20PSU=20pin=20(#2?= =?UTF-8?q?4266)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h index b884fcbfc7c1..977be79191b8 100644 --- a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h +++ b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h @@ -148,6 +148,7 @@ // // Misc. Functions // +//#define PS_ON_PIN 40 // The M80/M81 PSU pin for boards v2.1-2.3 //#define CASE_LIGHT_PIN 5 #define SDSS 53 //#ifndef LED_PIN From 11d68e31274fccd20c8bb72eec0b4ad547962823 Mon Sep 17 00:00:00 2001 From: bryan065 <30362590+bryan065@users.noreply.github.com> Date: Thu, 2 Jun 2022 04:51:39 -0400 Subject: [PATCH 355/502] =?UTF-8?q?=F0=9F=9A=B8=20Custom=20Menu=20Items=20?= =?UTF-8?q?for=20JyersUI=20(#24270)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 167 ++++++++++++++++++++++++++- Marlin/src/lcd/e3v2/jyersui/dwin.h | 3 +- 2 files changed, 168 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 9fed9fee83d9..f8ba1090d91b 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -121,6 +121,26 @@ #define MIN_BED_TEMP 0 #endif +/** + * Custom menu items with jyersLCD + */ +#if ENABLED(CUSTOM_MENU_CONFIG) + #ifdef CONFIG_MENU_ITEM_5_DESC + #define CUSTOM_MENU_COUNT 5 + #elif defined(CONFIG_MENU_ITEM_4_DESC) + #define CUSTOM_MENU_COUNT 4 + #elif defined(CONFIG_MENU_ITEM_3_DESC) + #define CUSTOM_MENU_COUNT 3 + #elif defined(CONFIG_MENU_ITEM_2_DESC) + #define CUSTOM_MENU_COUNT 2 + #elif defined(CONFIG_MENU_ITEM_1_DESC) + #define CUSTOM_MENU_COUNT 1 + #endif + #if CUSTOM_MENU_COUNT + #define HAS_CUSTOM_MENU 1 + #endif +#endif + constexpr uint16_t TROWS = 6, MROWS = TROWS - 1, TITLE_HEIGHT = 30, MLINE = 53, @@ -1078,7 +1098,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #define PREPARE_PREHEAT (PREPARE_ZOFFSET + ENABLED(HAS_PREHEAT)) #define PREPARE_COOLDOWN (PREPARE_PREHEAT + EITHER(HAS_HOTEND, HAS_HEATED_BED)) #define PREPARE_CHANGEFIL (PREPARE_COOLDOWN + ENABLED(ADVANCED_PAUSE_FEATURE)) - #define PREPARE_TOTAL PREPARE_CHANGEFIL + #define PREPARE_CUSTOM_MENU (PREPARE_CHANGEFIL + ENABLED(HAS_CUSTOM_MENU)) + #define PREPARE_TOTAL PREPARE_CUSTOM_MENU switch (item) { case PREPARE_BACK: @@ -1153,6 +1174,18 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; #endif + #if HAS_CUSTOM_MENU + case PREPARE_CUSTOM_MENU: + #ifndef CUSTOM_MENU_CONFIG_TITLE + #define CUSTOM_MENU_CONFIG_TITLE "Custom Commands" + #endif + if (draw) + Draw_Menu_Item(row, ICON_Version, F(CUSTOM_MENU_CONFIG_TITLE)); + else + Draw_Menu(MenuCustom); + break; + #endif + #if ENABLED(ADVANCED_PAUSE_FEATURE) case PREPARE_CHANGEFIL: if (draw) { @@ -1750,6 +1783,126 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; #endif // FILAMENT_LOAD_UNLOAD_GCODES + #if HAS_CUSTOM_MENU + + case MenuCustom: + + #define CUSTOM_MENU_BACK 0 + #define CUSTOM_MENU_1 1 + #define CUSTOM_MENU_2 2 + #define CUSTOM_MENU_3 3 + #define CUSTOM_MENU_4 4 + #define CUSTOM_MENU_5 5 + #define CUSTOM_MENU_TOTAL CUSTOM_MENU_COUNT + + switch (item) { + case CUSTOM_MENU_BACK: + if (draw) + Draw_Menu_Item(row, ICON_Back, F("Back")); + else + Draw_Menu(Prepare, PREPARE_CUSTOM_MENU); + break; + + #if CUSTOM_MENU_COUNT >= 1 + case CUSTOM_MENU_1: + if (draw) + Draw_Menu_Item(row, ICON_Info, F(CONFIG_MENU_ITEM_1_DESC)); + else { + Popup_Handler(Custom); + //queue.inject(F(CONFIG_MENU_ITEM_1_GCODE)); // Old code + gcode.process_subcommands_now(F(CONFIG_MENU_ITEM_1_GCODE)); + planner.synchronize(); + Redraw_Menu(); + #if ENABLED(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK) + AudioFeedback(); + #endif + #ifdef CUSTOM_MENU_CONFIG_SCRIPT_RETURN + queue.inject(F(CUSTOM_MENU_CONFIG_SCRIPT_DONE)); + #endif + } + break; + #endif + + #if CUSTOM_MENU_COUNT >= 2 + case CUSTOM_MENU_2: + if (draw) + Draw_Menu_Item(row, ICON_Info, F(CONFIG_MENU_ITEM_2_DESC)); + else { + Popup_Handler(Custom); + gcode.process_subcommands_now(F(CONFIG_MENU_ITEM_2_GCODE)); + planner.synchronize(); + Redraw_Menu(); + #if ENABLED(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK) + AudioFeedback(); + #endif + #ifdef CUSTOM_MENU_CONFIG_SCRIPT_RETURN + queue.inject(F(CUSTOM_MENU_CONFIG_SCRIPT_DONE)); + #endif + } + break; + #endif + + #if CUSTOM_MENU_COUNT >= 3 + case CUSTOM_MENU_3: + if (draw) + Draw_Menu_Item(row, ICON_Info, F(CONFIG_MENU_ITEM_3_DESC)); + else { + Popup_Handler(Custom); + gcode.process_subcommands_now(F(CONFIG_MENU_ITEM_3_GCODE)); + planner.synchronize(); + Redraw_Menu(); + #if ENABLED(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK) + AudioFeedback(); + #endif + #ifdef CUSTOM_MENU_CONFIG_SCRIPT_RETURN + queue.inject(F(CUSTOM_MENU_CONFIG_SCRIPT_DONE)); + #endif + } + break; + #endif + + #if CUSTOM_MENU_COUNT >= 4 + case CUSTOM_MENU_4: + if (draw) + Draw_Menu_Item(row, ICON_Info, F(CONFIG_MENU_ITEM_4_DESC)); + else { + Popup_Handler(Custom); + gcode.process_subcommands_now(F(CONFIG_MENU_ITEM_4_GCODE)); + planner.synchronize(); + Redraw_Menu(); + #if ENABLED(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK) + AudioFeedback(); + #endif + #ifdef CUSTOM_MENU_CONFIG_SCRIPT_RETURN + queue.inject(F(CUSTOM_MENU_CONFIG_SCRIPT_DONE)); + #endif + } + break; + #endif + + #if CUSTOM_MENU_COUNT >= 5 + case CUSTOM_MENU_5: + if (draw) + Draw_Menu_Item(row, ICON_Info, F(CONFIG_MENU_ITEM_5_DESC)); + else { + Popup_Handler(Custom); + gcode.process_subcommands_now(F(CONFIG_MENU_ITEM_5_GCODE)); + planner.synchronize(); + Redraw_Menu(); + #if ENABLED(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK) + AudioFeedback(); + #endif + #ifdef CUSTOM_MENU_CONFIG_SCRIPT_RETURN + queue.inject(F(CUSTOM_MENU_CONFIG_SCRIPT_DONE)); + #endif + } + break; + #endif // Custom Menu + } + break; + + #endif // HAS_CUSTOM_MENU + case Control: #define CONTROL_BACK 0 @@ -3688,6 +3841,14 @@ FSTR_P CrealityDWINClass::Get_Menu_Title(uint8_t menu) { #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) case ChangeFilament: return F("Change Filament"); #endif + #if HAS_CUSTOM_MENU + case MenuCustom: + #ifdef CUSTOM_MENU_CONFIG_TITLE + return F(CUSTOM_MENU_CONFIG_TITLE); + #else + return F("Custom Commands"); + #endif + #endif case Control: return F("Control"); case TempMenu: return F("Temperature"); #if HAS_HOTEND || HAS_HEATED_BED @@ -3753,6 +3914,9 @@ uint8_t CrealityDWINClass::Get_Menu_Size(uint8_t menu) { #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) case ChangeFilament: return CHANGEFIL_TOTAL; #endif + #if HAS_CUSTOM_MENU + case MenuCustom: return CUSTOM_MENU_TOTAL; + #endif case Control: return CONTROL_TOTAL; case TempMenu: return TEMP_TOTAL; #if HAS_HOTEND || HAS_HEATED_BED @@ -3831,6 +3995,7 @@ void CrealityDWINClass::Popup_Handler(PopupID popupid, bool option/*=false*/) { case Runout: Draw_Popup(F("Filament Runout"), F(""), F(""), Wait, ICON_BLTouch); break; case PIDWait: Draw_Popup(F("PID Autotune"), F("in process"), F("Please wait until done."), Wait, ICON_BLTouch); break; case Resuming: Draw_Popup(F("Resuming Print"), F("Please wait until done."), F(""), Wait, ICON_BLTouch); break; + case Custom: Draw_Popup(F("Running Custom GCode"), F("Please wait until done."), F(""), Wait, ICON_BLTouch); break; default: break; } } diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.h b/Marlin/src/lcd/e3v2/jyersui/dwin.h index d238d8e24ffa..8985647cd131 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.h +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.h @@ -43,7 +43,7 @@ enum processID : uint8_t { enum PopupID : uint8_t { Pause, Stop, Resume, SaveLevel, ETemp, ConfFilChange, PurgeMore, MeshSlot, Level, Home, MoveWait, Heating, FilLoad, FilChange, TempWarn, Runout, PIDWait, Resuming, ManualProbing, - FilInsert, HeaterTime, UserInput, LevelError, InvalidMesh, UI, Complete + FilInsert, HeaterTime, UserInput, LevelError, InvalidMesh, UI, Complete, Custom }; enum menuID : uint8_t { @@ -55,6 +55,7 @@ enum menuID : uint8_t { ZOffset, Preheat, ChangeFilament, + MenuCustom, Control, TempMenu, PID, From e784e0413204680f3c8f3a8cdf519fb5bee7a164 Mon Sep 17 00:00:00 2001 From: BIGTREETECH <38851044+bigtreetech@users.noreply.github.com> Date: Thu, 2 Jun 2022 17:02:06 +0800 Subject: [PATCH 356/502] =?UTF-8?q?=E2=9C=A8=20BigTreeTech=20SKR3=20-=20ST?= =?UTF-8?q?M32H743=20(#24271,=20#24272,=20#24275)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Alan.Ma --- Marlin/src/HAL/STM32/sdio.cpp | 378 +++++------- Marlin/src/core/boards.h | 2 + Marlin/src/pins/pins.h | 4 + Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0.h | 26 + .../src/pins/stm32h7/pins_BTT_SKR_V3_0_EZ.h | 26 + .../pins/stm32h7/pins_BTT_SKR_V3_0_common.h | 569 ++++++++++++++++++ .../PlatformIO/boards/marlin_STM32H743Vx.json | 61 ++ .../variants/MARLIN_H743Vx/PeripheralPins.c | 539 +++++++++++++++++ .../variants/MARLIN_H743Vx/PinNamesVar.h | 112 ++++ .../variants/MARLIN_H743Vx/ldscript.ld | 208 +++++++ .../variant_MARLIN_STM32H743VX.cpp | 245 ++++++++ .../variant_MARLIN_STM32H743VX.h | 268 +++++++++ ini/stm32h7.ini | 21 + 13 files changed, 2244 insertions(+), 215 deletions(-) create mode 100644 Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0.h create mode 100644 Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_EZ.h create mode 100644 Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h create mode 100644 buildroot/share/PlatformIO/boards/marlin_STM32H743Vx.json create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PeripheralPins.c create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PinNamesVar.h create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.cpp create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.h diff --git a/Marlin/src/HAL/STM32/sdio.cpp b/Marlin/src/HAL/STM32/sdio.cpp index b26ec768e8cd..e958d8c3bc48 100644 --- a/Marlin/src/HAL/STM32/sdio.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -35,42 +35,15 @@ // use local drivers #if defined(STM32F103xE) || defined(STM32F103xG) - #include - #include + #include #elif defined(STM32F4xx) - #include - #include - #include - #include + #include #elif defined(STM32F7xx) - #include - #include - #include - #include + #include +#elif defined(STM32H7xx) + #include #else - #error "SDIO only supported with STM32F103xE, STM32F103xG, STM32F4xx, or STM32F7xx." -#endif - -SD_HandleTypeDef hsd; // create SDIO structure -// F4 supports one DMA for RX and another for TX, but Marlin will never -// do read and write at same time, so we use the same DMA for both. -DMA_HandleTypeDef hdma_sdio; - -/* - SDIO_INIT_CLK_DIV is 118 - SDIO clock frequency is 48MHz / (TRANSFER_CLOCK_DIV + 2) - SDIO init clock frequency should not exceed 400kHz = 48MHz / (118 + 2) - - Default TRANSFER_CLOCK_DIV is 2 (118 / 40) - Default SDIO clock frequency is 48MHz / (2 + 2) = 12 MHz - This might be too fast for stable SDIO operations - - MKS Robin board seems to have stable SDIO with BusWide 1bit and ClockDiv 8 i.e. 4.8MHz SDIO clock frequency - Additional testing is required as there are clearly some 4bit initialization problems -*/ - -#ifndef USBD_OK - #define USBD_OK 0 + #error "SDIO only supported with STM32F103xE, STM32F103xG, STM32F4xx, STM32F7xx, or STM32H7xx." #endif // Target Clock, configurable. Default is 18MHz, from STM32F1 @@ -78,223 +51,209 @@ DMA_HandleTypeDef hdma_sdio; #define SDIO_CLOCK 18000000 // 18 MHz #endif -// SDIO retries, configurable. Default is 3, from STM32F1 -#ifndef SDIO_READ_RETRIES - #define SDIO_READ_RETRIES 3 -#endif +#define SD_TIMEOUT 1000 // ms // SDIO Max Clock (naming from STM Manual, don't change) #define SDIOCLK 48000000 -static uint32_t clock_to_divider(uint32_t clk) { - // limit the SDIO master clock to 8/3 of PCLK2. See STM32 Manuals - // Also limited to no more than 48Mhz (SDIOCLK). - const uint32_t pclk2 = HAL_RCC_GetPCLK2Freq(); - clk = min(clk, (uint32_t)(pclk2 * 8 / 3)); - clk = min(clk, (uint32_t)SDIOCLK); - // Round up divider, so we don't run the card over the speed supported, - // and subtract by 2, because STM32 will add 2, as written in the manual: - // SDIO_CK frequency = SDIOCLK / [CLKDIV + 2] - return pclk2 / clk + (pclk2 % clk != 0) - 2; -} - -void go_to_transfer_speed() { - /* Default SDIO peripheral configuration for SD card initialization */ - hsd.Init.ClockEdge = hsd.Init.ClockEdge; - hsd.Init.ClockBypass = hsd.Init.ClockBypass; - hsd.Init.ClockPowerSave = hsd.Init.ClockPowerSave; - hsd.Init.BusWide = hsd.Init.BusWide; - hsd.Init.HardwareFlowControl = hsd.Init.HardwareFlowControl; - hsd.Init.ClockDiv = clock_to_divider(SDIO_CLOCK); - - /* Initialize SDIO peripheral interface with default configuration */ - SDIO_Init(hsd.Instance, hsd.Init); -} - -void SD_LowLevel_Init(void) { - uint32_t tempreg; +#if defined(STM32F1xx) + DMA_HandleTypeDef hdma_sdio; + extern "C" void DMA2_Channel4_5_IRQHandler(void) { + HAL_DMA_IRQHandler(&hdma_sdio); + } +#elif defined(STM32F4xx) + DMA_HandleTypeDef hdma_sdio_rx; + DMA_HandleTypeDef hdma_sdio_tx; + extern "C" void DMA2_Stream3_IRQHandler(void) { + HAL_DMA_IRQHandler(&hdma_sdio_rx); + } - __HAL_RCC_GPIOC_CLK_ENABLE(); //enable GPIO clocks - __HAL_RCC_GPIOD_CLK_ENABLE(); //enable GPIO clocks + extern "C" void DMA2_Stream6_IRQHandler(void) { + HAL_DMA_IRQHandler(&hdma_sdio_tx); + } +#elif defined(STM32H7xx) + #define __HAL_RCC_SDIO_FORCE_RESET __HAL_RCC_SDMMC1_FORCE_RESET + #define __HAL_RCC_SDIO_RELEASE_RESET __HAL_RCC_SDMMC1_RELEASE_RESET + #define __HAL_RCC_SDIO_CLK_ENABLE __HAL_RCC_SDMMC1_CLK_ENABLE + #define SDIO SDMMC1 + #define SDIO_IRQn SDMMC1_IRQn + #define SDIO_IRQHandler SDMMC1_IRQHandler + #define SDIO_CLOCK_EDGE_RISING SDMMC_CLOCK_EDGE_RISING + #define SDIO_CLOCK_POWER_SAVE_DISABLE SDMMC_CLOCK_POWER_SAVE_DISABLE + #define SDIO_BUS_WIDE_1B SDMMC_BUS_WIDE_1B + #define SDIO_BUS_WIDE_4B SDMMC_BUS_WIDE_4B + #define SDIO_HARDWARE_FLOW_CONTROL_DISABLE SDMMC_HARDWARE_FLOW_CONTROL_DISABLE +#endif - GPIO_InitTypeDef GPIO_InitStruct; +uint8_t waitingRxCplt = 0; +uint8_t waitingTxCplt = 0; +SD_HandleTypeDef hsd; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = 1; //GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; +extern "C" void SDIO_IRQHandler(void) { + HAL_SD_IRQHandler(&hsd); +} - #if DISABLED(STM32F1xx) - GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; - #endif +void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsdio) { + waitingTxCplt = 0; +} - GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_12; // D0 & SCK - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); +void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsdio) { + waitingRxCplt = 0; +} +void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { + pinmap_pinout(PC_12, PinMap_SD); + pinmap_pinout(PD_2, PinMap_SD); + pinmap_pinout(PC_8, PinMap_SD); #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // define D1-D3 only if have a four bit wide SDIO bus - GPIO_InitStruct.Pin = GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11; // D1-D3 - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + // D1-D3 + pinmap_pinout(PC_9, PinMap_SD); + pinmap_pinout(PC_10, PinMap_SD); + pinmap_pinout(PC_11, PinMap_SD); #endif - // Configure PD.02 CMD line - GPIO_InitStruct.Pin = GPIO_PIN_2; - HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + __HAL_RCC_SDIO_CLK_ENABLE(); + HAL_NVIC_EnableIRQ(SDIO_IRQn); - // Setup DMA + // DMA Config #if defined(STM32F1xx) - hdma_sdio.Init.Mode = DMA_NORMAL; - hdma_sdio.Instance = DMA2_Channel4; + __HAL_RCC_DMA2_CLK_ENABLE(); HAL_NVIC_EnableIRQ(DMA2_Channel4_5_IRQn); + hdma_sdio.Instance = DMA2_Channel4; + hdma_sdio.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_sdio.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_sdio.Init.MemInc = DMA_MINC_ENABLE; + hdma_sdio.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; + hdma_sdio.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; + hdma_sdio.Init.Mode = DMA_NORMAL; + hdma_sdio.Init.Priority = DMA_PRIORITY_LOW; + HAL_DMA_Init(&hdma_sdio); + + __HAL_LINKDMA(hsd, hdmarx ,hdma_sdio); + __HAL_LINKDMA(hsd, hdmatx, hdma_sdio); #elif defined(STM32F4xx) - hdma_sdio.Init.Mode = DMA_PFCTRL; - hdma_sdio.Instance = DMA2_Stream3; - hdma_sdio.Init.Channel = DMA_CHANNEL_4; - hdma_sdio.Init.FIFOMode = DMA_FIFOMODE_ENABLE; - hdma_sdio.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; - hdma_sdio.Init.MemBurst = DMA_MBURST_INC4; - hdma_sdio.Init.PeriphBurst = DMA_PBURST_INC4; + __HAL_RCC_DMA2_CLK_ENABLE(); HAL_NVIC_EnableIRQ(DMA2_Stream3_IRQn); + HAL_NVIC_EnableIRQ(DMA2_Stream6_IRQn); + hdma_sdio_rx.Instance = DMA2_Stream3; + hdma_sdio_rx.Init.Channel = DMA_CHANNEL_4; + hdma_sdio_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_sdio_rx.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_sdio_rx.Init.MemInc = DMA_MINC_ENABLE; + hdma_sdio_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; + hdma_sdio_rx.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; + hdma_sdio_rx.Init.Mode = DMA_PFCTRL; + hdma_sdio_rx.Init.Priority = DMA_PRIORITY_LOW; + hdma_sdio_rx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; + hdma_sdio_rx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; + hdma_sdio_rx.Init.MemBurst = DMA_MBURST_INC4; + hdma_sdio_rx.Init.PeriphBurst = DMA_PBURST_INC4; + HAL_DMA_Init(&hdma_sdio_rx); + + __HAL_LINKDMA(hsd,hdmarx,hdma_sdio_rx); + + hdma_sdio_tx.Instance = DMA2_Stream6; + hdma_sdio_tx.Init.Channel = DMA_CHANNEL_4; + hdma_sdio_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; + hdma_sdio_tx.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_sdio_tx.Init.MemInc = DMA_MINC_ENABLE; + hdma_sdio_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; + hdma_sdio_tx.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; + hdma_sdio_tx.Init.Mode = DMA_PFCTRL; + hdma_sdio_tx.Init.Priority = DMA_PRIORITY_LOW; + hdma_sdio_tx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; + hdma_sdio_tx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; + hdma_sdio_tx.Init.MemBurst = DMA_MBURST_INC4; + hdma_sdio_tx.Init.PeriphBurst = DMA_PBURST_INC4; + HAL_DMA_Init(&hdma_sdio_tx); + + __HAL_LINKDMA(hsd,hdmatx,hdma_sdio_tx); #endif - HAL_NVIC_EnableIRQ(SDIO_IRQn); - hdma_sdio.Init.PeriphInc = DMA_PINC_DISABLE; - hdma_sdio.Init.MemInc = DMA_MINC_ENABLE; - hdma_sdio.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; - hdma_sdio.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; - hdma_sdio.Init.Priority = DMA_PRIORITY_LOW; - __HAL_LINKDMA(&hsd, hdmarx, hdma_sdio); - __HAL_LINKDMA(&hsd, hdmatx, hdma_sdio); +} - #if defined(STM32F1xx) - __HAL_RCC_SDIO_CLK_ENABLE(); - __HAL_RCC_DMA2_CLK_ENABLE(); - #else +void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd) { + #if !defined(STM32F1xx) __HAL_RCC_SDIO_FORCE_RESET(); - delay(2); + delay(10); __HAL_RCC_SDIO_RELEASE_RESET(); - delay(2); - __HAL_RCC_SDIO_CLK_ENABLE(); - - __HAL_RCC_DMA2_FORCE_RESET(); - delay(2); - __HAL_RCC_DMA2_RELEASE_RESET(); - delay(2); - __HAL_RCC_DMA2_CLK_ENABLE(); + delay(10); #endif - - //Initialize the SDIO (with initial <400Khz Clock) - tempreg = 0; //Reset value - tempreg |= SDIO_CLKCR_CLKEN; // Clock enabled - tempreg |= SDIO_INIT_CLK_DIV; // Clock Divider. Clock = 48000 / (118 + 2) = 400Khz - // Keep the rest at 0 => HW_Flow Disabled, Rising Clock Edge, Disable CLK ByPass, Bus Width = 0, Power save Disable - SDIO->CLKCR = tempreg; - - // Power up the SDIO - SDIO_PowerState_ON(SDIO); - hsd.Instance = SDIO; } -void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { // application specific init - UNUSED(hsd); // Prevent unused argument(s) compilation warning - __HAL_RCC_SDIO_CLK_ENABLE(); // turn on SDIO clock +static uint32_t clock_to_divider(uint32_t clk) { + #if defined(STM32H7xx) + // SDMMC_CK frequency = sdmmc_ker_ck / [2 * CLKDIV]. + uint32_t sdmmc_clk = HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SDMMC); + return sdmmc_clk / (2U * SDIO_CLOCK) + (sdmmc_clk % (2U * SDIO_CLOCK) != 0); + #else + // limit the SDIO master clock to 8/3 of PCLK2. See STM32 Manuals + // Also limited to no more than 48Mhz (SDIOCLK). + const uint32_t pclk2 = HAL_RCC_GetPCLK2Freq(); + clk = min(clk, (uint32_t)(pclk2 * 8 / 3)); + clk = min(clk, (uint32_t)SDIOCLK); + // Round up divider, so we don't run the card over the speed supported, + // and subtract by 2, because STM32 will add 2, as written in the manual: + // SDIO_CK frequency = SDIOCLK / [CLKDIV + 2] + return pclk2 / clk + (pclk2 % clk != 0) - 2; + #endif } bool SDIO_Init() { - uint8_t retryCnt = SDIO_READ_RETRIES; + HAL_StatusTypeDef sd_state = HAL_OK; + if (hsd.Instance == SDIO) + HAL_SD_DeInit(&hsd); - bool status; + /* HAL SD initialization */ hsd.Instance = SDIO; - hsd.State = HAL_SD_STATE_RESET; - - SD_LowLevel_Init(); - - uint8_t retry_Cnt = retryCnt; - for (;;) { - hal.watchdog_refresh(); - status = (bool) HAL_SD_Init(&hsd); - if (!status) break; - if (!--retry_Cnt) return false; // return failing status if retries are exhausted - } - - go_to_transfer_speed(); - - #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined - retry_Cnt = retryCnt; - for (;;) { - hal.watchdog_refresh(); - if (!HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B)) break; // some cards are only 1 bit wide so a pass here is not required - if (!--retry_Cnt) break; - } - if (!retry_Cnt) { // wide bus failed, go back to one bit wide mode - hsd.State = (HAL_SD_StateTypeDef) 0; // HAL_SD_STATE_RESET - SD_LowLevel_Init(); - retry_Cnt = retryCnt; - for (;;) { - hal.watchdog_refresh(); - status = (bool) HAL_SD_Init(&hsd); - if (!status) break; - if (!--retry_Cnt) return false; // return failing status if retries are exhausted - } - go_to_transfer_speed(); + hsd.Init.ClockEdge = SDIO_CLOCK_EDGE_RISING; + hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_DISABLE; + hsd.Init.BusWide = SDIO_BUS_WIDE_1B; + hsd.Init.HardwareFlowControl = SDIO_HARDWARE_FLOW_CONTROL_DISABLE; + hsd.Init.ClockDiv = clock_to_divider(SDIO_CLOCK); + sd_state = HAL_SD_Init(&hsd); + + #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) + if (sd_state == HAL_OK) { + sd_state = HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B); } #endif - return true; + return (sd_state == HAL_OK) ? true : false; } -static bool SDIO_ReadWriteBlock_DMA(uint32_t block, const uint8_t *src, uint8_t *dst) { - if (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) return false; - - hal.watchdog_refresh(); +bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { + uint32_t timeout = HAL_GetTick() + SD_TIMEOUT; - HAL_StatusTypeDef ret; - if (src) { - hdma_sdio.Init.Direction = DMA_MEMORY_TO_PERIPH; - HAL_DMA_Init(&hdma_sdio); - ret = HAL_SD_WriteBlocks_DMA(&hsd, (uint8_t *)src, block, 1); - } - else { - hdma_sdio.Init.Direction = DMA_PERIPH_TO_MEMORY; - HAL_DMA_Init(&hdma_sdio); - ret = HAL_SD_ReadBlocks_DMA(&hsd, (uint8_t *)dst, block, 1); + while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) { + if (HAL_GetTick() >= timeout) return false; } - if (ret != HAL_OK) { - HAL_DMA_Abort_IT(&hdma_sdio); - HAL_DMA_DeInit(&hdma_sdio); + waitingRxCplt = 1; + if (HAL_SD_ReadBlocks_DMA(&hsd, (uint8_t *)dst, block, 1) != HAL_OK) return false; - } - millis_t timeout = millis() + 500; - // Wait the transfer - while (hsd.State != HAL_SD_STATE_READY) { - if (ELAPSED(millis(), timeout)) { - HAL_DMA_Abort_IT(&hdma_sdio); - HAL_DMA_DeInit(&hdma_sdio); - return false; - } - } + timeout = HAL_GetTick() + SD_TIMEOUT; + while (waitingRxCplt) + if (HAL_GetTick() >= timeout) return false; - while (__HAL_DMA_GET_FLAG(&hdma_sdio, __HAL_DMA_GET_TC_FLAG_INDEX(&hdma_sdio)) != 0 - || __HAL_DMA_GET_FLAG(&hdma_sdio, __HAL_DMA_GET_TE_FLAG_INDEX(&hdma_sdio)) != 0) { /* nada */ } + return true; +} - HAL_DMA_Abort_IT(&hdma_sdio); - HAL_DMA_DeInit(&hdma_sdio); +bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { + uint32_t timeout = HAL_GetTick() + SD_TIMEOUT; - timeout = millis() + 500; - while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) if (ELAPSED(millis(), timeout)) return false; + while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) + if (HAL_GetTick() >= timeout) return false; - return true; -} + waitingTxCplt = 1; + if (HAL_SD_WriteBlocks_DMA(&hsd, (uint8_t *)src, block, 1) != HAL_OK) + return false; -bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { - uint8_t retries = SDIO_READ_RETRIES; - while (retries--) if (SDIO_ReadWriteBlock_DMA(block, nullptr, dst)) return true; - return false; -} + timeout = HAL_GetTick() + SD_TIMEOUT; + while (waitingTxCplt) + if (HAL_GetTick() >= timeout) return false; -bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { - uint8_t retries = SDIO_READ_RETRIES; - while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true; - return false; + return true; } bool SDIO_IsReady() { @@ -305,16 +264,5 @@ uint32_t SDIO_GetCardSize() { return (uint32_t)(hsd.SdCard.BlockNbr) * (hsd.SdCard.BlockSize); } -#if defined(STM32F1xx) - #define DMA_IRQ_HANDLER DMA2_Channel4_5_IRQHandler -#elif defined(STM32F4xx) - #define DMA_IRQ_HANDLER DMA2_Stream3_IRQHandler -#else - #error "Unknown STM32 architecture." -#endif - -extern "C" void SDIO_IRQHandler(void) { HAL_SD_IRQHandler(&hsd); } -extern "C" void DMA_IRQ_HANDLER(void) { HAL_DMA_IRQHandler(&hdma_sdio); } - #endif // SDIO_SUPPORT #endif // HAL_STM32 diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 20ec0298d528..5b0210d9e4ff 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -429,6 +429,8 @@ #define BOARD_T41U5XBB 5002 // T41U5XBB Teensy 4.1 breakout board #define BOARD_NUCLEO_F767ZI 5003 // ST NUCLEO-F767ZI Dev Board #define BOARD_BTT_SKR_SE_BX 5004 // BigTreeTech SKR SE BX (STM32H743II) +#define BOARD_BTT_SKR_V3_0 5005 // BigTreeTech SKR V3.0 (STM32H743VG) +#define BOARD_BTT_SKR_V3_0_EZ 5006 // BigTreeTech SKR V3.0 EZ (STM32H743VG) // // Espressif ESP32 WiFi diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index da2075911433..3ea3c6b48d3c 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -708,6 +708,10 @@ #include "stm32f7/pins_NUCLEO_F767ZI.h" // STM32F7 env:NUCLEO_F767ZI #elif MB(BTT_SKR_SE_BX) #include "stm32h7/pins_BTT_SKR_SE_BX.h" // STM32H7 env:BTT_SKR_SE_BX +#elif MB(BTT_SKR_V3_0) + #include "stm32h7/pins_BTT_SKR_V3_0.h" // STM32H7 env:STM32H743Vx_btt +#elif MB(BTT_SKR_V3_0_EZ) + #include "stm32h7/pins_BTT_SKR_V3_0_EZ.h" // STM32H7 env:STM32H743Vx_btt #elif MB(TEENSY41) #include "teensy4/pins_TEENSY41.h" // Teensy-4.x env:teensy41 #elif MB(T41U5XBB) diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0.h new file mode 100644 index 000000000000..d83548608585 --- /dev/null +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0.h @@ -0,0 +1,26 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#define BOARD_INFO_NAME "BTT SKR V3" + +#include "pins_BTT_SKR_V3_0_common.h" diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_EZ.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_EZ.h new file mode 100644 index 000000000000..003f20f5cf6e --- /dev/null +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_EZ.h @@ -0,0 +1,26 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#define BOARD_INFO_NAME "BTT SKR V3 EZ" + +#include "pins_BTT_SKR_V3_0_common.h" diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h new file mode 100644 index 000000000000..02e195a1852e --- /dev/null +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h @@ -0,0 +1,569 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if NOT_TARGET(STM32H7) + #error "Oops! Select an STM32H7 board in 'Tools > Board.'" +#endif + +// If you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION +// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT +//#define BTT_MOTOR_EXPANSION + +#if BOTH(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION) + #if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) + #define EXP_MOT_USE_EXP2_ONLY 1 + #else + #error "You can't use both an LCD and a Motor Expansion Module on EXP1/EXP2 at the same time." + #endif +#endif + +#define USES_DIAG_JUMPERS + +// Onboard I2C EEPROM +#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) + #undef NO_EEPROM_SELECTED + #define I2C_EEPROM + #define SOFT_I2C_EEPROM // Force the use of Software I2C + #define I2C_SCL_PIN PA14 + #define I2C_SDA_PIN PA13 + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB +#endif + +// +// Servos +// +#define SERVO0_PIN PE5 + +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN PC1 // X-STOP +#define Y_DIAG_PIN PC3 // Y-STOP +#define Z_DIAG_PIN PC0 // Z-STOP +#define E0_DIAG_PIN PC2 // E0DET +#define E1_DIAG_PIN PA0 // E1DET + +// +// Limit Switches +// +#ifdef X_STALL_SENSITIVITY + #define X_STOP_PIN X_DIAG_PIN + #if X_HOME_TO_MIN + #define X_MAX_PIN PC2 // E0DET + #else + #define X_MIN_PIN PC2 // E0DET + #endif +#elif ENABLED(X_DUAL_ENDSTOPS) + #ifndef X_MIN_PIN + #define X_MIN_PIN PC1 // X-STOP + #endif + #ifndef X_MAX_PIN + #define X_MAX_PIN PC2 // E0DET + #endif +#else + #define X_STOP_PIN PC1 // X-STOP +#endif + +#ifdef Y_STALL_SENSITIVITY + #define Y_STOP_PIN Y_DIAG_PIN + #if Y_HOME_TO_MIN + #define Y_MAX_PIN PA0 // E1DET + #else + #define Y_MIN_PIN PA0 // E1DET + #endif +#elif ENABLED(Y_DUAL_ENDSTOPS) + #ifndef Y_MIN_PIN + #define Y_MIN_PIN PC3 // Y-STOP + #endif + #ifndef Y_MAX_PIN + #define Y_MAX_PIN PA0 // E1DET + #endif +#else + #define Y_STOP_PIN PC3 // Y-STOP +#endif + +#ifdef Z_STALL_SENSITIVITY + #define Z_STOP_PIN Z_DIAG_PIN + #if Z_HOME_TO_MIN + #define Z_MAX_PIN PC15 // PWRDET + #else + #define Z_MIN_PIN PC15 // PWRDET + #endif +#elif ENABLED(Z_MULTI_ENDSTOPS) + #ifndef Z_MIN_PIN + #define Z_MIN_PIN PC0 // Z-STOP + #endif + #ifndef Z_MAX_PIN + #define Z_MAX_PIN PC15 // PWRDET + #endif +#else + #ifndef Z_STOP_PIN + #define Z_STOP_PIN PC0 // Z-STOP + #endif +#endif + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PC13 +#endif + +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) + #ifndef PROBE_ENABLE_PIN + #define PROBE_ENABLE_PIN SERVO0_PIN + #endif +#endif + +// +// Filament Runout Sensor +// +#define FIL_RUNOUT_PIN PC2 // E0DET +#define FIL_RUNOUT2_PIN PA0 // E1DET + +// +// Power Supply Control +// +#ifndef PS_ON_PIN + #define PS_ON_PIN PE4 // PS-ON +#endif + +// +// Power Loss Detection +// +#ifndef POWER_LOSS_PIN + #define POWER_LOSS_PIN PC15 // PWRDET +#endif + +// +// Steppers +// +#define X_STEP_PIN PD4 +#define X_DIR_PIN PD3 +#define X_ENABLE_PIN PD6 +#ifndef X_CS_PIN + #define X_CS_PIN PD5 +#endif + +#define Y_STEP_PIN PA15 +#define Y_DIR_PIN PA8 +#define Y_ENABLE_PIN PD1 +#ifndef Y_CS_PIN + #define Y_CS_PIN PD0 +#endif + +#define Z_STEP_PIN PE2 +#define Z_DIR_PIN PE3 +#define Z_ENABLE_PIN PE0 +#ifndef Z_CS_PIN + #define Z_CS_PIN PE1 +#endif + +#ifndef E0_STEP_PIN + #define E0_STEP_PIN PD15 +#endif +#ifndef E0_DIR_PIN + #define E0_DIR_PIN PD14 +#endif +#ifndef E0_ENABLE_PIN + #define E0_ENABLE_PIN PC7 +#endif +#ifndef E0_CS_PIN + #define E0_CS_PIN PC6 +#endif + +#ifndef E1_STEP_PIN + #define E1_STEP_PIN PD11 +#endif +#ifndef E1_DIR_PIN + #define E1_DIR_PIN PD10 +#endif +#ifndef E1_ENABLE_PIN + #define E1_ENABLE_PIN PD13 +#endif +#ifndef E1_CS_PIN + #define E1_CS_PIN PD12 +#endif + +// +// Temperature Sensors +// +#ifndef TEMP_0_PIN + #define TEMP_0_PIN PA2 // TH0 +#endif +#ifndef TEMP_1_PIN + #define TEMP_1_PIN PA3 // TH1 +#endif +#ifndef TEMP_BED_PIN + #define TEMP_BED_PIN PA1 // TB +#endif + +#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL) + #if TEMP_SENSOR_PROBE + #define TEMP_PROBE_PIN TEMP_1_PIN + #elif TEMP_SENSOR_CHAMBER + #define TEMP_CHAMBER_PIN TEMP_1_PIN + #endif +#endif + +// +// Heaters / Fans +// +#ifndef HEATER_0_PIN + #define HEATER_0_PIN PB3 // Heater0 +#endif +#ifndef HEATER_1_PIN + #define HEATER_1_PIN PB4 // Heater1 +#endif +#ifndef HEATER_BED_PIN + #define HEATER_BED_PIN PD7 // Hotbed +#endif +#ifndef FAN_PIN + #define FAN_PIN PB7 // Fan0 +#endif + +#if HAS_CUTTER + #ifndef SPINDLE_LASER_PWM_PIN + #define SPINDLE_LASER_PWM_PIN PB5 + #endif + #ifndef SPINDLE_LASER_ENA_PIN + #define SPINDLE_LASER_ENA_PIN PB6 + #endif +#else + #ifndef FAN1_PIN + #define FAN1_PIN PB6 // Fan1 + #endif + #ifndef FAN2_PIN + #define FAN2_PIN PB5 // Fan2 + #endif +#endif // SPINDLE_FEATURE || LASER_FEATURE + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PE13 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PE15 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PE14 + #endif +#endif + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PD5 + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + + #define Y_SERIAL_TX_PIN PD0 + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + + #define Z_SERIAL_TX_PIN PE1 + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + + #define E0_SERIAL_TX_PIN PC6 + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN + + #define E1_SERIAL_TX_PIN PD12 + #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// SD Connection +// +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +/** + * ------ ------ + * (BEEPER) PC5 |10 9 | PB0 (BTN_ENC) (MISO) PA6 |10 9 | PA5 (SCK) + * (LCD_EN) PB1 | 8 7 | PE8 (LCD_RS) (BTN_EN1) PE7 | 8 7 | PA4 (SD_SS) + * (LCD_D4) PE9 | 6 5 PE10 (LCD_D5) (BTN_EN2) PB2 | 6 5 PA7 (MOSI) + * (LCD_D6) PE11 | 4 3 | PE12 (LCD_D7) (SD_DETECT) PC4 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN PE12 +#define EXP1_04_PIN PE11 +#define EXP1_05_PIN PE10 +#define EXP1_06_PIN PE9 +#define EXP1_07_PIN PE8 +#define EXP1_08_PIN PB1 +#define EXP1_09_PIN PB0 +#define EXP1_10_PIN PC5 + +#define EXP2_03_PIN -1 +#define EXP2_04_PIN PC4 +#define EXP2_05_PIN PA7 +#define EXP2_06_PIN PB2 +#define EXP2_07_PIN PA4 +#define EXP2_08_PIN PE7 +#define EXP2_09_PIN PA5 +#define EXP2_10_PIN PA6 + +// +// Onboard SD card +// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 +// +#if SD_CONNECTION_IS(LCD) + #define SDSS EXP2_07_PIN + #define SD_SS_PIN SDSS + #define SD_SCK_PIN EXP2_09_PIN + #define SD_MISO_PIN EXP2_10_PIN + #define SD_MOSI_PIN EXP2_05_PIN + #define SD_DETECT_PIN EXP2_04_PIN +#elif SD_CONNECTION_IS(ONBOARD) + #define SDIO_SUPPORT + #define SDIO_CLOCK 24000000 // 24MHz +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "No custom SD drive cable defined for this board." +#endif + +#if ENABLED(BTT_MOTOR_EXPANSION) + /** ----- ----- + * -- | . . | GND -- | . . | GND + * -- | . . | M1EN M2EN | . . | M3EN + * M1STP | . . M1DIR M1RX | . . M1DIAG + * M2DIR | . . | M2STP M2RX | . . | M2DIAG + * M3DIR | . . | M3STP M3RX | . . | M3DIAG + * ----- ----- + * EXP2 EXP1 + * + * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN + */ + + // M1 on Driver Expansion Module + #define E2_STEP_PIN EXP2_05_PIN + #define E2_DIR_PIN EXP2_06_PIN + #define E2_ENABLE_PIN EXP2_04_PIN + #if !EXP_MOT_USE_EXP2_ONLY + #define E2_DIAG_PIN EXP1_06_PIN + #define E2_CS_PIN EXP1_05_PIN + #if HAS_TMC_UART + #define E2_SERIAL_TX_PIN EXP1_05_PIN + #define E2_SERIAL_RX_PIN EXP1_05_PIN + #endif + #endif + + // M2 on Driver Expansion Module + #define E3_STEP_PIN EXP2_08_PIN + #define E3_DIR_PIN EXP2_07_PIN + #if !EXP_MOT_USE_EXP2_ONLY + #define E3_ENABLE_PIN EXP1_03_PIN + #define E3_DIAG_PIN EXP1_08_PIN + #define E3_CS_PIN EXP1_07_PIN + #if HAS_TMC_UART + #define E3_SERIAL_TX_PIN EXP1_07_PIN + #define E3_SERIAL_RX_PIN EXP1_07_PIN + #endif + #else + #define E3_ENABLE_PIN EXP2_04_PIN + #endif + + // M3 on Driver Expansion Module + #define E4_STEP_PIN EXP2_10_PIN + #define E4_DIR_PIN EXP2_09_PIN + #if !EXP_MOT_USE_EXP2_ONLY + #define E4_ENABLE_PIN EXP1_04_PIN + #define E4_DIAG_PIN EXP1_10_PIN + #define E4_CS_PIN EXP1_09_PIN + #if HAS_TMC_UART + #define E4_SERIAL_TX_PIN EXP1_09_PIN + #define E4_SERIAL_RX_PIN EXP1_09_PIN + #endif + #else + #define E4_ENABLE_PIN EXP2_04_PIN + #endif + +#endif // BTT_MOTOR_EXPANSION + +// +// LCDs and Controllers +// +#if IS_TFTGLCD_PANEL + + #if ENABLED(TFTGLCD_PANEL_SPI) + #define TFTGLCD_CS EXP2_08_PIN + #endif + +#elif HAS_WIRED_LCD + + #define BEEPER_PIN EXP1_10_PIN + #define BTN_ENC EXP1_09_PIN + + #if ENABLED(CR10_STOCKDISPLAY) + + #define LCD_PINS_RS EXP1_04_PIN + + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_06_PIN + + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + + #else + + #define LCD_PINS_RS EXP1_07_PIN + + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN EXP1_05_PIN + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN EXP1_04_PIN + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN EXP1_03_PIN + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN EXP1_05_PIN + #endif + #endif // !FYSETC_MINI_12864 + + #if IS_ULTIPANEL + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + #endif + + #endif + +#endif // HAS_WIRED_LCD + +// Alter timing for graphical display +#if IS_U8GLIB_ST7920 + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 120 + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 80 + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 580 + #endif +#endif + +#if HAS_SPI_TFT + // + // e.g., BTT_TFT35_SPI_V1_0 (480x320, 3.5", SPI Stock Display with Rotary Encoder in BIQU B1 SE) + // + #define TFT_CS_PIN EXP2_07_PIN + #define TFT_A0_PIN EXP2_04_PIN + #define TFT_SCK_PIN EXP2_09_PIN + #define TFT_MISO_PIN EXP2_10_PIN + #define TFT_MOSI_PIN EXP2_05_PIN + + #define TOUCH_INT_PIN EXP1_04_PIN + #define TOUCH_MISO_PIN EXP1_05_PIN + #define TOUCH_MOSI_PIN EXP1_08_PIN + #define TOUCH_SCK_PIN EXP1_06_PIN + #define TOUCH_CS_PIN EXP1_07_PIN + + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN +#endif + +// +// NeoPixel LED +// +#ifndef NEOPIXEL_PIN + #define NEOPIXEL_PIN PE6 +#endif + +// +// WIFI +// + +/** + * ------- + * GND | 9 | | 8 | 3.3V + * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI) + * 3.3V | 11 | | 6 | PB14 (ESP-MISO) + * (ESP-IO0) PB10 | 12 | | 5 | PB13 (ESP-CLK) + * (ESP-IO4) PB11 | 13 | | 4 | -- + * -- | 14 | | 3 | 3.3V (ESP-EN) + * (ESP-RX) PD8 | 15 | | 2 | -- + * (ESP-TX) PD9 | 16 | | 1 | PC14 (ESP-RST) + * ------- + * WIFI + */ +#define ESP_WIFI_MODULE_COM 3 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this +#define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2 +#define ESP_WIFI_MODULE_RESET_PIN PC14 +#define ESP_WIFI_MODULE_GPIO0_PIN PB10 +#define ESP_WIFI_MODULE_GPIO4_PIN PB11 diff --git a/buildroot/share/PlatformIO/boards/marlin_STM32H743Vx.json b/buildroot/share/PlatformIO/boards/marlin_STM32H743Vx.json new file mode 100644 index 000000000000..3b8fa73060b7 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/marlin_STM32H743Vx.json @@ -0,0 +1,61 @@ +{ + "build": { + "core": "stm32", + "cpu": "cortex-m7", + "extra_flags": "-DSTM32H7xx -DSTM32H743xx", + "f_cpu": "400000000L", + "mcu": "stm32h743vit6", + "product_line": "STM32H743xx", + "variant": "MARLIN_H743Vx" + }, + "connectivity": [ + "can", + "ethernet" + ], + "debug": { + "jlink_device": "STM32H743VI", + "openocd_target": "stm32h7x", + "svd_path": "STM32H7x3.svd", + "tools": { + "stlink": { + "server": { + "arguments": [ + "-f", + "scripts/interface/stlink.cfg", + "-c", + "transport select hla_swd", + "-f", + "scripts/target/stm32h7x.cfg", + "-c", + "reset_config none" + ], + "executable": "bin/openocd", + "package": "tool-openocd" + } + } + } + }, + "frameworks": [ + "arduino", + "stm32cube" + ], + "name": "STM32H743VI (1024k RAM. 2048k Flash)", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 1048576, + "maximum_size": 2097152, + "protocol": "stlink", + "protocols": [ + "stlink", + "dfu", + "jlink", + "cmsis-dap" + ], + "offset_address": "0x8020000", + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32h743vi.html", + "vendor": "ST" +} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PeripheralPins.c new file mode 100644 index 000000000000..49c4cbb87aa9 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PeripheralPins.c @@ -0,0 +1,539 @@ +/* + ******************************************************************************* + * Copyright (c) 2020-2021, STMicroelectronics + * All rights reserved. + * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +/* + * Automatically generated from STM32H742V(G-I)Hx.xml, STM32H742V(G-I)Tx.xml + * STM32H743V(G-I)Hx.xml, STM32H743VGTx.xml + * STM32H743VITx.xml, STM32H750VBTx.xml + * STM32H753VIHx.xml, STM32H753VITx.xml + * CubeMX DB release 6.0.30 + */ +#if !defined(CUSTOM_PERIPHERAL_PINS) +#include "Arduino.h" +#include "PeripheralPins.h" + +/* ===== + * Notes: + * - The pins mentioned Px_y_ALTz are alternative possibilities which use other + * HW peripheral instances. You can use them the same way as any other "normal" + * pin (i.e. analogWrite(PA7_ALT1, 128);). + * + * - Commented lines are alternative possibilities which are not used per default. + * If you change them, you will have to know what you do + * ===== + */ + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +WEAK const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 16, 0)}, // ADC1_INP16 + {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)}, // ADC1_INP17 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_INP14 + {PA_2_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_INP14 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_INP15 + {PA_3_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_INP15 + {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC1_INP18 + {PA_4_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC2_INP18 + {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC1_INP19 + {PA_5_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC2_INP19 + {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_INP3 + {PA_6_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_INP3 + {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_INP7 + {PA_7_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_INP7 + {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_INP9 + {PB_0_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_INP9 + {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_INP5 + {PB_1_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_INP5 + {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_INP10 + {PC_0_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_INP10 + {PC_0_ALT2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_INP10 + {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_INP11 + {PC_1_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_INP11 + {PC_1_ALT2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_INP11 + {PC_2_C, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_INP0 + {PC_3_C, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_INP1 + {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_INP4 + {PC_4_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_INP4 + {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_INP8 + {PC_5_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_INP8 + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +WEAK const PinMap PinMap_DAC[] = { + {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC1_OUT1 + {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC1_OUT2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SDA[] = { + {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_7_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_9_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)}, + {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + {PD_13, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SCL[] = { + {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_6_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + {PB_8_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)}, + {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PD_12, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)}, + {NC, NP, 0} +}; +#endif + +//*** TIM *** + +#ifdef HAL_TIM_MODULE_ENABLED +WEAK const PinMap PinMap_TIM[] = { + {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_0_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 + {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + {PA_1_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + {PA_1_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 1)}, // TIM15_CH1N + {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PA_2_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 + {PA_2_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 0)}, // TIM15_CH1 + {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PA_3_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 + {PA_3_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 2, 0)}, // TIM15_CH2 + {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_5_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PA_6_ALT1, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 + {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PA_7_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PA_7_ALT2, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N + {PA_7_ALT3, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 + {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {PB_0_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + {PB_0_ALT2, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + {PB_1_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PB_1_ALT2, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + {PB_6_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N + {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + {PB_7_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 1)}, // TIM17_CH1N + {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + {PB_8_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1 + {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PB_9_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1 + {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {PB_14_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N + {PB_14_ALT2, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM12, 1, 0)}, // TIM12_CH1 + {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + {PB_15_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N + {PB_15_ALT2, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM12, 2, 0)}, // TIM12_CH2 + {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 + {PC_6_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1 + {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + {PC_7_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 + {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 + {PC_8_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3 + {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 + {PC_9_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 + {PD_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 + {PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + {PD_14, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + {PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PE_4, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 1)}, // TIM15_CH1N + {PE_5, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 0)}, // TIM15_CH1 + {PE_6, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 2, 0)}, // TIM15_CH2 + {PE_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N + {PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + {PE_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N + {PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + {PE_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N + {PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + {PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + {NC, NP, 0} +}; +#endif + +//*** UART *** + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_TX[] = { + {PA_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_9, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)}, + {PA_9_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PA_12, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_UART4)}, + {PA_15, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)}, + {PB_4, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)}, + {PB_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART)}, + {PB_6_ALT1, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)}, + {PB_6_ALT2, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_9, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PB_13, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)}, + {PB_14, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, + {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)}, + {PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_10_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {PD_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PE_1, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)}, + {PE_8, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RX[] = { + {PA_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_8, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)}, + {PA_10, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)}, + {PA_10_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PA_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_UART4)}, + {PB_3, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)}, + {PB_5, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)}, + {PB_7, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART)}, + {PB_7_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_8, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PB_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)}, + {PB_15, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, + {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)}, + {PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_11_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PE_0, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)}, + {PE_7, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RTS[] = { + {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_12, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)}, + {PA_12_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PA_15, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PB_14, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PB_14_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PC_8, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {PD_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_12, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_15, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)}, + {PE_9, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_CTS[] = { + {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PA_11, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)}, + {PA_11_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, + {PB_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PB_15, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, + {PC_9, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, + {PD_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + {PD_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, + {PD_14, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)}, + {PE_10, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)}, + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_7_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PB_2, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)}, + {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_5_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)}, + {PB_5_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_1, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_3_C, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PD_6, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI3)}, + {PD_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PE_6, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {PE_14, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_6_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_4_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_4_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_2_C, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PE_5, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {PE_13, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_5_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PA_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PA_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PB_3_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PB_3_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PD_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PE_2, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {PE_12, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SSEL[] = { + {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_4_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PA_4_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)}, + {PA_11, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + {PA_15_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, + {PA_15_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI6)}, + {PB_4, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)}, + {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PE_4, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {PE_11, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, + {NC, NP, 0} +}; +#endif + +//*** FDCAN *** + +#ifdef HAL_FDCAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_RD[] = { + {PA_11, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {PB_5, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)}, + {PB_8, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {PB_12, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)}, + {PD_0, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_FDCAN_MODULE_ENABLED +WEAK const PinMap PinMap_CAN_TD[] = { + {PA_12, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {PB_6, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)}, + {PB_9, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {PB_13, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)}, + {PD_1, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)}, + {NC, NP, 0} +}; +#endif + +//*** ETHERNET *** + +#ifdef HAL_ETH_MODULE_ENABLED +WEAK const PinMap PinMap_Ethernet[] = { + {PA_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS + {PA_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_REF_CLK + {PA_1_ALT1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_CLK + {PA_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDIO + {PA_3, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_COL + {PA_7, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS_DV + {PA_7_ALT1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_DV + {PB_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD2 + {PB_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD3 + {PB_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_PPS_OUT + {PB_8, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3 + {PB_10, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_ER + {PB_11, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_EN + {PB_12, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD0 + {PB_13, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD1 + {PC_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDC + {PC_2_C, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD2 + {PC_3_C, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_CLK + {PC_4, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD0 + {PC_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD1 + {PE_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3 + {NC, NP, 0} +}; +#endif + +//*** QUADSPI *** + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_DATA0[] = { + {PC_9, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO0 + {PD_11, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO0 + {PE_7, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK2_IO0 + {NC, NP, 0} +}; +#endif + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_DATA1[] = { + {PC_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO1 + {PD_12, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO1 + {PE_8, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK2_IO1 + {NC, NP, 0} +}; +#endif + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_DATA2[] = { + {PE_2, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO2 + {PE_9, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK2_IO2 + {NC, NP, 0} +}; +#endif + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_DATA3[] = { + {PA_1, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO3 + {PD_13, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_IO3 + {PE_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK2_IO3 + {NC, NP, 0} +}; +#endif + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_SCLK[] = { + {PB_2, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_CLK + {NC, NP, 0} +}; +#endif + +#ifdef HAL_QSPI_MODULE_ENABLED +WEAK const PinMap PinMap_QUADSPI_SSEL[] = { + {PB_6, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK1_NCS + {PB_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK1_NCS + {PC_11, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QUADSPI)}, // QUADSPI_BK2_NCS + {NC, NP, 0} +}; +#endif + +//*** USB *** + +#if defined(HAL_PCD_MODULE_ENABLED) || defined(HAL_HCD_MODULE_ENABLED) +WEAK const PinMap PinMap_USB_OTG_FS[] = { + {PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_FS)}, // USB_OTG_FS_SOF + {PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS + {PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG1_FS)}, // USB_OTG_FS_ID + {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_FS)}, // USB_OTG_FS_DM + {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_FS)}, // USB_OTG_FS_DP + {NC, NP, 0} +}; +#endif + +#if defined(HAL_PCD_MODULE_ENABLED) || defined(HAL_HCD_MODULE_ENABLED) +WEAK const PinMap PinMap_USB_OTG_HS[] = { +#ifdef USE_USB_HS_IN_FS + // {PA_4, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG2_FS)}, // USB_OTG_HS_SOF + // {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG2_FS)}, // USB_OTG_HS_ID + // {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_HS_VBUS + {PB_14, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG2_FS)}, // USB_OTG_HS_DM + {PB_15, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG2_FS)}, // USB_OTG_HS_DP +#else + {PA_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D0 + {PA_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_CK + {PB_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D1 + {PB_1, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D2 + {PB_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D7 + {PB_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D3 + {PB_11, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D4 + {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D5 + {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_D6 + {PC_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_STP + {PC_2_C, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_DIR + {PC_3_C, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG2_HS)}, // USB_OTG_HS_ULPI_NXT +#endif /* USE_USB_HS_IN_FS */ + {NC, NP, 0} +}; +#endif + +//*** SD *** + +#ifdef HAL_SD_MODULE_ENABLED +WEAK const PinMap PinMap_SD[] = { + {PA_0, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_SDIO2)}, // SDMMC2_CMD + {PB_3, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDIO2)}, // SDMMC2_D2 + {PB_4, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDIO2)}, // SDMMC2_D3 + {PB_8, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF7_SDIO1)}, // SDMMC1_CKIN + {PB_8_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D4 + {PB_8_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDIO2)}, // SDMMC2_D4 + {PB_9, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF7_SDIO1)}, // SDMMC1_CDIR + {PB_9_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D5 + {PB_9_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDIO2)}, // SDMMC2_D5 + {PB_14, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDIO2)}, // SDMMC2_D0 + {PB_15, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDIO2)}, // SDMMC2_D1 + {PC_1, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_SDIO2)}, // SDMMC2_CK + {PC_6, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF8_SDIO1)}, // SDMMC1_D0DIR + {PC_6_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D6 + {PC_6_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDIO2)}, // SDMMC2_D6 + {PC_7, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF8_SDIO1)}, // SDMMC1_D123DIR + {PC_7_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D7 + {PC_7_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDIO2)}, // SDMMC2_D7 + {PC_8, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D0 + {PC_9, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D1 + {PC_10, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D2 + {PC_11, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO1)}, // SDMMC1_D3 + {PC_12, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO1)}, // SDMMC1_CK + {PD_2, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO1)}, // SDMMC1_CMD + {PD_6, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF11_SDIO2)}, // SDMMC2_CK + {PD_7, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF11_SDIO2)}, // SDMMC2_CMD + {NC, NP, 0} +}; +#endif + +#endif /* !CUSTOM_PERIPHERAL_PINS */ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PinNamesVar.h new file mode 100644 index 000000000000..2128732a400c --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/PinNamesVar.h @@ -0,0 +1,112 @@ +/* Dual pad pin name */ +PC_2_C = PC_2 | PDUAL, +PC_3_C = PC_3 | PDUAL, + +/* Alternate pin name */ +PA_0_ALT1 = PA_0 | ALT1, +PA_1_ALT1 = PA_1 | ALT1, +PA_1_ALT2 = PA_1 | ALT2, +PA_2_ALT1 = PA_2 | ALT1, +PA_2_ALT2 = PA_2 | ALT2, +PA_3_ALT1 = PA_3 | ALT1, +PA_3_ALT2 = PA_3 | ALT2, +PA_4_ALT1 = PA_4 | ALT1, +PA_4_ALT2 = PA_4 | ALT2, +PA_5_ALT1 = PA_5 | ALT1, +PA_6_ALT1 = PA_6 | ALT1, +PA_7_ALT1 = PA_7 | ALT1, +PA_7_ALT2 = PA_7 | ALT2, +PA_7_ALT3 = PA_7 | ALT3, +PA_9_ALT1 = PA_9 | ALT1, +PA_10_ALT1 = PA_10 | ALT1, +PA_11_ALT1 = PA_11 | ALT1, +PA_12_ALT1 = PA_12 | ALT1, +PA_15_ALT1 = PA_15 | ALT1, +PA_15_ALT2 = PA_15 | ALT2, +PB_0_ALT1 = PB_0 | ALT1, +PB_0_ALT2 = PB_0 | ALT2, +PB_1_ALT1 = PB_1 | ALT1, +PB_1_ALT2 = PB_1 | ALT2, +PB_3_ALT1 = PB_3 | ALT1, +PB_3_ALT2 = PB_3 | ALT2, +PB_4_ALT1 = PB_4 | ALT1, +PB_4_ALT2 = PB_4 | ALT2, +PB_5_ALT1 = PB_5 | ALT1, +PB_5_ALT2 = PB_5 | ALT2, +PB_6_ALT1 = PB_6 | ALT1, +PB_6_ALT2 = PB_6 | ALT2, +PB_7_ALT1 = PB_7 | ALT1, +PB_8_ALT1 = PB_8 | ALT1, +PB_8_ALT2 = PB_8 | ALT2, +PB_9_ALT1 = PB_9 | ALT1, +PB_9_ALT2 = PB_9 | ALT2, +PB_14_ALT1 = PB_14 | ALT1, +PB_14_ALT2 = PB_14 | ALT2, +PB_15_ALT1 = PB_15 | ALT1, +PB_15_ALT2 = PB_15 | ALT2, +PC_0_ALT1 = PC_0 | ALT1, +PC_0_ALT2 = PC_0 | ALT2, +PC_1_ALT1 = PC_1 | ALT1, +PC_1_ALT2 = PC_1 | ALT2, +PC_4_ALT1 = PC_4 | ALT1, +PC_5_ALT1 = PC_5 | ALT1, +PC_6_ALT1 = PC_6 | ALT1, +PC_6_ALT2 = PC_6 | ALT2, +PC_7_ALT1 = PC_7 | ALT1, +PC_7_ALT2 = PC_7 | ALT2, +PC_8_ALT1 = PC_8 | ALT1, +PC_9_ALT1 = PC_9 | ALT1, +PC_10_ALT1 = PC_10 | ALT1, +PC_11_ALT1 = PC_11 | ALT1, + +/* SYS_WKUP */ +#ifdef PWR_WAKEUP_PIN1 + SYS_WKUP1 = PA_0, /* SYS_WKUP0 */ +#endif +#ifdef PWR_WAKEUP_PIN2 + SYS_WKUP2 = PA_2, /* SYS_WKUP1 */ +#endif +#ifdef PWR_WAKEUP_PIN3 + SYS_WKUP3 = PC_13, /* SYS_WKUP2 */ +#endif +#ifdef PWR_WAKEUP_PIN4 + SYS_WKUP4 = NC, +#endif +#ifdef PWR_WAKEUP_PIN5 + SYS_WKUP5 = NC, +#endif +#ifdef PWR_WAKEUP_PIN6 + SYS_WKUP6 = PC_1, /* SYS_WKUP5 */ +#endif +#ifdef PWR_WAKEUP_PIN7 + SYS_WKUP7 = NC, +#endif +#ifdef PWR_WAKEUP_PIN8 + SYS_WKUP8 = NC, +#endif + +/* USB */ +#ifdef USBCON + USB_OTG_FS_DM = PA_11, + USB_OTG_FS_DP = PA_12, + USB_OTG_FS_ID = PA_10, + USB_OTG_FS_SOF = PA_8, + USB_OTG_FS_VBUS = PA_9, + USB_OTG_HS_DM = PB_14, + USB_OTG_HS_DP = PB_15, + USB_OTG_HS_ID = PB_12, + USB_OTG_HS_SOF = PA_4, + USB_OTG_HS_ULPI_CK = PA_5, + USB_OTG_HS_ULPI_D0 = PA_3, + USB_OTG_HS_ULPI_D1 = PB_0, + USB_OTG_HS_ULPI_D2 = PB_1, + USB_OTG_HS_ULPI_D3 = PB_10, + USB_OTG_HS_ULPI_D4 = PB_11, + USB_OTG_HS_ULPI_D5 = PB_12, + USB_OTG_HS_ULPI_D6 = PB_13, + USB_OTG_HS_ULPI_D7 = PB_5, + USB_OTG_HS_ULPI_DIR = PC_2_C, + USB_OTG_HS_ULPI_NXT = PC_3_C, + USB_OTG_HS_ULPI_STP = PC_0, + USB_OTG_HS_VBUS = PB_13, +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld new file mode 100644 index 000000000000..7d248a268283 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/ldscript.ld @@ -0,0 +1,208 @@ +/* +****************************************************************************** +** +** File : LinkerScript.ld +** +** Author : Auto-generated by STM32CubeIDE +** +** Abstract : Linker script for STM32H743VI Device from STM32H7 series +** 2048Kbytes FLASH +** 128Kbytes DTCMRAM +** 64Kbytes ITCMRAM +** 512Kbytes RAM_D1 +** 288Kbytes RAM_D2 +** 64Kbytes RAM_D3 +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** Distribution: The file is distributed as is without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2019 STMicroelectronics

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of STMicroelectronics nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x24080000; /* end of "RAM_D1" Ram type memory */ + +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Memories definition */ +MEMORY +{ + DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K + RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K + RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K + RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K + FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET +} + +/* Sections */ +SECTIONS +{ + /* The startup code into "FLASH" Rom type memory */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data into "FLASH" Rom type memory */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data into "FLASH" Rom type memory */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { + . = ALIGN(4); + *(.ARM.extab* .gnu.linkonce.armextab.*) + . = ALIGN(4); + } >FLASH + + .ARM : { + . = ALIGN(4); + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + . = ALIGN(4); + } >FLASH + + .preinit_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + . = ALIGN(4); + } >FLASH + + .init_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + . = ALIGN(4); + } >FLASH + + .fini_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + . = ALIGN(4); + } >FLASH + + /* Used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections into "RAM_D1" Ram type memory */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + + } >RAM_D1 AT> FLASH + + /* Uninitialized data section into "RAM_D1" Ram type memory */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss section */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM_D1 + + /* User_heap_stack section, used to check that there is enough "RAM_D1" Ram type memory left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM_D1 + + /* Remove information from the compiler libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.cpp new file mode 100644 index 000000000000..7813f8860e58 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.cpp @@ -0,0 +1,245 @@ +/* + ******************************************************************************* + * Copyright (c) 2020-2021, STMicroelectronics + * All rights reserved. + * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#if defined(STM32H743xx) +#include "pins_arduino.h" + +// Digital PinName array +const PinName digitalPin[] = { + PA_0, // D0/A0 + PA_1, // D1/A1 + PA_2, // D2/A2 + PA_3, // D3/A3 + PA_4, // D4/A4 + PA_5, // D5/A5 + PA_6, // D6/A6 + PA_7, // D7/A7 + PA_8, // D8 + PA_9, // D9 + PA_10, // D10 + PA_11, // D11 + PA_12, // D12 + PA_13, // D13 + PA_14, // D14 + PA_15, // D15 + PB_0, // D16/A8 + PB_1, // D17/A9 + PB_2, // D18 + PB_3, // D19 + PB_4, // D20 + PB_5, // D21 + PB_6, // D22 + PB_7, // D23 + PB_8, // D24 + PB_9, // D25 + PB_10, // D26 + PB_11, // D27 + PB_12, // D28 + PB_13, // D29 + PB_14, // D30 + PB_15, // D31 + PC_0, // D32/A10 + PC_1, // D33/A11 + PC_4, // D34/A12 + PC_5, // D35/A13 + PC_6, // D36 + PC_7, // D37 + PC_8, // D38 + PC_9, // D39 + PC_10, // D40 + PC_11, // D41 + PC_12, // D42 + PC_13, // D43 + PC_14, // D44 + PC_15, // D45 + PD_0, // D46 + PD_1, // D47 + PD_2, // D48 + PD_3, // D49 + PD_4, // D50 + PD_5, // D51 + PD_6, // D52 + PD_7, // D53 + PD_8, // D54 + PD_9, // D55 + PD_10, // D56 + PD_11, // D57 + PD_12, // D58 + PD_13, // D59 + PD_14, // D60 + PD_15, // D61 + PE_0, // D62 + PE_1, // D63 + PE_2, // D64 + PE_3, // D65 + PE_4, // D66 + PE_5, // D67 + PE_6, // D68 + PE_7, // D69 + PE_8, // D70 + PE_9, // D71 + PE_10, // D72 + PE_11, // D73 + PE_12, // D74 + PE_13, // D75 + PE_14, // D76 + PE_15, // D77 + PH_0, // D78 + PH_1, // D79 + PC_2_C, // D80/A14 + PC_3_C // D81/A15 +}; + +// Analog (Ax) pin number array +const uint32_t analogInputPin[] = { + 0, // A0, PA0 + 1, // A1, PA1 + 2, // A2, PA2 + 3, // A3, PA3 + 4, // A4, PA4 + 5, // A5, PA5 + 6, // A6, PA6 + 7, // A7, PA7 + 16, // A8, PB0 + 17, // A9, PB1 + 32, // A10, PC0 + 33, // A11, PC1 + 34, // A12, PC4 + 35, // A13, PC5 + 80, // A14, PC2_C + 81 // A15, PC3_C +}; + +/* + * @brief System Clock Configuration + * @param None + * @retval None + */ +WEAK void SystemClock_Config(void) +{ + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {}; + + /** Supply configuration update enable + */ + HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); + /** Configure the main internal regulator output voltage + */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0); + + while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} + /** Initializes the RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = 5; // 25Mhz / 5 = 5Mhz + RCC_OscInitStruct.PLL.PLLN = 192; // 25Mhz / 5 * 192 = 960Mhz + RCC_OscInitStruct.PLL.PLLP = 2; // 960Mhz / 2 = 480Mhz + RCC_OscInitStruct.PLL.PLLQ = 20; // 960Mhz / 20 = 48Mhz for USB + RCC_OscInitStruct.PLL.PLLR = 20; // unused + RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2; + RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE; + RCC_OscInitStruct.PLL.PLLFRACN = 0; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + { + Error_Handler(); + } + /** Initializes the CPU, AHB and APB buses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK + |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2 + |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; + RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; + RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) + { + Error_Handler(); + } + + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB | RCC_PERIPHCLK_QSPI + | RCC_PERIPHCLK_SDMMC | RCC_PERIPHCLK_ADC + | RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_USART16 + | RCC_PERIPHCLK_USART234578 | RCC_PERIPHCLK_I2C123 + | RCC_PERIPHCLK_I2C4 | RCC_PERIPHCLK_SPI123 + | RCC_PERIPHCLK_SPI45 | RCC_PERIPHCLK_SPI6; + + /* PLL1 qclk used for USB 48 Mhz */ + /* PLL1 qclk also used for FMC, QUADSPI, SDMMC, RNG, SAI */ + /* PLL2 pclk is needed for adc max 80 Mhz (p,q,r same) */ + /* PLL2 pclk also used for LP timers 2,3,4,5, SPI 1,2,3 */ + /* PLL2 qclk is needed for uart, can, spi4,5,6 80 Mhz */ + /* PLL3 r clk is needed for i2c 80 Mhz (p,q,r same) */ + PeriphClkInitStruct.PLL2.PLL2M = 15; // M DIV 15 vco 25 / 15 ~ 1.667 Mhz + PeriphClkInitStruct.PLL2.PLL2N = 96; // N MUL 96 + PeriphClkInitStruct.PLL2.PLL2P = 2; // P div 2 + PeriphClkInitStruct.PLL2.PLL2Q = 2; // Q div 2 + PeriphClkInitStruct.PLL2.PLL2R = 2; // R div 2 + // RCC_PLL1VCIRANGE_0 Clock range frequency between 1 and 2 MHz + PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_0; + PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOMEDIUM; + PeriphClkInitStruct.PLL2.PLL2FRACN = 0; + PeriphClkInitStruct.PLL3.PLL3M = 15; // M DIV 15 vco 25 / 15 ~ 1.667 Mhz + PeriphClkInitStruct.PLL3.PLL3N = 96; // N MUL 96 + PeriphClkInitStruct.PLL3.PLL3P = 2; // P div 2 + PeriphClkInitStruct.PLL3.PLL3Q = 2; // Q div 2 + PeriphClkInitStruct.PLL3.PLL3R = 2; // R div 2 + // RCC_PLL1VCIRANGE_0 Clock range frequency between 1 and 2 MHz + PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_0; + PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL3VCOMEDIUM; + PeriphClkInitStruct.PLL3.PLL3FRACN = 0; + // ADC from PLL2 pclk + PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_PLL2; + // USB from PLL1 qclk + PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL; + // QSPI from PLL1 qclk + PeriphClkInitStruct.QspiClockSelection = RCC_QSPICLKSOURCE_PLL; + // SDMMC from PLL1 qclk + PeriphClkInitStruct.SdmmcClockSelection = 0; + //PeriphClkInitStruct.SdmmcClockSelection = RCC_SDMMCCLKSOURCE_PLL; + // LPUART from PLL2 qclk + PeriphClkInitStruct.Lpuart1ClockSelection = 0; + //PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PLL2; + // USART from PLL2 qclk + PeriphClkInitStruct.Usart16ClockSelection = RCC_USART16CLKSOURCE_PLL2; + // USART from PLL2 qclk + PeriphClkInitStruct.Usart234578ClockSelection = 0; + //PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_PLL2; + // I2C123 from PLL3 rclk + PeriphClkInitStruct.I2c123ClockSelection = RCC_I2C123CLKSOURCE_PLL3; + // I2C4 from PLL3 rclk + PeriphClkInitStruct.I2c4ClockSelection = 0; + //PeriphClkInitStruct.I2c4ClockSelection = RCC_I2C4CLKSOURCE_PLL3; + // SPI123 from PLL2 pclk + PeriphClkInitStruct.Spi123ClockSelection = RCC_SPI123CLKSOURCE_PLL2; + // SPI45 from PLL2 qclk + PeriphClkInitStruct.Spi45ClockSelection = 0; + //PeriphClkInitStruct.Spi45ClockSelection = RCC_SPI45CLKSOURCE_PLL2; + // SPI6 from PLL2 qclk + PeriphClkInitStruct.Spi6ClockSelection = 0; + //PeriphClkInitStruct.Spi6ClockSelection = RCC_SPI6CLKSOURCE_PLL2; + + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { + Error_Handler(); + } +} + +#endif /* ARDUINO_GENERIC_* */ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.h b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.h new file mode 100644 index 000000000000..35cf65dee9b9 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_H743Vx/variant_MARLIN_STM32H743VX.h @@ -0,0 +1,268 @@ +/* + ******************************************************************************* + * Copyright (c) 2020-2021, STMicroelectronics + * All rights reserved. + * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#pragma once + +/*---------------------------------------------------------------------------- + * STM32 pins number + *----------------------------------------------------------------------------*/ +#define PA0 PIN_A0 +#define PA1 PIN_A1 +#define PA2 PIN_A2 +#define PA3 PIN_A3 +#define PA4 PIN_A4 +#define PA5 PIN_A5 +#define PA6 PIN_A6 +#define PA7 PIN_A7 +#define PA8 8 +#define PA9 9 +#define PA10 10 +#define PA11 11 +#define PA12 12 +#define PA13 13 +#define PA14 14 +#define PA15 15 +#define PB0 PIN_A8 +#define PB1 PIN_A9 +#define PB2 18 +#define PB3 19 +#define PB4 20 +#define PB5 21 +#define PB6 22 +#define PB7 23 +#define PB8 24 +#define PB9 25 +#define PB10 26 +#define PB11 27 +#define PB12 28 +#define PB13 29 +#define PB14 30 +#define PB15 31 +#define PC0 PIN_A10 +#define PC1 PIN_A11 +#define PC4 PIN_A12 +#define PC5 PIN_A13 +#define PC6 36 +#define PC7 37 +#define PC8 38 +#define PC9 39 +#define PC10 40 +#define PC11 41 +#define PC12 42 +#define PC13 43 +#define PC14 44 +#define PC15 45 +#define PD0 46 +#define PD1 47 +#define PD2 48 +#define PD3 49 +#define PD4 50 +#define PD5 51 +#define PD6 52 +#define PD7 53 +#define PD8 54 +#define PD9 55 +#define PD10 56 +#define PD11 57 +#define PD12 58 +#define PD13 59 +#define PD14 60 +#define PD15 61 +#define PE0 62 +#define PE1 63 +#define PE2 64 +#define PE3 65 +#define PE4 66 +#define PE5 67 +#define PE6 68 +#define PE7 69 +#define PE8 70 +#define PE9 71 +#define PE10 72 +#define PE11 73 +#define PE12 74 +#define PE13 75 +#define PE14 76 +#define PE15 77 +#define PH0 78 +#define PH1 79 +#define PC2_C PIN_A14 +#define PC3_C PIN_A15 +#define PC2 PC2_C +#define PC3 PC3_C + +// Alternate pins number +#define PA0_ALT1 (PA0 | ALT1) +#define PA1_ALT1 (PA1 | ALT1) +#define PA1_ALT2 (PA1 | ALT2) +#define PA2_ALT1 (PA2 | ALT1) +#define PA2_ALT2 (PA2 | ALT2) +#define PA3_ALT1 (PA3 | ALT1) +#define PA3_ALT2 (PA3 | ALT2) +#define PA4_ALT1 (PA4 | ALT1) +#define PA4_ALT2 (PA4 | ALT2) +#define PA5_ALT1 (PA5 | ALT1) +#define PA6_ALT1 (PA6 | ALT1) +#define PA7_ALT1 (PA7 | ALT1) +#define PA7_ALT2 (PA7 | ALT2) +#define PA7_ALT3 (PA7 | ALT3) +#define PA9_ALT1 (PA9 | ALT1) +#define PA10_ALT1 (PA10 | ALT1) +#define PA11_ALT1 (PA11 | ALT1) +#define PA12_ALT1 (PA12 | ALT1) +#define PA15_ALT1 (PA15 | ALT1) +#define PA15_ALT2 (PA15 | ALT2) +#define PB0_ALT1 (PB0 | ALT1) +#define PB0_ALT2 (PB0 | ALT2) +#define PB1_ALT1 (PB1 | ALT1) +#define PB1_ALT2 (PB1 | ALT2) +#define PB3_ALT1 (PB3 | ALT1) +#define PB3_ALT2 (PB3 | ALT2) +#define PB4_ALT1 (PB4 | ALT1) +#define PB4_ALT2 (PB4 | ALT2) +#define PB5_ALT1 (PB5 | ALT1) +#define PB5_ALT2 (PB5 | ALT2) +#define PB6_ALT1 (PB6 | ALT1) +#define PB6_ALT2 (PB6 | ALT2) +#define PB7_ALT1 (PB7 | ALT1) +#define PB8_ALT1 (PB8 | ALT1) +#define PB8_ALT2 (PB8 | ALT2) +#define PB9_ALT1 (PB9 | ALT1) +#define PB9_ALT2 (PB9 | ALT2) +#define PB14_ALT1 (PB14 | ALT1) +#define PB14_ALT2 (PB14 | ALT2) +#define PB15_ALT1 (PB15 | ALT1) +#define PB15_ALT2 (PB15 | ALT2) +#define PC0_ALT1 (PC0 | ALT1) +#define PC0_ALT2 (PC0 | ALT2) +#define PC1_ALT1 (PC1 | ALT1) +#define PC1_ALT2 (PC1 | ALT2) +#define PC4_ALT1 (PC4 | ALT1) +#define PC5_ALT1 (PC5 | ALT1) +#define PC6_ALT1 (PC6 | ALT1) +#define PC6_ALT2 (PC6 | ALT2) +#define PC7_ALT1 (PC7 | ALT1) +#define PC7_ALT2 (PC7 | ALT2) +#define PC8_ALT1 (PC8 | ALT1) +#define PC9_ALT1 (PC9 | ALT1) +#define PC10_ALT1 (PC10 | ALT1) +#define PC11_ALT1 (PC11 | ALT1) + +#define NUM_DIGITAL_PINS 82 +#define NUM_DUALPAD_PINS 2 +#define NUM_ANALOG_INPUTS 16 + +// On-board LED pin number +#ifndef LED_BUILTIN + #define LED_BUILTIN PNUM_NOT_DEFINED +#endif + +// On-board user button +#ifndef USER_BTN + #define USER_BTN PNUM_NOT_DEFINED +#endif + +// SPI definitions +#ifndef PIN_SPI_SS + #define PIN_SPI_SS PA4 +#endif +#ifndef PIN_SPI_SS1 + #define PIN_SPI_SS1 PA15 +#endif +#ifndef PIN_SPI_SS2 + #define PIN_SPI_SS2 PNUM_NOT_DEFINED +#endif +#ifndef PIN_SPI_SS3 + #define PIN_SPI_SS3 PNUM_NOT_DEFINED +#endif +#ifndef PIN_SPI_MOSI + #define PIN_SPI_MOSI PA7 +#endif +#ifndef PIN_SPI_MISO + #define PIN_SPI_MISO PA6 +#endif +#ifndef PIN_SPI_SCK + #define PIN_SPI_SCK PA5 +#endif + +// I2C definitions +#ifndef PIN_WIRE_SDA + #define PIN_WIRE_SDA PB7 +#endif +#ifndef PIN_WIRE_SCL + #define PIN_WIRE_SCL PB6 +#endif + +// Timer Definitions +// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin +#ifndef TIMER_TONE + #define TIMER_TONE TIM6 +#endif +#ifndef TIMER_SERVO + #define TIMER_SERVO TIM7 +#endif + +// UART Definitions +#ifndef SERIAL_UART_INSTANCE + #define SERIAL_UART_INSTANCE 4 +#endif + +// Default pin used for generic 'Serial' instance +// Mandatory for Firmata +#ifndef PIN_SERIAL_RX + #define PIN_SERIAL_RX PA1 +#endif +#ifndef PIN_SERIAL_TX + #define PIN_SERIAL_TX PA0 +#endif + +// Extra HAL modules +#if !defined(HAL_DAC_MODULE_DISABLED) + #define HAL_DAC_MODULE_ENABLED +#endif +#if !defined(HAL_ETH_MODULE_DISABLED) + #define HAL_ETH_MODULE_ENABLED +#endif +#if !defined(HAL_QSPI_MODULE_DISABLED) + #define HAL_QSPI_MODULE_ENABLED +#endif +#if !defined(HAL_SD_MODULE_DISABLED) + #define HAL_SD_MODULE_ENABLED +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + // These serial port names are intended to allow libraries and architecture-neutral + // sketches to automatically default to the correct port name for a particular type + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, + // the first hardware serial port whose RX/TX pins are not dedicated to another use. + // + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor + // + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial + // + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library + // + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. + // + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX + // pins are NOT connected to anything by default. + #ifndef SERIAL_PORT_MONITOR + #define SERIAL_PORT_MONITOR Serial + #endif + #ifndef SERIAL_PORT_HARDWARE + #define SERIAL_PORT_HARDWARE Serial + #endif +#endif diff --git a/ini/stm32h7.ini b/ini/stm32h7.ini index b0cb10866c55..c5d7d6299a1e 100644 --- a/ini/stm32h7.ini +++ b/ini/stm32h7.ini @@ -38,3 +38,24 @@ build_flags = ${stm32_variant.build_flags} ${stm_flash_drive.build_flags} -DHAL_SD_MODULE_ENABLED upload_protocol = cmsis-dap debug_tool = cmsis-dap + +# +# BigTreeTech SKR V3.0 / V3.0 EZ (STM32H743VIT6 ARM Cortex-M7) +# +[env:STM32H743Vx_btt] +extends = stm32_variant +platform = ststm32@~14.1.0 +platform_packages = framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/main.zip +board = marlin_STM32H743Vx +board_build.offset = 0x20000 +board_upload.offset_address = 0x08020000 +build_flags = ${stm32_variant.build_flags} + -DPIN_SERIAL1_RX=PA_10 -DPIN_SERIAL1_TX=PA_9 + -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 + -DPIN_SERIAL4_RX=PA_1 -DPIN_SERIAL4_TX=PA_0 + -DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024 + -DTIMER_SERVO=TIM5 -DTIMER_TONE=TIM2 + -DSTEP_TIMER_IRQ_PRIO=0 + -DD_CACHE_DISABLED +upload_protocol = cmsis-dap +debug_tool = cmsis-dap From 0d783a76907ace17f0d61ebe8882ebee9bc6ce3b Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Thu, 2 Jun 2022 21:22:09 +1200 Subject: [PATCH 357/502] =?UTF-8?q?=F0=9F=90=9B=20Init=20Stepper=20SPI=20b?= =?UTF-8?q?efore=20PSU=20Control=20(#24269)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 76bc988483c2..7f1aabc43b28 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1230,6 +1230,17 @@ void setup() { SETUP_RUN(tmc_serial_begin()); #endif + #if HAS_TMC_SPI + #if DISABLED(TMC_USE_SW_SPI) + SETUP_RUN(SPI.begin()); + #endif + SETUP_RUN(tmc_init_cs_pins()); + #endif + + #if HAS_L64XX + SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers + #endif + #if ENABLED(PSU_CONTROL) SETUP_LOG("PSU_CONTROL"); powerManager.init(); @@ -1239,21 +1250,10 @@ void setup() { SETUP_RUN(recovery.setup()); #endif - #if HAS_L64XX - SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers - #endif - #if HAS_STEPPER_RESET SETUP_RUN(disableStepperDrivers()); #endif - #if HAS_TMC_SPI - #if DISABLED(TMC_USE_SW_SPI) - SETUP_RUN(SPI.begin()); - #endif - SETUP_RUN(tmc_init_cs_pins()); - #endif - SETUP_RUN(hal.init_board()); SETUP_RUN(esp_wifi_init()); From 0253500ccd5a7192f3e545cb5552c4ab7b309c5d Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Wed, 25 May 2022 08:07:11 +0200 Subject: [PATCH 358/502] Use default null args in select_screen --- Marlin/src/lcd/menu/menu_bed_corners.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index b37e05f3a4b3..c820ff15e7ee 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -201,7 +201,6 @@ static void _lcd_level_bed_corners_get_next_position() { , []{ corner_probing_done = true; wait_for_probe = false; } , []{ wait_for_probe = false; } , GET_TEXT_F(MSG_BED_TRAMMING_RAISE) - , (const char*)nullptr, NUL_STR ); } @@ -213,7 +212,6 @@ static void _lcd_level_bed_corners_get_next_position() { , []{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); } , TERN(HAS_LEVELING, ui.goto_previous_screen_no_defer, []{}) , GET_TEXT_F(MSG_BED_TRAMMING_IN_RANGE) - , (const char*)nullptr, NUL_STR ); } From fcef8d946cbd45e27ba9888f1e18327b68d52b00 Mon Sep 17 00:00:00 2001 From: lujios <83166168+lujios@users.noreply.github.com> Date: Fri, 3 Jun 2022 07:19:25 +0200 Subject: [PATCH 359/502] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Improve=20Sensorle?= =?UTF-8?q?ss=20homing/probing=20accuracy=20for=20G28,=20G33,=20M48=20(#24?= =?UTF-8?q?220)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Robby Candra Co-Authored-By: ellensp <530024+ellensp@users.noreply.github.com> --- Marlin/src/gcode/calibrate/G28.cpp | 6 + Marlin/src/gcode/calibrate/G33.cpp | 47 ++++++-- .../lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 3 +- Marlin/src/lcd/menu/menu_delta_calibrate.cpp | 8 +- Marlin/src/module/delta.cpp | 10 ++ Marlin/src/module/delta.h | 11 ++ Marlin/src/module/endstops.cpp | 66 +++++++++++ Marlin/src/module/endstops.h | 5 + Marlin/src/module/motion.cpp | 14 ++- Marlin/src/module/planner.cpp | 5 +- Marlin/src/module/probe.cpp | 103 ++++++++---------- Marlin/src/module/probe.h | 11 +- 12 files changed, 212 insertions(+), 77 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 681df55f209f..b2096ace7e51 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -321,6 +321,9 @@ void GcodeSuite::G28() { stepperK.rms_current(K_CURRENT_HOME); if (DEBUGGING(LEVELING)) debug_current(F(STR_K), tmc_save_current_K, K_CURRENT_HOME); #endif + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif #endif #if ENABLED(IMPROVE_HOMING_RELIABILITY) @@ -542,6 +545,9 @@ void GcodeSuite::G28() { #if HAS_CURRENT_HOME(K) stepperK.rms_current(tmc_save_current_K); #endif + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif #endif // HAS_HOMING_CURRENT ui.refresh(); diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 506f367947df..05da2f94571d 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -71,9 +71,9 @@ float lcd_probe_pt(const xy_pos_t &xy); void ac_home() { endstops.enable(true); - TERN_(HAS_DELTA_SENSORLESS_PROBING, probe.set_homing_current(true)); + TERN_(SENSORLESS_HOMING, endstops.set_homing_current(true)); home_delta(); - TERN_(HAS_DELTA_SENSORLESS_PROBING, probe.set_homing_current(false)); + TERN_(SENSORLESS_HOMING, endstops.set_homing_current(false)); endstops.not_homing(); } @@ -390,6 +390,8 @@ static float auto_tune_a(const float dcr) { * X Don't activate stallguard on X. * Y Don't activate stallguard on Y. * Z Don't activate stallguard on Z. + * + * S Save offset_sensorless_adj */ void GcodeSuite::G33() { @@ -411,7 +413,8 @@ void GcodeSuite::G33() { dcr -= probe_at_offset ? _MAX(total_offset, PROBING_MARGIN) : total_offset; #endif NOMORE(dcr, DELTA_PRINTABLE_RADIUS); - if (parser.seenval('R')) dcr -= _MAX(parser.value_float(),0); + if (parser.seenval('R')) dcr -= _MAX(parser.value_float(), 0.0f); + TERN_(HAS_DELTA_SENSORLESS_PROBING, dcr *= sensorless_radius_factor); const float calibration_precision = parser.floatval('C', 0.0f); if (calibration_precision < 0) { @@ -434,9 +437,8 @@ void GcodeSuite::G33() { const bool stow_after_each = parser.seen_test('E'); #if HAS_DELTA_SENSORLESS_PROBING - probe.test_sensitivity.x = !parser.seen_test('X'); - TERN_(HAS_Y_AXIS, probe.test_sensitivity.y = !parser.seen_test('Y')); - TERN_(HAS_Z_AXIS, probe.test_sensitivity.z = !parser.seen_test('Z')); + probe.test_sensitivity.set(!parser.seen_test('X'), !parser.seen_test('Y'), !parser.seen_test('Z')); + const bool do_save_offset_adj = parser.seen_test('S'); #endif const bool _0p_calibration = probe_points == 0, @@ -475,6 +477,25 @@ void GcodeSuite::G33() { if (!_0p_calibration) ac_home(); + #if HAS_DELTA_SENSORLESS_PROBING + if (verbose_level > 0 && do_save_offset_adj) { + offset_sensorless_adj.reset(); + + auto caltower = [&](Probe::sense_bool_t s){ + float z_at_pt[NPP + 1]; + LOOP_CAL_ALL(rad) z_at_pt[rad] = 0.0f; + probe.test_sensitivity = s; + if (probe_calibration_points(z_at_pt, 1, dcr, false, false, probe_at_offset)) + probe.set_offset_sensorless_adj(z_at_pt[CEN]); + }; + caltower({ true, false, false }); // A + caltower({ false, true, false }); // B + caltower({ false, false, true }); // C + + probe.test_sensitivity = { true, true, true }; // reset to all + } + #endif + do { // start iterations float z_at_pt[NPP + 1] = { 0.0f }; @@ -598,8 +619,17 @@ void GcodeSuite::G33() { // print report - if (verbose_level == 3 || verbose_level == 0) + if (verbose_level == 3 || verbose_level == 0) { print_calibration_results(z_at_pt, _tower_results, _opposite_results); + #if HAS_DELTA_SENSORLESS_PROBING + if (verbose_level == 0 && probe_points == 1) { + if (do_save_offset_adj) + probe.set_offset_sensorless_adj(z_at_pt[CEN]); + else + probe.refresh_largest_sensorless_adj(); + } + #endif + } if (verbose_level != 0) { // !dry run if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) { // end iterations @@ -660,6 +690,9 @@ void GcodeSuite::G33() { ac_cleanup(TERN_(HAS_MULTI_HOTEND, old_tool_index)); TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE)); + #if HAS_DELTA_SENSORLESS_PROBING + probe.test_sensitivity = { true, true, true }; + #endif } #endif // DELTA_AUTO_CALIBRATION diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 35c2de05497f..739265e49636 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -193,7 +193,6 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { if (!ExtUI::isPrintingFromMedia()) return; // avoid race condition when user stays in this menu and printer finishes. switch (swap16(*(uint16_t*)val_ptr)) { case 0: { // Resume - auto cs = getCurrentScreen(); if (runout_mks.runout_status != RUNOUT_WAITING_STATUS && runout_mks.runout_status != UNRUNOUT_STATUS) { if (cs == MKSLCD_SCREEN_PRINT || cs == MKSLCD_SCREEN_PAUSE) @@ -213,7 +212,6 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { } break; case 1: // Pause - GotoScreen(MKSLCD_SCREEN_PAUSE); if (!ExtUI::isPrintingFromMediaPaused()) { nozzle_park_mks.print_pause_start_flag = 1; @@ -222,6 +220,7 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { //ExtUI::mks_pausePrint(); } break; + case 2: // Abort HandleUserConfirmationPopUp(VP_SD_AbortPrintConfirmed, nullptr, PSTR("Abort printing"), filelist.filename(), PSTR("?"), true, true, false, true); break; diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index 76d5677a806f..b86f1012586d 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -41,6 +41,10 @@ #include "../extui/ui_api.h" #endif +#if HAS_PROBE_XY_OFFSET + #include "../../module/probe.h" +#endif + void _man_probe_pt(const xy_pos_t &xy) { if (!ui.wait_for_move) { ui.wait_for_move = true; @@ -88,7 +92,9 @@ void _man_probe_pt(const xy_pos_t &xy) { } void _goto_tower_a(const_float_t a) { - constexpr float dcr = DELTA_PRINTABLE_RADIUS; + float dcr = DELTA_PRINTABLE_RADIUS - PROBING_MARGIN; + TERN_(HAS_PROBE_XY_OFFSET, dcr -= HYPOT(probe.offset_xy.x, probe.offset_xy.y)); + TERN_(HAS_DELTA_SENSORLESS_PROBING, dcr *= sensorless_radius_factor); xy_pos_t tower_vec = { cos(RADIANS(a)), sin(RADIANS(a)) }; _man_probe_pt(tower_vec * dcr); } diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index cd40175da4d2..35c9cf63c776 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -60,6 +60,10 @@ xy_float_t delta_tower[ABC]; abc_float_t delta_diagonal_rod_2_tower; float delta_clip_start_height = Z_MAX_POS; abc_float_t delta_diagonal_rod_trim; +#if HAS_DELTA_SENSORLESS_PROBING + abc_float_t offset_sensorless_adj{0}; + float largest_sensorless_adj = 0; +#endif float delta_safe_distance_from_top(); @@ -233,6 +237,9 @@ void home_delta() { TERN_(I_SENSORLESS, sensorless_t stealth_states_i = start_sensorless_homing_per_axis(I_AXIS)); TERN_(J_SENSORLESS, sensorless_t stealth_states_j = start_sensorless_homing_per_axis(J_AXIS)); TERN_(K_SENSORLESS, sensorless_t stealth_states_k = start_sensorless_homing_per_axis(K_AXIS)); + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif #endif // Move all carriages together linearly until an endstop is hit. @@ -249,6 +256,9 @@ void home_delta() { TERN_(I_SENSORLESS, end_sensorless_homing_per_axis(I_AXIS, stealth_states_i)); TERN_(J_SENSORLESS, end_sensorless_homing_per_axis(J_AXIS, stealth_states_j)); TERN_(K_SENSORLESS, end_sensorless_homing_per_axis(K_AXIS, stealth_states_k)); + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif #endif endstops.validate_homing_move(); diff --git a/Marlin/src/module/delta.h b/Marlin/src/module/delta.h index 7cd42805c90a..f7067ef9c713 100644 --- a/Marlin/src/module/delta.h +++ b/Marlin/src/module/delta.h @@ -38,6 +38,10 @@ extern xy_float_t delta_tower[ABC]; extern abc_float_t delta_diagonal_rod_2_tower; extern float delta_clip_start_height; extern abc_float_t delta_diagonal_rod_trim; +#if HAS_DELTA_SENSORLESS_PROBING + extern abc_float_t offset_sensorless_adj; + extern float largest_sensorless_adj; +#endif /** * Recalculate factors used for delta kinematics whenever @@ -45,6 +49,13 @@ extern abc_float_t delta_diagonal_rod_trim; */ void recalc_delta_settings(); +/** + * Get a safe radius for calibration + */ +#if HAS_DELTA_SENSORLESS_PROBING + static constexpr float sensorless_radius_factor = 0.7f; +#endif + /** * Delta Inverse Kinematics * diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 6abbcfd8fd7c..3f980b2217af 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -31,6 +31,9 @@ #include "temperature.h" #include "../lcd/marlinui.h" +#define DEBUG_OUT BOTH(USE_SENSORLESS, DEBUG_LEVELING_FEATURE) +#include "../core/debug_out.h" + #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) #include HAL_PATH(../HAL, endstop_interrupts.h) #endif @@ -1355,3 +1358,66 @@ void Endstops::update() { } #endif // PINS_DEBUGGING + +#if USE_SENSORLESS + /** + * Change TMC driver currents to N##_CURRENT_HOME, saving the current configuration of each. + */ + void Endstops::set_homing_current(const bool onoff) { + #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT) + #define HAS_DELTA_X_CURRENT (ENABLED(DELTA) && HAS_CURRENT_HOME(X)) + #define HAS_DELTA_Y_CURRENT (ENABLED(DELTA) && HAS_CURRENT_HOME(Y)) + #if HAS_DELTA_X_CURRENT || HAS_DELTA_Y_CURRENT || HAS_CURRENT_HOME(Z) + #if HAS_DELTA_X_CURRENT + static int16_t saved_current_x; + #endif + #if HAS_DELTA_Y_CURRENT + static int16_t saved_current_y; + #endif + #if HAS_CURRENT_HOME(Z) + static int16_t saved_current_z; + #endif + auto debug_current_on = [](PGM_P const s, const int16_t a, const int16_t b) { + if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM_P(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); } + }; + if (onoff) { + #if HAS_DELTA_X_CURRENT + saved_current_x = stepperX.getMilliamps(); + stepperX.rms_current(X_CURRENT_HOME); + debug_current_on(PSTR("X"), saved_current_x, X_CURRENT_HOME); + #endif + #if HAS_DELTA_Y_CURRENT + saved_current_y = stepperY.getMilliamps(); + stepperY.rms_current(Y_CURRENT_HOME); + debug_current_on(PSTR("Y"), saved_current_y, Y_CURRENT_HOME); + #endif + #if HAS_CURRENT_HOME(Z) + saved_current_z = stepperZ.getMilliamps(); + stepperZ.rms_current(Z_CURRENT_HOME); + debug_current_on(PSTR("Z"), saved_current_z, Z_CURRENT_HOME); + #endif + } + else { + #if HAS_DELTA_X_CURRENT + stepperX.rms_current(saved_current_x); + debug_current_on(PSTR("X"), X_CURRENT_HOME, saved_current_x); + #endif + #if HAS_DELTA_Y_CURRENT + stepperY.rms_current(saved_current_y); + debug_current_on(PSTR("Y"), Y_CURRENT_HOME, saved_current_y); + #endif + #if HAS_CURRENT_HOME(Z) + stepperZ.rms_current(saved_current_z); + debug_current_on(PSTR("Z"), Z_CURRENT_HOME, saved_current_z); + #endif + } + + TERN_(IMPROVE_HOMING_RELIABILITY, planner.enable_stall_prevention(onoff)); + + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif + + #endif // XYZ + } +#endif diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index 82a44cf95b83..83d1bc826f67 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -241,6 +241,11 @@ class Endstops { static void clear_endstop_state(); static bool tmc_spi_homing_check(); #endif + public: + // Basic functions for Sensorless Homing + #if USE_SENSORLESS + static void set_homing_current(const bool onoff); + #endif }; extern Endstops endstops; diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index c2e56e22f65d..ceea7f7117d7 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1541,7 +1541,12 @@ void prepare_line_to_destination() { } // Disable stealthChop if used. Enable diag1 pin on driver. - TERN_(SENSORLESS_HOMING, stealth_states = start_sensorless_homing_per_axis(axis)); + #if ENABLED(SENSORLESS_HOMING) + stealth_states = start_sensorless_homing_per_axis(axis); + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif + #endif } #if EITHER(MORGAN_SCARA, MP_SCARA) @@ -1577,7 +1582,12 @@ void prepare_line_to_destination() { endstops.validate_homing_move(); // Re-enable stealthChop if used. Disable diag1 pin on driver. - TERN_(SENSORLESS_HOMING, end_sensorless_homing_per_axis(axis, stealth_states)); + #if ENABLED(SENSORLESS_HOMING) + end_sensorless_homing_per_axis(axis, stealth_states); + #if SENSORLESS_STALLGUARD_DELAY + safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle + #endif + #endif } } diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index dcec8e3a620a..17eab914de6f 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1657,10 +1657,7 @@ void Planner::quick_stop() { // forced to empty, there's no risk the ISR will touch this. delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - #if HAS_WIRED_LCD - // Clear the accumulated runtime - clear_block_buffer_runtime(); - #endif + TERN_(HAS_WIRED_LCD, clear_block_buffer_runtime()); // Clear the accumulated runtime // Make sure to drop any attempt of queuing moves for 1 second cleaning_buffer_counter = TEMP_TIMER_FREQUENCY; diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 9318559499fd..1b49e4d4d8b9 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -103,7 +103,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load() #endif #if ENABLED(SENSORLESS_PROBING) - Probe::sense_bool_t Probe::test_sensitivity; + Probe::sense_bool_t Probe::test_sensitivity = { true, true, true }; #endif #if ENABLED(Z_PROBE_SLED) @@ -531,12 +531,12 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { #if ENABLED(SENSORLESS_PROBING) sensorless_t stealth_states { false }; #if HAS_DELTA_SENSORLESS_PROBING - if (test_sensitivity.x) stealth_states.x = tmc_enable_stallguard(stepperX); // Delta watches all DIAG pins for a stall + if (test_sensitivity.x) stealth_states.x = tmc_enable_stallguard(stepperX); // Delta watches all DIAG pins for a stall if (test_sensitivity.y) stealth_states.y = tmc_enable_stallguard(stepperY); #endif - if (test_sensitivity.z) stealth_states.z = tmc_enable_stallguard(stepperZ); // All machines will check Z-DIAG for stall + if (test_sensitivity.z) stealth_states.z = tmc_enable_stallguard(stepperZ); // All machines will check Z-DIAG for stall + endstops.set_homing_current(true); // The "homing" current also applies to probing endstops.enable(true); - set_homing_current(true); // The "homing" current also applies to probing #endif TERN_(HAS_QUIET_PROBING, set_probing_paused(true)); @@ -553,6 +553,11 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { #endif ; + // Offset sensorless probing + #if HAS_DELTA_SENSORLESS_PROBING + if (probe_triggered) probe.refresh_largest_sensorless_adj(); + #endif + TERN_(HAS_QUIET_PROBING, set_probing_paused(false)); // Re-enable stealthChop if used. Disable diag1 pin on driver. @@ -563,7 +568,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { if (test_sensitivity.y) tmc_disable_stallguard(stepperY, stealth_states.y); #endif if (test_sensitivity.z) tmc_disable_stallguard(stepperZ, stealth_states.z); - set_homing_current(false); + endstops.set_homing_current(false); #endif #if ENABLED(BLTOUCH) @@ -666,8 +671,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { if (try_to_probe(PSTR("FAST"), z_probe_low_point, z_probe_fast_mm_s, sanity_check, Z_CLEARANCE_BETWEEN_PROBES) ) return NAN; - const float first_probe_z = current_position.z; - + const float first_probe_z = DIFF_TERN(HAS_DELTA_SENSORLESS_PROBING, current_position.z, largest_sensorless_adj); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("1st Probe Z:", first_probe_z); // Raise to give the probe clearance @@ -709,7 +713,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { TERN_(MEASURE_BACKLASH_WHEN_PROBING, backlash.measure_with_probe()); - const float z = current_position.z; + const float z = DIFF_TERN(HAS_DELTA_SENSORLESS_PROBING, current_position.z, largest_sensorless_adj); #if EXTRA_PROBING > 0 // Insert Z measurement into probes[]. Keep it sorted ascending. @@ -760,7 +764,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) { #elif TOTAL_PROBING == 2 - const float z2 = current_position.z; + const float z2 = DIFF_TERN(HAS_DELTA_SENSORLESS_PROBING, current_position.z, largest_sensorless_adj); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("2nd Probe Z:", z2, " Discrepancy:", first_probe_z - z2); @@ -842,7 +846,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai SERIAL_ERROR_MSG(STR_ERR_PROBING_FAILED); #endif } - + DEBUG_ECHOLNPGM("measured_z: ", measured_z); return measured_z; } @@ -895,58 +899,39 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai } /** - * Change the current in the TMC drivers to N##_CURRENT_HOME. And we save the current configuration of each TMC driver. + * Set the sensorless Z offset */ - void Probe::set_homing_current(const bool onoff) { - #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT) - #if HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Z) - #if ENABLED(DELTA) - static int16_t saved_current_X, saved_current_Y; - #endif - #if HAS_CURRENT_HOME(Z) - static int16_t saved_current_Z; + void Probe::set_offset_sensorless_adj(const_float_t sz) { + #if ENABLED(SENSORLESS_PROBING) + DEBUG_SECTION(pso, "Probe::set_offset_sensorless_adj", true); + #if HAS_DELTA_SENSORLESS_PROBING + if (test_sensitivity.x) offset_sensorless_adj.a = sz; + if (test_sensitivity.y) offset_sensorless_adj.b = sz; #endif - #if ((ENABLED(DELTA) && (HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(Y))) || HAS_CURRENT_HOME(Z)) - auto debug_current_on = [](PGM_P const s, const int16_t a, const int16_t b) { - if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM_P(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); } - }; + if (test_sensitivity.z) offset_sensorless_adj.c = sz; + #endif + } + + /** + * Refresh largest_sensorless_adj based on triggered endstops + */ + void Probe::refresh_largest_sensorless_adj() { + #if ENABLED(SENSORLESS_PROBING) + DEBUG_SECTION(rso, "Probe::refresh_largest_sensorless_adj", true); + largest_sensorless_adj = -3; // A reference away from any real probe height + #if HAS_DELTA_SENSORLESS_PROBING + if (TEST(endstops.state(), X_MAX)) { + NOLESS(largest_sensorless_adj, offset_sensorless_adj.a); + DEBUG_ECHOLNPGM("Endstop_X: ", largest_sensorless_adj, " TowerX"); + } + if (TEST(endstops.state(), Y_MAX)) { + NOLESS(largest_sensorless_adj, offset_sensorless_adj.b); + DEBUG_ECHOLNPGM("Endstop_Y: ", largest_sensorless_adj, " TowerY"); + } #endif - if (onoff) { - #if ENABLED(DELTA) - #if HAS_CURRENT_HOME(X) - saved_current_X = stepperX.getMilliamps(); - stepperX.rms_current(X_CURRENT_HOME); - debug_current_on(PSTR("X"), saved_current_X, X_CURRENT_HOME); - #endif - #if HAS_CURRENT_HOME(Y) - saved_current_Y = stepperY.getMilliamps(); - stepperY.rms_current(Y_CURRENT_HOME); - debug_current_on(PSTR("Y"), saved_current_Y, Y_CURRENT_HOME); - #endif - #endif - #if HAS_CURRENT_HOME(Z) - saved_current_Z = stepperZ.getMilliamps(); - stepperZ.rms_current(Z_CURRENT_HOME); - debug_current_on(PSTR("Z"), saved_current_Z, Z_CURRENT_HOME); - #endif - TERN_(IMPROVE_HOMING_RELIABILITY, planner.enable_stall_prevention(true)); - } - else { - #if ENABLED(DELTA) - #if HAS_CURRENT_HOME(X) - stepperX.rms_current(saved_current_X); - debug_current_on(PSTR("X"), X_CURRENT_HOME, saved_current_X); - #endif - #if HAS_CURRENT_HOME(Y) - stepperY.rms_current(saved_current_Y); - debug_current_on(PSTR("Y"), Y_CURRENT_HOME, saved_current_Y); - #endif - #endif - #if HAS_CURRENT_HOME(Z) - stepperZ.rms_current(saved_current_Z); - debug_current_on(PSTR("Z"), Z_CURRENT_HOME, saved_current_Z); - #endif - TERN_(IMPROVE_HOMING_RELIABILITY, planner.enable_stall_prevention(false)); + if (TEST(endstops.state(), Z_MAX)) { + NOLESS(largest_sensorless_adj, offset_sensorless_adj.c); + DEBUG_ECHOLNPGM("Endstop_Z: ", largest_sensorless_adj, " TowerZ"); } #endif } diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index a65f982bb633..5a596053d8a7 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -66,7 +66,13 @@ class Probe { public: #if ENABLED(SENSORLESS_PROBING) - typedef struct { bool x:1, y:1, z:1; } sense_bool_t; + typedef struct { + #if HAS_DELTA_SENSORLESS_PROBING + bool x:1, y:1, z:1; + #else + bool z; + #endif + } sense_bool_t; static sense_bool_t test_sensitivity; #endif @@ -299,7 +305,8 @@ class Probe { #if USE_SENSORLESS static void enable_stallguard_diag1(); static void disable_stallguard_diag1(); - static void set_homing_current(const bool onoff); + static void set_offset_sensorless_adj(const_float_t sz); + static void refresh_largest_sensorless_adj(); #endif private: From 1e127a93c4c1446cf11aacecc9597a7355262ac8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Jun 2022 00:15:23 -0500 Subject: [PATCH 360/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Ext?= =?UTF-8?q?end=20LCD=20string=20substitution=20(#24278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/dac/stepper_dac.cpp | 1 - Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp | 10 +- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 23 +- Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp | 10 +- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 142 +++++----- Marlin/src/lcd/dogm/lcdprint_u8g.cpp | 6 +- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 38 +-- Marlin/src/lcd/dogm/u8g_fontutf8.cpp | 2 +- Marlin/src/lcd/dogm/u8g_fontutf8.h | 6 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 10 +- Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp | 60 +++-- Marlin/src/lcd/e3v2/marlinui/dwin_string.h | 93 +++++-- .../src/lcd/e3v2/marlinui/lcdprint_dwin.cpp | 41 ++- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 38 ++- .../lcd/e3v2/marlinui/ui_status_480x272.cpp | 10 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 10 +- Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp | 2 +- .../bioprinter/advanced_settings.cpp | 2 +- .../cocoa_press/advanced_settings_menu.cpp | 2 +- .../generic/advanced_settings_menu.cpp | 2 +- .../generic/max_velocity_screen.cpp | 2 +- .../ftdi_eve_touch_ui/language/language.h | 2 + .../ftdi_eve_touch_ui/language/language_en.h | 254 +++++++++--------- Marlin/src/lcd/fontutils.cpp | 13 +- Marlin/src/lcd/fontutils.h | 12 +- Marlin/src/lcd/language/language_an.h | 13 +- Marlin/src/lcd/language/language_bg.h | 7 +- Marlin/src/lcd/language/language_ca.h | 11 +- Marlin/src/lcd/language/language_cz.h | 33 +-- Marlin/src/lcd/language/language_da.h | 10 +- Marlin/src/lcd/language/language_de.h | 54 +--- Marlin/src/lcd/language/language_el.h | 20 +- Marlin/src/lcd/language/language_el_gr.h | 20 +- Marlin/src/lcd/language/language_en.h | 71 ++--- Marlin/src/lcd/language/language_es.h | 41 +-- Marlin/src/lcd/language/language_eu.h | 19 +- Marlin/src/lcd/language/language_fi.h | 2 +- Marlin/src/lcd/language/language_fr.h | 43 +-- Marlin/src/lcd/language/language_gl.h | 40 +-- Marlin/src/lcd/language/language_hr.h | 2 +- Marlin/src/lcd/language/language_hu.h | 43 +-- Marlin/src/lcd/language/language_it.h | 79 +----- Marlin/src/lcd/language/language_jp_kana.h | 22 +- Marlin/src/lcd/language/language_nl.h | 3 +- Marlin/src/lcd/language/language_pl.h | 25 +- Marlin/src/lcd/language/language_pt.h | 6 +- Marlin/src/lcd/language/language_pt_br.h | 13 +- Marlin/src/lcd/language/language_ro.h | 45 ++-- Marlin/src/lcd/language/language_ru.h | 44 +-- Marlin/src/lcd/language/language_sk.h | 66 ++--- Marlin/src/lcd/language/language_sv.h | 33 +-- Marlin/src/lcd/language/language_tr.h | 33 +-- Marlin/src/lcd/language/language_uk.h | 44 +-- Marlin/src/lcd/language/language_vi.h | 31 +-- Marlin/src/lcd/language/language_zh_CN.h | 32 +-- Marlin/src/lcd/language/language_zh_TW.h | 32 +-- Marlin/src/lcd/lcdprint.cpp | 19 +- Marlin/src/lcd/lcdprint.h | 134 +++++++-- Marlin/src/lcd/marlinui.cpp | 5 +- Marlin/src/lcd/menu/menu.cpp | 7 +- Marlin/src/lcd/menu/menu.h | 22 +- Marlin/src/lcd/menu/menu_advanced.cpp | 50 ++-- Marlin/src/lcd/menu/menu_backlash.cpp | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- Marlin/src/lcd/menu/menu_filament.cpp | 20 +- Marlin/src/lcd/menu/menu_item.h | 80 +++++- Marlin/src/lcd/menu/menu_motion.cpp | 20 +- Marlin/src/lcd/menu/menu_probe_offset.cpp | 17 +- Marlin/src/lcd/menu/menu_temperature.cpp | 24 +- Marlin/src/lcd/menu/menu_tune.cpp | 8 +- Marlin/src/lcd/menu/menu_ubl.cpp | 6 +- Marlin/src/lcd/menu/menu_x_twist.cpp | 11 +- Marlin/src/lcd/tft/tft.h | 2 +- Marlin/src/lcd/tft/tft_queue.cpp | 4 +- Marlin/src/lcd/tft/tft_queue.h | 5 +- Marlin/src/lcd/tft/tft_string.cpp | 38 +-- Marlin/src/lcd/tft/tft_string.h | 93 +++++-- Marlin/src/lcd/tft/ui_1024x600.cpp | 10 +- Marlin/src/lcd/tft/ui_320x240.cpp | 10 +- Marlin/src/lcd/tft/ui_480x320.cpp | 10 +- Marlin/src/lcd/tft/ui_common.cpp | 24 +- Marlin/src/libs/L64XX/L64XX_Marlin.cpp | 2 +- buildroot/share/fonts/genpages.c | 2 +- 83 files changed, 1068 insertions(+), 1287 deletions(-) diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index ff730e93c62c..119a85959982 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -29,7 +29,6 @@ #if HAS_MOTOR_CURRENT_DAC #include "stepper_dac.h" -#include "../../MarlinCore.h" // for SP_X_LBL... bool dac_present = false; constexpr xyze_uint8_t dac_order = DAC_STEPPER_ORDER; diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index 31b26aa5bbcb..1e82fe403d9f 100644 --- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -992,7 +992,7 @@ void lcd_put_int(const int i) { lcd.print(i); } // return < 0 on error // return the advanced cols -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { // find the HD44780 internal ROM first int ret; @@ -1047,9 +1047,9 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { * * Draw a UTF-8 string */ -static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) { +static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_byte, const pixel_len_t max_length) { pixel_len_t ret = 0; - uint8_t *p = (uint8_t *)utf8_str; + const uint8_t *p = (uint8_t *)utf8_str; while (ret < max_length) { wchar_t ch = 0; p = get_utf8_value_cb(p, cb_read_byte, &ch); @@ -1059,11 +1059,11 @@ static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(u return (int)ret; } -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { +int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length); } -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_pstr, read_byte_rom, max_length); } diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index f70b5b01749f..da4db8b2d419 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -495,12 +495,13 @@ void MarlinUI::clear_lcd() { lcd.clear(); } #endif // SHOW_BOOTSCREEN void MarlinUI::draw_kill_screen() { - lcd_put_u8str(0, 0, status_message); - lcd_uint_t y = 2; + lcd_uint_t x = 0, y = 0; + lcd_put_u8str(x, y, status_message); + y = 2; #if LCD_HEIGHT >= 4 - lcd_put_u8str(0, y++, GET_TEXT_F(MSG_HALTED)); + lcd_put_u8str(x, y++, GET_TEXT_F(MSG_HALTED)); #endif - lcd_put_u8str(0, y, GET_TEXT_F(MSG_PLEASE_RESET)); + lcd_put_u8str(x, y, GET_TEXT_F(MSG_PLEASE_RESET)); } // @@ -1076,24 +1077,24 @@ void MarlinUI::draw_status_screen() { int8_t pad = (LCD_WIDTH - plen - vlen) / 2; while (--pad >= 0) { lcd_put_wchar(' '); n--; } } - if (plen) n = lcd_put_u8str_ind(fstr, itemIndex, itemString, n); + if (plen) n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); if (vlen) n -= lcd_put_u8str_max(vstr, n); for (; n > 0; --n) lcd_put_wchar(' '); } // Draw a generic menu item with pre_char (if selected) and post_char - void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) { lcd_put_wchar(0, row, sel ? pre_char : ' '); - uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2); + uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2); for (; n; --n) lcd_put_wchar(' '); lcd_put_wchar(post_char); } // Draw a menu item with a (potentially) editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) { const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0; lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen); + uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vlen); if (vlen) { lcd_put_wchar(':'); for (; n; --n) lcd_put_wchar(' '); @@ -1102,9 +1103,9 @@ void MarlinUI::draw_status_screen() { } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace - void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const ftpl, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); - uint8_t n = lcd_put_u8str_ind(0, 1, fstr, itemIndex, itemString, LCD_WIDTH - 1); + uint8_t n = lcd_put_u8str(0, 1, ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1); if (value) { lcd_put_wchar(':'); n--; const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space diff --git a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp index d0cf5795d235..7b15b786055c 100644 --- a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp @@ -991,7 +991,7 @@ void lcd_put_int(const int i) { // return < 0 on error // return the advanced cols -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { // find the HD44780 internal ROM first int ret; @@ -1045,9 +1045,9 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { * * Draw a UTF-8 string */ -static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) { +static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_byte, const pixel_len_t max_length) { pixel_len_t ret = 0; - uint8_t *p = (uint8_t *)utf8_str; + const uint8_t *p = (uint8_t *)utf8_str; while (ret < max_length) { wchar_t ch = 0; p = get_utf8_value_cb(p, cb_read_byte, &ch); @@ -1057,11 +1057,11 @@ static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(u return (int)ret; } -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { +int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length); } -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_pstr, read_byte_rom, max_length); } diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index ca830960cb8f..46564bb1e6e2 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -380,9 +380,13 @@ void MarlinUI::clear_lcd() { void MarlinUI::_set_contrast() { lcd.setContrast(contrast); } #endif +#if !IS_TFTGLCD_PANEL + void lcd_moveto(const uint8_t col, const uint8_t row) { lcd.setCursor(col, row); } +#endif + static void center_text(FSTR_P const fstart, const uint8_t y) { const uint8_t len = utf8_strlen(fstart); - lcd.setCursor(len < LCD_WIDTH ? (LCD_WIDTH - len) / 2 : 0, y); + lcd_moveto(len < LCD_WIDTH ? (LCD_WIDTH - len) / 2 : 0, y); lcd_put_u8str(fstart); } @@ -396,9 +400,9 @@ static void center_text(FSTR_P const fstart, const uint8_t y) { uint8_t indent = (LCD_WIDTH - 8) / 2; // symbols 217 (bottom right corner) and 218 (top left corner) are using for letters in some languages // and they should be moved to beginning ASCII table as special symbols - lcd.setCursor(indent, 0); lcd.write(TLC); lcd_put_u8str(F("------")); lcd.write(TRC); - lcd.setCursor(indent, 1); lcd.write(LR); lcd_put_u8str(F("Marlin")); lcd.write(LR); - lcd.setCursor(indent, 2); lcd.write(BLC); lcd_put_u8str(F("------")); lcd.write(BRC); + lcd_moveto(indent, 0); lcd.write(TLC); lcd_put_u8str(F("------")); lcd.write(TRC); + lcd_moveto(indent, 1); lcd.write(LR); lcd_put_u8str(F("Marlin")); lcd.write(LR); + lcd_moveto(indent, 2); lcd.write(BLC); lcd_put_u8str(F("------")); lcd.write(BRC); center_text(F(SHORT_BUILD_VERSION), 3); center_text(F(MARLIN_WEBSITE_URL), 4); picBits = ICON_LOGO; @@ -414,8 +418,8 @@ static void center_text(FSTR_P const fstart, const uint8_t y) { void MarlinUI::draw_kill_screen() { if (!PanelDetected) return; lcd.clear_buffer(); - lcd.setCursor(0, 3); lcd.write(COLOR_ERROR); - lcd.setCursor((LCD_WIDTH - utf8_strlen(status_message)) / 2 + 1, 3); + lcd_moveto(0, 3); lcd.write(COLOR_ERROR); + lcd_moveto((LCD_WIDTH - utf8_strlen(status_message)) / 2 + 1, 3); lcd_put_u8str(status_message); center_text(GET_TEXT_F(MSG_HALTED), 5); center_text(GET_TEXT_F(MSG_PLEASE_RESET), 6); @@ -453,25 +457,25 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #if HOTENDS < 2 if (heater_id == H_E0) { - lcd.setCursor(2, 5); lcd.print(prefix); //HE - lcd.setCursor(1, 6); lcd.print(i16tostr3rj(t1)); - lcd.setCursor(1, 7); + lcd_moveto(2, 5); lcd.print(prefix); //HE + lcd_moveto(1, 6); lcd.print(i16tostr3rj(t1)); + lcd_moveto(1, 7); } else { - lcd.setCursor(6, 5); lcd.print(prefix); //BED - lcd.setCursor(6, 6); lcd.print(i16tostr3rj(t1)); - lcd.setCursor(6, 7); + lcd_moveto(6, 5); lcd.print(prefix); //BED + lcd_moveto(6, 6); lcd.print(i16tostr3rj(t1)); + lcd_moveto(6, 7); } #else if (heater_id > H_BED) { - lcd.setCursor(heater_id * 4, 5); lcd.print(prefix); // HE1 or HE2 or HE3 - lcd.setCursor(heater_id * 4, 6); lcd.print(i16tostr3rj(t1)); - lcd.setCursor(heater_id * 4, 7); + lcd_moveto(heater_id * 4, 5); lcd.print(prefix); // HE1 or HE2 or HE3 + lcd_moveto(heater_id * 4, 6); lcd.print(i16tostr3rj(t1)); + lcd_moveto(heater_id * 4, 7); } else { - lcd.setCursor(13, 5); lcd.print(prefix); //BED - lcd.setCursor(13, 6); lcd.print(i16tostr3rj(t1)); - lcd.setCursor(13, 7); + lcd_moveto(13, 5); lcd.print(prefix); //BED + lcd_moveto(13, 6); lcd.print(i16tostr3rj(t1)); + lcd_moveto(13, 7); } #endif // HOTENDS <= 1 @@ -512,9 +516,9 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const FORCE_INLINE void _draw_cooler_status(const bool blink) { const celsius_t t2 = thermalManager.degTargetCooler(); - lcd.setCursor(0, 5); lcd_put_u8str(F("COOL")); - lcd.setCursor(1, 6); lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegCooler())); - lcd.setCursor(1, 7); + lcd_moveto(0, 5); lcd_put_u8str(F("COOL")); + lcd_moveto(1, 6); lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegCooler())); + lcd_moveto(1, 7); #if !HEATER_IDLE_HANDLER UNUSED(blink); @@ -540,9 +544,9 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #if ENABLED(LASER_COOLANT_FLOW_METER) FORCE_INLINE void _draw_flowmeter_status() { - lcd.setCursor(5, 5); lcd_put_u8str(F("FLOW")); - lcd.setCursor(7, 6); lcd_put_wchar('L'); - lcd.setCursor(6, 7); lcd_put_u8str(ftostr11ns(cooler.flowrate)); + lcd_moveto(5, 5); lcd_put_u8str(F("FLOW")); + lcd_moveto(7, 6); lcd_put_wchar('L'); + lcd_moveto(6, 7); lcd_put_u8str(ftostr11ns(cooler.flowrate)); if (cooler.flowrate) picBits |= ICON_FAN; else picBits &= ~ICON_FAN; @@ -553,18 +557,18 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #if ENABLED(I2C_AMMETER) FORCE_INLINE void _draw_ammeter_status() { - lcd.setCursor(10, 5); lcd_put_u8str(F("ILAZ")); + lcd_moveto(10, 5); lcd_put_u8str(F("ILAZ")); ammeter.read(); - lcd.setCursor(11, 6); + lcd_moveto(11, 6); if (ammeter.current <= 0.999f) { lcd_put_u8str("mA"); - lcd.setCursor(10, 7); + lcd_moveto(10, 7); lcd_put_wchar(' '); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f))); } else { lcd_put_u8str(" A"); - lcd.setCursor(10, 7); + lcd_moveto(10, 7); lcd_put_u8str(ftostr12ns(ammeter.current)); } @@ -577,16 +581,16 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #if HAS_CUTTER FORCE_INLINE void _draw_cutter_status() { - lcd.setCursor(15, 5); lcd_put_u8str(F("CUTT")); + lcd_moveto(15, 5); lcd_put_u8str(F("CUTT")); #if CUTTER_UNIT_IS(RPM) - lcd.setCursor(16, 6); lcd_put_u8str(F("RPM")); - lcd.setCursor(15, 7); lcd_put_u8str(ftostr31ns(float(cutter.unitPower) / 1000)); + lcd_moveto(16, 6); lcd_put_u8str(F("RPM")); + lcd_moveto(15, 7); lcd_put_u8str(ftostr31ns(float(cutter.unitPower) / 1000)); lcd_put_wchar('K'); #elif CUTTER_UNIT_IS(PERCENT) - lcd.setCursor(17, 6); lcd_put_wchar('%'); - lcd.setCursor(18, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); + lcd_moveto(17, 6); lcd_put_wchar('%'); + lcd_moveto(18, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); #else - lcd.setCursor(17, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); + lcd_moveto(17, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); #endif if (cutter.unitPower) picBits |= ICON_HOT; @@ -622,10 +626,10 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const lcd.write('%'); lcd.write(percent); } else { // For progress bar test - lcd.setCursor(LCD_WIDTH / 2 - 2, MIDDLE_Y); - lcd.print(i16tostr3rj(percent)); lcd.write('%'); + lcd_moveto(LCD_WIDTH / 2 - 2, MIDDLE_Y); + lcd.print(i16tostr3rj(percent)); lcd.write('%'); lcd.print_line(); - lcd.setCursor(0, MIDDLE_Y + 1); + lcd_moveto(0, MIDDLE_Y + 1); lcd.write('%'); lcd.write(percent); lcd.print_line(); } @@ -635,7 +639,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const void MarlinUI::draw_status_message(const bool blink) { if (!PanelDetected) return; - lcd.setCursor(0, 3); + lcd_moveto(0, 3); #if BOTH(FILAMENT_LCD_DISPLAY, SDSUPPORT) // Alternate Status message and Filament display @@ -784,7 +788,7 @@ void MarlinUI::draw_status_screen() { // Line 1 - XYZ coordinates // - lcd.setCursor(0, 0); + lcd_moveto(0, 0); const xyz_pos_t lpos = current_position.asLogical(); _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink); lcd.write(' '); _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink); lcd.write(' '); @@ -798,11 +802,11 @@ void MarlinUI::draw_status_screen() { // Line 2 - feedrate, , time // - lcd.setCursor(0, 1); + lcd_moveto(0, 1); lcd_put_u8str(F("FR")); lcd.print(i16tostr3rj(feedrate_percentage)); lcd.write('%'); #if BOTH(SDSUPPORT, HAS_PRINT_PROGRESS) - lcd.setCursor(LCD_WIDTH / 2 - 3, 1); + lcd_moveto(LCD_WIDTH / 2 - 3, 1); _draw_print_progress(); #endif @@ -810,14 +814,14 @@ void MarlinUI::draw_status_screen() { duration_t elapsed = print_job_timer.duration(); uint8_t len = elapsed.toDigital(buffer); - lcd.setCursor((LCD_WIDTH - 1) - len, 1); + lcd_moveto((LCD_WIDTH - 1) - len, 1); lcd.write(LCD_STR_CLOCK[0]); lcd.print(buffer); // // Line 3 - progressbar // - lcd.setCursor(0, 2); + lcd_moveto(0, 2); #if ENABLED(LCD_PROGRESS_BAR) draw_progress_bar(_get_progress()); #else @@ -836,7 +840,7 @@ void MarlinUI::draw_status_screen() { #if HOTENDS <= 1 || (HOTENDS <= 2 && !HAS_HEATED_BED) #if DUAL_MIXING_EXTRUDER - lcd.setCursor(0, 4); + lcd_moveto(0, 4); // Two-component mix / gradient instead of XY char mixer_messages[12]; const char *mix_label; @@ -892,9 +896,9 @@ void MarlinUI::draw_status_screen() { #else #define FANX 17 #endif - lcd.setCursor(FANX, 5); lcd_put_u8str(F("FAN")); - lcd.setCursor(FANX + 1, 6); lcd.write('%'); - lcd.setCursor(FANX, 7); + lcd_moveto(FANX, 5); lcd_put_u8str(F("FAN")); + lcd_moveto(FANX + 1, 6); lcd.write('%'); + lcd_moveto(FANX, 7); lcd.print(i16tostr3rj(per)); if (TERN0(HAS_FAN0, thermalManager.fan_speed[0]) || TERN0(HAS_FAN1, thermalManager.fan_speed[1]) || TERN0(HAS_FAN2, thermalManager.fan_speed[2])) @@ -927,7 +931,7 @@ void MarlinUI::draw_status_screen() { void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) { if (!PanelDetected) return; - lcd.setCursor((LCD_WIDTH - 14) / 2, row + 1); + lcd_moveto((LCD_WIDTH - 14) / 2, row + 1); lcd.write(LCD_STR_THERMOMETER[0]); lcd_put_u8str(F(" E")); lcd.write('1' + extruder); lcd.write(' '); lcd.print(i16tostr3rj(thermalManager.wholeDegHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]); lcd.write('/'); lcd.print(i16tostr3rj(thermalManager.degTargetHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]); @@ -940,12 +944,12 @@ void MarlinUI::draw_status_screen() { void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) { if (!PanelDetected) return; uint8_t n = LCD_WIDTH; - lcd.setCursor(0, row); + lcd_moveto(0, row); if ((style & SS_CENTER) && !valstr) { int8_t pad = (LCD_WIDTH - utf8_strlen(fstr)) / 2; while (--pad >= 0) { lcd.write(' '); n--; } } - n = lcd_put_u8str_ind(fstr, itemIndex, itemString, n); + n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); if (valstr) n -= lcd_put_u8str_max(valstr, n); for (; n; --n) lcd.write(' '); lcd.print_line(); @@ -954,25 +958,25 @@ void MarlinUI::draw_status_screen() { // Draw a generic menu item with pre_char (if selected) and post_char void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) { if (!PanelDetected) return; - lcd.setCursor(0, row); + lcd_moveto(0, row); lcd.write(sel ? pre_char : ' '); - uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2); + uint8_t n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2); for (; n; --n) lcd.write(' '); lcd.write(post_char); lcd.print_line(); } // Draw a menu item with a (potentially) editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const data, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { if (!PanelDetected) return; - const uint8_t vlen = data ? (pgm ? utf8_strlen_P(data) : utf8_strlen(data)) : 0; - lcd.setCursor(0, row); + const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0; + lcd_moveto(0, row); lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - uint8_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2 - vlen); + uint8_t n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vlen); if (vlen) { lcd.write(':'); for (; n; --n) lcd.write(' '); - if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str(data); + if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); } lcd.print_line(); } @@ -983,12 +987,12 @@ void MarlinUI::draw_status_screen() { if (!PanelDetected) return; ui.encoder_direction_normal(); const uint8_t y = TERN0(AUTO_BED_LEVELING_UBL, ui.external_control) ? LCD_HEIGHT - 1 : MIDDLE_Y; - lcd.setCursor(0, y); + lcd_moveto(0, y); lcd.write(COLOR_EDIT); lcd_put_u8str(fstr); if (value) { lcd.write(':'); - lcd.setCursor((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), y); // Right-justified, padded by spaces + lcd_moveto((LCD_WIDTH - 1) - (utf8_strlen(value) + 1), y); // Right-justified, padded by spaces lcd.write(' '); // Overwrite char if value gets shorter lcd.print(value); lcd.write(' '); @@ -1002,11 +1006,11 @@ void MarlinUI::draw_status_screen() { ui.draw_select_screen_prompt(pref, string, suff); lcd.write(COLOR_EDIT); if (no) { - lcd.setCursor(0, MIDDLE_Y); + lcd_moveto(0, MIDDLE_Y); lcd.write(yesno ? ' ' : '['); lcd_put_u8str(no); lcd.write(yesno ? ' ' : ']'); } if (yes) { - lcd.setCursor(LCD_WIDTH - utf8_strlen(yes) - 3, MIDDLE_Y); + lcd_moveto(LCD_WIDTH - utf8_strlen(yes) - 3, MIDDLE_Y); lcd.write(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd.write(yesno ? ']' : ' '); } lcd.print_line(); @@ -1016,7 +1020,7 @@ void MarlinUI::draw_status_screen() { void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (!PanelDetected) return; - lcd.setCursor(0, row); + lcd_moveto(0, row); lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); constexpr uint8_t maxlen = LCD_WIDTH - 2; uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); @@ -1055,23 +1059,23 @@ void MarlinUI::draw_status_screen() { lcd.clear_buffer(); //print only top left corner. All frame with grid points will be printed by panel - lcd.setCursor(0, 0); + lcd_moveto(0, 0); *fb++ = TLC; //top left corner - marker for plot parameters *fb = (GRID_MAX_POINTS_X << 4) + GRID_MAX_POINTS_Y; //set mesh size // Print plot position - lcd.setCursor(_LCD_W_POS, 0); - *fb++ = '('; lcd.print(i16tostr3left(x_plot)); - *fb++ = ','; lcd.print(i16tostr3left(y_plot)); *fb = ')'; + lcd_moveto(_LCD_W_POS, 0); + *fb++ = '('; lcd.print(i16tostr3left(x_plot)); + *fb++ = ','; lcd.print(i16tostr3left(y_plot)); *fb = ')'; // Show all values - lcd.setCursor(_LCD_W_POS, 1); lcd_put_u8str(F("X:")); + lcd_moveto(_LCD_W_POS, 1); lcd_put_u8str(F("X:")); lcd.print(ftostr52(LOGICAL_X_POSITION(pgm_read_float(&bedlevel._mesh_index_to_xpos[x_plot])))); - lcd.setCursor(_LCD_W_POS, 2); lcd_put_u8str(F("Y:")); + lcd_moveto(_LCD_W_POS, 2); lcd_put_u8str(F("Y:")); lcd.print(ftostr52(LOGICAL_Y_POSITION(pgm_read_float(&bedlevel._mesh_index_to_ypos[y_plot])))); // Show the location value - lcd.setCursor(_LCD_W_POS, 3); lcd_put_u8str(F("Z:")); + lcd_moveto(_LCD_W_POS, 3); lcd_put_u8str(F("Z:")); if (!isnan(bedlevel.z_values[x_plot][y_plot])) lcd.print(ftostr43sign(bedlevel.z_values[x_plot][y_plot])); diff --git a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp index f74a59a08c7c..f5c13798f234 100644 --- a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp +++ b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp @@ -28,7 +28,7 @@ void lcd_put_int(const int i) { u8g.print(i); } // return < 0 on error // return the advanced pixels -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { if (c < 256) { u8g.print((char)c); return u8g_GetFontBBXWidth(u8g.getU8g()); @@ -39,14 +39,14 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { return ret; } -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { +int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), ret = uxg_DrawUtf8Str(u8g.getU8g(), x, y, utf8_str, max_length); u8g.setPrintPos(x + ret, y); return ret; } -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), ret = uxg_DrawUtf8StrP(u8g.getU8g(), x, y, utf8_pstr, max_length); u8g.setPrintPos(x + ret, y); diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 3b40343628b0..3c661a44294a 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -330,13 +330,13 @@ void MarlinUI::update_language_font() { // The kill screen is displayed for unrecoverable conditions void MarlinUI::draw_kill_screen() { TERN_(LIGHTWEIGHT_UI, ST7920_Lite_Status_Screen::clear_text_buffer()); - const u8g_uint_t h4 = u8g.getHeight() / 4; + const u8g_uint_t x = 0, h4 = u8g.getHeight() / 4; u8g.firstPage(); do { set_font(FONT_MENU); - lcd_put_u8str(0, h4 * 1, status_message); - lcd_put_u8str(0, h4 * 2, GET_TEXT_F(MSG_HALTED)); - lcd_put_u8str(0, h4 * 3, GET_TEXT_F(MSG_PLEASE_RESET)); + lcd_put_u8str(x, h4 * 1, status_message); + lcd_put_u8str(x, h4 * 2, GET_TEXT_F(MSG_HALTED)); + lcd_put_u8str(x, h4 * 3, GET_TEXT_F(MSG_PLEASE_RESET)); } while (u8g.nextPage()); } @@ -412,28 +412,28 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } // Draw a static line of text in the same idiom as a menu item - void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { if (mark_as_selected(row, style & SS_INVERT)) { pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed - const int plen = fstr ? calculateWidth(FTOP(fstr)) : 0, + const int plen = ftpl ? calculateWidth(ftpl) : 0, vlen = vstr ? utf8_strlen(vstr) : 0; if (style & SS_CENTER) { int pad = (LCD_PIXEL_WIDTH - plen - vlen * MENU_FONT_WIDTH) / MENU_FONT_WIDTH / 2; while (--pad >= 0) n -= lcd_put_wchar(' '); } - if (plen) n = lcd_put_u8str_ind(fstr, itemIndex, itemString, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); + if (plen) n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); if (vlen) n -= lcd_put_u8str_max(vstr, n); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); } } // Draw a generic menu item - void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char, const char post_char) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) { if (mark_as_selected(row, sel)) { - pixel_len_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 1) * (MENU_FONT_WIDTH); + pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1) * (MENU_FONT_WIDTH); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char); lcd_put_wchar(' '); @@ -441,27 +441,27 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } // Draw a menu item with an editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) { if (mark_as_selected(row, sel)) { - const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen((char*)inStr)), - pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), (char*)inStr)); + const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)), + pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), inStr)); const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; - pixel_len_t n = lcd_put_u8str_ind(fstr, itemIndex, itemString, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH); + pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH); if (vallen) { lcd_put_wchar(':'); while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); lcd_moveto(LCD_PIXEL_WIDTH - _MAX((MENU_FONT_WIDTH) * vallen, pixelwidth + 2), row_y2); - if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str((char*)inStr); + if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); } } } - void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const ftpl, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; - const u8g_uint_t labellen = utf8_strlen(fstr), vallen = utf8_strlen(value); + const u8g_uint_t labellen = utf8_strlen(ftpl), vallen = utf8_strlen(value); bool extra_row = labellen * prop > LCD_WIDTH - 2 - vallen * prop; #if ENABLED(USE_BIG_EDIT_FONT) @@ -490,7 +490,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Assume the label is alpha-numeric (with a descender) bool onpage = PAGE_CONTAINS(baseline - (EDIT_FONT_ASCENT - 1), baseline + EDIT_FONT_DESCENT); - if (onpage) lcd_put_u8str_ind(0, baseline, fstr, itemIndex, itemString); + if (onpage) lcd_put_u8str(0, baseline, ftpl, itemIndex, itemStringC, itemStringF); // If a value is included, print a colon, then print the value right-justified if (value) { @@ -522,8 +522,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop if (inv) u8g.setColorIndex(1); } - void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { - ui.draw_select_screen_prompt(pref, string, suff); + void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const fpre, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { + ui.draw_select_screen_prompt(fpre, string, suff); if (no) draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno); if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno); } diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp index 89bdb09e1be2..8ba0e7d50a8b 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp @@ -104,7 +104,7 @@ static void fontgroup_drawwchar(font_group_t *group, const font_t *fnt_default, * Get the screen pixel width of a ROM UTF-8 string */ static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default, const char *utf8_msg, read_byte_cb_t cb_read_byte, void * userdata, fontgroup_cb_draw_t cb_draw_ram) { - uint8_t *p = (uint8_t*)utf8_msg; + const uint8_t *p = (uint8_t*)utf8_msg; for (;;) { wchar_t val = 0; p = get_utf8_value_cb(p, cb_read_byte, &val); diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.h b/Marlin/src/lcd/dogm/u8g_fontutf8.h index 9760ef106bd1..5933f027cc79 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.h +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.h @@ -26,10 +26,10 @@ typedef struct _uxg_fontinfo_t { int uxg_SetUtf8Fonts(const uxg_fontinfo_t * fntinfo, int number); // fntinfo is type of PROGMEM -unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_length); +unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, const pixel_len_t max_length); -unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_length); -unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, pixel_len_t max_length); +unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, const pixel_len_t max_length); +unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, const pixel_len_t max_length); int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg); int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg); diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index f8ba1090d91b..19155fd5e55d 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4280,14 +4280,14 @@ void CrealityDWINClass::Print_Screen_Control() { card.startOrResumeFilePrinting(); TERN_(POWER_LOSS_RECOVERY, recovery.prepare()); #else - char cmnd[20]; + char cmd[20]; #if HAS_HEATED_BED - cmnd[sprintf_P(cmnd, PSTR("M140 S%i"), pausebed)] = '\0'; - gcode.process_subcommands_now(cmnd); + sprintf_P(cmd, PSTR("M140 S%i"), pausebed); + gcode.process_subcommands_now(cmd); #endif #if HAS_EXTRUDERS - cmnd[sprintf_P(cmnd, PSTR("M109 S%i"), pausetemp)] = '\0'; - gcode.process_subcommands_now(cmnd); + sprintf_P(cmd, PSTR("M109 S%i"), pausetemp); + gcode.process_subcommands_now(cmd); #endif TERN_(HAS_FAN, thermalManager.fan_speed[0] = pausefan); planner.synchronize(); diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp b/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp index 4231c4d75f02..d631cbfafc8d 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp @@ -27,35 +27,35 @@ #include "dwin_string.h" //#include "../../fontutils.h" -uint8_t DWIN_String::data[]; +char DWIN_String::data[]; uint16_t DWIN_String::span; -uint8_t DWIN_String::len; +uint8_t DWIN_String::length; void DWIN_String::set() { //*data = 0x00; memset(data, 0x00, sizeof(data)); span = 0; - len = 0; + length = 0; } -uint8_t read_byte(uint8_t *byte) { return *byte; } +uint8_t read_byte(const uint8_t *byte) { return *byte; } /** * Add a string, applying substitutions for the following characters: * - * $ displays the clipped C-string given by the inStr argument + * $ displays the clipped string given by fstr or cstr * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) * @ displays an axis name such as XYZUVW, or E for an extruder */ -void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *inStr/*=nullptr*/) { +void DWIN_String::add(const char *tpl, const int8_t index, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/) { wchar_t wchar; - while (*string) { - string = get_utf8_value_cb(string, read_byte, &wchar); + while (*tpl) { + tpl = get_utf8_value_cb(tpl, read_byte, &wchar); if (wchar > 255) wchar |= 0x0080; - uint8_t ch = uint8_t(wchar & 0x00FF); + const uint8_t ch = uint8_t(wchar & 0x00FF); if (ch == '=' || ch == '~' || ch == '*') { if (index >= 0) { @@ -65,10 +65,12 @@ void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *inStr/*=null add_character('0' + inum); } else - add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED)); + add(index == -2 ? GET_TEXT_F(MSG_CHAMBER) : GET_TEXT_F(MSG_BED)); } - else if (ch == '$' && inStr) - add(inStr); + else if (ch == '$' && fstr) + add(fstr); + else if (ch == '$' && cstr) + add(cstr); else if (ch == '@') add_character(axis_codes[index]); else @@ -77,10 +79,10 @@ void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *inStr/*=null eol(); } -void DWIN_String::add(uint8_t *string, uint8_t max_len) { +void DWIN_String::add(const char *cstr, uint8_t max_len/*=MAX_STRING_LENGTH*/) { wchar_t wchar; - while (*string && max_len) { - string = get_utf8_value_cb(string, read_byte, &wchar); + while (*cstr && max_len) { + cstr = get_utf8_value_cb(cstr, read_byte, &wchar); /* if (wchar > 255) wchar |= 0x0080; uint8_t ch = uint8_t(wchar & 0x00FF); @@ -92,7 +94,7 @@ void DWIN_String::add(uint8_t *string, uint8_t max_len) { eol(); } -void DWIN_String::add(wchar_t character) { +void DWIN_String::add(const wchar_t character) { int ret; size_t idx = 0; dwin_charmap_t pinval; @@ -127,18 +129,18 @@ void DWIN_String::add(wchar_t character) { if (str[1]) add_character(str[1]); } -void DWIN_String::add_character(const uint8_t character) { - if (len < MAX_STRING_LENGTH) { - data[len] = character; - len++; +void DWIN_String::add_character(const char character) { + if (length < MAX_STRING_LENGTH) { + data[length] = character; + length++; //span += glyph(character)->DWidth; } } -void DWIN_String::rtrim(const uint8_t character) { - while (len) { - if (data[len - 1] == 0x20 || data[len - 1] == character) { - len--; +void DWIN_String::rtrim(const char character) { + while (length) { + if (data[length - 1] == 0x20 || data[length - 1] == character) { + length--; //span -= glyph(data[length])->DWidth; eol(); } @@ -147,18 +149,18 @@ void DWIN_String::rtrim(const uint8_t character) { } } -void DWIN_String::ltrim(const uint8_t character) { +void DWIN_String::ltrim(const char character) { uint16_t i, j; - for (i = 0; (i < len) && (data[i] == 0x20 || data[i] == character); i++) { + for (i = 0; (i < length) && (data[i] == 0x20 || data[i] == character); i++) { //span -= glyph(data[i])->DWidth; } if (i == 0) return; - for (j = 0; i < len; data[j++] = data[i++]); - len = j; + for (j = 0; i < length; data[j++] = data[i++]); + length = j; eol(); } -void DWIN_String::trim(const uint8_t character) { +void DWIN_String::trim(const char character) { rtrim(character); ltrim(character); } diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h index d013d56a870e..c29777ae7b12 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h @@ -21,6 +21,8 @@ */ #pragma once +// TODO: Make AVR-compatible with separate ROM / RAM string methods + #include "../../fontutils.h" #include "../../marlinui.h" @@ -41,14 +43,14 @@ class DWIN_String { //static glyph_t *glyphs[256]; //static font_t *font_header; - static uint8_t data[MAX_STRING_LENGTH + 1]; + static char data[MAX_STRING_LENGTH + 1]; static uint16_t span; // in pixels - static uint8_t len; // in characters - static void add_character(const uint8_t character); - static void eol() { data[len] = 0x00; } + static void add_character(const char character); + static void eol() { data[length] = 0x00; } public: + static uint8_t length; // in characters //static void set_font(const uint8_t *font); //static void add_glyphs(const uint8_t *font); @@ -57,34 +59,71 @@ class DWIN_String { //static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */ //static glyph_t *glyph(uint8_t *character) { return glyph(*character); } + /** + * @brief Set the string empty + */ static void set(); - //static void add(uint8_t character) { add_character(character); eol(); } - static void add(wchar_t character); - static void add(uint8_t *string, uint8_t max_len=MAX_STRING_LENGTH); - static void add(uint8_t *string, const int8_t index, uint8_t *inStr=nullptr); - static void set(uint8_t *string) { set(); add(string); } - static void set(wchar_t character) { set(); add(character); } - static void set(uint8_t *string, int8_t index, const char *inStr=nullptr) { set(); add(string, index, (uint8_t *)inStr); } - static void set(const char *string) { set((uint8_t *)string); } - static void set(const char *string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)string, index, inStr); } - static void add(const char *string) { add((uint8_t *)string); } - static void add(FSTR_P const string, uint8_t max_len=MAX_STRING_LENGTH) { add((uint8_t *)FTOP(string), max_len); } - static void add(FSTR_P const string, int8_t index, uint8_t *inStr=nullptr) { add((uint8_t *)FTOP(string), index, inStr); } - static void set(FSTR_P const string) { set((uint8_t *)FTOP(string)); } - static void set(FSTR_P const string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)FTOP(string), index, inStr); } - static void add(FSTR_P const string) { add((uint8_t *)FTOP(string)); } + //static void add(const char character) { add_character(character); eol(); } - static void trim(const uint8_t character=0x20); - static void rtrim(const uint8_t character=0x20); - static void ltrim(const uint8_t character=0x20); - - static void truncate(uint8_t maxlen) { if (len > maxlen) { len = maxlen; eol(); } } + /** + * @brief Append a UTF-8 character + * + * @param character The UTF-8 character + */ + static void add(wchar_t character); + static void set(wchar_t character) { set(); add(character); } - static uint8_t length() { return len; } + /** + * @brief Append / Set C-string + * + * @param cstr The string + * @param max_len Character limit + */ + static void add(const char *cstr, uint8_t max_len=MAX_STRING_LENGTH); + static void set(const char *cstr) { set(); add(cstr); } + + /** + * @brief Append / Set F-string + * + * @param fstr The string + * @param max_len Character limit + */ + static void add(FSTR_P const fstr, uint8_t max_len=MAX_STRING_LENGTH) { add(FTOP(fstr), max_len); } + static void set(FSTR_P const fstr) { set(FTOP(fstr)); } + + /** + * @brief Append / Set C-string with optional substitution + * + * @param tpl A string with optional substitution + * @param index An index + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + */ + static void add(const char *tpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr); + static void set(const char *tpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { set(); add(tpl, index, cstr, fstr); } + + /** + * @brief Append / Set F-string with optional substitution + * + * @param ftpl A ROM F-string with optional substitution + * @param index An index + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + */ + static void add(FSTR_P const ftpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { add(FTOP(ftpl), index, cstr, fstr); } + static void set(FSTR_P const ftpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { set(); add(ftpl, index, cstr, fstr); } + + // Common string ops + static void trim(const char character=' '); + static void rtrim(const char character=' '); + static void ltrim(const char character=' '); + static void truncate(const uint8_t maxlen) { if (length > maxlen) { length = maxlen; eol(); } } + + // Accessors + static char *string() { return data; } static uint16_t width() { return span; } - static uint8_t *string() { return data; } - static uint16_t center(uint16_t width) { return span > width ? 0 : (width - span) / 2; } + static uint16_t center(const uint16_t width) { return span > width ? 0 : (width - span) / 2; } }; int dwin_charmap_compare(dwin_charmap_t *v1, dwin_charmap_t *v2); diff --git a/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp b/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp index 44be749d41fc..278f17fac994 100644 --- a/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp @@ -56,20 +56,20 @@ void lcd_put_int(const int i) { } int lcd_put_dwin_string() { - DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, (char*)dwin_string.string()); - lcd_advance_cursor(dwin_string.length()); - return dwin_string.length(); + DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, dwin_string.string()); + lcd_advance_cursor(dwin_string.length); + return dwin_string.length; } // return < 0 on error // return the advanced cols -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { dwin_string.set(c); dwin_string.truncate(max_length); // Draw the char(s) at the cursor and advance the cursor - DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, (char*)dwin_string.string()); - lcd_advance_cursor(dwin_string.length()); - return dwin_string.length(); + DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, dwin_string.string()); + lcd_advance_cursor(dwin_string.length); + return dwin_string.length; } /** @@ -83,35 +83,34 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { * * Draw a UTF-8 string */ -static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) { - uint8_t *p = (uint8_t *)utf8_str; +static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_byte, const pixel_len_t max_length) { + const uint8_t *p = (uint8_t *)utf8_str; dwin_string.set(); - while (dwin_string.length() < max_length) { + while (dwin_string.length < max_length) { wchar_t ch = 0; p = get_utf8_value_cb(p, cb_read_byte, &ch); if (!ch) break; dwin_string.add(ch); } - DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, (char*)dwin_string.string()); - lcd_advance_cursor(dwin_string.length()); - return dwin_string.length(); + DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, dwin_string.string()); + lcd_advance_cursor(dwin_string.length); + return dwin_string.length; } -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { +int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length); } -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_pstr, read_byte_rom, max_length); } -lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const inStr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { - dwin_string.set(); - dwin_string.add((uint8_t*)pstr, ind, (uint8_t*)inStr); +lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char * const cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { + dwin_string.set(ptpl, ind, cstr, fstr); dwin_string.truncate(maxlen); - DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, (char*)dwin_string.string()); - lcd_advance_cursor(dwin_string.length()); - return dwin_string.length(); + DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, dwin_string.string()); + lcd_advance_cursor(dwin_string.length); + return dwin_string.length; } #if ENABLED(DEBUG_LCDPRINT) diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index d124c5294640..f01a2beddf4e 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -110,7 +110,7 @@ void MarlinUI::clear_lcd() { #define VERSION_Y 84 #endif - DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length() * 10) / 2, VERSION_Y, S(dwin_string.string())); + DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length * 10) / 2, VERSION_Y, S(dwin_string.string())); TERN_(SHOW_CUSTOM_BOOTSCREEN, safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT)); clear_lcd(); @@ -127,7 +127,7 @@ void MarlinUI::clear_lcd() { DWIN_ICON_Show(BOOT_ICON, ICON_MarlinURL, INFO_CENTER - 100 / 2, 152); DWIN_ICON_Show(BOOT_ICON, ICON_Copyright, INFO_CENTER - 126 / 2, 200); #endif - DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length() * 10) / 2, VERSION_Y, S(dwin_string.string())); + DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length * 10) / 2, VERSION_Y, S(dwin_string.string())); DWIN_UpdateLCD(); } @@ -284,7 +284,7 @@ void MarlinUI::draw_status_message(const bool blink) { else dwin_string.add(PSTR(" ")); - lcd_moveto(LCD_WIDTH - dwin_string.length(), row); + lcd_moveto(LCD_WIDTH - dwin_string.length, row); lcd_put_dwin_string(); } @@ -311,7 +311,7 @@ void MarlinUI::draw_status_message(const bool blink) { // Draw a static line of text in the same idiom as a menu item - void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { // Call mark_as_selected to draw a bigger selection box // and draw the text without a background if (mark_as_selected(row, (bool)(style & SS_INVERT), true)) { @@ -320,15 +320,15 @@ void MarlinUI::draw_status_message(const bool blink) { dwin_font.fg = Color_White; dwin_string.set(); - const int8_t plen = fstr ? utf8_strlen(fstr) : 0, + const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0, vlen = vstr ? utf8_strlen(vstr) : 0; if (style & SS_CENTER) { int8_t pad = (LCD_WIDTH - 1 - plen - vlen) / 2; while (--pad) dwin_string.add(' '); } - if (plen) dwin_string.add((uint8_t*)FTOP(fstr), itemIndex, (uint8_t*)FTOP(itemString)); - if (vlen) dwin_string.add((uint8_t*)vstr); + if (plen) dwin_string.add(ftpl, itemIndex, itemStringC, itemStringF); + if (vlen) dwin_string.add(vstr); if (style & SS_CENTER) { int8_t pad = (LCD_WIDTH - 1 - plen - vlen) / 2; while (--pad) dwin_string.add(' '); @@ -340,15 +340,15 @@ void MarlinUI::draw_status_message(const bool blink) { } // Draw a generic menu item - void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char, const char post_char) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) { if (mark_as_selected(row, sel)) { ui.set_font(DWIN_FONT_MENU); dwin_font.solid = false; dwin_font.fg = Color_White; - dwin_string.set(fstr, itemIndex, FTOP(itemString)); + dwin_string.set(ftpl, itemIndex, itemStringC, itemStringF); - pixel_len_t n = LCD_WIDTH - 1 - dwin_string.length(); + pixel_len_t n = LCD_WIDTH - 1 - dwin_string.length; while (--n > 1) dwin_string.add(' '); dwin_string.add(post_char); @@ -361,7 +361,7 @@ void MarlinUI::draw_status_message(const bool blink) { // // Draw a menu item with an editable value // - void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) { if (mark_as_selected(row, sel)) { ui.set_font(DWIN_FONT_MENU); dwin_font.solid = false; @@ -369,7 +369,7 @@ void MarlinUI::draw_status_message(const bool blink) { const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen(S(inStr))); - dwin_string.set(fstr, itemIndex, FTOP(itemString)); + dwin_string.set(ftpl, itemIndex, itemStringC, itemStringF); if (vallen) dwin_string.add(':'); lcd_moveto(1, row); @@ -392,8 +392,7 @@ void MarlinUI::draw_status_message(const bool blink) { const dwin_coord_t labellen = utf8_strlen(fstr), vallen = utf8_strlen(value); - dwin_string.set(); - dwin_string.add((uint8_t*)FTOP(fstr), itemIndex); + dwin_string.set(FTOP(fstr), itemIndex); if (vallen) dwin_string.add(':'); // If a value is included, add a colon // Assume the label is alpha-numeric (with a descender) @@ -406,8 +405,7 @@ void MarlinUI::draw_status_message(const bool blink) { // If a value is included, print the value in larger text below the label if (vallen) { - dwin_string.set(); - dwin_string.add(value); + dwin_string.set(value); const dwin_coord_t by = (row * MENU_LINE_HEIGHT) + MENU_FONT_HEIGHT + EXTRA_ROW_HEIGHT / 2; DWIN_Draw_String(true, font16x32, Color_Yellow, Color_Bg_Black, (LCD_PIXEL_WIDTH - vallen * 16) / 2, by, S(dwin_string.string())); @@ -464,8 +462,8 @@ void MarlinUI::draw_status_message(const bool blink) { maxlen -= 2; } - dwin_string.add((uint8_t*)ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); - uint8_t n = maxlen - dwin_string.length(); + dwin_string.add(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); + uint8_t n = maxlen - dwin_string.length; while (n > 0) { dwin_string.add(' '); --n; } lcd_moveto(1, row); lcd_put_dwin_string(); @@ -548,7 +546,7 @@ void MarlinUI::draw_status_message(const bool blink) { dwin_string.add(i8tostr3rj(y_plot)); dwin_string.add(")"); lcd_moveto( - TERN(DWIN_MARLINUI_LANDSCAPE, ((x_offset + x_map_pixels) / MENU_FONT_WIDTH) + 2, LCD_WIDTH - dwin_string.length()), + TERN(DWIN_MARLINUI_LANDSCAPE, ((x_offset + x_map_pixels) / MENU_FONT_WIDTH) + 2, LCD_WIDTH - dwin_string.length), TERN(DWIN_MARLINUI_LANDSCAPE, LCD_HEIGHT - 2, ((y_offset + y_map_pixels) / MENU_LINE_HEIGHT) + 1) ); lcd_put_dwin_string(); @@ -560,7 +558,7 @@ void MarlinUI::draw_status_message(const bool blink) { else dwin_string.add(PSTR(" -----")); lcd_moveto( - TERN(DWIN_MARLINUI_LANDSCAPE, ((x_offset + x_map_pixels) / MENU_FONT_WIDTH) + 2, LCD_WIDTH - dwin_string.length()), + TERN(DWIN_MARLINUI_LANDSCAPE, ((x_offset + x_map_pixels) / MENU_FONT_WIDTH) + 2, LCD_WIDTH - dwin_string.length), TERN(DWIN_MARLINUI_LANDSCAPE, LCD_HEIGHT - 1, ((y_offset + y_map_pixels) / MENU_LINE_HEIGHT) + 2) ); lcd_put_dwin_string(); diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index ba6814a57a10..810eaf361a09 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -72,8 +72,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const uint8_t vallen = utf8_strlen(value); if (!ui.did_first_redraw) { - dwin_string.set(); - dwin_string.add('X' + axis); + dwin_string.set('X' + axis); DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (vallen * 14 - 14) / 2, y + 2, S(dwin_string.string())); } @@ -96,8 +95,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #else // !DWIN_MARLINUI_PORTRAIT if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) { - dwin_string.set(); - dwin_string.add('X' + axis); + dwin_string.set('X' + axis); DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x, y, S(dwin_string.string())); } @@ -391,7 +389,7 @@ void MarlinUI::draw_status_screen() { time.toDigital(buffer); dwin_string.add(prefix); dwin_string.add(buffer); - DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, (LCD_PIXEL_WIDTH - ((dwin_string.length() + 1) * 14)), 290, S(dwin_string.string())); + DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, (LCD_PIXEL_WIDTH - ((dwin_string.length + 1) * 14)), 290, S(dwin_string.string())); #else @@ -454,7 +452,7 @@ void MarlinUI::draw_status_screen() { dwin_string.add(PSTR("%")); DWIN_Draw_String( false, font16x32, Percent_Color, Color_Bg_Black, - pb_left + (pb_width - dwin_string.length() * 16) / 2, + pb_left + (pb_width - dwin_string.length * 16) / 2, pb_top + (pb_height - 32) / 2, S(dwin_string.string()) ); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 122136c1a082..709ed05fed73 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -3437,14 +3437,14 @@ void Draw_MaxSpeed_Menu() { if (!MaxSpeedMenu) MaxSpeedMenu = new MenuClass(); if (CurrentMenu != MaxSpeedMenu) { CurrentMenu = MaxSpeedMenu; - SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MAXSPEED)); + SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MAX_SPEED)); MenuItemsPrepare(5); BACK_ITEM(Draw_Motion_Menu); - EDIT_ITEM_F(ICON_MaxSpeedX, MSG_MAXSPEED_X, onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); - EDIT_ITEM_F(ICON_MaxSpeedY, MSG_MAXSPEED_Y, onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); - EDIT_ITEM_F(ICON_MaxSpeedZ, MSG_MAXSPEED_Z, onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedX, MSG_VMAX_A, onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedY, MSG_VMAX_B, onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedZ, MSG_VMAX_C, onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); #if HAS_HOTEND - EDIT_ITEM_F(ICON_MaxSpeedE, MSG_MAXSPEED_E, onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[E_AXIS]); + EDIT_ITEM_F(ICON_MaxSpeedE, MSG_VMAX_E, onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[E_AXIS]); #endif } CurrentMenu->draw(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp index f2cefe0cb745..6cdafc8a935f 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp @@ -147,7 +147,7 @@ void DWIN_SRAMToPic(uint8_t picID) { //--------------------------Test area ------------------------- -//void DWIN_ReadSRAM(uint16_t addr, uint8_t length, const char * const data) { +//void DWIN_ReadSRAM(uint16_t addr, const uint8_t length, const char * const data) { // size_t i = 0; // DWIN_Byte(i, 0x32); // DWIN_Byte(i, 0x5A); // 0x5A Read from SRAM - 0xA5 Read from Flash diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp index e9df264c1dd2..e3b95c4cd490 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/advanced_settings.cpp @@ -54,7 +54,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(7) .button(BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) - .tag(8) .button(BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) + .tag(8) .button(BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MAX_SPEED)) .tag(9) .button(BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) .tag(10) .button(BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) .enabled(ENABLED(BACKLASH_GCODE)) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp index 888f2c2cdd24..00cdf76331d6 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/advanced_settings_menu.cpp @@ -59,7 +59,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(3) .button(TMC_CURRENT_POS, GET_TEXT_F(MSG_TMC_CURRENT)) .enabled(ENABLED(LIN_ADVANCE)) .tag(4) .button(LIN_ADVANCE_POS, GET_TEXT_F(MSG_LINEAR_ADVANCE)) - .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) + .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_MAX_SPEED)) .tag(6) .button(ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) .tag(7) .button(JERK_POS, GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) .tag(8) .button(ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS)) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp index 8e0a01e1c8a3..8753b44e709b 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp @@ -105,7 +105,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(15).button(DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) .tag(9) .button(INTERFACE_POS, GET_TEXT_F(MSG_INTERFACE)) .tag(10).button(RESTORE_DEFAULTS_POS, GET_TEXT_F(MSG_RESTORE_DEFAULTS)) - .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_VELOCITY)) + .tag(5) .button(VELOCITY_POS, GET_TEXT_F(MSG_MAX_SPEED)) .tag(6) .button(ACCELERATION_POS, GET_TEXT_F(MSG_ACCELERATION)) .tag(7) .button(JERK_POS, GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK))) .enabled(ENABLED(BACKLASH_GCODE)) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp index 011127621120..e7fc23ab4870 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/max_velocity_screen.cpp @@ -34,7 +34,7 @@ void MaxVelocityScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(0); w.units(GET_TEXT_F(MSG_UNITS_MM_S)); - w.heading( GET_TEXT_F(MSG_VELOCITY)); + w.heading( GET_TEXT_F(MSG_MAX_SPEED)); w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_VMAX_X), getAxisMaxFeedrate_mm_s(X) ); w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_VMAX_Y), getAxisMaxFeedrate_mm_s(Y) ); w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_VMAX_Z), getAxisMaxFeedrate_mm_s(Z) ); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.h index cbc05c5aa3b0..8c123db6a1f7 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.h @@ -20,4 +20,6 @@ ****************************************************************************/ #pragma once +#define LSTR PROGMEM Language_Str + #include "language_en.h" diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h index 83e762430ce1..5dbde8a5c359 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h @@ -36,142 +36,142 @@ #endif namespace Language_en { - PROGMEM Language_Str MSG_BUTTON_OKAY = u8"Okay"; - PROGMEM Language_Str MSG_BUTTON_MENU = u8"Menu"; - PROGMEM Language_Str MSG_BUTTON_MEDIA = u8"Media"; - PROGMEM Language_Str MSG_BUTTON_OPEN = u8"Open"; - PROGMEM Language_Str MSG_CLEAN_NOZZLE = u8"Clean Nozzle"; - PROGMEM Language_Str MSG_VMAX_X = u8"Vmax X"; - PROGMEM Language_Str MSG_VMAX_Y = u8"Vmax Y"; - PROGMEM Language_Str MSG_VMAX_Z = u8"Vmax Z"; - PROGMEM Language_Str MSG_ACCEL_PRINTING = u8"Printing"; - PROGMEM Language_Str MSG_ACCEL_TRAVEL = u8"Travel"; - PROGMEM Language_Str MSG_ACCEL_RETRACT = u8"Retraction"; - PROGMEM Language_Str MSG_AMAX_X = u8"Amax X"; - PROGMEM Language_Str MSG_AMAX_Y = u8"Amax Y"; - PROGMEM Language_Str MSG_AMAX_Z = u8"Amax Z"; - PROGMEM Language_Str MSG_AXIS_X = u8"X"; - PROGMEM Language_Str MSG_AXIS_X2 = u8"X2"; - PROGMEM Language_Str MSG_AXIS_Y = u8"Y"; - PROGMEM Language_Str MSG_AXIS_Y2 = u8"Y2"; - PROGMEM Language_Str MSG_AXIS_Z = u8"Z"; - PROGMEM Language_Str MSG_AXIS_Z2 = u8"Z2"; - PROGMEM Language_Str MSG_AXIS_E = u8"E"; - PROGMEM Language_Str MSG_AXIS_E1 = u8"E1"; - PROGMEM Language_Str MSG_AXIS_E2 = u8"E2"; - PROGMEM Language_Str MSG_AXIS_E3 = u8"E3"; - PROGMEM Language_Str MSG_AXIS_E4 = u8"E4"; - PROGMEM Language_Str MSG_AXIS_ALL = u8"All"; - PROGMEM Language_Str MSG_HOME = u8"Home"; - PROGMEM Language_Str MSG_PRINT_STARTING = u8"Print starting"; - PROGMEM Language_Str MSG_PRINT_FINISHED = u8"Print finished"; - PROGMEM Language_Str MSG_PRINT_ERROR = u8"Print error"; - PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_1 = u8"Color Touch Panel"; - PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_2 = WEBSITE_URL; - PROGMEM Language_Str MSG_LICENSE = u8"This program is free software: you can redistribute it and/or modify it under the terms of " + LSTR MSG_BUTTON_OKAY = u8"Okay"; + LSTR MSG_BUTTON_MENU = u8"Menu"; + LSTR MSG_BUTTON_MEDIA = u8"Media"; + LSTR MSG_BUTTON_OPEN = u8"Open"; + LSTR MSG_CLEAN_NOZZLE = u8"Clean Nozzle"; + LSTR MSG_VMAX_X = u8"Max X Speed"; + LSTR MSG_VMAX_Y = u8"Max Y Speed"; + LSTR MSG_VMAX_Z = u8"Max Z Speed"; + LSTR MSG_ACCEL_PRINTING = u8"Printing"; + LSTR MSG_ACCEL_TRAVEL = u8"Travel"; + LSTR MSG_ACCEL_RETRACT = u8"Retraction"; + LSTR MSG_AMAX_X = u8"Max X Accel."; + LSTR MSG_AMAX_Y = u8"Max Y Accel."; + LSTR MSG_AMAX_Z = u8"Max Z Accel."; + LSTR MSG_AXIS_X = u8"X"; + LSTR MSG_AXIS_X2 = u8"X2"; + LSTR MSG_AXIS_Y = u8"Y"; + LSTR MSG_AXIS_Y2 = u8"Y2"; + LSTR MSG_AXIS_Z = u8"Z"; + LSTR MSG_AXIS_Z2 = u8"Z2"; + LSTR MSG_AXIS_E = u8"E"; + LSTR MSG_AXIS_E1 = u8"E1"; + LSTR MSG_AXIS_E2 = u8"E2"; + LSTR MSG_AXIS_E3 = u8"E3"; + LSTR MSG_AXIS_E4 = u8"E4"; + LSTR MSG_AXIS_ALL = u8"All"; + LSTR MSG_HOME = u8"Home"; + LSTR MSG_PRINT_STARTING = u8"Print starting"; + LSTR MSG_PRINT_FINISHED = u8"Print finished"; + LSTR MSG_PRINT_ERROR = u8"Print error"; + LSTR MSG_ABOUT_TOUCH_PANEL_1 = u8"Color Touch Panel"; + LSTR MSG_ABOUT_TOUCH_PANEL_2 = WEBSITE_URL; + LSTR MSG_LICENSE = u8"This program is free software: you can redistribute it and/or modify it under the terms of " "the GNU General Public License as published by the Free Software Foundation, either version 3 " "of the License, or (at your option) any later version. To view a copy of the GNU General " "Public License, go to the following location: https://www.gnu.org/licenses."; - PROGMEM Language_Str MSG_RUNOUT_1 = u8"Runout 1"; - PROGMEM Language_Str MSG_RUNOUT_2 = u8"Runout 2"; - PROGMEM Language_Str MSG_DISPLAY_MENU = u8"Display"; - PROGMEM Language_Str MSG_INTERFACE = u8"Interface"; - PROGMEM Language_Str MSG_MEASURE_AUTOMATICALLY = u8"Measure automatically"; - PROGMEM Language_Str MSG_H_OFFSET = u8"H Offset"; - PROGMEM Language_Str MSG_V_OFFSET = u8"V Offset"; - PROGMEM Language_Str MSG_TOUCH_SCREEN = u8"Touch Screen"; - PROGMEM Language_Str MSG_CALIBRATE = u8"Calibrate"; - PROGMEM Language_Str MSG_UNITS_MILLIAMP = u8"mA"; - PROGMEM Language_Str MSG_UNITS_MM = u8"mm"; - PROGMEM Language_Str MSG_UNITS_MM_S = u8"mm/s"; - PROGMEM Language_Str MSG_UNITS_MM_S2 = u8"mm/s" SUPERSCRIPT_TWO; - PROGMEM Language_Str MSG_UNITS_STEP_MM = u8"st/mm"; - PROGMEM Language_Str MSG_UNITS_PERCENT = u8"%"; - PROGMEM Language_Str MSG_UNITS_C = DEGREE_SIGN u8"C"; - PROGMEM Language_Str MSG_IDLE = u8"idle"; - PROGMEM Language_Str MSG_SET_MAXIMUM = u8"Set Maximum"; - PROGMEM Language_Str MSG_PRINT_SPEED = u8"Print Speed"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE = u8"Linear Advance"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K = u8"K"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K1 = u8"K E1"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K2 = u8"K E2"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K3 = u8"K E3"; - PROGMEM Language_Str MSG_LINEAR_ADVANCE_K4 = u8"K E4"; - PROGMEM Language_Str MSG_NUDGE_NOZZLE = u8"Nudge Nozzle"; - PROGMEM Language_Str MSG_ADJUST_BOTH_NOZZLES = u8"Adjust Both Nozzles"; - PROGMEM Language_Str MSG_SHOW_OFFSETS = u8"Show Offsets"; - PROGMEM Language_Str MSG_INCREMENT = u8"Increment"; - PROGMEM Language_Str MSG_ERASE_FLASH_WARNING = u8"Are you sure? SPI flash will be erased."; - PROGMEM Language_Str MSG_ERASING = u8"Erasing..."; - PROGMEM Language_Str MSG_ERASED = u8"SPI flash erased"; - PROGMEM Language_Str MSG_CALIBRATION_WARNING = u8"For best results, unload the filament and clean the hotend prior to starting calibration. Continue?"; - PROGMEM Language_Str MSG_START_PRINT_CONFIRMATION = u8"Start printing %s?"; - PROGMEM Language_Str MSG_ABORT_WARNING = u8"Are you sure you want to cancel the print?"; - PROGMEM Language_Str MSG_EXTRUDER_SELECTION = u8"Extruder Selection"; - PROGMEM Language_Str MSG_CURRENT_TEMPERATURE = u8"Current Temp"; - PROGMEM Language_Str MSG_REMOVAL_TEMPERATURE = u8"Removal Temp"; - PROGMEM Language_Str MSG_CAUTION = u8"Caution:"; - PROGMEM Language_Str MSG_HOT = u8"Hot!"; - PROGMEM Language_Str MSG_UNLOAD_FILAMENT = u8"Unload/Retract"; - PROGMEM Language_Str MSG_LOAD_FILAMENT = u8"Load/Extrude"; - PROGMEM Language_Str MSG_MOMENTARY = u8"Momentary"; - PROGMEM Language_Str MSG_CONTINUOUS = u8"Continuous"; - PROGMEM Language_Str MSG_PRINT_MENU = u8"Print Menu"; - PROGMEM Language_Str MSG_FINE_MOTION = u8"Fine motion"; - PROGMEM Language_Str MSG_ENABLE_MEDIA = u8"Enable Media"; - PROGMEM Language_Str MSG_INSERT_MEDIA = u8"Insert Media..."; - PROGMEM Language_Str MSG_LCD_BRIGHTNESS = u8"LCD brightness"; - PROGMEM Language_Str MSG_SOUND_VOLUME = u8"Sound volume"; - PROGMEM Language_Str MSG_SCREEN_LOCK = u8"Screen lock"; - PROGMEM Language_Str MSG_BOOT_SCREEN = u8"Boot screen"; - PROGMEM Language_Str MSG_SOUNDS = u8"Sounds"; - PROGMEM Language_Str MSG_CLICK_SOUNDS = u8"Click sounds"; - PROGMEM Language_Str MSG_EEPROM_RESTORED = u8"Settings restored from backup"; - PROGMEM Language_Str MSG_EEPROM_RESET = u8"Settings restored to default"; - PROGMEM Language_Str MSG_EEPROM_SAVED = u8"Settings saved!"; - PROGMEM Language_Str MSG_EEPROM_SAVE_PROMPT = u8"Settings applied. Save these settings for next power-on?"; - PROGMEM Language_Str MSG_EEPROM_RESET_WARNING = u8"Are you sure? Customizations will be lost."; + LSTR MSG_RUNOUT_1 = u8"Runout 1"; + LSTR MSG_RUNOUT_2 = u8"Runout 2"; + LSTR MSG_DISPLAY_MENU = u8"Display"; + LSTR MSG_INTERFACE = u8"Interface"; + LSTR MSG_MEASURE_AUTOMATICALLY = u8"Measure automatically"; + LSTR MSG_H_OFFSET = u8"H Offset"; + LSTR MSG_V_OFFSET = u8"V Offset"; + LSTR MSG_TOUCH_SCREEN = u8"Touch Screen"; + LSTR MSG_CALIBRATE = u8"Calibrate"; + LSTR MSG_UNITS_MILLIAMP = u8"mA"; + LSTR MSG_UNITS_MM = u8"mm"; + LSTR MSG_UNITS_MM_S = u8"mm/s"; + LSTR MSG_UNITS_MM_S2 = u8"mm/s" SUPERSCRIPT_TWO; + LSTR MSG_UNITS_STEP_MM = u8"st/mm"; + LSTR MSG_UNITS_PERCENT = u8"%"; + LSTR MSG_UNITS_C = DEGREE_SIGN u8"C"; + LSTR MSG_IDLE = u8"idle"; + LSTR MSG_SET_MAXIMUM = u8"Set Maximum"; + LSTR MSG_PRINT_SPEED = u8"Print Speed"; + LSTR MSG_LINEAR_ADVANCE = u8"Linear Advance"; + LSTR MSG_LINEAR_ADVANCE_K = u8"K"; + LSTR MSG_LINEAR_ADVANCE_K1 = u8"K E1"; + LSTR MSG_LINEAR_ADVANCE_K2 = u8"K E2"; + LSTR MSG_LINEAR_ADVANCE_K3 = u8"K E3"; + LSTR MSG_LINEAR_ADVANCE_K4 = u8"K E4"; + LSTR MSG_NUDGE_NOZZLE = u8"Nudge Nozzle"; + LSTR MSG_ADJUST_BOTH_NOZZLES = u8"Adjust Both Nozzles"; + LSTR MSG_SHOW_OFFSETS = u8"Show Offsets"; + LSTR MSG_INCREMENT = u8"Increment"; + LSTR MSG_ERASE_FLASH_WARNING = u8"Are you sure? SPI flash will be erased."; + LSTR MSG_ERASING = u8"Erasing..."; + LSTR MSG_ERASED = u8"SPI flash erased"; + LSTR MSG_CALIBRATION_WARNING = u8"For best results, unload the filament and clean the hotend prior to starting calibration. Continue?"; + LSTR MSG_START_PRINT_CONFIRMATION = u8"Start printing %s?"; + LSTR MSG_ABORT_WARNING = u8"Are you sure you want to cancel the print?"; + LSTR MSG_EXTRUDER_SELECTION = u8"Extruder Selection"; + LSTR MSG_CURRENT_TEMPERATURE = u8"Current Temp"; + LSTR MSG_REMOVAL_TEMPERATURE = u8"Removal Temp"; + LSTR MSG_CAUTION = u8"Caution:"; + LSTR MSG_HOT = u8"Hot!"; + LSTR MSG_UNLOAD_FILAMENT = u8"Unload/Retract"; + LSTR MSG_LOAD_FILAMENT = u8"Load/Extrude"; + LSTR MSG_MOMENTARY = u8"Momentary"; + LSTR MSG_CONTINUOUS = u8"Continuous"; + LSTR MSG_PRINT_MENU = u8"Print Menu"; + LSTR MSG_FINE_MOTION = u8"Fine motion"; + LSTR MSG_ENABLE_MEDIA = u8"Enable Media"; + LSTR MSG_INSERT_MEDIA = u8"Insert Media..."; + LSTR MSG_LCD_BRIGHTNESS = u8"LCD brightness"; + LSTR MSG_SOUND_VOLUME = u8"Sound volume"; + LSTR MSG_SCREEN_LOCK = u8"Screen lock"; + LSTR MSG_BOOT_SCREEN = u8"Boot screen"; + LSTR MSG_SOUNDS = u8"Sounds"; + LSTR MSG_CLICK_SOUNDS = u8"Click sounds"; + LSTR MSG_EEPROM_RESTORED = u8"Settings restored from backup"; + LSTR MSG_EEPROM_RESET = u8"Settings restored to default"; + LSTR MSG_EEPROM_SAVED = u8"Settings saved!"; + LSTR MSG_EEPROM_SAVE_PROMPT = u8"Settings applied. Save these settings for next power-on?"; + LSTR MSG_EEPROM_RESET_WARNING = u8"Are you sure? Customizations will be lost."; - PROGMEM Language_Str MSG_PASSCODE_REJECTED = u8"Wrong passcode!"; - PROGMEM Language_Str MSG_PASSCODE_ACCEPTED = u8"Passcode accepted!"; - PROGMEM Language_Str MSG_PASSCODE_SELECT = u8"Select Passcode:"; - PROGMEM Language_Str MSG_PASSCODE_REQUEST = u8"Enter Passcode:"; + LSTR MSG_PASSCODE_REJECTED = u8"Wrong passcode!"; + LSTR MSG_PASSCODE_ACCEPTED = u8"Passcode accepted!"; + LSTR MSG_PASSCODE_SELECT = u8"Select Passcode:"; + LSTR MSG_PASSCODE_REQUEST = u8"Enter Passcode:"; - PROGMEM Language_Str MSG_TOUCH_CALIBRATION_START = u8"Release to begin screen calibration"; - PROGMEM Language_Str MSG_TOUCH_CALIBRATION_PROMPT = u8"Touch the dots to calibrate"; - PROGMEM Language_Str MSG_BED_MAPPING_DONE = u8"Bed mapping finished"; - PROGMEM Language_Str MSG_BED_MAPPING_INCOMPLETE = u8"Not all points probed"; - PROGMEM Language_Str MSG_LEVELING = u8"Leveling"; - PROGMEM Language_Str MSG_AXIS_LEVELING = u8"Axis Leveling"; - PROGMEM Language_Str MSG_PROBE_BED = u8"Probe Mesh"; - PROGMEM Language_Str MSG_PRINT_TEST = u8"Print Test (PLA)"; - PROGMEM Language_Str MSG_MOVE_Z_TO_TOP = u8"Raise Z to Top"; + LSTR MSG_TOUCH_CALIBRATION_START = u8"Release to begin screen calibration"; + LSTR MSG_TOUCH_CALIBRATION_PROMPT = u8"Touch the dots to calibrate"; + LSTR MSG_BED_MAPPING_DONE = u8"Bed mapping finished"; + LSTR MSG_BED_MAPPING_INCOMPLETE = u8"Not all points probed"; + LSTR MSG_LEVELING = u8"Leveling"; + LSTR MSG_AXIS_LEVELING = u8"Axis Leveling"; + LSTR MSG_PROBE_BED = u8"Probe Mesh"; + LSTR MSG_PRINT_TEST = u8"Print Test (PLA)"; + LSTR MSG_MOVE_Z_TO_TOP = u8"Raise Z to Top"; #if ENABLED(TOUCH_UI_LULZBOT_BIO) - PROGMEM Language_Str MSG_MOVE_TO_HOME = u8"Move to Home"; - PROGMEM Language_Str MSG_RAISE_PLUNGER = u8"Raise Plunger"; - PROGMEM Language_Str MSG_RELEASE_XY_AXIS = u8"Release X and Y Axis"; - PROGMEM Language_Str MSG_BED_TEMPERATURE = u8"Bed Temperature"; - PROGMEM Language_Str MSG_HOME_XYZ_WARNING = u8"About to move to home position. Ensure the top and the bed of the printer are clear.\n\nContinue?"; - PROGMEM Language_Str MSG_HOME_E_WARNING = u8"About to re-home plunger and auto-level. Remove syringe prior to proceeding.\n\nContinue?"; + LSTR MSG_MOVE_TO_HOME = u8"Move to Home"; + LSTR MSG_RAISE_PLUNGER = u8"Raise Plunger"; + LSTR MSG_RELEASE_XY_AXIS = u8"Release X and Y Axis"; + LSTR MSG_BED_TEMPERATURE = u8"Bed Temperature"; + LSTR MSG_HOME_XYZ_WARNING = u8"About to move to home position. Ensure the top and the bed of the printer are clear.\n\nContinue?"; + LSTR MSG_HOME_E_WARNING = u8"About to re-home plunger and auto-level. Remove syringe prior to proceeding.\n\nContinue?"; #endif #ifdef TOUCH_UI_COCOA_PRESS - PROGMEM Language_Str MSG_BODY = u8"Body"; - PROGMEM Language_Str MSG_SELECT_CHOCOLATE_TYPE = u8"Select Chocolate Type"; - PROGMEM Language_Str MSG_EXTERNAL = u8"External"; - PROGMEM Language_Str MSG_CHOCOLATE = u8"Chocolate"; - PROGMEM Language_Str MSG_UNLOAD_CARTRIDGE = u8"Unload Cartridge"; - PROGMEM Language_Str MSG_LOAD_UNLOAD = u8"Load/Unload"; - PROGMEM Language_Str MSG_FULL_LOAD = u8"Full Load"; - PROGMEM Language_Str MSG_FULL_UNLOAD = u8"Full Unload"; - PROGMEM Language_Str MSG_PREHEAT_CHOCOLATE = u8"Preheat Chocolate"; - PROGMEM Language_Str MSG_PREHEAT_FINISHED = u8"Preheat finished"; - PROGMEM Language_Str MSG_PREHEAT = u8"Preheat"; - PROGMEM Language_Str MSG_BUTTON_PAUSE = u8"Pause"; - PROGMEM Language_Str MSG_BUTTON_RESUME = u8"Resume"; - PROGMEM Language_Str MSG_ELAPSED_PRINT = u8"Elapsed Print"; - PROGMEM Language_Str MSG_XYZ_MOVE = u8"XYZ Move"; - PROGMEM Language_Str MSG_E_MOVE = u8"Extrusion Move"; + LSTR MSG_BODY = u8"Body"; + LSTR MSG_SELECT_CHOCOLATE_TYPE = u8"Select Chocolate Type"; + LSTR MSG_EXTERNAL = u8"External"; + LSTR MSG_CHOCOLATE = u8"Chocolate"; + LSTR MSG_UNLOAD_CARTRIDGE = u8"Unload Cartridge"; + LSTR MSG_LOAD_UNLOAD = u8"Load/Unload"; + LSTR MSG_FULL_LOAD = u8"Full Load"; + LSTR MSG_FULL_UNLOAD = u8"Full Unload"; + LSTR MSG_PREHEAT_CHOCOLATE = u8"Preheat Chocolate"; + LSTR MSG_PREHEAT_FINISHED = u8"Preheat finished"; + LSTR MSG_PREHEAT = u8"Preheat"; + LSTR MSG_BUTTON_PAUSE = u8"Pause"; + LSTR MSG_BUTTON_RESUME = u8"Resume"; + LSTR MSG_ELAPSED_PRINT = u8"Elapsed Print"; + LSTR MSG_XYZ_MOVE = u8"XYZ Move"; + LSTR MSG_E_MOVE = u8"Extrusion Move"; #endif }; // namespace Language_en diff --git a/Marlin/src/lcd/fontutils.cpp b/Marlin/src/lcd/fontutils.cpp index 50b671ea33a5..a97e63ac4d3a 100644 --- a/Marlin/src/lcd/fontutils.cpp +++ b/Marlin/src/lcd/fontutils.cpp @@ -40,13 +40,8 @@ #include "fontutils.h" -uint8_t read_byte_ram(uint8_t * str) { - return *str; -} - -uint8_t read_byte_rom(uint8_t * str) { - return pgm_read_byte(str); -} +uint8_t read_byte_ram(const uint8_t *str) { return *str; } +uint8_t read_byte_rom(const uint8_t *str) { return pgm_read_byte(str); } /** * @brief Using binary search to find the position by data_pin @@ -104,9 +99,9 @@ static inline bool utf8_is_start_byte_of_char(const uint8_t b) { /* This function gets the character at the pstart position, interpreting UTF8 multibyte sequences and returns the pointer to the next character */ -uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval) { +const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval) { uint32_t val = 0; - uint8_t *p = pstart; + const uint8_t *p = pstart; #define NEXT_6_BITS() do{ val <<= 6; p++; valcur = cb_read_byte(p); val |= (valcur & 0x3F); }while(0) diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index 21aee1e93919..e01962d7ad80 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -38,10 +38,10 @@ #include "../core/macros.h" // read a byte from ROM or RAM -typedef uint8_t (*read_byte_cb_t)(uint8_t * str); +typedef uint8_t (*read_byte_cb_t)(const uint8_t * str); -uint8_t read_byte_ram(uint8_t * str); -uint8_t read_byte_rom(uint8_t * str); +uint8_t read_byte_ram(const uint8_t *str); +uint8_t read_byte_rom(const uint8_t *str); // there's overflow of the wchar_t due to the 2-byte size in Arduino // sizeof(wchar_t)=2; sizeof(size_t)=2; sizeof(uint32_t)=4; @@ -58,7 +58,11 @@ typedef int (* pf_bsearch_cb_comp_t)(void *userdata, size_t idx, void * data_pin int pf_bsearch_r(void *userdata, size_t num_data, pf_bsearch_cb_comp_t cb_comp, void *data_pinpoint, size_t *ret_idx); /* Get the character, decoding multibyte UTF8 characters and returning a pointer to the start of the next UTF8 character */ -uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval); +const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval); + +inline const char* get_utf8_value_cb(const char *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval) { + return (const char *)get_utf8_value_cb((const uint8_t *)pstart, cb_read_byte, pval); +} /* Returns length of string in CHARACTERS, NOT BYTES */ uint8_t utf8_strlen(const char *pstart); diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index c5a7e1877ec5..98f3d4ed97e1 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -85,7 +85,7 @@ namespace Language_an { LSTR MSG_MOVE_Z = _UxGT("Mover Z"); LSTR MSG_MOVE_E = _UxGT("Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Extrusor *"); - LSTR MSG_MOVE_N_MM = _UxGT("Mover %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mover $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mover 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); @@ -109,10 +109,8 @@ namespace Language_an { LSTR MSG_AMAX_A = _UxGT("Acel. max ") STR_A; LSTR MSG_AMAX_B = _UxGT("Acel. max ") STR_B; LSTR MSG_AMAX_C = _UxGT("Acel. max ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Acel. max ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Acel. max ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Acel. max ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Acel. max ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Acel. max @"); + LSTR MSG_AMAX_E = _UxGT("Acel. max E"); LSTR MSG_AMAX_EN = _UxGT("Acel. max *"); LSTR MSG_A_RETRACT = _UxGT("Acel. retrac."); LSTR MSG_A_TRAVEL = _UxGT("Acel. Viaje"); @@ -120,9 +118,7 @@ namespace Language_an { LSTR MSG_A_STEPS = STR_A _UxGT(" trangos/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" trangos/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" trangos/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" trangos/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" trangos/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" trangos/mm"); + LSTR MSG_N_STEPS = _UxGT("@ trangos/mm"); LSTR MSG_E_STEPS = _UxGT("E trangos/mm"); LSTR MSG_EN_STEPS = _UxGT("* trangos/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -168,6 +164,7 @@ namespace Language_an { LSTR MSG_BABYSTEP_X = _UxGT("Micropaso X"); LSTR MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Micropaso @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Cancelado - Endstop"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Error: en calentar"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Error: temperatura"); diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index 95ca4ce1bfcc..2596d62564e6 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -74,7 +74,7 @@ namespace Language_bg { LSTR MSG_MOVE_Z = _UxGT("Движение по Z"); LSTR MSG_MOVE_E = _UxGT("Екструдер"); LSTR MSG_MOVE_EN = _UxGT("Екструдер *"); - LSTR MSG_MOVE_N_MM = _UxGT("Премести с %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Премести с $mm"); LSTR MSG_MOVE_01MM = _UxGT("Премести с 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Премести с 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Премести с 10mm"); @@ -101,9 +101,7 @@ namespace Language_bg { LSTR MSG_A_STEPS = STR_A _UxGT(" стъпки/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" стъпки/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" стъпки/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" стъпки/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" стъпки/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" стъпки/mm"); + LSTR MSG_N_STEPS = _UxGT("@ стъпки/mm"); LSTR MSG_E_STEPS = _UxGT("E стъпки/mm"); LSTR MSG_EN_STEPS = _UxGT("* стъпки/mm"); LSTR MSG_TEMPERATURE = _UxGT("Температура"); @@ -148,6 +146,7 @@ namespace Language_bg { LSTR MSG_BABYSTEP_X = _UxGT("Министъпка X"); LSTR MSG_BABYSTEP_Y = _UxGT("Министъпка Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Министъпка Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Министъпка @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Стоп Кр.Изключватели"); LSTR MSG_DELTA_CALIBRATE = _UxGT("Делта Калибровка"); LSTR MSG_DELTA_CALIBRATE_X = _UxGT("Калибровка X"); diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 582c27b1ae6a..fd46bcc28fc0 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -85,7 +85,7 @@ namespace Language_ca { LSTR MSG_MOVE_Z = _UxGT("Mou Z"); LSTR MSG_MOVE_E = _UxGT("Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Extrusor *"); - LSTR MSG_MOVE_N_MM = _UxGT("Mou %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mou $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mou 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mou 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mou 10mm"); @@ -107,11 +107,9 @@ namespace Language_ca { LSTR MSG_A_STEPS = STR_A _UxGT(" passos/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" passos/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" passos/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" passos/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" passos/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" passos/mm"); - LSTR MSG_E_STEPS = _UxGT("Epassos/mm"); - LSTR MSG_EN_STEPS = _UxGT("*passos/mm"); + LSTR MSG_E_STEPS = _UxGT("@ passos/mm"); + LSTR MSG_N_STEPS = _UxGT("E passos/mm"); + LSTR MSG_EN_STEPS = _UxGT("* passos/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); LSTR MSG_MOTION = _UxGT("Moviment"); LSTR MSG_FILAMENT = _UxGT("Filament"); @@ -156,6 +154,7 @@ namespace Language_ca { LSTR MSG_BABYSTEP_X = _UxGT("Micropas X"); LSTR MSG_BABYSTEP_Y = _UxGT("Micropas Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Micropas Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Micropas @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Cancel. Endstop"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Error al escalfar"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP REDUNDANT"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 76469c5fe5a8..d78b43f9a9e0 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -235,7 +235,7 @@ namespace Language_cz { LSTR MSG_MOVE_E = _UxGT("Extrudér"); LSTR MSG_MOVE_EN = _UxGT("Extrudér *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend je studený"); - LSTR MSG_MOVE_N_MM = _UxGT("Posunout o %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Posunout o $mm"); LSTR MSG_MOVE_01MM = _UxGT("Posunout o 0,1mm"); LSTR MSG_MOVE_1MM = _UxGT("Posunout o 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Posunout o 10mm"); @@ -269,19 +269,15 @@ namespace Language_cz { LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Jerk"); LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Jerk"); LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Jerk"); - LSTR MSG_VI_JERK = _UxGT("Max ") STR_I _UxGT(" Jerk"); - LSTR MSG_VJ_JERK = _UxGT("Max ") STR_J _UxGT(" Jerk"); - LSTR MSG_VK_JERK = _UxGT("Max ") STR_K _UxGT(" Jerk"); + LSTR MSG_VN_JERK = _UxGT("Max @ Jerk"); LSTR MSG_VE_JERK = _UxGT("Max E Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Odchylka spoje"); - LSTR MSG_VELOCITY = _UxGT("Rychlost"); + LSTR MSG_MAX_SPEED = _UxGT("Max Rychlost"); LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Rychlost"); LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Rychlost"); LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Rychlost"); - LSTR MSG_VMAX_I = _UxGT("Max ") STR_I _UxGT(" Rychlost"); - LSTR MSG_VMAX_J = _UxGT("Max ") STR_J _UxGT(" Rychlost"); - LSTR MSG_VMAX_K = _UxGT("Max ") STR_K _UxGT(" Rychlost"); - LSTR MSG_VMAX_E = _UxGT("Max ") STR_E _UxGT(" Rychlost"); + LSTR MSG_VMAX_N = _UxGT("Max @ Rychlost"); + LSTR MSG_VMAX_E = _UxGT("Max E Rychlost"); LSTR MSG_VMAX_EN = _UxGT("Max * Rychlost"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("VTrav Min"); @@ -289,10 +285,8 @@ namespace Language_cz { LSTR MSG_AMAX_A = _UxGT("Max ") STR_A _UxGT(" Akcel"); LSTR MSG_AMAX_B = _UxGT("Max ") STR_B _UxGT(" Akcel"); LSTR MSG_AMAX_C = _UxGT("Max ") STR_C _UxGT(" Akcel"); - LSTR MSG_AMAX_I = _UxGT("Max ") STR_I _UxGT(" Akcel"); - LSTR MSG_AMAX_J = _UxGT("Max ") STR_J _UxGT(" Akcel"); - LSTR MSG_AMAX_K = _UxGT("Max ") STR_K _UxGT(" Akcel"); - LSTR MSG_AMAX_E = _UxGT("Max ") STR_E _UxGT(" Akcel"); + LSTR MSG_AMAX_N = _UxGT("Max @ Akcel"); + LSTR MSG_AMAX_E = _UxGT("Max E Akcel"); LSTR MSG_AMAX_EN = _UxGT("Max * Akcel"); LSTR MSG_A_RETRACT = _UxGT("A-retrakt"); LSTR MSG_A_TRAVEL = _UxGT("A-přejezd"); @@ -300,9 +294,7 @@ namespace Language_cz { LSTR MSG_A_STEPS = STR_A _UxGT(" kroků/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" kroků/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" kroků/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" kroků/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" kroků/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" kroků/mm"); + LSTR MSG_N_STEPS = _UxGT("@ kroků/mm"); LSTR MSG_E_STEPS = _UxGT("E kroků/mm"); LSTR MSG_EN_STEPS = _UxGT("* kroků/mm"); LSTR MSG_TEMPERATURE = _UxGT("Teplota"); @@ -407,6 +399,7 @@ namespace Language_cz { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Celkem"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop abort"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Chyba zahřívání"); @@ -482,13 +475,7 @@ namespace Language_cz { LSTR MSG_INFO_MAX_TEMP = _UxGT("Teplota max"); LSTR MSG_INFO_PSU = _UxGT("Nap. zdroj"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Buzení motorů"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Motor %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Motor %"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC uložit EEPROM"); LSTR MSG_ERROR_TMC = _UxGT("TMC CHYBA SPOJENÍ"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("VÝMĚNA FILAMENTU"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 01281db2688c..05474744d0ac 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -74,7 +74,7 @@ namespace Language_da { LSTR MSG_MOVE_X = _UxGT("Flyt X"); LSTR MSG_MOVE_Y = _UxGT("Flyt Y"); LSTR MSG_MOVE_Z = _UxGT("Flyt Z"); - LSTR MSG_MOVE_N_MM = _UxGT("Flyt %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Flyt $mm"); LSTR MSG_MOVE_01MM = _UxGT("Flyt 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Flyt 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Flyt 10mm"); @@ -172,13 +172,7 @@ namespace Language_da { LSTR MSG_INFO_PSU = _UxGT("Strømfors."); LSTR MSG_DRIVE_STRENGTH = _UxGT("Driv Styrke"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driv %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driv %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driv %"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Skriv"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 111608dd4671..2b22319361aa 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -84,12 +84,6 @@ namespace Language_de { LSTR MSG_HOME_OFFSET_X = _UxGT("Homeversatz X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Homeversatz Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Homeversatz Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Homeversatz ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Homeversatz ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Homeversatz ") STR_K; - LSTR MSG_HOME_OFFSET_U = _UxGT("Homeversatz ") STR_U; - LSTR MSG_HOME_OFFSET_V = _UxGT("Homeversatz ") STR_V; - LSTR MSG_HOME_OFFSET_W = _UxGT("Homeversatz ") STR_W; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Homeversatz aktiv"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Assistent"); LSTR MSG_SELECT_ORIGIN = _UxGT("Wählen Sie Ursprung"); @@ -273,13 +267,11 @@ namespace Language_de { LSTR MSG_MOVE_X = _UxGT("Bewege X"); LSTR MSG_MOVE_Y = _UxGT("Bewege Y"); LSTR MSG_MOVE_Z = _UxGT("Bewege Z"); - LSTR MSG_MOVE_I = _UxGT("Bewege ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Bewege ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Bewege ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Bewege @"); LSTR MSG_MOVE_E = _UxGT("Bewege Extruder"); LSTR MSG_MOVE_EN = _UxGT("Bewege Extruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend zu kalt"); - LSTR MSG_MOVE_N_MM = _UxGT(" %s mm"); + LSTR MSG_MOVE_N_MM = _UxGT(" $ mm"); LSTR MSG_MOVE_01MM = _UxGT(" 0,1 mm"); LSTR MSG_MOVE_1MM = _UxGT(" 1,0 mm"); LSTR MSG_MOVE_10MM = _UxGT(" 10,0 mm"); @@ -289,12 +281,6 @@ namespace Language_de { LSTR MSG_MOVE_01IN = _UxGT("0.100 in"); LSTR MSG_MOVE_1IN = _UxGT("1.000 in"); LSTR MSG_SPEED = _UxGT("Geschw."); - LSTR MSG_MAXSPEED = _UxGT("Max Geschw. (mm/s)"); - LSTR MSG_MAXSPEED_X = _UxGT("Max ") STR_A _UxGT(" Geschw."); - LSTR MSG_MAXSPEED_Y = _UxGT("Max ") STR_B _UxGT(" Geschw."); - LSTR MSG_MAXSPEED_Z = _UxGT("Max ") STR_C _UxGT(" Geschw."); - LSTR MSG_MAXSPEED_E = _UxGT("Max ") STR_E _UxGT(" Geschw."); - LSTR MSG_MAXSPEED_A = _UxGT("Max @ Geschw."); LSTR MSG_BED_Z = _UxGT("Bett Z"); LSTR MSG_NOZZLE = _UxGT("Düse"); LSTR MSG_NOZZLE_N = _UxGT("Düse ~"); @@ -347,19 +333,15 @@ namespace Language_de { LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Jerk"); LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Jerk"); LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Jerk"); - LSTR MSG_VI_JERK = _UxGT("Max ") STR_I _UxGT(" Jerk"); - LSTR MSG_VJ_JERK = _UxGT("Max ") STR_J _UxGT(" Jerk"); - LSTR MSG_VK_JERK = _UxGT("Max ") STR_K _UxGT(" Jerk"); + LSTR MSG_VN_JERK = _UxGT("Max @ Jerk"); LSTR MSG_VE_JERK = _UxGT("Max E Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - LSTR MSG_VELOCITY = _UxGT("Geschwindigkeit"); + LSTR MSG_MAX_SPEED = _UxGT("Max Geschw. (mm/s)"); LSTR MSG_VMAX_A = _UxGT("V max ") STR_A; LSTR MSG_VMAX_B = _UxGT("V max ") STR_B; LSTR MSG_VMAX_C = _UxGT("V max ") STR_C; - LSTR MSG_VMAX_I = _UxGT("V max ") STR_I; - LSTR MSG_VMAX_J = _UxGT("V max ") STR_J; - LSTR MSG_VMAX_K = _UxGT("V max ") STR_K; - LSTR MSG_VMAX_E = _UxGT("V max ") STR_E; + LSTR MSG_VMAX_N = _UxGT("V max @"); + LSTR MSG_VMAX_E = _UxGT("V max E"); LSTR MSG_VMAX_EN = _UxGT("V max *"); LSTR MSG_VMIN = _UxGT("V min "); LSTR MSG_VTRAV_MIN = _UxGT("V min Leerfahrt"); @@ -367,10 +349,8 @@ namespace Language_de { LSTR MSG_AMAX_A = _UxGT("A max ") STR_A; LSTR MSG_AMAX_B = _UxGT("A max ") STR_B; LSTR MSG_AMAX_C = _UxGT("A max ") STR_C; - LSTR MSG_AMAX_I = _UxGT("A max ") STR_I; - LSTR MSG_AMAX_J = _UxGT("A max ") STR_J; - LSTR MSG_AMAX_K = _UxGT("A max ") STR_K; - LSTR MSG_AMAX_E = _UxGT("A max ") STR_E; + LSTR MSG_AMAX_N = _UxGT("A max @"); + LSTR MSG_AMAX_E = _UxGT("A max E"); LSTR MSG_AMAX_EN = _UxGT("A max *"); LSTR MSG_A_RETRACT = _UxGT("A Einzug"); LSTR MSG_A_TRAVEL = _UxGT("A Leerfahrt"); @@ -380,10 +360,8 @@ namespace Language_de { LSTR MSG_A_STEPS = STR_A _UxGT(" Steps/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" Steps/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" Steps/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" Steps/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" Steps/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" Steps/mm"); - LSTR MSG_E_STEPS = STR_E _UxGT(" Steps/mm"); + LSTR MSG_N_STEPS = _UxGT("@ Steps/mm"); + LSTR MSG_E_STEPS = _UxGT("E Steps/mm"); LSTR MSG_EN_STEPS = _UxGT("* Steps/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatur"); LSTR MSG_MOTION = _UxGT("Bewegung"); @@ -533,9 +511,7 @@ namespace Language_de { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Abbr. mit Endstopp"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("HEIZEN ERFOLGLOS"); @@ -629,13 +605,7 @@ namespace Language_de { LSTR MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); LSTR MSG_INFO_PSU = _UxGT("Netzteil"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Motorleistung"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Treiber %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Treiber %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Treiber %"); LSTR MSG_ERROR_TMC = _UxGT("TMC Verbindungsfehler"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Werte speichern"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMENT WECHSEL"); diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 370568175656..47d6a5b2da35 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -119,17 +119,13 @@ namespace Language_el { LSTR MSG_VA_JERK = _UxGT("Vαντίδραση ") STR_A; LSTR MSG_VB_JERK = _UxGT("Vαντίδραση ") STR_B; LSTR MSG_VC_JERK = _UxGT("Vαντίδραση ") STR_C; - LSTR MSG_VI_JERK = _UxGT("Vαντίδραση ") STR_I; - LSTR MSG_VJ_JERK = _UxGT("Vαντίδραση ") STR_J; - LSTR MSG_VK_JERK = _UxGT("Vαντίδραση ") STR_K; + LSTR MSG_VN_JERK = _UxGT("Vαντίδραση @"); LSTR MSG_VE_JERK = _UxGT("Vαντίδραση E"); LSTR MSG_VMAX_A = _UxGT("V Μέγιστο") STR_A; LSTR MSG_VMAX_B = _UxGT("V Μέγιστο") STR_B; LSTR MSG_VMAX_C = _UxGT("V Μέγιστο") STR_C; - LSTR MSG_VMAX_I = _UxGT("V Μέγιστο") STR_I; - LSTR MSG_VMAX_J = _UxGT("V Μέγιστο") STR_J; - LSTR MSG_VMAX_K = _UxGT("V Μέγιστο") STR_K; - LSTR MSG_VMAX_E = _UxGT("V Μέγιστο") STR_E; + LSTR MSG_VMAX_N = _UxGT("V Μέγιστο@"); + LSTR MSG_VMAX_E = _UxGT("V ΜέγιστοE"); LSTR MSG_VMAX_EN = _UxGT("V Μέγιστο *"); LSTR MSG_VMIN = _UxGT("V Ελάχιστο"); LSTR MSG_VTRAV_MIN = _UxGT("Vελάχ. μετατόπιση"); @@ -137,10 +133,8 @@ namespace Language_el { LSTR MSG_AMAX_A = _UxGT("Aμεγ ") STR_A; LSTR MSG_AMAX_B = _UxGT("Aμεγ ") STR_B; LSTR MSG_AMAX_C = _UxGT("Aμεγ ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Aμεγ ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Aμεγ ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Aμεγ ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Aμεγ ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Aμεγ @"); + LSTR MSG_AMAX_E = _UxGT("Aμεγ E"); LSTR MSG_AMAX_EN = _UxGT("Aμεγ *"); LSTR MSG_A_RETRACT = _UxGT("Α-ανάσυρση"); LSTR MSG_A_TRAVEL = _UxGT("Α-μετατόπιση"); @@ -148,9 +142,7 @@ namespace Language_el { LSTR MSG_A_STEPS = _UxGT("Bήματα ") STR_A _UxGT(" ανά μμ"); LSTR MSG_B_STEPS = _UxGT("Bήματα ") STR_B _UxGT(" ανά μμ"); LSTR MSG_C_STEPS = _UxGT("Bήματα ") STR_C _UxGT(" ανά μμ"); - LSTR MSG_I_STEPS = _UxGT("Bήματα ") STR_I _UxGT(" ανά μμ"); - LSTR MSG_J_STEPS = _UxGT("Bήματα ") STR_J _UxGT(" ανά μμ"); - LSTR MSG_K_STEPS = _UxGT("Bήματα ") STR_K _UxGT(" ανά μμ"); + LSTR MSG_N_STEPS = _UxGT("Bήματα @ ανά μμ"); LSTR MSG_E_STEPS = _UxGT("Bήματα Ε ανά μμ"); LSTR MSG_EN_STEPS = _UxGT("Bήματα * ανά μμ"); LSTR MSG_TEMPERATURE = _UxGT("Θερμοκρασία"); diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index b13893fb4cde..bd2e7d595d9a 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -109,17 +109,13 @@ namespace Language_el_gr { LSTR MSG_VA_JERK = _UxGT("Vαντίδραση ") STR_A; LSTR MSG_VB_JERK = _UxGT("Vαντίδραση ") STR_B; LSTR MSG_VC_JERK = _UxGT("Vαντίδραση ") STR_C; - LSTR MSG_VI_JERK = _UxGT("Vαντίδραση ") STR_I; - LSTR MSG_VJ_JERK = _UxGT("Vαντίδραση ") STR_J; - LSTR MSG_VK_JERK = _UxGT("Vαντίδραση ") STR_K; + LSTR MSG_VN_JERK = _UxGT("Vαντίδραση @"); LSTR MSG_VE_JERK = _UxGT("Vαντίδραση E"); LSTR MSG_VMAX_A = _UxGT("Vμεγ ") STR_A; LSTR MSG_VMAX_B = _UxGT("Vμεγ ") STR_B; LSTR MSG_VMAX_C = _UxGT("Vμεγ ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vμεγ ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vμεγ ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vμεγ ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vμεγ ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Vμεγ @"); + LSTR MSG_VMAX_E = _UxGT("Vμεγ E"); LSTR MSG_VMAX_EN = _UxGT("Vμεγ *"); LSTR MSG_VMIN = _UxGT("Vελαχ"); LSTR MSG_VTRAV_MIN = _UxGT("Vελάχ. μετατόπιση"); @@ -127,10 +123,8 @@ namespace Language_el_gr { LSTR MSG_AMAX_A = _UxGT("Aμεγ ") STR_A; LSTR MSG_AMAX_B = _UxGT("Aμεγ ") STR_B; LSTR MSG_AMAX_C = _UxGT("Aμεγ ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Aμεγ ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Aμεγ ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Aμεγ ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Aμεγ ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Aμεγ @"); + LSTR MSG_AMAX_E = _UxGT("Aμεγ E"); LSTR MSG_AMAX_EN = _UxGT("Aμεγ *"); LSTR MSG_A_RETRACT = _UxGT("Α-ανάσυρση"); LSTR MSG_A_TRAVEL = _UxGT("Α-μετατόπιση"); @@ -138,9 +132,7 @@ namespace Language_el_gr { LSTR MSG_A_STEPS = _UxGT("Bήματα ") STR_A _UxGT(" ανά μμ"); LSTR MSG_B_STEPS = _UxGT("Bήματα ") STR_B _UxGT(" ανά μμ"); LSTR MSG_C_STEPS = _UxGT("Bήματα ") STR_C _UxGT(" ανά μμ"); - LSTR MSG_I_STEPS = _UxGT("Bήματα ") STR_I _UxGT(" ανά μμ"); - LSTR MSG_J_STEPS = _UxGT("Bήματα ") STR_J _UxGT(" ανά μμ"); - LSTR MSG_K_STEPS = _UxGT("Bήματα ") STR_K _UxGT(" ανά μμ"); + LSTR MSG_N_STEPS = _UxGT("Bήματα @ ανά μμ"); LSTR MSG_E_STEPS = _UxGT("Bήματα Ε ανά μμ"); LSTR MSG_EN_STEPS = _UxGT("Bήματα * ανά μμ"); LSTR MSG_TEMPERATURE = _UxGT("Θερμοκρασία"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 90607e82459a..81f30b61d8ef 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -27,10 +27,9 @@ * LCD Menu Messages * See also https://marlinfw.org/docs/development/lcd_language.html * - * Substitutions are applied for the following characters when used - * in menu items that call lcd_put_u8str_ind_P with an index: + * Substitutions are applied for the following characters when used in menu items titles: * - * $ displays an inserted C-string + * $ displays an inserted string * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) @@ -106,9 +105,6 @@ namespace Language_en { LSTR MSG_HOME_OFFSET_X = _UxGT("Home Offset X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Home Offset Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Home Offset Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Home Offset ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Home Offset ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Home Offset ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets Applied"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Wizard"); LSTR MSG_SELECT_ORIGIN = _UxGT("Select Origin"); @@ -311,13 +307,11 @@ namespace Language_en { LSTR MSG_MOVE_X = _UxGT("Move X"); // Used by draw_edit_screen LSTR MSG_MOVE_Y = _UxGT("Move Y"); LSTR MSG_MOVE_Z = _UxGT("Move Z"); - LSTR MSG_MOVE_I = _UxGT("Move ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Move ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Move ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Move @"); LSTR MSG_MOVE_E = _UxGT("Move Extruder"); LSTR MSG_MOVE_EN = _UxGT("Move E*"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend too cold"); - LSTR MSG_MOVE_N_MM = _UxGT("Move %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Move $mm"); LSTR MSG_MOVE_01MM = _UxGT("Move 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Move 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Move 10mm"); @@ -327,12 +321,6 @@ namespace Language_en { LSTR MSG_MOVE_01IN = _UxGT("Move 0.1in"); LSTR MSG_MOVE_1IN = _UxGT("Move 1.0in"); LSTR MSG_SPEED = _UxGT("Speed"); - LSTR MSG_MAXSPEED = _UxGT("Max Speed (mm/s)"); - LSTR MSG_MAXSPEED_X = _UxGT("Max ") STR_A _UxGT(" Speed"); - LSTR MSG_MAXSPEED_Y = _UxGT("Max ") STR_B _UxGT(" Speed"); - LSTR MSG_MAXSPEED_Z = _UxGT("Max ") STR_C _UxGT(" Speed"); - LSTR MSG_MAXSPEED_E = _UxGT("Max ") STR_E _UxGT(" Speed"); - LSTR MSG_MAXSPEED_A = _UxGT("Max @ Speed"); LSTR MSG_BED_Z = _UxGT("Bed Z"); LSTR MSG_NOZZLE = _UxGT("Nozzle"); LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~"); @@ -389,30 +377,24 @@ namespace Language_en { LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Jerk"); LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Jerk"); LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Jerk"); - LSTR MSG_VI_JERK = _UxGT("Max ") STR_I _UxGT(" Jerk"); - LSTR MSG_VJ_JERK = _UxGT("Max ") STR_J _UxGT(" Jerk"); - LSTR MSG_VK_JERK = _UxGT("Max ") STR_K _UxGT(" Jerk"); + LSTR MSG_VN_JERK = _UxGT("Max @ Jerk"); LSTR MSG_VE_JERK = _UxGT("Max E Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - LSTR MSG_VELOCITY = _UxGT("Velocity"); - LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Vel"); - LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Vel"); - LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Vel"); - LSTR MSG_VMAX_I = _UxGT("Max ") STR_I _UxGT(" Vel"); - LSTR MSG_VMAX_J = _UxGT("Max ") STR_J _UxGT(" Vel"); - LSTR MSG_VMAX_K = _UxGT("Max ") STR_K _UxGT(" Vel"); - LSTR MSG_VMAX_E = _UxGT("Max ") STR_E _UxGT(" Vel"); - LSTR MSG_VMAX_EN = _UxGT("Max * Vel"); + LSTR MSG_MAX_SPEED = _UxGT("Max Speed (mm/s)"); + LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Speed"); + LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Speed"); + LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Speed"); + LSTR MSG_VMAX_N = _UxGT("Max @ Speed"); + LSTR MSG_VMAX_E = _UxGT("Max E Speed"); + LSTR MSG_VMAX_EN = _UxGT("Max * Speed"); LSTR MSG_VMIN = _UxGT("Min Velocity"); - LSTR MSG_VTRAV_MIN = _UxGT("Min Travel Vel"); + LSTR MSG_VTRAV_MIN = _UxGT("Min Travel Speed"); LSTR MSG_ACCELERATION = _UxGT("Acceleration"); LSTR MSG_AMAX_A = _UxGT("Max ") STR_A _UxGT(" Accel"); LSTR MSG_AMAX_B = _UxGT("Max ") STR_B _UxGT(" Accel"); LSTR MSG_AMAX_C = _UxGT("Max ") STR_C _UxGT(" Accel"); - LSTR MSG_AMAX_I = _UxGT("Max ") STR_I _UxGT(" Accel"); - LSTR MSG_AMAX_J = _UxGT("Max ") STR_J _UxGT(" Accel"); - LSTR MSG_AMAX_K = _UxGT("Max ") STR_K _UxGT(" Accel"); - LSTR MSG_AMAX_E = _UxGT("Max ") STR_E _UxGT(" Accel"); + LSTR MSG_AMAX_N = _UxGT("Max @ Accel"); + LSTR MSG_AMAX_E = _UxGT("Max E Accel"); LSTR MSG_AMAX_EN = _UxGT("Max * Accel"); LSTR MSG_A_RETRACT = _UxGT("Retract Accel"); LSTR MSG_A_TRAVEL = _UxGT("Travel Accel"); @@ -422,9 +404,7 @@ namespace Language_en { LSTR MSG_A_STEPS = STR_A _UxGT(" Steps/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" Steps/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" Steps/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" Steps/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" Steps/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" Steps/mm"); + LSTR MSG_N_STEPS = _UxGT("@ steps/mm"); LSTR MSG_E_STEPS = _UxGT("E steps/mm"); LSTR MSG_EN_STEPS = _UxGT("* Steps/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperature"); @@ -587,9 +567,7 @@ namespace Language_en { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop Abort"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Heating Failed"); @@ -686,13 +664,7 @@ namespace Language_en { LSTR MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); LSTR MSG_INFO_PSU = _UxGT("PSU"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Drive Strength"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("TMC CONNECTION ERROR"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Write"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMENT CHANGE"); @@ -865,12 +837,7 @@ namespace Language_en { LSTR MSG_PID_C_E = _UxGT("PID-C *"); LSTR MSG_PID_F = _UxGT("PID-F"); LSTR MSG_PID_F_E = _UxGT("PID-F *"); - LSTR MSG_BACKLASH_A = STR_A; - LSTR MSG_BACKLASH_B = STR_B; - LSTR MSG_BACKLASH_C = STR_C; - LSTR MSG_BACKLASH_I = STR_I; - LSTR MSG_BACKLASH_J = STR_J; - LSTR MSG_BACKLASH_K = STR_K; + LSTR MSG_BACKLASH_N = _UxGT("@"); } #if FAN_COUNT == 1 diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 4eb7c9f7e1a6..cc331efd4562 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -229,7 +229,7 @@ namespace Language_es { LSTR MSG_MOVE_E = _UxGT("Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Extrusor *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend muy frio"); - LSTR MSG_MOVE_N_MM = _UxGT("Mover %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mover $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mover 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); @@ -270,30 +270,24 @@ namespace Language_es { LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Jerk"); LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Jerk"); LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Jerk"); - LSTR MSG_VI_JERK = _UxGT("Max ") STR_I _UxGT(" Jerk"); - LSTR MSG_VJ_JERK = _UxGT("Max ") STR_J _UxGT(" Jerk"); - LSTR MSG_VK_JERK = _UxGT("Max ") STR_K _UxGT(" Jerk"); + LSTR MSG_VN_JERK = _UxGT("Max @ Jerk"); LSTR MSG_VE_JERK = _UxGT("Max E Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Desvi. Unión"); - LSTR MSG_VELOCITY = _UxGT("Velocidad"); - LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Vel"); - LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Vel"); - LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Vel"); - LSTR MSG_VMAX_I = _UxGT("Max ") STR_I _UxGT(" Vel"); - LSTR MSG_VMAX_J = _UxGT("Max ") STR_J _UxGT(" Vel"); - LSTR MSG_VMAX_K = _UxGT("Max ") STR_K _UxGT(" Vel"); - LSTR MSG_VMAX_E = _UxGT("Max ") STR_E _UxGT(" Vel"); - LSTR MSG_VMAX_EN = _UxGT("Max * Vel"); + LSTR MSG_MAX_SPEED = _UxGT("Max Velocidad"); + LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Speed"); + LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Speed"); + LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Speed"); + LSTR MSG_VMAX_N = _UxGT("Max @ Speed"); + LSTR MSG_VMAX_E = _UxGT("Max E Speed"); + LSTR MSG_VMAX_EN = _UxGT("Max * Speed"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("Vel. viaje min"); LSTR MSG_ACCELERATION = _UxGT("Acceleración"); LSTR MSG_AMAX_A = _UxGT("Acel. max") STR_A; LSTR MSG_AMAX_B = _UxGT("Acel. max") STR_B; LSTR MSG_AMAX_C = _UxGT("Acel. max") STR_C; - LSTR MSG_AMAX_I = _UxGT("Acel. max") STR_I; - LSTR MSG_AMAX_J = _UxGT("Acel. max") STR_J; - LSTR MSG_AMAX_K = _UxGT("Acel. max") STR_K; - LSTR MSG_AMAX_E = _UxGT("Acel. max") STR_E; + LSTR MSG_AMAX_N = _UxGT("Acel. max@"); + LSTR MSG_AMAX_E = _UxGT("Acel. maxE"); LSTR MSG_AMAX_EN = _UxGT("Acel. max *"); LSTR MSG_A_RETRACT = _UxGT("Acel. retrac."); LSTR MSG_A_TRAVEL = _UxGT("Acel. Viaje"); @@ -301,9 +295,7 @@ namespace Language_es { LSTR MSG_A_STEPS = STR_A _UxGT(" pasos/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" pasos/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" pasos/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" pasos/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" pasos/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" pasos/mm"); + LSTR MSG_N_STEPS = _UxGT("@ pasos/mm"); LSTR MSG_E_STEPS = _UxGT("E pasos/mm"); LSTR MSG_EN_STEPS = _UxGT("* pasos/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -413,6 +405,7 @@ namespace Language_es { LSTR MSG_BABYSTEP_X = _UxGT("Micropaso X"); LSTR MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Micropaso @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Cancelado - Endstop"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Calent. fallido"); @@ -480,13 +473,7 @@ namespace Language_es { LSTR MSG_INFO_MAX_TEMP = _UxGT("Temp. Máxima"); LSTR MSG_INFO_PSU = _UxGT("F. Aliment."); LSTR MSG_DRIVE_STRENGTH = _UxGT("Fuerza de empuje"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("ERROR CONEX. TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Escribe DAC EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("CAMBIAR FILAMENTO"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 2d84518f0bfe..09a0fbeb6ac6 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -138,7 +138,7 @@ namespace Language_eu { LSTR MSG_MOVE_Z = _UxGT("Mugitu Z"); LSTR MSG_MOVE_E = _UxGT("Estrusorea"); LSTR MSG_MOVE_EN = _UxGT("Estrusorea *"); - LSTR MSG_MOVE_N_MM = _UxGT("Mugitu %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mugitu $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mugitu 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mugitu 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mugitu 10mm"); @@ -166,9 +166,7 @@ namespace Language_eu { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-astindua"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-astindua"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-astindua"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-astindua"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-astindua"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-astindua"); + LSTR MSG_VN_JERK = _UxGT("V@-astindua"); LSTR MSG_VE_JERK = _UxGT("Ve-astindua"); LSTR MSG_VTRAV_MIN = _UxGT("VBidaia min"); LSTR MSG_A_RETRACT = _UxGT("A-retrakt"); @@ -177,9 +175,7 @@ namespace Language_eu { LSTR MSG_A_STEPS = STR_A _UxGT(" pausoak/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" pausoak/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" pausoak/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" pausoak/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" pausoak/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" pausoak/mm"); + LSTR MSG_N_STEPS = _UxGT("@ pausoak/mm"); LSTR MSG_E_STEPS = _UxGT("E pausoak/mm"); LSTR MSG_EN_STEPS = _UxGT("* pausoak/mm"); LSTR MSG_TEMPERATURE = _UxGT("Tenperatura"); @@ -243,6 +239,7 @@ namespace Language_eu { LSTR MSG_BABYSTEP_X = _UxGT("Mikro-urratsa X"); LSTR MSG_BABYSTEP_Y = _UxGT("Mikro-urratsa Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Mikro-urratsa Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Mikro-urratsa @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop deusezta."); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Err: Beroketa"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: Tenperatura"); @@ -296,13 +293,7 @@ namespace Language_eu { LSTR MSG_INFO_MAX_TEMP = _UxGT("Tenp. Maximoa"); LSTR MSG_INFO_PSU = _UxGT("Elikadura-iturria"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Driver-aren potentzia"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Idatzi DAC EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("HARIZPIA ALDATU"); LSTR MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("HARIZPIA KARGATU"); diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 066179c9504d..8fd53a79e36d 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -71,7 +71,7 @@ namespace Language_fi { LSTR MSG_MOVE_Z = _UxGT("Liikuta Z"); LSTR MSG_MOVE_E = _UxGT("Extruder"); LSTR MSG_MOVE_EN = _UxGT("Extruder *"); - LSTR MSG_MOVE_N_MM = _UxGT("Liikuta %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Liikuta $mm"); LSTR MSG_MOVE_01MM = _UxGT("Liikuta 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Liikuta 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Liikuta 10mm"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index f3ea9b5e3b80..6081234607f4 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -72,9 +72,6 @@ namespace Language_fr { LSTR MSG_HOME_OFFSET_X = _UxGT("Décal. origine X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Décal. origine Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Décal. origine Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Décal. origine ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Décal. origine ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Décal. origine ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Décalages appliqués"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Assistant Molettes"); LSTR MSG_SELECT_ORIGIN = _UxGT("Molette du lit"); // Not a selection of the origin @@ -233,13 +230,11 @@ namespace Language_fr { LSTR MSG_MOVE_X = _UxGT("Déplacer X"); LSTR MSG_MOVE_Y = _UxGT("Déplacer Y"); LSTR MSG_MOVE_Z = _UxGT("Déplacer Z"); - LSTR MSG_MOVE_I = _UxGT("Déplacer ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Déplacer ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Déplacer ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Déplacer @"); LSTR MSG_MOVE_E = _UxGT("Extruder"); LSTR MSG_MOVE_EN = _UxGT("Extruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Buse trop froide"); - LSTR MSG_MOVE_N_MM = _UxGT("Déplacer %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Déplacer $mm"); LSTR MSG_MOVE_01MM = _UxGT("Déplacer 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Déplacer 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Déplacer 10mm"); @@ -282,18 +277,14 @@ namespace Language_fr { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT(" jerk"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT(" jerk"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT(" jerk"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT(" jerk"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT(" jerk"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT(" jerk"); + LSTR MSG_VN_JERK = _UxGT("V@ jerk"); LSTR MSG_VE_JERK = _UxGT("Ve jerk"); - LSTR MSG_VELOCITY = _UxGT("Vélocité"); + LSTR MSG_MAX_SPEED = _UxGT("Max Vélocité"); LSTR MSG_VMAX_A = _UxGT("Vit. Max ") STR_A; LSTR MSG_VMAX_B = _UxGT("Vit. Max ") STR_B; LSTR MSG_VMAX_C = _UxGT("Vit. Max ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vit. Max ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vit. Max ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vit. Max ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vit. Max ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Vit. Max @"); + LSTR MSG_VMAX_E = _UxGT("Vit. Max E"); LSTR MSG_VMAX_EN = _UxGT("Vit. Max *"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Déviat. jonct."); LSTR MSG_VMIN = _UxGT("Vit. Min"); @@ -302,10 +293,8 @@ namespace Language_fr { LSTR MSG_AMAX_A = _UxGT("Max Accél. ") STR_A; LSTR MSG_AMAX_B = _UxGT("Max Accél. ") STR_B; LSTR MSG_AMAX_C = _UxGT("Max Accél. ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Max Accél. ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Max Accél. ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Max Accél. ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Max Accél. ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Max Accél. @"); + LSTR MSG_AMAX_E = _UxGT("Max Accél. E"); LSTR MSG_AMAX_EN = _UxGT("Max Accél. *"); LSTR MSG_A_RETRACT = _UxGT("Acc.rétraction"); LSTR MSG_A_TRAVEL = _UxGT("Acc.course"); @@ -315,9 +304,7 @@ namespace Language_fr { LSTR MSG_A_STEPS = STR_A _UxGT(" pas/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" pas/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" pas/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" pas/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" pas/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" pas/mm"); + LSTR MSG_N_STEPS = _UxGT("@ pas/mm"); LSTR MSG_E_STEPS = _UxGT("E pas/mm"); LSTR MSG_EN_STEPS = _UxGT("* pas/mm"); LSTR MSG_TEMPERATURE = _UxGT("Température"); @@ -443,9 +430,7 @@ namespace Language_fr { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Butée abandon"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Err de chauffe"); @@ -521,13 +506,7 @@ namespace Language_fr { LSTR MSG_INFO_MAX_TEMP = _UxGT("Temp Max"); LSTR MSG_INFO_PSU = _UxGT("Alim."); LSTR MSG_DRIVE_STRENGTH = _UxGT("Puiss. moteur "); - LSTR MSG_DAC_PERCENT_A = _UxGT("Driver ") STR_A _UxGT(" %"); - LSTR MSG_DAC_PERCENT_B = _UxGT("Driver ") STR_B _UxGT(" %"); - LSTR MSG_DAC_PERCENT_C = _UxGT("Driver ") STR_C _UxGT(" %"); - LSTR MSG_DAC_PERCENT_I = _UxGT("Driver ") STR_I _UxGT(" %"); - LSTR MSG_DAC_PERCENT_J = _UxGT("Driver ") STR_J _UxGT(" %"); - LSTR MSG_DAC_PERCENT_K = _UxGT("Driver ") STR_K _UxGT(" %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("Driver E %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("Driver @ %"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM sauv."); LSTR MSG_ERROR_TMC = _UxGT("ERREUR CONNEXION TMC"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 55dc03ac9d95..dabd35efcf9b 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -226,7 +226,7 @@ namespace Language_gl { LSTR MSG_MOVE_E = _UxGT("Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Extrusor *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Bico moi frío"); - LSTR MSG_MOVE_N_MM = _UxGT("Mover %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mover $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mover 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); @@ -271,30 +271,23 @@ namespace Language_gl { LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Jerk"); LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Jerk"); LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Jerk"); - LSTR MSG_VI_JERK = _UxGT("Max ") STR_I _UxGT(" Jerk"); - LSTR MSG_VJ_JERK = _UxGT("Max ") STR_J _UxGT(" Jerk"); - LSTR MSG_VK_JERK = _UxGT("Max ") STR_K _UxGT(" Jerk"); + LSTR MSG_VN_JERK = _UxGT("Max @ Jerk"); LSTR MSG_VE_JERK = _UxGT("Max E Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Desvío Unión"); - LSTR MSG_VELOCITY = _UxGT("Velocidade"); - LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Vel"); - LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Vel"); - LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Vel"); - LSTR MSG_VMAX_I = _UxGT("Max ") STR_I _UxGT(" Vel"); - LSTR MSG_VMAX_J = _UxGT("Max ") STR_J _UxGT(" Vel"); - LSTR MSG_VMAX_K = _UxGT("Max ") STR_K _UxGT(" Vel"); - LSTR MSG_VMAX_E = _UxGT("Max ") STR_E _UxGT(" Vel"); - LSTR MSG_VMAX_EN = _UxGT("Max * Vel"); + LSTR MSG_MAX_SPEED = _UxGT("Max Velocidade"); + LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Speed"); + LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Speed"); + LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Speed"); + LSTR MSG_VMAX_N = _UxGT("Max @ Speed"); + LSTR MSG_VMAX_E = _UxGT("Max E Speed"); + LSTR MSG_VMAX_EN = _UxGT("Max * Speed"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("V-viaxe min"); LSTR MSG_ACCELERATION = _UxGT("Aceleración"); LSTR MSG_AMAX_A = _UxGT("Max ") STR_A _UxGT(" Accel"); LSTR MSG_AMAX_B = _UxGT("Max ") STR_B _UxGT(" Accel"); LSTR MSG_AMAX_C = _UxGT("Max ") STR_C _UxGT(" Accel"); - LSTR MSG_AMAX_I = _UxGT("Max ") STR_I _UxGT(" Accel"); - LSTR MSG_AMAX_J = _UxGT("Max ") STR_J _UxGT(" Accel"); - LSTR MSG_AMAX_K = _UxGT("Max ") STR_K _UxGT(" Accel"); - LSTR MSG_AMAX_E = _UxGT("Max ") STR_E _UxGT(" Accel"); + LSTR MSG_AMAX_E = _UxGT("Max E Accel"); LSTR MSG_AMAX_EN = _UxGT("Max * Accel"); LSTR MSG_A_RETRACT = _UxGT("A-retrac."); LSTR MSG_A_TRAVEL = _UxGT("A-viaxe"); @@ -304,9 +297,7 @@ namespace Language_gl { LSTR MSG_A_STEPS = STR_A _UxGT(" pasos/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" pasos/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" pasos/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" pasos/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" pasos/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" pasos/mm"); + LSTR MSG_N_STEPS = _UxGT("@ pasos/mm"); LSTR MSG_E_STEPS = _UxGT("E pasos/mm"); LSTR MSG_EN_STEPS = _UxGT("* pasos/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -429,6 +420,7 @@ namespace Language_gl { LSTR MSG_BABYSTEP_X = _UxGT("Micropaso X"); LSTR MSG_BABYSTEP_Y = _UxGT("Micropaso Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Micropaso @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Erro FinCarro"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Fallo Quentando"); @@ -496,13 +488,7 @@ namespace Language_gl { LSTR MSG_INFO_MAX_TEMP = _UxGT("Temp Máx"); LSTR MSG_INFO_PSU = _UxGT("Fonte Alimentación"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Forza do Motor"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("ERRO CONEX. TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Escribe DAC EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("CAMBIAR FILAMENTO"); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 40705bbc91d9..10f11f616f5f 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -78,7 +78,7 @@ namespace Language_hr { LSTR MSG_LEVEL_BED = _UxGT("Niveliraj bed"); LSTR MSG_MOVE_X = _UxGT("Miči X"); LSTR MSG_MOVE_Y = _UxGT("Miči Y"); - LSTR MSG_MOVE_N_MM = _UxGT("Miči %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Miči $mm"); LSTR MSG_MOVE_01MM = _UxGT("Miči 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Miči 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Miči 10mm"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 6321ed136741..81db96df1702 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -79,9 +79,6 @@ namespace Language_hu { LSTR MSG_HOME_OFFSET_X = _UxGT("X Kezdö eltol."); LSTR MSG_HOME_OFFSET_Y = _UxGT("Y Kezdö eltol."); LSTR MSG_HOME_OFFSET_Z = _UxGT("Z Kezdö eltol."); - LSTR MSG_HOME_OFFSET_I = _UxGT("Kezdö eltol. ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Kezdö eltol. ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Kezdö eltol. ") STR_K; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Eltolás beállítva."); LSTR MSG_TRAMMING_WIZARD = _UxGT("Elektromos varázsló"); LSTR MSG_SELECT_ORIGIN = _UxGT("Eredeti választása"); @@ -259,13 +256,11 @@ namespace Language_hu { LSTR MSG_MOVE_X = _UxGT("X mozgás"); LSTR MSG_MOVE_Y = _UxGT("Y mozgás"); LSTR MSG_MOVE_Z = _UxGT("Z mozgás"); - LSTR MSG_MOVE_I = _UxGT("Mozgás ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Mozgás ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Mozgás ") STR_K; + LSTR MSG_MOVE_N = _UxGT("@ mozgás"); LSTR MSG_MOVE_E = _UxGT("Adagoló"); LSTR MSG_MOVE_EN = _UxGT("Adagoló *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("A fej túl hideg"); - LSTR MSG_MOVE_N_MM = _UxGT("Mozgás %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mozgás $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mozgás 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mozgás 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mozgás 10mm"); @@ -319,19 +314,15 @@ namespace Language_hu { LSTR MSG_VA_JERK = _UxGT("Seb.") STR_A _UxGT("-Rántás"); LSTR MSG_VB_JERK = _UxGT("Seb.") STR_B _UxGT("-Rántás"); LSTR MSG_VC_JERK = _UxGT("Seb.") STR_C _UxGT("-Rántás"); - LSTR MSG_VI_JERK = _UxGT("Seb.") STR_I _UxGT("-Rántás"); - LSTR MSG_VJ_JERK = _UxGT("Seb.") STR_J _UxGT("-Rántás"); - LSTR MSG_VK_JERK = _UxGT("Seb.") STR_K _UxGT("-Rántás"); + LSTR MSG_VN_JERK = _UxGT("Seb.@-Rántás"); LSTR MSG_VE_JERK = _UxGT("E ránt. seb."); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Csomopont eltérés"); - LSTR MSG_VELOCITY = _UxGT("Sebesség"); + LSTR MSG_MAX_SPEED = _UxGT("Max Sebesség (mm/s)"); LSTR MSG_VMAX_A = _UxGT("Max Seb. ") STR_A; LSTR MSG_VMAX_B = _UxGT("Max Seb. ") STR_B; LSTR MSG_VMAX_C = _UxGT("Max Seb. ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Max Seb. ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Max Seb. ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Max Seb. ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Max Seb. ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Max Seb. @"); + LSTR MSG_VMAX_E = _UxGT("Max Seb. E"); LSTR MSG_VMAX_EN = _UxGT("Max sebesség *"); LSTR MSG_VMIN = _UxGT("Min sebesség"); LSTR MSG_VTRAV_MIN = _UxGT("Min utazó.seb."); @@ -339,10 +330,8 @@ namespace Language_hu { LSTR MSG_AMAX_A = _UxGT("Max gyors. ") STR_A; LSTR MSG_AMAX_B = _UxGT("Max gyors. ") STR_B; LSTR MSG_AMAX_C = _UxGT("Max gyors. ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Max gyors. ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Max gyors. ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Max gyors. ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Max gyors. ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Max gyors. @"); + LSTR MSG_AMAX_E = _UxGT("Max gyors. E"); LSTR MSG_AMAX_EN = _UxGT("Max gyorsulás *"); LSTR MSG_A_RETRACT = _UxGT("Visszahúzás"); LSTR MSG_A_TRAVEL = _UxGT("Utazás"); @@ -352,9 +341,7 @@ namespace Language_hu { LSTR MSG_A_STEPS = STR_A _UxGT(" Lépés/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" Lépés/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" Lépés/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" Lépés/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" Lépés/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" Lépés/mm"); + LSTR MSG_N_STEPS = _UxGT("@ lépés/mm"); LSTR MSG_E_STEPS = _UxGT("E lépés/mm"); LSTR MSG_EN_STEPS = _UxGT("*Lépés/mm"); LSTR MSG_TEMPERATURE = _UxGT("Höfok"); @@ -488,9 +475,7 @@ namespace Language_hu { LSTR MSG_BABYSTEP_X = _UxGT("Mikrolépés X"); LSTR MSG_BABYSTEP_Y = _UxGT("Mikrolépés Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Mikrolépés Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Mikrolépés ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Mikrolépés ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Mikrolépés ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Mikrolépés @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Teljes"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Végállás megszakítva!"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Fütés hiba!"); @@ -568,13 +553,7 @@ namespace Language_hu { LSTR MSG_INFO_MAX_TEMP = _UxGT("Max höfok"); LSTR MSG_INFO_PSU = _UxGT("PSU"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Meghajtási erö"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Meghajtó %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E meghajtó %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ meghajtó %"); LSTR MSG_ERROR_TMC = _UxGT("TMC CSATLAKOZÁSI HIBA"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM írása"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("NYOMTATÓSZÁL CSERE"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 82c595aa8c22..b043ac26e168 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -27,10 +27,9 @@ * LCD Menu Messages * See also https://marlinfw.org/docs/development/lcd_language.html * - * Substitutions are applied for the following characters when used - * in menu items that call lcd_put_u8str_ind_P with an index: + * Substitutions are applied for the following characters when used in menu items titles: * - * $ displays an inserted C-string + * $ displays an inserted string * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) @@ -95,12 +94,6 @@ namespace Language_it { LSTR MSG_HOME_OFFSET_X = _UxGT("Offset home X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Offset home Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Offset home Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Offset home ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Offset home ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Offset home ") STR_K; - LSTR MSG_HOME_OFFSET_U = _UxGT("Offset home ") STR_U; - LSTR MSG_HOME_OFFSET_V = _UxGT("Offset home ") STR_V; - LSTR MSG_HOME_OFFSET_W = _UxGT("Offset home ") STR_W; LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset applicato"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Wizard Tramming"); LSTR MSG_SELECT_ORIGIN = _UxGT("Selez. origine"); @@ -284,16 +277,11 @@ namespace Language_it { LSTR MSG_MOVE_X = _UxGT("Muovi X"); LSTR MSG_MOVE_Y = _UxGT("Muovi Y"); LSTR MSG_MOVE_Z = _UxGT("Muovi Z"); - LSTR MSG_MOVE_I = _UxGT("Muovi ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Muovi ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Muovi ") STR_K; - LSTR MSG_MOVE_U = _UxGT("Muovi ") STR_U; - LSTR MSG_MOVE_V = _UxGT("Muovi ") STR_V; - LSTR MSG_MOVE_W = _UxGT("Muovi ") STR_W; + LSTR MSG_MOVE_N = _UxGT("Muovi @"); LSTR MSG_MOVE_E = _UxGT("Estrusore"); LSTR MSG_MOVE_EN = _UxGT("Estrusore *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Ugello freddo"); - LSTR MSG_MOVE_N_MM = _UxGT("Muovi di %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Muovi di $mm"); LSTR MSG_MOVE_01MM = _UxGT("Muovi di 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Muovi di 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Muovi di 10mm"); @@ -302,13 +290,6 @@ namespace Language_it { LSTR MSG_MOVE_001IN = _UxGT("Muovi di 0.01\""); LSTR MSG_MOVE_01IN = _UxGT("Muovi di 0.1\""); LSTR MSG_MOVE_1IN = _UxGT("Muovi di 1\""); - LSTR MSG_SPEED = _UxGT("Velocità"); - LSTR MSG_MAXSPEED = _UxGT("Vel.massima (mm/s)"); - LSTR MSG_MAXSPEED_X = _UxGT("Vel.massima ") STR_A; - LSTR MSG_MAXSPEED_Y = _UxGT("Vel.massima ") STR_B; - LSTR MSG_MAXSPEED_Z = _UxGT("Vel.massima ") STR_C; - LSTR MSG_MAXSPEED_E = _UxGT("Vel.massima ") STR_E; - LSTR MSG_MAXSPEED_A = _UxGT("Vel.massima @"); LSTR MSG_BED_Z = _UxGT("Piatto Z"); LSTR MSG_NOZZLE = _UxGT("Ugello"); LSTR MSG_NOZZLE_N = _UxGT("Ugello ~"); @@ -361,25 +342,15 @@ namespace Language_it { LSTR MSG_VA_JERK = _UxGT("Max Jerk ") STR_A; LSTR MSG_VB_JERK = _UxGT("Max Jerk ") STR_B; LSTR MSG_VC_JERK = _UxGT("Max Jerk ") STR_C; - LSTR MSG_VI_JERK = _UxGT("Max Jerk ") STR_I; - LSTR MSG_VJ_JERK = _UxGT("Max Jerk ") STR_J; - LSTR MSG_VK_JERK = _UxGT("Max Jerk ") STR_K; - LSTR MSG_VU_JERK = _UxGT("Max Jerk ") STR_U; - LSTR MSG_VV_JERK = _UxGT("Max Jerk ") STR_V; - LSTR MSG_VW_JERK = _UxGT("Max Jerk ") STR_W; + LSTR MSG_VN_JERK = _UxGT("Max Jerk @"); LSTR MSG_VE_JERK = _UxGT("Max Jerk E"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Deviaz. giunzioni"); - LSTR MSG_VELOCITY = _UxGT("Velocità"); + LSTR MSG_MAX_SPEED = _UxGT("Vel.massima (mm/s)"); LSTR MSG_VMAX_A = _UxGT("Vel.Massima ") STR_A; LSTR MSG_VMAX_B = _UxGT("Vel.Massima ") STR_B; LSTR MSG_VMAX_C = _UxGT("Vel.Massima ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vel.Massima ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vel.Massima ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vel.Massima ") STR_K; - LSTR MSG_VMAX_U = _UxGT("Vel.Massima ") STR_U; - LSTR MSG_VMAX_V = _UxGT("Vel.Massima ") STR_V; - LSTR MSG_VMAX_W = _UxGT("Vel.Massima ") STR_W; - LSTR MSG_VMAX_E = _UxGT("Vel.Massima ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Vel.Massima @"); + LSTR MSG_VMAX_E = _UxGT("Vel.Massima E"); LSTR MSG_VMAX_EN = _UxGT("Vel.Massima *"); LSTR MSG_VMIN = _UxGT("Vel.Minima"); LSTR MSG_VTRAV_MIN = _UxGT("Vel.Min spostam."); @@ -387,13 +358,8 @@ namespace Language_it { LSTR MSG_AMAX_A = _UxGT("Acc.Massima ") STR_A; LSTR MSG_AMAX_B = _UxGT("Acc.Massima ") STR_B; LSTR MSG_AMAX_C = _UxGT("Acc.Massima ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Acc.Massima ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Acc.Massima ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Acc.Massima ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Acc.Massima ") STR_E; - LSTR MSG_AMAX_U = _UxGT("Acc.Massima ") STR_U; - LSTR MSG_AMAX_V = _UxGT("Acc.Massima ") STR_V; - LSTR MSG_AMAX_W = _UxGT("Acc.Massima ") STR_W; + LSTR MSG_AMAX_N = _UxGT("Acc.Massima @"); + LSTR MSG_AMAX_E = _UxGT("Acc.Massima E"); LSTR MSG_AMAX_EN = _UxGT("Acc.Massima *"); LSTR MSG_A_RETRACT = _UxGT("A-Ritrazione"); LSTR MSG_A_TRAVEL = _UxGT("A-Spostamento"); @@ -403,12 +369,7 @@ namespace Language_it { LSTR MSG_A_STEPS = STR_A _UxGT(" passi/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" passi/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" passi/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" passi/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" passi/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" passi/mm"); - LSTR MSG_U_STEPS = STR_U _UxGT(" passi/mm"); - LSTR MSG_V_STEPS = STR_V _UxGT(" passi/mm"); - LSTR MSG_W_STEPS = STR_W _UxGT(" passi/mm"); + LSTR MSG_N_STEPS = _UxGT("@ passi/mm"); LSTR MSG_E_STEPS = _UxGT("E passi/mm"); LSTR MSG_EN_STEPS = _UxGT("* passi/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -560,12 +521,7 @@ namespace Language_it { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; - LSTR MSG_BABYSTEP_U = _UxGT("Babystep ") STR_U; - LSTR MSG_BABYSTEP_V = _UxGT("Babystep ") STR_V; - LSTR MSG_BABYSTEP_W = _UxGT("Babystep ") STR_W; + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Totali"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Interrompi se FC"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Risc.Fallito"); // Max 12 characters @@ -658,16 +614,7 @@ namespace Language_it { LSTR MSG_INFO_MAX_TEMP = _UxGT("Temp max"); LSTR MSG_INFO_PSU = _UxGT("Alimentatore"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Potenza Drive"); - LSTR MSG_DAC_PERCENT_A = _UxGT("Driver ") STR_A _UxGT(" %"); - LSTR MSG_DAC_PERCENT_B = _UxGT("Driver ") STR_B _UxGT(" %"); - LSTR MSG_DAC_PERCENT_C = _UxGT("Driver ") STR_C _UxGT(" %"); - LSTR MSG_DAC_PERCENT_I = _UxGT("Driver ") STR_I _UxGT(" %"); - LSTR MSG_DAC_PERCENT_J = _UxGT("Driver ") STR_J _UxGT(" %"); - LSTR MSG_DAC_PERCENT_K = _UxGT("Driver ") STR_K _UxGT(" %"); - LSTR MSG_DAC_PERCENT_U = _UxGT("Driver ") STR_U _UxGT(" %"); - LSTR MSG_DAC_PERCENT_V = _UxGT("Driver ") STR_V _UxGT(" %"); - LSTR MSG_DAC_PERCENT_W = _UxGT("Driver ") STR_W _UxGT(" %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("Driver E %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("Driver @ %"); LSTR MSG_ERROR_TMC = _UxGT("ERR.CONNESSIONE TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Scrivi DAC EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("CAMBIO FILAMENTO"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 01d1c0b987ea..0a53ee50d21f 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -93,7 +93,7 @@ namespace Language_jp_kana { LSTR MSG_MOVE_Y = _UxGT("Yジク イドウ"); // "Move Y" LSTR MSG_MOVE_Z = _UxGT("Zジク イドウ"); // "Move Z" LSTR MSG_MOVE_E = _UxGT("エクストルーダー"); // "Extruder" - LSTR MSG_MOVE_N_MM = _UxGT("%smm イドウ"); // "Move 0.025mm" + LSTR MSG_MOVE_N_MM = _UxGT("$mm イドウ"); // "Move 0.025mm" LSTR MSG_MOVE_01MM = _UxGT("0.1mm イドウ"); // "Move 0.1mm" LSTR MSG_MOVE_1MM = _UxGT(" 1mm イドウ"); // "Move 1mm" LSTR MSG_MOVE_10MM = _UxGT(" 10mm イドウ"); // "Move 10mm" @@ -118,20 +118,16 @@ namespace Language_jp_kana { LSTR MSG_VA_JERK = _UxGT("ジク ヤクドウ mm/s") STR_A; // "Va-jerk" LSTR MSG_VB_JERK = _UxGT("ジク ヤクドウ mm/s") STR_B; // "Vb-jerk" LSTR MSG_VC_JERK = _UxGT("ジク ヤクドウ mm/s") STR_C; // "Vc-jerk" - LSTR MSG_VI_JERK = _UxGT("ジク ヤクドウ mm/s") STR_I; // "Va-jerk" - LSTR MSG_VJ_JERK = _UxGT("ジク ヤクドウ mm/s") STR_J; // "Vb-jerk" - LSTR MSG_VK_JERK = _UxGT("ジク ヤクドウ mm/s") STR_K; // "Vc-jerk" + LSTR MSG_VN_JERK = _UxGT("ジク ヤクドウ mm/s@"); // "V@-jerk" LSTR MSG_A_STEPS = STR_A _UxGT("ステップ/mm"); LSTR MSG_B_STEPS = STR_B _UxGT("ステップ/mm"); LSTR MSG_C_STEPS = STR_C _UxGT("ステップ/mm"); + LSTR MSG_N_STEPS = _UxGT("@ステップ/mm"); LSTR MSG_VE_JERK = _UxGT("エクストルーダー ヤクド"); // "Ve-jerk" LSTR MSG_VMAX_A = _UxGT("サイダイオクリソクド ") STR_A; // "Vmax A" LSTR MSG_VMAX_B = _UxGT("サイダイオクリソクド ") STR_B; // "Vmax B" LSTR MSG_VMAX_C = _UxGT("サイダイオクリソクド ") STR_C; // "Vmax C" - LSTR MSG_VMAX_I = _UxGT("サイダイオクリソクド ") STR_I; // "Vmax I" - LSTR MSG_VMAX_J = _UxGT("サイダイオクリソクド ") STR_J; // "Vmax J" - LSTR MSG_VMAX_K = _UxGT("サイダイオクリソクド ") STR_K; // "Vmax K" - LSTR MSG_VMAX_E = _UxGT("サイダイオクリソクド ") STR_E; // "Vmax E" + LSTR MSG_VMAX_E = _UxGT("サイダイオクリソクド E"); // "Vmax E" LSTR MSG_VMAX_EN = _UxGT("サイダイオクリソクド *"); // "Vmax E1" LSTR MSG_VMIN = _UxGT("サイショウオクリソクド"); // "Vmin" LSTR MSG_VTRAV_MIN = _UxGT("サイショウイドウソクド"); // "VTrav min" @@ -215,13 +211,7 @@ namespace Language_jp_kana { LSTR MSG_INFO_MAX_TEMP = _UxGT("セッテイサイコウオン"); // "Max Temp" LSTR MSG_INFO_PSU = _UxGT("デンゲンシュベツ"); // "Power Supply" LSTR MSG_DRIVE_STRENGTH = _UxGT("モータークドウリョク"); // "Drive Strength" - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" DACシュツリョク %"); // "X Driver %" - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" DACシュツリョク %"); // "Y Driver %" - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" DACシュツリョク %"); // "Z Driver %" - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" DACシュツリョク %"); // "I Driver %" - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" DACシュツリョク %"); // "J Driver %" - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" DACシュツリョク %"); // "K Driver %" - LSTR MSG_DAC_PERCENT_E = _UxGT("E DACシュツリョク %"); // "E Driver %" + LSTR MSG_DAC_PERCENT_N = _UxGT("@ DACシュツリョク %"); // "@ Driver %" LSTR MSG_DAC_EEPROM_WRITE = _UxGT("EEPROMヘホゾン"); // "Store memory" LSTR MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("イチジテイシ"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("プリントサイカイ"); // "Resume print" @@ -249,7 +239,7 @@ namespace Language_jp_kana { LSTR MSG_YES = _UxGT("ハイ"); LSTR MSG_NO = _UxGT("イイエ"); LSTR MSG_BACK = _UxGT("モドリ"); - LSTR MSG_VELOCITY = _UxGT("ソクド"); + LSTR MSG_MAX_SPEED = _UxGT("ソクド"); LSTR MSG_STEPS_PER_MM = _UxGT("ステップ/mm"); LSTR MSG_CUSTOM_COMMANDS = _UxGT("ユーザーコマンド"); LSTR MSG_PRINT_PAUSED = _UxGT("プリントガイチジテイシサレマシタ"); diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 29a8a1fdc8d8..6b308ba48bac 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -86,7 +86,7 @@ namespace Language_nl { LSTR MSG_MOVE_Z = _UxGT("Verplaats Z"); LSTR MSG_MOVE_E = _UxGT("Extruder"); LSTR MSG_MOVE_EN = _UxGT("Extruder *"); - LSTR MSG_MOVE_N_MM = _UxGT("Verplaats %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Verplaats $mm"); LSTR MSG_MOVE_01MM = _UxGT("Verplaats 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Verplaats 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Verplaats 10mm"); @@ -157,6 +157,7 @@ namespace Language_nl { LSTR MSG_BABYSTEP_X = _UxGT("Babystap X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystap Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystap Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Babystap @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop afbr."); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Voorverw. fout"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Redun. temp fout"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 8bd7d2d30159..630f94ab12df 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -27,10 +27,9 @@ * LCD Menu Messages * See also https://marlinfw.org/docs/development/lcd_language.html * - * Substitutions are applied for the following characters when used - * in menu items that call lcd_put_u8str_ind_P with an index: + * Substitutions are applied for the following characters when used in menu items titles: * - * $ displays an inserted C-string + * $ displays an inserted string * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) @@ -239,7 +238,7 @@ namespace Language_pl { LSTR MSG_MOVE_E = _UxGT("Ekstruzja (os E)"); LSTR MSG_MOVE_EN = _UxGT("Ekstruzja (os E) *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Dysza za zimna"); - LSTR MSG_MOVE_N_MM = _UxGT("Przesuń co %s mm"); + LSTR MSG_MOVE_N_MM = _UxGT("Przesuń co $ mm"); LSTR MSG_MOVE_01MM = _UxGT("Przesuń co .1 mm"); LSTR MSG_MOVE_1MM = _UxGT("Przesuń co 1 mm"); LSTR MSG_MOVE_10MM = _UxGT("Przesuń co 10 mm"); @@ -276,11 +275,9 @@ namespace Language_pl { LSTR MSG_VA_JERK = _UxGT("Zryw V") STR_A; LSTR MSG_VB_JERK = _UxGT("Zryw V") STR_B; LSTR MSG_VC_JERK = _UxGT("Zryw V") STR_C; - LSTR MSG_VI_JERK = _UxGT("Zryw V") STR_I; - LSTR MSG_VJ_JERK = _UxGT("Zryw V") STR_J; - LSTR MSG_VK_JERK = _UxGT("Zryw V") STR_K; + LSTR MSG_VN_JERK = _UxGT("Zryw V@"); LSTR MSG_VE_JERK = _UxGT("Zryw Ve"); - LSTR MSG_VELOCITY = _UxGT("Prędkość (V)"); + LSTR MSG_MAX_SPEED = _UxGT("Prędkość (V)"); LSTR MSG_VTRAV_MIN = _UxGT("Vskok min"); LSTR MSG_ACCELERATION = _UxGT("Przyspieszenie (A)"); @@ -292,9 +289,7 @@ namespace Language_pl { LSTR MSG_A_STEPS = STR_A _UxGT(" kroki/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" kroki/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" kroki/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" kroki/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" kroki/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" kroki/mm"); + LSTR MSG_N_STEPS = _UxGT("@ kroki/mm"); LSTR MSG_E_STEPS = _UxGT("E kroki/mm"); LSTR MSG_EN_STEPS = _UxGT("* kroki/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -445,13 +440,7 @@ namespace Language_pl { LSTR MSG_INFO_PSU = _UxGT("Zasilacz"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Siła silnika"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Siła %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Siła %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Siła %"); LSTR MSG_ERROR_TMC = _UxGT("TMC BŁĄD POŁĄCZENIA"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Zapisz DAC EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("ZMIEŃ FILAMENT"); diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 2366142f062f..69df8bdf5427 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -80,7 +80,7 @@ namespace Language_pt { LSTR MSG_MOVE_Z = _UxGT("Mover Z"); LSTR MSG_MOVE_E = _UxGT("Mover Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Mover Extrusor *"); - LSTR MSG_MOVE_N_MM = _UxGT("Mover %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mover $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mover 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); @@ -104,9 +104,7 @@ namespace Language_pt { LSTR MSG_A_STEPS = STR_A _UxGT(" passo/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" passo/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" passo/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" passo/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" passo/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" passo/mm"); + LSTR MSG_N_STEPS = _UxGT("@ passo/mm"); LSTR MSG_E_STEPS = _UxGT("E passo/mm"); LSTR MSG_EN_STEPS = _UxGT("* passo/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 5e3e33b37625..5b73d6df6def 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -212,7 +212,7 @@ namespace Language_pt_br { LSTR MSG_MOVE_E = _UxGT("Mover Extrusor"); LSTR MSG_MOVE_EN = _UxGT("Mover Extrusor *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Extrus. mto fria"); - LSTR MSG_MOVE_N_MM = _UxGT("Mover %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Mover $mm"); LSTR MSG_MOVE_01MM = _UxGT("Mover 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Mover 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm"); @@ -242,12 +242,10 @@ namespace Language_pt_br { LSTR MSG_VA_JERK = _UxGT("arrancada V") STR_A; LSTR MSG_VB_JERK = _UxGT("arrancada V") STR_B; LSTR MSG_VC_JERK = _UxGT("arrancada V") STR_C; - LSTR MSG_VI_JERK = _UxGT("arrancada V") STR_I; - LSTR MSG_VJ_JERK = _UxGT("arrancada V") STR_J; - LSTR MSG_VK_JERK = _UxGT("arrancada V") STR_K; + LSTR MSG_VN_JERK = _UxGT("arrancada V@"); LSTR MSG_VE_JERK = _UxGT("arrancada VE"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Desv. Junção"); - LSTR MSG_VELOCITY = _UxGT("Velocidade"); + LSTR MSG_MAX_SPEED = _UxGT("Velocidade"); LSTR MSG_VTRAV_MIN = _UxGT("VDeslocamento min"); LSTR MSG_ACCELERATION = _UxGT("Aceleração"); LSTR MSG_A_RETRACT = _UxGT("Retrair A"); @@ -256,9 +254,7 @@ namespace Language_pt_br { LSTR MSG_A_STEPS = _UxGT("Passo ") STR_A _UxGT("/mm"); LSTR MSG_B_STEPS = _UxGT("Passo ") STR_B _UxGT("/mm"); LSTR MSG_C_STEPS = _UxGT("Passo ") STR_C _UxGT("/mm"); - LSTR MSG_I_STEPS = _UxGT("Passo ") STR_I _UxGT("/mm"); - LSTR MSG_J_STEPS = _UxGT("Passo ") STR_J _UxGT("/mm"); - LSTR MSG_K_STEPS = _UxGT("Passo ") STR_K _UxGT("/mm"); + LSTR MSG_N_STEPS = _UxGT("Passo @/mm"); LSTR MSG_E_STEPS = _UxGT("E/mm"); LSTR MSG_EN_STEPS = _UxGT("*/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatura"); @@ -352,6 +348,7 @@ namespace Language_pt_br { LSTR MSG_BABYSTEP_X = _UxGT("Passinho X"); LSTR MSG_BABYSTEP_Y = _UxGT("Passinho Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Passinho Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Passinho @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Abortar Fim de Curso"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Aquecimento falhou"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 79421752af01..79160624e7a4 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -225,7 +225,7 @@ namespace Language_ro { LSTR MSG_MOVE_E = _UxGT("Extruder"); LSTR MSG_MOVE_EN = _UxGT("Extruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Capat Prea Rece"); - LSTR MSG_MOVE_N_MM = _UxGT("Move %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Move $mm"); LSTR MSG_MOVE_01MM = _UxGT("Move 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Move 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Move 10mm"); @@ -270,30 +270,24 @@ namespace Language_ro { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-Jerk"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-Jerk"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-Jerk"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-Jerk"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-Jerk"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-Jerk"); + LSTR MSG_VN_JERK = _UxGT("V@-Jerk"); LSTR MSG_VE_JERK = _UxGT("Ve-Jerk"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - LSTR MSG_VELOCITY = _UxGT("Velocity"); - LSTR MSG_VMAX_A = _UxGT("Vmax ") STR_A; - LSTR MSG_VMAX_B = _UxGT("Vmax ") STR_B; - LSTR MSG_VMAX_C = _UxGT("Vmax ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vmax ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vmax ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vmax ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vmax ") STR_E; - LSTR MSG_VMAX_EN = _UxGT("Vmax *"); + LSTR MSG_MAX_SPEED = _UxGT("Max Speed"); + LSTR MSG_VMAX_A = _UxGT("Max Speed ") STR_A; + LSTR MSG_VMAX_B = _UxGT("Max Speed ") STR_B; + LSTR MSG_VMAX_C = _UxGT("Max Speed ") STR_C; + LSTR MSG_VMAX_N = _UxGT("Max Speed @"); + LSTR MSG_VMAX_E = _UxGT("Max Speed E"); + LSTR MSG_VMAX_EN = _UxGT("Max Speed *"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("VTrav Min"); LSTR MSG_ACCELERATION = _UxGT("Acceleration"); LSTR MSG_AMAX_A = _UxGT("Amax ") STR_A; LSTR MSG_AMAX_B = _UxGT("Amax ") STR_B; LSTR MSG_AMAX_C = _UxGT("Amax ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Amax ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Amax ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Amax ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Amax ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Amax @"); + LSTR MSG_AMAX_E = _UxGT("Amax E"); LSTR MSG_AMAX_EN = _UxGT("Amax *"); LSTR MSG_A_RETRACT = _UxGT("A-Retract"); LSTR MSG_A_TRAVEL = _UxGT("A-Travel"); @@ -303,11 +297,9 @@ namespace Language_ro { LSTR MSG_A_STEPS = STR_A _UxGT(" steps/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" steps/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" steps/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" steps/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" steps/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" steps/mm"); - LSTR MSG_E_STEPS = _UxGT("Esteps/mm"); - LSTR MSG_EN_STEPS = _UxGT("*steps/mm"); + LSTR MSG_N_STEPS = _UxGT("@ steps/mm"); + LSTR MSG_E_STEPS = _UxGT("E steps/mm"); + LSTR MSG_EN_STEPS = _UxGT("* steps/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperature"); LSTR MSG_MOTION = _UxGT("Motion"); LSTR MSG_FILAMENT = _UxGT("Filament"); @@ -435,6 +427,7 @@ namespace Language_ro { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop Abort"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Heating Failed"); @@ -503,13 +496,7 @@ namespace Language_ro { LSTR MSG_INFO_MAX_TEMP = _UxGT("Temperatura Maxima"); LSTR MSG_INFO_PSU = _UxGT("PSU"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Drive Strength"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("TMC CONNECTION ERROR"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Write"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMENT CHANGE"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 4b8d4703e453..5f05f1d2beb3 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -84,17 +84,11 @@ namespace Language_ru { LSTR MSG_HOME_OFFSET_X = _UxGT("Смещение дома X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Смещение дома Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Смещение дома Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Смещение дома ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Смещение дома ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Смещение дома ") STR_K; #else LSTR MSG_SET_HOME_OFFSETS = _UxGT("Установ.смещ.дома"); LSTR MSG_HOME_OFFSET_X = _UxGT("Смещ. дома X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Смещ. дома Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Смещ. дома Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Смещ. дома ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Смещ. дома ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Смещ. дома ") STR_K; #endif LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Смещения применены"); LSTR MSG_SELECT_ORIGIN = _UxGT("Выберите ноль"); @@ -338,9 +332,7 @@ namespace Language_ru { LSTR MSG_MOVE_X = _UxGT("Движение по X"); LSTR MSG_MOVE_Y = _UxGT("Движение по Y"); LSTR MSG_MOVE_Z = _UxGT("Движение по Z"); - LSTR MSG_MOVE_I = _UxGT("Движение по ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Движение по ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Движение по ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Движение по @"); LSTR MSG_MOVE_E = _UxGT("Экструдер"); LSTR MSG_MOVE_EN = _UxGT("Экструдер *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Сопло не нагрето"); @@ -401,23 +393,19 @@ namespace Language_ru { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-рывок"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-рывок"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-рывок"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-рывок"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-рывок"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-рывок"); + LSTR MSG_VN_JERK = _UxGT("V@-рывок"); LSTR MSG_VE_JERK = _UxGT("Ve-рывок"); #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_JUNCTION_DEVIATION = _UxGT("Отклонение узла"); #else LSTR MSG_JUNCTION_DEVIATION = _UxGT("Отклон. узла"); #endif - LSTR MSG_VELOCITY = _UxGT("Скорость, мм/с"); + LSTR MSG_MAX_SPEED = _UxGT("Скорость, мм/с"); LSTR MSG_VMAX_A = _UxGT("Скор.макс ") STR_A; LSTR MSG_VMAX_B = _UxGT("Скор.макс ") STR_B; LSTR MSG_VMAX_C = _UxGT("Скор.макс ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Скор.макс ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Скор.макс ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Скор.макс ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Скор.макс ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Скор.макс @"); + LSTR MSG_VMAX_E = _UxGT("Скор.макс E"); LSTR MSG_VMAX_EN = _UxGT("Скор.макс *"); LSTR MSG_VMIN = _UxGT("Скор.мин"); LSTR MSG_VTRAV_MIN = _UxGT("Перемещение мин"); @@ -425,10 +413,8 @@ namespace Language_ru { LSTR MSG_AMAX_A = _UxGT("Ускор.макс ") STR_A; LSTR MSG_AMAX_B = _UxGT("Ускор.макс ") STR_B; LSTR MSG_AMAX_C = _UxGT("Ускор.макс ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Ускор.макс ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Ускор.макс ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Ускор.макс ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Ускор.макс ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Ускор.макс @"); + LSTR MSG_AMAX_E = _UxGT("Ускор.макс E"); LSTR MSG_AMAX_EN = _UxGT("Ускор.макс *"); LSTR MSG_A_RETRACT = _UxGT("Ускор.втягив."); LSTR MSG_A_TRAVEL = _UxGT("Ускор.путеш."); @@ -438,9 +424,7 @@ namespace Language_ru { LSTR MSG_A_STEPS = STR_A _UxGT(" шаг/мм"); LSTR MSG_B_STEPS = STR_B _UxGT(" шаг/мм"); LSTR MSG_C_STEPS = STR_C _UxGT(" шаг/мм"); - LSTR MSG_I_STEPS = STR_I _UxGT(" шаг/мм"); - LSTR MSG_J_STEPS = STR_J _UxGT(" шаг/мм"); - LSTR MSG_K_STEPS = STR_K _UxGT(" шаг/мм"); + LSTR MSG_N_STEPS = _UxGT("@ шаг/мм"); LSTR MSG_E_STEPS = _UxGT("E шаг/мм"); LSTR MSG_EN_STEPS = _UxGT("* шаг/мм"); LSTR MSG_TEMPERATURE = _UxGT("Температура"); @@ -611,9 +595,7 @@ namespace Language_ru { LSTR MSG_BABYSTEP_X = _UxGT("Микрошаг X"); LSTR MSG_BABYSTEP_Y = _UxGT("Микрошаг Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Микрошаг Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Микрошаг ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Микрошаг ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Микрошаг ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Микрошаг @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Сумарно"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Сработал концевик"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Разогрев не удался"); @@ -710,13 +692,7 @@ namespace Language_ru { LSTR MSG_INFO_MAX_TEMP = _UxGT("Макс. ") LCD_STR_THERMOMETER; LSTR MSG_INFO_PSU = _UxGT("БП"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Сила привода"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Привод, %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Привод, %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Привод, %"); LSTR MSG_ERROR_TMC = _UxGT("СБОЙ СВЯЗИ С TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Запись DAC в EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("ЗАМЕНА ФИЛАМЕНТА"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 7ba505ede511..124080de0b85 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -31,10 +31,9 @@ * Translated by Michal Holeš, Farma MaM * https://www.facebook.com/farmamam * - * Substitutions are applied for the following characters when used - * in menu items that call lcd_put_u8str_ind_P with an index: + * Substitutions are applied for the following characters when used in menu items titles: * - * $ displays an inserted C-string + * $ displays an inserted string * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) @@ -98,9 +97,6 @@ namespace Language_sk { LSTR MSG_HOME_OFFSET_X = _UxGT("X Ofset"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Y Ofset"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Z Ofset"); - LSTR MSG_HOME_OFFSET_I = STR_I _UxGT(" Ofset"); - LSTR MSG_HOME_OFFSET_J = STR_J _UxGT(" Ofset"); - LSTR MSG_HOME_OFFSET_K = STR_K _UxGT(" Ofset"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastavené"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Spriev. vyrovn."); LSTR MSG_SELECT_ORIGIN = _UxGT("Vyberte začiatok"); @@ -281,13 +277,11 @@ namespace Language_sk { LSTR MSG_MOVE_X = _UxGT("Posunúť X"); LSTR MSG_MOVE_Y = _UxGT("Posunúť Y"); LSTR MSG_MOVE_Z = _UxGT("Posunúť Z"); - LSTR MSG_MOVE_I = _UxGT("Posunúť ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Posunúť ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Posunúť ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Posunúť @"); LSTR MSG_MOVE_E = _UxGT("Extrudér"); LSTR MSG_MOVE_EN = _UxGT("Extrudér *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend je studený"); - LSTR MSG_MOVE_N_MM = _UxGT("Posunúť o %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Posunúť o $mm"); LSTR MSG_MOVE_01MM = _UxGT("Posunúť o 0,1mm"); LSTR MSG_MOVE_1MM = _UxGT("Posunúť o 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Posunúť o 10mm"); @@ -297,12 +291,6 @@ namespace Language_sk { LSTR MSG_MOVE_01IN = _UxGT("Posunúť o 0,1in"); LSTR MSG_MOVE_1IN = _UxGT("Posunúť o 1,0in"); LSTR MSG_SPEED = _UxGT("Rýchlosť"); - LSTR MSG_MAXSPEED = _UxGT("Max rýchl. (mm/s)"); - LSTR MSG_MAXSPEED_X = _UxGT("Max rýchl. ") STR_A; - LSTR MSG_MAXSPEED_Y = _UxGT("Max rýchl. ") STR_B; - LSTR MSG_MAXSPEED_Z = _UxGT("Max rýchl. ") STR_C; - LSTR MSG_MAXSPEED_E = _UxGT("Max rýchl. ") STR_E; - LSTR MSG_MAXSPEED_A = _UxGT("Max rýchl. @"); LSTR MSG_BED_Z = _UxGT("Výška podl."); LSTR MSG_NOZZLE = _UxGT("Tryska"); LSTR MSG_NOZZLE_N = _UxGT("Tryska ~"); @@ -347,30 +335,24 @@ namespace Language_sk { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-skok"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-skok"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-skok"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-skok"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-skok"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-skok"); + LSTR MSG_VN_JERK = _UxGT("V@-skok"); LSTR MSG_VE_JERK = _UxGT("Ve-skok"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Junction Dev"); - LSTR MSG_VELOCITY = _UxGT("Rýchlosť"); - LSTR MSG_VMAX_A = _UxGT("Vmax ") STR_A; - LSTR MSG_VMAX_B = _UxGT("Vmax ") STR_B; - LSTR MSG_VMAX_C = _UxGT("Vmax ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vmax ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vmax ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vmax ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vmax ") STR_E; - LSTR MSG_VMAX_EN = _UxGT("Vmax *"); + LSTR MSG_MAX_SPEED = _UxGT("Max rýchl. (mm/s)"); + LSTR MSG_VMAX_A = _UxGT("Max rýchl. ") STR_A; + LSTR MSG_VMAX_B = _UxGT("Max rýchl. ") STR_B; + LSTR MSG_VMAX_C = _UxGT("Max rýchl. ") STR_C; + LSTR MSG_VMAX_N = _UxGT("Max rýchl. @"); + LSTR MSG_VMAX_E = _UxGT("Max rýchl. E"); + LSTR MSG_VMAX_EN = _UxGT("Max rýchl. *"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("VPrej Min"); LSTR MSG_ACCELERATION = _UxGT("Akcelerácia"); LSTR MSG_AMAX_A = _UxGT("Amax ") STR_A; LSTR MSG_AMAX_B = _UxGT("Amax ") STR_B; LSTR MSG_AMAX_C = _UxGT("Amax ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Amax ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Amax ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Amax ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Amax ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Amax @"); + LSTR MSG_AMAX_E = _UxGT("Amax E"); LSTR MSG_AMAX_EN = _UxGT("Amax *"); LSTR MSG_A_RETRACT = _UxGT("A-retrakt"); LSTR MSG_A_TRAVEL = _UxGT("A-prejazd"); @@ -380,11 +362,9 @@ namespace Language_sk { LSTR MSG_A_STEPS = STR_A _UxGT(" krokov/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" krokov/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" krokov/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" krokov/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" krokov/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" krokov/mm"); - LSTR MSG_E_STEPS = _UxGT("Ekrokov/mm"); - LSTR MSG_EN_STEPS = _UxGT("*krokov/mm"); + LSTR MSG_N_STEPS = _UxGT("@ krokov/mm"); + LSTR MSG_E_STEPS = _UxGT("E krokov/mm"); + LSTR MSG_EN_STEPS = _UxGT("* krokov/mm"); LSTR MSG_TEMPERATURE = _UxGT("Teplota"); LSTR MSG_MOTION = _UxGT("Pohyb"); LSTR MSG_FILAMENT = _UxGT("Filament"); @@ -527,9 +507,7 @@ namespace Language_sk { LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Babystep Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Babystep ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Babystep ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Babystep ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Celkom"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Zastavenie Endstop"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Chyba ohrevu"); @@ -624,13 +602,7 @@ namespace Language_sk { LSTR MSG_INFO_MAX_TEMP = _UxGT("Teplota max"); LSTR MSG_INFO_PSU = _UxGT("Nap. zdroj"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Budenie motorov"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Motor %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Motor %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Motor %"); LSTR MSG_ERROR_TMC = _UxGT("CHYBA KOMUNIKÁ. TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Uložiť do EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("VÝMENA FILAMENTU"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index db2196fa46ae..6e6d3e11ecd0 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -252,7 +252,7 @@ namespace Language_sv { LSTR MSG_MOVE_E = _UxGT("Extruder"); LSTR MSG_MOVE_EN = _UxGT("Extruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hetände för kall"); - LSTR MSG_MOVE_N_MM = _UxGT("Flytta %smm"); + LSTR MSG_MOVE_N_MM = _UxGT("Flytta $mm"); LSTR MSG_MOVE_01MM = _UxGT("Flytta 0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("Flytta 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Flytta 10mm"); @@ -300,19 +300,15 @@ namespace Language_sv { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-Ryck"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-Ryck"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-Ryck"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-Ryck"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-Ryck"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-Ryck"); + LSTR MSG_VN_JERK = _UxGT("V@-Ryck"); LSTR MSG_VE_JERK = _UxGT("Ve-Ryck"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Knutpunkt Avv"); - LSTR MSG_VELOCITY = _UxGT("Hastighet"); + LSTR MSG_MAX_SPEED = _UxGT("Hastighet"); LSTR MSG_VMAX_A = _UxGT("Vmax ") STR_A; LSTR MSG_VMAX_B = _UxGT("Vmax ") STR_B; LSTR MSG_VMAX_C = _UxGT("Vmax ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vmax ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vmax ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vmax ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vmax ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Vmax @"); + LSTR MSG_VMAX_E = _UxGT("Vmax E"); LSTR MSG_VMAX_EN = _UxGT("Vmax *"); LSTR MSG_VMIN = _UxGT("Vmin"); LSTR MSG_VTRAV_MIN = _UxGT("VTrav Min"); @@ -320,10 +316,8 @@ namespace Language_sv { LSTR MSG_AMAX_A = _UxGT("Amax ") STR_A; LSTR MSG_AMAX_B = _UxGT("Amax ") STR_B; LSTR MSG_AMAX_C = _UxGT("Amax ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Amax ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Amax ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Amax ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Amax ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Amax @"); + LSTR MSG_AMAX_E = _UxGT("Amax E"); LSTR MSG_AMAX_EN = _UxGT("Amax *"); LSTR MSG_A_RETRACT = _UxGT("A-Dra tillbaka"); LSTR MSG_A_TRAVEL = _UxGT("A-Färdas"); @@ -333,9 +327,7 @@ namespace Language_sv { LSTR MSG_A_STEPS = STR_A _UxGT(" Steg/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" Steg/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" Steg/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" Steg/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" Steg/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" Steg/mm"); + LSTR MSG_N_STEPS = _UxGT("@ Steg/mm"); LSTR MSG_E_STEPS = _UxGT("E Steg/mm"); LSTR MSG_EN_STEPS = _UxGT("* Steg/mm"); LSTR MSG_TEMPERATURE = _UxGT("Temperatur"); @@ -469,6 +461,7 @@ namespace Language_sv { LSTR MSG_BABYSTEP_X = _UxGT("Småsteg X"); LSTR MSG_BABYSTEP_Y = _UxGT("Småsteg Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Småsteg Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Småsteg @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Slutstopp Avbrott"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Värma Misslyckad"); @@ -540,13 +533,7 @@ namespace Language_sv { LSTR MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); LSTR MSG_INFO_PSU = _UxGT("PSU"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Driv Styrka"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Driver %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Driver %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("TMC KOPPLNINGSFEL"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Skriv"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("TRÅDBYTE"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 0acdd958c32d..b981127ed1cd 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -228,7 +228,7 @@ namespace Language_tr { LSTR MSG_MOVE_E = _UxGT("Ekstruder"); LSTR MSG_MOVE_EN = _UxGT("Ekstruder *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Nozul Çok Soğuk"); - LSTR MSG_MOVE_N_MM = _UxGT("%smm"); + LSTR MSG_MOVE_N_MM = _UxGT("$mm"); LSTR MSG_MOVE_01MM = _UxGT("0.1mm"); LSTR MSG_MOVE_1MM = _UxGT("1mm"); LSTR MSG_MOVE_10MM = _UxGT("10mm"); @@ -263,19 +263,15 @@ namespace Language_tr { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-Sarsım"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-Sarsım"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-Sarsım"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-Sarsım"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-Sarsım"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-Sarsım"); + LSTR MSG_VN_JERK = _UxGT("V@-Sarsım"); LSTR MSG_VE_JERK = _UxGT("Ve-Sarsım"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Jonksiyon Sapması"); - LSTR MSG_VELOCITY = _UxGT("Hız Vektörü"); + LSTR MSG_MAX_SPEED = _UxGT("Hız Vektörü"); LSTR MSG_VMAX_A = _UxGT("HızVektör.max ") STR_A; LSTR MSG_VMAX_B = _UxGT("HızVektör.max ") STR_B; LSTR MSG_VMAX_C = _UxGT("HızVektör.max ") STR_C; - LSTR MSG_VMAX_I = _UxGT("HızVektör.max ") STR_I; - LSTR MSG_VMAX_J = _UxGT("HızVektör.max ") STR_J; - LSTR MSG_VMAX_K = _UxGT("HızVektör.max ") STR_K; - LSTR MSG_VMAX_E = _UxGT("HızVektör.max ") STR_E; + LSTR MSG_VMAX_N = _UxGT("HızVektör.max @"); + LSTR MSG_VMAX_E = _UxGT("HızVektör.max E"); LSTR MSG_VMAX_EN = _UxGT("HızVektör.max *"); LSTR MSG_VMIN = _UxGT("HızVektör.min"); LSTR MSG_VTRAV_MIN = _UxGT("HV.gezinme min"); @@ -283,10 +279,8 @@ namespace Language_tr { LSTR MSG_AMAX_A = _UxGT("Max. ivme ") STR_A; LSTR MSG_AMAX_B = _UxGT("Max. ivme ") STR_B; LSTR MSG_AMAX_C = _UxGT("Max. ivme ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Max. ivme ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Max. ivme ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Max. ivme ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Max. ivme ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Max. ivme @"); + LSTR MSG_AMAX_E = _UxGT("Max. ivme E"); LSTR MSG_AMAX_EN = _UxGT("Max. ivme *"); LSTR MSG_A_RETRACT = _UxGT("Ivme-geri çekme"); LSTR MSG_A_TRAVEL = _UxGT("Ivme-gezinme"); @@ -294,9 +288,7 @@ namespace Language_tr { LSTR MSG_A_STEPS = STR_A _UxGT(" adım/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" adım/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" adım/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" adım/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" adım/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" adım/mm"); + LSTR MSG_N_STEPS = _UxGT("@ adım/mm"); LSTR MSG_E_STEPS = _UxGT("E adım/mm"); LSTR MSG_EN_STEPS = _UxGT("* adım/mm"); LSTR MSG_TEMPERATURE = _UxGT("Sıcaklık"); @@ -406,6 +398,7 @@ namespace Language_tr { LSTR MSG_BABYSTEP_X = _UxGT("Miniadım X"); LSTR MSG_BABYSTEP_Y = _UxGT("Miniadım Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Miniadım Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Miniadım @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Toplam"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop iptal"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Isınma başarısız"); @@ -473,13 +466,7 @@ namespace Language_tr { LSTR MSG_INFO_MAX_TEMP = _UxGT("Max Sıc."); LSTR MSG_INFO_PSU = _UxGT("Güç Kaynağı"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Sürücü Gücü"); - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" Sürücü %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E Sürücü %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ Sürücü %"); LSTR MSG_ERROR_TMC = _UxGT("TMC BAĞLANTI HATASI"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("DAC EEPROM Yaz"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("FILAMAN DEGISTIR"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index bfb74b9f6e9b..3c47ccada916 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -86,17 +86,11 @@ namespace Language_uk { LSTR MSG_HOME_OFFSET_X = _UxGT("Зміщення дому X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Зміщення дому Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Зміщення дому Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Зміщення дому ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Зміщення дому ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Зміщення дому ") STR_K; #else LSTR MSG_SET_HOME_OFFSETS = _UxGT("Встан. зміщ. дому"); LSTR MSG_HOME_OFFSET_X = _UxGT("Зміщ. дому X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Зміщ. дому Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Зміщ. дому Z"); - LSTR MSG_HOME_OFFSET_I = _UxGT("Зміщ. дому ") STR_I; - LSTR MSG_HOME_OFFSET_J = _UxGT("Зміщ. дому ") STR_J; - LSTR MSG_HOME_OFFSET_K = _UxGT("Зміщ. дому ") STR_K; #endif LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Зміщення прийняті"); LSTR MSG_SELECT_ORIGIN = _UxGT("Оберіть нуль"); @@ -339,9 +333,7 @@ namespace Language_uk { LSTR MSG_MOVE_X = _UxGT("Рух по X"); LSTR MSG_MOVE_Y = _UxGT("Рух по Y"); LSTR MSG_MOVE_Z = _UxGT("Рух по Z"); - LSTR MSG_MOVE_I = _UxGT("Рух по ") STR_I; - LSTR MSG_MOVE_J = _UxGT("Рух по ") STR_J; - LSTR MSG_MOVE_K = _UxGT("Рух по ") STR_K; + LSTR MSG_MOVE_N = _UxGT("Рух по @"); LSTR MSG_MOVE_E = _UxGT("Екструдер"); LSTR MSG_MOVE_EN = _UxGT("Екструдер *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Сопло дуже холодне"); @@ -406,23 +398,19 @@ namespace Language_uk { LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT("-ривок"); LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT("-ривок"); LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT("-ривок"); - LSTR MSG_VI_JERK = _UxGT("V") STR_I _UxGT("-ривок"); - LSTR MSG_VJ_JERK = _UxGT("V") STR_J _UxGT("-ривок"); - LSTR MSG_VK_JERK = _UxGT("V") STR_K _UxGT("-ривок"); + LSTR MSG_VN_JERK = _UxGT("V@-ривок"); LSTR MSG_VE_JERK = _UxGT("Ve-ривок"); #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_JUNCTION_DEVIATION = _UxGT("Відхилення вузла"); #else LSTR MSG_JUNCTION_DEVIATION = _UxGT("Відхил.вузла"); #endif - LSTR MSG_VELOCITY = _UxGT("Швидкість, мм/с"); + LSTR MSG_MAX_SPEED = _UxGT("Швидкість, мм/с"); LSTR MSG_VMAX_A = _UxGT("Швидк.макс ") STR_A; LSTR MSG_VMAX_B = _UxGT("Швидк.макс ") STR_B; LSTR MSG_VMAX_C = _UxGT("Швидк.макс ") STR_C; - LSTR MSG_VMAX_I = _UxGT("Швидк.макс ") STR_I; - LSTR MSG_VMAX_J = _UxGT("Швидк.макс ") STR_J; - LSTR MSG_VMAX_K = _UxGT("Швидк.макс ") STR_K; - LSTR MSG_VMAX_E = _UxGT("Швидк.макс ") STR_E; + LSTR MSG_VMAX_N = _UxGT("Швидк.макс @"); + LSTR MSG_VMAX_E = _UxGT("Швидк.макс E"); LSTR MSG_VMAX_EN = _UxGT("Швидк.макс *"); LSTR MSG_VMIN = _UxGT("Швидк. мін"); #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 @@ -434,10 +422,8 @@ namespace Language_uk { LSTR MSG_AMAX_A = _UxGT("Приск.макс ") STR_A; LSTR MSG_AMAX_B = _UxGT("Приск.макс ") STR_B; LSTR MSG_AMAX_C = _UxGT("Приск.макс ") STR_C; - LSTR MSG_AMAX_I = _UxGT("Приск.макс ") STR_I; - LSTR MSG_AMAX_J = _UxGT("Приск.макс ") STR_J; - LSTR MSG_AMAX_K = _UxGT("Приск.макс ") STR_K; - LSTR MSG_AMAX_E = _UxGT("Приск.макс ") STR_E; + LSTR MSG_AMAX_N = _UxGT("Приск.макс @"); + LSTR MSG_AMAX_E = _UxGT("Приск.макс E"); LSTR MSG_AMAX_EN = _UxGT("Приск.макс *"); LSTR MSG_A_RETRACT = _UxGT("Приск.втягув."); LSTR MSG_A_TRAVEL = _UxGT("Приск.переміщ."); @@ -447,9 +433,7 @@ namespace Language_uk { LSTR MSG_A_STEPS = STR_A _UxGT(" кроків/мм"); LSTR MSG_B_STEPS = STR_B _UxGT(" кроків/мм"); LSTR MSG_C_STEPS = STR_C _UxGT(" кроків/мм"); - LSTR MSG_I_STEPS = STR_I _UxGT(" кроків/мм"); - LSTR MSG_J_STEPS = STR_J _UxGT(" кроків/мм"); - LSTR MSG_K_STEPS = STR_K _UxGT(" кроків/мм"); + LSTR MSG_N_STEPS = _UxGT("@ кроків/мм"); LSTR MSG_E_STEPS = _UxGT("E кроків/мм"); LSTR MSG_EN_STEPS = _UxGT("* кроків/мм"); LSTR MSG_TEMPERATURE = _UxGT("Температура"); @@ -624,9 +608,7 @@ namespace Language_uk { LSTR MSG_BABYSTEP_X = _UxGT("Мікрокрок X"); LSTR MSG_BABYSTEP_Y = _UxGT("Мікрокрок Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Мікрокрок Z"); - LSTR MSG_BABYSTEP_I = _UxGT("Мікрокрок ") STR_I; - LSTR MSG_BABYSTEP_J = _UxGT("Мікрокрок ") STR_J; - LSTR MSG_BABYSTEP_K = _UxGT("Мікрокрок ") STR_K; + LSTR MSG_BABYSTEP_N = _UxGT("Мікрокрок @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Сумарно"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Кінцевик спрацював"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Збій нагріву"); @@ -749,13 +731,7 @@ namespace Language_uk { LSTR MSG_INFO_MAX_TEMP = _UxGT("Макс. ") LCD_STR_THERMOMETER; LSTR MSG_INFO_PSU = _UxGT("Блок жив-ня"); LSTR MSG_DRIVE_STRENGTH = _UxGT("Сила мотору"); - LSTR MSG_DAC_PERCENT_A = _UxGT("Драйвер ") STR_A _UxGT(", %"); - LSTR MSG_DAC_PERCENT_B = _UxGT("Драйвер ") STR_B _UxGT(", %"); - LSTR MSG_DAC_PERCENT_C = _UxGT("Драйвер ") STR_C _UxGT(", %"); - LSTR MSG_DAC_PERCENT_I = _UxGT("Драйвер ") STR_I _UxGT(", %"); - LSTR MSG_DAC_PERCENT_J = _UxGT("Драйвер ") STR_J _UxGT(", %"); - LSTR MSG_DAC_PERCENT_K = _UxGT("Драйвер ") STR_K _UxGT(", %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("Драйвер E, %"); + LSTR MSG_DAC_PERCENT_N = _UxGT("Драйвер @, %"); LSTR MSG_ERROR_TMC = _UxGT("ЗБІЙ ЗВ'ЯЗКУ З TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Запис ЦАП у EEPROM"); LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("ЗАМІНА ПРУТКА"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index da9e1fc03015..f963e3e346bc 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -230,19 +230,15 @@ namespace Language_vi { LSTR MSG_VA_JERK = _UxGT("Giật-V") STR_A; LSTR MSG_VB_JERK = _UxGT("Giật-V") STR_B; LSTR MSG_VC_JERK = _UxGT("Giật-V") STR_C; - LSTR MSG_VI_JERK = _UxGT("Giật-V") STR_I; - LSTR MSG_VJ_JERK = _UxGT("Giật-V") STR_J; - LSTR MSG_VK_JERK = _UxGT("Giật-V") STR_K; + LSTR MSG_VN_JERK = _UxGT("Giật-V@"); LSTR MSG_VE_JERK = _UxGT("Giật-Ve"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Độ Lệch Chỗ Giao"); // Junction Dev - LSTR MSG_VELOCITY = _UxGT("Vận tốc"); // velocity + LSTR MSG_MAX_SPEED = _UxGT("Vận tốc"); // velocity LSTR MSG_VMAX_A = _UxGT("Vđa") STR_A; // Vmax LSTR MSG_VMAX_B = _UxGT("Vđa") STR_B; LSTR MSG_VMAX_C = _UxGT("Vđa") STR_C; - LSTR MSG_VMAX_I = _UxGT("Vđa") STR_I; - LSTR MSG_VMAX_J = _UxGT("Vđa") STR_J; - LSTR MSG_VMAX_K = _UxGT("Vđa") STR_K; - LSTR MSG_VMAX_E = _UxGT("Vđa") STR_E; + LSTR MSG_VMAX_N = _UxGT("Vđa@"); + LSTR MSG_VMAX_E = _UxGT("VđaE"); LSTR MSG_VMAX_EN = _UxGT("Vđa *"); LSTR MSG_VMIN = _UxGT("Vthiểu"); // Vmin LSTR MSG_VTRAV_MIN = _UxGT("Vchuyển thiểu"); // VTrav min @@ -250,10 +246,8 @@ namespace Language_vi { LSTR MSG_AMAX_A = _UxGT("Tăng tốc ca") STR_A; // Amax LSTR MSG_AMAX_B = _UxGT("Tăng tốc ca") STR_B; LSTR MSG_AMAX_C = _UxGT("Tăng tốc ca") STR_C; - LSTR MSG_AMAX_I = _UxGT("Tăng tốc ca") STR_I; // Amax - LSTR MSG_AMAX_J = _UxGT("Tăng tốc ca") STR_J; - LSTR MSG_AMAX_K = _UxGT("Tăng tốc ca") STR_K; - LSTR MSG_AMAX_E = _UxGT("Tăng tốc ca") STR_E; + LSTR MSG_AMAX_N = _UxGT("Tăng tốc ca@"); + LSTR MSG_AMAX_E = _UxGT("Tăng tốc caE"); LSTR MSG_AMAX_EN = _UxGT("Tăng tốc ca *"); LSTR MSG_A_RETRACT = _UxGT("TT-Rút"); // A-retract LSTR MSG_A_TRAVEL = _UxGT("TT-Chuyển"); // A-travel @@ -261,9 +255,7 @@ namespace Language_vi { LSTR MSG_A_STEPS = _UxGT("Bước") STR_A _UxGT("/mm"); // Steps/mm LSTR MSG_B_STEPS = _UxGT("Bước") STR_B _UxGT("/mm"); LSTR MSG_C_STEPS = _UxGT("Bước") STR_C _UxGT("/mm"); - LSTR MSG_I_STEPS = _UxGT("Bước") STR_I _UxGT("/mm"); // Steps/mm - LSTR MSG_J_STEPS = _UxGT("Bước") STR_J _UxGT("/mm"); - LSTR MSG_K_STEPS = _UxGT("Bước") STR_K _UxGT("/mm"); + LSTR MSG_N_STEPS = _UxGT("Bước@/mm"); LSTR MSG_E_STEPS = _UxGT("BướcE/mm"); LSTR MSG_EN_STEPS = _UxGT("Bước */mm"); LSTR MSG_TEMPERATURE = _UxGT("Nhiệt độ"); // Temperature @@ -339,6 +331,7 @@ namespace Language_vi { LSTR MSG_BABYSTEP_X = _UxGT("Nhít X"); // Babystep X LSTR MSG_BABYSTEP_Y = _UxGT("Nhít Y"); LSTR MSG_BABYSTEP_Z = _UxGT("Nhít Z"); + LSTR MSG_BABYSTEP_N = _UxGT("Nhít @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Hủy bỏ công tắc"); // Endstop abort LSTR MSG_HEATING_FAILED_LCD = _UxGT("Sưởi đầu phun không thành công"); // Heating failed LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Điều sai: nhiệt độ dư"); // Err: REDUNDANT TEMP @@ -399,13 +392,7 @@ namespace Language_vi { LSTR MSG_INFO_MAX_TEMP = _UxGT("Nhiệt độ tối đa"); // Max temp LSTR MSG_INFO_PSU = _UxGT("Bộ nguồn"); // PSU LSTR MSG_DRIVE_STRENGTH = _UxGT("Sức mạnh ổ đĩa"); // Drive Strength - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" % trình điều khiển"); // X Driver % - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" % trình điều khiển"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" % trình điều khiển"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" % trình điều khiển"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" % trình điều khiển"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" % trình điều khiển"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E % trình điều khiển"); + LSTR MSG_DAC_PERCENT_N = _UxGT("@ % trình điều khiển"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Ghi DAC EEPROM"); // DAC EEPROM Write LSTR MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("In tạm dừng"); // PRINT PAUSED LSTR MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("Nạp dây nhựa"); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index f2d348b3965b..a4816ff899c0 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -225,7 +225,7 @@ namespace Language_zh_CN { LSTR MSG_MOVE_E = _UxGT("挤出机"); // "Extruder" LSTR MSG_MOVE_EN = _UxGT("挤出机 *"); // "Extruder" LSTR MSG_HOTEND_TOO_COLD = _UxGT("热端太冷"); - LSTR MSG_MOVE_N_MM = _UxGT("移动 %s mm"); // "Move 0.025mm" + LSTR MSG_MOVE_N_MM = _UxGT("移动 $ mm"); // "Move 0.025mm" LSTR MSG_MOVE_01MM = _UxGT("移动 0.1 mm"); // "Move 0.1mm" LSTR MSG_MOVE_1MM = _UxGT("移动 1 mm"); // "Move 1mm" LSTR MSG_MOVE_10MM = _UxGT("移动 10 mm"); // "Move 10mm" @@ -270,19 +270,15 @@ namespace Language_zh_CN { LSTR MSG_VA_JERK = _UxGT("轴抖动速率") STR_A; // "Va-jerk" LSTR MSG_VB_JERK = _UxGT("轴抖动速率") STR_B; // "Vb-jerk" LSTR MSG_VC_JERK = _UxGT("轴抖动速率") STR_C; // "Vc-jerk" - LSTR MSG_VI_JERK = _UxGT("轴抖动速率") STR_I; // "Vi-jerk" - LSTR MSG_VJ_JERK = _UxGT("轴抖动速率") STR_J; // "Vj-jerk" - LSTR MSG_VK_JERK = _UxGT("轴抖动速率") STR_K; // "Vk-jerk" + LSTR MSG_VN_JERK = _UxGT("轴抖动速率@"); // "V@-jerk" LSTR MSG_VE_JERK = _UxGT("挤出机抖动速率"); // "Ve-jerk" LSTR MSG_JUNCTION_DEVIATION = _UxGT("接点差"); - LSTR MSG_VELOCITY = _UxGT("速度"); // "Velocity" + LSTR MSG_MAX_SPEED = _UxGT("速度"); // "Velocity" LSTR MSG_VMAX_A = _UxGT("最大进料速率") STR_A; // "Vmax " max_feedrate_mm_s LSTR MSG_VMAX_B = _UxGT("最大进料速率") STR_B; LSTR MSG_VMAX_C = _UxGT("最大进料速率") STR_C; - LSTR MSG_VMAX_I = _UxGT("最大进料速率") STR_I; - LSTR MSG_VMAX_J = _UxGT("最大进料速率") STR_J; - LSTR MSG_VMAX_K = _UxGT("最大进料速率") STR_K; - LSTR MSG_VMAX_E = _UxGT("最大进料速率") STR_E; + LSTR MSG_VMAX_N = _UxGT("最大进料速率@"); + LSTR MSG_VMAX_E = _UxGT("最大进料速率E"); LSTR MSG_VMAX_EN = _UxGT("最大进料速率 *"); LSTR MSG_VMIN = _UxGT("最小进料速率"); // "Vmin" min_feedrate_mm_s LSTR MSG_VTRAV_MIN = _UxGT("最小移动速率"); // "VTrav min" min_travel_feedrate_mm_s, (target) speed of the move @@ -290,10 +286,8 @@ namespace Language_zh_CN { LSTR MSG_AMAX_A = _UxGT("最大打印加速度") STR_A; // "Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves LSTR MSG_AMAX_B = _UxGT("最大打印加速度") STR_B; LSTR MSG_AMAX_C = _UxGT("最大打印加速度") STR_C; - LSTR MSG_AMAX_I = _UxGT("最大打印加速度") STR_I; - LSTR MSG_AMAX_J = _UxGT("最大打印加速度") STR_J; - LSTR MSG_AMAX_K = _UxGT("最大打印加速度") STR_K; - LSTR MSG_AMAX_E = _UxGT("最大打印加速度") STR_E; + LSTR MSG_AMAX_N = _UxGT("最大打印加速度@"); + LSTR MSG_AMAX_E = _UxGT("最大打印加速度E"); LSTR MSG_AMAX_EN = _UxGT("最大打印加速度 *"); LSTR MSG_A_RETRACT = _UxGT("收进加速度"); // "A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts LSTR MSG_A_TRAVEL = _UxGT("非打印移动加速度"); // "A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves @@ -303,9 +297,7 @@ namespace Language_zh_CN { LSTR MSG_A_STEPS = STR_A _UxGT(" 步数/mm"); // "Asteps/mm" LSTR MSG_B_STEPS = STR_B _UxGT(" 步数/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" 步数/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" 步数/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" 步数/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" 步数/mm"); + LSTR MSG_N_STEPS = _UxGT("@ 步数/mm"); LSTR MSG_E_STEPS = _UxGT("E 步数/mm"); // "Esteps/mm" LSTR MSG_EN_STEPS = _UxGT("* 步数/mm"); LSTR MSG_TEMPERATURE = _UxGT("温度"); // "Temperature" @@ -507,13 +499,7 @@ namespace Language_zh_CN { LSTR MSG_INFO_MAX_TEMP = _UxGT("最高温度"); // "Max Temp" LSTR MSG_INFO_PSU = _UxGT("电源供应"); // "Power Supply" LSTR MSG_DRIVE_STRENGTH = _UxGT("驱动力度"); // "Drive Strength" - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" 驱动 %"); // "X Driver %" - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" 驱动 %"); - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" 驱动 %"); - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" 驱动 %"); - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" 驱动 %"); - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" 驱动 %"); - LSTR MSG_DAC_PERCENT_E = _UxGT("E 驱动 %"); // "E Driver %" + LSTR MSG_DAC_PERCENT_N = _UxGT("@ 驱动 %"); // "E Driver %" LSTR MSG_ERROR_TMC = _UxGT("TMC 连接错误"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("保存驱动设置"); // "DAC EEPROM Write" LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("更换料"); diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 3c0acd5fa87d..5f7c85c8383d 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -221,7 +221,7 @@ namespace Language_zh_TW { LSTR MSG_MOVE_E = _UxGT("擠出機"); // "Extruder" LSTR MSG_MOVE_EN = _UxGT("擠出機 *"); // "Extruder *" LSTR MSG_HOTEND_TOO_COLD = _UxGT("噴嘴溫度不夠"); // "Hotend too cold" - LSTR MSG_MOVE_N_MM = _UxGT("移動 %s mm"); // "Move 0.025mm" + LSTR MSG_MOVE_N_MM = _UxGT("移動 $ mm"); // "Move 0.025mm" LSTR MSG_MOVE_01MM = _UxGT("移動 0.1 mm"); // "Move 0.1mm" LSTR MSG_MOVE_1MM = _UxGT("移動 1 mm"); // "Move 1mm" LSTR MSG_MOVE_10MM = _UxGT("移動 10 mm"); // "Move 10mm" @@ -254,19 +254,15 @@ namespace Language_zh_TW { LSTR MSG_VA_JERK = _UxGT("軸抖動速率") STR_A; // "Va-jerk" LSTR MSG_VB_JERK = _UxGT("軸抖動速率") STR_B; LSTR MSG_VC_JERK = _UxGT("軸抖動速率") STR_C; - LSTR MSG_VI_JERK = _UxGT("軸抖動速率") STR_I; - LSTR MSG_VJ_JERK = _UxGT("軸抖動速率") STR_J; - LSTR MSG_VK_JERK = _UxGT("軸抖動速率") STR_K; + LSTR MSG_VN_JERK = _UxGT("軸抖動速率@"); LSTR MSG_VE_JERK = _UxGT("擠出機抖動速率"); - LSTR MSG_VELOCITY = _UxGT("速度"); // "Velocity" + LSTR MSG_MAX_SPEED = _UxGT("速度"); // "Velocity" LSTR MSG_VMAX_A = _UxGT("最大進料速率") STR_A; // "Vmax " max_feedrate_mm_s LSTR MSG_VMAX_B = _UxGT("最大進料速率") STR_B; LSTR MSG_VMAX_C = _UxGT("最大進料速率") STR_C; - LSTR MSG_VMAX_I = _UxGT("最大進料速率") STR_I; - LSTR MSG_VMAX_J = _UxGT("最大進料速率") STR_J; - LSTR MSG_VMAX_K = _UxGT("最大進料速率") STR_K; - LSTR MSG_VMAX_E = _UxGT("最大進料速率") STR_E; + LSTR MSG_VMAX_N = _UxGT("最大進料速率@"); + LSTR MSG_VMAX_E = _UxGT("最大進料速率E"); LSTR MSG_VMAX_EN = _UxGT("最大進料速率 *"); // "Vmax " max_feedrate_mm_s LSTR MSG_VMIN = _UxGT("最小進料速率"); // "Vmin" min_feedrate_mm_s LSTR MSG_VTRAV_MIN = _UxGT("最小移動速率"); // "VTrav min" min_travel_feedrate_mm_s, (target) speed of the move @@ -274,10 +270,8 @@ namespace Language_zh_TW { LSTR MSG_AMAX_A = _UxGT("最大列印加速度") STR_A; // "Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves LSTR MSG_AMAX_B = _UxGT("最大列印加速度") STR_B; LSTR MSG_AMAX_C = _UxGT("最大列印加速度") STR_C; - LSTR MSG_AMAX_I = _UxGT("最大列印加速度") STR_I; - LSTR MSG_AMAX_J = _UxGT("最大列印加速度") STR_J; - LSTR MSG_AMAX_K = _UxGT("最大列印加速度") STR_K; - LSTR MSG_AMAX_E = _UxGT("最大列印加速度") STR_E; + LSTR MSG_AMAX_N = _UxGT("最大列印加速度@"); + LSTR MSG_AMAX_E = _UxGT("最大列印加速度E"); LSTR MSG_AMAX_EN = _UxGT("最大列印加速度 *"); // "Amax " max_acceleration_mm_per_s2, acceleration in units/s^2 for print moves LSTR MSG_A_RETRACT = _UxGT("回縮加速度"); // "A-retract" retract_acceleration, E acceleration in mm/s^2 for retracts LSTR MSG_A_TRAVEL = _UxGT("非列印移動加速度"); // "A-travel" travel_acceleration, X, Y, Z acceleration in mm/s^2 for travel (non printing) moves @@ -285,9 +279,7 @@ namespace Language_zh_TW { LSTR MSG_A_STEPS = STR_A _UxGT(" 軸步數/mm"); // "Asteps/mm" axis_steps_per_mm, axis steps-per-unit G92 LSTR MSG_B_STEPS = STR_B _UxGT(" 軸步數/mm"); LSTR MSG_C_STEPS = STR_C _UxGT(" 軸步數/mm"); - LSTR MSG_I_STEPS = STR_I _UxGT(" 軸步數/mm"); - LSTR MSG_J_STEPS = STR_J _UxGT(" 軸步數/mm"); - LSTR MSG_K_STEPS = STR_K _UxGT(" 軸步數/mm"); + LSTR MSG_N_STEPS = _UxGT("@ 軸步數/mm"); LSTR MSG_E_STEPS = _UxGT("擠出機步數/mm"); // "Esteps/mm" LSTR MSG_EN_STEPS = _UxGT("擠出機~步數/mm"); LSTR MSG_TEMPERATURE = _UxGT("溫度"); // "Temperature" @@ -454,13 +446,7 @@ namespace Language_zh_TW { LSTR MSG_INFO_MAX_TEMP = _UxGT("最高溫度"); // "Max Temp" LSTR MSG_INFO_PSU = _UxGT("電源供應"); // "Power Supply" LSTR MSG_DRIVE_STRENGTH = _UxGT("驅動力度"); // "Drive Strength" - LSTR MSG_DAC_PERCENT_A = STR_A _UxGT(" 驅動 %"); // X Driver % - LSTR MSG_DAC_PERCENT_B = STR_B _UxGT(" 驅動 %"); // Y Driver % - LSTR MSG_DAC_PERCENT_C = STR_C _UxGT(" 驅動 %"); // Z Driver % - LSTR MSG_DAC_PERCENT_I = STR_I _UxGT(" 驅動 %"); // I Driver % - LSTR MSG_DAC_PERCENT_J = STR_J _UxGT(" 驅動 %"); // J Driver % - LSTR MSG_DAC_PERCENT_K = STR_K _UxGT(" 驅動 %"); // K Driver % - LSTR MSG_DAC_PERCENT_E = _UxGT("E 驅動 %"); //E Driver % + LSTR MSG_DAC_PERCENT_N = _UxGT("@ 驅動 %"); //E Driver % LSTR MSG_ERROR_TMC = _UxGT("TMC連接錯誤"); // "TMC CONNECTION ERROR" LSTR MSG_DAC_EEPROM_WRITE = _UxGT("保存驅動設置"); // "DAC EEPROM Write" LSTR MSG_FILAMENT_CHANGE_HEADER = _UxGT("更換絲料"); // "FILAMENT CHANGE" diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 8ca0c8ee9e3e..692181306993 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -32,19 +32,19 @@ #include "lcdprint.h" /** - * lcd_put_u8str_ind_P + * lcd_put_u8str_P * - * Print a string with an index substituted within it: + * Print a string with optional substitutions: * - * $ displays the clipped C-string given by the inStr argument + * $ displays the clipped string given by fstr or cstr * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) * @ displays an axis name such as XYZUVW, or E for an extruder */ -lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const inStr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { +lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { const uint8_t prop = USE_WIDE_GLYPH ? 2 : 1; - uint8_t *p = (uint8_t*)pstr; + const uint8_t *p = (uint8_t*)ptpl; int8_t n = maxlen; while (n > 0) { wchar_t ch; @@ -71,8 +71,11 @@ lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const i break; } } - else if (ch == '$' && inStr) { - n -= lcd_put_u8str_max_P(inStr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); + else if (ch == '$' && fstr) { + n -= lcd_put_u8str_max_P(FTOP(fstr), n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); + } + else if (ch == '$' && cstr) { + n -= lcd_put_u8str_max(cstr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); } else if (ch == '@') { lcd_put_wchar(axis_codes[ind]); @@ -90,7 +93,7 @@ lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const i int calculateWidth(PGM_P const pstr) { if (!USE_WIDE_GLYPH) return utf8_strlen_P(pstr) * MENU_FONT_WIDTH; const uint8_t prop = 2; - uint8_t *p = (uint8_t*)pstr; + const uint8_t *p = (uint8_t*)pstr; int n = 0; do { diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index d716d035caf6..2eb47c534b05 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -130,83 +130,167 @@ int lcd_glyph_height(); -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length); +/** + * @brief Draw a UTF-8 character + * + * @param utf8_str : the UTF-8 character + * @param max_length : the output width limit (in pixels on GLCD) + * + * @return the output width (in pixels on GLCD) + */ +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length); /** - * @brief Draw a UTF-8 string + * @brief Draw a SRAM UTF-8 string * * @param utf8_str : the UTF-8 string - * @param max_length : the pixel length of the string allowed (or number of slots in HD44780) - * - * @return the pixel width + * @param max_length : the output width limit (in pixels on GLCD) * - * Draw a UTF-8 string + * @return the output width (in pixels on GLCD) */ -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length); +int lcd_put_u8str_max(const char *utf8_str, const pixel_len_t max_length); /** - * Set the print baseline position + * Change the print cursor position */ void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row); /** * @brief Draw a ROM UTF-8 string * - * @param utf8_pstr : the ROM UTF-8 string - * @param max_length : the pixel length of the string allowed (or number of slots in HD44780) + * @param pstr : the ROM UTF-8 string + * @param max_length : the output width limit (in pixels on GLCD) * - * @return the pixel width - * - * Draw a ROM UTF-8 string + * @return the output width (in pixels on GLCD) */ -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length); -inline int lcd_put_u8str_max_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P pstr, const pixel_len_t max_length); +inline int lcd_put_u8str_max_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P pstr, const pixel_len_t max_length) { lcd_moveto(col, row); - return lcd_put_u8str_max_P(utf8_pstr, max_length); + return lcd_put_u8str_max_P(pstr, max_length); } -inline int lcd_put_u8str_max(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const utf8_fstr, pixel_len_t max_length) { - return lcd_put_u8str_max_P(col, row, FTOP(utf8_fstr), max_length); +inline int lcd_put_u8str_max(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const fstr, const pixel_len_t max_length) { + return lcd_put_u8str_max_P(col, row, FTOP(fstr), max_length); } +/** + * @brief Draw an integer, left-justified + * + * @param i : the integer + */ void lcd_put_int(const int i); inline void lcd_put_int(const lcd_uint_t col, const lcd_uint_t row, const int i) { lcd_moveto(col, row); lcd_put_int(i); } +/** + * @brief Draw a ROM UTF-8 string + * + * @param i : the integer + */ inline int lcd_put_u8str_P(PGM_P const pstr) { return lcd_put_u8str_max_P(pstr, PIXEL_LEN_NOLIMIT); } inline int lcd_put_u8str_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P const pstr) { lcd_moveto(col, row); return lcd_put_u8str_P(pstr); } +/** + * @brief Draw a ROM UTF-8 F-string + * + * @param fstr The F-string pointer + * @return the output width (in pixels on GLCD) + */ inline int lcd_put_u8str(FSTR_P const fstr) { return lcd_put_u8str_P(FTOP(fstr)); } inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const fstr) { return lcd_put_u8str_P(col, row, FTOP(fstr)); } -lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const inStr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH); -inline lcd_uint_t lcd_put_u8str_ind_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P const pstr, const int8_t ind, PGM_P const inStr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { +/** + * @brief Draw a string with optional substitution + * @details Print a string with optional substitutions: + * $ displays the clipped string given by fstr or cstr + * = displays '0'....'10' for indexes 0 - 10 + * ~ displays '1'....'11' for indexes 0 - 10 + * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) + * @ displays an axis name such as XYZUVW, or E for an extruder + * + * @param ptpl A ROM string (template) + * @param ind An index value to use for = ~ * substitution + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + * @param maxlen The maximum size of the string (in pixels on GLCD) + * @return the output width (in pixels on GLCD) + */ +lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr=nullptr, FSTR_P const fstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH); +inline lcd_uint_t lcd_put_u8str_P(const lcd_uint_t col, const lcd_uint_t row, PGM_P const ptpl, const int8_t ind, const char *cstr=nullptr, FSTR_P const fstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { lcd_moveto(col, row); - return lcd_put_u8str_ind_P(pstr, ind, inStr, maxlen); + return lcd_put_u8str_P(ptpl, ind, cstr, fstr, maxlen); } -inline lcd_uint_t lcd_put_u8str_ind(FSTR_P const fstr, const int8_t ind, FSTR_P const inFstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { - return lcd_put_u8str_ind_P(FTOP(fstr), ind, FTOP(inFstr), maxlen); +/** + * @brief Draw a ROM UTF-8 F-string with optional substitution + * @details (See above) + * + * @param ftpl A ROM F-string (template) + * @param ind An index value to use for = ~ * substitution + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + * @param maxlen The maximum size of the string (in pixels on GLCD) + * @return the output width (in pixels on GLCD) + */ +inline lcd_uint_t lcd_put_u8str(FSTR_P const ftpl, const int8_t ind, const char *cstr=nullptr, FSTR_P const fstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { + return lcd_put_u8str_P(FTOP(ftpl), ind, cstr, fstr, maxlen); } -inline lcd_uint_t lcd_put_u8str_ind(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const fstr, const int8_t ind, FSTR_P const inFstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { - return lcd_put_u8str_ind_P(col, row, FTOP(fstr), ind, FTOP(inFstr), maxlen); +/** + * @param col + * @param row + */ +inline lcd_uint_t lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, FSTR_P const ftpl, const int8_t ind, const char *cstr=nullptr, FSTR_P const fstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { + return lcd_put_u8str_P(col, row, FTOP(ftpl), ind, cstr, fstr, maxlen); } +/** + * @brief Draw a SRAM string with no width limit + * + * @param str The UTF-8 string + * @return the output width (in pixels on GLCD) + */ inline int lcd_put_u8str(const char * const str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); } +/** + * @param col + * @param row + */ inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, const char * const str) { lcd_moveto(col, row); return lcd_put_u8str(str); } +/** + * @brief Draw a UTF-8 character with no width limit + * + * @param c The wchar to draw + * @return the output width (in pixels on GLCD) + */ inline int lcd_put_wchar(const wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); } +/** + * @param col + * @param row + */ inline int lcd_put_wchar(const lcd_uint_t col, const lcd_uint_t row, const wchar_t c) { lcd_moveto(col, row); return lcd_put_wchar(c); } +/** + * @brief Calculate the width of a ROM UTF-8 string (in pixels on GLCD) + * + * @param pstr The ROM-based UTF-8 string + * @return the string width (in pixels on GLCD) + */ int calculateWidth(PGM_P const pstr); +/** + * @brief Calculate the width of a ROM UTF-8 string (in pixels on GLCD) + * + * @param pstr The ROM-based UTF-8 string + * @return the string width (in pixels on GLCD) + */ +inline int calculateWidth(FSTR_P const fstr) { return calculateWidth(FTOP(fstr)); } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index af1286c48b00..0765ef40a915 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -416,10 +416,11 @@ void MarlinUI::init() { SETCURSOR(0, row); // Simulate carriage return }; - uint8_t *p = (uint8_t*)string; + const uint8_t *p = (uint8_t*)string; wchar_t ch; if (wordwrap) { - uint8_t *wrd = nullptr, c = 0; + const uint8_t *wrd = nullptr; + uint8_t c = 0; // find the end of the part for (;;) { if (!wrd) wrd = p; // Get word start /before/ advancing diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 92be24aa0642..4dc1105f78b9 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -68,9 +68,10 @@ typedef struct { menuPosition screen_history[6]; uint8_t screen_history_depth = 0; -int8_t MenuItemBase::itemIndex; // Index number for draw and action -FSTR_P MenuItemBase::itemString; // A string for substitution -chimera_t editable; // Value Editing +int8_t MenuItemBase::itemIndex; // Index number for draw and action +FSTR_P MenuItemBase::itemStringF; // A string for substitution +const char *MenuItemBase::itemStringC; +chimera_t editable; // Value Editing // Menu Edit Items FSTR_P MenuEditItemBase::editLabel; diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index fbee2c8501f4..2dd6315ad97d 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -53,15 +53,17 @@ class MenuItemBase { // Index to interject in the item label and/or for use by its action. static int8_t itemIndex; - // An optional pointer for use in display or by the action - static FSTR_P itemString; + // Optional pointers for use in display or by the action + static FSTR_P itemStringF; + static const char* itemStringC; - // Store the index of the item ahead of use by indexed items - FORCE_INLINE static void init(const int8_t ind=0, FSTR_P const fstr=nullptr) { itemIndex = ind; itemString = fstr; } + // Store an index and string for later substitution + FORCE_INLINE static void init(const int8_t ind=0, FSTR_P const fstr=nullptr) { itemIndex = ind; itemStringF = fstr; itemStringC = nullptr; } + FORCE_INLINE static void init(const int8_t ind, const char * const cstr) { itemIndex = ind; itemStringC = cstr; itemStringF = nullptr; } // Implementation-specific: // Draw an item either selected (pre_char) or not (space) with post_char - // Menus may set up itemIndex, itemString and pass them to string-building or string-emitting functions + // Menus may set up itemIndex, itemStringC/F and pass them to string-building or string-emitting functions static void _draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char); // Draw an item either selected ('>') or not (space) with post_char @@ -90,8 +92,8 @@ class MenuItem_back : public MenuItemBase { // YESNO_ITEM(LABEL,FY,FN,...) class MenuItem_confirm : public MenuItemBase { public: - FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, ...) { - _draw(sel, row, fstr, '>', LCD_STR_ARROW_RIGHT[0]); + FORCE_INLINE static void draw(const bool sel, const uint8_t row, FSTR_P const ftpl, ...) { + _draw(sel, row, ftpl, '>', LCD_STR_ARROW_RIGHT[0]); } // Implemented for HD44780 and DOGM // Draw the prompt, buttons, and state @@ -170,10 +172,10 @@ class MenuEditItemBase : public MenuItemBase { public: // Implementation-specific: // Draw the current item at specified row with edit data - static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm=false); + static void draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm=false); - static void draw(const bool sel, const uint8_t row, FSTR_P const fstr, FSTR_P const inStr) { - draw(sel, row, fstr, FTOP(inStr), true); + static void draw(const bool sel, const uint8_t row, FSTR_P const ftpl, FSTR_P const fstr) { + draw(sel, row, ftpl, FTOP(fstr), true); } // Implementation-specific: diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index a4677952d620..e3c7c171d0f0 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -68,8 +68,10 @@ void menu_backlash(); LOOP_LOGICAL_AXES(i) driverPercent[i] = stepper_dac.get_current_percent((AxisEnum)i); START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_DAC_PERCENT(A) EDIT_ITEM(uint8, MSG_DAC_PERCENT_##A, &driverPercent[_AXIS(A)], 0, 100, []{ stepper_dac.set_current_percents(driverPercent); }) - LOGICAL_AXIS_CODE(EDIT_DAC_PERCENT(E), EDIT_DAC_PERCENT(A), EDIT_DAC_PERCENT(B), EDIT_DAC_PERCENT(C), EDIT_DAC_PERCENT(I), EDIT_DAC_PERCENT(J), EDIT_DAC_PERCENT(K)); + + LOOP_LOGICAL_AXES(a) + EDIT_ITEM_N(uint8, a, MSG_DAC_PERCENT_N, &driverPercent[a], 0, 100, []{ stepper_dac.set_current_percents(driverPercent); }); + ACTION_ITEM(MSG_DAC_EEPROM_WRITE, stepper_dac.commit_eeprom); END_MENU(); } @@ -427,11 +429,11 @@ void menu_backlash(); START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_VMAX(N) EDIT_ITEM_FAST(float5, MSG_VMAX_##N, &planner.settings.max_feedrate_mm_s[_AXIS(N)], 1, max_fr_edit_scaled[_AXIS(N)]) - LINEAR_AXIS_CODE(EDIT_VMAX(A), EDIT_VMAX(B), EDIT_VMAX(C), EDIT_VMAX(I), EDIT_VMAX(J), EDIT_VMAX(K)); + LOOP_NUM_AXES(a) + EDIT_ITEM_FAST_N(float5, a, MSG_VMAX_N, &planner.settings.max_feedrate_mm_s[a], 1, max_fr_edit_scaled[a]); #if E_STEPPERS - EDIT_ITEM_FAST(float5, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e); + EDIT_ITEM_FAST_N(float5, E_AXIS, MSG_VMAX_N, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e); #endif #if ENABLED(DISTINCT_E_FACTORS) LOOP_L_N(n, E_STEPPERS) @@ -514,11 +516,9 @@ void menu_backlash(); BACK_ITEM(MSG_ADVANCED_SETTINGS); #if HAS_JUNCTION_DEVIATION - #if ENABLED(LIN_ADVANCE) - EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.3f, planner.recalculate_max_e_jerk); - #else - EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.5f); - #endif + EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, TERN(LIN_ADVANCE, 0.3f, 0.5f) + OPTARG(LIN_ADVANCE, planner.recalculate_max_e_jerk) + ); #endif constexpr xyze_float_t max_jerk_edit = @@ -532,20 +532,13 @@ void menu_backlash(); { LOGICAL_AXIS_LIST(990, 990, 990, 990, 990, 990, 990) } #endif ; - #define EDIT_JERK(N) EDIT_ITEM_FAST(float3, MSG_V##N##_JERK, &planner.max_jerk[_AXIS(N)], 1, max_jerk_edit[_AXIS(N)]) - #if ENABLED(DELTA) - #define EDIT_JERK_C() EDIT_JERK(C) - #else - #define EDIT_JERK_C() EDIT_ITEM_FAST(float52sign, MSG_VC_JERK, &planner.max_jerk.c, 0.1f, max_jerk_edit.c) - #endif - LINEAR_AXIS_CODE( - EDIT_JERK(A), EDIT_JERK(B), EDIT_JERK_C(), - EDIT_JERK(I), EDIT_JERK(J), EDIT_JERK(K) - ); - #if HAS_EXTRUDERS - EDIT_ITEM_FAST(float52sign, MSG_VE_JERK, &planner.max_jerk.e, 0.1f, max_jerk_edit.e); - #endif + LOOP_LOGICAL_AXES(a) { + if (a == C_AXIS || TERN0(HAS_EXTRUDERS, a == E_AXIS)) + EDIT_ITEM_FAST_N(float52sign, a, MSG_VN_JERK, &planner.max_jerk[a], 0.1f, max_jerk_edit[a]); + else + EDIT_ITEM_FAST_N(float3, a, MSG_VN_JERK, &planner.max_jerk[a], 1.0f, max_jerk_edit[a]); + } END_MENU(); } @@ -582,11 +575,8 @@ void menu_advanced_steps_per_mm() { START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - #define EDIT_QSTEPS(Q) EDIT_ITEM_FAST(float61, MSG_##Q##_STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, []{ planner.refresh_positioning(); }) - LINEAR_AXIS_CODE( - EDIT_QSTEPS(A), EDIT_QSTEPS(B), EDIT_QSTEPS(C), - EDIT_QSTEPS(I), EDIT_QSTEPS(J), EDIT_QSTEPS(K) - ); + LOOP_NUM_AXES(a) + EDIT_ITEM_FAST_N(float61, a, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[a], 5, 9999, []{ planner.refresh_positioning(); }); #if ENABLED(DISTINCT_E_FACTORS) LOOP_L_N(n, E_STEPPERS) @@ -598,7 +588,7 @@ void menu_advanced_steps_per_mm() { planner.mm_per_step[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)]; }); #elif E_STEPPERS - EDIT_ITEM_FAST(float61, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); }); + EDIT_ITEM_FAST_N(float61, E_AXIS, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); }); #endif END_MENU(); @@ -624,7 +614,7 @@ void menu_advanced_settings() { #endif // M203 / M205 - Feedrate items - SUBMENU(MSG_VELOCITY, menu_advanced_velocity); + SUBMENU(MSG_MAX_SPEED, menu_advanced_velocity); // M201 - Acceleration items SUBMENU(MSG_ACCELERATION, menu_advanced_acceleration); diff --git a/Marlin/src/lcd/menu/menu_backlash.cpp b/Marlin/src/lcd/menu/menu_backlash.cpp index faed8cf77763..6b6cdf2e0bef 100644 --- a/Marlin/src/lcd/menu/menu_backlash.cpp +++ b/Marlin/src/lcd/menu/menu_backlash.cpp @@ -47,7 +47,7 @@ void menu_backlash() { #define EDIT_BACKLASH_DISTANCE(N) do { \ editable.decimal = backlash.get_distance_mm(_AXIS(N)); \ - EDIT_ITEM_FAST(float43, MSG_BACKLASH_##N, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_distance_mm(_AXIS(N), editable.decimal); }); \ + EDIT_ITEM_FAST_N(float43, _AXIS(N), MSG_BACKLASH_N, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_distance_mm(_AXIS(N), editable.decimal); }); \ } while (0); if (_CAN_CALI(A)) EDIT_BACKLASH_DISTANCE(A); diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index cb36f4bc98a2..8b6af33fd11e 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -572,7 +572,7 @@ void menu_configuration() { // Preheat configurations #if HAS_PREHEAT && DISABLED(SLIM_LCD_MENUS) LOOP_L_N(m, PREHEAT_COUNT) - SUBMENU_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M_SETTINGS, _menu_configuration_preheat_settings); + SUBMENU_N_f(m, ui.get_preheat_label(m), MSG_PREHEAT_M_SETTINGS, _menu_configuration_preheat_settings); #endif #if ENABLED(SOUND_MENU_ITEM) diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 5e4e11669695..5902a2f63f35 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -95,7 +95,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { BACK_ITEM(MSG_BACK); #if HAS_PREHEAT LOOP_L_N(m, PREHEAT_COUNT) - ACTION_ITEM_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset); + ACTION_ITEM_N_f(m, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset); #endif EDIT_ITEM_FAST_N(int3, extruder, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[extruder].target, EXTRUDE_MINTEMP, thermalManager.hotend_max_target(extruder), @@ -132,18 +132,18 @@ void menu_change_filament() { // Change filament #if E_STEPPERS == 1 - FSTR_P const msg = GET_TEXT_F(MSG_FILAMENTCHANGE); + FSTR_P const fmsg = GET_TEXT_F(MSG_FILAMENTCHANGE); if (thermalManager.targetTooColdToExtrude(active_extruder)) - SUBMENU_F(msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); }); + SUBMENU_F(fmsg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); }); else - GCODES_ITEM_F(msg, F("M600 B0")); + GCODES_ITEM_F(fmsg, F("M600 B0")); #else - FSTR_P const msg = GET_TEXT_F(MSG_FILAMENTCHANGE_E); + FSTR_P const fmsg = GET_TEXT_F(MSG_FILAMENTCHANGE_E); LOOP_L_N(s, E_STEPPERS) { if (thermalManager.targetTooColdToExtrude(s)) - SUBMENU_N_F(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); }); + SUBMENU_N_F(s, fmsg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); }); else { - ACTION_ITEM_N_F(s, msg, []{ + ACTION_ITEM_N_F(s, fmsg, []{ PGM_P const cmdpstr = PSTR("M600 B0 T%i"); char cmd[strlen_P(cmdpstr) + 3 + 1]; sprintf_P(cmd, cmdpstr, int(MenuItemBase::itemIndex)); @@ -271,10 +271,10 @@ void menu_pause_option() { // // ADVANCED_PAUSE_FEATURE message screens // -// Warning: msg must have three null bytes to delimit lines! +// Warning: fmsg must have three null bytes to delimit lines! // -void _lcd_pause_message(FSTR_P const msg) { - PGM_P const msg1 = FTOP(msg); +void _lcd_pause_message(FSTR_P const fmsg) { + PGM_P const msg1 = FTOP(fmsg); PGM_P const msg2 = msg1 + strlen_P(msg1) + 1; PGM_P const msg3 = msg2 + strlen_P(msg2) + 1; const bool has2 = msg2[0], has3 = msg3[0], diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 80a0872da652..53cf7c321ea5 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -268,7 +268,7 @@ class MenuItem_bool : public MenuEditItemBase { #define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER) #endif -#define _MENU_INNER_P(TYPE, USE_MULTIPLIER, FLABEL, V...) do { \ +#define _MENU_INNER_F(TYPE, USE_MULTIPLIER, FLABEL, V...) do { \ FSTR_P const flabel = FLABEL; \ if (encoderLine == _thisItemNr && ui.use_click()) { \ _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ @@ -280,30 +280,41 @@ class MenuItem_bool : public MenuEditItemBase { (encoderLine == _thisItemNr, _lcdLineNr, flabel, ##V); \ }while(0) +// Item with optional data #define _MENU_ITEM_F(TYPE, V...) do { \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ - _MENU_INNER_P(TYPE, ##V); \ + _MENU_INNER_F(TYPE, ##V); \ } \ NEXT_ITEM(); \ }while(0) -// Indexed items set a global index value and optional data +// Item with index value, C-string, and optional data #define _MENU_ITEM_N_S_F(TYPE, N, S, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ MenuItemBase::init(N, S); \ - _MENU_INNER_P(TYPE, ##V); \ + _MENU_INNER_F(TYPE, ##V); \ } \ NEXT_ITEM(); \ }while(0) -// Indexed items set a global index value +// Item with index value and F-string +#define _MENU_ITEM_N_f_F(TYPE, N, f, V...) do{ \ + if (_menuLineNr == _thisItemNr) { \ + _skipStatic = false; \ + MenuItemBase::init(N, f); \ + _MENU_INNER_F(TYPE, ##V); \ + } \ + NEXT_ITEM(); \ +}while(0) + +// Item with index value #define _MENU_ITEM_N_F(TYPE, N, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ - MenuItemBase::itemIndex = N; \ - _MENU_INNER_P(TYPE, ##V); \ + MenuItemBase::init(N); \ + _MENU_INNER_F(TYPE, ##V); \ } \ NEXT_ITEM(); \ }while(0) @@ -312,8 +323,18 @@ class MenuItem_bool : public MenuEditItemBase { #define _MENU_ITEM_S_F(TYPE, S, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ _skipStatic = false; \ - MenuItemBase::itemString = S; \ - _MENU_INNER_P(TYPE, ##V); \ + MenuItemBase::init(0, S); \ + _MENU_INNER_F(TYPE, ##V); \ + } \ + NEXT_ITEM(); \ +}while(0) + +// Items with a unique F-string +#define _MENU_ITEM_f_F(TYPE, f, V...) do{ \ + if (_menuLineNr == _thisItemNr) { \ + _skipStatic = false; \ + MenuItemBase::init(0, f); \ + _MENU_INNER_F(TYPE, ##V); \ } \ NEXT_ITEM(); \ }while(0) @@ -361,15 +382,24 @@ class MenuItem_bool : public MenuEditItemBase { #define STATIC_ITEM(LABEL, V...) STATIC_ITEM_F(GET_TEXT_F(LABEL), ##V) #define STATIC_ITEM_N(LABEL, N, V...) STATIC_ITEM_N_F(GET_TEXT_F(LABEL), N, ##V) +// Menu item with index and composed C-string substitution #define MENU_ITEM_N_S_F(TYPE, N, S, FLABEL, V...) _MENU_ITEM_N_S_F(TYPE, N, S, false, FLABEL, ##V) #define MENU_ITEM_N_S(TYPE, N, S, LABEL, V...) MENU_ITEM_N_S_F(TYPE, N, S, GET_TEXT_F(LABEL), ##V) + +// Menu item with composed C-string substitution #define MENU_ITEM_S_F(TYPE, S, FLABEL, V...) _MENU_ITEM_S_F(TYPE, S, false, FLABEL, ##V) #define MENU_ITEM_S(TYPE, S, LABEL, V...) MENU_ITEM_S_F(TYPE, S, GET_TEXT_F(LABEL), ##V) + +// Menu item substitution, indexed #define MENU_ITEM_N_F(TYPE, N, FLABEL, V...) _MENU_ITEM_N_F(TYPE, N, false, FLABEL, ##V) #define MENU_ITEM_N(TYPE, N, LABEL, V...) MENU_ITEM_N_F(TYPE, N, GET_TEXT_F(LABEL), ##V) + +// Basic menu items, no substitution #define MENU_ITEM_F(TYPE, FLABEL, V...) _MENU_ITEM_F(TYPE, false, FLABEL, ##V) #define MENU_ITEM(TYPE, LABEL, V...) MENU_ITEM_F(TYPE, GET_TEXT_F(LABEL), ##V) +// Predefined menu item types // + #define BACK_ITEM_F(FLABEL) MENU_ITEM_F(back, FLABEL) #define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL) @@ -418,6 +448,38 @@ class MenuItem_bool : public MenuEditItemBase { #define EDIT_ITEM_FAST_F(TYPE, FLABEL, V...) _MENU_ITEM_F(TYPE, true, FLABEL, ##V) #define EDIT_ITEM_FAST(TYPE, LABEL, V...) EDIT_ITEM_FAST_F(TYPE, GET_TEXT_F(LABEL), ##V) +// F-string substitution instead of C-string // + +#define MENU_ITEM_N_f_F(TYPE, N, f, FLABEL, V...) _MENU_ITEM_N_f_F(TYPE, N, f, false, FLABEL, ##V) +#define MENU_ITEM_N_f(TYPE, N, f, LABEL, V...) MENU_ITEM_N_f_F(TYPE, N, f, GET_TEXT_F(LABEL), ##V) +#define MENU_ITEM_f_F(TYPE, f, FLABEL, V...) _MENU_ITEM_f_F(TYPE, f, false, FLABEL, ##V) +#define MENU_ITEM_f(TYPE, f, LABEL, V...) MENU_ITEM_f_F(TYPE, f, GET_TEXT_F(LABEL), ##V) + +#define ACTION_ITEM_N_f_F(N, f, FLABEL, ACTION) MENU_ITEM_N_f_F(function, N, f, FLABEL, ACTION) +#define ACTION_ITEM_N_f(N, f, LABEL, ACTION) ACTION_ITEM_N_f_F(N, f, GET_TEXT_F(LABEL), ACTION) +#define ACTION_ITEM_f_F(f, FLABEL, ACTION) MENU_ITEM_f_F(function, f, FLABEL, ACTION) +#define ACTION_ITEM_f(f, LABEL, ACTION) ACTION_ITEM_f_F(f, GET_TEXT_F(LABEL), ACTION) + +#define GCODES_ITEM_N_f_F(N, f, FLABEL, GCODES) MENU_ITEM_N_f_F(gcode, N, f, FLABEL, GCODES) +#define GCODES_ITEM_N_f(N, f, LABEL, GCODES) GCODES_ITEM_N_f_F(N, f, GET_TEXT_F(LABEL), GCODES) +#define GCODES_ITEM_f_F(f, FLABEL, GCODES) MENU_ITEM_f_F(gcode, f, FLABEL, GCODES) +#define GCODES_ITEM_f(f, LABEL, GCODES) GCODES_ITEM_f_F(f, GET_TEXT_F(LABEL), GCODES) + +#define SUBMENU_N_f_F(N, f, FLABEL, DEST) MENU_ITEM_N_f_F(submenu, N, f, FLABEL, DEST) +#define SUBMENU_N_f(N, f, LABEL, DEST) SUBMENU_N_f_F(N, f, GET_TEXT_F(LABEL), DEST) +#define SUBMENU_f_F(f, FLABEL, DEST) MENU_ITEM_f_F(submenu, f, FLABEL, DEST) +#define SUBMENU_f(f, LABEL, DEST) SUBMENU_f_F(f, GET_TEXT_F(LABEL), DEST) + +#define EDIT_ITEM_N_f_F(TYPE, N, f, FLABEL, V...) MENU_ITEM_N_f_F(TYPE, N, f, FLABEL, ##V) +#define EDIT_ITEM_N_f(TYPE, N, f, LABEL, V...) EDIT_ITEM_N_f_F(TYPE, N, f, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_f_F(TYPE, f, FLABEL, V...) MENU_ITEM_f_F(TYPE, f, FLABEL, ##V) +#define EDIT_ITEM_f(TYPE, f, LABEL, V...) EDIT_ITEM_f_F(TYPE, f, GET_TEXT_F(LABEL), ##V) + +#define EDIT_ITEM_FAST_N_f_F(TYPE, N, f, FLABEL, V...) _MENU_ITEM_N_f_F(TYPE, N, f, true, FLABEL, ##V) +#define EDIT_ITEM_FAST_N_f(TYPE, N, f, LABEL, V...) EDIT_ITEM_FAST_N_f_F(TYPE, N, f, true, GET_TEXT_F(LABEL), ##V) +#define EDIT_ITEM_FAST_f_F(TYPE, f, FLABEL, V...) _MENU_ITEM_f_F(TYPE, f, true, FLABEL, ##V) +#define EDIT_ITEM_FAST_f(TYPE, f, LABEL, V...) EDIT_ITEM_FAST_f_F(TYPE, f, GET_TEXT_F(LABEL), ##V) + #define _CONFIRM_ITEM_INNER_F(FLABEL, V...) do { \ if (encoderLine == _thisItemNr && ui.use_click()) { \ ui.push_current_screen(); \ diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 2cfdb078efc9..e5d027f21532 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -57,6 +57,8 @@ // "Motion" > "Move Axis" submenu // +// TODO: Use substitution here with MSG_MOVE_N + static void _lcd_move_xyz(FSTR_P const name, const AxisEnum axis) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); if (ui.encoderPosition && !ui.manual_move.processing) { @@ -187,22 +189,8 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); }); SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); }); SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); }); - if (axis == Z_AXIS && (FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) { - // Determine digits needed right of decimal - constexpr uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; - PGM_P const label = GET_TEXT(MSG_MOVE_N_MM); - char tmp[strlen_P(label) + 10 + 1], numstr[10]; - sprintf_P(tmp, label, dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); - #if DISABLED(HAS_GRAPHICAL_TFT) - SUBMENU_F(FPSTR(NUL_STR), []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); - MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - #else - SUBMENU_F(FPSTR(tmp), []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); - #endif - } + if (axis == Z_AXIS && (FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) + SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); }); } END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index 6271b314f404..c7cbebaade82 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -68,21 +68,8 @@ void probe_offset_wizard_menu() { SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); }); SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); }); - if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) { - char tmp[20], numstr[10]; - // Determine digits needed right of decimal - const uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; - sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); - #if DISABLED(HAS_GRAPHICAL_TFT) - SUBMENU_F(FPSTR(NUL_STR), []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); - MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - #else - SUBMENU_F(tmp, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); - #endif - } + if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) + SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); ACTION_ITEM(MSG_BUTTON_DONE, []{ set_offset_and_go_back(calculated_z_offset); diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index fb539f006c14..e493972a9712 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -88,14 +88,14 @@ void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t i // Indexed "Preheat ABC" and "Heat Bed" items #define PREHEAT_ITEMS(M,E) do{ \ - ACTION_ITEM_N_S(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_both(M, MenuItemBase::itemIndex); }); \ - ACTION_ITEM_N_S(E, ui.get_preheat_label(M), MSG_PREHEAT_M_END_E, []{ _preheat_end(M, MenuItemBase::itemIndex); }); \ + ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_both(M, MenuItemBase::itemIndex); }); \ + ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_END_E, []{ _preheat_end(M, MenuItemBase::itemIndex); }); \ }while(0) #elif HAS_MULTI_HOTEND // No heated bed, so just indexed "Preheat ABC" items - #define PREHEAT_ITEMS(M,E) ACTION_ITEM_N_S(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_end(M, MenuItemBase::itemIndex); }) + #define PREHEAT_ITEMS(M,E) ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_end(M, MenuItemBase::itemIndex); }) #endif @@ -112,16 +112,16 @@ void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t i #if HOTENDS == 1 #if HAS_HEATED_BED - ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, []{ _preheat_both(editable.int8, 0); }); - ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_END, do_preheat_end_m); + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, []{ _preheat_both(editable.int8, 0); }); + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_END, do_preheat_end_m); #else - ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); #endif #elif HAS_MULTI_HOTEND HOTEND_LOOP() PREHEAT_ITEMS(editable.int8, e); - ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_ALL, []() { + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_ALL, []() { const celsius_t t = ui.material_preset[editable.int8].hotend_temp; HOTEND_LOOP() thermalManager.setTargetHotend(t, e); TERN(HAS_HEATED_BED, _preheat_bed(editable.int8), ui.return_to_status()); @@ -130,7 +130,7 @@ void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t i #endif #if HAS_HEATED_BED - ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M_BEDONLY, []{ _preheat_bed(editable.int8); }); + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_BEDONLY, []{ _preheat_bed(editable.int8); }); #endif END_MENU(); @@ -269,9 +269,9 @@ void menu_temperature() { LOOP_L_N(m, PREHEAT_COUNT) { editable.int8 = m; #if HAS_MULTI_HOTEND || HAS_HEATED_BED - SUBMENU_S(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m); + SUBMENU_f(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m); #elif HAS_HOTEND - ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); #endif } #endif @@ -296,9 +296,9 @@ void menu_temperature() { LOOP_L_N(m, PREHEAT_COUNT) { editable.int8 = m; #if HAS_MULTI_HOTEND || HAS_HEATED_BED - SUBMENU_S(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m); + SUBMENU_f(ui.get_preheat_label(m), MSG_PREHEAT_M, menu_preheat_m); #else - ACTION_ITEM_S(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); #endif } diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 5d4c3a4bfb47..b13c55f80a3b 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -50,6 +50,8 @@ #include "../dogm/marlinui_DOGM.h" #endif + // TODO: Replace fmsg with MSG_BABYSTEP_N and index substitution + void _lcd_babystep(const AxisEnum axis, FSTR_P const fmsg) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); if (ui.encoderPosition) { @@ -223,13 +225,13 @@ void menu_tune() { // #if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEP_XY) - SUBMENU(MSG_BABYSTEP_X, []{ _lcd_babystep_go(_lcd_babystep_x); }); - SUBMENU(MSG_BABYSTEP_Y, []{ _lcd_babystep_go(_lcd_babystep_y); }); + SUBMENU_N(X_AXIS, MSG_BABYSTEP_N, []{ _lcd_babystep_go(_lcd_babystep_x); }); + SUBMENU_N(Y_AXIS, MSG_BABYSTEP_N, []{ _lcd_babystep_go(_lcd_babystep_y); }); #endif #if ENABLED(BABYSTEP_ZPROBE_OFFSET) SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); #else - SUBMENU(MSG_BABYSTEP_Z, lcd_babystep_z); + SUBMENU_N(Z_AXIS, MSG_BABYSTEP_N, lcd_babystep_z); #endif #endif diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 297325348d23..62c1770bd4c3 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -211,10 +211,10 @@ void _lcd_ubl_edit_mesh() { #if HAS_PREHEAT #if HAS_HEATED_BED #define VALIDATE_MESH_GCODE_ITEM(M) \ - GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPI" STRINGIFY(M))); + GCODES_ITEM_N_f(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPI" STRINGIFY(M))); #else #define VALIDATE_MESH_GCODE_ITEM(M) \ - GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPB0I" STRINGIFY(M))); + GCODES_ITEM_N_f(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, F("G28\nG26CPB0I" STRINGIFY(M))); #endif REPEAT(PREHEAT_COUNT, VALIDATE_MESH_GCODE_ITEM) #endif @@ -317,7 +317,7 @@ void _lcd_ubl_build_mesh() { #else #define PREHEAT_BED_GCODE(M) "" #endif - #define BUILD_MESH_GCODE_ITEM(M) GCODES_ITEM_S(ui.get_preheat_label(M), MSG_UBL_BUILD_MESH_M, \ + #define BUILD_MESH_GCODE_ITEM(M) GCODES_ITEM_f(ui.get_preheat_label(M), MSG_UBL_BUILD_MESH_M, \ F( \ "G28\n" \ PREHEAT_BED_GCODE(M) \ diff --git a/Marlin/src/lcd/menu/menu_x_twist.cpp b/Marlin/src/lcd/menu/menu_x_twist.cpp index eba22cca620c..e46745e8b761 100644 --- a/Marlin/src/lcd/menu/menu_x_twist.cpp +++ b/Marlin/src/lcd/menu/menu_x_twist.cpp @@ -100,19 +100,10 @@ void xatc_wizard_menu() { SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); }); if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) { - char tmp[20], numstr[10]; // Determine digits needed right of decimal const uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 : !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; - sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr)); - #if DISABLED(HAS_GRAPHICAL_TFT) - SUBMENU_F(FPSTR(NUL_STR), []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); - MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780)); - lcd_put_u8str(tmp); - MENU_ITEM_ADDON_END(); - #else - SUBMENU_F(FPSTR(tmp), []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); - #endif + SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); } ACTION_ITEM(MSG_BUTTON_DONE, xatc_wizard_set_offset_and_go_to_next_point); diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index 435e7c30bf51..67cec2ee1c7e 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -94,7 +94,7 @@ class TFT { static void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { queue.canvas(x, y, width, height); } static void set_background(uint16_t color) { queue.set_background(color); } static void add_text(uint16_t x, uint16_t y, uint16_t color, TFT_String tft_string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, tft_string.string(), maxWidth); } - static void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, (uint8_t *)string, maxWidth); } + static void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, string, maxWidth); } static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { queue.add_image(x, y, image, colors); } static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main = COLOR_WHITE, uint16_t color_background = COLOR_BACKGROUND, uint16_t color_shadow = COLOR_BLACK) { queue.add_image(x, y, image, color_main, color_background, color_shadow); } static void add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_bar(x, y, width, height, color); } diff --git a/Marlin/src/lcd/tft/tft_queue.cpp b/Marlin/src/lcd/tft/tft_queue.cpp index 3f604005f9e5..25ab452cef31 100644 --- a/Marlin/src/lcd/tft/tft_queue.cpp +++ b/Marlin/src/lcd/tft/tft_queue.cpp @@ -215,13 +215,13 @@ void TFT_Queue::handle_queue_overflow(uint16_t sizeNeeded) { } } -void TFT_Queue::add_text(uint16_t x, uint16_t y, uint16_t color, uint8_t *string, uint16_t maxWidth) { +void TFT_Queue::add_text(uint16_t x, uint16_t y, uint16_t color, const uint8_t *string, uint16_t maxWidth) { handle_queue_overflow(sizeof(parametersCanvasText_t) + maxWidth); parametersCanvas_t *task_parameters = (parametersCanvas_t *)(((uint8_t *)last_task) + sizeof(queueTask_t)); parametersCanvasText_t *parameters = (parametersCanvasText_t *)end_of_queue; last_parameter = end_of_queue; - uint8_t *pointer = string; + const uint8_t *pointer = string; parameters->type = CANVAS_ADD_TEXT; parameters->x = x; diff --git a/Marlin/src/lcd/tft/tft_queue.h b/Marlin/src/lcd/tft/tft_queue.h index 51387254c55d..55d0a526b5e3 100644 --- a/Marlin/src/lcd/tft/tft_queue.h +++ b/Marlin/src/lcd/tft/tft_queue.h @@ -139,7 +139,10 @@ class TFT_Queue { static void fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color); static void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height); static void set_background(uint16_t color); - static void add_text(uint16_t x, uint16_t y, uint16_t color, uint8_t *string, uint16_t maxWidth); + static void add_text(uint16_t x, uint16_t y, uint16_t color, const uint8_t *string, uint16_t maxWidth); + static void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth) { + add_text(x, y, color, (uint8_t *)string, maxWidth); + } static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors); static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main, uint16_t color_background, uint16_t color_shadow); diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp index 7dca9c589d60..8585d1d82ffa 100644 --- a/Marlin/src/lcd/tft/tft_string.cpp +++ b/Marlin/src/lcd/tft/tft_string.cpp @@ -35,7 +35,7 @@ glyph_t *TFT_String::glyphs[256]; font_t *TFT_String::font_header; -uint8_t TFT_String::data[]; +char TFT_String::data[]; uint16_t TFT_String::span; uint8_t TFT_String::length; @@ -84,24 +84,22 @@ void TFT_String::set() { length = 0; } -uint8_t read_byte(uint8_t *byte) { return *byte; } - /** * Add a string, applying substitutions for the following characters: * - * $ displays an inserted C-string given by the inStr parameter + * $ displays the string given by fstr or cstr * = displays '0'....'10' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10 * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) * @ displays an axis name such as XYZUVW, or E for an extruder */ -void TFT_String::add(uint8_t *string, int8_t index, uint8_t *inStr/*=nullptr*/) { +void TFT_String::add(const char *tpl, const int8_t index, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/) { wchar_t wchar; - while (*string) { - string = get_utf8_value_cb(string, read_byte, &wchar); + while (*tpl) { + tpl = get_utf8_value_cb(tpl, read_byte_ram, &wchar); if (wchar > 255) wchar |= 0x0080; - uint8_t ch = uint8_t(wchar & 0x00FF); + const uint8_t ch = uint8_t(wchar & 0x00FF); if (ch == '=' || ch == '~' || ch == '*') { if (index >= 0) { @@ -111,10 +109,12 @@ void TFT_String::add(uint8_t *string, int8_t index, uint8_t *inStr/*=nullptr*/) add_character('0' + inum); } else - add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED)); + add(index == -2 ? GET_TEXT_F(MSG_CHAMBER) : GET_TEXT_F(MSG_BED)); } - else if (ch == '$' && inStr) - add(inStr); + else if (ch == '$' && fstr) + add(fstr); + else if (ch == '$' && cstr) + add(cstr); else if (ch == '@') add_character(axis_codes[index]); else @@ -123,19 +123,19 @@ void TFT_String::add(uint8_t *string, int8_t index, uint8_t *inStr/*=nullptr*/) eol(); } -void TFT_String::add(uint8_t *string, uint8_t max_len) { +void TFT_String::add(const char *cstr, uint8_t max_len/*=MAX_STRING_LENGTH*/) { wchar_t wchar; - while (*string && max_len) { - string = get_utf8_value_cb(string, read_byte, &wchar); + while (*cstr && max_len) { + cstr = get_utf8_value_cb(cstr, read_byte_ram, &wchar); if (wchar > 255) wchar |= 0x0080; - uint8_t ch = uint8_t(wchar & 0x00FF); + const uint8_t ch = uint8_t(wchar & 0x00FF); add_character(ch); max_len--; } eol(); } -void TFT_String::add_character(uint8_t character) { +void TFT_String::add_character(const char character) { if (length < MAX_STRING_LENGTH) { data[length] = character; length++; @@ -143,7 +143,7 @@ void TFT_String::add_character(uint8_t character) { } } -void TFT_String::rtrim(uint8_t character) { +void TFT_String::rtrim(const char character) { while (length) { if (data[length - 1] == 0x20 || data[length - 1] == character) { length--; @@ -155,7 +155,7 @@ void TFT_String::rtrim(uint8_t character) { } } -void TFT_String::ltrim(uint8_t character) { +void TFT_String::ltrim(const char character) { uint16_t i, j; for (i = 0; (i < length) && (data[i] == 0x20 || data[i] == character); i++) { span -= glyph(data[i])->DWidth; @@ -166,7 +166,7 @@ void TFT_String::ltrim(uint8_t character) { eol(); } -void TFT_String::trim(uint8_t character) { +void TFT_String::trim(const char character) { rtrim(character); ltrim(character); } diff --git a/Marlin/src/lcd/tft/tft_string.h b/Marlin/src/lcd/tft/tft_string.h index 7fd87bdf5277..5940a48ac98b 100644 --- a/Marlin/src/lcd/tft/tft_string.h +++ b/Marlin/src/lcd/tft/tft_string.h @@ -21,6 +21,8 @@ */ #pragma once +// TODO: Make AVR-compatible with separate ROM / RAM string methods + #include extern const uint8_t ISO10646_1_5x7[]; @@ -67,14 +69,15 @@ class TFT_String { static glyph_t *glyphs[256]; static font_t *font_header; - static uint8_t data[MAX_STRING_LENGTH + 1]; + static char data[MAX_STRING_LENGTH + 1]; static uint16_t span; // in pixels - static uint8_t length; // in characters - static void add_character(uint8_t character); - static void eol() { data[length] = 0x00; } + static void add_character(const char character); + static void eol() { data[length] = '\0'; } public: + static uint8_t length; // in characters + static void set_font(const uint8_t *font); static void add_glyphs(const uint8_t *font); @@ -83,31 +86,69 @@ class TFT_String { static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */ static glyph_t *glyph(uint8_t *character) { return glyph(*character); } + /** + * @brief Set the string empty + */ static void set(); - static void add(uint8_t character) { add_character(character); eol(); } - static void add(uint8_t *string, uint8_t max_len=MAX_STRING_LENGTH); - static void add(uint8_t *string, int8_t index, uint8_t *inStr=nullptr); - static void set(uint8_t *string) { set(); add(string); }; - static void set(uint8_t *string, int8_t index, const char *inStr=nullptr) { set(); add(string, index, (uint8_t *)inStr); }; - static void set(const char *string) { set((uint8_t *)string); } - static void set(const char *string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)string, index, inStr); } - static void add(const char *string) { add((uint8_t *)string); } - - static void add(FSTR_P const string, uint8_t max_len=MAX_STRING_LENGTH) { add((uint8_t *)FTOP(string), max_len); } - static void add(FSTR_P const string, int8_t index, uint8_t *inStr=nullptr) { add((uint8_t *)FTOP(string), index, inStr); } - static void set(FSTR_P const string) { set((uint8_t *)FTOP(string)); } - static void set(FSTR_P const string, int8_t index, const char *inStr=nullptr) { set((uint8_t *)FTOP(string), index, inStr); } - static void add(FSTR_P const string) { add((uint8_t *)FTOP(string)); } - - static void trim(uint8_t character=0x20); - static void rtrim(uint8_t character=0x20); - static void ltrim(uint8_t character=0x20); - - static void truncate(uint8_t maxlen) { if (length > maxlen) { length = maxlen; eol(); } } + /** + * @brief Append an ASCII character and EOL + * + * @param character The ASCII character + */ + static void add(const char character) { add_character(character); eol(); } + static void set(wchar_t character) { set(); add(character); } + + /** + * @brief Append / Set C-string + * + * @param cstr The string + * @param max_len Character limit + */ + static void add(const char *cstr, uint8_t max_len=MAX_STRING_LENGTH); + static void set(const char *cstr, uint8_t max_len=MAX_STRING_LENGTH) { set(); add(cstr, max_len); } + + /** + * @brief Append / Set F-string + * + * @param fstr The string + * @param max_len Character limit + */ + static void add(FSTR_P const fstr, uint8_t max_len=MAX_STRING_LENGTH) { add(FTOP(fstr), max_len); } + static void set(FSTR_P const fstr, uint8_t max_len=MAX_STRING_LENGTH) { set(FTOP(fstr), max_len); } + + /** + * @brief Append / Set C-string with optional substitution + * + * @param tpl A string with optional substitution + * @param index An index + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + */ + static void add(const char *tpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr); + static void set(const char *tpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { set(); add(tpl, index, cstr, fstr); } + + /** + * @brief Append / Set F-string with optional substitution + * + * @param ftpl A ROM F-string with optional substitution + * @param index An index + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + */ + static void add(FSTR_P const ftpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { add(FTOP(ftpl), index, cstr, fstr); } + static void set(FSTR_P const ftpl, const int8_t index, const char *cstr=nullptr, FSTR_P const fstr=nullptr) { set(); add(ftpl, index, cstr, fstr); } + + // Common string ops + static void trim(const char character=' '); + static void rtrim(const char character=' '); + static void ltrim(const char character=' '); + static void truncate(const uint8_t maxlen) { if (length > maxlen) { length = maxlen; eol(); } } + + // Accessors + static char *string() { return data; } static uint16_t width() { return span; } - static uint8_t *string() { return data; } - static uint16_t center(uint16_t width) { return span > width ? 0 : (width - span) / 2; } + static uint16_t center(const uint16_t width) { return span > width ? 0 : (width - span) / 2; } }; extern TFT_String tft_string; diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index e8ba4737a80f..a1b6ee69e3b2 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -181,13 +181,13 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { tft.add_image(8, 28, image, Color); - tft_string.set((uint8_t *)i16tostr3rj(currentTemperature)); + tft_string.set(i16tostr3rj(currentTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(80) + 2, 82, Color, tft_string); if (targetTemperature >= 0) { - tft_string.set((uint8_t *)i16tostr3rj(targetTemperature)); + tft_string.set(i16tostr3rj(targetTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(80) + 2, 8, Color, tft_string); @@ -211,7 +211,7 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink) { tft.add_image(8, 20, image, COLOR_FAN); - tft_string.set((uint8_t *)ui8tostr4pctrj(thermalManager.fan_speed[0])); + tft_string.set(ui8tostr4pctrj(thermalManager.fan_speed[0])); tft_string.trim(); tft.add_text(tft_string.center(80) + 6, 82, COLOR_FAN, tft_string); } @@ -359,7 +359,7 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va uint16_t line = 1; menu_line(line++); - tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString)); + tft_string.set(fstr, itemIndex, itemStringC, itemStringF); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -606,7 +606,7 @@ static void quick_feedback() { #define CUR_STEP_VALUE_WIDTH 104 static void drawCurStepValue() { - tft_string.set((uint8_t *)ftostr52sp(motionAxisState.currentStepSize)); + tft_string.set(ftostr52sp(motionAxisState.currentStepSize)); tft_string.add("mm"); tft.canvas(motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT); tft.set_background(COLOR_BACKGROUND); diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 148d5d3964c1..15031d0da2ec 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -181,13 +181,13 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { tft.add_image(0, 18, image, Color); - tft_string.set((uint8_t *)i16tostr3rj(currentTemperature)); + tft_string.set(i16tostr3rj(currentTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(64) + 2, 72, Color, tft_string); if (targetTemperature >= 0) { - tft_string.set((uint8_t *)i16tostr3rj(targetTemperature)); + tft_string.set(i16tostr3rj(targetTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(64) + 2, 8, Color, tft_string); @@ -211,7 +211,7 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink) { tft.add_image(0, 10, image, COLOR_FAN); - tft_string.set((uint8_t *)ui8tostr4pctrj(thermalManager.fan_speed[0])); + tft_string.set(ui8tostr4pctrj(thermalManager.fan_speed[0])); tft_string.trim(); tft.add_text(tft_string.center(64) + 6, 72, COLOR_FAN, tft_string); } @@ -354,7 +354,7 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va uint16_t line = 1; menu_line(line++); - tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString)); + tft_string.set(fstr, itemIndex, itemStringC, itemStringF); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -588,7 +588,7 @@ static void quick_feedback() { #define CUR_STEP_VALUE_WIDTH 38 static void drawCurStepValue() { - tft_string.set((uint8_t *)ftostr52sp(motionAxisState.currentStepSize)); + tft_string.set(ftostr52sp(motionAxisState.currentStepSize)); tft.canvas(motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, 20); tft.set_background(COLOR_BACKGROUND); tft.add_text(CUR_STEP_VALUE_WIDTH - tft_string.width(), 0, COLOR_AXIS_HOMED, tft_string); diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 34502df54026..5a964525ecd1 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -181,13 +181,13 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { tft.add_image(8, 28, image, Color); - tft_string.set((uint8_t *)i16tostr3rj(currentTemperature)); + tft_string.set(i16tostr3rj(currentTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(80) + 2, 82, Color, tft_string); if (targetTemperature >= 0) { - tft_string.set((uint8_t *)i16tostr3rj(targetTemperature)); + tft_string.set(i16tostr3rj(targetTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); tft.add_text(tft_string.center(80) + 2, 8, Color, tft_string); @@ -211,7 +211,7 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink) { tft.add_image(8, 20, image, COLOR_FAN); - tft_string.set((uint8_t *)ui8tostr4pctrj(thermalManager.fan_speed[0])); + tft_string.set(ui8tostr4pctrj(thermalManager.fan_speed[0])); tft_string.trim(); tft.add_text(tft_string.center(80) + 6, 82, COLOR_FAN, tft_string); } @@ -359,7 +359,7 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va uint16_t line = 1; menu_line(line++); - tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString)); + tft_string.set(fstr, itemIndex, itemStringC, itemStringF); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); @@ -593,7 +593,7 @@ static void quick_feedback() { #define CUR_STEP_VALUE_WIDTH 104 static void drawCurStepValue() { - tft_string.set((uint8_t *)ftostr52sp(motionAxisState.currentStepSize)); + tft_string.set(ftostr52sp(motionAxisState.currentStepSize)); tft_string.add("mm"); tft.canvas(motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT); tft.set_background(COLOR_BACKGROUND); diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index 023ff59ca6d6..c9e069dbbd6f 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -96,16 +96,15 @@ void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { lcd_gotopixel(int(col) * (TFT_COL_WIDTH), int(row) * MENU_LINE_HEIGHT); } -int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { +int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { if (max_length < 1) return 0; - tft_string.set(); - tft_string.add(c); + tft_string.set(c); tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); lcd_gotopixel((cursor.x + 1) * (TFT_COL_WIDTH) + tft_string.width(), cursor.y * MENU_LINE_HEIGHT); return tft_string.width(); } -int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { +int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { if (max_length < 1) return 0; tft_string.set(utf8_pstr); tft_string.trim(); @@ -115,7 +114,7 @@ int lcd_put_u8str_max_P(PGM_P utf8_pstr, pixel_len_t max_length) { return tft_string.width(); } -int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { +int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { return lcd_put_u8str_max_P(utf8_str, max_length); } @@ -133,7 +132,7 @@ void lcd_put_int(const int i) { void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) { menu_item(row, sel); - uint8_t *string = (uint8_t *)FTOP(fstr); + const char *string = FTOP(fstr); MarlinImage image = noImage; switch (*string) { case 0x01: image = imgRefresh; break; // LCD_STR_REFRESH @@ -147,18 +146,19 @@ void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, c tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, image, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); } - tft_string.set(string, itemIndex, FTOP(itemString)); + tft_string.set(string, itemIndex, itemStringC, itemStringF); + tft.add_text(offset, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); } // Draw a menu item with a (potentially) editable value -void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const data, const bool pgm) { +void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { menu_item(row, sel); - tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString)); + tft_string.set(fstr, itemIndex, itemStringC, itemStringF); tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); - if (data) { - tft_string.set(data); + if (inStr) { + tft_string.set(inStr); tft.add_text(TFT_WIDTH - MENU_TEXT_X_OFFSET - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string); } } @@ -166,7 +166,7 @@ void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr // Draw a static item with no left-right margin required. Centered by default. void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) { menu_item(row); - tft_string.set(FTOP(fstr), itemIndex, FTOP(itemString)); + tft_string.set(fstr, itemIndex, itemStringC, itemStringF); if (vstr) tft_string.add(vstr); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string); } diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp index a8c2695630d6..df3f26f66ae1 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp @@ -38,7 +38,7 @@ L64XX_Marlin L64xxManager; #include "../../HAL/shared/Delay.h" static const char LINEAR_AXIS_LIST( - str_X[] PROGMEM = "X ", str_Y[] PROGMEM = "Y ", str_Z[] PROGMEM = "Z ", + str_X[] PROGMEM = "X ", str_Y[] PROGMEM = "Y ", str_Z[] PROGMEM = "Z ", str_I[] PROGMEM = STR_I " ", str_J[] PROGMEM = STR_J " ", str_K[] PROGMEM = STR_K " " ), str_X2[] PROGMEM = "X2", str_Y2[] PROGMEM = "Y2", diff --git a/buildroot/share/fonts/genpages.c b/buildroot/share/fonts/genpages.c index dea5b05c5c80..8009e553fa68 100644 --- a/buildroot/share/fonts/genpages.c +++ b/buildroot/share/fonts/genpages.c @@ -66,7 +66,7 @@ wchar_t get_val_utf82uni(uint8_t *pstart) { */ uint8_t* get_utf8_value(uint8_t *pstart, wchar_t *pval) { uint32_t val = 0; - uint8_t *p = pstart; + const uint8_t *p = pstart; /*size_t maxlen = strlen(pstart);*/ assert(NULL != pstart); From 1d8d8dccf45d2090e075b148d4f08e299184392c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 29 Apr 2022 15:21:15 -0500 Subject: [PATCH 361/502] =?UTF-8?q?=F0=9F=92=A5=20Num=20Axes=20/=20Multi-S?= =?UTF-8?q?tepper=20based=20on=20Driver=20Types=20(#24106,=20#24120)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 92 +++---- Marlin/Configuration_adv.h | 142 ++++++----- Marlin/src/core/drivers.h | 10 +- Marlin/src/feature/z_stepper_align.cpp | 22 +- Marlin/src/feature/z_stepper_align.h | 4 +- Marlin/src/gcode/calibrate/G34.cpp | 2 +- Marlin/src/gcode/calibrate/G34_M422.cpp | 36 +-- Marlin/src/gcode/calibrate/M666.cpp | 8 +- Marlin/src/gcode/config/M217.cpp | 6 +- Marlin/src/gcode/feature/pause/M600.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 267 +++++++++++++------- Marlin/src/inc/Conditionals_adv.h | 29 +-- Marlin/src/inc/Conditionals_post.h | 22 +- Marlin/src/inc/SanityCheck.h | 54 ++-- Marlin/src/inc/Warnings.cpp | 4 + Marlin/src/lcd/menu/menu_advanced.cpp | 4 +- Marlin/src/libs/L64XX/L64XX_Marlin.cpp | 14 +- Marlin/src/module/endstops.cpp | 16 +- Marlin/src/module/endstops.h | 8 +- Marlin/src/module/motion.cpp | 26 +- Marlin/src/module/settings.cpp | 16 +- Marlin/src/module/stepper.cpp | 54 ++-- Marlin/src/module/stepper.h | 12 +- Marlin/src/module/stepper/indirection.h | 168 ++++++------ Marlin/src/pins/pins_postprocess.h | 28 +- Marlin/src/pins/ramps/pins_RL200.h | 4 +- Marlin/src/pins/ramps/pins_ZRIB_V53.h | 2 +- Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h | 2 +- Marlin/src/pins/sensitive_pins.h | 8 +- buildroot/tests/BIGTREE_GTR_V1_0 | 2 +- buildroot/tests/DUE | 2 +- buildroot/tests/SAMD51_grandcentral_m4 | 1 - buildroot/tests/mega1280 | 2 +- buildroot/tests/rambo | 5 +- buildroot/tests/teensy35 | 2 +- buildroot/tests/teensy41 | 2 +- 36 files changed, 571 insertions(+), 507 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 96bfc59428fa..4720e4e878be 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -150,20 +150,40 @@ //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" /** - * Define the number of coordinated linear axes. - * See https://github.com/DerAndere1/Marlin/wiki - * Each linear axis gets its own stepper control and endstop: + * Stepper Drivers * - * Steppers: *_STEP_PIN, *_ENABLE_PIN, *_DIR_PIN, *_ENABLE_ON - * Endstops: *_STOP_PIN, USE_*MIN_PLUG, USE_*MAX_PLUG - * Axes: *_MIN_POS, *_MAX_POS, INVERT_*_DIR - * Planner: DEFAULT_AXIS_STEPS_PER_UNIT, DEFAULT_MAX_FEEDRATE - * DEFAULT_MAX_ACCELERATION, AXIS_RELATIVE_MODES, - * MICROSTEP_MODES, MANUAL_FEEDRATE + * These settings allow Marlin to tune stepper driver timing and enable advanced options for + * stepper drivers that support them. You may also override timing options in Configuration_adv.h. + * + * Use TMC2208/TMC2208_STANDALONE for TMC2225 drivers and TMC2209/TMC2209_STANDALONE for TMC2226 drivers. * - * :[3, 4, 5, 6] + * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, + * TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ -//#define LINEAR_AXES 3 +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +//#define Z4_DRIVER_TYPE A4988 +//#define I_DRIVER_TYPE A4988 +//#define J_DRIVER_TYPE A4988 +//#define K_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_DRIVER_TYPE A4988 +//#define E6_DRIVER_TYPE A4988 +//#define E7_DRIVER_TYPE A4988 /** * Axis codes for additional axes: @@ -178,14 +198,16 @@ * Regardless of the settings, firmware-internal axis IDs are * I (AXIS4), J (AXIS5), K (AXIS6). */ -#if LINEAR_AXES >= 4 +#ifdef I_DRIVER_TYPE #define AXIS4_NAME 'A' // :['A', 'B', 'C', 'U', 'V', 'W'] #endif -#if LINEAR_AXES >= 5 - #define AXIS5_NAME 'B' // :['A', 'B', 'C', 'U', 'V', 'W'] +#ifdef J_DRIVER_TYPE + #define AXIS5_NAME 'B' // :['B', 'C', 'U', 'V', 'W'] + #define AXIS5_ROTATES #endif -#if LINEAR_AXES >= 6 - #define AXIS6_NAME 'C' // :['A', 'B', 'C', 'U', 'V', 'W'] +#ifdef K_DRIVER_TYPE + #define AXIS6_NAME 'C' // :['C', 'U', 'V', 'W'] + #define AXIS6_ROTATES #endif // @section extruder @@ -898,44 +920,6 @@ #define K_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. #define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe. -/** - * Stepper Drivers - * - * These settings allow Marlin to tune stepper driver timing and enable advanced options for - * stepper drivers that support them. You may also override timing options in Configuration_adv.h. - * - * A4988 is assumed for unspecified drivers. - * - * Use TMC2208/TMC2208_STANDALONE for TMC2225 drivers and TMC2209/TMC2209_STANDALONE for TMC2226 drivers. - * - * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, - * TB6560, TB6600, TMC2100, - * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, - * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] - */ -#define X_DRIVER_TYPE A4988 -#define Y_DRIVER_TYPE A4988 -#define Z_DRIVER_TYPE A4988 -//#define X2_DRIVER_TYPE A4988 -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define Z3_DRIVER_TYPE A4988 -//#define Z4_DRIVER_TYPE A4988 -//#define I_DRIVER_TYPE A4988 -//#define J_DRIVER_TYPE A4988 -//#define K_DRIVER_TYPE A4988 -#define E0_DRIVER_TYPE A4988 -//#define E1_DRIVER_TYPE A4988 -//#define E2_DRIVER_TYPE A4988 -//#define E3_DRIVER_TYPE A4988 -//#define E4_DRIVER_TYPE A4988 -//#define E5_DRIVER_TYPE A4988 -//#define E6_DRIVER_TYPE A4988 -//#define E7_DRIVER_TYPE A4988 - // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 1202f1f51793..c09436573ac4 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -699,73 +699,6 @@ //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 #endif -/** - * Dual Steppers / Dual Endstops - * - * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. - * - * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to - * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop - * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug - * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. - * - * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors - * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error - * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. - */ - -//#define X_DUAL_STEPPER_DRIVERS -#if ENABLED(X_DUAL_STEPPER_DRIVERS) - //#define INVERT_X2_VS_X_DIR // Enable if X2 direction signal is opposite to X - //#define X_DUAL_ENDSTOPS - #if ENABLED(X_DUAL_ENDSTOPS) - #define X2_USE_ENDSTOP _XMAX_ - #define X2_ENDSTOP_ADJUSTMENT 0 - #endif -#endif - -//#define Y_DUAL_STEPPER_DRIVERS -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) - //#define INVERT_Y2_VS_Y_DIR // Enable if Y2 direction signal is opposite to Y - //#define Y_DUAL_ENDSTOPS - #if ENABLED(Y_DUAL_ENDSTOPS) - #define Y2_USE_ENDSTOP _YMAX_ - #define Y2_ENDSTOP_ADJUSTMENT 0 - #endif -#endif - -// -// For Z set the number of stepper drivers -// -#define NUM_Z_STEPPER_DRIVERS 1 // (1-4) Z options change based on how many - -#if NUM_Z_STEPPER_DRIVERS > 1 - // Enable if Z motor direction signals are the opposite of Z1 - //#define INVERT_Z2_VS_Z_DIR - //#define INVERT_Z3_VS_Z_DIR - //#define INVERT_Z4_VS_Z_DIR - - //#define Z_MULTI_ENDSTOPS - #if ENABLED(Z_MULTI_ENDSTOPS) - #define Z2_USE_ENDSTOP _XMAX_ - #define Z2_ENDSTOP_ADJUSTMENT 0 - #if NUM_Z_STEPPER_DRIVERS >= 3 - #define Z3_USE_ENDSTOP _YMAX_ - #define Z3_ENDSTOP_ADJUSTMENT 0 - #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 - #define Z4_USE_ENDSTOP _ZMAX_ - #define Z4_ENDSTOP_ADJUSTMENT 0 - #endif - #endif -#endif - -// Drive the E axis with two synchronized steppers -//#define E_DUAL_STEPPER_DRIVERS -#if ENABLED(E_DUAL_STEPPER_DRIVERS) - //#define INVERT_E1_VS_E0_DIR // Enable if the E motors need opposite DIR states -#endif - /** * Dual X Carriage * @@ -816,6 +749,77 @@ //#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X" #endif +/** + * Multi-Stepper / Multi-Endstop + * + * When X2_DRIVER_TYPE is defined, this indicates that the X and X2 motors work in tandem. + * The following explanations for X also apply to Y and Z multi-stepper setups. + * Endstop offsets may be changed by 'M666 X Y Z' and stored to EEPROM. + * + * - Enable INVERT_X2_VS_X_DIR if the X2 motor requires an opposite DIR signal from X. + * + * - Enable X_DUAL_ENDSTOPS if the second motor has its own endstop, with adjustable offset. + * + * - Extra endstops are included in the output of 'M119'. + * + * - Set X_DUAL_ENDSTOP_ADJUSTMENT to the known error in the X2 endstop. + * Applied to the X2 motor on 'G28' / 'G28 X'. + * Get the offset by homing X and measuring the error. + * Also set with 'M666 X' and stored to EEPROM with 'M500'. + * + * - Use X2_USE_ENDSTOP to set the endstop plug by name. (_XMIN_, _XMAX_, _YMIN_, _YMAX_, _ZMIN_, _ZMAX_) + */ +#if HAS_X2_STEPPER && DISABLED(DUAL_X_CARRIAGE) + //#define INVERT_X2_VS_X_DIR // X2 direction signal is the opposite of X + //#define X_DUAL_ENDSTOPS // X2 has its own endstop + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ // X2 endstop board plug. Don't forget to enable USE_*_PLUG. + #define X2_ENDSTOP_ADJUSTMENT 0 // X2 offset relative to X endstop + #endif +#endif + +#if HAS_DUAL_Y_STEPPERS + //#define INVERT_Y2_VS_Y_DIR // Y2 direction signal is the opposite of Y + //#define Y_DUAL_ENDSTOPS // Y2 has its own endstop + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ // Y2 endstop board plug. Don't forget to enable USE_*_PLUG. + #define Y2_ENDSTOP_ADJUSTMENT 0 // Y2 offset relative to Y endstop + #endif +#endif + +// +// Multi-Z steppers +// +#ifdef Z2_DRIVER_TYPE + //#define INVERT_Z2_VS_Z_DIR // Z2 direction signal is the opposite of Z + + //#define Z_MULTI_ENDSTOPS // Other Z axes have their own endstops + #if ENABLED(Z_MULTI_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ // Z2 endstop board plug. Don't forget to enable USE_*_PLUG. + #define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Y endstop + #endif + #ifdef Z3_DRIVER_TYPE + //#define INVERT_Z3_VS_Z_DIR // Z3 direction signal is the opposite of Z + #if ENABLED(Z_MULTI_ENDSTOPS) + #define Z3_USE_ENDSTOP _YMAX_ // Z3 endstop board plug. Don't forget to enable USE_*_PLUG. + #define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Y endstop + #endif + #endif + #ifdef Z4_DRIVER_TYPE + //#define INVERT_Z4_VS_Z_DIR // Z4 direction signal is the opposite of Z + #if ENABLED(Z_MULTI_ENDSTOPS) + #define Z4_USE_ENDSTOP _ZMAX_ // Z4 endstop board plug. Don't forget to enable USE_*_PLUG. + #define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Y endstop + #endif + #endif +#endif + +// Drive the E axis with two synchronized steppers +//#define E_DUAL_STEPPER_DRIVERS +#if ENABLED(E_DUAL_STEPPER_DRIVERS) + //#define INVERT_E1_VS_E0_DIR // E direction signals are opposites +#endif + // Activate a solenoid on the active extruder with M380. Disable all with M381. // Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. //#define EXT_SOLENOID @@ -949,7 +953,7 @@ /** * Z Stepper positions for more rapid convergence in bed alignment. - * Requires NUM_Z_STEPPER_DRIVERS to be 3 or 4. + * Requires 3 or 4 Z steppers. * * Define Stepper XY positions for Z1, Z2, Z3... corresponding to the screw * positions in the bed carriage, with one position per Z stepper in stepper @@ -2419,7 +2423,7 @@ /** * Extra G-code to run while executing tool-change commands. Can be used to use an additional - * stepper motor (I axis, see option LINEAR_AXES in Configuration.h) to drive the tool-changer. + * stepper motor (e.g., I axis in Configuration.h) to drive the tool-changer. */ //#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 A0" // Extra G-code to run while executing tool-change command T0 //#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10" // Extra G-code to run while executing tool-change command T1 diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index ac1f4a155de1..f6a8f0f126ac 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -64,11 +64,11 @@ #define AXIS_DRIVER_TYPE_J(T) _AXIS_DRIVER_TYPE(J,T) #define AXIS_DRIVER_TYPE_K(T) _AXIS_DRIVER_TYPE(K,T) -#define AXIS_DRIVER_TYPE_X2(T) (EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) && _AXIS_DRIVER_TYPE(X2,T)) -#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T)) -#define AXIS_DRIVER_TYPE_Z2(T) (NUM_Z_STEPPER_DRIVERS >= 2 && _AXIS_DRIVER_TYPE(Z2,T)) -#define AXIS_DRIVER_TYPE_Z3(T) (NUM_Z_STEPPER_DRIVERS >= 3 && _AXIS_DRIVER_TYPE(Z3,T)) -#define AXIS_DRIVER_TYPE_Z4(T) (NUM_Z_STEPPER_DRIVERS >= 4 && _AXIS_DRIVER_TYPE(Z4,T)) +#define AXIS_DRIVER_TYPE_X2(T) (HAS_X2_STEPPER && _AXIS_DRIVER_TYPE(X2,T)) +#define AXIS_DRIVER_TYPE_Y2(T) (HAS_DUAL_Y_STEPPERS && _AXIS_DRIVER_TYPE(Y2,T)) +#define AXIS_DRIVER_TYPE_Z2(T) (NUM_Z_STEPPERS >= 2 && _AXIS_DRIVER_TYPE(Z2,T)) +#define AXIS_DRIVER_TYPE_Z3(T) (NUM_Z_STEPPERS >= 3 && _AXIS_DRIVER_TYPE(Z3,T)) +#define AXIS_DRIVER_TYPE_Z4(T) (NUM_Z_STEPPERS >= 4 && _AXIS_DRIVER_TYPE(Z4,T)) #define AXIS_DRIVER_TYPE_E(N,T) (E_STEPPERS > N && _AXIS_DRIVER_TYPE(E##N,T)) #define AXIS_DRIVER_TYPE_E0(T) AXIS_DRIVER_TYPE_E(0,T) diff --git a/Marlin/src/feature/z_stepper_align.cpp b/Marlin/src/feature/z_stepper_align.cpp index fdbd464ea1b4..9dba21d8219d 100644 --- a/Marlin/src/feature/z_stepper_align.cpp +++ b/Marlin/src/feature/z_stepper_align.cpp @@ -33,35 +33,35 @@ ZStepperAlign z_stepper_align; -xy_pos_t ZStepperAlign::xy[NUM_Z_STEPPER_DRIVERS]; +xy_pos_t ZStepperAlign::xy[NUM_Z_STEPPERS]; #if HAS_Z_STEPPER_ALIGN_STEPPER_XY - xy_pos_t ZStepperAlign::stepper_xy[NUM_Z_STEPPER_DRIVERS]; + xy_pos_t ZStepperAlign::stepper_xy[NUM_Z_STEPPERS]; #endif void ZStepperAlign::reset_to_default() { #ifdef Z_STEPPER_ALIGN_XY constexpr xy_pos_t xy_init[] = Z_STEPPER_ALIGN_XY; - static_assert(COUNT(xy_init) == NUM_Z_STEPPER_DRIVERS, + static_assert(COUNT(xy_init) == NUM_Z_STEPPERS, "Z_STEPPER_ALIGN_XY requires " - #if NUM_Z_STEPPER_DRIVERS == 4 + #if NUM_Z_STEPPERS == 4 "four {X,Y} entries (Z, Z2, Z3, and Z4)." - #elif NUM_Z_STEPPER_DRIVERS == 3 + #elif NUM_Z_STEPPERS == 3 "three {X,Y} entries (Z, Z2, and Z3)." #else "two {X,Y} entries (Z and Z2)." #endif ); - #define VALIDATE_ALIGN_POINT(N) static_assert(N >= NUM_Z_STEPPER_DRIVERS || Probe::build_time::can_reach(xy_init[N]), \ + #define VALIDATE_ALIGN_POINT(N) static_assert(N >= NUM_Z_STEPPERS || Probe::build_time::can_reach(xy_init[N]), \ "Z_STEPPER_ALIGN_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.") VALIDATE_ALIGN_POINT(0); VALIDATE_ALIGN_POINT(1); VALIDATE_ALIGN_POINT(2); VALIDATE_ALIGN_POINT(3); #else // !Z_STEPPER_ALIGN_XY const xy_pos_t xy_init[] = { - #if NUM_Z_STEPPER_DRIVERS >= 3 // First probe point... + #if NUM_Z_STEPPERS >= 3 // First probe point... #if !Z_STEPPERS_ORIENTATION { probe.min_x(), probe.min_y() }, // SW #elif Z_STEPPERS_ORIENTATION == 1 @@ -73,7 +73,7 @@ void ZStepperAlign::reset_to_default() { #else #error "Z_STEPPERS_ORIENTATION must be from 0 to 3 (first point SW, NW, NE, SE)." #endif - #if NUM_Z_STEPPER_DRIVERS == 4 // 3 more points... + #if NUM_Z_STEPPERS == 4 // 3 more points... #if !Z_STEPPERS_ORIENTATION { probe.min_x(), probe.max_y() }, { probe.max_x(), probe.max_y() }, { probe.max_x(), probe.min_y() } // SW #elif Z_STEPPERS_ORIENTATION == 1 @@ -106,11 +106,11 @@ void ZStepperAlign::reset_to_default() { #if HAS_Z_STEPPER_ALIGN_STEPPER_XY constexpr xy_pos_t stepper_xy_init[] = Z_STEPPER_ALIGN_STEPPER_XY; static_assert( - COUNT(stepper_xy_init) == NUM_Z_STEPPER_DRIVERS, + COUNT(stepper_xy_init) == NUM_Z_STEPPERS, "Z_STEPPER_ALIGN_STEPPER_XY requires " - #if NUM_Z_STEPPER_DRIVERS == 4 + #if NUM_Z_STEPPERS == 4 "four {X,Y} entries (Z, Z2, Z3, and Z4)." - #elif NUM_Z_STEPPER_DRIVERS == 3 + #elif NUM_Z_STEPPERS == 3 "three {X,Y} entries (Z, Z2, and Z3)." #endif ); diff --git a/Marlin/src/feature/z_stepper_align.h b/Marlin/src/feature/z_stepper_align.h index 8a12cd18b0bd..f3f9abb845b9 100644 --- a/Marlin/src/feature/z_stepper_align.h +++ b/Marlin/src/feature/z_stepper_align.h @@ -29,10 +29,10 @@ class ZStepperAlign { public: - static xy_pos_t xy[NUM_Z_STEPPER_DRIVERS]; + static xy_pos_t xy[NUM_Z_STEPPERS]; #if HAS_Z_STEPPER_ALIGN_STEPPER_XY - static xy_pos_t stepper_xy[NUM_Z_STEPPER_DRIVERS]; + static xy_pos_t stepper_xy[NUM_Z_STEPPERS]; #endif static void reset_to_default(); diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp index ea5d5fa150cf..84b910212344 100644 --- a/Marlin/src/gcode/calibrate/G34.cpp +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -91,7 +91,7 @@ void GcodeSuite::G34() { digipot_i2c.set_current(Z_AXIS, target_current) #elif HAS_TRINAMIC_CONFIG const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT); - static uint16_t previous_current_arr[NUM_Z_STEPPER_DRIVERS]; + static uint16_t previous_current_arr[NUM_Z_STEPPERS]; #if AXIS_IS_TMC(Z) previous_current_arr[0] = stepperZ.getMilliamps(); stepperZ.rms_current(target_current); diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index d1f82e7e9874..d68207885d39 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -52,9 +52,9 @@ #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../core/debug_out.h" -#if NUM_Z_STEPPER_DRIVERS >= 3 +#if NUM_Z_STEPPERS >= 3 #define TRIPLE_Z 1 - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 #define QUAD_Z 1 #endif #endif @@ -180,11 +180,11 @@ void GcodeSuite::G34() { // This hack is un-done at the end of G34 - either by re-homing, or by using the probed heights of the last iteration. #if !HAS_Z_STEPPER_ALIGN_STEPPER_XY - float last_z_align_move[NUM_Z_STEPPER_DRIVERS] = ARRAY_N_1(NUM_Z_STEPPER_DRIVERS, 10000.0f); + float last_z_align_move[NUM_Z_STEPPERS] = ARRAY_N_1(NUM_Z_STEPPERS, 10000.0f); #else float last_z_align_level_indicator = 10000.0f; #endif - float z_measured[NUM_Z_STEPPER_DRIVERS] = { 0 }, + float z_measured[NUM_Z_STEPPERS] = { 0 }, z_maxdiff = 0.0f, amplification = z_auto_align_amplification; @@ -217,9 +217,9 @@ void GcodeSuite::G34() { float z_measured_max = -100000.0f; // Probe all positions (one per Z-Stepper) - LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { + LOOP_L_N(i, NUM_Z_STEPPERS) { // iteration odd/even --> downward / upward stepper sequence - const uint8_t iprobe = (iteration & 1) ? NUM_Z_STEPPER_DRIVERS - 1 - i : i; + const uint8_t iprobe = (iteration & 1) ? NUM_Z_STEPPERS - 1 - i : i; // Safe clearance even on an incline if ((iteration == 0 || i > 0) && z_probe > current_position.z) do_blocking_move_to_z(z_probe); @@ -270,20 +270,20 @@ void GcodeSuite::G34() { // This allows the actual adjustment logic to be shared by both algorithms. linear_fit_data lfd; incremental_LSF_reset(&lfd); - LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { + LOOP_L_N(i, NUM_Z_STEPPERS) { SERIAL_ECHOLNPGM("PROBEPT_", i, ": ", z_measured[i]); incremental_LSF(&lfd, z_stepper_align.xy[i], z_measured[i]); } finish_incremental_LSF(&lfd); z_measured_min = 100000.0f; - LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { + LOOP_L_N(i, NUM_Z_STEPPERS) { z_measured[i] = -(lfd.A * z_stepper_align.stepper_xy[i].x + lfd.B * z_stepper_align.stepper_xy[i].y + lfd.D); z_measured_min = _MIN(z_measured_min, z_measured[i]); } SERIAL_ECHOLNPGM( - LIST_N(DOUBLE(NUM_Z_STEPPER_DRIVERS), + LIST_N(DOUBLE(NUM_Z_STEPPERS), "Calculated Z1=", z_measured[0], " Z2=", z_measured[1], " Z3=", z_measured[2], @@ -307,7 +307,7 @@ void GcodeSuite::G34() { #if HAS_STATUS_MESSAGE char fstr1[10]; - char msg[6 + (6 + 5) * NUM_Z_STEPPER_DRIVERS + 1] + char msg[6 + (6 + 5) * NUM_Z_STEPPERS + 1] #if TRIPLE_Z , fstr2[10], fstr3[10] #if QUAD_Z @@ -345,12 +345,12 @@ void GcodeSuite::G34() { // Calculate mean value as a reference float z_measured_mean = 0.0f; - LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) z_measured_mean += z_measured[zstepper]; - z_measured_mean /= NUM_Z_STEPPER_DRIVERS; + LOOP_L_N(zstepper, NUM_Z_STEPPERS) z_measured_mean += z_measured[zstepper]; + z_measured_mean /= NUM_Z_STEPPERS; // Calculate the sum of the absolute deviations from the mean value float z_align_level_indicator = 0.0f; - LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) + LOOP_L_N(zstepper, NUM_Z_STEPPERS) z_align_level_indicator += ABS(z_measured[zstepper] - z_measured_mean); // If it's getting worse, stop and throw an error @@ -365,7 +365,7 @@ void GcodeSuite::G34() { bool success_break = true; // Correct the individual stepper offsets - LOOP_L_N(zstepper, NUM_Z_STEPPER_DRIVERS) { + LOOP_L_N(zstepper, NUM_Z_STEPPERS) { // Calculate current stepper move float z_align_move = z_measured[zstepper] - z_measured_min; const float z_align_abs = ABS(z_align_move); @@ -515,9 +515,9 @@ void GcodeSuite::M422() { #endif } - if (!WITHIN(position_index, 1, NUM_Z_STEPPER_DRIVERS)) { + if (!WITHIN(position_index, 1, NUM_Z_STEPPERS)) { SERIAL_ECHOF(err_string); - SERIAL_ECHOLNPGM(" index invalid (1.." STRINGIFY(NUM_Z_STEPPER_DRIVERS) ")."); + SERIAL_ECHOLNPGM(" index invalid (1.." STRINGIFY(NUM_Z_STEPPERS) ")."); return; } @@ -544,7 +544,7 @@ void GcodeSuite::M422() { void GcodeSuite::M422_report(const bool forReplay/*=true*/) { report_heading(forReplay, F(STR_Z_AUTO_ALIGN)); - LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { + LOOP_L_N(i, NUM_Z_STEPPERS) { report_echo_start(forReplay); SERIAL_ECHOLNPGM_P( PSTR(" M422 S"), i + 1, @@ -553,7 +553,7 @@ void GcodeSuite::M422_report(const bool forReplay/*=true*/) { ); } #if HAS_Z_STEPPER_ALIGN_STEPPER_XY - LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { + LOOP_L_N(i, NUM_Z_STEPPERS) { report_echo_start(forReplay); SERIAL_ECHOLNPGM_P( PSTR(" M422 W"), i + 1, diff --git a/Marlin/src/gcode/calibrate/M666.cpp b/Marlin/src/gcode/calibrate/M666.cpp index 15f8baf109eb..aa8ba26bb6b2 100644 --- a/Marlin/src/gcode/calibrate/M666.cpp +++ b/Marlin/src/gcode/calibrate/M666.cpp @@ -93,12 +93,12 @@ #if ENABLED(Z_MULTI_ENDSTOPS) if (parser.seenval('Z')) { const float z_adj = parser.value_linear_units(); - #if NUM_Z_STEPPER_DRIVERS == 2 + #if NUM_Z_STEPPERS == 2 endstops.z2_endstop_adj = z_adj; #else const int ind = parser.intval('S'); #define _SET_ZADJ(N) if (!ind || ind == N) endstops.z##N##_endstop_adj = z_adj; - REPEAT_S(2, INCREMENT(NUM_Z_STEPPER_DRIVERS), _SET_ZADJ) + REPEAT_S(2, INCREMENT(NUM_Z_STEPPERS), _SET_ZADJ) #endif } #endif @@ -114,11 +114,11 @@ SERIAL_ECHOLNPGM_P(SP_Y_STR, LINEAR_UNIT(endstops.y2_endstop_adj)); #endif #if ENABLED(Z_MULTI_ENDSTOPS) - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 SERIAL_ECHOPGM(" S2 Z", LINEAR_UNIT(endstops.z3_endstop_adj)); report_echo_start(forReplay); SERIAL_ECHOPGM(" M666 S3 Z", LINEAR_UNIT(endstops.z3_endstop_adj)); - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 report_echo_start(forReplay); SERIAL_ECHOPGM(" M666 S4 Z", LINEAR_UNIT(endstops.z4_endstop_adj)); #endif diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index 80c9cef65c40..74932a64f8fe 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -50,9 +50,9 @@ * W[linear] 0/1 Enable park & Z Raise * X[linear] Park X (Requires TOOLCHANGE_PARK) * Y[linear] Park Y (Requires TOOLCHANGE_PARK) - * I[linear] Park I (Requires TOOLCHANGE_PARK and NUM_AXES >= 4) - * J[linear] Park J (Requires TOOLCHANGE_PARK and NUM_AXES >= 5) - * K[linear] Park K (Requires TOOLCHANGE_PARK and NUM_AXES >= 6) + * I[linear] Park I (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 4) + * J[linear] Park J (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 5) + * K[linear] Park K (Requires TOOLCHANGE_PARK and LINEAR_AXES >= 6) * Z[linear] Z Raise * F[speed] Fan Speed 0-255 * D[seconds] Fan time diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 1679c90687bd..9ba54ac448c5 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -34,7 +34,7 @@ #include "../../../module/tool_change.h" #endif -#if ENABLED(HAS_PRUSA_MMU2) +#if HAS_PRUSA_MMU2 #include "../../../feature/mmu/mmu2.h" #if ENABLED(MMU2_MENUS) #include "../../../lcd/menu/menu_mmu2.h" diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 52c6e34f22fd..5b6313b19d70 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -669,13 +669,37 @@ * Number of Linear Axes (e.g., XYZ) * All the logical axes except for the tool (E) axis */ -#ifndef LINEAR_AXES - #define LINEAR_AXES XYZ +#ifdef LINEAR_AXES + #undef LINEAR_AXES + #define LINEAR_AXES_WARNING 1 +#endif + +#ifdef K_DRIVER_TYPE + #define LINEAR_AXES 6 +#elif defined(J_DRIVER_TYPE) + #define LINEAR_AXES 5 +#elif defined(I_DRIVER_TYPE) + #define LINEAR_AXES 4 +#elif defined(Z_DRIVER_TYPE) + #define LINEAR_AXES 3 +#elif defined(Y_DRIVER_TYPE) + #define LINEAR_AXES 2 +#else + #define LINEAR_AXES 1 #endif #if LINEAR_AXES >= XY #define HAS_Y_AXIS 1 #if LINEAR_AXES >= XYZ #define HAS_Z_AXIS 1 + #ifdef Z4_DRIVER_TYPE + #define NUM_Z_STEPPERS 4 + #elif defined(Z3_DRIVER_TYPE) + #define NUM_Z_STEPPERS 3 + #elif defined(Z2_DRIVER_TYPE) + #define NUM_Z_STEPPERS 2 + #else + #define NUM_Z_STEPPERS 1 + #endif #if LINEAR_AXES >= 4 #define HAS_I_AXIS 1 #if LINEAR_AXES >= 5 @@ -688,6 +712,156 @@ #endif #endif +#if E_STEPPERS <= 0 + #undef E0_DRIVER_TYPE +#endif +#if E_STEPPERS <= 1 + #undef E1_DRIVER_TYPE +#endif +#if E_STEPPERS <= 2 + #undef E2_DRIVER_TYPE +#endif +#if E_STEPPERS <= 3 + #undef E3_DRIVER_TYPE +#endif +#if E_STEPPERS <= 4 + #undef E4_DRIVER_TYPE +#endif +#if E_STEPPERS <= 5 + #undef E5_DRIVER_TYPE +#endif +#if E_STEPPERS <= 6 + #undef E6_DRIVER_TYPE +#endif +#if E_STEPPERS <= 7 + #undef E7_DRIVER_TYPE +#endif + +#if !HAS_Y_AXIS + #undef ENDSTOPPULLUP_YMIN + #undef ENDSTOPPULLUP_YMAX + #undef Y_MIN_ENDSTOP_INVERTING + #undef Y_MAX_ENDSTOP_INVERTING + #undef Y2_DRIVER_TYPE + #undef Y_ENABLE_ON + #undef DISABLE_Y + #undef INVERT_Y_DIR + #undef Y_HOME_DIR + #undef Y_MIN_POS + #undef Y_MAX_POS + #undef MANUAL_Y_HOME_POS +#endif + +#if !HAS_Z_AXIS + #undef ENDSTOPPULLUP_ZMIN + #undef ENDSTOPPULLUP_ZMAX + #undef Z_MIN_ENDSTOP_INVERTING + #undef Z_MAX_ENDSTOP_INVERTING + #undef Z2_DRIVER_TYPE + #undef Z3_DRIVER_TYPE + #undef Z4_DRIVER_TYPE + #undef Z_ENABLE_ON + #undef DISABLE_Z + #undef INVERT_Z_DIR + #undef Z_HOME_DIR + #undef Z_MIN_POS + #undef Z_MAX_POS + #undef MANUAL_Z_HOME_POS +#endif + +#if !HAS_I_AXIS + #undef ENDSTOPPULLUP_IMIN + #undef ENDSTOPPULLUP_IMAX + #undef I_MIN_ENDSTOP_INVERTING + #undef I_MAX_ENDSTOP_INVERTING + #undef I_ENABLE_ON + #undef DISABLE_I + #undef INVERT_I_DIR + #undef I_HOME_DIR + #undef I_MIN_POS + #undef I_MAX_POS + #undef MANUAL_I_HOME_POS +#endif + +#if !HAS_J_AXIS + #undef ENDSTOPPULLUP_JMIN + #undef ENDSTOPPULLUP_JMAX + #undef J_MIN_ENDSTOP_INVERTING + #undef J_MAX_ENDSTOP_INVERTING + #undef J_ENABLE_ON + #undef DISABLE_J + #undef INVERT_J_DIR + #undef J_HOME_DIR + #undef J_MIN_POS + #undef J_MAX_POS + #undef MANUAL_J_HOME_POS +#endif + +#if !HAS_K_AXIS + #undef ENDSTOPPULLUP_KMIN + #undef ENDSTOPPULLUP_KMAX + #undef K_MIN_ENDSTOP_INVERTING + #undef K_MAX_ENDSTOP_INVERTING + #undef K_ENABLE_ON + #undef DISABLE_K + #undef INVERT_K_DIR + #undef K_HOME_DIR + #undef K_MIN_POS + #undef K_MAX_POS + #undef MANUAL_K_HOME_POS +#endif + +#if !HAS_U_AXIS + #undef ENDSTOPPULLUP_UMIN + #undef ENDSTOPPULLUP_UMAX + #undef U_MIN_ENDSTOP_INVERTING + #undef U_MAX_ENDSTOP_INVERTING + #undef U_ENABLE_ON + #undef DISABLE_U + #undef INVERT_U_DIR + #undef U_HOME_DIR + #undef U_MIN_POS + #undef U_MAX_POS + #undef MANUAL_U_HOME_POS +#endif + +#if !HAS_V_AXIS + #undef ENDSTOPPULLUP_VMIN + #undef ENDSTOPPULLUP_VMAX + #undef V_MIN_ENDSTOP_INVERTING + #undef V_MAX_ENDSTOP_INVERTING + #undef V_ENABLE_ON + #undef DISABLE_V + #undef INVERT_V_DIR + #undef V_HOME_DIR + #undef V_MIN_POS + #undef V_MAX_POS + #undef MANUAL_V_HOME_POS +#endif + +#if !HAS_W_AXIS + #undef ENDSTOPPULLUP_WMIN + #undef ENDSTOPPULLUP_WMAX + #undef W_MIN_ENDSTOP_INVERTING + #undef W_MAX_ENDSTOP_INVERTING + #undef W_ENABLE_ON + #undef DISABLE_W + #undef INVERT_W_DIR + #undef W_HOME_DIR + #undef W_MIN_POS + #undef W_MAX_POS + #undef MANUAL_W_HOME_POS +#endif + +#ifdef X2_DRIVER_TYPE + #define HAS_X2_STEPPER 1 + // Dual X Carriage isn't known yet. TODO: Consider moving it to Configuration.h. +#endif +#ifdef Y2_DRIVER_TYPE + #define HAS_Y2_STEPPER 1 + #define HAS_DUAL_Y_STEPPERS 1 +#endif + /** * Number of Logical Axes (e.g., XYZE) * All the logical axes that can be commanded directly by G-code. @@ -1136,95 +1310,6 @@ #define HAS_ETHERNET 1 #endif -// Fallback Stepper Driver types that don't depend on Configuration_adv.h -#ifndef X_DRIVER_TYPE - #define X_DRIVER_TYPE A4988 -#endif -#ifndef X2_DRIVER_TYPE - #define X2_DRIVER_TYPE A4988 -#endif -#ifndef Y_DRIVER_TYPE - #define Y_DRIVER_TYPE A4988 -#endif -#ifndef Y2_DRIVER_TYPE - #define Y2_DRIVER_TYPE A4988 -#endif -#ifndef Z_DRIVER_TYPE - #define Z_DRIVER_TYPE A4988 -#endif -#ifndef Z2_DRIVER_TYPE - #define Z2_DRIVER_TYPE A4988 -#endif -#ifndef Z3_DRIVER_TYPE - #define Z3_DRIVER_TYPE A4988 -#endif -#ifndef Z4_DRIVER_TYPE - #define Z4_DRIVER_TYPE A4988 -#endif -#if E_STEPPERS <= 0 - #undef E0_DRIVER_TYPE -#elif !defined(E0_DRIVER_TYPE) - #define E0_DRIVER_TYPE A4988 -#endif -#if E_STEPPERS <= 1 - #undef E1_DRIVER_TYPE -#elif !defined(E1_DRIVER_TYPE) - #define E1_DRIVER_TYPE A4988 -#endif -#if E_STEPPERS <= 2 - #undef E2_DRIVER_TYPE -#elif !defined(E2_DRIVER_TYPE) - #define E2_DRIVER_TYPE A4988 -#endif -#if E_STEPPERS <= 3 - #undef E3_DRIVER_TYPE -#elif !defined(E3_DRIVER_TYPE) - #define E3_DRIVER_TYPE A4988 -#endif -#if E_STEPPERS <= 4 - #undef E4_DRIVER_TYPE -#elif !defined(E4_DRIVER_TYPE) - #define E4_DRIVER_TYPE A4988 -#endif -#if E_STEPPERS <= 5 - #undef E5_DRIVER_TYPE -#elif !defined(E5_DRIVER_TYPE) - #define E5_DRIVER_TYPE A4988 -#endif -#if E_STEPPERS <= 6 - #undef E6_DRIVER_TYPE -#elif !defined(E6_DRIVER_TYPE) - #define E6_DRIVER_TYPE A4988 -#endif -#if E_STEPPERS <= 7 - #undef E7_DRIVER_TYPE -#elif !defined(E7_DRIVER_TYPE) - #define E7_DRIVER_TYPE A4988 -#endif - -// Fallback axis inverting -#ifndef INVERT_X_DIR - #define INVERT_X_DIR false -#endif -#if HAS_Y_AXIS && !defined(INVERT_Y_DIR) - #define INVERT_Y_DIR false -#endif -#if HAS_Z_AXIS && !defined(INVERT_Z_DIR) - #define INVERT_Z_DIR false -#endif -#if HAS_I_AXIS && !defined(INVERT_I_DIR) - #define INVERT_I_DIR false -#endif -#if HAS_J_AXIS && !defined(INVERT_J_DIR) - #define INVERT_J_DIR false -#endif -#if HAS_K_AXIS && !defined(INVERT_K_DIR) - #define INVERT_K_DIR false -#endif -#if HAS_EXTRUDERS && !defined(INVERT_E_DIR) - #define INVERT_E_DIR false -#endif - /** * This setting is also used by M109 when trying to calculate * a ballpark safe margin to prevent wait-forever situation. diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 309648a69d83..0490f33eb0dd 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -650,33 +650,20 @@ #endif // Multiple Z steppers -#ifndef NUM_Z_STEPPER_DRIVERS - #define NUM_Z_STEPPER_DRIVERS 1 -#endif - -// Fallback Stepper Driver types that depend on Configuration_adv.h -#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) - #define HAS_X2_STEPPER 1 -#else - #undef X2_DRIVER_TYPE -#endif -#if DISABLED(Y_DUAL_STEPPER_DRIVERS) - #undef Y2_DRIVER_TYPE -#endif - -#if NUM_Z_STEPPER_DRIVERS < 4 - #undef Z4_DRIVER_TYPE +#if NUM_Z_STEPPERS < 4 #undef INVERT_Z4_VS_Z_DIR - #if NUM_Z_STEPPER_DRIVERS < 3 - #undef Z3_DRIVER_TYPE + #if NUM_Z_STEPPERS < 3 #undef INVERT_Z3_VS_Z_DIR - #if NUM_Z_STEPPER_DRIVERS < 2 - #undef Z2_DRIVER_TYPE + #if NUM_Z_STEPPERS < 2 #undef INVERT_Z2_VS_Z_DIR #endif #endif #endif +#if defined(X2_DRIVER_TYPE) && DISABLED(DUAL_X_CARRIAGE) + #define HAS_DUAL_X_STEPPERS 1 +#endif + // // Spindle/Laser power display types // Defined here so sanity checks can use them @@ -944,7 +931,7 @@ #undef HOME_Z_FIRST #undef HOMING_Z_WITH_PROBE #undef ENABLE_LEVELING_FADE_HEIGHT - #undef NUM_Z_STEPPER_DRIVERS + #undef NUM_Z_STEPPERS #undef CNC_WORKSPACE_PLANES #if LINEAR_AXES < 2 #undef STEALTHCHOP_Y diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 0095042c1da0..9f75a2f3a809 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1152,7 +1152,7 @@ #endif #endif - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 #if Z_HOME_TO_MAX #ifndef Z3_MAX_ENDSTOP_INVERTING #if Z3_USE_ENDSTOP == _XMIN_ @@ -1284,7 +1284,7 @@ #endif #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 #if Z_HOME_TO_MAX #ifndef Z4_MAX_ENDSTOP_INVERTING #if Z4_USE_ENDSTOP == _XMIN_ @@ -1575,7 +1575,7 @@ #undef DISABLE_INACTIVE_Z #endif -#if NUM_Z_STEPPER_DRIVERS >= 2 +#if NUM_Z_STEPPERS >= 2 #if PIN_EXISTS(Z2_ENABLE) || AXIS_IS_L64XX(Z2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)) #define HAS_Z2_ENABLE 1 #endif @@ -1590,7 +1590,7 @@ #endif #endif -#if NUM_Z_STEPPER_DRIVERS >= 3 +#if NUM_Z_STEPPERS >= 3 #if PIN_EXISTS(Z3_ENABLE) || AXIS_IS_L64XX(Z3) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3)) #define HAS_Z3_ENABLE 1 #endif @@ -1605,7 +1605,7 @@ #endif #endif -#if NUM_Z_STEPPER_DRIVERS >= 4 +#if NUM_Z_STEPPERS >= 4 #if PIN_EXISTS(Z4_ENABLE) || AXIS_IS_L64XX(Z4) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4)) #define HAS_Z4_ENABLE 1 #endif @@ -1920,7 +1920,7 @@ #ifndef Y_SLAVE_ADDRESS #define Y_SLAVE_ADDRESS 0 #endif - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #if HAS_DUAL_Y_STEPPERS #if defined(Y2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2) #define Y2_SENSORLESS 1 #endif @@ -1958,7 +1958,7 @@ #ifndef Z_SLAVE_ADDRESS #define Z_SLAVE_ADDRESS 0 #endif - #if NUM_Z_STEPPER_DRIVERS >= 2 + #if NUM_Z_STEPPERS >= 2 #if defined(Z2_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2) #define Z2_SENSORLESS 1 #endif @@ -1975,7 +1975,7 @@ #define Z2_SLAVE_ADDRESS 0 #endif #endif - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 #if defined(Z3_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z3) #define Z3_SENSORLESS 1 #endif @@ -1992,7 +1992,7 @@ #define Z3_SLAVE_ADDRESS 0 #endif #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 #if defined(Z4_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z4) #define Z4_SENSORLESS 1 #endif @@ -2309,8 +2309,8 @@ #define IS_X2_ENDSTOP(A,M) (ENABLED(X_DUAL_ENDSTOPS) && X2_USE_ENDSTOP == _##A##M##_) #define IS_Y2_ENDSTOP(A,M) (ENABLED(Y_DUAL_ENDSTOPS) && Y2_USE_ENDSTOP == _##A##M##_) #define IS_Z2_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && Z2_USE_ENDSTOP == _##A##M##_) -#define IS_Z3_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && Z3_USE_ENDSTOP == _##A##M##_) -#define IS_Z4_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && Z4_USE_ENDSTOP == _##A##M##_) +#define IS_Z3_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3 && Z3_USE_ENDSTOP == _##A##M##_) +#define IS_Z4_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4 && Z4_USE_ENDSTOP == _##A##M##_) #define _HAS_STOP(A,M) (PIN_EXISTS(A##_##M) && !IS_PROBE_PIN(A,M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_ENDSTOP(A,M) && !IS_Z3_ENDSTOP(A,M) && !IS_Z4_ENDSTOP(A,M)) #if _HAS_STOP(X,MIN) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index dadbf27273da..21ebadcebc30 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -524,11 +524,11 @@ #elif defined(Z_QUAD_ENDSTOPS_ADJUSTMENT2) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT3) || defined(Z_QUAD_ENDSTOPS_ADJUSTMENT4) #error "Z_QUAD_ENDSTOPS_ADJUSTMENT[234] is now Z[234]_ENDSTOP_ADJUSTMENT." #elif defined(Z_DUAL_STEPPER_DRIVERS) - #error "Z_DUAL_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 2." + #error "Z_DUAL_STEPPER_DRIVERS is no longer needed and should be removed." #elif defined(Z_TRIPLE_STEPPER_DRIVERS) - #error "Z_TRIPLE_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 3." + #error "Z_TRIPLE_STEPPER_DRIVERS is no longer needed and should be removed." #elif defined(Z_QUAD_STEPPER_DRIVERS) - #error "Z_QUAD_STEPPER_DRIVERS is now NUM_Z_STEPPER_DRIVERS with a value of 4." + #error "Z_QUAD_STEPPER_DRIVERS is no longer needed and should be removed." #elif defined(Z_DUAL_ENDSTOPS) || defined(Z_TRIPLE_ENDSTOPS) || defined(Z_QUAD_ENDSTOPS) #error "Z_(DUAL|TRIPLE|QUAD)_ENDSTOPS is now Z_MULTI_ENDSTOPS." #elif defined(DUGS_UI_MOVE_DIS_OPTION) @@ -619,6 +619,12 @@ #error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS is now just Z_STEPPER_ALIGN_STEPPER_XY." #elif defined(DWIN_CREALITY_LCD_ENHANCED) #error "DWIN_CREALITY_LCD_ENHANCED is now DWIN_LCD_PROUI." +#elif defined(X_DUAL_STEPPER_DRIVERS) + #error "X_DUAL_STEPPER_DRIVERS is no longer needed and should be removed." +#elif defined(Y_DUAL_STEPPER_DRIVERS) + #error "Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed." +#elif defined(NUM_Z_STEPPER_DRIVERS) + #error "NUM_Z_STEPPER_DRIVERS is no longer needed and should be removed." #endif constexpr float arm[] = AXIS_RELATIVE_MODES; @@ -735,27 +741,21 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L * Multiple Stepper Drivers Per Axis */ #define GOOD_AXIS_PINS(A) (HAS_##A##_ENABLE && HAS_##A##_STEP && HAS_##A##_DIR) -#if ENABLED(X_DUAL_STEPPER_DRIVERS) - #if ENABLED(DUAL_X_CARRIAGE) - #error "DUAL_X_CARRIAGE is not compatible with X_DUAL_STEPPER_DRIVERS." - #elif !GOOD_AXIS_PINS(X) - #error "X_DUAL_STEPPER_DRIVERS requires X2 pins to be defined." - #endif +#if HAS_X2_STEPPER && !GOOD_AXIS_PINS(X) + #error "If X2_DRIVER_TYPE is defined, then X2 ENABLE/STEP/DIR pins are also needed." #endif -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !GOOD_AXIS_PINS(Y) - #error "Y_DUAL_STEPPER_DRIVERS requires Y2 pins to be defined." +#if HAS_DUAL_Y_STEPPERS && !GOOD_AXIS_PINS(Y) + #error "If Y2_DRIVER_TYPE is defined, then Y2 ENABLE/STEP/DIR pins are also needed." #endif #if HAS_Z_AXIS - #if !WITHIN(NUM_Z_STEPPER_DRIVERS, 1, 4) - #error "NUM_Z_STEPPER_DRIVERS must be an integer from 1 to 4." - #elif NUM_Z_STEPPER_DRIVERS == 2 && !GOOD_AXIS_PINS(Z2) - #error "If NUM_Z_STEPPER_DRIVERS is 2, you must define stepper pins for Z2." - #elif NUM_Z_STEPPER_DRIVERS == 3 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3)) - #error "If NUM_Z_STEPPER_DRIVERS is 3, you must define stepper pins for Z2 and Z3." - #elif NUM_Z_STEPPER_DRIVERS == 4 && !(GOOD_AXIS_PINS(Z2) && GOOD_AXIS_PINS(Z3) && GOOD_AXIS_PINS(Z4)) - #error "If NUM_Z_STEPPER_DRIVERS is 4, you must define stepper pins for Z2, Z3, and Z4." + #if NUM_Z_STEPPERS >= 2 && !GOOD_AXIS_PINS(Z2) + #error "If Z2_DRIVER_TYPE is defined, then Z2 ENABLE/STEP/DIR pins are also needed." + #elif NUM_Z_STEPPERS >= 3 && !GOOD_AXIS_PINS(Z3) + #error "If Z3_DRIVER_TYPE is defined, then Z3 ENABLE/STEP/DIR pins are also needed." + #elif NUM_Z_STEPPERS >= 4 && !GOOD_AXIS_PINS(Z4) + #error "If Z4_DRIVER_TYPE is defined, then Z4 ENABLE/STEP/DIR pins are also needed." #endif #endif @@ -2531,10 +2531,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Z_MULTI_ENDSTOPS is not compatible with DELTA." #elif !Z2_USE_ENDSTOP #error "Z2_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS." - #elif !Z3_USE_ENDSTOP && NUM_Z_STEPPER_DRIVERS >= 3 - #error "Z3_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and NUM_Z_STEPPER_DRIVERS >= 3." - #elif !Z4_USE_ENDSTOP && NUM_Z_STEPPER_DRIVERS >= 4 - #error "Z4_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and NUM_Z_STEPPER_DRIVERS >= 4." + #elif !Z3_USE_ENDSTOP && NUM_Z_STEPPERS >= 3 + #error "Z3_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and Z3_DRIVER_TYPE." + #elif !Z4_USE_ENDSTOP && NUM_Z_STEPPERS >= 4 + #error "Z4_USE_ENDSTOP must be set with Z_MULTI_ENDSTOPS and Z4_DRIVER_TYPE." #endif #endif @@ -3504,14 +3504,14 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #endif #if ENABLED(Z_STEPPER_AUTO_ALIGN) - #if NUM_Z_STEPPER_DRIVERS <= 1 - #error "Z_STEPPER_AUTO_ALIGN requires NUM_Z_STEPPER_DRIVERS greater than 1." + #if NUM_Z_STEPPERS <= 1 + #error "Z_STEPPER_AUTO_ALIGN requires more than one Z stepper." #elif !HAS_BED_PROBE #error "Z_STEPPER_AUTO_ALIGN requires a Z-bed probe." #elif HAS_Z_STEPPER_ALIGN_STEPPER_XY static_assert(WITHIN(Z_STEPPER_ALIGN_AMP, 0.5, 2.0), "Z_STEPPER_ALIGN_AMP must be between 0.5 and 2.0."); - #if NUM_Z_STEPPER_DRIVERS < 3 - #error "Z_STEPPER_ALIGN_STEPPER_XY requires NUM_Z_STEPPER_DRIVERS to be 3 or 4." + #if NUM_Z_STEPPERS < 3 + #error "Z_STEPPER_ALIGN_STEPPER_XY requires 3 or 4 Z steppers." #endif #endif #endif diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index ff38c47a37bb..bfe6a3751818 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -35,6 +35,10 @@ #warning "WARNING! Disable MARLIN_DEV_MODE for the final build!" #endif +#if LINEAR_AXES_WARNING + #warning "Note: LINEAR_AXES is now based on the *_DRIVER_TYPE settings so you can remove LINEAR_AXES from Configuration.h." +#endif + // Safety Features #if DISABLED(USE_WATCHDOG) #warning "Safety Alert! Enable USE_WATCHDOG for the final build!" diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index e3c7c171d0f0..517feea3e6e4 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -429,7 +429,7 @@ void menu_backlash(); START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - LOOP_NUM_AXES(a) + LOOP_LINEAR_AXES(a) EDIT_ITEM_FAST_N(float5, a, MSG_VMAX_N, &planner.settings.max_feedrate_mm_s[a], 1, max_fr_edit_scaled[a]); #if E_STEPPERS @@ -575,7 +575,7 @@ void menu_advanced_steps_per_mm() { START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); - LOOP_NUM_AXES(a) + LOOP_LINEAR_AXES(a) EDIT_ITEM_FAST_N(float61, a, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[a], 5, 9999, []{ planner.refresh_positioning(); }); #if ENABLED(DISTINCT_E_FACTORS) diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp index df3f26f66ae1..1dc27d546538 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp @@ -66,14 +66,14 @@ void echo_yes_no(const bool yes) { DEBUG_ECHOPGM_P(yes ? PSTR(" YES") : PSTR(" N uint8_t L64XX_Marlin::dir_commands[MAX_L64XX]; // array to hold direction command for each driver -#define _EN_ITEM(N) , INVERT_E##N##_DIR +#define _EN_ITEM(N) , ENABLED(INVERT_E##N##_DIR) const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = { - LINEAR_AXIS_LIST(INVERT_X_DIR, INVERT_Y_DIR, INVERT_Z_DIR, INVERT_I_DIR, INVERT_J_DIR, INVERT_K_DIR) - , (INVERT_X_DIR) ^ BOTH(X_DUAL_STEPPER_DRIVERS, INVERT_X2_VS_X_DIR) // X2 - , (INVERT_Y_DIR) ^ BOTH(Y_DUAL_STEPPER_DRIVERS, INVERT_Y2_VS_Y_DIR) // Y2 - , (INVERT_Z_DIR) ^ ENABLED(INVERT_Z2_VS_Z_DIR) // Z2 - , (INVERT_Z_DIR) ^ ENABLED(INVERT_Z3_VS_Z_DIR) // Z3 - , (INVERT_Z_DIR) ^ ENABLED(INVERT_Z4_VS_Z_DIR) // Z4 + NUM_AXIS_LIST(ENABLED(INVERT_X_DIR), ENABLED(INVERT_Y_DIR), ENABLED(INVERT_Z_DIR), ENABLED(INVERT_I_DIR), ENABLED(INVERT_J_DIR), ENABLED(INVERT_K_DIR)) + , ENABLED(INVERT_X_DIR) ^ BOTH(HAS_DUAL_X_STEPPERS, INVERT_X2_VS_X_DIR) // X2 + , ENABLED(INVERT_Y_DIR) ^ BOTH(HAS_DUAL_Y_STEPPERS, INVERT_Y2_VS_Y_DIR) // Y2 + , ENABLED(INVERT_Z_DIR) ^ ENABLED(INVERT_Z2_VS_Z_DIR) // Z2 + , ENABLED(INVERT_Z_DIR) ^ ENABLED(INVERT_Z3_VS_Z_DIR) // Z3 + , ENABLED(INVERT_Z_DIR) ^ ENABLED(INVERT_Z4_VS_Z_DIR) // Z4 REPEAT(E_STEPPERS, _EN_ITEM) }; #undef _EN_ITEM diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 3f980b2217af..0620285e61e3 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -81,9 +81,9 @@ Endstops::endstop_mask_t Endstops::live_state = 0; #endif #if ENABLED(Z_MULTI_ENDSTOPS) float Endstops::z2_endstop_adj; - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 float Endstops::z3_endstop_adj; - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 float Endstops::z4_endstop_adj; #endif #endif @@ -708,14 +708,14 @@ void Endstops::update() { #else COPY_LIVE_STATE(Z_MIN, Z2_MIN); #endif - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 #if HAS_Z3_MIN UPDATE_ENDSTOP_BIT(Z3, MIN); #else COPY_LIVE_STATE(Z_MIN, Z3_MIN); #endif #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 #if HAS_Z4_MIN UPDATE_ENDSTOP_BIT(Z4, MIN); #else @@ -740,14 +740,14 @@ void Endstops::update() { #else COPY_LIVE_STATE(Z_MAX, Z2_MAX); #endif - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 #if HAS_Z3_MAX UPDATE_ENDSTOP_BIT(Z3, MAX); #else COPY_LIVE_STATE(Z_MAX, Z3_MAX); #endif #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 #if HAS_Z4_MAX UPDATE_ENDSTOP_BIT(Z4, MAX); #else @@ -930,9 +930,9 @@ void Endstops::update() { #if DISABLED(Z_MULTI_ENDSTOPS) #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_ENDSTOP(Z, MINMAX) - #elif NUM_Z_STEPPER_DRIVERS == 4 + #elif NUM_Z_STEPPERS == 4 #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_QUAD_ENDSTOP(Z, MINMAX) - #elif NUM_Z_STEPPER_DRIVERS == 3 + #elif NUM_Z_STEPPERS == 3 #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_TRIPLE_ENDSTOP(Z, MINMAX) #else #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX) diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index 83d1bc826f67..0282b7f263f6 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -58,11 +58,11 @@ enum EndstopEnum : char { #if ENABLED(Z_MULTI_ENDSTOPS) _ES_ITEM(HAS_Z_MIN, Z2_MIN) _ES_ITEM(HAS_Z_MAX, Z2_MAX) - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 _ES_ITEM(HAS_Z_MIN, Z3_MIN) _ES_ITEM(HAS_Z_MAX, Z3_MAX) #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 _ES_ITEM(HAS_Z_MIN, Z4_MIN) _ES_ITEM(HAS_Z_MAX, Z4_MAX) #endif @@ -114,10 +114,10 @@ class Endstops { #if ENABLED(Z_MULTI_ENDSTOPS) static float z2_endstop_adj; #endif - #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 + #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3 static float z3_endstop_adj; #endif - #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 + #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4 static float z4_endstop_adj; #endif diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index ceea7f7117d7..e709c6a9c9f0 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1634,7 +1634,7 @@ void prepare_line_to_destination() { phasePerUStep = PHASE_PER_MICROSTEP(X); phaseCurrent = stepperX.get_microstep_counter(); effectorBackoutDir = -X_HOME_DIR; - stepperBackoutDir = INVERT_X_DIR ? effectorBackoutDir : -effectorBackoutDir; + stepperBackoutDir = IF_DISABLED(INVERT_X_DIR, -)effectorBackoutDir; break; #endif #ifdef Y_MICROSTEPS @@ -1642,7 +1642,7 @@ void prepare_line_to_destination() { phasePerUStep = PHASE_PER_MICROSTEP(Y); phaseCurrent = stepperY.get_microstep_counter(); effectorBackoutDir = -Y_HOME_DIR; - stepperBackoutDir = INVERT_Y_DIR ? effectorBackoutDir : -effectorBackoutDir; + stepperBackoutDir = IF_DISABLED(INVERT_Y_DIR, -)effectorBackoutDir; break; #endif #ifdef Z_MICROSTEPS @@ -1650,7 +1650,7 @@ void prepare_line_to_destination() { phasePerUStep = PHASE_PER_MICROSTEP(Z); phaseCurrent = stepperZ.get_microstep_counter(); effectorBackoutDir = -Z_HOME_DIR; - stepperBackoutDir = INVERT_Z_DIR ? effectorBackoutDir : -effectorBackoutDir; + stepperBackoutDir = IF_DISABLED(INVERT_Z_DIR, -)effectorBackoutDir; break; #endif #ifdef I_MICROSTEPS @@ -1658,7 +1658,7 @@ void prepare_line_to_destination() { phasePerUStep = PHASE_PER_MICROSTEP(I); phaseCurrent = stepperI.get_microstep_counter(); effectorBackoutDir = -I_HOME_DIR; - stepperBackoutDir = INVERT_I_DIR ? effectorBackoutDir : -effectorBackoutDir; + stepperBackoutDir = IF_DISABLED(INVERT_I_DIR, -)effectorBackoutDir; break; #endif #ifdef J_MICROSTEPS @@ -1666,7 +1666,7 @@ void prepare_line_to_destination() { phasePerUStep = PHASE_PER_MICROSTEP(J); phaseCurrent = stepperJ.get_microstep_counter(); effectorBackoutDir = -J_HOME_DIR; - stepperBackoutDir = INVERT_J_DIR ? effectorBackoutDir : -effectorBackoutDir; + stepperBackoutDir = IF_DISABLED(INVERT_J_DIR, -)effectorBackoutDir; break; #endif #ifdef K_MICROSTEPS @@ -1674,7 +1674,7 @@ void prepare_line_to_destination() { phasePerUStep = PHASE_PER_MICROSTEP(K); phaseCurrent = stepperK.get_microstep_counter(); effectorBackoutDir = -K_HOME_DIR; - stepperBackoutDir = INVERT_K_DIR ? effectorBackoutDir : -effectorBackoutDir; + stepperBackoutDir = IF_DISABLED(INVERT_K_DIR, -)effectorBackoutDir; break; #endif default: return; @@ -1882,7 +1882,7 @@ void prepare_line_to_destination() { #if ENABLED(Z_MULTI_ENDSTOPS) if (axis == Z_AXIS) { - #if NUM_Z_STEPPER_DRIVERS == 2 + #if NUM_Z_STEPPERS == 2 const float adj = ABS(endstops.z2_endstop_adj); if (adj) { @@ -1900,13 +1900,13 @@ void prepare_line_to_destination() { adjustFunc_t lock[] = { stepper.set_z1_lock, stepper.set_z2_lock, stepper.set_z3_lock - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 , stepper.set_z4_lock #endif }; float adj[] = { 0, endstops.z2_endstop_adj, endstops.z3_endstop_adj - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 , endstops.z4_endstop_adj #endif }; @@ -1925,7 +1925,7 @@ void prepare_line_to_destination() { lock[1] = lock[2], adj[1] = adj[2]; lock[2] = tempLock, adj[2] = tempAdj; } - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 if (adj[3] < adj[2]) { tempLock = lock[2], tempAdj = adj[2]; lock[2] = lock[3], adj[2] = adj[3]; @@ -1950,14 +1950,14 @@ void prepare_line_to_destination() { // lock the second stepper for the final correction (*lock[1])(true); do_homing_move(axis, adj[2] - adj[1]); - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 // lock the third stepper for the final correction (*lock[2])(true); do_homing_move(axis, adj[3] - adj[2]); #endif } else { - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 (*lock[3])(true); do_homing_move(axis, adj[2] - adj[3]); #endif @@ -1970,7 +1970,7 @@ void prepare_line_to_destination() { stepper.set_z1_lock(false); stepper.set_z2_lock(false); stepper.set_z3_lock(false); - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 stepper.set_z4_lock(false); #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index dd360e9cd8a0..0d69c07c2480 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -347,9 +347,9 @@ typedef struct SettingsDataStruct { // Z_STEPPER_AUTO_ALIGN, HAS_Z_STEPPER_ALIGN_STEPPER_XY // #if ENABLED(Z_STEPPER_AUTO_ALIGN) - xy_pos_t z_stepper_align_xy[NUM_Z_STEPPER_DRIVERS]; // M422 S X Y + xy_pos_t z_stepper_align_xy[NUM_Z_STEPPERS]; // M422 S X Y #if HAS_Z_STEPPER_ALIGN_STEPPER_XY - xy_pos_t z_stepper_align_stepper_xy[NUM_Z_STEPPER_DRIVERS]; // M422 W X Y + xy_pos_t z_stepper_align_stepper_xy[NUM_Z_STEPPERS]; // M422 W X Y #endif #endif @@ -1009,13 +1009,13 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(TERN(Y_DUAL_ENDSTOPS, endstops.y2_endstop_adj, dummyf)); // 1 float EEPROM_WRITE(TERN(Z_MULTI_ENDSTOPS, endstops.z2_endstop_adj, dummyf)); // 1 float - #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 + #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3 EEPROM_WRITE(endstops.z3_endstop_adj); // 1 float #else EEPROM_WRITE(dummyf); #endif - #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 + #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4 EEPROM_WRITE(endstops.z4_endstop_adj); // 1 float #else EEPROM_WRITE(dummyf); @@ -1943,12 +1943,12 @@ void MarlinSettings::postprocess() { EEPROM_READ(TERN(Y_DUAL_ENDSTOPS, endstops.y2_endstop_adj, dummyf)); // 1 float EEPROM_READ(TERN(Z_MULTI_ENDSTOPS, endstops.z2_endstop_adj, dummyf)); // 1 float - #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 + #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3 EEPROM_READ(endstops.z3_endstop_adj); // 1 float #else EEPROM_READ(dummyf); #endif - #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 + #if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4 EEPROM_READ(endstops.z4_endstop_adj); // 1 float #else EEPROM_READ(dummyf); @@ -2990,13 +2990,13 @@ void MarlinSettings::reset() { #define Z2_ENDSTOP_ADJUSTMENT 0 #endif endstops.z2_endstop_adj = Z2_ENDSTOP_ADJUSTMENT; - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 #ifndef Z3_ENDSTOP_ADJUSTMENT #define Z3_ENDSTOP_ADJUSTMENT 0 #endif endstops.z3_endstop_adj = Z3_ENDSTOP_ADJUSTMENT; #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 #ifndef Z4_ENDSTOP_ADJUSTMENT #define Z4_ENDSTOP_ADJUSTMENT 0 #endif diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 1821043647a1..66cf7a535888 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -177,9 +177,9 @@ bool Stepper::abort_current_block; #if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN) bool Stepper::locked_Z_motor = false, Stepper::locked_Z2_motor = false - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 , Stepper::locked_Z3_motor = false - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 , Stepper::locked_Z4_motor = false #endif #endif @@ -365,7 +365,7 @@ xyze_int8_t Stepper::count_direction{0}; A##4_STEP_WRITE(V); \ } -#if ENABLED(X_DUAL_STEPPER_DRIVERS) +#if HAS_DUAL_X_STEPPERS #define X_APPLY_DIR(v,Q) do{ X_DIR_WRITE(v); X2_DIR_WRITE((v) ^ ENABLED(INVERT_X2_VS_X_DIR)); }while(0) #if ENABLED(X_DUAL_ENDSTOPS) #define X_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(X,v) @@ -386,7 +386,7 @@ xyze_int8_t Stepper::count_direction{0}; #define X_APPLY_STEP(v,Q) X_STEP_WRITE(v) #endif -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) +#if HAS_DUAL_Y_STEPPERS #define Y_APPLY_DIR(v,Q) do{ Y_DIR_WRITE(v); Y2_DIR_WRITE((v) ^ ENABLED(INVERT_Y2_VS_Y_DIR)); }while(0) #if ENABLED(Y_DUAL_ENDSTOPS) #define Y_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Y,v) @@ -398,7 +398,7 @@ xyze_int8_t Stepper::count_direction{0}; #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v) #endif -#if NUM_Z_STEPPER_DRIVERS == 4 +#if NUM_Z_STEPPERS == 4 #define Z_APPLY_DIR(v,Q) do{ \ Z_DIR_WRITE(v); Z2_DIR_WRITE((v) ^ ENABLED(INVERT_Z2_VS_Z_DIR)); \ Z3_DIR_WRITE((v) ^ ENABLED(INVERT_Z3_VS_Z_DIR)); Z4_DIR_WRITE((v) ^ ENABLED(INVERT_Z4_VS_Z_DIR)); \ @@ -410,7 +410,7 @@ xyze_int8_t Stepper::count_direction{0}; #else #define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); Z3_STEP_WRITE(v); Z4_STEP_WRITE(v); }while(0) #endif -#elif NUM_Z_STEPPER_DRIVERS == 3 +#elif NUM_Z_STEPPERS == 3 #define Z_APPLY_DIR(v,Q) do{ \ Z_DIR_WRITE(v); Z2_DIR_WRITE((v) ^ ENABLED(INVERT_Z2_VS_Z_DIR)); Z3_DIR_WRITE((v) ^ ENABLED(INVERT_Z3_VS_Z_DIR)); \ }while(0) @@ -421,7 +421,7 @@ xyze_int8_t Stepper::count_direction{0}; #else #define Z_APPLY_STEP(v,Q) do{ Z_STEP_WRITE(v); Z2_STEP_WRITE(v); Z3_STEP_WRITE(v); }while(0) #endif -#elif NUM_Z_STEPPER_DRIVERS == 2 +#elif NUM_Z_STEPPERS == 2 #define Z_APPLY_DIR(v,Q) do{ Z_DIR_WRITE(v); Z2_DIR_WRITE((v) ^ ENABLED(INVERT_Z2_VS_Z_DIR)); }while(0) #if ENABLED(Z_MULTI_ENDSTOPS) #define Z_APPLY_STEP(v,Q) DUAL_ENDSTOP_APPLY_STEP(Z,v) @@ -2564,19 +2564,19 @@ void Stepper::init() { TERN_(HAS_X2_DIR, X2_DIR_INIT()); #if HAS_Y_DIR Y_DIR_INIT(); - #if BOTH(Y_DUAL_STEPPER_DRIVERS, HAS_Y2_DIR) + #if BOTH(HAS_DUAL_Y_STEPPERS, HAS_Y2_DIR) Y2_DIR_INIT(); #endif #endif #if HAS_Z_DIR Z_DIR_INIT(); - #if NUM_Z_STEPPER_DRIVERS >= 2 && HAS_Z2_DIR + #if NUM_Z_STEPPERS >= 2 && HAS_Z2_DIR Z2_DIR_INIT(); #endif - #if NUM_Z_STEPPER_DRIVERS >= 3 && HAS_Z3_DIR + #if NUM_Z_STEPPERS >= 3 && HAS_Z3_DIR Z3_DIR_INIT(); #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 && HAS_Z4_DIR + #if NUM_Z_STEPPERS >= 4 && HAS_Z4_DIR Z4_DIR_INIT(); #endif #endif @@ -2626,7 +2626,7 @@ void Stepper::init() { #if HAS_Y_ENABLE Y_ENABLE_INIT(); if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH); - #if BOTH(Y_DUAL_STEPPER_DRIVERS, HAS_Y2_ENABLE) + #if BOTH(HAS_DUAL_Y_STEPPERS, HAS_Y2_ENABLE) Y2_ENABLE_INIT(); if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH); #endif @@ -2634,15 +2634,15 @@ void Stepper::init() { #if HAS_Z_ENABLE Z_ENABLE_INIT(); if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH); - #if NUM_Z_STEPPER_DRIVERS >= 2 && HAS_Z2_ENABLE + #if NUM_Z_STEPPERS >= 2 && HAS_Z2_ENABLE Z2_ENABLE_INIT(); if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH); #endif - #if NUM_Z_STEPPER_DRIVERS >= 3 && HAS_Z3_ENABLE + #if NUM_Z_STEPPERS >= 3 && HAS_Z3_ENABLE Z3_ENABLE_INIT(); if (!Z_ENABLE_ON) Z3_ENABLE_WRITE(HIGH); #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 && HAS_Z4_ENABLE + #if NUM_Z_STEPPERS >= 4 && HAS_Z4_ENABLE Z4_ENABLE_INIT(); if (!Z_ENABLE_ON) Z4_ENABLE_WRITE(HIGH); #endif @@ -2705,7 +2705,7 @@ void Stepper::init() { // Init Step Pins #if HAS_X_STEP - #if EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) + #if HAS_X2_STEPPER X2_STEP_INIT(); X2_STEP_WRITE(INVERT_X_STEP_PIN); #endif @@ -2713,7 +2713,7 @@ void Stepper::init() { #endif #if HAS_Y_STEP - #if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #if HAS_DUAL_Y_STEPPERS Y2_STEP_INIT(); Y2_STEP_WRITE(INVERT_Y_STEP_PIN); #endif @@ -2721,15 +2721,15 @@ void Stepper::init() { #endif #if HAS_Z_STEP - #if NUM_Z_STEPPER_DRIVERS >= 2 + #if NUM_Z_STEPPERS >= 2 Z2_STEP_INIT(); Z2_STEP_WRITE(INVERT_Z_STEP_PIN); #endif - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 Z3_STEP_INIT(); Z3_STEP_WRITE(INVERT_Z_STEP_PIN); #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 Z4_STEP_INIT(); Z4_STEP_WRITE(INVERT_Z_STEP_PIN); #endif @@ -2965,7 +2965,7 @@ void Stepper::report_positions() { #define _ENABLE_AXIS(A) enable_axis(_AXIS(A)) #define _READ_DIR(AXIS) AXIS ##_DIR_READ() - #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR + #define _INVERT_DIR(AXIS) ENABLED(INVERT_## AXIS ##_DIR) #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true) #if MINIMUM_STEPPER_PULSE @@ -3108,21 +3108,21 @@ void Stepper::report_positions() { I_DIR_READ(), J_DIR_READ(), K_DIR_READ() ); - X_DIR_WRITE(INVERT_X_DIR ^ z_direction); + X_DIR_WRITE(ENABLED(INVERT_X_DIR) ^ z_direction); #ifdef Y_DIR_WRITE - Y_DIR_WRITE(INVERT_Y_DIR ^ z_direction); + Y_DIR_WRITE(ENABLED(INVERT_Y_DIR) ^ z_direction); #endif #ifdef Z_DIR_WRITE - Z_DIR_WRITE(INVERT_Z_DIR ^ z_direction); + Z_DIR_WRITE(ENABLED(INVERT_Z_DIR) ^ z_direction); #endif #ifdef I_DIR_WRITE - I_DIR_WRITE(INVERT_I_DIR ^ z_direction); + I_DIR_WRITE(ENABLED(INVERT_I_DIR) ^ z_direction); #endif #ifdef J_DIR_WRITE - J_DIR_WRITE(INVERT_J_DIR ^ z_direction); + J_DIR_WRITE(ENABLED(INVERT_J_DIR) ^ z_direction); #endif #ifdef K_DIR_WRITE - K_DIR_WRITE(INVERT_K_DIR ^ z_direction); + K_DIR_WRITE(ENABLED(INVERT_K_DIR) ^ z_direction); #endif DIR_WAIT_AFTER(); diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 942b8cc793a6..89ba7b06719c 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -357,9 +357,9 @@ class Stepper { #endif #if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN) static bool locked_Z_motor, locked_Z2_motor - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 , locked_Z3_motor - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 , locked_Z4_motor #endif #endif @@ -561,18 +561,18 @@ class Stepper { #if EITHER(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN) FORCE_INLINE static void set_z1_lock(const bool state) { locked_Z_motor = state; } FORCE_INLINE static void set_z2_lock(const bool state) { locked_Z2_motor = state; } - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 FORCE_INLINE static void set_z3_lock(const bool state) { locked_Z3_motor = state; } - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 FORCE_INLINE static void set_z4_lock(const bool state) { locked_Z4_motor = state; } #endif #endif static void set_all_z_lock(const bool lock, const int8_t except=-1) { set_z1_lock(lock ^ (except == 0)); set_z2_lock(lock ^ (except == 1)); - #if NUM_Z_STEPPER_DRIVERS >= 3 + #if NUM_Z_STEPPERS >= 3 set_z3_lock(lock ^ (except == 2)); - #if NUM_Z_STEPPER_DRIVERS >= 4 + #if NUM_Z_STEPPERS >= 4 set_z4_lock(lock ^ (except == 3)); #endif #endif diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index 7aea67753403..f8369ffb1cf5 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -405,91 +405,91 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #if EXTRUDERS > 7 #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else if (E < 6) { E2_STEP_WRITE(V); } else { E3_STEP_WRITE(V); } }while(0) #define NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \ - case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 5: E2_DIR_WRITE( INVERT_E2_DIR); break; \ - case 6: E3_DIR_WRITE( INVERT_E3_DIR); break; case 7: E3_DIR_WRITE( INVERT_E3_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ + case 4: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; \ + case 6: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; case 7: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \ } }while(0) #define REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ - case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; case 5: E2_DIR_WRITE(!INVERT_E2_DIR); break; \ - case 6: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 7: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ + case 4: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; \ + case 6: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; case 7: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \ } }while(0) #elif EXTRUDERS > 6 #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else if (E < 6) { E2_STEP_WRITE(V); } else { E3_STEP_WRITE(V); } }while(0) #define NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \ - case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 5: E2_DIR_WRITE( INVERT_E2_DIR); break; \ - case 6: E3_DIR_WRITE( INVERT_E3_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ + case 4: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; \ + case 6: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \ } }while(0) #define REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ - case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; case 5: E2_DIR_WRITE(!INVERT_E2_DIR); break; \ - case 6: E3_DIR_WRITE(!INVERT_E3_DIR); } }while(0) + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ + case 4: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; \ + case 6: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); } }while(0) #elif EXTRUDERS > 5 #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0) #define NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \ - case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 5: E2_DIR_WRITE( INVERT_E2_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ + case 4: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; \ } }while(0) #define REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ - case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; case 5: E2_DIR_WRITE(!INVERT_E2_DIR); break; \ + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ + case 4: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 5: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; \ } }while(0) #elif EXTRUDERS > 4 #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0) #define NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \ - case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ + case 4: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; \ } }while(0) #define REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ - case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; \ + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ + case 4: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; \ } }while(0) #elif EXTRUDERS > 3 #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) #define NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ } }while(0) #define REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 3: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ } }while(0) #elif EXTRUDERS > 2 #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) #define NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ } }while(0) #define REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ - case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; \ + case 2: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ } }while(0) #else #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? INVERT_E0_DIR : !INVERT_E0_DIR); }while(0) - #define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0) + #define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? ENABLED(INVERT_E0_DIR) : DISABLED(INVERT_E0_DIR)); }while(0) + #define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? DISABLED(INVERT_E0_DIR) : ENABLED(INVERT_E0_DIR)); }while(0) #endif #elif HAS_PRUSA_MMU2 // One multiplexed stepper driver #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) - #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) + #define NORM_E_DIR(E) E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)) + #define REV_E_DIR(E) E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)) #elif HAS_PRUSA_MMU1 // One multiplexed stepper driver, reversed on odd index #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR); }while(0) - #define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR); }while(0) + #define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? DISABLED(INVERT_E0_DIR): ENABLED(INVERT_E0_DIR)); }while(0) + #define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? ENABLED(INVERT_E0_DIR): DISABLED(INVERT_E0_DIR)); }while(0) #elif E_STEPPERS > 1 @@ -500,16 +500,16 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset case 4: E4_STEP_WRITE(V); break; case 5: E5_STEP_WRITE(V); break; case 6: E6_STEP_WRITE(V); break; case 7: E7_STEP_WRITE(V); break; \ } }while(0) #define _NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ - case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ - case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 5: E5_DIR_WRITE(!INVERT_E5_DIR); break; \ - case 6: E6_DIR_WRITE(!INVERT_E6_DIR); break; case 7: E7_DIR_WRITE(!INVERT_E7_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ + case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \ + case 4: E4_DIR_WRITE(DISABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE(DISABLED(INVERT_E5_DIR)); break; \ + case 6: E6_DIR_WRITE(DISABLED(INVERT_E6_DIR)); break; case 7: E7_DIR_WRITE(DISABLED(INVERT_E7_DIR)); break; \ } }while(0) #define _REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \ - case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \ - case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 5: E5_DIR_WRITE( INVERT_E5_DIR); break; \ - case 6: E6_DIR_WRITE( INVERT_E6_DIR); break; case 7: E7_DIR_WRITE( INVERT_E7_DIR); break; \ + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ + case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \ + case 4: E4_DIR_WRITE( ENABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE( ENABLED(INVERT_E5_DIR)); break; \ + case 6: E6_DIR_WRITE( ENABLED(INVERT_E6_DIR)); break; case 7: E7_DIR_WRITE( ENABLED(INVERT_E7_DIR)); break; \ } }while(0) #elif E_STEPPERS > 6 @@ -519,16 +519,16 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset case 4: E4_STEP_WRITE(V); break; case 5: E5_STEP_WRITE(V); break; case 6: E6_STEP_WRITE(V); break; \ } }while(0) #define _NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ - case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ - case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 5: E5_DIR_WRITE(!INVERT_E5_DIR); break; \ - case 6: E6_DIR_WRITE(!INVERT_E6_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ + case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \ + case 4: E4_DIR_WRITE(DISABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE(DISABLED(INVERT_E5_DIR)); break; \ + case 6: E6_DIR_WRITE(DISABLED(INVERT_E6_DIR)); break; \ } }while(0) #define _REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \ - case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \ - case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 5: E5_DIR_WRITE( INVERT_E5_DIR); break; \ - case 6: E6_DIR_WRITE( INVERT_E6_DIR); break; \ + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ + case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \ + case 4: E4_DIR_WRITE( ENABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE( ENABLED(INVERT_E5_DIR)); break; \ + case 6: E6_DIR_WRITE( ENABLED(INVERT_E6_DIR)); break; \ } }while(0) #elif E_STEPPERS > 5 @@ -538,14 +538,14 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset case 4: E4_STEP_WRITE(V); break; case 5: E5_STEP_WRITE(V); break; \ } }while(0) #define _NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ - case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ - case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 5: E5_DIR_WRITE(!INVERT_E5_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ + case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \ + case 4: E4_DIR_WRITE(DISABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE(DISABLED(INVERT_E5_DIR)); break; \ } }while(0) #define _REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \ - case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \ - case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 5: E5_DIR_WRITE( INVERT_E5_DIR); break; \ + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ + case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \ + case 4: E4_DIR_WRITE( ENABLED(INVERT_E4_DIR)); break; case 5: E5_DIR_WRITE( ENABLED(INVERT_E5_DIR)); break; \ } }while(0) #elif E_STEPPERS > 4 @@ -555,14 +555,14 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset case 4: E4_STEP_WRITE(V); break; \ } }while(0) #define _NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ - case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ - case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ + case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \ + case 4: E4_DIR_WRITE(DISABLED(INVERT_E4_DIR)); break; \ } }while(0) #define _REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \ - case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \ - case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; \ + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ + case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \ + case 4: E4_DIR_WRITE( ENABLED(INVERT_E4_DIR)); break; \ } }while(0) #elif E_STEPPERS > 3 @@ -571,25 +571,25 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; \ } }while(0) #define _NORM_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ - case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ + case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; \ + case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE(DISABLED(INVERT_E3_DIR)); break; \ } }while(0) #define _REV_E_DIR(E) do{ switch (E) { \ - case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \ - case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \ + case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; \ + case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); break; case 3: E3_DIR_WRITE( ENABLED(INVERT_E3_DIR)); break; \ } }while(0) #elif E_STEPPERS > 2 #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); } }while(0) - #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) - #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) + #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); break; case 2: E2_DIR_WRITE(DISABLED(INVERT_E2_DIR)); } }while(0) + #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); break; case 1: E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); break; case 2: E2_DIR_WRITE( ENABLED(INVERT_E2_DIR)); } }while(0) #else #define _E_STEP_WRITE(E,V) do{ if (E == 0) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define _NORM_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) - #define _REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) + #define _NORM_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); } else { E1_DIR_WRITE(DISABLED(INVERT_E1_DIR)); } }while(0) + #define _REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); } else { E1_DIR_WRITE( ENABLED(INVERT_E1_DIR)); } }while(0) #endif #if HAS_DUPLICATION_MODE @@ -600,8 +600,8 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define _DUPE(N,T,V) E##N##_##T##_WRITE(V) #endif - #define NDIR(N) _DUPE(N,DIR,!INVERT_E##N##_DIR) - #define RDIR(N) _DUPE(N,DIR, INVERT_E##N##_DIR) + #define NDIR(N) _DUPE(N,DIR,DISABLED(INVERT_E##N##_DIR)) + #define RDIR(N) _DUPE(N,DIR, ENABLED(INVERT_E##N##_DIR)) #define E_STEP_WRITE(E,V) do{ if (extruder_duplication_enabled) { DUPE(STEP,V); } else _E_STEP_WRITE(E,V); }while(0) @@ -647,13 +647,13 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #elif ENABLED(E_DUAL_STEPPER_DRIVERS) #define E_STEP_WRITE(E,V) do{ E0_STEP_WRITE(V); E1_STEP_WRITE(V); }while(0) - #define NORM_E_DIR(E) do{ E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E0_DIR ^ ENABLED(INVERT_E1_VS_E0_DIR)); }while(0) - #define REV_E_DIR(E) do{ E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E0_DIR ^ ENABLED(INVERT_E1_VS_E0_DIR)); }while(0) + #define NORM_E_DIR(E) do{ E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)); E1_DIR_WRITE(DISABLED(INVERT_E0_DIR) ^ ENABLED(INVERT_E1_VS_E0_DIR)); }while(0) + #define REV_E_DIR(E) do{ E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)); E1_DIR_WRITE( ENABLED(INVERT_E0_DIR) ^ ENABLED(INVERT_E1_VS_E0_DIR)); }while(0) #elif E_STEPPERS #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) - #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) + #define NORM_E_DIR(E) E0_DIR_WRITE(DISABLED(INVERT_E0_DIR)) + #define REV_E_DIR(E) E0_DIR_WRITE( ENABLED(INVERT_E0_DIR)) #else #define E_STEP_WRITE(E,V) NOOP diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index 1609c9c08326..ab42c30a8f32 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -468,10 +468,10 @@ #ifndef Z2_USE_ENDSTOP #define Z2_USE_ENDSTOP _ZSTOP_ #endif - #if NUM_Z_STEPPER_DRIVERS >= 3 && !defined(Z3_USE_ENDSTOP) + #if NUM_Z_STEPPERS >= 3 && !defined(Z3_USE_ENDSTOP) #define Z3_USE_ENDSTOP _ZSTOP_ #endif - #if NUM_Z_STEPPER_DRIVERS >= 4 && !defined(Z4_USE_ENDSTOP) + #if NUM_Z_STEPPERS >= 4 && !defined(Z4_USE_ENDSTOP) #define Z4_USE_ENDSTOP _ZSTOP_ #endif #endif @@ -688,14 +688,14 @@ #define X2_MS3_PIN -1 #endif -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !defined(Y2_DIAG_PIN) && !defined(Y2_STEP_PIN) && !PIN_EXISTS(Y2_CS_PIN) +#if HAS_DUAL_Y_STEPPERS && !defined(Y2_DIAG_PIN) && !defined(Y2_STEP_PIN) && !PIN_EXISTS(Y2_CS_PIN) #define Z2_E_INDEX INCREMENT(Y2_E_INDEX) #else #define Z2_E_INDEX Y2_E_INDEX #endif // The Y2 axis, if any, should be the next open extruder port -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) +#if HAS_DUAL_Y_STEPPERS #ifndef Y2_STEP_PIN #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR) @@ -774,14 +774,14 @@ #define Y2_MS3_PIN -1 #endif -#if NUM_Z_STEPPER_DRIVERS >= 2 && !defined(Z2_DIAG_PIN) && !defined(Z2_STEP_PIN) && !PIN_EXISTS(Z2_CS_PIN) +#if NUM_Z_STEPPERS >= 2 && !defined(Z2_DIAG_PIN) && !defined(Z2_STEP_PIN) && !PIN_EXISTS(Z2_CS_PIN) #define Z3_E_INDEX INCREMENT(Z2_E_INDEX) #else #define Z3_E_INDEX Z2_E_INDEX #endif // The Z2 axis, if any, should be the next open extruder port -#if NUM_Z_STEPPER_DRIVERS >= 2 +#if NUM_Z_STEPPERS >= 2 #ifndef Z2_STEP_PIN #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR) @@ -860,14 +860,14 @@ #define Z2_MS3_PIN -1 #endif -#if NUM_Z_STEPPER_DRIVERS >= 3 && !defined(Z3_DIAG_PIN) && !defined(Z3_STEP_PIN) && !PIN_EXISTS(Z3_CS_PIN) +#if NUM_Z_STEPPERS >= 3 && !defined(Z3_DIAG_PIN) && !defined(Z3_STEP_PIN) && !PIN_EXISTS(Z3_CS_PIN) #define Z4_E_INDEX INCREMENT(Z3_E_INDEX) #else #define Z4_E_INDEX Z3_E_INDEX #endif // The Z3 axis, if any, should be the next open extruder port -#if NUM_Z_STEPPER_DRIVERS >= 3 +#if NUM_Z_STEPPERS >= 3 #ifndef Z3_STEP_PIN #define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP) #define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR) @@ -946,14 +946,14 @@ #define Z3_MS3_PIN -1 #endif -#if NUM_Z_STEPPER_DRIVERS >= 4 && !defined(Z4_DIAG_PIN) && !defined(Z4_STEP_PIN) && !PIN_EXISTS(Z4_CS_PIN) +#if NUM_Z_STEPPERS >= 4 && !defined(Z4_DIAG_PIN) && !defined(Z4_STEP_PIN) && !PIN_EXISTS(Z4_CS_PIN) #define I_E_INDEX INCREMENT(Z4_E_INDEX) #else #define I_E_INDEX Z4_E_INDEX #endif // The Z4 axis, if any, should be the next open extruder port -#if NUM_Z_STEPPER_DRIVERS >= 4 +#if NUM_Z_STEPPERS >= 4 #ifndef Z4_STEP_PIN #define Z4_STEP_PIN _EPIN(Z4_E_INDEX, STEP) #define Z4_DIR_PIN _EPIN(Z4_E_INDEX, DIR) @@ -1396,16 +1396,16 @@ #if DISABLED(Z_MULTI_ENDSTOPS) || Z_HOME_TO_MIN #undef Z2_MAX_PIN #endif -#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_TO_MAX +#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPERS < 3 || Z_HOME_TO_MAX #undef Z3_MIN_PIN #endif -#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 3 || Z_HOME_TO_MIN +#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPERS < 3 || Z_HOME_TO_MIN #undef Z3_MAX_PIN #endif -#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_TO_MAX +#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPERS < 4 || Z_HOME_TO_MAX #undef Z4_MIN_PIN #endif -#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPER_DRIVERS < 4 || Z_HOME_TO_MIN +#if DISABLED(Z_MULTI_ENDSTOPS) || NUM_Z_STEPPERS < 4 || Z_HOME_TO_MIN #undef Z4_MAX_PIN #endif diff --git a/Marlin/src/pins/ramps/pins_RL200.h b/Marlin/src/pins/ramps/pins_RL200.h index 047ad160bed1..52d0173c00a8 100644 --- a/Marlin/src/pins/ramps/pins_RL200.h +++ b/Marlin/src/pins/ramps/pins_RL200.h @@ -31,8 +31,8 @@ #if HOTENDS > 2 || E_STEPPERS > 2 #error "RL200v1 supports up to 2 hotends / E-steppers. Comment out this line to continue." -#elif NUM_Z_STEPPER_DRIVERS != 2 - #error "RL200 uses dual Z stepper motors. Set NUM_Z_STEPPER_DRIVERS to 2 or comment out this line to continue." +#elif NUM_Z_STEPPERS != 2 + #error "RL200 uses dual Z stepper motors. Set NUM_Z_STEPPERS to 2 or comment out this line to continue." #elif !(AXIS_DRIVER_TYPE_X(DRV8825) && AXIS_DRIVER_TYPE_Y(DRV8825) && AXIS_DRIVER_TYPE_Z(DRV8825) && AXIS_DRIVER_TYPE_Z2(DRV8825) && AXIS_DRIVER_TYPE_E0(DRV8825)) #error "You must set ([XYZ]|Z2|E0)_DRIVER_TYPE to DRV8825 in Configuration.h for RL200." #endif diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V53.h b/Marlin/src/pins/ramps/pins_ZRIB_V53.h index 6cbc0351ba98..3a2604586ef0 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V53.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V53.h @@ -118,7 +118,7 @@ #define Z_DIR_PIN 48 #define Z_ENABLE_PIN 62 -#if NUM_Z_STEPPER_DRIVERS == 2 +#if NUM_Z_STEPPERS == 2 #define Z2_STEP_PIN 26 // E0 connector #define Z2_DIR_PIN 28 #define Z2_ENABLE_PIN 24 diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h index 71fe76a59219..0f4bb1d0b591 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h @@ -110,7 +110,7 @@ // This board have the option to use an extra TMC2209 stepper, one of the use could be as a second extruder. #if EXTRUDERS < 2 // TODO: Corregir aquí que cuando tenemos dos extrusores o lo que sea, utiliza los endstop que le sobran, osea los max, no hay Z2_endstop - #if NUM_Z_STEPPER_DRIVERS > 1 + #if NUM_Z_STEPPERS > 1 #define Z2_STOP_PIN 14 #endif #else diff --git a/Marlin/src/pins/sensitive_pins.h b/Marlin/src/pins/sensitive_pins.h index f9911cc863fa..07634dacdd94 100644 --- a/Marlin/src/pins/sensitive_pins.h +++ b/Marlin/src/pins/sensitive_pins.h @@ -658,7 +658,7 @@ #define _X2_PINS #endif -#if ENABLED(Y_DUAL_STEPPER_DRIVERS) +#if HAS_DUAL_Y_STEPPERS #if PIN_EXISTS(Y2_CS) && AXIS_HAS_SPI(Y2) #define _Y2_CS Y2_CS_PIN, #else @@ -684,7 +684,7 @@ #define _Y2_PINS #endif -#if NUM_Z_STEPPER_DRIVERS >= 2 +#if NUM_Z_STEPPERS >= 2 #if PIN_EXISTS(Z2_CS) && AXIS_HAS_SPI(Z2) #define _Z2_CS Z2_CS_PIN, #else @@ -710,7 +710,7 @@ #define _Z2_PINS #endif -#if NUM_Z_STEPPER_DRIVERS >= 3 +#if NUM_Z_STEPPERS >= 3 #if PIN_EXISTS(Z3_CS) && AXIS_HAS_SPI(Z3) #define _Z3_CS Z3_CS_PIN, #else @@ -736,7 +736,7 @@ #define _Z3_PINS #endif -#if NUM_Z_STEPPER_DRIVERS >= 4 +#if NUM_Z_STEPPERS >= 4 #if PIN_EXISTS(Z4_CS) && AXIS_HAS_SPI(Z4) #define _Z4_CS Z4_CS_PIN, #else diff --git a/buildroot/tests/BIGTREE_GTR_V1_0 b/buildroot/tests/BIGTREE_GTR_V1_0 index 13ec7ca3a2f7..d6eccaff07dc 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0 +++ b/buildroot/tests/BIGTREE_GTR_V1_0 @@ -22,7 +22,7 @@ exec_test $1 $2 "BigTreeTech GTR | 8 Extruders | Auto-Fan | Mixed TMC Drivers | restore_configs opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \ EXTRUDERS 5 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 \ - NUM_Z_STEPPER_DRIVERS 4 \ + Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z3_DRIVER_TYPE A4988 Z4_DRIVER_TYPE A4988 \ DEFAULT_Kp_LIST '{ 22.2, 20.0, 21.0, 19.0, 18.0 }' DEFAULT_Ki_LIST '{ 1.08 }' DEFAULT_Kd_LIST '{ 114.0, 112.0, 110.0, 108.0 }' opt_enable TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_MIGRATION_FEATURE TOOLCHANGE_FS_SLOW_FIRST_PRIME TOOLCHANGE_FS_PRIME_FIRST_USED \ PID_PARAMS_PER_HOTEND Z_MULTI_ENDSTOPS diff --git a/buildroot/tests/DUE b/buildroot/tests/DUE index 9b968cbd8d4d..a2f3fda7a7ac 100755 --- a/buildroot/tests/DUE +++ b/buildroot/tests/DUE @@ -35,7 +35,7 @@ exec_test $1 $2 "RAMPS4DUE_EFB with ABL (Bilinear), ExtUI, S-Curve, many options # RADDS with BLTouch, ABL(B), 3 x Z auto-align # restore_configs -opt_set MOTHERBOARD BOARD_RADDS NUM_Z_STEPPER_DRIVERS 3 +opt_set MOTHERBOARD BOARD_RADDS Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z3_DRIVER_TYPE A4988 opt_enable USE_XMAX_PLUG USE_YMAX_PLUG ENDSTOPPULLUPS BLTOUCH AUTO_BED_LEVELING_BILINEAR \ Z_STEPPER_AUTO_ALIGN Z_STEPPER_ALIGN_STEPPER_XY Z_SAFE_HOMING pins_set ramps/RAMPS X_MAX_PIN -1 diff --git a/buildroot/tests/SAMD51_grandcentral_m4 b/buildroot/tests/SAMD51_grandcentral_m4 index 92a62c9d37a4..e6e27d8cb8c9 100755 --- a/buildroot/tests/SAMD51_grandcentral_m4 +++ b/buildroot/tests/SAMD51_grandcentral_m4 @@ -16,7 +16,6 @@ opt_set MOTHERBOARD BOARD_AGCM4_RAMPS_144 SERIAL_PORT -1 \ RESTORE_LEVELING_AFTER_G28 false \ LCD_LANGUAGE it \ SDCARD_CONNECTION LCD \ - NUM_Z_STEPPER_DRIVERS 2 \ HOMING_BUMP_MM '{ 0, 0, 0 }' opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_REPEATABILITY_TEST \ FILAMENT_RUNOUT_SENSOR G26_MESH_VALIDATION MESH_EDIT_GFX_OVERLAY Z_SAFE_HOMING \ diff --git a/buildroot/tests/mega1280 b/buildroot/tests/mega1280 index a7f25953acd0..5bf37289ba61 100755 --- a/buildroot/tests/mega1280 +++ b/buildroot/tests/mega1280 @@ -39,7 +39,7 @@ exec_test $1 $2 "(No PWM)" "$3" restore_configs opt_set MOTHERBOARD BOARD_ZRIB_V52 \ LCD_LANGUAGE pt REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 \ - EXTRUDERS 2 TEMP_SENSOR_1 1 + EXTRUDERS 2 TEMP_SENSOR_1 1 X2_DRIVER_TYPE A4988 opt_enable USE_XMAX_PLUG DUAL_X_CARRIAGE REPRAPWORLD_KEYPAD exec_test $1 $2 "ZRIB_V52 | DUAL_X_CARRIAGE" "$3" diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo index e696dce96ec3..f8fef704f1c2 100755 --- a/buildroot/tests/rambo +++ b/buildroot/tests/rambo @@ -51,10 +51,11 @@ opt_set MOTHERBOARD BOARD_RAMBO \ DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ AXIS_RELATIVE_MODES '{ false, false, false }' \ - LEVEL_CORNERS_LEVELING_ORDER '{ LF, RF }' + LEVEL_CORNERS_LEVELING_ORDER '{ LF, RF }' \ + X2_DRIVER_TYPE A4988 Y2_DRIVER_TYPE A4988 opt_enable USE_XMAX_PLUG USE_YMAX_PLUG USE_ZMAX_PLUG \ REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER REVERSE_ENCODER_DIRECTION SDSUPPORT EEPROM_SETTINGS \ - S_CURVE_ACCELERATION X_DUAL_STEPPER_DRIVERS X_DUAL_ENDSTOPS Y_DUAL_STEPPER_DRIVERS Y_DUAL_ENDSTOPS \ + S_CURVE_ACCELERATION X_DUAL_ENDSTOPS Y_DUAL_ENDSTOPS \ ADAPTIVE_STEP_SMOOTHING CNC_COORDINATE_SYSTEMS GCODE_MOTION_MODES \ LEVEL_BED_CORNERS LEVEL_CENTER_TOO opt_disable MIN_SOFTWARE_ENDSTOP_Z MAX_SOFTWARE_ENDSTOPS diff --git a/buildroot/tests/teensy35 b/buildroot/tests/teensy35 index 09e8cee58ef3..64ce4e65505a 100755 --- a/buildroot/tests/teensy35 +++ b/buildroot/tests/teensy35 @@ -101,7 +101,7 @@ exec_test $1 $2 "Teensy 3.5/3.6 COREXZ | BACKLASH" "$3" # Enable Dual Z with Dual Z endstops # restore_configs -opt_set MOTHERBOARD BOARD_TEENSY35_36 NUM_Z_STEPPER_DRIVERS 2 Z2_MIN_PIN 2 +opt_set MOTHERBOARD BOARD_TEENSY35_36 Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z2_MIN_PIN 2 opt_enable Z_MULTI_ENDSTOPS USE_XMAX_PLUG pins_set ramps/RAMPS X_MAX_PIN -1 exec_test $1 $2 "Dual Z with Dual Z endstops" "$3" diff --git a/buildroot/tests/teensy41 b/buildroot/tests/teensy41 index 1affd7c89e12..56bd5043c736 100755 --- a/buildroot/tests/teensy41 +++ b/buildroot/tests/teensy41 @@ -105,7 +105,7 @@ exec_test $1 $2 "Teensy 4.0/4.1 COREXZ" "$3" # Enable Dual Z with Dual Z endstops # restore_configs -opt_set MOTHERBOARD BOARD_TEENSY41 NUM_Z_STEPPER_DRIVERS 2 Z2_MIN_PIN 2 +opt_set MOTHERBOARD BOARD_TEENSY41 Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z2_MIN_PIN 2 opt_enable Z_MULTI_ENDSTOPS USE_XMAX_PLUG pins_set ramps/RAMPS X_MAX_PIN -1 exec_test $1 $2 "Dual Z with Dual Z endstops" "$3" From f3b593ae73b5d21b5c270a5f5ede0fe982822b07 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 31 May 2022 12:43:44 -0500 Subject: [PATCH 362/502] =?UTF-8?q?=F0=9F=8E=A8=20Fix=20spelling,=20whites?= =?UTF-8?q?pace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- Marlin/Makefile | 2 +- Marlin/src/core/boards.h | 2 +- Marlin/src/feature/meatpack.cpp | 2 +- Marlin/src/feature/meatpack.h | 4 ++-- Marlin/src/feature/mmu/mmu2-serial-protocol.md | 2 +- Marlin/src/feature/mmu/mmu2.cpp | 2 +- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/gcode/parser.h | 2 +- Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp | 2 +- Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp | 2 +- Marlin/src/lcd/extui/malyan/malyan.cpp | 2 +- Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp | 6 +++--- Marlin/src/lcd/extui/mks_ui/draw_ui.cpp | 6 +++--- Marlin/src/lcd/extui/mks_ui/pic_manager.h | 2 +- Marlin/src/module/planner.h | 4 ++-- buildroot/share/scripts/g29_auto.py | 10 +++++----- 18 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 4720e4e878be..a61ca947aa7e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -623,7 +623,7 @@ #if ENABLED(PIDTEMP) //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) - // Set/get with gcode: M301 E[extruder number, 0-2] + // Set/get with G-code: M301 E[extruder number, 0-2] #if ENABLED(PID_PARAMS_PER_HOTEND) // Specify up to one value per hotend here, according to your setup. diff --git a/Marlin/Makefile b/Marlin/Makefile index f1c89ff7f520..417c979f8857 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -512,7 +512,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1324) else ifeq ($(HARDWARE_MOTHERBOARD),1325) # Intamsys 4.0 (Funmat HT) else ifeq ($(HARDWARE_MOTHERBOARD),1326) -# Malyan M180 Mainboard Version 2 (no display function, direct gcode only) +# Malyan M180 Mainboard Version 2 (no display function, direct G-code only) else ifeq ($(HARDWARE_MOTHERBOARD),1327) # Geeetech GT2560 Rev B for A20(M/T/D) else ifeq ($(HARDWARE_MOTHERBOARD),1328) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 5b0210d9e4ff..ef750056d6fc 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -161,7 +161,7 @@ #define BOARD_PICA_REVB 1324 // PICA Shield (original version) #define BOARD_PICA 1325 // PICA Shield (rev C or later) #define BOARD_INTAMSYS40 1326 // Intamsys 4.0 (Funmat HT) -#define BOARD_MALYAN_M180 1327 // Malyan M180 Mainboard Version 2 (no display function, direct gcode only) +#define BOARD_MALYAN_M180 1327 // Malyan M180 Mainboard Version 2 (no display function, direct G-code only) #define BOARD_GT2560_V4_A20 1328 // Geeetech GT2560 Rev B for A20(M/T/D) #define BOARD_PROTONEER_CNC_SHIELD_V3 1329 // Mega controller & Protoneer CNC Shield V3.00 #define BOARD_WEEDO_62A 1330 // WEEDO 62A board (TINA2, Monoprice Cadet, etc.) diff --git a/Marlin/src/feature/meatpack.cpp b/Marlin/src/feature/meatpack.cpp index b2899243b2fb..07ff41e5be22 100644 --- a/Marlin/src/feature/meatpack.cpp +++ b/Marlin/src/feature/meatpack.cpp @@ -26,7 +26,7 @@ * Algorithm & Implementation: Scott Mudge - mail@scottmudge.com * Date: Dec. 2020 * - * Character Frequencies from ~30 MB of comment-stripped gcode: + * Character Frequencies from ~30 MB of comment-stripped G-code: * '1' -> 4451136 '4' -> 1353273 '\n' -> 1087683 '-' -> 90242 * '0' -> 4253577 '9' -> 1352147 'G' -> 1075806 'Z' -> 34109 * ' ' -> 3053297 '3' -> 1262929 'X' -> 975742 'M' -> 11879 diff --git a/Marlin/src/feature/meatpack.h b/Marlin/src/feature/meatpack.h index a56e65b6cc30..98a535e5923f 100644 --- a/Marlin/src/feature/meatpack.h +++ b/Marlin/src/feature/meatpack.h @@ -29,7 +29,7 @@ * Specifically optimized for 3D printing G-Code, this is a zero-cost data compression method * which packs ~180-190% more data into the same amount of bytes going to the CNC controller. * As a majority of G-Code can be represented by a restricted alphabet, I performed histogram - * analysis on a wide variety of 3D printing gcode samples, and found ~93% of all gcode could + * analysis on a wide variety of 3D printing G-code samples, and found ~93% of all G-code could * be represented by the same 15-character alphabet. * * This allowed me to design a system of packing 2 8-bit characters into a single byte, assuming @@ -38,7 +38,7 @@ * * Combined with some logic to allow commingling of full-width characters outside of this 15- * character alphabet (at the cost of an extra 8-bits per full-width character), and by stripping - * out unnecessary comments, the end result is gcode which is roughly half the original size. + * out unnecessary comments, the end result is G-code which is roughly half the original size. * * Why did I do this? I noticed micro-stuttering and other data-bottleneck issues while printing * objects with high curvature, especially at high speeds. There is also the issue of the limited diff --git a/Marlin/src/feature/mmu/mmu2-serial-protocol.md b/Marlin/src/feature/mmu/mmu2-serial-protocol.md index 7ff0901742af..93135e406f36 100644 --- a/Marlin/src/feature/mmu/mmu2-serial-protocol.md +++ b/Marlin/src/feature/mmu/mmu2-serial-protocol.md @@ -51,7 +51,7 @@ When done, the MMU sends - MMU => 'ok\n' -We don't wait for a response here but immediately continue with the next gcode which should +We don't wait for a response here but immediately continue with the next G-code which should be one or more extruder moves to feed the filament into the hotend. diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp index 2544995c6d18..a4718b53d9d8 100644 --- a/Marlin/src/feature/mmu/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -939,7 +939,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) { * Load filament to nozzle of multimaterial printer * * This function is used only after T? (user select filament) and M600 (change filament). - * It is not used after T0 .. T4 command (select filament), in such case, gcode is responsible for loading + * It is not used after T0 .. T4 command (select filament), in such case, G-code is responsible for loading * filament to nozzle. */ void MMU2::load_to_nozzle() { diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 70e2f36f2f74..f6e6dda5f87f 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -21,7 +21,7 @@ */ /** - * gcode.cpp - Temporary container for all gcode handlers + * gcode.cpp - Temporary container for all G-code handlers * Most will migrate to classes, by feature. */ diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 772accba5dc0..509c6e219db8 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -110,7 +110,7 @@ * M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT) * M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA) * - * M42 - Change pin status via gcode: M42 P S. LED pin assumed if P is omitted. (Requires DIRECT_PIN_CONTROL) + * M42 - Change pin status via G-code: M42 P S. LED pin assumed if P is omitted. (Requires DIRECT_PIN_CONTROL) * M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins (Requires PINS_DEBUGGING) * M48 - Measure Z Probe repeatability: M48 P X Y V E L S. (Requires Z_MIN_PROBE_REPEATABILITY_TEST) * diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 1487c083ec60..a32999f2d2cb 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -45,7 +45,7 @@ /** * GCode parser * - * - Parse a single gcode line for its letter, code, subcode, and parameters + * - Parse a single G-code line for its letter, code, subcode, and parameters * - FASTER_GCODE_PARSER: * - Flags existing params (1 bit each) * - Stores value offsets (1 byte each) diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp index 7561c89d79bf..285729cc15d2 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp @@ -708,7 +708,7 @@ void ChironTFT::PanelAction(uint8_t req) { // Old TFT A22 X -1F1500 A22 X +1F1500 // New TFT A22 X-1.0 F1500 A22 X1.0 F1500 - // lets just wrap this in a gcode relative nonprint move and let the controller deal with it + // Send a G-code-relative non-print move and let the controller deal with it // G91 G0 G90 if (!isPrinting()) { // Ignore request if printing diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp index 6fa188bf5ff3..0eb95bb041ba 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.cpp @@ -243,7 +243,7 @@ void DGUSDisplay::WritePGM(const char str[], uint8_t len) { } void DGUSDisplay::loop() { - // protect against recursion… ProcessRx() may indirectly call idle() when injecting gcode commands. + // Protect against recursion. ProcessRx() may indirectly call idle() when injecting G-code commands. if (!no_reentrance) { no_reentrance = true; ProcessRx(); diff --git a/Marlin/src/lcd/extui/malyan/malyan.cpp b/Marlin/src/lcd/extui/malyan/malyan.cpp index df7f305df2be..06c9886f0131 100644 --- a/Marlin/src/lcd/extui/malyan/malyan.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan.cpp @@ -24,7 +24,7 @@ * lcd/extui/malyan/malyan.cpp * * LCD implementation for Malyan's LCD, a separate ESP8266 MCU running - * on Serial1 for the M200 board. This module outputs a pseudo-gcode + * on Serial1 for the M200 board. This module outputs a pseudo-G-code * wrapped in curly braces which the LCD implementation translates into * actual G-code commands. * diff --git a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp index 5d6a99191034..0199bc1f555d 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp @@ -369,7 +369,7 @@ uint32_t lv_open_gcode_file(char *path) { card.openFileRead(cur_name); card.read(public_buf, 512); ps4 = (uint32_t *)strstr((char *)public_buf, ";simage:"); - // Ignore the beginning message of gcode file + // Ignore the beginning message of G-code file if (ps4) { pre_sread_cnt = (uintptr_t)ps4 - (uintptr_t)((uint32_t *)(&public_buf[0])); card.setIndex(pre_sread_cnt); @@ -490,7 +490,7 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) { //&& (strIndex2 != 0) && (strIndex1 < strIndex2) ) ? strIndex1 + 1 : tmpFile; - if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not gcode file + if (strIndex2 == 0 || (strIndex1 > strIndex2)) { // not G-code file #if _LFN_UNICODE if (wcslen(beginIndex) > len) wcsncpy(outStr, beginIndex, len); @@ -503,7 +503,7 @@ void cutFileName(char *path, int len, int bytePerLine, char *outStr) { strcpy(outStr, beginIndex); #endif } - else { // gcode file + else { // G-code file if (strIndex2 - beginIndex > (len - 2)) { #if _LFN_UNICODE wcsncpy(outStr, (const WCHAR *)beginIndex, len - 3); diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp index d3f192e44f70..6a8333fd66df 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp @@ -159,7 +159,7 @@ void gCfgItems_init() { gCfgItems.spi_flash_flag = FLASH_INF_VALID_FLAG; W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); - // init gcode command + // Init G-code command W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&custom_gcode_command[0], AUTO_LEVELING_COMMAND_ADDR, 100); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&custom_gcode_command[1], OTHERS_COMMAND_ADDR_1, 100); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&custom_gcode_command[2], OTHERS_COMMAND_ADDR_2, 100); @@ -238,7 +238,7 @@ void update_spi_flash() { uint8_t command_buf[512]; W25QXX.init(SPI_QUARTER_SPEED); - // read back the gcode command before erase spi flash + // read back the G-code command before erase spi flash W25QXX.SPI_FLASH_BufferRead((uint8_t *)&command_buf, GCODE_COMMAND_ADDR, sizeof(command_buf)); W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); @@ -249,7 +249,7 @@ void update_gcode_command(int addr, uint8_t *s) { uint8_t command_buf[512]; W25QXX.init(SPI_QUARTER_SPEED); - // read back the gcode command before erase spi flash + // read back the G-code command before erase spi flash W25QXX.SPI_FLASH_BufferRead((uint8_t *)&command_buf, GCODE_COMMAND_ADDR, sizeof(command_buf)); W25QXX.SPI_FLASH_SectorErase(VAR_INF_ADDR); W25QXX.SPI_FLASH_BufferWrite((uint8_t *)&gCfgItems, VAR_INF_ADDR, sizeof(gCfgItems)); diff --git a/Marlin/src/lcd/extui/mks_ui/pic_manager.h b/Marlin/src/lcd/extui/mks_ui/pic_manager.h index 320cb20b0b8d..cdcc5b76b8a9 100644 --- a/Marlin/src/lcd/extui/mks_ui/pic_manager.h +++ b/Marlin/src/lcd/extui/mks_ui/pic_manager.h @@ -122,7 +122,7 @@ #define VAR_INF_ADDR 0x000000 #define FLASH_INF_VALID_FLAG 0x20201118 -// Store some gcode commands, such as auto leveling commands +// Store some G-code commands, such as auto-leveling commands #define GCODE_COMMAND_ADDR VAR_INF_ADDR + 3 * 1024 #define AUTO_LEVELING_COMMAND_ADDR GCODE_COMMAND_ADDR #define OTHERS_COMMAND_ADDR_1 AUTO_LEVELING_COMMAND_ADDR + 100 diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index c450418a5c7a..1af5ccc8106a 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -162,7 +162,7 @@ enum BlockFlag : char { * A single entry in the planner buffer. * Tracks linear movement over multiple axes. * - * The "nominal" values are as-specified by gcode, and + * The "nominal" values are as-specified by G-code, and * may never actually be reached due to acceleration limits. */ typedef struct block_t { @@ -411,7 +411,7 @@ class Planner { /** * The current position of the tool in absolute steps - * Recalculated if any axis_steps_per_mm are changed by gcode + * Recalculated if any axis_steps_per_mm are changed by G-code */ static xyze_long_t position; diff --git a/buildroot/share/scripts/g29_auto.py b/buildroot/share/scripts/g29_auto.py index ca36346dd9dd..5cf27b996865 100755 --- a/buildroot/share/scripts/g29_auto.py +++ b/buildroot/share/scripts/g29_auto.py @@ -1,13 +1,13 @@ #!/usr/bin/env python -# This file is for preprocessing gcode and the new G29 Autobedleveling from Marlin -# It will analyse the first 2 Layer and return the maximum size for this part -# After this it will replace with g29_keyword = ';MarlinG29Script' with the new G29 LRFB -# the new file will be created in the same folder. +# This file is for preprocessing G-code and the new G29 Auto bed leveling from Marlin +# It will analyze the first 2 layers and return the maximum size for this part +# Then it will be replaced with g29_keyword = ';MarlinG29Script' with the new G29 LRFB. +# The new file will be created in the same folder. from __future__ import print_function -# your gcode-file/folder +# Your G-code file/folder folder = './' my_file = 'test.gcode' From d7a71beaf4f08e60c3d13049f1046bbb663c643d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Jun 2022 18:16:43 -0500 Subject: [PATCH 363/502] =?UTF-8?q?=F0=9F=94=A7=20LEVEL=5FBED=5FCORNERS=20?= =?UTF-8?q?=3D>=20LCD=5FBED=5FTRAMMING?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 26 +++--- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/inc/SanityCheck.h | 32 ++++--- .../lcd/extui/dgus_reloaded/DGUSRxHandler.cpp | 8 +- .../dgus_reloaded/config/DGUS_Constants.h | 10 +-- Marlin/src/lcd/menu/menu.cpp | 2 +- Marlin/src/lcd/menu/menu.h | 4 +- Marlin/src/lcd/menu/menu_bed_corners.cpp | 90 +++++++++---------- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 2 +- Marlin/src/lcd/menu/menu_item.h | 2 +- Marlin/src/lcd/menu/menu_motion.cpp | 2 +- .../PlatformIO/scripts/common-dependencies.h | 2 +- .../tests/BIGTREE_GTR_V1_0_usb_flash_drive | 2 +- buildroot/tests/LPC1769 | 2 +- buildroot/tests/rambo | 6 +- 15 files changed, 99 insertions(+), 93 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index a61ca947aa7e..5ff646e2688e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1735,18 +1735,18 @@ #endif // Add a menu item to move between bed corners for manual bed adjustment -//#define LEVEL_BED_CORNERS - -#if ENABLED(LEVEL_BED_CORNERS) - #define LEVEL_CORNERS_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets - #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points - #define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points - //#define LEVEL_CENTER_TOO // Move to the center after the last corner - //#define LEVEL_CORNERS_USE_PROBE - #if ENABLED(LEVEL_CORNERS_USE_PROBE) - #define LEVEL_CORNERS_PROBE_TOLERANCE 0.1 - #define LEVEL_CORNERS_VERIFY_RAISED // After adjustment triggers the probe, re-probe to verify - //#define LEVEL_CORNERS_AUDIO_FEEDBACK +//#define LCD_BED_TRAMMING + +#if ENABLED(LCD_BED_TRAMMING) + #define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets + #define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points + #define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points + //#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner + //#define BED_TRAMMING_USE_PROBE + #if ENABLED(BED_TRAMMING_USE_PROBE) + #define BED_TRAMMING_PROBE_TOLERANCE 0.1 // (mm) + #define BED_TRAMMING_VERIFY_RAISED // After adjustment triggers the probe, re-probe to verify + //#define BED_TRAMMING_AUDIO_FEEDBACK #endif /** @@ -1766,7 +1766,7 @@ * | 1 2 | | 1 4 | | 1 2 | | 2 | * LF --------- RF LF --------- RF LF --------- RF LF --------- RF */ - #define LEVEL_CORNERS_LEVELING_ORDER { LF, RF, RB, LB } + #define BED_TRAMMING_LEVELING_ORDER { LF, RF, RB, LB } #endif /** diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 9f75a2f3a809..95edb81fccec 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -205,7 +205,7 @@ * No adjustable bed on non-cartesians */ #if IS_KINEMATIC - #undef LEVEL_BED_CORNERS + #undef LCD_BED_TRAMMING #endif /** diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 21ebadcebc30..28913492a4a3 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -371,7 +371,7 @@ #elif defined(FILAMENT_CHANGE_LOAD_LENGTH) #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH." #elif defined(LEVEL_CORNERS_INSET) - #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB." + #error "LEVEL_CORNERS_INSET is now BED_TRAMMING_INSET_LFRB." #elif defined(BEZIER_JERK_CONTROL) #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION." #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR) @@ -625,6 +625,12 @@ #error "Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed." #elif defined(NUM_Z_STEPPER_DRIVERS) #error "NUM_Z_STEPPER_DRIVERS is no longer needed and should be removed." +#elif defined(LEVEL_BED_CORNERS) + #error "LEVEL_BED_CORNERS is now LCD_BED_TRAMMING." +#elif defined(LEVEL_CORNERS_INSET_LFRB) || defined(LEVEL_CORNERS_HEIGHT) || defined(LEVEL_CORNERS_Z_HOP) || defined(LEVEL_CORNERS_USE_PROBE) || defined(LEVEL_CORNERS_PROBE_TOLERANCE) || defined(LEVEL_CORNERS_VERIFY_RAISED) || defined(LEVEL_CORNERS_AUDIO_FEEDBACK) + #error "LEVEL_CORNERS_* settings have been renamed BED_TRAMMING_*." +#elif defined(LEVEL_CENTER_TOO) + #error "LEVEL_CENTER_TOO is now BED_TRAMMING_INCLUDE_CENTER." #endif constexpr float arm[] = AXIS_RELATIVE_MODES; @@ -1765,14 +1771,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif -#if ENABLED(LEVEL_BED_CORNERS) - #ifndef LEVEL_CORNERS_INSET_LFRB - #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values." - #elif ENABLED(LEVEL_CORNERS_USE_PROBE) +#if ENABLED(LCD_BED_TRAMMING) + #ifndef BED_TRAMMING_INSET_LFRB + #error "LCD_BED_TRAMMING requires BED_TRAMMING_INSET_LFRB values." + #elif ENABLED(BED_TRAMMING_USE_PROBE) #if !HAS_BED_PROBE - #error "LEVEL_CORNERS_USE_PROBE requires a real probe." + #error "BED_TRAMMING_USE_PROBE requires a real probe." #elif ENABLED(SENSORLESS_PROBING) - #error "LEVEL_CORNERS_USE_PROBE is incompatible with SENSORLESS_PROBING." + #error "BED_TRAMMING_USE_PROBE is incompatible with SENSORLESS_PROBING." #endif #endif #endif @@ -2858,8 +2864,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "DWIN_CREALITY_LCD does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU." #elif EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU) #error "DWIN_CREALITY_LCD does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU." - #elif ENABLED(LEVEL_BED_CORNERS) - #error "DWIN_CREALITY_LCD does not support LEVEL_BED_CORNERS." + #elif ENABLED(LCD_BED_TRAMMING) + #error "DWIN_CREALITY_LCD does not support LCD_BED_TRAMMING." #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) #error "DWIN_CREALITY_LCD does not support LCD_BED_LEVELING with PROBE_MANUALLY." #endif @@ -2870,8 +2876,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "DWIN_LCD_PROUI does not support PID_EDIT_MENU or PID_AUTOTUNE_MENU." #elif EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU) #error "DWIN_LCD_PROUI does not support MPC_EDIT_MENU or MPC_AUTOTUNE_MENU." - #elif ENABLED(LEVEL_BED_CORNERS) - #error "DWIN_LCD_PROUI does not support LEVEL_BED_CORNERS." + #elif ENABLED(LCD_BED_TRAMMING) + #error "DWIN_LCD_PROUI does not support LCD_BED_TRAMMING." #elif BOTH(LCD_BED_LEVELING, PROBE_MANUALLY) #error "DWIN_LCD_PROUI does not support LCD_BED_LEVELING with PROBE_MANUALLY." #endif @@ -3925,8 +3931,8 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "DGUS_LCD_UI_RELOADED requires a bed probe." #elif !HAS_MESH #error "DGUS_LCD_UI_RELOADED requires mesh leveling." - #elif DISABLED(LEVEL_BED_CORNERS) - #error "DGUS_LCD_UI_RELOADED requires LEVEL_BED_CORNERS." + #elif DISABLED(LCD_BED_TRAMMING) + #error "DGUS_LCD_UI_RELOADED requires LCD_BED_TRAMMING." #elif DISABLED(BABYSTEP_ALWAYS_AVAILABLE) #error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ALWAYS_AVAILABLE." #elif DISABLED(BABYSTEP_ZPROBE_OFFSET) diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index cf95bb1d761d..cef9c772e9df 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -466,7 +466,7 @@ void DGUSRxHandler::MoveToPoint(DGUS_VP &vp, void *data_ptr) { } const uint8_t point = ((uint8_t*)data_ptr)[1]; - constexpr float lfrb[4] = LEVEL_CORNERS_INSET_LFRB; + constexpr float lfrb[4] = BED_TRAMMING_INSET_LFRB; float x, y; switch (point) { @@ -493,12 +493,12 @@ void DGUSRxHandler::MoveToPoint(DGUS_VP &vp, void *data_ptr) { break; } - if (ExtUI::getAxisPosition_mm(ExtUI::Z) < Z_MIN_POS + LEVEL_CORNERS_Z_HOP) { - ExtUI::setAxisPosition_mm(Z_MIN_POS + LEVEL_CORNERS_Z_HOP, ExtUI::Z); + if (ExtUI::getAxisPosition_mm(ExtUI::Z) < Z_MIN_POS + BED_TRAMMING_Z_HOP) { + ExtUI::setAxisPosition_mm(Z_MIN_POS + BED_TRAMMING_Z_HOP, ExtUI::Z); } ExtUI::setAxisPosition_mm(x, ExtUI::X); ExtUI::setAxisPosition_mm(y, ExtUI::Y); - ExtUI::setAxisPosition_mm(Z_MIN_POS + LEVEL_CORNERS_HEIGHT, ExtUI::Z); + ExtUI::setAxisPosition_mm(Z_MIN_POS + BED_TRAMMING_HEIGHT, ExtUI::Z); } void DGUSRxHandler::Probe(DGUS_VP &vp, void *data_ptr) { diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h index 9b275fb2f550..846fd1594216 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h @@ -71,15 +71,15 @@ static_assert((DGUS_LEVEL_GRID_SIZE == GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y), " #define DGUS_DEFAULT_FILAMENT_LEN 10 #endif -#ifndef LEVEL_CORNERS_Z_HOP - #define LEVEL_CORNERS_Z_HOP 4.0 +#ifndef BED_TRAMMING_Z_HOP + #define BED_TRAMMING_Z_HOP 4.0 #endif -#ifndef LEVEL_CORNERS_HEIGHT - #define LEVEL_CORNERS_HEIGHT 0.0 +#ifndef BED_TRAMMING_HEIGHT + #define BED_TRAMMING_HEIGHT 0.0 #endif -static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration."); +static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0. Please update your configuration."); #ifndef DGUS_LEVEL_CENTER_X #define DGUS_LEVEL_CENTER_X ((X_BED_SIZE) / 2) diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 4dc1105f78b9..a1e2beaf72d0 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -47,7 +47,7 @@ ///////////// Global Variables ///////////// //////////////////////////////////////////// -#if HAS_LEVELING && ANY(LEVEL_BED_CORNERS, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION) +#if HAS_LEVELING && ANY(LCD_BED_TRAMMING, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION) bool leveling_was_active; // = false #endif #if ANY(PROBE_MANUALLY, MESH_BED_LEVELING, X_AXIS_TWIST_COMPENSATION) diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 2dd6315ad97d..3e88f68690a6 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -213,7 +213,7 @@ void menu_move(); void lcd_move_z(); void _lcd_draw_homing(); -#define HAS_LINE_TO_Z ANY(DELTA, PROBE_MANUALLY, MESH_BED_LEVELING, LEVEL_BED_CORNERS) +#define HAS_LINE_TO_Z ANY(DELTA, PROBE_MANUALLY, MESH_BED_LEVELING, LCD_BED_TRAMMING) #if HAS_LINE_TO_Z void line_to_z(const_float_t z); @@ -260,7 +260,7 @@ inline void clear_menu_history() { screen_history_depth = 0; } #define STICKY_SCREEN(S) []{ ui.defer_status_screen(); ui.goto_screen(S); } -#if HAS_LEVELING && ANY(LEVEL_BED_CORNERS, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION) +#if HAS_LEVELING && ANY(LCD_BED_TRAMMING, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION) extern bool leveling_was_active; #endif diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index c820ff15e7ee..3fe0c582cb10 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if BOTH(HAS_MARLINUI_MENU, LEVEL_BED_CORNERS) +#if BOTH(HAS_MARLINUI_MENU, LCD_BED_TRAMMING) #include "menu_item.h" #include "../../module/motion.h" @@ -36,21 +36,21 @@ #include "../../feature/bedlevel/bedlevel.h" #endif -#ifndef LEVEL_CORNERS_Z_HOP - #define LEVEL_CORNERS_Z_HOP 4.0 +#ifndef BED_TRAMMING_Z_HOP + #define BED_TRAMMING_Z_HOP 4.0 #endif -#ifndef LEVEL_CORNERS_HEIGHT - #define LEVEL_CORNERS_HEIGHT 0.0 +#ifndef BED_TRAMMING_HEIGHT + #define BED_TRAMMING_HEIGHT 0.0 #endif -#if ENABLED(LEVEL_CORNERS_USE_PROBE) +#if ENABLED(BED_TRAMMING_USE_PROBE) #include "../../module/probe.h" #include "../../module/endstops.h" #if ENABLED(BLTOUCH) #include "../../feature/bltouch.h" #endif - #ifndef LEVEL_CORNERS_PROBE_TOLERANCE - #define LEVEL_CORNERS_PROBE_TOLERANCE 0.2 + #ifndef BED_TRAMMING_PROBE_TOLERANCE + #define BED_TRAMMING_PROBE_TOLERANCE 0.2 #endif float last_z; int good_points; @@ -64,32 +64,32 @@ #endif -static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration."); +static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0. Please update your configuration."); -#ifndef LEVEL_CORNERS_LEVELING_ORDER - #define LEVEL_CORNERS_LEVELING_ORDER { LF, RF, LB, RB } // Default - //#define LEVEL_CORNERS_LEVELING_ORDER { LF, LB, RF } // 3 hard-coded points - //#define LEVEL_CORNERS_LEVELING_ORDER { LF, RF } // 3-Point tramming - Rear - //#define LEVEL_CORNERS_LEVELING_ORDER { LF, LB } // 3-Point tramming - Right - //#define LEVEL_CORNERS_LEVELING_ORDER { RF, RB } // 3-Point tramming - Left - //#define LEVEL_CORNERS_LEVELING_ORDER { LB, RB } // 3-Point tramming - Front +#ifndef BED_TRAMMING_LEVELING_ORDER + #define BED_TRAMMING_LEVELING_ORDER { LF, RF, LB, RB } // Default + //#define BED_TRAMMING_LEVELING_ORDER { LF, LB, RF } // 3 hard-coded points + //#define BED_TRAMMING_LEVELING_ORDER { LF, RF } // 3-Point tramming - Rear + //#define BED_TRAMMING_LEVELING_ORDER { LF, LB } // 3-Point tramming - Right + //#define BED_TRAMMING_LEVELING_ORDER { RF, RB } // 3-Point tramming - Left + //#define BED_TRAMMING_LEVELING_ORDER { LB, RB } // 3-Point tramming - Front #endif #define LF 1 #define RF 2 #define RB 3 #define LB 4 -constexpr int lco[] = LEVEL_CORNERS_LEVELING_ORDER; +constexpr int lco[] = BED_TRAMMING_LEVELING_ORDER; constexpr bool level_corners_3_points = COUNT(lco) == 2; -static_assert(level_corners_3_points || COUNT(lco) == 4, "LEVEL_CORNERS_LEVELING_ORDER must have exactly 2 or 4 corners."); +static_assert(level_corners_3_points || COUNT(lco) == 4, "BED_TRAMMING_LEVELING_ORDER must have exactly 2 or 4 corners."); constexpr int lcodiff = ABS(lco[0] - lco[1]); -static_assert(COUNT(lco) == 4 || lcodiff == 1 || lcodiff == 3, "The first two LEVEL_CORNERS_LEVELING_ORDER corners must be on the same edge."); +static_assert(COUNT(lco) == 4 || lcodiff == 1 || lcodiff == 3, "The first two BED_TRAMMING_LEVELING_ORDER corners must be on the same edge."); constexpr int nr_edge_points = level_corners_3_points ? 3 : 4; -constexpr int available_points = nr_edge_points + ENABLED(LEVEL_CENTER_TOO); -constexpr int center_index = TERN(LEVEL_CENTER_TOO, available_points - 1, -1); -constexpr float inset_lfrb[4] = LEVEL_CORNERS_INSET_LFRB; +constexpr int available_points = nr_edge_points + ENABLED(BED_TRAMMING_INCLUDE_CENTER); +constexpr int center_index = TERN(BED_TRAMMING_INCLUDE_CENTER, available_points - 1, -1); +constexpr float inset_lfrb[4] = BED_TRAMMING_INSET_LFRB; constexpr xy_pos_t lf { (X_MIN_BED) + inset_lfrb[0], (Y_MIN_BED) + inset_lfrb[1] }, rb { (X_MAX_BED) - inset_lfrb[2], (Y_MAX_BED) - inset_lfrb[3] }; @@ -120,12 +120,12 @@ static void _lcd_level_bed_corners_get_next_position() { if ((lco[0] == LF && lco[1] == LB) || (lco[0] == LB && lco[1] == LF)) current_position.x = rb.x; // Center Right if ((lco[0] == RF && lco[1] == RB) || (lco[0] == RB && lco[1] == RF)) current_position.x = lf.x; // Left Center if ((lco[0] == LF && lco[1] == RF) || (lco[0] == RF && lco[1] == LF)) current_position.y = rb.y; // Center Back - #if DISABLED(LEVEL_CENTER_TOO) && ENABLED(LEVEL_CORNERS_USE_PROBE) + #if DISABLED(BED_TRAMMING_INCLUDE_CENTER) && ENABLED(BED_TRAMMING_USE_PROBE) bed_corner++; // Must increment the count to ensure it resets the loop if the 3rd point is out of tolerance #endif break; - #if ENABLED(LEVEL_CENTER_TOO) + #if ENABLED(BED_TRAMMING_INCLUDE_CENTER) case 3: current_position.set(X_CENTER, Y_CENTER); break; @@ -134,9 +134,9 @@ static void _lcd_level_bed_corners_get_next_position() { } else { // Four-Corner Bed Tramming with optional center - if (TERN0(LEVEL_CENTER_TOO, bed_corner == center_index)) { + if (TERN0(BED_TRAMMING_INCLUDE_CENTER, bed_corner == center_index)) { current_position.set(X_CENTER, Y_CENTER); - TERN_(LEVEL_CORNERS_USE_PROBE, good_points--); // Decrement to allow one additional probe point + TERN_(BED_TRAMMING_USE_PROBE, good_points--); // Decrement to allow one additional probe point } else { current_position = lf; // Left front @@ -152,10 +152,10 @@ static void _lcd_level_bed_corners_get_next_position() { /** * Level corners, starting in the front-left corner. */ -#if ENABLED(LEVEL_CORNERS_USE_PROBE) +#if ENABLED(BED_TRAMMING_USE_PROBE) #define VALIDATE_POINT(X, Y, STR) static_assert(Probe::build_time::can_reach((X), (Y)), \ - "LEVEL_CORNERS_INSET_LFRB " STR " inset is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.") + "BED_TRAMMING_INSET_LFRB " STR " inset is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.") VALIDATE_POINT(lf.x, Y_CENTER, "left"); VALIDATE_POINT(X_CENTER, lf.y, "front"); VALIDATE_POINT(rb.x, Y_CENTER, "right"); VALIDATE_POINT(X_CENTER, rb.y, "back"); @@ -216,16 +216,16 @@ static void _lcd_level_bed_corners_get_next_position() { } bool _lcd_level_bed_corners_probe(bool verify=false) { - if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed + if (verify) do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP); // do clearance if needed TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action - do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance + do_blocking_move_to_z(last_z - BED_TRAMMING_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered endstops.hit_on_purpose(); set_current_from_steppers_for_axis(Z_AXIS); sync_plan_position(); TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); // Stow in LOW SPEED MODE on every trigger // Triggered outside tolerance range? - if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) { + if (ABS(current_position.z - last_z) > BED_TRAMMING_PROBE_TOLERANCE) { last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners. good_points = 0; // ...and start over } @@ -245,7 +245,7 @@ static void _lcd_level_bed_corners_get_next_position() { probe_triggered = PROBE_TRIGGERED(); if (probe_triggered) { endstops.hit_on_purpose(); - TERN_(LEVEL_CORNERS_AUDIO_FEEDBACK, BUZZ(200, 600)); + TERN_(BED_TRAMMING_AUDIO_FEEDBACK, BUZZ(200, 600)); } idle(); } @@ -255,8 +255,8 @@ static void _lcd_level_bed_corners_get_next_position() { } void _lcd_test_corners() { - bed_corner = TERN(LEVEL_CENTER_TOO, center_index, 0); - last_z = LEVEL_CORNERS_HEIGHT; + bed_corner = TERN(BED_TRAMMING_INCLUDE_CENTER, center_index, 0); + last_z = BED_TRAMMING_HEIGHT; endstops.enable_z_probe(true); good_points = 0; ui.goto_screen(_lcd_draw_probing); @@ -264,7 +264,7 @@ static void _lcd_level_bed_corners_get_next_position() { ui.refresh(LCDVIEW_REDRAW_NOW); _lcd_draw_probing(); // update screen with # of good points - do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance + do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance _lcd_level_bed_corners_get_next_position(); // Select next corner coordinates current_position -= probe.offset_xy; // Account for probe offsets @@ -273,7 +273,7 @@ static void _lcd_level_bed_corners_get_next_position() { TERN_(BLTOUCH, if (bltouch.high_speed_mode) bltouch.deploy()); // Deploy in HIGH SPEED MODE if (!_lcd_level_bed_corners_probe()) { // Probe down to tolerance if (_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed - #if ENABLED(LEVEL_CORNERS_VERIFY_RAISED) // Verify + #if ENABLED(BED_TRAMMING_VERIFY_RAISED) // Verify while (!_lcd_level_bed_corners_probe(true)) { // Loop while corner verified if (!_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed if (corner_probing_done) return; // Done was selected @@ -294,7 +294,7 @@ static void _lcd_level_bed_corners_get_next_position() { #if ENABLED(BLTOUCH) if (bltouch.high_speed_mode) { // In HIGH SPEED MODE do clearance and stow at the very end - do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); + do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP); bltouch.stow(); } #endif @@ -303,25 +303,25 @@ static void _lcd_level_bed_corners_get_next_position() { ui.set_selection(true); } -#else // !LEVEL_CORNERS_USE_PROBE +#else // !BED_TRAMMING_USE_PROBE static void _lcd_goto_next_corner() { - line_to_z(LEVEL_CORNERS_Z_HOP); + line_to_z(BED_TRAMMING_Z_HOP); // Select next corner coordinates _lcd_level_bed_corners_get_next_position(); line_to_current_position(manual_feedrate_mm_s.x); - line_to_z(LEVEL_CORNERS_HEIGHT); + line_to_z(BED_TRAMMING_HEIGHT); if (++bed_corner >= available_points) bed_corner = 0; } -#endif // !LEVEL_CORNERS_USE_PROBE +#endif // !BED_TRAMMING_USE_PROBE static void _lcd_level_bed_corners_homing() { _lcd_draw_homing(); if (!all_axes_homed()) return; - #if ENABLED(LEVEL_CORNERS_USE_PROBE) + #if ENABLED(BED_TRAMMING_USE_PROBE) _lcd_test_corners(); if (corner_probing_done) ui.goto_previous_screen_no_defer(); TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); @@ -333,11 +333,11 @@ static void _lcd_level_bed_corners_homing() { GET_TEXT_F(MSG_BUTTON_NEXT), GET_TEXT_F(MSG_BUTTON_DONE) , _lcd_goto_next_corner , []{ - line_to_z(LEVEL_CORNERS_Z_HOP); // Raise Z off the bed when done + line_to_z(BED_TRAMMING_Z_HOP); // Raise Z off the bed when done TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active)); ui.goto_previous_screen_no_defer(); } - , GET_TEXT_F(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER)) + , GET_TEXT_F(TERN(BED_TRAMMING_INCLUDE_CENTER, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER)) , (const char*)nullptr, F("?") ); }); @@ -362,4 +362,4 @@ void _lcd_level_bed_corners() { ui.goto_screen(_lcd_level_bed_corners_homing); } -#endif // HAS_MARLINUI_MENU && LEVEL_BED_CORNERS +#endif // HAS_MARLINUI_MENU && LCD_BED_TRAMMING diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 142da1696af8..294666e35621 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -290,7 +290,7 @@ void menu_bed_leveling() { EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif - #if ENABLED(LEVEL_BED_CORNERS) + #if ENABLED(LCD_BED_TRAMMING) SUBMENU(MSG_BED_TRAMMING, _lcd_level_bed_corners); #endif diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 53cf7c321ea5..b48eaf9bae06 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -528,7 +528,7 @@ class MenuItem_bool : public MenuEditItemBase { #define YESNO_ITEM_N_F(N,FLABEL, V...) CONFIRM_ITEM_N_F(N, FLABEL, MSG_YES, MSG_NO, ##V) #define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V) -#if ENABLED(LEVEL_BED_CORNERS) +#if ENABLED(LCD_BED_TRAMMING) void _lcd_level_bed_corners(); #endif diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index e5d027f21532..96f632508041 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -450,7 +450,7 @@ void menu_motion() { #endif - #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING) + #if ENABLED(LCD_BED_TRAMMING) && DISABLED(LCD_BED_LEVELING) SUBMENU(MSG_BED_TRAMMING, _lcd_level_bed_corners); #endif diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h index 4aa97c41ad69..da2d380a82b6 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.h +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h @@ -53,7 +53,7 @@ #if ENABLED(BACKLASH_GCODE) #define HAS_MENU_BACKLASH #endif - #if ENABLED(LEVEL_BED_CORNERS) + #if ENABLED(LCD_BED_TRAMMING) #define HAS_MENU_BED_CORNERS #endif #if ENABLED(CANCEL_OBJECTS) diff --git a/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive b/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive index 34bf77be27a4..78aec1329558 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive +++ b/buildroot/tests/BIGTREE_GTR_V1_0_usb_flash_drive @@ -10,7 +10,7 @@ restore_configs opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT 3 \ EXTRUDERS 8 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 TEMP_SENSOR_5 1 TEMP_SENSOR_6 1 TEMP_SENSOR_7 1 opt_enable SDSUPPORT USB_FLASH_DRIVE_SUPPORT USE_OTG_USB_HOST \ - REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH LEVEL_BED_CORNERS LEVEL_CORNERS_USE_PROBE \ + REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH LCD_BED_TRAMMING BED_TRAMMING_USE_PROBE \ NEOPIXEL_LED Z_SAFE_HOMING FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE # Not necessary to enable auto-fan for all extruders to hit problematic code paths opt_set E0_AUTO_FAN_PIN PC10 E1_AUTO_FAN_PIN PC11 E2_AUTO_FAN_PIN PC12 NEOPIXEL_PIN PF13 \ diff --git a/buildroot/tests/LPC1769 b/buildroot/tests/LPC1769 index 3fe99734ca6b..086dffffc92c 100755 --- a/buildroot/tests/LPC1769 +++ b/buildroot/tests/LPC1769 @@ -21,7 +21,7 @@ opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD \ 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 \ + BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BED_TRAMMING_USE_PROBE BED_TRAMMING_VERIFY_RAISED \ PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo index f8fef704f1c2..167f6d89aae2 100755 --- a/buildroot/tests/rambo +++ b/buildroot/tests/rambo @@ -24,7 +24,7 @@ opt_enable USE_ZMAX_PLUG REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_P BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ NEOPIXEL_LED NEOPIXEL_PIN CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \ PID_PARAMS_PER_HOTEND PID_AUTOTUNE_MENU PID_EDIT_MENU LCD_SHOW_E_TOTAL \ - PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LEVEL_BED_CORNERS LEVEL_CENTER_TOO \ + PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LCD_BED_TRAMMING BED_TRAMMING_INCLUDE_CENTER \ NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM \ ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES FILAMENT_UNLOAD_ALL_EXTRUDERS \ PASSWORD_FEATURE PASSWORD_ON_STARTUP PASSWORD_ON_SD_PRINT_MENU PASSWORD_AFTER_SD_PRINT_END PASSWORD_AFTER_SD_PRINT_ABORT \ @@ -51,13 +51,13 @@ opt_set MOTHERBOARD BOARD_RAMBO \ DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \ MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \ AXIS_RELATIVE_MODES '{ false, false, false }' \ - LEVEL_CORNERS_LEVELING_ORDER '{ LF, RF }' \ + BED_TRAMMING_LEVELING_ORDER '{ LF, RF }' \ X2_DRIVER_TYPE A4988 Y2_DRIVER_TYPE A4988 opt_enable USE_XMAX_PLUG USE_YMAX_PLUG USE_ZMAX_PLUG \ REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER REVERSE_ENCODER_DIRECTION SDSUPPORT EEPROM_SETTINGS \ S_CURVE_ACCELERATION X_DUAL_ENDSTOPS Y_DUAL_ENDSTOPS \ ADAPTIVE_STEP_SMOOTHING CNC_COORDINATE_SYSTEMS GCODE_MOTION_MODES \ - LEVEL_BED_CORNERS LEVEL_CENTER_TOO + LCD_BED_TRAMMING BED_TRAMMING_INCLUDE_CENTER opt_disable MIN_SOFTWARE_ENDSTOP_Z MAX_SOFTWARE_ENDSTOPS exec_test $1 $2 "Rambo CNC Configuration" "$3" From 40d96c3460117eeab1742d74c2d78b57b4a9a1b6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Jun 2022 20:26:40 -0500 Subject: [PATCH 364/502] =?UTF-8?q?=F0=9F=91=94=20Remove=20actions=20from?= =?UTF-8?q?=20misc.=20branch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yml | 168 --------------------- .github/ISSUE_TEMPLATE/config.yml | 20 --- .github/ISSUE_TEMPLATE/feature_request.yml | 44 ------ .github/lock.yml | 40 ----- .github/workflows/bump-date.yml | 39 ----- .github/workflows/check-pr.yml | 33 ---- .github/workflows/clean-closed.yml | 39 ----- .github/workflows/close-stale.yml | 28 ---- .github/workflows/lock-closed.yml | 32 ---- .github/workflows/test-builds.yml | 147 ------------------ .github/workflows/unlock-reopened.yml | 22 --- 11 files changed, 612 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml delete mode 100644 .github/lock.yml delete mode 100644 .github/workflows/bump-date.yml delete mode 100644 .github/workflows/check-pr.yml delete mode 100644 .github/workflows/clean-closed.yml delete mode 100644 .github/workflows/close-stale.yml delete mode 100644 .github/workflows/lock-closed.yml delete mode 100644 .github/workflows/test-builds.yml delete mode 100644 .github/workflows/unlock-reopened.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index d4dc730a5744..000000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,168 +0,0 @@ -name: 🪲 Report a bug -description: Create a bug report to help improve Marlin Firmware -title: "[BUG] (bug summary)" -body: - - type: markdown - attributes: - value: > - Do you want to ask a question? Are you looking for support? Please use one of the [support links](https://github.com/MarlinFirmware/Marlin/issues/new/choose). - - - type: markdown - attributes: - value: | - **Thank you for reporting a bug in Marlin Firmware!** - - ## Before Reporting a Bug - - - Read and understand Marlin's [Code of Conduct](https://github.com/MarlinFirmware/Marlin/blob/2.0.x/.github/code_of_conduct.md). You are expected to comply with it, including treating everyone with respect. - - - Test with the [`bugfix-2.0.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.0.x.zip) to see whether the issue still exists. - - ## Instructions - - Please follow the instructions below. Failure to do so may result in your issue being closed. See [Contributing to Marlin](https://github.com/MarlinFirmware/Marlin/blob/2.0.x/.github/contributing.md) for additional guidelines. - - 1. Provide a good title starting with [BUG]. - 2. Fill out all sections of this bug report form. - 3. Always attach configuration files so we can build and test your setup. - - - type: dropdown - attributes: - label: Did you test the latest `bugfix-2.0.x` code? - description: >- - Always try the latest code to make sure the issue you are reporting is not already fixed. To download - the latest code just [click this link](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.0.x.zip). - options: - - Yes, and the problem still exists. - - No, but I will test it now! - validations: - required: true - - - type: markdown - attributes: - value: | - # Bug Details - - - type: textarea - attributes: - label: Bug Description - description: >- - Describe the bug in this section. Tell us what you were trying to do and what - happened that you did not expect. Provide a clear and concise description of the - problem and include as many details as possible. - - When pasting formatted text don't forget to put ` ``` ` (on its own line) before and after to make it readable. - placeholder: | - Marlin doesn't work. - validations: - required: true - - - type: input - attributes: - label: Bug Timeline - description: Is this a new bug or an old issue? When did it first start? - - - type: textarea - attributes: - label: Expected behavior - description: >- - What did you expect to happen? - placeholder: I expected it to move left. - - - type: textarea - attributes: - label: Actual behavior - description: What actually happened instead? - placeholder: It moved right instead of left. - - - type: textarea - attributes: - label: Steps to Reproduce - description: >- - Please describe the steps needed to reproduce the issue. - placeholder: | - 1. [First Step] ... - 2. [Second Step] ... - 3. [and so on] ... - - - type: markdown - attributes: - value: | - # Your Setup - - - type: input - attributes: - label: Version of Marlin Firmware - description: "See the About Menu on the LCD or the output of `M115`. NOTE: For older releases we only patch critical bugs." - validations: - required: true - - - type: input - attributes: - label: Printer model - description: Creality Ender 3, Prusa mini, or Kossel Delta? - - - type: input - attributes: - label: Electronics - description: Stock electronics, upgrade board, or something else? - - - type: input - attributes: - label: Add-ons - description: Please list any hardware add-ons that could be involved. - - - type: dropdown - attributes: - label: Bed Leveling - description: What kind of bed leveling compensation are you using? - options: - - UBL Bilinear mesh - - ABL Bilinear mesh - - ABL Linear grid - - ABL 3-point - - MBL Manual Bed Leveling - - No Bed Leveling - - - type: dropdown - attributes: - label: Your Slicer - description: Do you use Slic3r, Prusa Slicer, Simplify3D, IdeaMaker...? - options: - - Slic3r - - Simplify3D - - Prusa Slicer - - IdeaMaker - - Cura - - Other (explain below) - - - type: dropdown - attributes: - label: Host Software - description: Do you use OctoPrint, Repetier Host, Pronterface...? - options: - - SD Card (headless) - - Repetier Host - - OctoPrint - - Pronterface - - Cura - - Same as my slicer - - Other (explain below) - - - type: checkboxes - attributes: - label: Other things to include - options: - - label: A ZIP file containing your `Configuration.h` and `Configuration_adv.h`. - required: true - - label: Log output from the host. (`M111 S247` for maximum logging.) - - label: Images or videos demonstrating the problem, if it helps to make it clear. - - label: A G-Code file that exposes the problem, if not affecting _all_ G-code. - - - type: textarea - attributes: - label: Additional information & file uploads - description: >- - If you've made any other modifications to the firmware, please describe them in detail. - - When pasting formatted text don't forget to put ` ``` ` (on its own line) before and after to make it readable. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 1fe68966fbba..000000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,20 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: 📖 Marlin Documentation - url: https://marlinfw.org/ - about: Lots of documentation on installing and using Marlin. - - name: 👤 MarlinFirmware Facebook group - url: https://www.facebook.com/groups/1049718498464482 - about: Please ask and answer questions here. - - name: 🕹 Marlin on Discord - url: https://discord.gg/n5NJ59y - about: Join the Discord server for support and discussion. - - name: 🔗 Marlin Discussion Forum - url: https://reprap.org/forum/list.php?415 - about: A searchable web forum hosted by RepRap dot org. - - name: 📺 Marlin Videos on YouTube - url: https://www.youtube.com/results?search_query=marlin+firmware - about: Tutorials and more from Marlin users all around the world. Great for new users! - - name: 💸 Want to donate? - url: https://www.thinkyhead.com/donate-to-marlin - about: Please take a look at the various options to support Marlin Firmware's development financially! diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index df1938ccd84a..000000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: ✨ Request a feature -description: Request a new Marlin Firmware feature -title: "[FR] (feature summary)" -labels: 'T: Feature Request' -body: - - type: markdown - attributes: - value: > - Do you want to ask a question? Are you looking for support? Please use one of the [support links](https://github.com/MarlinFirmware/Marlin/issues/new/choose). - - - type: markdown - attributes: - value: > - **Thank you for requesting a new Marlin Firmware feature!** - - ## Before Requesting a Feature - - - Read and understand Marlin's [Code of Conduct](https://github.com/MarlinFirmware/Marlin/blob/master/.github/code_of_conduct.md). You are expected to comply with it, including treating everyone with respect. - - - Check the latest [`bugfix-2.0.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.0.x.zip) to see if the feature already exists. - - - Before you proceed with your request, please consider if it is necessary to make it into a firmware feature, or if it may be better suited for a slicer or host feature. - - - type: textarea - attributes: - label: Is your feature request related to a problem? Please describe. - description: A clear description of the problem (e.g., "I need X but Marlin can't do it [...]"). - - - type: textarea - attributes: - label: Are you looking for hardware support? - description: Tell us the printer, board, or peripheral that needs support. - - - type: textarea - attributes: - label: Describe the feature you want - description: A clear description of the feature and how you think it should work. - validations: - required: true - - - type: textarea - attributes: - label: Additional context - description: Add any other context or screenshots about the feature request here. diff --git a/.github/lock.yml b/.github/lock.yml deleted file mode 100644 index c5ceff66b0a7..000000000000 --- a/.github/lock.yml +++ /dev/null @@ -1,40 +0,0 @@ -# -# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app -# - -# Number of days of inactivity before a closed issue or pull request is locked -daysUntilLock: 60 - -# Skip issues and pull requests created before a given timestamp. Timestamp must -# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable -skipCreatedBefore: false - -# Issues and pull requests with these labels will be ignored. Set to `[]` to disable -exemptLabels: [ 'no-locking' ] - -# Label to add before locking, such as `outdated`. Set to `false` to disable -lockLabel: false - -# Comment to post before locking. Set to `false` to disable -lockComment: > - This thread has been automatically locked since there has not been - any recent activity after it was closed. Please open a new issue for - related bugs. - -# Assign `resolved` as the reason for locking. Set to `false` to disable -setLockReason: true - -# Limit to only `issues` or `pulls` -# only: issues - -# Optionally, specify configuration settings just for `issues` or `pulls` -# issues: -# exemptLabels: -# - help-wanted -# lockLabel: outdated - -# pulls: -# daysUntilLock: 30 - -# Repository to extend settings from -# _extends: repo diff --git a/.github/workflows/bump-date.yml b/.github/workflows/bump-date.yml deleted file mode 100644 index 2366da725806..000000000000 --- a/.github/workflows/bump-date.yml +++ /dev/null @@ -1,39 +0,0 @@ -# -# bump-date.yml -# Bump the distribution date once per day -# - -name: Bump Distribution Date - -on: - schedule: - - cron: '0 */6 * * *' - -jobs: - bump_date: - name: Bump Distribution Date - if: github.repository == 'MarlinFirmware/Marlin' - - runs-on: ubuntu-latest - - steps: - - - name: Check out bugfix-2.0.x - uses: actions/checkout@v2 - with: - ref: bugfix-2.0.x - - - name: Bump Distribution Date - run: | - # Inline Bump Script - if [[ ! "$( git log -1 --pretty=%B )" =~ ^\[cron\] ]]; then - DIST=$( date +"%Y-%m-%d" ) - eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \ - eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \ - git config user.name "${GITHUB_ACTOR}" && \ - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \ - git add . && \ - git commit -m "[cron] Bump distribution date ($DIST)" && \ - git push - fi - exit 0 diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml deleted file mode 100644 index 93a110f270d3..000000000000 --- a/.github/workflows/check-pr.yml +++ /dev/null @@ -1,33 +0,0 @@ -# -# check-pr.yml -# Close PRs directed at release branches -# - -name: PR Bad Target - -on: - pull_request_target: - types: [opened] - branches: - - 1.0.x - - 1.1.x - - 2.0.x - -jobs: - bad_target: - name: PR Bad Target - if: github.repository == 'MarlinFirmware/Marlin' - - runs-on: ubuntu-latest - - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: > - Thanks for your contribution! Unfortunately we can't accept PRs directed at release branches. We make patches to the bugfix branches and only later do we push them out as releases. - - Please redo this PR starting with the `bugfix-2.0.x` branch and be careful to target `bugfix-2.0.x` when resubmitting the PR. - - It may help to set your fork's default branch to `bugfix-2.0.x`. - - See [this page](http://marlinfw.org/docs/development/getting_started_pull_requests.html) for full instructions. diff --git a/.github/workflows/clean-closed.yml b/.github/workflows/clean-closed.yml deleted file mode 100644 index befec4498f25..000000000000 --- a/.github/workflows/clean-closed.yml +++ /dev/null @@ -1,39 +0,0 @@ -# -# clean-closed.yml -# Remove obsolete labels when an Issue or PR is closed -# - -name: Clean Closed - -on: - pull_request: - types: [closed] - issues: - types: [closed] - -jobs: - remove_label: - runs-on: ubuntu-latest - - strategy: - matrix: - label: - - "S: Don't Merge" - - "S: Hold for 2.1" - - "S: Please Merge" - - "S: Please Test" - - "help wanted" - - "Needs: Discussion" - - "Needs: Documentation" - - "Needs: More Data" - - "Needs: Patch" - - "Needs: Testing" - - "Needs: Work" - - steps: - - uses: actions/checkout@v2 - - name: Remove Labels - uses: actions-ecosystem/action-remove-labels@v1 - with: - github_token: ${{ github.token }} - labels: ${{ matrix.label }} diff --git a/.github/workflows/close-stale.yml b/.github/workflows/close-stale.yml deleted file mode 100644 index f90c079f6605..000000000000 --- a/.github/workflows/close-stale.yml +++ /dev/null @@ -1,28 +0,0 @@ -# -# close-stale.yml -# Close open issues after a period of inactivity -# - -name: Close Stale Issues - -on: - schedule: - - cron: "22 1 * * *" - -jobs: - stale: - name: Close Stale Issues - if: github.repository == 'MarlinFirmware/Marlin' - - runs-on: ubuntu-latest - - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.' - days-before-stale: 60 - days-before-close: 10 - stale-issue-label: 'stale-closing-soon' - exempt-all-assignees: true - exempt-issue-labels: 'Bug: Confirmed !,T: Feature Request,Needs: Discussion,Needs: Documentation,Needs: Patch,Needs: Work,Needs: Testing,help wanted,no-locking' diff --git a/.github/workflows/lock-closed.yml b/.github/workflows/lock-closed.yml deleted file mode 100644 index 8cdcd7a8369e..000000000000 --- a/.github/workflows/lock-closed.yml +++ /dev/null @@ -1,32 +0,0 @@ -# -# lock-closed.yml -# Lock closed issues after a period of inactivity -# - -name: Lock Closed Issues - -on: - schedule: - - cron: '0 1/13 * * *' - -jobs: - lock: - name: Lock Closed Issues - if: github.repository == 'MarlinFirmware/Marlin' - - runs-on: ubuntu-latest - - steps: - - uses: dessant/lock-threads@v2 - with: - github-token: ${{ github.token }} - process-only: 'issues' - issue-lock-inactive-days: '60' - issue-exclude-created-before: '' - issue-exclude-labels: 'no-locking' - issue-lock-labels: '' - issue-lock-comment: > - This issue has been automatically locked since there - has not been any recent activity after it was closed. - Please open a new issue for related bugs. - issue-lock-reason: '' diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml deleted file mode 100644 index 498cfc1d1f51..000000000000 --- a/.github/workflows/test-builds.yml +++ /dev/null @@ -1,147 +0,0 @@ -# -# test-builds.yml -# Do test builds to catch compile errors -# - -name: CI - -on: - pull_request: - branches: - - bugfix-2.0.x - paths-ignore: - - config/** - - data/** - - docs/** - - '**/*.md' - push: - branches: - - bugfix-2.0.x - paths-ignore: - - config/** - - data/** - - docs/** - - '**/*.md' - -jobs: - test_builds: - name: Run All Tests - if: github.repository == 'MarlinFirmware/Marlin' - - runs-on: ubuntu-latest - - strategy: - matrix: - test-platform: - # Base Environments - - - DUE - - DUE_archim - - esp32 - - linux_native - - mega2560 - - at90usb1286_dfu - - teensy31 - - teensy35 - - teensy41 - - SAMD51_grandcentral_m4 - - # Extended AVR Environments - - - FYSETC_F6 - - mega1280 - - rambo - - sanguino1284p - - sanguino644p - - # STM32F1 (Maple) Environments - - #- STM32F103RC_btt_maple - - STM32F103RC_btt_USB_maple - - STM32F103RC_fysetc_maple - - STM32F103RC_meeb_maple - - jgaurora_a5s_a1_maple - - STM32F103VE_longer_maple - #- mks_robin_maple - - mks_robin_lite_maple - - mks_robin_pro_maple - #- mks_robin_nano35_maple - #- STM32F103RE_creality_maple - - STM32F103VE_ZM3E4V2_USB_maple - - # STM32 (ST) Environments - - - STM32F103RC_btt - #- STM32F103RC_btt_USB - - STM32F103RE_btt - - STM32F103RE_btt_USB - - STM32F103RE_creality - - STM32F401RC_creality - - STM32F103VE_longer - - STM32F407VE_black - - STM32F401VE_STEVAL - - BIGTREE_BTT002 - - BIGTREE_SKR_PRO - - BIGTREE_GTR_V1_0 - - mks_robin - - ARMED - - FYSETC_S6 - - STM32F070CB_malyan - - STM32F070RB_malyan - - malyan_M300 - - FLYF407ZG - - rumba32 - - LERDGEX - - LERDGEK - - mks_robin_nano35 - - NUCLEO_F767ZI - - REMRAM_V1 - - BTT_SKR_SE_BX - - chitu_f103 - - Index_Mobo_Rev03 - - # Put lengthy tests last - - - LPC1768 - - LPC1769 - - # Non-working environment tests - #- at90usb1286_cdc - #- STM32F103CB_malyan - #- STM32F103RE - #- mks_robin_mini - - steps: - - - name: Check out the PR - uses: actions/checkout@v3 - - - name: Cache pip - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache PlatformIO - uses: actions/cache@v3 - with: - path: ~/.platformio - key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - - - name: Select Python 3.7 - uses: actions/setup-python@v3 - with: - python-version: '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax. - architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified - - - name: Install PlatformIO - run: | - pip install -U platformio - pio upgrade --dev - pio pkg update --global - - - name: Run ${{ matrix.test-platform }} Tests - run: | - make tests-single-ci TEST_TARGET=${{ matrix.test-platform }} diff --git a/.github/workflows/unlock-reopened.yml b/.github/workflows/unlock-reopened.yml deleted file mode 100644 index 614ef3fab297..000000000000 --- a/.github/workflows/unlock-reopened.yml +++ /dev/null @@ -1,22 +0,0 @@ -# -# unlock-reopened.yml -# Unlock an issue whenever it is re-opened -# - -name: "Unlock reopened issue" - -on: - issues: - types: [reopened] - -jobs: - unlock: - name: Unlock Reopened - if: github.repository == 'MarlinFirmware/Marlin' - - runs-on: ubuntu-latest - - steps: - - uses: OSDKDev/unlock-issues@v1.1 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" From 369542db3bb34c28196a77838a2f018180a7da74 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Jun 2022 00:23:43 -0500 Subject: [PATCH 365/502] =?UTF-8?q?=F0=9F=94=96=20Marlin=202.0.9.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- Marlin/Configuration_adv.h | 2 +- Marlin/Version.h | 4 ++-- Marlin/src/inc/Version.h | 6 +++--- config/README.md | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 5ff646e2688e..c3b176d245ab 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -35,7 +35,7 @@ * * Advanced settings can be found in Configuration_adv.h */ -#define CONFIGURATION_H_VERSION 02000903 +#define CONFIGURATION_H_VERSION 02000904 //=========================================================================== //============================= Getting Started ============================= diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index c09436573ac4..d25355d8a6ba 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -30,7 +30,7 @@ * * Basic settings can be found in Configuration.h */ -#define CONFIGURATION_ADV_H_VERSION 02000903 +#define CONFIGURATION_ADV_H_VERSION 02000904 //=========================================================================== //============================= Thermal Settings ============================ diff --git a/Marlin/Version.h b/Marlin/Version.h index 40136a36847d..68d56f6e7ecf 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -28,7 +28,7 @@ /** * Marlin release version identifier */ -//#define SHORT_BUILD_VERSION "2.0.9.3" +//#define SHORT_BUILD_VERSION "2.0.9.4" /** * Verbose version identifier which should contain a reference to the location @@ -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-12-25" +//#define STRING_DISTRIBUTION_DATE "2022-06-04" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 767e3e9a8e71..f7d5e1774c93 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -25,7 +25,7 @@ * Release version. Leave the Marlin version or apply a custom scheme. */ #ifndef SHORT_BUILD_VERSION - #define SHORT_BUILD_VERSION "2.0.9.3" + #define SHORT_BUILD_VERSION "2.0.9.4" #endif /** @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2021-12-25" + #define STRING_DISTRIBUTION_DATE "2022-06-04" #endif /** @@ -52,7 +52,7 @@ * to alert users to major changes. */ -#define MARLIN_HEX_VERSION 02000903 +#define MARLIN_HEX_VERSION 02000904 #ifndef REQUIRED_CONFIGURATION_H_VERSION #define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION #endif diff --git a/config/README.md b/config/README.md index c322cdf71bb4..609b5d4c6ffd 100644 --- a/config/README.md +++ b/config/README.md @@ -1,3 +1,3 @@ # Where have all the configurations gone? -## https://github.com/MarlinFirmware/Configurations/archive/release-2.0.9.3.zip +## https://github.com/MarlinFirmware/Configurations/archive/release-2.0.9.4.zip From 236251a2ce4f055ab96af0008c882ffe77f5dac8 Mon Sep 17 00:00:00 2001 From: Miguel Risco-Castillo Date: Mon, 6 Jun 2022 00:01:06 -0500 Subject: [PATCH 366/502] =?UTF-8?q?=F0=9F=9A=B8=20ProUI=20G-code=20preview?= =?UTF-8?q?,=20PID=20plot=20(#24282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/base64.hpp | 208 ++++++++++++++++ Marlin/src/lcd/e3v2/proui/dwin.cpp | 101 ++++++-- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 2 + Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 253 ++++++++++++++++++++ Marlin/src/lcd/e3v2/proui/gcode_preview.h | 27 +++ Marlin/src/lcd/e3v2/proui/plot.cpp | 94 ++++++++ Marlin/src/lcd/e3v2/proui/plot.h | 54 +++++ Marlin/src/lcd/e3v2/proui/ubl_tools.cpp | 18 +- buildroot/tests/STM32F103RE_creality | 11 +- buildroot/tests/STM32F401RC_creality | 13 +- 10 files changed, 749 insertions(+), 32 deletions(-) create mode 100644 Marlin/src/lcd/e3v2/proui/base64.hpp create mode 100644 Marlin/src/lcd/e3v2/proui/gcode_preview.cpp create mode 100644 Marlin/src/lcd/e3v2/proui/gcode_preview.h create mode 100644 Marlin/src/lcd/e3v2/proui/plot.cpp create mode 100644 Marlin/src/lcd/e3v2/proui/plot.h diff --git a/Marlin/src/lcd/e3v2/proui/base64.hpp b/Marlin/src/lcd/e3v2/proui/base64.hpp new file mode 100644 index 000000000000..d82d0b27e8ac --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/base64.hpp @@ -0,0 +1,208 @@ +/** + * Base64 encoder/decoder for arduino repo + * Uses common web conventions - '+' for 62, '/' for 63, '=' for padding. + * Note that invalid base64 characters are interpreted as padding. + * Author: Densaugeo + * Maintainer: Densaugeo + * Version: 1.2.1.1 + * Changed unsigned int to uint16_t for use in the professional Ender 3V2/S1 firmware + * Url: https://www.arduino.cc/reference/en/libraries/base64/ + */ + +#ifndef BASE64_H_INCLUDED +#define BASE64_H_INCLUDED + +/* binary_to_base64: + * Description: + * Converts a single byte from a binary value to the corresponding base64 character + * Parameters: + * v - Byte to convert + * Returns: + * ascii code of base64 character. If byte is >= 64, then there is not corresponding base64 character + * and 255 is returned + */ +unsigned char binary_to_base64(unsigned char v); + +/* base64_to_binary: + * Description: + * Converts a single byte from a base64 character to the corresponding binary value + * Parameters: + * c - Base64 character (as ascii code) + * Returns: + * 6-bit binary value + */ +unsigned char base64_to_binary(unsigned char c); + +/* encode_base64_length: + * Description: + * Calculates length of base64 string needed for a given number of binary bytes + * Parameters: + * input_length - Amount of binary data in bytes + * Returns: + * Number of base64 characters needed to encode input_length bytes of binary data + */ +uint16_t encode_base64_length(uint16_t input_length); + +/* decode_base64_length: + * Description: + * Calculates number of bytes of binary data in a base64 string + * Variant that does not use input_length no longer used within library, retained for API compatibility + * Parameters: + * input - Base64-encoded null-terminated string + * input_length (optional) - Number of bytes to read from input pointer + * Returns: + * Number of bytes of binary data in input + */ +uint16_t decode_base64_length(unsigned char input[]); +uint16_t decode_base64_length(unsigned char input[], uint16_t input_length); + +/* encode_base64: + * Description: + * Converts an array of bytes to a base64 null-terminated string + * Parameters: + * input - Pointer to input data + * input_length - Number of bytes to read from input pointer + * output - Pointer to output string. Null terminator will be added automatically + * Returns: + * Length of encoded string in bytes (not including null terminator) + */ +uint16_t encode_base64(unsigned char input[], uint16_t input_length, unsigned char output[]); + +/* decode_base64: + * Description: + * Converts a base64 null-terminated string to an array of bytes + * Parameters: + * input - Pointer to input string + * input_length (optional) - Number of bytes to read from input pointer + * output - Pointer to output array + * Returns: + * Number of bytes in the decoded binary + */ +uint16_t decode_base64(unsigned char input[], unsigned char output[]); +uint16_t decode_base64(unsigned char input[], uint16_t input_length, unsigned char output[]); + +unsigned char binary_to_base64(unsigned char v) { + // Capital letters - 'A' is ascii 65 and base64 0 + if (v < 26) return v + 'A'; + + // Lowercase letters - 'a' is ascii 97 and base64 26 + if (v < 52) return v + 71; + + // Digits - '0' is ascii 48 and base64 52 + if (v < 62) return v - 4; + + // '+' is ascii 43 and base64 62 + if (v == 62) return '+'; + + // '/' is ascii 47 and base64 63 + if (v == 63) return '/'; + + return 64; +} + +unsigned char base64_to_binary(unsigned char c) { + // Capital letters - 'A' is ascii 65 and base64 0 + if ('A' <= c && c <= 'Z') return c - 'A'; + + // Lowercase letters - 'a' is ascii 97 and base64 26 + if ('a' <= c && c <= 'z') return c - 71; + + // Digits - '0' is ascii 48 and base64 52 + if ('0' <= c && c <= '9') return c + 4; + + // '+' is ascii 43 and base64 62 + if (c == '+') return 62; + + // '/' is ascii 47 and base64 63 + if (c == '/') return 63; + + return 255; +} + +uint16_t encode_base64_length(uint16_t input_length) { + return (input_length + 2)/3*4; +} + +uint16_t decode_base64_length(unsigned char input[]) { + return decode_base64_length(input, -1); +} + +uint16_t decode_base64_length(unsigned char input[], uint16_t input_length) { + unsigned char *start = input; + + while (base64_to_binary(input[0]) < 64 && (unsigned char)(input - start) < input_length) { + ++input; + } + + input_length = input - start; + return input_length/4*3 + (input_length % 4 ? input_length % 4 - 1 : 0); +} + +uint16_t encode_base64(unsigned char input[], uint16_t input_length, unsigned char output[]) { + uint16_t full_sets = input_length/3; + + // While there are still full sets of 24 bits... + for (uint16_t i = 0; i < full_sets; ++i) { + output[0] = binary_to_base64( input[0] >> 2); + output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4); + output[2] = binary_to_base64((input[1] & 0x0F) << 2 | input[2] >> 6); + output[3] = binary_to_base64( input[2] & 0x3F); + + input += 3; + output += 4; + } + + switch(input_length % 3) { + case 0: + output[0] = '\0'; + break; + case 1: + output[0] = binary_to_base64( input[0] >> 2); + output[1] = binary_to_base64((input[0] & 0x03) << 4); + output[2] = '='; + output[3] = '='; + output[4] = '\0'; + break; + case 2: + output[0] = binary_to_base64( input[0] >> 2); + output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4); + output[2] = binary_to_base64((input[1] & 0x0F) << 2); + output[3] = '='; + output[4] = '\0'; + break; + } + + return encode_base64_length(input_length); +} + +uint16_t decode_base64(unsigned char input[], unsigned char output[]) { + return decode_base64(input, -1, output); +} + +uint16_t decode_base64(unsigned char input[], uint16_t input_length, unsigned char output[]) { + uint16_t output_length = decode_base64_length(input, input_length); + + // While there are still full sets of 24 bits... + for (uint16_t i = 2; i < output_length; i += 3) { + output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4; + output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2; + output[2] = base64_to_binary(input[2]) << 6 | base64_to_binary(input[3]); + + input += 4; + output += 3; + } + + switch(output_length % 3) { + case 1: + output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4; + break; + case 2: + output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4; + output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2; + break; + } + + return output_length; +} + +#endif // ifndef diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 709ed05fed73..c98fd6a0e150 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -98,6 +98,14 @@ #include "endstop_diag.h" #endif +#if HAS_PIDPLOT + #include "plot.h" +#endif + +#if HAS_GCODE_PREVIEW + #include "gcode_preview.h" +#endif + #if HAS_MESH #include "meshviewer.h" #endif @@ -652,13 +660,19 @@ void Draw_PrintDone() { Title.ShowCaption(GET_TEXT_F(MSG_PRINT_DONE)); DWINUI::ClearMainArea(); DWIN_Print_Header(nullptr); - Draw_Print_ProgressBar(); - Draw_Print_Labels(); - DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); - DWINUI::Draw_Icon(ICON_RemainTime, 150, 171); - Draw_Print_ProgressElapsed(); - Draw_Print_ProgressRemain(); - DWINUI::Draw_Button(BTN_Continue, 86, 273); + if (sdprint && TERN0(HAS_GCODE_PREVIEW, Preview_Valid())) { + DWIN_ICON_Show(0, 0, 1, 21, 100, 0x00); + DWINUI::Draw_Button(BTN_Continue, 86, 300); + } + else { + Draw_Print_ProgressBar(); + Draw_Print_Labels(); + DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); + DWINUI::Draw_Icon(ICON_RemainTime, 150, 171); + Draw_Print_ProgressElapsed(); + Draw_Print_ProgressRemain(); + DWINUI::Draw_Button(BTN_Continue, 86, 273); + } } void Goto_PrintDone() { @@ -1354,6 +1368,9 @@ void EachMomentUpdate() { #if HAS_ESDIAG if (checkkey == ESDiagProcess) ESDiag.Update(); #endif + #if HAS_PIDPLOT + if (checkkey == PidProcess) Plot.Update((HMI_value.pidresult == PID_EXTR_START) ? thermalManager.wholeDegHotend(0) : thermalManager.wholeDegBed()); + #endif } #if HAS_STATUS_MESSAGE_TIMEOUT @@ -1580,15 +1597,49 @@ void DWIN_LevelingDone() { #endif // PID process + +#if HAS_PIDPLOT + void DWIN_Draw_PIDPopup() { + frame_rect_t gfrm = {40, 180, DWIN_WIDTH - 80, 120}; + DWINUI::ClearMainArea(); + Draw_Popup_Bkgd(); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); + DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); + switch (HMI_value.pidresult) { + case PID_EXTR_START: + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running.")); + Plot.Draw(gfrm, thermalManager.hotend_maxtemp[0], HMI_data.HotendPidT); + DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.HotendPidT); + break; + case PID_BED_START: + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running.")); + Plot.Draw(gfrm, BED_MAXTEMP, HMI_data.BedPidT); + DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.BedPidT); + break; + default: + break; + } + } +#endif + void DWIN_PidTuning(pidresult_t result) { + HMI_value.pidresult = result; switch (result) { case PID_BED_START: - HMI_SaveProcessID(NothingToDo); - DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); + HMI_SaveProcessID(PidProcess); + #if HAS_PIDPLOT + DWIN_Draw_PIDPopup(); + #else + DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); + #endif break; case PID_EXTR_START: - HMI_SaveProcessID(NothingToDo); - DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); + HMI_SaveProcessID(PidProcess); + #if HAS_PIDPLOT + DWIN_Draw_PIDPopup(); + #else + DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); + #endif break; case PID_BAD_EXTRUDER_NUM: checkkey = last_checkkey; @@ -1905,10 +1956,30 @@ void HMI_LockScreen() { } -void Goto_ConfirmToPrint() { - card.openAndPrintFile(card.filename); - DWIN_Print_Started(true); -} +#if HAS_GCODE_PREVIEW + + void onClick_ConfirmToPrint() { + if (HMI_flag.select_flag) { // Confirm + card.openAndPrintFile(card.filename); + return DWIN_Print_Started(true); + } + else { // Cancel + DWIN_ResetStatusLine(); + checkkey = SelectFile; + return Draw_Print_File_Menu(); + } + } + + void Goto_ConfirmToPrint() { + Goto_Popup(Preview_DrawFromSD, onClick_ConfirmToPrint); + } + +#else + void Goto_ConfirmToPrint() { + card.openAndPrintFile(card.filename); + DWIN_Print_Started(true); + } +#endif #if HAS_ESDIAG void Draw_EndStopDiag() { diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index bfeb06d76341..cb7b2f8160df 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -35,6 +35,8 @@ #include #define HAS_ESDIAG 1 +#define HAS_PIDPLOT 1 +#define HAS_GCODE_PREVIEW 1 #if defined(__STM32F1__) || defined(STM32F1) #define DASH_REDRAW 1 #endif diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp new file mode 100644 index 000000000000..951f469e1c60 --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -0,0 +1,253 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * DWIN g-code thumbnail preview + * Author: Miguel A. Risco-Castillo + * version: 2.1 + * Date: 2021/06/19 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * For commercial applications additional licenses can be requested + */ + +#include "dwin_defines.h" + +#if HAS_GCODE_PREVIEW + +#include "../../../core/types.h" +#include "../../marlinui.h" +#include "../../../sd/cardreader.h" +#include "dwin_lcd.h" +#include "dwinui.h" +#include "dwin.h" +#include "dwin_popup.h" +#include "base64.hpp" +#include "gcode_preview.h" + +typedef struct { + char name[13] = ""; //8.3 + null + uint32_t thumbstart = 0; + int thumbsize = 0; + int thumbheight = 0; + int thumbwidth = 0; + uint8_t *thumbdata = nullptr; + float time = 0; + float filament = 0; + float layer = 0; + float width = 0; + float height = 0; + float length = 0; + void setname(const char * const fn); + void clear(); +} fileprop_t; +fileprop_t fileprop; + +void fileprop_t::setname(const char * const fn) { + const uint8_t len = _MIN(sizeof(name) - 1, strlen(fn)); + memcpy(&name[0], fn, len); + name[len] = '\0'; +} + +void fileprop_t::clear() { + fileprop.name[0] = '\0'; + fileprop.thumbstart = 0; + fileprop.thumbsize = 0; + fileprop.thumbheight = 0; + fileprop.thumbwidth = 0; + fileprop.thumbdata = nullptr; + fileprop.time = 0; + fileprop.filament = 0; + fileprop.layer = 0; + fileprop.height = 0; + fileprop.width = 0; + fileprop.length = 0; +} + +void Get_Value(char *buf, const char * const key, float &value) { + char num[10] = ""; + char * posptr = 0; + uint8_t i = 0; + if (!!value) return; + posptr = strstr(buf, key); + if (posptr != nullptr) { + while (i < sizeof(num)) { + char c = posptr[0]; + if (!ISEOL(c) && (c != 0)) { + if ((c > 47 && c < 58) || (c == '.')) num[i++] = c; + posptr++; + } + else { + num[i] = '\0'; + value = atof(num); + return; + } + } + } +} + +bool Has_Preview() { + const char * tbstart = "; thumbnail begin 230x180"; + char * posptr = 0; + uint8_t nbyte = 1; + uint32_t indx = 0; + char buf[256]; + float tmp = 0; + + fileprop.clear(); + fileprop.setname(card.filename); + + card.openFileRead(fileprop.name); + + while ((nbyte > 0) && (indx < 4 * sizeof(buf)) && !fileprop.thumbstart) { + nbyte = card.read(buf, sizeof(buf) - 1); + if (nbyte > 0) { + buf[nbyte] = '\0'; + Get_Value(buf, ";TIME:", fileprop.time); + Get_Value(buf, ";Filament used:", fileprop.filament); + Get_Value(buf, ";Layer height:", fileprop.layer); + Get_Value(buf, ";MINX:", tmp); + Get_Value(buf, ";MAXX:", fileprop.width); + fileprop.width -= tmp; + tmp = 0; + Get_Value(buf, ";MINY:", tmp); + Get_Value(buf, ";MAXY:", fileprop.length); + fileprop.length -= tmp; + tmp = 0; + Get_Value(buf, ";MINZ:", tmp); + Get_Value(buf, ";MAXZ:", fileprop.height); + fileprop.height -= tmp; + posptr = strstr(buf, tbstart); + if (posptr != NULL) { + fileprop.thumbstart = indx + (posptr - &buf[0]); + } + else { + indx += _MAX(10, nbyte - (signed)strlen(tbstart)); + card.setIndex(indx); + } + } + } + + if (!fileprop.thumbstart) { + card.closefile(); + LCD_MESSAGE_F("Thumbnail not found"); + return 0; + } + + // Get the size of the thumbnail + card.setIndex(fileprop.thumbstart + strlen(tbstart)); + for (uint8_t i = 0; i < 16; i++) { + char c = card.get(); + if (!ISEOL(c)) { + buf[i] = c; + } + else { + buf[i] = 0; + break; + } + } + fileprop.thumbsize = atoi(buf); + + // Exit if there isn't a thumbnail + if (!fileprop.thumbsize) { + card.closefile(); + LCD_MESSAGE_F("Invalid Thumbnail Size"); + return 0; + } + + uint16_t readed = 0; + uint8_t buf64[fileprop.thumbsize]; + + fileprop.thumbdata = new uint8_t[3 + 3 * (fileprop.thumbsize / 4)]; // Reserve space for the JPEG thumbnail + + while (readed < fileprop.thumbsize) { + uint8_t c = card.get(); + if (!ISEOL(c) && (c != ';') && (c != ' ')) { + buf64[readed] = c; + readed++; + } + } + card.closefile(); + buf64[readed] = 0; + + fileprop.thumbsize = decode_base64(buf64, fileprop.thumbdata); card.closefile(); + DWINUI::WriteToSRAM(0x00, fileprop.thumbsize, fileprop.thumbdata); + delete[] fileprop.thumbdata; + return true; +} + +void Preview_DrawFromSD() { + if (Has_Preview()) { + char buf[46]; + char str_1[6] = ""; + char str_2[6] = ""; + char str_3[6] = ""; + DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 0, DWIN_WIDTH, STATUS_Y - 1); + if (fileprop.time) { + sprintf_P(buf, PSTR("Estimated time: %i:%02i"), (uint16_t)fileprop.time / 3600, ((uint16_t)fileprop.time % 3600) / 60); + DWINUI::Draw_String(20, 10, buf); + } + if (fileprop.filament) { + sprintf_P(buf, PSTR("Filament used: %s m"), dtostrf(fileprop.filament, 1, 2, str_1)); + DWINUI::Draw_String(20, 30, buf); + } + if (fileprop.layer) { + sprintf_P(buf, PSTR("Layer height: %s mm"), dtostrf(fileprop.layer, 1, 2, str_1)); + DWINUI::Draw_String(20, 50, buf); + } + if (fileprop.width) { + sprintf_P(buf, PSTR("Volume: %sx%sx%s mm"), dtostrf(fileprop.width, 1, 1, str_1), dtostrf(fileprop.length, 1, 1, str_2), dtostrf(fileprop.height, 1, 1, str_3)); + DWINUI::Draw_String(20, 70, buf); + } + DWINUI::Draw_Button(BTN_Print, 26, 290); + DWINUI::Draw_Button(BTN_Cancel, 146, 290); + DWIN_ICON_Show(0, 0, 1, 21, 90, 0x00); + Draw_Select_Highlight(true, 290); + DWIN_UpdateLCD(); + } + else { + HMI_flag.select_flag = 1; + wait_for_user = false; + } +} + +bool Preview_Valid() { + return !!fileprop.thumbstart; +} + +void Preview_Reset() { + fileprop.thumbsize = 0; +} + +#endif // HAS_GCODE_PREVIEW diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.h b/Marlin/src/lcd/e3v2/proui/gcode_preview.h new file mode 100644 index 000000000000..4417084a242d --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.h @@ -0,0 +1,27 @@ +/** + * DWIN g-code thumbnail preview + * Author: Miguel A. Risco-Castillo + * version: 2.1 + * Date: 2021/06/19 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * For commercial applications additional licenses can be requested + */ + +#pragma once + +void Preview_DrawFromSD(); +bool Preview_Valid(); +void Preview_Reset(); diff --git a/Marlin/src/lcd/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp new file mode 100644 index 000000000000..ebc685fa2453 --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -0,0 +1,94 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * DWIN Single var plot + * Author: Miguel A. Risco-Castillo + * Version: 2.0 + * Date: 2022/01/31 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * For commercial applications additional licenses can be requested + */ + +#include "../../../inc/MarlinConfigPre.h" + +#ifdef DWIN_LCD_PROUI + +#include "plot.h" + +#include "../../../core/types.h" +#include "../../marlinui.h" +#include "dwin_lcd.h" +#include "dwinui.h" +#include "dwin_popup.h" +#include "dwin.h" + +#define Plot_Bg_Color RGB( 1, 12, 8) + +PlotClass Plot; + +uint16_t grphpoints, r, x2, y2 = 0; +frame_rect_t grphframe = {0}; +float scale = 0; + +void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) { + grphframe = frame; + grphpoints = 0; + scale = frame.h / max; + x2 = frame.x + frame.w - 1; + y2 = frame.y + frame.h - 1; + r = round((y2) - ref * scale); + DWINUI::Draw_Box(1, Plot_Bg_Color, frame); + for (uint8_t i = 1; i < 4; i++) if (i*50 < frame.w) DWIN_Draw_VLine(Line_Color, i*50 + frame.x, frame.y, frame.h); + DWINUI::Draw_Box(0, Color_White, DWINUI::ExtendFrame(frame, 1)); + DWIN_Draw_HLine(Color_Red, frame.x, r, frame.w); +} + +void PlotClass::Update(const float value) { + if (!scale) return; + uint16_t y = round((y2) - value * scale); + if (grphpoints < grphframe.w) { + DWIN_Draw_Point(Color_Yellow, 1, 1, grphpoints + grphframe.x, y); + } + else { + DWIN_Frame_AreaMove(1, 0, 1, Plot_Bg_Color, grphframe.x, grphframe.y, x2, y2); + if ((grphpoints % 50) == 0) DWIN_Draw_VLine(Line_Color, x2 - 1, grphframe.y + 1, grphframe.h - 2); + DWIN_Draw_Point(Color_Red, 1, 1, x2 - 1, r); + DWIN_Draw_Point(Color_Yellow, 1, 1, x2 - 1, y); + } + grphpoints++; +} + +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/plot.h b/Marlin/src/lcd/e3v2/proui/plot.h new file mode 100644 index 000000000000..8522c530bd3f --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/plot.h @@ -0,0 +1,54 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * DWIN Single var plot + * Author: Miguel A. Risco-Castillo + * Version: 1.0 + * Date: 2022/01/30 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * For commercial applications additional licenses can be requested + */ +#pragma once + +#include "dwinui.h" + +class PlotClass { +public: + void Draw(frame_rect_t frame, float max, float ref = 0); + void Update(float value); +}; + +extern PlotClass Plot; diff --git a/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp b/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp index 96a7f52becc6..6c9175700574 100644 --- a/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp @@ -1,10 +1,9 @@ /** - * UBL Tools and Mesh Viewer for Pro UI - * Version: 1.0.0 - * Date: 2022/04/13 + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * - * Original Author: Henri-J-Norden - * Original Source: https://github.com/Jyers/Marlin/pull/126 + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,6 +20,15 @@ * */ +/** + * UBL Tools and Mesh Viewer for Pro UI + * Version: 1.0.0 + * Date: 2022/04/13 + * + * Original Author: Henri-J-Norden + * Original Source: https://github.com/Jyers/Marlin/pull/126 + */ + #include "../../../inc/MarlinConfigPre.h" #include "ubl_tools.h" diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index a5d2899dd565..5e6d5f044ac3 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -18,9 +18,14 @@ opt_disable DWIN_CREALITY_LCD opt_enable DWIN_CREALITY_LCD_JYERSUI AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY exec_test $1 $2 "Ender 3 v2 with JyersUI" "$3" -use_example_configs "Creality/Ender-3 V2/CrealityV422/MarlinUI" -opt_add SDCARD_EEPROM_EMULATION AUTO_BED_LEVELING_BILINEAR Z_SAFE_HOMING -exec_test $1 $2 "Ender 3 v2 with MarlinUI" "$3" +use_example_configs "Creality/Ender-3 S1" +opt_disable DWIN_CREALITY_LCD Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN AUTO_BED_LEVELING_BILINEAR CONFIGURATION_EMBEDDING CANCEL_OBJECTS FWRETRACT +opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING \ + SOUND_MENU_ITEM PRINTCOUNTER NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_SENSOR \ + BLTOUCH Z_SAFE_HOMING AUTO_BED_LEVELING_UBL MESH_EDIT_MENU \ + LIMITED_MAX_FR_EDITING LIMITED_MAX_ACCEL_EDITING LIMITED_JERK_EDITING BAUD_RATE_GCODE +opt_set PREHEAT_3_LABEL '"CUSTOM"' PREHEAT_3_TEMP_HOTEND 240 PREHEAT_3_TEMP_BED 60 PREHEAT_3_FAN_SPEED 128 +exec_test $1 $2 "Ender-3 S1 with ProUI" "$3" restore_configs opt_set MOTHERBOARD BOARD_CREALITY_V452 SERIAL_PORT 1 diff --git a/buildroot/tests/STM32F401RC_creality b/buildroot/tests/STM32F401RC_creality index c7cd464df066..380711d061c2 100755 --- a/buildroot/tests/STM32F401RC_creality +++ b/buildroot/tests/STM32F401RC_creality @@ -6,15 +6,10 @@ # exit on first failure set -e -use_example_configs "Creality/Ender-3 S1" -opt_disable DWIN_CREALITY_LCD Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN AUTO_BED_LEVELING_BILINEAR CONFIGURATION_EMBEDDING CANCEL_OBJECTS FWRETRACT -opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING \ - SOUND_MENU_ITEM PRINTCOUNTER NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_SENSOR \ - BLTOUCH Z_SAFE_HOMING AUTO_BED_LEVELING_UBL MESH_EDIT_MENU \ - LIMITED_MAX_FR_EDITING LIMITED_MAX_ACCEL_EDITING LIMITED_JERK_EDITING BAUD_RATE_GCODE -opt_set MOTHERBOARD BOARD_CREALITY_V24S1_301F4 \ - PREHEAT_3_LABEL '"CUSTOM"' PREHEAT_3_TEMP_HOTEND 240 PREHEAT_3_TEMP_BED 60 PREHEAT_3_FAN_SPEED 128 -exec_test $1 $2 "Ender-3 S1 with ProUI" "$3" +use_example_configs "Creality/Ender-3 V2/CrealityV422/MarlinUI" +opt_add SDCARD_EEPROM_EMULATION AUTO_BED_LEVELING_BILINEAR Z_SAFE_HOMING +opt_set MOTHERBOARD BOARD_CREALITY_V24S1_301F4 +exec_test $1 $2 "Ender 3 v2 with MarlinUI" "$3" # clean up restore_configs From 92910721d0c4cc79ad0f8a64fb11b2c15bf3619d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 6 Jun 2022 19:06:03 -0500 Subject: [PATCH 367/502] =?UTF-8?q?=F0=9F=91=94=20Fix=20and=20comment=20us?= =?UTF-8?q?e=5Fexample=5Fconfigs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/use_example_configs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/buildroot/bin/use_example_configs b/buildroot/bin/use_example_configs index 83c0f5485d2c..bfd4aa612f0e 100755 --- a/buildroot/bin/use_example_configs +++ b/buildroot/bin/use_example_configs @@ -1,8 +1,20 @@ #!/usr/bin/env bash +# +# use_example_configs [repo:]configpath +# +# Examples: +# use_example_configs Creality/CR-10/CrealityV1 +# use_example_configs release-2.0.9.4:Creality/CR-10/CrealityV1 +# +# If a configpath has spaces (or quotes) escape them or enquote the path +# + +CURR=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g') +[[ $CURR == "bugfix-2.0.x" ]] && BRANCH=bugfix-2.0.x || BRANCH=bugfix-2.1.x IFS=: read -r PART1 PART2 <<< "$@" -[ -n "${PART2}" ] && { REPO="$PART1" ; RDIR="${PART2// /%20}" ; } \ - || { REPO=bugfix-2.0.x ; RDIR="${PART1// /%20}" ; } +[[ -n $PART2 ]] && { REPO="$PART1" ; RDIR="${PART2// /%20}" ; } \ + || { REPO=$BRANCH ; RDIR="${PART1// /%20}" ; } EXAMPLES="https://raw.githubusercontent.com/MarlinFirmware/Configurations/$REPO/config/examples" which curl >/dev/null && TOOL='curl -L -s -S -f -o wgot' @@ -12,6 +24,8 @@ restore_configs cd Marlin +echo "Fetching $RDIR configurations from $REPO..." + $TOOL "$EXAMPLES/$RDIR/Configuration.h" >/dev/null 2>&1 && mv wgot Configuration.h $TOOL "$EXAMPLES/$RDIR/Configuration_adv.h" >/dev/null 2>&1 && mv wgot Configuration_adv.h $TOOL "$EXAMPLES/$RDIR/_Bootscreen.h" >/dev/null 2>&1 && mv wgot _Bootscreen.h From ce9c81dfa12ebde0a0a55663523c782afecbd85c Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Tue, 7 Jun 2022 18:59:21 +1200 Subject: [PATCH 368/502] =?UTF-8?q?=F0=9F=A9=B9=20Media=20Change=20followu?= =?UTF-8?q?p=20(#24302)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #24015 --- Marlin/src/HAL/SAMD51/HAL.cpp | 2 +- Marlin/src/inc/Conditionals_post.h | 32 ++++++++++++------- Marlin/src/inc/SanityCheck.h | 3 +- .../anycubic_i3mega/anycubic_i3mega_lcd.cpp | 4 +-- .../lcd/extui/dgus_reloaded/DGUSRxHandler.cpp | 4 +-- .../extui/mks_ui/tft_lvgl_configuration.cpp | 3 +- Marlin/src/lcd/marlinui.cpp | 2 +- Marlin/src/lcd/menu/menu_main.cpp | 4 +-- Marlin/src/lcd/menu/menu_media.cpp | 2 +- Marlin/src/sd/cardreader.cpp | 19 +++++------ Marlin/src/sd/cardreader.h | 2 +- 11 files changed, 42 insertions(+), 35 deletions(-) diff --git a/Marlin/src/HAL/SAMD51/HAL.cpp b/Marlin/src/HAL/SAMD51/HAL.cpp index 648e0a4f144b..bd1c98bfa1d9 100644 --- a/Marlin/src/HAL/SAMD51/HAL.cpp +++ b/Marlin/src/HAL/SAMD51/HAL.cpp @@ -598,7 +598,7 @@ void MarlinHAL::dma_init() { void MarlinHAL::init() { TERN_(DMA_IS_REQUIRED, dma_init()); #if ENABLED(SDSUPPORT) - #if SD_CONNECTION_IS(ONBOARD) && PIN_EXISTS(SD_DETECT) + #if HAS_SD_DETECT && SD_CONNECTION_IS(ONBOARD) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 95edb81fccec..dd6b165328fe 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -435,20 +435,28 @@ #define HAS_SHARED_MEDIA 1 #endif - // Set SD_DETECT_STATE based on hardware if not overridden - #if PIN_EXISTS(SD_DETECT) && !defined(SD_DETECT_STATE) - #if BOTH(HAS_MARLINUI_MENU, ELB_FULL_GRAPHIC_CONTROLLER) && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)) - #define SD_DETECT_STATE HIGH - #else - #define SD_DETECT_STATE LOW - #endif - #endif - // Extender cable doesn't support SD_DETECT_PIN #if ENABLED(NO_SD_DETECT) #undef SD_DETECT_PIN #endif + // Not onboard or custom cable + #if SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION) + #define SD_CONNECTION_TYPICAL 1 + #endif + + // Set SD_DETECT_STATE based on hardware if not overridden + #if PIN_EXISTS(SD_DETECT) + #define HAS_SD_DETECT 1 + #ifndef SD_DETECT_STATE + #if ALL(SD_CONNECTION_TYPICAL, HAS_MARLINUI_MENU, ELB_FULL_GRAPHIC_CONTROLLER) + #define SD_DETECT_STATE HIGH + #else + #define SD_DETECT_STATE LOW + #endif + #endif + #endif + #if DISABLED(USB_FLASH_DRIVE_SUPPORT) || BOTH(MULTI_VOLUME, VOLUME_SD_ONBOARD) #if ENABLED(SDIO_SUPPORT) #define NEED_SD2CARD_SDIO 1 @@ -457,10 +465,10 @@ #endif #endif -#endif + #if HAS_SD_DETECT && NONE(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI, HAS_DWIN_E3V2) + #define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion + #endif -#if PIN_EXISTS(SD_DETECT) && NONE(HAS_GRAPHICAL_TFT, LCD_USE_DMA_FSMC, HAS_FSMC_GRAPHICAL_TFT, HAS_SPI_GRAPHICAL_TFT, IS_DWIN_MARLINUI, EXTENSIBLE_UI, HAS_DWIN_E3V2) - #define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion #endif /** diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 28913492a4a3..4e5d3a96aaea 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -879,9 +879,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * SD Card Settings */ -#if ALL(SDSUPPORT, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && PIN_EXISTS(SD_DETECT) && SD_DETECT_STATE != HIGH && (SD_CONNECTION_IS(LCD) || !defined(SDCARD_CONNECTION)) +#if ALL(SDSUPPORT, HAS_SD_DETECT, SD_CONNECTION_TYPICAL, ELB_FULL_GRAPHIC_CONTROLLER, HAS_MARLINUI_MENU) && SD_DETECT_STATE == LOW #error "SD_DETECT_STATE must be set HIGH for SD on the ELB_FULL_GRAPHIC_CONTROLLER." #endif +#undef SD_CONNECTION_TYPICAL /** * SD File Sorting diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp index c382af3fe2e5..0da8bb36a780 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -86,7 +86,7 @@ void AnycubicTFTClass::OnSetup() { delay_ms(10); // Init the state of the key pins running on the TFT - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) + #if BOTH(SDSUPPORT, HAS_SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) @@ -916,7 +916,7 @@ void AnycubicTFTClass::GetCommandFromTFT() { } void AnycubicTFTClass::DoSDCardStateCheck() { - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) + #if BOTH(SDSUPPORT, HAS_SD_DETECT) bool isInserted = isMediaInserted(); if (isInserted) SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted"); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index cef9c772e9df..88fe30a0273f 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -47,9 +47,7 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) { if (vp.addr == DGUS_Addr::SCREENCHANGE_SD) { #if ENABLED(SDSUPPORT) - #if !PIN_EXISTS(SD_DETECT) - card.mount(); - #endif + IF_DISABLED(HAS_SD_DETECT, card.mount()); if (!ExtUI::isMediaInserted()) { dgus_screen_handler.SetStatusMessage(GET_TEXT_F(MSG_NO_MEDIA)); diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp index 378521031509..38612358110b 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -137,8 +137,7 @@ void tft_lvgl_init() { uint16_t usb_flash_loop = 1000; #if ENABLED(MULTI_VOLUME) && !HAS_SD_HOST_DRIVE SET_INPUT_PULLUP(SD_DETECT_PIN); - if (READ(SD_DETECT_PIN) == LOW) card.changeMedia(&card.media_driver_sdcard); - else card.changeMedia(&card.media_driver_usbFlash); + card.changeMedia(IS_SD_INSERTED() ? &card.media_driver_sdcard : &card.media_driver_usbFlash); #endif do { card.media_driver_usbFlash.idle(); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 0765ef40a915..d0c966303324 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1756,7 +1756,7 @@ void MarlinUI::init() { if (old_status < 2) { #if ENABLED(EXTENSIBLE_UI) ExtUI::onMediaRemoved(); - #elif PIN_EXISTS(SD_DETECT) + #elif HAS_SD_DETECT LCD_MESSAGE(MSG_MEDIA_REMOVED); #if HAS_MARLINUI_MENU if (!defer_return_to_status) return_to_status(); diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index fdedddb6ddda..518f1e0f502d 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -246,7 +246,7 @@ void menu_main() { if (card_detected) { if (!card_open) { - #if PIN_EXISTS(SD_DETECT) + #if HAS_SD_DETECT GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21")); // M21 Change Media #else // - or - ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media @@ -262,7 +262,7 @@ void menu_main() { } } else { - #if PIN_EXISTS(SD_DETECT) + #if HAS_SD_DETECT ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media" #else GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21")); // M21 Attach Media diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index e979f04e119d..20ef6e3d198f 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -122,7 +122,7 @@ void menu_media_filelist() { BACK_ITEM_F(TERN1(BROWSE_MEDIA_ON_INSERT, screen_history_depth) ? GET_TEXT_F(MSG_MAIN) : GET_TEXT_F(MSG_BACK)); #endif if (card.flag.workDirIsRoot) { - #if !PIN_EXISTS(SD_DETECT) + #if !HAS_SD_DETECT ACTION_ITEM(MSG_REFRESH, []{ encoderTopLine = 0; card.mount(); }); #endif } diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 0aa06e47c9f4..5e03795692da 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -171,7 +171,7 @@ CardReader::CardReader() { workDirDepth = 0; ZERO(workDirParents); - #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) + #if BOTH(SDSUPPORT, HAS_SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif @@ -456,10 +456,11 @@ void CardReader::mount() { if (flag.mounted) cdroot(); - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) || PIN_EXISTS(SD_DETECT) - else if (marlin_state != MF_INITIALIZING) - LCD_ALERTMESSAGE(MSG_MEDIA_INIT_FAIL); - #endif + else { + #if EITHER(HAS_SD_DETECT, USB_FLASH_DRIVE_SUPPORT) + if (marlin_state != MF_INITIALIZING) LCD_ALERTMESSAGE(MSG_MEDIA_INIT_FAIL); + #endif + } ui.refresh(); } @@ -496,15 +497,15 @@ void CardReader::manage_media() { if (TERN1(SD_IGNORE_AT_STARTUP, old_stat != 2)) mount(); if (!isMounted()) { // Not mounted? stat = 0; - IF_DISABLED(SD_IGNORE_AT_STARTUP, prev_stat = 0); + #if HAS_SD_DETECT && DISABLED(SD_IGNORE_AT_STARTUP) + prev_stat = 0; + #endif } TERN_(RESET_STEPPERS_ON_MEDIA_INSERT, reset_stepper_drivers()); // Workaround for Cheetah bug } else { - #if PIN_EXISTS(SD_DETECT) - release(); // Card is released - #endif + TERN_(HAS_SD_DETECT, release()); // Card is released } ui.media_changed(old_stat, stat); // Update the UI or flag an error diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 483ab8139584..d2f462c2a777 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -362,7 +362,7 @@ class CardReader { #if ENABLED(USB_FLASH_DRIVE_SUPPORT) #define IS_SD_INSERTED() DiskIODriver_USBFlash::isInserted() -#elif PIN_EXISTS(SD_DETECT) +#elif HAS_SD_DETECT #define IS_SD_INSERTED() (READ(SD_DETECT_PIN) == SD_DETECT_STATE) #else // No card detect line? Assume the card is inserted. From ad786a7930f1a0516427f7e0d827402387549ead Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Tue, 7 Jun 2022 01:23:55 +0100 Subject: [PATCH 369/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Mesh=20Leveling=20?= =?UTF-8?q?+=20Debug=20compile=20(#24297)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/utility.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index 060e74d9fe66..7d33c25c3c43 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -132,11 +132,10 @@ void safe_delay(millis_t ms) { #else #if ENABLED(AUTO_BED_LEVELING_UBL) SERIAL_ECHOPGM("UBL Adjustment Z"); - const float rz = bedlevel.get_z_correction(current_position); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) SERIAL_ECHOPGM("ABL Adjustment Z"); - const float rz = bedlevel.get_z_correction(current_position); #endif + const float rz = bedlevel.get_z_correction(current_position); SERIAL_ECHO(ftostr43sign(rz, '+')); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) if (planner.z_fade_height) { @@ -156,11 +155,13 @@ void safe_delay(millis_t ms) { SERIAL_ECHOPGM("Mesh Bed Leveling"); if (planner.leveling_active) { SERIAL_ECHOLNPGM(" (enabled)"); - SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(bedlevel.get_z(current_position), '+')); + const float z_offset = bedlevel.get_z_offset(), + z_correction = bedlevel.get_z_correction(current_position); + SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(z_offset + z_correction, '+')); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) if (planner.z_fade_height) { SERIAL_ECHOPGM(" (", ftostr43sign( - bedlevel.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+' + z_offset + z_correction * planner.fade_scaling_factor_for_z(current_position.z), '+' )); SERIAL_CHAR(')'); } From 1c7696838b04051115d246fff173846cf74ea4d9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Jun 2022 00:51:08 -0500 Subject: [PATCH 370/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Rem?= =?UTF-8?q?ove=20servo=20macros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bltouch.cpp | 2 +- Marlin/src/feature/spindle_laser.cpp | 4 ++-- Marlin/src/gcode/config/M43.cpp | 8 ++++---- Marlin/src/gcode/control/M280.cpp | 6 +++--- Marlin/src/gcode/control/M282.cpp | 2 +- Marlin/src/module/probe.cpp | 2 +- Marlin/src/module/servo.cpp | 8 ++++---- Marlin/src/module/servo.h | 7 ++----- Marlin/src/module/temperature.cpp | 6 +++--- Marlin/src/module/tool_change.cpp | 8 ++++---- 10 files changed, 25 insertions(+), 28 deletions(-) diff --git a/Marlin/src/feature/bltouch.cpp b/Marlin/src/feature/bltouch.cpp index d911fae6ae75..10d3131aedcb 100644 --- a/Marlin/src/feature/bltouch.cpp +++ b/Marlin/src/feature/bltouch.cpp @@ -45,7 +45,7 @@ void stop(); bool BLTouch::command(const BLTCommand cmd, const millis_t &ms) { if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("BLTouch Command :", cmd); - MOVE_SERVO(Z_PROBE_SERVO_NR, cmd); + servo[Z_PROBE_SERVO_NR].move(cmd); safe_delay(_MAX(ms, (uint32_t)BLTOUCH_DELAY)); // BLTOUCH_DELAY is also the *minimum* delay return triggered(); } diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index 8f70816c9942..4f8f4d49dc2f 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -58,7 +58,7 @@ cutter_power_t SpindleLaser::menuPower, // Power s */ void SpindleLaser::init() { #if ENABLED(SPINDLE_SERVO) - MOVE_SERVO(SPINDLE_SERVO_NR, SPINDLE_SERVO_MIN); + servo[SPINDLE_SERVO_NR].move(SPINDLE_SERVO_MIN); #else OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Init spindle to off #endif @@ -131,7 +131,7 @@ void SpindleLaser::apply_power(const uint8_t opwr) { isReady = false; } #elif ENABLED(SPINDLE_SERVO) - MOVE_SERVO(SPINDLE_SERVO_NR, power); + servo[SPINDLE_SERVO_NR].move(power); #else WRITE(SPINDLE_LASER_ENA_PIN, enabled() ? SPINDLE_LASER_ACTIVE_STATE : !SPINDLE_LASER_ACTIVE_STATE); isReady = true; diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index de76b8e97936..688b94c9bf39 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -198,10 +198,10 @@ inline void servo_probe_test() { uint8_t i = 0; SERIAL_ECHOLNPGM(". Deploy & stow 4 times"); do { - MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][0]); // Deploy + servo[probe_index].move(servo_angles[Z_PROBE_SERVO_NR][0]); // Deploy safe_delay(500); deploy_state = READ(PROBE_TEST_PIN); - MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][1]); // Stow + servo[probe_index].move(servo_angles[Z_PROBE_SERVO_NR][1]); // Stow safe_delay(500); stow_state = READ(PROBE_TEST_PIN); } while (++i < 4); @@ -226,7 +226,7 @@ inline void servo_probe_test() { } // Ask the user for a trigger event and measure the pulse width. - MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][0]); // Deploy + servo[probe_index].move(servo_angles[Z_PROBE_SERVO_NR][0]); // Deploy safe_delay(500); SERIAL_ECHOLNPGM("** Please trigger probe within 30 sec **"); uint16_t probe_counter = 0; @@ -256,7 +256,7 @@ inline void servo_probe_test() { } else SERIAL_ECHOLNPGM("FAIL: Noise detected - please re-run test"); - MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][1]); // Stow + servo[probe_index].move(servo_angles[Z_PROBE_SERVO_NR][1]); // Stow return; } } diff --git a/Marlin/src/gcode/control/M280.cpp b/Marlin/src/gcode/control/M280.cpp index 2a8e73eafbf2..930542999ee2 100644 --- a/Marlin/src/gcode/control/M280.cpp +++ b/Marlin/src/gcode/control/M280.cpp @@ -56,14 +56,14 @@ void GcodeSuite::M280() { while (PENDING(now, end)) { safe_delay(50); now = _MIN(millis(), end); - MOVE_SERVO(servo_index, LROUND(aold + (anew - aold) * (float(now - start) / t))); + servo[servo_index].move(LROUND(aold + (anew - aold) * (float(now - start) / t))); } } #endif // POLARGRAPH - MOVE_SERVO(servo_index, anew); + servo[servo_index].move(anew); } else - DETACH_SERVO(servo_index); + servo[servo_index].detach(); } else SERIAL_ECHO_MSG(" Servo ", servo_index, ": ", servo[servo_index].read()); diff --git a/Marlin/src/gcode/control/M282.cpp b/Marlin/src/gcode/control/M282.cpp index e6f5ce7dccc3..3ac5ac9f5bfc 100644 --- a/Marlin/src/gcode/control/M282.cpp +++ b/Marlin/src/gcode/control/M282.cpp @@ -36,7 +36,7 @@ void GcodeSuite::M282() { const int servo_index = parser.value_int(); if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) - DETACH_SERVO(servo_index); + servo[servo_index].detach(); else SERIAL_ECHO_MSG("Servo ", servo_index, " out of range"); diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 1b49e4d4d8b9..519a94d73833 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -343,7 +343,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { #elif HAS_Z_SERVO_PROBE - MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]); + servo[Z_PROBE_SERVO_NR].move(servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]); #elif EITHER(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY) diff --git a/Marlin/src/module/servo.cpp b/Marlin/src/module/servo.cpp index 96d5ba9da837..2782be1f2bd9 100644 --- a/Marlin/src/module/servo.cpp +++ b/Marlin/src/module/servo.cpp @@ -39,19 +39,19 @@ hal_servo_t servo[NUM_SERVOS]; void servo_init() { #if NUM_SERVOS >= 1 && HAS_SERVO_0 servo[0].attach(SERVO0_PIN); - DETACH_SERVO(0); // Just set up the pin. We don't have a position yet. Don't move to a random position. + servo[0].detach(); // Just set up the pin. We don't have a position yet. Don't move to a random position. #endif #if NUM_SERVOS >= 2 && HAS_SERVO_1 servo[1].attach(SERVO1_PIN); - DETACH_SERVO(1); + servo[1].detach(); #endif #if NUM_SERVOS >= 3 && HAS_SERVO_2 servo[2].attach(SERVO2_PIN); - DETACH_SERVO(2); + servo[2].detach(); #endif #if NUM_SERVOS >= 4 && HAS_SERVO_3 servo[3].attach(SERVO3_PIN); - DETACH_SERVO(3); + servo[3].detach(); #endif } diff --git a/Marlin/src/module/servo.h b/Marlin/src/module/servo.h index cd55a317a275..2ed992aa03f7 100644 --- a/Marlin/src/module/servo.h +++ b/Marlin/src/module/servo.h @@ -103,14 +103,11 @@ }; #if HAS_Z_SERVO_PROBE - #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][0]) - #define STOW_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][1]) + #define DEPLOY_Z_SERVO() servo[Z_PROBE_SERVO_NR].move(servo_angles[Z_PROBE_SERVO_NR][0]) + #define STOW_Z_SERVO() servo[Z_PROBE_SERVO_NR].move(servo_angles[Z_PROBE_SERVO_NR][1]) #endif #endif // HAS_SERVO_ANGLES -#define MOVE_SERVO(I, P) servo[I].move(P) -#define DETACH_SERVO(I) servo[I].detach() - extern hal_servo_t servo[NUM_SERVOS]; void servo_init(); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index f65de00f61ef..d9db3dce1cbd 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1881,7 +1881,7 @@ void Temperature::manage_heater() { #endif #if ENABLED(CHAMBER_VENT) flag_chamber_excess_heat = false; - MOVE_SERVO(CHAMBER_VENT_SERVO_NR, 90); + servo[CHAMBER_VENT_SERVO_NR].move(90); #endif } #endif @@ -1897,7 +1897,7 @@ void Temperature::manage_heater() { if (flag_chamber_excess_heat) { temp_chamber.soft_pwm_amount = 0; #if ENABLED(CHAMBER_VENT) - if (!flag_chamber_off) MOVE_SERVO(CHAMBER_VENT_SERVO_NR, temp_chamber.celsius <= temp_chamber.target ? 0 : 90); + if (!flag_chamber_off) servo[CHAMBER_VENT_SERVO_NR].move(temp_chamber.celsius <= temp_chamber.target ? 0 : 90); #endif } else { @@ -1910,7 +1910,7 @@ void Temperature::manage_heater() { temp_chamber.soft_pwm_amount = temp_chamber.celsius < temp_chamber.target ? (MAX_CHAMBER_POWER) >> 1 : 0; #endif #if ENABLED(CHAMBER_VENT) - if (!flag_chamber_off) MOVE_SERVO(CHAMBER_VENT_SERVO_NR, 0); + if (!flag_chamber_off) servo[CHAMBER_VENT_SERVO_NR].move(0); #endif } } diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index eda4d97d4e9f..d9920ae6fcae 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -116,7 +116,7 @@ void move_extruder_servo(const uint8_t e) { planner.synchronize(); if ((EXTRUDERS & 1) && e < EXTRUDERS - 1) { - MOVE_SERVO(_SERVO_NR(e), servo_angles[_SERVO_NR(e)][e & 1]); + servo[_SERVO_NR(e)].move(servo_angles[_SERVO_NR(e)][e & 1]); safe_delay(500); } } @@ -131,7 +131,7 @@ constexpr int8_t sns_index[2] = { SWITCHING_NOZZLE_SERVO_NR, SWITCHING_NOZZLE_E1_SERVO_NR }; constexpr int16_t sns_angles[2] = SWITCHING_NOZZLE_SERVO_ANGLES; planner.synchronize(); - MOVE_SERVO(sns_index[e], sns_angles[angle_index]); + servo[sns_index[e]].move(sns_angles[angle_index]); safe_delay(500); } @@ -142,7 +142,7 @@ void move_nozzle_servo(const uint8_t angle_index) { planner.synchronize(); - MOVE_SERVO(SWITCHING_NOZZLE_SERVO_NR, servo_angles[SWITCHING_NOZZLE_SERVO_NR][angle_index]); + servo[SWITCHING_NOZZLE_SERVO_NR].move(servo_angles[SWITCHING_NOZZLE_SERVO_NR][angle_index]); safe_delay(500); } @@ -443,7 +443,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. inline void switching_toolhead_lock(const bool locked) { #ifdef SWITCHING_TOOLHEAD_SERVO_ANGLES const uint16_t swt_angles[2] = SWITCHING_TOOLHEAD_SERVO_ANGLES; - MOVE_SERVO(SWITCHING_TOOLHEAD_SERVO_NR, swt_angles[locked ? 0 : 1]); + servo[SWITCHING_TOOLHEAD_SERVO_NR].move(swt_angles[locked ? 0 : 1]); #elif PIN_EXISTS(SWT_SOLENOID) OUT_WRITE(SWT_SOLENOID_PIN, locked); gcode.dwell(10); From 00527f38d59d8b466d515da801844197073c7bcc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Jun 2022 00:51:47 -0500 Subject: [PATCH 371/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Mis?= =?UTF-8?q?c.=20servo=20code=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/Servo.cpp | 2 +- Marlin/src/HAL/DUE/Servo.cpp | 21 ++++++++------------- Marlin/src/HAL/SAMD51/Servo.cpp | 4 ++-- Marlin/src/HAL/STM32F1/Servo.cpp | 16 ++++++++-------- Marlin/src/HAL/shared/servo.cpp | 13 +++++++------ Marlin/src/HAL/shared/servo_private.h | 12 ++++++------ 6 files changed, 32 insertions(+), 36 deletions(-) diff --git a/Marlin/src/HAL/AVR/Servo.cpp b/Marlin/src/HAL/AVR/Servo.cpp index 526352b77339..6dc1e2fb0732 100644 --- a/Marlin/src/HAL/AVR/Servo.cpp +++ b/Marlin/src/HAL/AVR/Servo.cpp @@ -66,7 +66,7 @@ static volatile int8_t Channel[_Nbr_16timers]; // counter for the s /************ static functions common to all instances ***********************/ -static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) { +static inline void handle_interrupts(const timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) { if (Channel[timer] < 0) *TCNTn = 0; // channel set to -1 indicated that refresh interval completed so reset the timer else { diff --git a/Marlin/src/HAL/DUE/Servo.cpp b/Marlin/src/HAL/DUE/Servo.cpp index 5524aa9cef47..72a7d649ef04 100644 --- a/Marlin/src/HAL/DUE/Servo.cpp +++ b/Marlin/src/HAL/DUE/Servo.cpp @@ -52,7 +52,7 @@ static volatile int8_t Channel[_Nbr_16timers]; // counter for the s // ------------------------ /// Interrupt handler for the TC0 channel 1. // ------------------------ -void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel); +void Servo_Handler(const timer16_Sequence_t, Tc*, const uint8_t); #ifdef _useTimer1 void HANDLER_FOR_TIMER1() { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); } @@ -70,7 +70,7 @@ void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel); void HANDLER_FOR_TIMER5() { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); } #endif -void Servo_Handler(timer16_Sequence_t timer, Tc *tc, uint8_t channel) { +void Servo_Handler(const timer16_Sequence_t timer, Tc *tc, const uint8_t channel) { // clear interrupt tc->TC_CHANNEL[channel].TC_SR; if (Channel[timer] < 0) @@ -113,26 +113,21 @@ static void _initISR(Tc *tc, uint32_t channel, uint32_t id, IRQn_Type irqn) { TC_Start(tc, channel); } -void initISR(timer16_Sequence_t timer) { +void initISR(const timer16_Sequence_t timer) { #ifdef _useTimer1 - if (timer == _timer1) - _initISR(TC_FOR_TIMER1, CHANNEL_FOR_TIMER1, ID_TC_FOR_TIMER1, IRQn_FOR_TIMER1); + if (timer == _timer1) _initISR(TC_FOR_TIMER1, CHANNEL_FOR_TIMER1, ID_TC_FOR_TIMER1, IRQn_FOR_TIMER1); #endif #ifdef _useTimer2 - if (timer == _timer2) - _initISR(TC_FOR_TIMER2, CHANNEL_FOR_TIMER2, ID_TC_FOR_TIMER2, IRQn_FOR_TIMER2); + if (timer == _timer2) _initISR(TC_FOR_TIMER2, CHANNEL_FOR_TIMER2, ID_TC_FOR_TIMER2, IRQn_FOR_TIMER2); #endif #ifdef _useTimer3 - if (timer == _timer3) - _initISR(TC_FOR_TIMER3, CHANNEL_FOR_TIMER3, ID_TC_FOR_TIMER3, IRQn_FOR_TIMER3); + if (timer == _timer3) _initISR(TC_FOR_TIMER3, CHANNEL_FOR_TIMER3, ID_TC_FOR_TIMER3, IRQn_FOR_TIMER3); #endif #ifdef _useTimer4 - if (timer == _timer4) - _initISR(TC_FOR_TIMER4, CHANNEL_FOR_TIMER4, ID_TC_FOR_TIMER4, IRQn_FOR_TIMER4); + if (timer == _timer4) _initISR(TC_FOR_TIMER4, CHANNEL_FOR_TIMER4, ID_TC_FOR_TIMER4, IRQn_FOR_TIMER4); #endif #ifdef _useTimer5 - if (timer == _timer5) - _initISR(TC_FOR_TIMER5, CHANNEL_FOR_TIMER5, ID_TC_FOR_TIMER5, IRQn_FOR_TIMER5); + if (timer == _timer5) _initISR(TC_FOR_TIMER5, CHANNEL_FOR_TIMER5, ID_TC_FOR_TIMER5, IRQn_FOR_TIMER5); #endif } diff --git a/Marlin/src/HAL/SAMD51/Servo.cpp b/Marlin/src/HAL/SAMD51/Servo.cpp index 23ab21c615c4..04461653f94f 100644 --- a/Marlin/src/HAL/SAMD51/Servo.cpp +++ b/Marlin/src/HAL/SAMD51/Servo.cpp @@ -124,7 +124,7 @@ HAL_SERVO_TIMER_ISR() { } } -void initISR(timer16_Sequence_t timer) { +void initISR(const timer16_Sequence_t timer) { Tc * const tc = timer_config[SERVO_TC].pTc; const uint8_t tcChannel = TIMER_TCCHANNEL(timer); @@ -201,7 +201,7 @@ void initISR(timer16_Sequence_t timer) { } } -void finISR(timer16_Sequence_t timer) { +void finISR(const timer16_Sequence_t timer) { Tc * const tc = timer_config[SERVO_TC].pTc; const uint8_t tcChannel = TIMER_TCCHANNEL(timer); diff --git a/Marlin/src/HAL/STM32F1/Servo.cpp b/Marlin/src/HAL/STM32F1/Servo.cpp index 8dc1ef7b6a5b..47ffb631cf8f 100644 --- a/Marlin/src/HAL/STM32F1/Servo.cpp +++ b/Marlin/src/HAL/STM32F1/Servo.cpp @@ -147,17 +147,17 @@ void libServo::move(const int32_t value) { uint16_t SR = timer_get_status(tdev); if (SR & TIMER_SR_CC1IF) { // channel 1 off #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(SERVO0_PIN, 1); // off + OUT_WRITE_OD(SERVO0_PIN, HIGH); // off #else - OUT_WRITE(SERVO0_PIN, 0); + OUT_WRITE(SERVO0_PIN, LOW); #endif timer_reset_status_bit(tdev, TIMER_SR_CC1IF_BIT); } if (SR & TIMER_SR_CC2IF) { // channel 2 resume #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(SERVO0_PIN, 0); // on + OUT_WRITE_OD(SERVO0_PIN, LOW); // on #else - OUT_WRITE(SERVO0_PIN, 1); + OUT_WRITE(SERVO0_PIN, HIGH); #endif timer_reset_status_bit(tdev, TIMER_SR_CC2IF_BIT); } @@ -167,9 +167,9 @@ void libServo::move(const int32_t value) { timer_dev *tdev = HAL_get_timer_dev(MF_TIMER_SERVO0); if (!tdev) return false; #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(inPin, 1); + OUT_WRITE_OD(inPin, HIGH); #else - OUT_WRITE(inPin, 0); + OUT_WRITE(inPin, LOW); #endif timer_pause(tdev); @@ -200,9 +200,9 @@ void libServo::move(const int32_t value) { timer_disable_irq(tdev, 1); timer_disable_irq(tdev, 2); #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(pin, 1); // off + OUT_WRITE_OD(pin, HIGH); // off #else - OUT_WRITE(pin, 0); + OUT_WRITE(pin, LOW); #endif } } diff --git a/Marlin/src/HAL/shared/servo.cpp b/Marlin/src/HAL/shared/servo.cpp index cfec6f301737..b838800de654 100644 --- a/Marlin/src/HAL/shared/servo.cpp +++ b/Marlin/src/HAL/shared/servo.cpp @@ -65,7 +65,7 @@ uint8_t ServoCount = 0; // the total number of attached /************ static functions common to all instances ***********************/ -static boolean isTimerActive(timer16_Sequence_t timer) { +static bool anyTimerChannelActive(const timer16_Sequence_t timer) { // returns true if any servo is active on this timer LOOP_L_N(channel, SERVOS_PER_TIMER) { if (SERVO(timer, channel).Pin.isActive) @@ -101,17 +101,18 @@ int8_t Servo::attach(const int inPin, const int inMin, const int inMax) { max = (MAX_PULSE_WIDTH - inMax) / 4; // initialize the timer if it has not already been initialized - timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex); - if (!isTimerActive(timer)) initISR(timer); - servo_info[servoIndex].Pin.isActive = true; // this must be set after the check for isTimerActive + const timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex); + if (!anyTimerChannelActive(timer)) initISR(timer); + servo_info[servoIndex].Pin.isActive = true; // this must be set after the check for anyTimerChannelActive return servoIndex; } void Servo::detach() { servo_info[servoIndex].Pin.isActive = false; - timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex); - if (!isTimerActive(timer)) finISR(timer); + const timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex); + if (!anyTimerChannelActive(timer)) finISR(timer); + //pinMode(servo_info[servoIndex].Pin.nbr, INPUT); // set servo pin to input } void Servo::write(int value) { diff --git a/Marlin/src/HAL/shared/servo_private.h b/Marlin/src/HAL/shared/servo_private.h index d85d8da8ba43..021e0cb81d01 100644 --- a/Marlin/src/HAL/shared/servo_private.h +++ b/Marlin/src/HAL/shared/servo_private.h @@ -70,10 +70,10 @@ #define ticksToUs(_ticks) (unsigned(_ticks) * (SERVO_TIMER_PRESCALER) / clockCyclesPerMicrosecond()) // convenience macros -#define SERVO_INDEX_TO_TIMER(_servo_nbr) ((timer16_Sequence_t)(_servo_nbr / (SERVOS_PER_TIMER))) // returns the timer controlling this servo -#define SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % (SERVOS_PER_TIMER)) // returns the index of the servo on this timer -#define SERVO_INDEX(_timer,_channel) ((_timer*(SERVOS_PER_TIMER)) + _channel) // macro to access servo index by timer and channel -#define SERVO(_timer,_channel) (servo_info[SERVO_INDEX(_timer,_channel)]) // macro to access servo class by timer and channel +#define SERVO_INDEX_TO_TIMER(_servo_nbr) timer16_Sequence_t(_servo_nbr / (SERVOS_PER_TIMER)) // the timer controlling this servo +#define SERVO_INDEX_TO_CHANNEL(_servo_nbr) (_servo_nbr % (SERVOS_PER_TIMER)) // the index of the servo on this timer +#define SERVO_INDEX(_timer,_channel) ((_timer*(SERVOS_PER_TIMER)) + _channel) // servo index by timer and channel +#define SERVO(_timer,_channel) servo_info[SERVO_INDEX(_timer,_channel)] // servo class by timer and channel // Types @@ -94,5 +94,5 @@ extern ServoInfo_t servo_info[MAX_SERVOS]; // Public functions -extern void initISR(timer16_Sequence_t timer); -extern void finISR(timer16_Sequence_t timer); +extern void initISR(const timer16_Sequence_t timer); +extern void finISR(const timer16_Sequence_t timer); From 571007e5c9a1e407ef7f72b555e1d207be2f256f Mon Sep 17 00:00:00 2001 From: Steven Haigh Date: Sat, 11 Jun 2022 12:08:55 +1000 Subject: [PATCH 372/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20ProUI=20compile=20?= =?UTF-8?q?(#24310)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 951f469e1c60..1a3a3abfab58 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -49,6 +49,7 @@ #include "../../../core/types.h" #include "../../marlinui.h" #include "../../../sd/cardreader.h" +#include "../../../MarlinCore.h" // for wait_for_user #include "dwin_lcd.h" #include "dwinui.h" #include "dwin.h" From f976e56a1993adede0ed854326e0cab214d90295 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 11 Jun 2022 17:03:20 +1200 Subject: [PATCH 373/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20JGAurora=20A5S=20A?= =?UTF-8?q?1=20build=20(#24326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/stm32f1.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 6bf6a1cb851c..a4ad79adfaff 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -330,7 +330,6 @@ extends = stm32_variant board = genericSTM32F103ZE board_build.variant = MARLIN_F103Zx board_build.offset = 0xA000 -board_build.rename = firmware_for_sd_upload.bin board_upload.offset_address = 0x0800A000 build_flags = ${stm32_variant.build_flags} -DSTM32F1xx -DSTM32_XL_DENSITY From f31178f868882905d210504e763052ca639782f9 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Tue, 14 Jun 2022 13:38:19 +1200 Subject: [PATCH 374/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20missing=20ProUI=20?= =?UTF-8?q?cpp=20wrapper=20(#24313)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 1a3a3abfab58..adb23a96646b 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -42,6 +42,9 @@ * For commercial applications additional licenses can be requested */ +#include "../../../inc/MarlinConfigPre.h" +#if ENABLED(DWIN_LCD_PROUI) + #include "dwin_defines.h" #if HAS_GCODE_PREVIEW @@ -252,3 +255,4 @@ void Preview_Reset() { } #endif // HAS_GCODE_PREVIEW +#endif // DWIN_LCD_PROUI From 5408259f51394e2c2a48879c0119251f324f0e12 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 13 Jun 2022 20:43:23 -0500 Subject: [PATCH 375/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20App?= =?UTF-8?q?ly=20F()=20to=20some=20LCD=20/=20TFT=20strings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #24228 --- Marlin/src/gcode/queue.cpp | 5 ++-- Marlin/src/gcode/queue.h | 3 +- Marlin/src/lcd/e3v2/common/dwin_api.h | 10 +++++-- Marlin/src/lcd/e3v2/creality/dwin.cpp | 10 +++++-- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 12 ++++---- .../lcd/e3v2/marlinui/ui_status_480x272.cpp | 20 ++++++------- .../src/lcd/extui/dgus/DGUSScreenHandler.cpp | 13 +++------ .../bioprinter/printing_dialog_box.cpp | 22 +++++++++------ .../bioprinter/status_screen.cpp | 6 ++-- .../ftdi_eve_lib/extended/text_box.cpp | 10 +++++-- .../ftdi_eve_lib/extended/unicode/unicode.cpp | 10 +++++-- .../generic/dialog_box_base_class.cpp | 5 ++-- .../generic/dialog_box_base_class.h | 7 +++-- .../generic/status_screen.cpp | 12 +++++--- Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp | 16 +++++++---- Marlin/src/lcd/extui/ui_api.cpp | 20 +++++++++---- Marlin/src/lcd/menu/menu.h | 12 +++++--- Marlin/src/lcd/tft/ui_1024x600.cpp | 28 ++++++++++++------- Marlin/src/lcd/tft/ui_320x240.cpp | 24 ++++++++-------- Marlin/src/lcd/tft/ui_480x320.cpp | 24 ++++++++-------- 20 files changed, 160 insertions(+), 109 deletions(-) diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 2250cd3b7452..454a009b8598 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -196,14 +196,15 @@ bool GCodeQueue::process_injected_command() { * Never call this from a G-code handler! */ void GCodeQueue::enqueue_one_now(const char * const cmd) { while (!enqueue_one(cmd)) idle(); } +void GCodeQueue::enqueue_one_now(FSTR_P const fcmd) { while (!enqueue_one(fcmd)) idle(); } /** * Attempt to enqueue a single G-code command * and return 'true' if successful. */ -bool GCodeQueue::enqueue_one(FSTR_P const fgcode) { +bool GCodeQueue::enqueue_one(FSTR_P const fcmd) { size_t i = 0; - PGM_P p = FTOP(fgcode); + PGM_P p = FTOP(fcmd); char c; while ((c = pgm_read_byte(&p[i])) && c != '\n') i++; char cmd[i + 1]; diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 1a2baaa6bbc4..142283008001 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -141,12 +141,13 @@ class GCodeQueue { * Enqueue and return only when commands are actually enqueued */ static void enqueue_one_now(const char * const cmd); + static void enqueue_one_now(FSTR_P const fcmd); /** * Attempt to enqueue a single G-code command * and return 'true' if successful. */ - static bool enqueue_one(FSTR_P const fgcode); + static bool enqueue_one(FSTR_P const fcmd); /** * Enqueue with Serial Echo diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.h b/Marlin/src/lcd/e3v2/common/dwin_api.h index 81724c6edf97..dc97ef2723fa 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.h +++ b/Marlin/src/lcd/e3v2/common/dwin_api.h @@ -176,9 +176,13 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis, void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit=0xFFFF); inline void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, FSTR_P const ftitle) { - char ctitle[strlen_P(FTOP(ftitle)) + 1]; - strcpy_P(ctitle, FTOP(ftitle)); - DWIN_Draw_String(bShow, size, color, bColor, x, y, ctitle); + #ifdef __AVR__ + char ctitle[strlen_P(FTOP(ftitle)) + 1]; + strcpy_P(ctitle, FTOP(ftitle)); + DWIN_Draw_String(bShow, size, color, bColor, x, y, ctitle); + #else + DWIN_Draw_String(bShow, size, color, bColor, x, y, FTOP(ftitle)); + #endif } // Draw a positive integer diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index b2cb1bee30ce..3ca7627db086 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -4307,9 +4307,13 @@ void DWIN_StatusChanged(const char * const cstr/*=nullptr*/) { } void DWIN_StatusChanged(FSTR_P const fstr) { - char str[strlen_P(FTOP(fstr)) + 1]; - strcpy_P(str, FTOP(fstr)); - DWIN_StatusChanged(str); + #ifdef __AVR__ + char str[strlen_P(FTOP(fstr)) + 1]; + strcpy_P(str, FTOP(fstr)); + DWIN_StatusChanged(str); + #else + DWIN_StatusChanged(FTOP(fstr)); + #endif } #endif // DWIN_CREALITY_LCD diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index f01a2beddf4e..ce1758f1da64 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -274,7 +274,7 @@ void MarlinUI::draw_status_message(const bool blink) { dwin_font.solid = false; dwin_font.fg = Color_White; - dwin_string.set("E"); + dwin_string.set('E'); dwin_string.add('1' + extruder); dwin_string.add(' '); dwin_string.add(i16tostr3rj(thermalManager.degHotend(extruder))); @@ -282,7 +282,7 @@ void MarlinUI::draw_status_message(const bool blink) { if (get_blink() || !thermalManager.heater_idle[thermalManager.idle_index_for_id(extruder)].timed_out) dwin_string.add(i16tostr3rj(thermalManager.degTargetHotend(extruder))); else - dwin_string.add(PSTR(" ")); + dwin_string.add(F(" ")); lcd_moveto(LCD_WIDTH - dwin_string.length, row); lcd_put_dwin_string(); @@ -540,11 +540,11 @@ void MarlinUI::draw_status_message(const bool blink) { lcd_put_u8str(ftostr52(lpos.y)); // Print plot position - dwin_string.set("("); + dwin_string.set('('); dwin_string.add(i8tostr3rj(x_plot)); - dwin_string.add(","); + dwin_string.add(','); dwin_string.add(i8tostr3rj(y_plot)); - dwin_string.add(")"); + dwin_string.add(')'); lcd_moveto( TERN(DWIN_MARLINUI_LANDSCAPE, ((x_offset + x_map_pixels) / MENU_FONT_WIDTH) + 2, LCD_WIDTH - dwin_string.length), TERN(DWIN_MARLINUI_LANDSCAPE, LCD_HEIGHT - 2, ((y_offset + y_map_pixels) / MENU_LINE_HEIGHT) + 1) @@ -556,7 +556,7 @@ void MarlinUI::draw_status_message(const bool blink) { if (!isnan(bedlevel.z_values[x_plot][y_plot])) dwin_string.add(ftostr43sign(bedlevel.z_values[x_plot][y_plot])); else - dwin_string.add(PSTR(" -----")); + dwin_string.add(F(" -----")); lcd_moveto( TERN(DWIN_MARLINUI_LANDSCAPE, ((x_offset + x_map_pixels) / MENU_FONT_WIDTH) + 2, LCD_WIDTH - dwin_string.length), TERN(DWIN_MARLINUI_LANDSCAPE, LCD_HEIGHT - 1, ((y_offset + y_map_pixels) / MENU_LINE_HEIGHT) + 2) diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index 810eaf361a09..56fd8cadc0ad 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -88,7 +88,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const // For E_TOTAL there may be some characters to cover up if (BOTH(DWIN_MARLINUI_PORTRAIT, LCD_SHOW_E_TOTAL) && axis == X_AXIS) - dwin_string.add(" "); + dwin_string.add(F(" ")); DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + 32, S(dwin_string.string())); @@ -117,7 +117,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const // For E_TOTAL there may be some characters to cover up if (ENABLED(LCD_SHOW_E_TOTAL) && (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) && axis == X_AXIS) - dwin_string.add(" "); + dwin_string.add(F(" ")); DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x + 32, y + 4, S(dwin_string.string())); @@ -133,7 +133,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const if (!ui.did_first_redraw) { // Extra spaces to erase previous value - dwin_string.set("E "); + dwin_string.set(F("E ")); DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (4 * 14 / 2) - 7, y + 2, S(dwin_string.string())); } @@ -146,7 +146,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #else // !DWIN_MARLINUI_PORTRAIT if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) { - dwin_string.set("E "); + dwin_string.set(F("E ")); DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x, y, S(dwin_string.string())); } @@ -176,7 +176,7 @@ FORCE_INLINE void _draw_fan_status(const uint16_t x, const uint16_t y) { else { DWIN_ICON_AnimationControl(0x0000); // disable all icon animations (this is the only one) DWIN_ICON_Show(ICON, ICON_Fan0, x + fanx, y); - dwin_string.set(PSTR(" ")); + dwin_string.set(F(" ")); DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + STATUS_FAN_HEIGHT, S(dwin_string.string())); } } @@ -289,7 +289,7 @@ FORCE_INLINE void _draw_feedrate_status(const char *value, uint16_t x, uint16_t } dwin_string.set(value); - dwin_string.add(PSTR("%")); + dwin_string.add('%'); DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x + 14, y, S(dwin_string.string())); } @@ -396,7 +396,7 @@ void MarlinUI::draw_status_screen() { // landscape mode shows both elapsed and remaining (if SHOW_REMAINING_TIME) time = print_job_timer.duration(); time.toDigital(buffer); - dwin_string.set(" "); + dwin_string.set(' '); dwin_string.add(buffer); DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, 230, 170, S(dwin_string.string())); @@ -405,7 +405,7 @@ void MarlinUI::draw_status_screen() { time = get_remaining_time(); DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, 336, 170, S(" R ")); if (print_job_timer.isPaused() && blink) - dwin_string.set(" "); + dwin_string.set(F(" ")); else { time.toDigital(buffer); dwin_string.set(buffer); @@ -413,7 +413,7 @@ void MarlinUI::draw_status_screen() { DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, 378, 170, S(dwin_string.string())); } else if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) { - dwin_string.set(" "); + dwin_string.set(F(" ")); DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, 336, 170, S(dwin_string.string())); } #endif @@ -449,7 +449,7 @@ void MarlinUI::draw_status_screen() { #if ENABLED(SHOW_SD_PERCENT) dwin_string.set(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(progress), ui8tostr3rj(progress / (PROGRESS_SCALE)))); - dwin_string.add(PSTR("%")); + dwin_string.add('%'); DWIN_Draw_String( false, font16x32, Percent_Color, Color_Bg_Black, pb_left + (pb_width - dwin_string.length * 16) / 2, diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index dc872bff3b0e..88326466c092 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -474,13 +474,8 @@ void DGUSScreenHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr void DGUSScreenHandler::HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr) { DEBUG_ECHOLNPGM("HandleMotorLockUnlock"); - - char buf[4]; const int16_t lock = swap16(*(uint16_t*)val_ptr); - strcpy_P(buf, lock ? PSTR("M18") : PSTR("M17")); - - //DEBUG_ECHOPGM(" ", buf); - queue.enqueue_one_now(buf); + queue.enqueue_one_now(lock ? F("M18") : F("M17")); } void DGUSScreenHandler::HandleSettings(DGUS_VP_Variable &var, void *val_ptr) { @@ -552,23 +547,23 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo #if HAS_HOTEND case VP_PID_AUTOTUNE_E0: // Autotune Extruder 0 sprintf_P(buf, PSTR("M303 E%d C5 S210 U1"), ExtUI::extruder_t::E0); + queue.enqueue_one_now(buf); break; #endif #if HAS_MULTI_HOTEND case VP_PID_AUTOTUNE_E1: sprintf_P(buf, PSTR("M303 E%d C5 S210 U1"), ExtUI::extruder_t::E1); + queue.enqueue_one_now(buf); break; #endif #endif #if ENABLED(PIDTEMPBED) case VP_PID_AUTOTUNE_BED: - strcpy_P(buf, PSTR("M303 E-1 C5 S70 U1")); + queue.enqueue_one_now(F("M303 E-1 C5 S70 U1")); break; #endif } - if (buf[0]) queue.enqueue_one_now(buf); - #if ENABLED(DGUS_UI_WAITING) sendinfoscreen(F("PID is autotuning"), F("please wait"), NUL_STR, NUL_STR, true, true, true, true); GotoScreen(DGUSLCD_SCREEN_WAITING); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp index 79a49c79a631..4af38dcb9df7 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/printing_dialog_box.cpp @@ -32,12 +32,12 @@ using namespace Theme; #define GRID_COLS 2 #define GRID_ROWS 9 -void BioPrintingDialogBox::draw_status_message(draw_mode_t what, const char *message) { +void BioPrintingDialogBox::draw_status_message(draw_mode_t what, const char *cmsg) { if (what & BACKGROUND) { CommandProcessor cmd; cmd.cmd(COLOR_RGB(bg_text_enabled)) .tag(0); - draw_text_box(cmd, BTN_POS(1,2), BTN_SIZE(2,2), message, OPT_CENTER, font_large); + draw_text_box(cmd, BTN_POS(1,2), BTN_SIZE(2,2), cmsg, OPT_CENTER, font_large); } } @@ -105,26 +105,30 @@ bool BioPrintingDialogBox::onTouchEnd(uint8_t tag) { return true; } -void BioPrintingDialogBox::setStatusMessage(FSTR_P message) { - char buff[strlen_P(FTOP(message)) + 1]; - strcpy_P(buff, FTOP(message)); - setStatusMessage(buff); +void BioPrintingDialogBox::setStatusMessage(FSTR_P fmsg) { + #ifdef __AVR__ + char buff[strlen_P(FTOP(fmsg)) + 1]; + strcpy_P(buff, FTOP(fmsg)); + setStatusMessage(buff); + #else + setStatusMessage(FTOP(fmsg)); + #endif } -void BioPrintingDialogBox::setStatusMessage(const char *message) { +void BioPrintingDialogBox::setStatusMessage(const char *cmsg) { CommandProcessor cmd; cmd.cmd(CMD_DLSTART) .cmd(CLEAR_COLOR_RGB(bg_color)) .cmd(CLEAR(true,true,true)); - draw_status_message(BACKGROUND, message); + draw_status_message(BACKGROUND, cmsg); draw_progress(BACKGROUND); draw_time_remaining(BACKGROUND); draw_interaction_buttons(BACKGROUND); storeBackground(); #if ENABLED(TOUCH_UI_DEBUG) - SERIAL_ECHO_MSG("New status message: ", message); + SERIAL_ECHO_MSG("New status message: ", cmsg); #endif if (AT_SCREEN(BioPrintingDialogBox)) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp index a6674bed90b6..9fb56bce11f7 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp @@ -122,7 +122,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) { ui.bounds(POLY(bed_temp), x, y, h, v); cmd.text(x, y, h, v, str); - #endif + #endif } } @@ -354,8 +354,8 @@ bool StatusScreen::onTouchHeld(uint8_t tag) { return false; } -void StatusScreen::setStatusMessage(FSTR_P pstr) { - BioPrintingDialogBox::setStatusMessage(pstr); +void StatusScreen::setStatusMessage(FSTR_P fstr) { + BioPrintingDialogBox::setStatusMessage(fstr); } void StatusScreen::setStatusMessage(const char * const str) { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp index c75cdf18121a..d2f95d1f6e79 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp @@ -136,9 +136,13 @@ namespace FTDI { } void draw_text_box(CommandProcessor& cmd, int x, int y, int w, int h, FSTR_P fstr, uint16_t options, uint8_t font) { - char str[strlen_P(FTOP(fstr)) + 1]; - strcpy_P(str, FTOP(fstr)); - draw_text_box(cmd, x, y, w, h, (const char*) str, options, font); + #ifdef __AVR__ + char str[strlen_P(FTOP(fstr)) + 1]; + strcpy_P(str, FTOP(fstr)); + draw_text_box(cmd, x, y, w, h, (const char*) str, options, font); + #else + draw_text_box(cmd, x, y, w, h, FTOP(fstr), options, font); + #endif } } // namespace FTDI diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp index ab52a59b9acc..6f189155f5de 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -192,9 +192,13 @@ } uint16_t FTDI::get_utf8_text_width(FSTR_P fstr, font_size_t fs) { - char str[strlen_P(FTOP(fstr)) + 1]; - strcpy_P(str, FTOP(fstr)); - return get_utf8_text_width(str, fs); + #ifdef __AVR__ + char str[strlen_P(FTOP(fstr)) + 1]; + strcpy_P(str, FTOP(fstr)); + return get_utf8_text_width(str, fs); + #else + return get_utf8_text_width(FTOP(fstr), fs); + #endif } /** diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.cpp index b6f69bc33e95..a006d30942d9 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.cpp @@ -32,7 +32,7 @@ using namespace Theme; #define GRID_ROWS 8 template -void DialogBoxBaseClass::drawMessage(T message, int16_t font) { +void DialogBoxBaseClass::drawMessage(T message, const int16_t font) { CommandProcessor cmd; cmd.cmd(CMD_DLSTART) .cmd(CLEAR_COLOR_RGB(bg_color)) @@ -43,8 +43,7 @@ void DialogBoxBaseClass::drawMessage(T message, int16_t font) { cmd.colors(normal_btn); } -template void DialogBoxBaseClass::drawMessage(const char *, int16_t font); -template void DialogBoxBaseClass::drawMessage(FSTR_P, int16_t font); +template void DialogBoxBaseClass::drawMessage(PGM_P const, const int16_t); void DialogBoxBaseClass::drawYesNoButtons(uint8_t default_btn) { CommandProcessor cmd; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.h index c87640992866..fc05560b8cac 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.h @@ -27,12 +27,15 @@ class DialogBoxBaseClass : public BaseScreen { protected: - template static void drawMessage(T, int16_t font = 0); + template static void drawMessage(T, const int16_t font=0); + static void drawMessage(FSTR_P const fstr, const int16_t font=0) { drawMessage(FTOP(fstr), font); } + template static void drawButton(T); static void drawYesNoButtons(uint8_t default_btn = 0); static void drawOkayButton(); - static void onRedraw(draw_mode_t) {}; + static void onRedraw(draw_mode_t) {} + public: static bool onTouchEnd(uint8_t tag); static void onIdle(); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp index 43f33fb3bf0b..f1c65357e017 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp @@ -332,10 +332,14 @@ void StatusScreen::draw_status_message(draw_mode_t what, const char *message) { } } -void StatusScreen::setStatusMessage(FSTR_P message) { - char buff[strlen_P(FTOP(message)) + 1]; - strcpy_P(buff, FTOP(message)); - setStatusMessage((const char *) buff); +void StatusScreen::setStatusMessage(FSTR_P fmsg) { + #ifdef __AVR__ + char buff[strlen_P(FTOP(fmsg)) + 1]; + strcpy_P(buff, FTOP(fmsg)); + setStatusMessage((const char *)buff); + #else + setStatusMessage(FTOP(fmsg)); + #endif } void StatusScreen::setStatusMessage(const char *message) { diff --git a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp index c679751ebe90..00bb9833fc72 100644 --- a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp +++ b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp @@ -711,12 +711,16 @@ void disp_assets_update() { } void disp_assets_update_progress(FSTR_P const fmsg) { - static constexpr int buflen = 30; - char buf[buflen]; - memset(buf, ' ', buflen); - strncpy_P(buf, FTOP(fmsg), buflen - 1); - buf[buflen - 1] = '\0'; - disp_string(100, 165, buf, 0xFFFF, 0x0000); + #ifdef __AVR__ + static constexpr int buflen = 30; + char buf[buflen]; + memset(buf, ' ', buflen); + strncpy_P(buf, FTOP(fmsg), buflen - 1); + buf[buflen - 1] = '\0'; + disp_string(100, 165, buf, 0xFFFF, 0x0000); + #else + disp_string(100, 165, FTOP(fmsg), 0xFFFF, 0x0000); + #endif } #if BOTH(MKS_TEST, SDSUPPORT) diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 2aa3f44a8380..5791865568a6 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -1082,15 +1082,23 @@ namespace ExtUI { // Simplest approach is to make an SRAM copy void onUserConfirmRequired(FSTR_P const fstr) { - char msg[strlen_P(FTOP(fstr)) + 1]; - strcpy_P(msg, FTOP(fstr)); - onUserConfirmRequired(msg); + #ifdef __AVR__ + char msg[strlen_P(FTOP(fstr)) + 1]; + strcpy_P(msg, FTOP(fstr)); + onUserConfirmRequired(msg); + #else + onUserConfirmRequired(FTOP(fstr)); + #endif } void onStatusChanged(FSTR_P const fstr) { - char msg[strlen_P(FTOP(fstr)) + 1]; - strcpy_P(msg, FTOP(fstr)); - onStatusChanged(msg); + #ifdef __AVR__ + char msg[strlen_P(FTOP(fstr)) + 1]; + strcpy_P(msg, FTOP(fstr)); + onStatusChanged(msg); + #else + onStatusChanged(FTOP(fstr)); + #endif } FileList::FileList() { refresh(); } diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 3e88f68690a6..b65214f7b572 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -113,11 +113,15 @@ class MenuItem_confirm : public MenuItemBase { static void select_screen( FSTR_P const yes, FSTR_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, - FSTR_P const pref, FSTR_P const string, FSTR_P const suff=nullptr + FSTR_P const pref, FSTR_P const fstr, FSTR_P const suff=nullptr ) { - char str[strlen_P(FTOP(string)) + 1]; - strcpy_P(str, FTOP(string)); - select_screen(yes, no, yesFunc, noFunc, pref, str, suff); + #ifdef __AVR__ + char str[strlen_P(FTOP(fstr)) + 1]; + strcpy_P(str, FTOP(fstr)); + select_screen(yes, no, yesFunc, noFunc, pref, str, suff); + #else + select_screen(yes, no, yesFunc, noFunc, pref, FTOP(fstr), suff); + #endif } // Shortcut for prompt with "NO"/ "YES" labels FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr) { diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index a1b6ee69e3b2..15a51f56b8ec 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -271,19 +271,25 @@ void MarlinUI::draw_status_screen() { else { tft.add_text(200, 3, COLOR_AXIS_HOMED , "X"); const bool nhx = axis_should_home(X_AXIS); - tft_string.set(blink && nhx ? "?" : ftostr4sign(LOGICAL_X_POSITION(current_position.x))); + if (blink && nhx) + tft_string.set('?'); + else + tft_string.set(ftostr4sign(LOGICAL_X_POSITION(current_position.x))); tft.add_text(300 - tft_string.width(), 3, nhx ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); tft.add_text(500, 3, COLOR_AXIS_HOMED , "Y"); const bool nhy = axis_should_home(Y_AXIS); - tft_string.set(blink && nhy ? "?" : ftostr4sign(LOGICAL_Y_POSITION(current_position.y))); + if (blink && nhy) + tft_string.set('?'); + else + tft_string.set(ftostr4sign(LOGICAL_Y_POSITION(current_position.y))); tft.add_text(600 - tft_string.width(), 3, nhy ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); } tft.add_text(800, 3, COLOR_AXIS_HOMED , "Z"); uint16_t offset = 32; const bool nhz = axis_should_home(Z_AXIS); if (blink && nhz) - tft_string.set("?"); + tft_string.set('?'); else { const float z = LOGICAL_Z_POSITION(current_position.z); tft_string.set(ftostr52sp((int16_t)z)); @@ -479,7 +485,7 @@ void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, con tft_string.add(' '); tft_string.add(i16tostr3rj(thermalManager.wholeDegHotend(extruder))); tft_string.add(LCD_STR_DEGREE); - tft_string.add(" / "); + tft_string.add(F(" / ")); tft_string.add(i16tostr3rj(thermalManager.degTargetHotend(extruder))); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); @@ -607,19 +613,19 @@ static void quick_feedback() { #define CUR_STEP_VALUE_WIDTH 104 static void drawCurStepValue() { tft_string.set(ftostr52sp(motionAxisState.currentStepSize)); - tft_string.add("mm"); + tft_string.add(F("mm")); tft.canvas(motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT); tft.set_background(COLOR_BACKGROUND); tft.add_text(tft_string.center(CUR_STEP_VALUE_WIDTH), 0, COLOR_AXIS_HOMED, tft_string); } static void drawCurZSelection() { - tft_string.set("Z"); + tft_string.set('Z'); tft.canvas(motionAxisState.zTypePos.x, motionAxisState.zTypePos.y, tft_string.width(), 34); tft.set_background(COLOR_BACKGROUND); tft.add_text(0, 0, Z_BTN_COLOR, tft_string); tft.queue.sync(); - tft_string.set("Offset"); + tft_string.set(F("Offset")); tft.canvas(motionAxisState.zTypePos.x, motionAxisState.zTypePos.y + 34, tft_string.width(), 34); tft.set_background(COLOR_BACKGROUND); if (motionAxisState.z_selection == Z_SELECTION_Z_PROBE) { @@ -630,17 +636,19 @@ static void drawCurZSelection() { static void drawCurESelection() { tft.canvas(motionAxisState.eNamePos.x, motionAxisState.eNamePos.y, BTN_WIDTH, BTN_HEIGHT); tft.set_background(COLOR_BACKGROUND); - tft_string.set("E"); + tft_string.set('E'); tft.add_text(0, 0, E_BTN_COLOR , tft_string); tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection)); } -static void drawMessage(const char *msg) { +static void drawMessage(PGM_P const msg) { tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 34, TFT_HEIGHT / 2, 34); tft.set_background(COLOR_BACKGROUND); tft.add_text(0, 0, COLOR_YELLOW, msg); } +static void drawMessage(FSTR_P const fmsg) { drawMessage(FTOP(fmsg)); } + static void drawAxisValue(const AxisEnum axis) { const float value = ( TERN_(HAS_BED_PROBE, axis == Z_AXIS && motionAxisState.z_selection == Z_SELECTION_Z_PROBE ? probe.offset.z :) @@ -666,7 +674,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage("Too cold"); + drawMessage(F("Too cold")); return; } #endif diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 15031d0da2ec..a4fcc35bd039 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -282,7 +282,7 @@ void MarlinUI::draw_status_screen() { const bool nhz = axis_should_home(Z_AXIS); uint16_t offset = 25; if (blink && nhz) - tft_string.set("?"); + tft_string.set('?'); else { const float z = LOGICAL_Z_POSITION(current_position.z); tft_string.set(ftostr52sp((int16_t)z)); @@ -461,7 +461,7 @@ void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, con tft_string.add(' '); tft_string.add(i16tostr3rj(thermalManager.wholeDegHotend(extruder))); tft_string.add(LCD_STR_DEGREE); - tft_string.add(" / "); + tft_string.add(F(" / ")); tft_string.add(i16tostr3rj(thermalManager.degTargetHotend(extruder))); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); @@ -593,19 +593,19 @@ static void drawCurStepValue() { tft.set_background(COLOR_BACKGROUND); tft.add_text(CUR_STEP_VALUE_WIDTH - tft_string.width(), 0, COLOR_AXIS_HOMED, tft_string); tft.queue.sync(); - tft_string.set("mm"); + tft_string.set(F("mm")); tft.canvas(motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y + 20, CUR_STEP_VALUE_WIDTH, 20); tft.set_background(COLOR_BACKGROUND); tft.add_text(CUR_STEP_VALUE_WIDTH - tft_string.width(), 0, COLOR_AXIS_HOMED, tft_string); } static void drawCurZSelection() { - tft_string.set("Z"); + tft_string.set('Z'); tft.canvas(motionAxisState.zTypePos.x, motionAxisState.zTypePos.y, tft_string.width(), 20); tft.set_background(COLOR_BACKGROUND); tft.add_text(0, 0, Z_BTN_COLOR, tft_string); tft.queue.sync(); - tft_string.set("Offset"); + tft_string.set(F("Offset")); tft.canvas(motionAxisState.zTypePos.x, motionAxisState.zTypePos.y + 34, tft_string.width(), 20); tft.set_background(COLOR_BACKGROUND); if (motionAxisState.z_selection == Z_SELECTION_Z_PROBE) { @@ -616,7 +616,7 @@ static void drawCurZSelection() { static void drawCurESelection() { tft.canvas(motionAxisState.eNamePos.x, motionAxisState.eNamePos.y, BTN_WIDTH, BTN_HEIGHT); tft.set_background(COLOR_BACKGROUND); - tft_string.set("E"); + tft_string.set('E'); tft.add_text(0, 0, E_BTN_COLOR , tft_string); tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection)); } @@ -627,6 +627,8 @@ static void drawMessage(PGM_P const msg) { tft.add_text(0, 0, COLOR_YELLOW, msg); } +static void drawMessage(FSTR_P const fmsg) { drawMessage(FTOP(fmsg)); } + static void drawAxisValue(const AxisEnum axis) { const float value = ( TERN_(HAS_BED_PROBE, axis == Z_AXIS && motionAxisState.z_selection == Z_SELECTION_Z_PROBE ? probe.offset.z :) @@ -652,7 +654,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage(PSTR("Too cold")); + drawMessage(F("Too cold")); return; } #endif @@ -679,18 +681,18 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { drawAxisValue(axis); } else { - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } #elif HAS_BED_PROBE // only change probe.offset.z probe.offset.z += diff; if (direction < 0 && current_position[axis] < Z_PROBE_OFFSET_RANGE_MIN) { current_position[axis] = Z_PROBE_OFFSET_RANGE_MIN; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } else if (direction > 0 && current_position[axis] > Z_PROBE_OFFSET_RANGE_MAX) { current_position[axis] = Z_PROBE_OFFSET_RANGE_MAX; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } else { drawMessage(NUL_STR); // clear the error @@ -752,7 +754,7 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } static void do_home() { quick_feedback(); - drawMessage(GET_TEXT(MSG_LEVEL_BED_HOMING)); + drawMessage(GET_TEXT_F(MSG_LEVEL_BED_HOMING)); queue.inject_P(G28_STR); // Disable touch until home is done TERN_(HAS_TFT_XPT2046, touch.disable()); diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 5a964525ecd1..8a5fa6335420 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -283,7 +283,7 @@ void MarlinUI::draw_status_screen() { uint16_t offset = 32; const bool nhz = axis_should_home(Z_AXIS); if (blink && nhz) - tft_string.set("?"); + tft_string.set('?'); else { const float z = LOGICAL_Z_POSITION(current_position.z); tft_string.set(ftostr52sp((int16_t)z)); @@ -466,7 +466,7 @@ void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, con tft_string.add(' '); tft_string.add(i16tostr3rj(thermalManager.wholeDegHotend(extruder))); tft_string.add(LCD_STR_DEGREE); - tft_string.add(" / "); + tft_string.add(F(" / ")); tft_string.add(i16tostr3rj(thermalManager.degTargetHotend(extruder))); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); @@ -594,19 +594,19 @@ static void quick_feedback() { #define CUR_STEP_VALUE_WIDTH 104 static void drawCurStepValue() { tft_string.set(ftostr52sp(motionAxisState.currentStepSize)); - tft_string.add("mm"); + tft_string.add(F("mm")); tft.canvas(motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT); tft.set_background(COLOR_BACKGROUND); tft.add_text(tft_string.center(CUR_STEP_VALUE_WIDTH), 0, COLOR_AXIS_HOMED, tft_string); } static void drawCurZSelection() { - tft_string.set("Z"); + tft_string.set('Z'); tft.canvas(motionAxisState.zTypePos.x, motionAxisState.zTypePos.y, tft_string.width(), 34); tft.set_background(COLOR_BACKGROUND); tft.add_text(0, 0, Z_BTN_COLOR, tft_string); tft.queue.sync(); - tft_string.set("Offset"); + tft_string.set(F("Offset")); tft.canvas(motionAxisState.zTypePos.x, motionAxisState.zTypePos.y + 34, tft_string.width(), 34); tft.set_background(COLOR_BACKGROUND); if (motionAxisState.z_selection == Z_SELECTION_Z_PROBE) { @@ -617,7 +617,7 @@ static void drawCurZSelection() { static void drawCurESelection() { tft.canvas(motionAxisState.eNamePos.x, motionAxisState.eNamePos.y, BTN_WIDTH, BTN_HEIGHT); tft.set_background(COLOR_BACKGROUND); - tft_string.set("E"); + tft_string.set('E'); tft.add_text(0, 0, E_BTN_COLOR , tft_string); tft.add_text(tft_string.width(), 0, E_BTN_COLOR, ui8tostr3rj(motionAxisState.e_selection)); } @@ -628,6 +628,8 @@ static void drawMessage(PGM_P const msg) { tft.add_text(0, 0, COLOR_YELLOW, msg); } +static void drawMessage(FSTR_P const fmsg) { drawMessage(FTOP(fmsg)); } + static void drawAxisValue(const AxisEnum axis) { const float value = ( TERN_(HAS_BED_PROBE, axis == Z_AXIS && motionAxisState.z_selection == Z_SELECTION_Z_PROBE ? probe.offset.z :) @@ -653,7 +655,7 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage(PSTR("Too cold")); + drawMessage(F("Too cold")); return; } #endif @@ -680,18 +682,18 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { drawAxisValue(axis); } else { - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } #elif HAS_BED_PROBE // only change probe.offset.z probe.offset.z += diff; if (direction < 0 && current_position[axis] < Z_PROBE_OFFSET_RANGE_MIN) { current_position[axis] = Z_PROBE_OFFSET_RANGE_MIN; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } else if (direction > 0 && current_position[axis] > Z_PROBE_OFFSET_RANGE_MAX) { current_position[axis] = Z_PROBE_OFFSET_RANGE_MAX; - drawMessage(GET_TEXT(MSG_LCD_SOFT_ENDSTOPS)); + drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } else { drawMessage(NUL_STR); // clear the error @@ -753,7 +755,7 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } static void do_home() { quick_feedback(); - drawMessage(GET_TEXT(MSG_LEVEL_BED_HOMING)); + drawMessage(GET_TEXT_F(MSG_LEVEL_BED_HOMING)); queue.inject_P(G28_STR); // Disable touch until home is done TERN_(HAS_TFT_XPT2046, touch.disable()); From d57cf9bd6b6d70dda6fe2bba9b83849a9688408a Mon Sep 17 00:00:00 2001 From: luzpaz Date: Sat, 18 Jun 2022 00:19:01 -0400 Subject: [PATCH 376/502] =?UTF-8?q?=F0=9F=8C=90=20Fix=20LCD=20string,=20ty?= =?UTF-8?q?pos=20(#24324)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h | 4 ++-- Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h index 9ec2304a36aa..bdcd248dd6cd 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h @@ -680,8 +680,8 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040; constexpr uint16_t VP_EX_TEMP_INFO2_Dis = 0x5620; constexpr uint16_t VP_EX_TEMP_INFO3_Dis = 0x5630; constexpr uint16_t VP_LCD_BLK_Dis = 0x56A0; - constexpr uint16_t VP_Info_PrinfFinsh_1_Dis = 0x5C00; - constexpr uint16_t VP_Info_PrinfFinsh_2_Dis = 0x5C10; + constexpr uint16_t VP_Info_PrintFinish_1_Dis = 0x5C00; + constexpr uint16_t VP_Info_PrintFinish_2_Dis = 0x5C10; constexpr uint16_t VP_Length_Dis = 0x5B00; diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 739265e49636..18ac433b719a 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -564,7 +564,7 @@ void DGUSScreenHandlerMKS::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) { queue.enqueue_now(F("G29S2")); mesh_point_count--; if (mks_language_index == MKS_English) { - const char level_buf_en2[] = "Level Finsh"; + const char level_buf_en2[] = "Leveling Done"; dgusdisplay.WriteVariable(VP_AutoLevel_1_Dis, level_buf_en2, 32, true); } else if (mks_language_index == MKS_SimpleChinese) { @@ -1709,8 +1709,8 @@ void DGUSScreenHandlerMKS::DGUS_LanguageDisplay(uint8_t var) { const char Info_EEPROM_2_buf_en[] = "Revert setting?"; dgusdisplay.WriteVariable(VP_Info_EEPROM_2_Dis, Info_EEPROM_2_buf_en, 32, true); - const char Info_PrinfFinsh_1_buf_en[] = "Print Done"; - dgusdisplay.WriteVariable(VP_Info_PrinfFinsh_1_Dis, Info_PrinfFinsh_1_buf_en, 32, true); + const char Info_PrintFinish_1_buf_en[] = "Print Done"; + dgusdisplay.WriteVariable(VP_Info_PrintFinish_1_Dis, Info_PrintFinish_1_buf_en, 32, true); const char TMC_X_Step_buf_en[] = "X_SenSitivity"; dgusdisplay.WriteVariable(VP_TMC_X_Step_Dis, TMC_X_Step_buf_en, 32, true); @@ -1973,8 +1973,8 @@ void DGUSScreenHandlerMKS::DGUS_LanguageDisplay(uint8_t var) { const uint16_t TMC_Z_Step_buf_ch[] = { 0x205A, 0xE9C1, 0xF4C3, 0xC8B6, 0x2000 }; dgusdisplay.WriteVariable(VP_TMC_Z_Step_Dis, TMC_Z_Step_buf_ch, 16, true); - const uint16_t Info_PrinfFinsh_1_buf_ch[] = { 0xF2B4, 0xA1D3, 0xEACD, 0xC9B3, 0x2000 }; - dgusdisplay.WriteVariable(VP_Info_PrinfFinsh_1_Dis, Info_PrinfFinsh_1_buf_ch, 32, true); + const uint16_t Info_PrintFinish_1_buf_ch[] = { 0xF2B4, 0xA1D3, 0xEACD, 0xC9B3, 0x2000 }; + dgusdisplay.WriteVariable(VP_Info_PrintFinish_1_Dis, Info_PrintFinish_1_buf_ch, 32, true); const uint16_t TMC_X_Current_buf_ch[] = { 0x2058, 0xE1D6, 0xE7B5, 0xF7C1, 0x2000 }; dgusdisplay.WriteVariable(VP_TMC_X_Current_Dis, TMC_X_Current_buf_ch, 16, true); From ce6c8adcb1002049f27513fdb0c74ce9831386cc Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 15 Jun 2022 20:02:32 +1200 Subject: [PATCH 377/502] =?UTF-8?q?=F0=9F=91=B7=20CI=20test=20without=20sr?= =?UTF-8?q?c=20filter=20(emulate=20Arduino)=20(#24335)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/ci_src_filter | 14 ++++++++++++++ buildroot/tests/mega2560 | 8 ++++++++ 2 files changed, 22 insertions(+) create mode 100755 buildroot/bin/ci_src_filter diff --git a/buildroot/bin/ci_src_filter b/buildroot/bin/ci_src_filter new file mode 100755 index 000000000000..928f492e69fa --- /dev/null +++ b/buildroot/bin/ci_src_filter @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# exit on first failure +set -e + +SED=$(which gsed sed | head -n1) +FN="platformio.ini" + +if [[ $1 == "-n" ]]; then + "${SED}" -i "s/default_src_filter/org_src_filter/" $FN + "${SED}" -i "/org_src_filter/ s/^/default_src_filter = +\n/" $FN +else + git checkout $FN 2>/dev/null +fi diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560 index fc24cf212509..6871ce4a0cef 100755 --- a/buildroot/tests/mega2560 +++ b/buildroot/tests/mega2560 @@ -12,6 +12,14 @@ set -e #restore_configs #exec_test $1 $2 "Default Configuration" "$3" +# +# Build with no source filers +# +restore_configs +ci_src_filter -n +exec_test $1 $2 "Default Configuration | no source filtering" "$3" +ci_src_filter -y + # # Test a probeless build of AUTO_BED_LEVELING_UBL, with lots of extruders # From f26438ef2870d88b057fba3c892f1ab4fd82b952 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Mon, 13 Jun 2022 19:04:49 -0700 Subject: [PATCH 378/502] =?UTF-8?q?=F0=9F=91=B7=20Use=20Biqu=20BX=20for=20?= =?UTF-8?q?CI=20test=20(#24331)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/tests/BTT_SKR_SE_BX | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/buildroot/tests/BTT_SKR_SE_BX b/buildroot/tests/BTT_SKR_SE_BX index b5d6f6de8398..199cff14b9b0 100755 --- a/buildroot/tests/BTT_SKR_SE_BX +++ b/buildroot/tests/BTT_SKR_SE_BX @@ -9,10 +9,8 @@ set -e # # Build with the default configurations # -restore_configs -opt_set MOTHERBOARD BOARD_BTT_SKR_SE_BX -opt_set SERIAL_PORT 1 -exec_test $1 $2 "Default Configuration" "$3" +use_example_configs BIQU/BX +exec_test $1 $2 "BIQU/BX" "$3" # clean up restore_configs From ae78a8844ae47d1b22f04e4545a29c19a0f8b214 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 22 May 2022 16:08:29 -0500 Subject: [PATCH 379/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20MAP?= =?UTF-8?q?=20macro=20for=20axis=20lists,=20etc.=20(#24191)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/macros.h | 29 +++++++++++++------- Marlin/src/core/types.h | 12 ++++++++ Marlin/src/feature/spindle_laser.h | 2 -- Marlin/src/gcode/calibrate/M425.cpp | 10 ++----- Marlin/src/lcd/menu/menu_advanced.cpp | 11 ++++---- Marlin/src/libs/L64XX/L64XX_Marlin.h | 2 +- Marlin/src/module/endstops.cpp | 38 ++++++++++++-------------- Marlin/src/module/motion.cpp | 16 ++++------- Marlin/src/module/settings.cpp | 6 ++-- Marlin/src/module/stepper.cpp | 10 ++----- Marlin/src/module/stepper/trinamic.cpp | 26 ++++-------------- 11 files changed, 72 insertions(+), 90 deletions(-) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 648307656e64..13480bd8e6db 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -700,13 +700,22 @@ #define RREPEAT2_S(S,N,OP,V...) EVAL1024(_RREPEAT2(S,SUB##S(N),OP,V)) #define RREPEAT2(N,OP,V...) RREPEAT2_S(0,N,OP,V) -// See https://github.com/swansontec/map-macro -#define MAP_OUT -#define MAP_END(...) -#define MAP_GET_END() 0, MAP_END -#define MAP_NEXT0(test, next, ...) next MAP_OUT -#define MAP_NEXT1(test, next) MAP_NEXT0 (test, next, 0) -#define MAP_NEXT(test, next) MAP_NEXT1 (MAP_GET_END test, next) -#define MAP0(f, x, peek, ...) f(x) MAP_NEXT (peek, MAP1) (f, peek, __VA_ARGS__) -#define MAP1(f, x, peek, ...) f(x) MAP_NEXT (peek, MAP0) (f, peek, __VA_ARGS__) -#define MAP(f, ...) EVAL512 (MAP1 (f, __VA_ARGS__, (), 0)) +// Call OP(A) with each item as an argument +#define _MAP(_MAP_OP,A,V...) \ + _MAP_OP(A) \ + IF_ELSE(HAS_ARGS(V)) \ + ( DEFER2(__MAP)()(_MAP_OP,V) ) \ + ( /* Do nothing */ ) +#define __MAP() _MAP + +#define MAP(OP,V...) EVAL(_MAP(OP,V)) + +// Emit a list of OP(A) with the given items +#define _MAPLIST(_MAP_OP,A,V...) \ + _MAP_OP(A) \ + IF_ELSE(HAS_ARGS(V)) \ + ( , DEFER2(__MAPLIST)()(_MAP_OP,V) ) \ + ( /* Do nothing */ ) +#define __MAPLIST() _MAPLIST + +#define MAPLIST(OP,V...) EVAL(_MAPLIST(OP,V)) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 855502458bbb..0f5cff46678f 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -36,22 +36,34 @@ struct IF { typedef R type; }; template struct IF { typedef L type; }; +#define ALL_AXIS_NAMES X, X2, Y, Y2, Z, Z2, Z3, Z4, I, J, K, E0, E1, E2, E3, E4, E5, E6, E7 + #define LINEAR_AXIS_GANG(V...) GANG_N(LINEAR_AXES, V) #define LINEAR_AXIS_CODE(V...) CODE_N(LINEAR_AXES, V) #define LINEAR_AXIS_LIST(V...) LIST_N(LINEAR_AXES, V) +#define LINEAR_AXIS_LIST_1(V) LIST_N_1(LINEAR_AXES, V) #define LINEAR_AXIS_ARRAY(V...) { LINEAR_AXIS_LIST(V) } +#define LINEAR_AXIS_ARRAY_1(V) { LINEAR_AXIS_LIST_1(V) } #define LINEAR_AXIS_ARGS(T...) LINEAR_AXIS_LIST(T x, T y, T z, T i, T j, T k) #define LINEAR_AXIS_ELEM(O) LINEAR_AXIS_LIST(O.x, O.y, O.z, O.i, O.j, O.k) #define LINEAR_AXIS_DEFS(T,V) LINEAR_AXIS_LIST(T x=V, T y=V, T z=V, T i=V, T j=V, T k=V) +#define MAIN_AXIS_NAMES LINEAR_AXIS_LIST(X, Y, Z, I, J, K) +#define MAIN_AXIS_MAP(F) MAP(F, MAIN_AXIS_NAMES) + #define LOGICAL_AXIS_GANG(E,V...) LINEAR_AXIS_GANG(V) GANG_ITEM_E(E) #define LOGICAL_AXIS_CODE(E,V...) LINEAR_AXIS_CODE(V) CODE_ITEM_E(E) #define LOGICAL_AXIS_LIST(E,V...) LINEAR_AXIS_LIST(V) LIST_ITEM_E(E) +#define LOGICAL_AXIS_LIST_1(E,V) LINEAR_AXIS_LIST_1(V) LIST_ITEM_E(E) #define LOGICAL_AXIS_ARRAY(E,V...) { LOGICAL_AXIS_LIST(E,V) } +#define LOGICAL_AXIS_ARRAY_1(E,V) { LOGICAL_AXIS_LIST_1(E,V) } #define LOGICAL_AXIS_ARGS(T...) LOGICAL_AXIS_LIST(T e, T x, T y, T z, T i, T j, T k) #define LOGICAL_AXIS_ELEM(O) LOGICAL_AXIS_LIST(O.e, O.x, O.y, O.z, O.i, O.j, O.k) #define LOGICAL_AXIS_DECL(T,V) LOGICAL_AXIS_LIST(T e=V, T x=V, T y=V, T z=V, T i=V, T j=V, T k=V) +#define LOGICAL_AXIS_NAMES LOGICAL_AXIS_LIST(E, X, Y, Z, I, J, K) +#define LOGICAL_AXIS_MAP(F) MAP(F, LOGICAL_AXIS_NAMES) + #define LOGICAL_AXES_STRING LOGICAL_AXIS_GANG("E", "X", "Y", "Z", STR_I, STR_J, STR_K) #if HAS_EXTRUDERS diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index a9dc7794c4e9..808fa634e162 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -41,8 +41,6 @@ #define PCT_TO_PWM(X) ((X) * 255 / 100) #define PCT_TO_SERVO(X) ((X) * 180 / 100) -// #define _MAP(N,S1,S2,D1,D2) ((N)*_MAX((D2)-(D1),0)/_MAX((S2)-(S1),1)+(D1)) - class SpindleLaser { public: static const inline uint8_t pct_to_ocr(const_float_t pct) { return uint8_t(PCT_TO_PWM(pct)); } diff --git a/Marlin/src/gcode/calibrate/M425.cpp b/Marlin/src/gcode/calibrate/M425.cpp index 6b1f56fcf658..873d67032291 100644 --- a/Marlin/src/gcode/calibrate/M425.cpp +++ b/Marlin/src/gcode/calibrate/M425.cpp @@ -47,16 +47,10 @@ void GcodeSuite::M425() { bool noArgs = true; auto axis_can_calibrate = [](const uint8_t a) { + #define _CAN_CASE(N) case N##_AXIS: return AXIS_CAN_CALIBRATE(N); switch (a) { default: return false; - LINEAR_AXIS_CODE( - case X_AXIS: return AXIS_CAN_CALIBRATE(X), - case Y_AXIS: return AXIS_CAN_CALIBRATE(Y), - case Z_AXIS: return AXIS_CAN_CALIBRATE(Z), - case I_AXIS: return AXIS_CAN_CALIBRATE(I), - case J_AXIS: return AXIS_CAN_CALIBRATE(J), - case K_AXIS: return AXIS_CAN_CALIBRATE(K) - ); + MAIN_AXIS_MAP(_CAN_CASE) } }; diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 517feea3e6e4..2924e9d52391 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -417,7 +417,7 @@ void menu_backlash(); #elif ENABLED(LIMITED_MAX_FR_EDITING) DEFAULT_MAX_FEEDRATE #else - LOGICAL_AXIS_ARRAY(9999, 9999, 9999, 9999, 9999, 9999, 9999) + LOGICAL_AXIS_ARRAY_1(9999) #endif ; #if ENABLED(LIMITED_MAX_FR_EDITING) && !defined(MAX_FEEDRATE_EDIT_VALUES) @@ -460,7 +460,7 @@ void menu_backlash(); #elif ENABLED(LIMITED_MAX_ACCEL_EDITING) DEFAULT_MAX_ACCELERATION #else - LOGICAL_AXIS_ARRAY(99000, 99000, 99000, 99000, 99000, 99000, 99000) + LOGICAL_AXIS_ARRAY_1(99000) #endif ; #if ENABLED(LIMITED_MAX_ACCEL_EDITING) && !defined(MAX_ACCEL_EDIT_VALUES) @@ -525,11 +525,10 @@ void menu_backlash(); #ifdef MAX_JERK_EDIT_VALUES MAX_JERK_EDIT_VALUES #elif ENABLED(LIMITED_JERK_EDITING) - { LOGICAL_AXIS_LIST((DEFAULT_EJERK) * 2, - (DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, (DEFAULT_ZJERK) * 2, - (DEFAULT_IJERK) * 2, (DEFAULT_JJERK) * 2, (DEFAULT_KJERK) * 2) } + #define _JERK2(N) DEFAULT_##N##JERK * 2 + { MAPLIST(_JERK2, LOGICAL_AXIS_NAMES) } #else - { LOGICAL_AXIS_LIST(990, 990, 990, 990, 990, 990, 990) } + LOGICAL_AXIS_ARRAY_1(990) #endif ; diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.h b/Marlin/src/libs/L64XX/L64XX_Marlin.h index de7c0d605740..e8d8498ac7a6 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.h +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.h @@ -36,7 +36,7 @@ #define HAS_L64XX_EXTRUDER (AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5) || AXIS_IS_L64XX(E6) || AXIS_IS_L64XX(E7)) #define _EN_ITEM(N) , E##N -enum L64XX_axis_t : uint8_t { LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM), MAX_L64XX }; +enum L64XX_axis_t : uint8_t { MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM), MAX_L64XX }; #undef _EN_ITEM class L64XX_Marlin : public L64XXHelper { diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 0620285e61e3..c3252ca82421 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -1365,50 +1365,46 @@ void Endstops::update() { */ void Endstops::set_homing_current(const bool onoff) { #define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT) - #define HAS_DELTA_X_CURRENT (ENABLED(DELTA) && HAS_CURRENT_HOME(X)) - #define HAS_DELTA_Y_CURRENT (ENABLED(DELTA) && HAS_CURRENT_HOME(Y)) - #if HAS_DELTA_X_CURRENT || HAS_DELTA_Y_CURRENT || HAS_CURRENT_HOME(Z) - #if HAS_DELTA_X_CURRENT - static int16_t saved_current_x; - #endif - #if HAS_DELTA_Y_CURRENT - static int16_t saved_current_y; + #define _HOME_ELEM(N) HAS_CURRENT_HOME(N) || + #if MAIN_AXIS_MAP(_HOME_ELEM) 0 + #if ENABLED(DELTA) + static int16_t saved_current_X, saved_current_Y; #endif #if HAS_CURRENT_HOME(Z) - static int16_t saved_current_z; + static int16_t saved_current_Z; #endif auto debug_current_on = [](PGM_P const s, const int16_t a, const int16_t b) { if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM_P(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); } }; if (onoff) { #if HAS_DELTA_X_CURRENT - saved_current_x = stepperX.getMilliamps(); + saved_current_X = stepperX.getMilliamps(); stepperX.rms_current(X_CURRENT_HOME); - debug_current_on(PSTR("X"), saved_current_x, X_CURRENT_HOME); + debug_current_on(PSTR("X"), saved_current_X, X_CURRENT_HOME); #endif #if HAS_DELTA_Y_CURRENT - saved_current_y = stepperY.getMilliamps(); + saved_current_Y = stepperY.getMilliamps(); stepperY.rms_current(Y_CURRENT_HOME); - debug_current_on(PSTR("Y"), saved_current_y, Y_CURRENT_HOME); + debug_current_on(PSTR("Y"), saved_current_Y, Y_CURRENT_HOME); #endif #if HAS_CURRENT_HOME(Z) - saved_current_z = stepperZ.getMilliamps(); + saved_current_Z = stepperZ.getMilliamps(); stepperZ.rms_current(Z_CURRENT_HOME); - debug_current_on(PSTR("Z"), saved_current_z, Z_CURRENT_HOME); + debug_current_on(PSTR("Z"), saved_current_Z, Z_CURRENT_HOME); #endif } else { #if HAS_DELTA_X_CURRENT - stepperX.rms_current(saved_current_x); - debug_current_on(PSTR("X"), X_CURRENT_HOME, saved_current_x); + stepperX.rms_current(saved_current_X); + debug_current_on(PSTR("X"), X_CURRENT_HOME, saved_current_X); #endif #if HAS_DELTA_Y_CURRENT - stepperY.rms_current(saved_current_y); - debug_current_on(PSTR("Y"), Y_CURRENT_HOME, saved_current_y); + stepperY.rms_current(saved_current_Y); + debug_current_on(PSTR("Y"), Y_CURRENT_HOME, saved_current_Y); #endif #if HAS_CURRENT_HOME(Z) - stepperZ.rms_current(saved_current_z); - debug_current_on(PSTR("Z"), Z_CURRENT_HOME, saved_current_z); + stepperZ.rms_current(saved_current_Z); + debug_current_on(PSTR("Z"), Z_CURRENT_HOME, saved_current_Z); #endif } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index e709c6a9c9f0..7f62deb8bc9c 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -677,10 +677,12 @@ void restore_feedrate_and_scaling() { #if HAS_SOFTWARE_ENDSTOPS // Software Endstops are based on the configured limits. + #define _AMIN(A) A##_MIN_POS + #define _AMAX(A) (_AXIS(A) < Z_AXIS ? A##_MAX_BED : A##_MAX_POS) soft_endstops_t soft_endstop = { true, false, - LINEAR_AXIS_ARRAY(X_MIN_POS, Y_MIN_POS, Z_MIN_POS, I_MIN_POS, J_MIN_POS, K_MIN_POS), - LINEAR_AXIS_ARRAY(X_MAX_BED, Y_MAX_BED, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS) + { MAPLIST(_AMIN, MAIN_AXIS_NAMES) }, + { MAPLIST(_AMAX, MAIN_AXIS_NAMES) } }; /** @@ -1733,14 +1735,8 @@ void prepare_line_to_destination() { || TERN0(A##_HOME_TO_MIN, A##_MIN_PIN > -1) \ || TERN0(A##_HOME_TO_MAX, A##_MAX_PIN > -1) \ )) - if (LINEAR_AXIS_GANG( - !_CAN_HOME(X), - && !_CAN_HOME(Y), - && !_CAN_HOME(Z), - && !_CAN_HOME(I), - && !_CAN_HOME(J), - && !_CAN_HOME(K)) - ) return; + #define _ANDCANT(N) && !_CAN_HOME(N) + if (true MAIN_AXIS_MAP(_ANDCANT)) return; #endif if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(">>> homeaxis(", AS_CHAR(AXIS_CHAR(axis)), ")"); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 0d69c07c2480..a24ff751fced 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -180,9 +180,9 @@ #define _EN_ITEM(N) , E##N #define _EN1_ITEM(N) , E##N:1 -typedef struct { uint16_t LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint16_t; -typedef struct { uint32_t LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint32_t; -typedef struct { int16_t LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4; } mot_stepper_int16_t; +typedef struct { uint16_t MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint16_t; +typedef struct { uint32_t MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM); } per_stepper_uint32_t; +typedef struct { int16_t MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4; } mot_stepper_int16_t; typedef struct { bool LINEAR_AXIS_LIST(X:1, Y:1, Z:1, I:1, J:1, K:1), X2:1, Y2:1, Z2:1, Z3:1, Z4:1 REPEAT(E_STEPPERS, _EN1_ITEM); } per_stepper_bool_t; #undef _EN_ITEM diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 66cf7a535888..2ed97b7e0c07 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -486,10 +486,7 @@ xyze_int8_t Stepper::count_direction{0}; void Stepper::enable_axis(const AxisEnum axis) { #define _CASE_ENABLE(N) case N##_AXIS: ENABLE_AXIS_##N(); break; switch (axis) { - LINEAR_AXIS_CODE( - _CASE_ENABLE(X), _CASE_ENABLE(Y), _CASE_ENABLE(Z), - _CASE_ENABLE(I), _CASE_ENABLE(J), _CASE_ENABLE(K) - ); + MAIN_AXIS_MAP(_CASE_ENABLE) default: break; } mark_axis_enabled(axis); @@ -505,10 +502,7 @@ bool Stepper::disable_axis(const AxisEnum axis) { if (can_disable) { #define _CASE_DISABLE(N) case N##_AXIS: DISABLE_AXIS_##N(); break; switch (axis) { - LINEAR_AXIS_CODE( - _CASE_DISABLE(X), _CASE_DISABLE(Y), _CASE_DISABLE(Z), - _CASE_DISABLE(I), _CASE_DISABLE(J), _CASE_DISABLE(K) - ); + MAIN_AXIS_MAP(_CASE_DISABLE) default: break; } } diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index af09623dc1bb..776e982eb122 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -449,7 +449,7 @@ enum StealthIndex : uint8_t { #endif #define _EN_ITEM(N) , E##N - enum TMCAxis : uint8_t { LINEAR_AXIS_LIST(X, Y, Z, I, J, K), X2, Y2, Z2, Z3, Z4 REPEAT(EXTRUDERS, _EN_ITEM), TOTAL }; + enum TMCAxis : uint8_t { MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4 REPEAT(EXTRUDERS, _EN_ITEM), TOTAL }; #undef _EN_ITEM void tmc_serial_begin() { @@ -943,11 +943,7 @@ void reset_trinamic_drivers() { #define TMC_HW_DETAIL_ARGS(A) TERN(A##_HAS_HW_SERIAL, STRINGIFY(A##_HARDWARE_SERIAL), ""), TERN0(A##_HAS_HW_SERIAL, A##_SLAVE_ADDRESS) #define TMC_HW_DETAIL(A) { TMC_HW_DETAIL_ARGS(A) } constexpr SanityHwSerialDetails sanity_tmc_hw_details[] = { - TMC_HW_DETAIL(X), TMC_HW_DETAIL(X2), - TMC_HW_DETAIL(Y), TMC_HW_DETAIL(Y2), - TMC_HW_DETAIL(Z), TMC_HW_DETAIL(Z2), TMC_HW_DETAIL(Z3), TMC_HW_DETAIL(Z4), - TMC_HW_DETAIL(I), TMC_HW_DETAIL(J), TMC_HW_DETAIL(K), - TMC_HW_DETAIL(E0), TMC_HW_DETAIL(E1), TMC_HW_DETAIL(E2), TMC_HW_DETAIL(E3), TMC_HW_DETAIL(E4), TMC_HW_DETAIL(E5), TMC_HW_DETAIL(E6), TMC_HW_DETAIL(E7) + MAPLIST(TMC_HW_DETAIL, ALL_AXIS_NAMES) }; // constexpr compatible string comparison @@ -966,11 +962,7 @@ void reset_trinamic_drivers() { #define TMC_HWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_HARDWARE_SERIAL" #define SA_NO_TMC_HW_C(A) static_assert(1 >= count_tmc_hw_serial_matches(TMC_HW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_hw_details)), TMC_HWSERIAL_CONFLICT_MSG(A)); - SA_NO_TMC_HW_C(X); SA_NO_TMC_HW_C(X2); - SA_NO_TMC_HW_C(Y); SA_NO_TMC_HW_C(Y2); - SA_NO_TMC_HW_C(Z); SA_NO_TMC_HW_C(Z2); SA_NO_TMC_HW_C(Z3); SA_NO_TMC_HW_C(Z4); - SA_NO_TMC_HW_C(I); SA_NO_TMC_HW_C(J); SA_NO_TMC_HW_C(K); - SA_NO_TMC_HW_C(E0); SA_NO_TMC_HW_C(E1); SA_NO_TMC_HW_C(E2); SA_NO_TMC_HW_C(E3); SA_NO_TMC_HW_C(E4); SA_NO_TMC_HW_C(E5); SA_NO_TMC_HW_C(E6); SA_NO_TMC_HW_C(E7); + MAP(SA_NO_TMC_HW_C, ALL_AXIS_NAMES) #endif #if ANY_AXIS_HAS(SW_SERIAL) @@ -978,11 +970,7 @@ void reset_trinamic_drivers() { #define TMC_SW_DETAIL_ARGS(A) TERN(A##_HAS_SW_SERIAL, A##_SERIAL_TX_PIN, -1), TERN(A##_HAS_SW_SERIAL, A##_SERIAL_RX_PIN, -1), TERN0(A##_HAS_SW_SERIAL, A##_SLAVE_ADDRESS) #define TMC_SW_DETAIL(A) TMC_SW_DETAIL_ARGS(A) constexpr SanitySwSerialDetails sanity_tmc_sw_details[] = { - TMC_SW_DETAIL(X), TMC_SW_DETAIL(X2), - TMC_SW_DETAIL(Y), TMC_SW_DETAIL(Y2), - TMC_SW_DETAIL(Z), TMC_SW_DETAIL(Z2), TMC_SW_DETAIL(Z3), TMC_SW_DETAIL(Z4), - TMC_SW_DETAIL(I), TMC_SW_DETAIL(J), TMC_SW_DETAIL(K), - TMC_SW_DETAIL(E0), TMC_SW_DETAIL(E1), TMC_SW_DETAIL(E2), TMC_SW_DETAIL(E3), TMC_SW_DETAIL(E4), TMC_SW_DETAIL(E5), TMC_SW_DETAIL(E6), TMC_SW_DETAIL(E7) + MAPLIST(TMC_SW_DETAIL, ALL_AXIS_NAMES) }; constexpr bool sc_sw_done(size_t start, size_t end) { return start == end; } @@ -996,11 +984,7 @@ void reset_trinamic_drivers() { #define TMC_SWSERIAL_CONFLICT_MSG(A) STRINGIFY(A) "_SLAVE_ADDRESS conflicts with another driver using the same " STRINGIFY(A) "_SERIAL_RX_PIN or " STRINGIFY(A) "_SERIAL_TX_PIN" #define SA_NO_TMC_SW_C(A) static_assert(1 >= count_tmc_sw_serial_matches(TMC_SW_DETAIL_ARGS(A), 0, COUNT(sanity_tmc_sw_details)), TMC_SWSERIAL_CONFLICT_MSG(A)); - SA_NO_TMC_SW_C(X); SA_NO_TMC_SW_C(X2); - SA_NO_TMC_SW_C(Y); SA_NO_TMC_SW_C(Y2); - SA_NO_TMC_SW_C(Z); SA_NO_TMC_SW_C(Z2); SA_NO_TMC_SW_C(Z3); SA_NO_TMC_SW_C(Z4); - SA_NO_TMC_SW_C(I); SA_NO_TMC_SW_C(J); SA_NO_TMC_SW_C(K); - SA_NO_TMC_SW_C(E0); SA_NO_TMC_SW_C(E1); SA_NO_TMC_SW_C(E2); SA_NO_TMC_SW_C(E3); SA_NO_TMC_SW_C(E4); SA_NO_TMC_SW_C(E5); SA_NO_TMC_SW_C(E6); SA_NO_TMC_SW_C(E7); + MAPLIST(SA_NO_TMC_SW_C, ALL_AXIS_NAMES) #endif #endif // HAS_TRINAMIC_CONFIG From 2b8d115ebc08ee3ac03d680eff40d2b8079c2b44 Mon Sep 17 00:00:00 2001 From: John Robertson Date: Sat, 4 Jun 2022 07:26:08 +0100 Subject: [PATCH 380/502] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20PWM=20for=20ESP32?= =?UTF-8?q?=20I2S=20expander=20(#24193)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 5 ++- Marlin/Makefile | 2 +- Marlin/src/HAL/ESP32/HAL.cpp | 50 ++++++++++++++++----- Marlin/src/HAL/ESP32/HAL.h | 11 +++++ Marlin/src/HAL/ESP32/i2s.cpp | 20 +++++++++ Marlin/src/HAL/ESP32/inc/Conditionals_adv.h | 7 +++ Marlin/src/HAL/ESP32/inc/SanityCheck.h | 4 ++ Marlin/src/module/stepper.cpp | 4 +- Marlin/src/pins/esp32/pins_E4D.h | 9 +--- Marlin/src/pins/esp32/pins_ENWI_ESPNP.h | 8 ++-- Marlin/src/pins/esp32/pins_ESP32.h | 8 ++-- Marlin/src/pins/esp32/pins_ESPA_common.h | 8 ---- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h | 5 +-- Marlin/src/pins/esp32/pins_MRR_ESPE.h | 9 ++-- 14 files changed, 104 insertions(+), 46 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d25355d8a6ba..9b70dbbb650f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3472,7 +3472,10 @@ #if ENABLED(SPINDLE_LASER_USE_PWM) #define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR, ESP32, and LPC) - #endif + // ESP32: If SPINDLE_LASER_PWM_PIN is onboard then <=78125Hz. For I2S expander + // the frequency determines the PWM resolution. 2500Hz = 0-100, 977Hz = 0-255, ... + // (250000 / SPINDLE_LASER_FREQUENCY) = max value. +#endif //#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11 #if ENABLED(AIR_EVACUATION) diff --git a/Marlin/Makefile b/Marlin/Makefile index 417c979f8857..563354fdbe1f 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -109,7 +109,7 @@ LIQUID_TWI2 ?= 0 # This defines if Wire is needed WIRE ?= 0 -# This defines if Tone is needed (i.e SPEAKER is defined in Configuration.h) +# This defines if Tone is needed (i.e., SPEAKER is defined in Configuration.h) # Disabling this (and SPEAKER) saves approximately 350 bytes of memory. TONE ?= 1 diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index 65af39786eeb..29f3be3c028a 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -65,6 +65,7 @@ portMUX_TYPE MarlinHAL::spinlock = portMUX_INITIALIZER_UNLOCKED; // ------------------------ uint16_t MarlinHAL::adc_result; +pwm_pin_t MarlinHAL::pwm_pin_data[MAX_EXPANDER_BITS]; // ------------------------ // Private Variables @@ -330,21 +331,46 @@ int8_t get_pwm_channel(const pin_t pin, const uint32_t freq, const uint16_t res) } void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=_BV(PWM_RESOLUTION)-1*/, const bool invert/*=false*/) { - const int8_t cid = get_pwm_channel(pin, PWM_FREQUENCY, PWM_RESOLUTION); - if (cid >= 0) { - uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, _BV(PWM_RESOLUTION)-1); - ledcWrite(cid, duty); - } + #if ENABLED(I2S_STEPPER_STREAM) + if (pin > 127) { + const uint8_t pinlo = pin & 0x7F; + pwm_pin_t &pindata = pwm_pin_data[pinlo]; + const uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, pindata.pwm_cycle_ticks); + if (duty == 0 || duty == pindata.pwm_cycle_ticks) { // max or min (i.e., on/off) + pindata.pwm_duty_ticks = 0; // turn off PWM for this pin + duty ? SBI32(i2s_port_data, pinlo) : CBI32(i2s_port_data, pinlo); // set pin level + } + else + pindata.pwm_duty_ticks = duty; // PWM duty count = # of 4µs ticks per full PWM cycle + } + else + #endif + { + const int8_t cid = get_pwm_channel(pin, PWM_FREQUENCY, PWM_RESOLUTION); + if (cid >= 0) { + const uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, _BV(PWM_RESOLUTION)-1); + ledcWrite(cid, duty); + } + } } int8_t MarlinHAL::set_pwm_frequency(const pin_t pin, const uint32_t f_desired) { - const int8_t cid = channel_for_pin(pin); - if (cid >= 0) { - if (f_desired == ledcReadFreq(cid)) return cid; // no freq change - ledcDetachPin(chan_pin[cid]); - chan_pin[cid] = 0; // remove old freq channel - } - return get_pwm_channel(pin, f_desired, PWM_RESOLUTION); // try for new one + #if ENABLED(I2S_STEPPER_STREAM) + if (pin > 127) { + pwm_pin_data[pin & 0x7F].pwm_cycle_ticks = 1000000UL / f_desired / 4; // # of 4µs ticks per full PWM cycle + return 0; + } + else + #endif + { + const int8_t cid = channel_for_pin(pin); + if (cid >= 0) { + if (f_desired == ledcReadFreq(cid)) return cid; // no freq change + ledcDetachPin(chan_pin[cid]); + chan_pin[cid] = 0; // remove old freq channel + } + return get_pwm_channel(pin, f_desired, PWM_RESOLUTION); // try for new one + } } // use hardware PWM if avail, if not then ISR diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index a07303d4891f..600ca8f5ee37 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -68,6 +68,9 @@ #define PWM_RESOLUTION 10u // Default PWM bit resolution #define CHANNEL_MAX_NUM 15u // max PWM channel # to allocate (7 to only use low speed, 15 to use low & high) #define MAX_PWM_IOPIN 33u // hardware pwm pins < 34 +#ifndef MAX_EXPANDER_BITS + #define MAX_EXPANDER_BITS 32 // I2S expander bit width (max 32) +#endif // ------------------------ // Types @@ -76,6 +79,12 @@ typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs. typedef int16_t pin_t; +typedef struct pwm_pin { + uint32_t pwm_cycle_ticks = 1000000UL / (PWM_FREQUENCY) / 4; // # ticks per pwm cycle + uint32_t pwm_tick_count = 0; // current tick count + uint32_t pwm_duty_ticks = 0; // # of ticks for current duty cycle +} pwm_pin_t; + class Servo; typedef Servo hal_servo_t; @@ -197,6 +206,8 @@ class MarlinHAL { // Free SRAM static int freeMemory(); + static pwm_pin_t pwm_pin_data[MAX_EXPANDER_BITS]; + // // ADC Methods // diff --git a/Marlin/src/HAL/ESP32/i2s.cpp b/Marlin/src/HAL/ESP32/i2s.cpp index 3e77b658360b..cf337eeb4622 100644 --- a/Marlin/src/HAL/ESP32/i2s.cpp +++ b/Marlin/src/HAL/ESP32/i2s.cpp @@ -337,6 +337,26 @@ uint8_t i2s_state(uint8_t pin) { } void i2s_push_sample() { + // Every 4µs (when space in DMA buffer) toggle each expander PWM output using + // the current duty cycle/frequency so they sync with any steps (once + // through the DMA/FIFO buffers). PWM signal inversion handled by other functions + LOOP_L_N(p, MAX_EXPANDER_BITS) { + if (hal.pwm_pin_data[p].pwm_duty_ticks > 0) { // pin has active pwm? + if (hal.pwm_pin_data[p].pwm_tick_count == 0) { + if (TEST32(i2s_port_data, p)) { // hi->lo + CBI32(i2s_port_data, p); + hal.pwm_pin_data[p].pwm_tick_count = hal.pwm_pin_data[p].pwm_cycle_ticks - hal.pwm_pin_data[p].pwm_duty_ticks; + } + else { // lo->hi + SBI32(i2s_port_data, p); + hal.pwm_pin_data[p].pwm_tick_count = hal.pwm_pin_data[p].pwm_duty_ticks; + } + } + else + hal.pwm_pin_data[p].pwm_tick_count--; + } + } + dma.current[dma.rw_pos++] = i2s_port_data; } diff --git a/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h b/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h index 5f1c4b16019d..3ca806897a89 100644 --- a/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h +++ b/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h @@ -20,3 +20,10 @@ * */ #pragma once + +// +// Board-specific options need to be defined before HAL.h +// +#if MB(MKS_TINYBEE) + #define MAX_EXPANDER_BITS 24 // TinyBee has 3 x HC595 +#endif diff --git a/Marlin/src/HAL/ESP32/inc/SanityCheck.h b/Marlin/src/HAL/ESP32/inc/SanityCheck.h index 04d70ec14f0b..3ccb15989f33 100644 --- a/Marlin/src/HAL/ESP32/inc/SanityCheck.h +++ b/Marlin/src/HAL/ESP32/inc/SanityCheck.h @@ -48,3 +48,7 @@ #if USING_PULLDOWNS #error "PULLDOWN pin mode is not available on ESP32 boards." #endif + +#if BOTH(I2S_STEPPER_STREAM, LIN_ADVANCE) + #error "I2S stream is currently incompatible with LIN_ADVANCE." +#endif diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 2ed97b7e0c07..7624359c879d 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -1863,9 +1863,7 @@ void Stepper::pulse_phase_isr() { #endif #endif - #if ENABLED(I2S_STEPPER_STREAM) - i2s_push_sample(); - #endif + TERN_(I2S_STEPPER_STREAM, i2s_push_sample()); // TODO: need to deal with MINIMUM_STEPPER_PULSE over i2s #if ISR_MULTI_STEPS diff --git a/Marlin/src/pins/esp32/pins_E4D.h b/Marlin/src/pins/esp32/pins_E4D.h index 02a5fe4e33aa..86ba1a7594fc 100644 --- a/Marlin/src/pins/esp32/pins_E4D.h +++ b/Marlin/src/pins/esp32/pins_E4D.h @@ -40,19 +40,14 @@ #define BOARD_WEBSITE_URL "github.com/Exilaus/E4d@box" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME -// -// Disable I2S stepper stream -// -#undef I2S_STEPPER_STREAM - // // Redefine I2S for ESP32 // #undef I2S_WS -#define I2S_WS 23 #undef I2S_BCK -#define I2S_BCK 22 #undef I2S_DATA +#define I2S_WS 23 +#define I2S_BCK 22 #define I2S_DATA 21 // diff --git a/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h b/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h index aff7f742edf9..80923d972deb 100644 --- a/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h +++ b/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h @@ -35,9 +35,11 @@ // I2S (steppers & other output-only pins) // #define I2S_STEPPER_STREAM -#define I2S_WS 17 -#define I2S_BCK 22 -#define I2S_DATA 21 +#if ENABLED(I2S_STEPPER_STREAM) + #define I2S_WS 17 + #define I2S_BCK 22 + #define I2S_DATA 21 +#endif // // Servos diff --git a/Marlin/src/pins/esp32/pins_ESP32.h b/Marlin/src/pins/esp32/pins_ESP32.h index 6578770ba0e2..266de7e9f60e 100644 --- a/Marlin/src/pins/esp32/pins_ESP32.h +++ b/Marlin/src/pins/esp32/pins_ESP32.h @@ -33,9 +33,11 @@ // I2S (steppers & other output-only pins) // #define I2S_STEPPER_STREAM -#define I2S_WS 25 -#define I2S_BCK 26 -#define I2S_DATA 27 +#if ENABLED(I2S_STEPPER_STREAM) + #define I2S_WS 25 + #define I2S_BCK 26 + #define I2S_DATA 27 +#endif // // Limit Switches diff --git a/Marlin/src/pins/esp32/pins_ESPA_common.h b/Marlin/src/pins/esp32/pins_ESPA_common.h index 2fcacb3002b4..ca949cdf9716 100644 --- a/Marlin/src/pins/esp32/pins_ESPA_common.h +++ b/Marlin/src/pins/esp32/pins_ESPA_common.h @@ -32,14 +32,6 @@ #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME #endif -// -// Disable I2S stepper stream, by default -// -#undef I2S_STEPPER_STREAM -#undef I2S_WS -#undef I2S_BCK -#undef I2S_DATA - // // Limit Switches // diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 025650fef552..10e8fbc0c629 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -40,6 +40,8 @@ #define BOARD_WEBSITE_URL "https://github.com/makerbase-mks" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME +// MAX_EXPANDER_BITS is defined for MKS TinyBee in HAL/ESP32/inc/Conditionals_adv.h + // // Servos // @@ -61,9 +63,6 @@ #define I2S_WS 26 #define I2S_BCK 25 #define I2S_DATA 27 - #if ENABLED(LIN_ADVANCE) - #error "I2S stream is currently incompatible with LIN_ADVANCE." - #endif #endif // diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index 9b9b54e3aebe..140be0a28614 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -52,11 +52,10 @@ // Enable I2S stepper stream // #define I2S_STEPPER_STREAM -#define I2S_WS 26 -#define I2S_BCK 25 -#define I2S_DATA 27 -#if ENABLED(LIN_ADVANCE) - #error "I2S stream is currently incompatible with LIN_ADVANCE." +#if ENABLED(I2S_STEPPER_STREAM) + #define I2S_WS 26 + #define I2S_BCK 25 + #define I2S_DATA 27 #endif // From 15ca479708d39977c76acb73aaf1deca78810206 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jun 2022 23:28:19 -0500 Subject: [PATCH 381/502] =?UTF-8?q?=F0=9F=8E=A8=20Fix=20comments,=20format?= =?UTF-8?q?ting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/macros.h | 5 ++--- .../ftdi_eve_touch_ui/ftdi_eve_lib/compat.h | 4 ++-- Marlin/src/module/planner.cpp | 18 +++++++----------- Marlin/src/module/stepper/trinamic.cpp | 2 +- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 13480bd8e6db..56aa21cada5c 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -632,8 +632,8 @@ #define IS_PROBE(V...) SECOND(V, 0) // Get the second item passed, or 0 #define PROBE() ~, 1 // Second item will be 1 if this is passed #define _NOT_0 PROBE() -#define NOT(x) IS_PROBE(_CAT(_NOT_, x)) // NOT('0') gets '1'. Anything else gets '0'. -#define _BOOL(x) NOT(NOT(x)) // NOT('0') gets '0'. Anything else gets '1'. +#define NOT(x) IS_PROBE(_CAT(_NOT_, x)) // NOT('0') gets '1'. Anything else gets '0'. +#define _BOOL(x) NOT(NOT(x)) // _BOOL('0') gets '0'. Anything else gets '1'. #define IF_ELSE(TF) _IF_ELSE(_BOOL(TF)) #define _IF_ELSE(TF) _CAT(_IF_, TF) @@ -647,7 +647,6 @@ #define HAS_ARGS(V...) _BOOL(FIRST(_END_OF_ARGUMENTS_ V)()) #define _END_OF_ARGUMENTS_() 0 - // Simple Inline IF Macros, friendly to use in other macro definitions #define IF(O, A, B) ((O) ? (A) : (B)) #define IF_0(O, A) IF(O, A, 0) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h index da911c772daa..6b2dc9eb4498 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h @@ -240,8 +240,8 @@ #define IS_PROBE(V...) SECOND(V, 0) // Get the second item passed, or 0 #define PROBE() ~, 1 // Second item will be 1 if this is passed #define _NOT_0 PROBE() - #define NOT(x) IS_PROBE(_CAT(_NOT_, x)) // NOT('0') gets '1'. Anything else gets '0'. - #define _BOOL(x) NOT(NOT(x)) // NOT('0') gets '0'. Anything else gets '1'. + #define NOT(x) IS_PROBE(_CAT(_NOT_, x)) // NOT('0') gets '1'. Anything else gets '0'. + #define _BOOL(x) NOT(NOT(x)) // _BOOL('0') gets '0'. Anything else gets '1'. #define _DO_1(W,C,A) (_##W##_1(A)) #define _DO_2(W,C,A,B) (_##W##_1(A) C _##W##_1(B)) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 17eab914de6f..1d8b6e716ec7 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2032,9 +2032,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move, TERN_(HAS_K_AXIS, steps_dist_mm.k = dk * mm_per_step[K_AXIS]); #elif ENABLED(MARKFORGED_XY) steps_dist_mm.a = (da - db) * mm_per_step[A_AXIS]; - steps_dist_mm.b = db * mm_per_step[B_AXIS]; + steps_dist_mm.b = db * mm_per_step[B_AXIS]; #elif ENABLED(MARKFORGED_YX) - steps_dist_mm.a = da * mm_per_step[A_AXIS]; + steps_dist_mm.a = da * mm_per_step[A_AXIS]; steps_dist_mm.b = (db - da) * mm_per_step[B_AXIS]; #else LINEAR_AXIS_CODE( @@ -2100,9 +2100,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move, /** * At this point at least one of the axes has more steps than - * MIN_STEPS_PER_SEGMENT, ensuring the segment won't get dropped as - * zero-length. It's important to not apply corrections - * to blocks that would get dropped! + * MIN_STEPS_PER_SEGMENT, ensuring the segment won't get dropped + * as zero-length. It's important to not apply corrections to blocks + * that would get dropped! * * A correction function is permitted to add steps to an axis, it * should *never* remove steps! @@ -2136,12 +2136,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #if ENABLED(AUTO_POWER_CONTROL) if (LINEAR_AXIS_GANG( - block->steps.x, - || block->steps.y, - || block->steps.z, - || block->steps.i, - || block->steps.j, - || block->steps.k + block->steps.x, || block->steps.y, || block->steps.z, + || block->steps.i, || block->steps.j, || block->steps.k )) powerManager.power_on(); #endif diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index 776e982eb122..9811f0960335 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -968,7 +968,7 @@ void reset_trinamic_drivers() { #if ANY_AXIS_HAS(SW_SERIAL) struct SanitySwSerialDetails { int32_t txpin; int32_t rxpin; uint32_t address; }; #define TMC_SW_DETAIL_ARGS(A) TERN(A##_HAS_SW_SERIAL, A##_SERIAL_TX_PIN, -1), TERN(A##_HAS_SW_SERIAL, A##_SERIAL_RX_PIN, -1), TERN0(A##_HAS_SW_SERIAL, A##_SLAVE_ADDRESS) - #define TMC_SW_DETAIL(A) TMC_SW_DETAIL_ARGS(A) + #define TMC_SW_DETAIL(A) { TMC_SW_DETAIL_ARGS(A) } constexpr SanitySwSerialDetails sanity_tmc_sw_details[] = { MAPLIST(TMC_SW_DETAIL, ALL_AXIS_NAMES) }; From 821f4983d01430b9fc9ba5ccb44ea7ace4bf31e0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2022 05:55:35 -0500 Subject: [PATCH 382/502] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fix?= =?UTF-8?q?=20STATIC=5FITEM=5FN=20arg=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu.h | 1 + Marlin/src/lcd/menu/menu_item.h | 4 ++-- Marlin/src/lcd/menu/menu_led.cpp | 4 ++-- Marlin/src/lcd/menu/menu_motion.cpp | 14 ++++++-------- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index b65214f7b572..6f5a9efb1516 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -214,6 +214,7 @@ void menu_move(); //////// Menu Item Helper Functions //////// //////////////////////////////////////////// +void lcd_move_axis(const AxisEnum); void lcd_move_z(); void _lcd_draw_homing(); diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index b48eaf9bae06..77e6bcab7b1b 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -357,7 +357,7 @@ class MenuItem_bool : public MenuEditItemBase { NEXT_ITEM(); \ } while(0) -#define STATIC_ITEM_N_F(FLABEL, N, V...) do{ \ +#define STATIC_ITEM_N_F(N, FLABEL, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ MenuItemBase::init(N); \ STATIC_ITEM_INNER_F(FLABEL, ##V); \ @@ -380,7 +380,7 @@ class MenuItem_bool : public MenuEditItemBase { #define PSTRING_ITEM(LABEL, V...) PSTRING_ITEM_F(GET_TEXT_F(LABEL), ##V) #define STATIC_ITEM(LABEL, V...) STATIC_ITEM_F(GET_TEXT_F(LABEL), ##V) -#define STATIC_ITEM_N(LABEL, N, V...) STATIC_ITEM_N_F(GET_TEXT_F(LABEL), N, ##V) +#define STATIC_ITEM_N(N, LABEL, V...) STATIC_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V) // Menu item with index and composed C-string substitution #define MENU_ITEM_N_S_F(TYPE, N, S, FLABEL, V...) _MENU_ITEM_N_S_F(TYPE, N, S, false, FLABEL, ##V) diff --git a/Marlin/src/lcd/menu/menu_led.cpp b/Marlin/src/lcd/menu/menu_led.cpp index 0c08f6fa944b..867e4dafa940 100644 --- a/Marlin/src/lcd/menu/menu_led.cpp +++ b/Marlin/src/lcd/menu/menu_led.cpp @@ -83,7 +83,7 @@ START_MENU(); BACK_ITEM(MSG_LED_CONTROL); #if ENABLED(NEOPIXEL2_SEPARATE) - STATIC_ITEM_N(MSG_LED_CHANNEL_N, 1, SS_DEFAULT|SS_INVERT); + STATIC_ITEM_N(1, MSG_LED_CHANNEL_N, SS_DEFAULT|SS_INVERT); #endif EDIT_ITEM(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); EDIT_ITEM(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); @@ -95,7 +95,7 @@ EDIT_ITEM(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); #endif #if ENABLED(NEOPIXEL2_SEPARATE) - STATIC_ITEM_N(MSG_LED_CHANNEL_N, 2, SS_DEFAULT|SS_INVERT); + STATIC_ITEM_N(2, MSG_LED_CHANNEL_N, SS_DEFAULT|SS_INVERT); EDIT_ITEM(uint8, MSG_INTENSITY_R, &leds2.color.r, 0, 255, leds2.update, true); EDIT_ITEM(uint8, MSG_INTENSITY_G, &leds2.color.g, 0, 255, leds2.update, true); EDIT_ITEM(uint8, MSG_INTENSITY_B, &leds2.color.b, 0, 255, leds2.update, true); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 96f632508041..d7345039b568 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -165,15 +165,13 @@ void _goto_manual_move(const_float_t scale) { void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int8_t eindex=active_extruder) { _manual_move_func_ptr = func; START_MENU(); + if (LCD_HEIGHT >= 4) { - switch (axis) { - case X_AXIS: STATIC_ITEM(MSG_MOVE_X, SS_DEFAULT|SS_INVERT); break; - case Y_AXIS: STATIC_ITEM(MSG_MOVE_Y, SS_DEFAULT|SS_INVERT); break; - case Z_AXIS: STATIC_ITEM(MSG_MOVE_Z, SS_DEFAULT|SS_INVERT); break; - default: - TERN_(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin = current_position.e); - STATIC_ITEM(MSG_MOVE_E, SS_DEFAULT|SS_INVERT); - break; + if (axis < LINEAR_AXES) + STATIC_ITEM_N(axis, MSG_MOVE_N, SS_DEFAULT|SS_INVERT); + else { + TERN_(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin = current_position.e); + STATIC_ITEM(MSG_MOVE_E, SS_DEFAULT|SS_INVERT); } } From 70d72354e2469eb66378e2da3a52ecd6db3f3447 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2022 05:55:23 -0500 Subject: [PATCH 383/502] =?UTF-8?q?=F0=9F=8E=A8=20Use=20MAP=20for=20home?= =?UTF-8?q?=20axis=20items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_motion.cpp | 36 ++++------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index d7345039b568..2e79d2add24c 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -316,6 +316,8 @@ void menu_move() { END_MENU(); } +#define _HOME_ITEM(N) GCODES_ITEM_N(N##_AXIS, MSG_AUTO_HOME_A, F("G28X" STR_##N)); + #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) // // "Motion" > "Homing" submenu @@ -325,22 +327,7 @@ void menu_move() { BACK_ITEM(MSG_MOTION); GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR)); - GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, F("G28X")); - #if HAS_Y_AXIS - GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, F("G28Y")); - #endif - #if HAS_Z_AXIS - GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, F("G28Z")); - #endif - #if HAS_I_AXIS - GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, F("G28" STR_I)); - #endif - #if HAS_J_AXIS - GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, F("G28" STR_J)); - #endif - #if HAS_K_AXIS - GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, F("G28" STR_K)); - #endif + MAIN_AXIS_MAP(_HOME_ITEM); END_MENU(); } @@ -378,22 +365,7 @@ void menu_motion() { #else GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR)); #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) - GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, F("G28X")); - #if HAS_Y_AXIS - GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, F("G28Y")); - #endif - #if HAS_Z_AXIS - GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, F("G28Z")); - #endif - #if HAS_I_AXIS - GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, F("G28" STR_I)); - #endif - #if HAS_J_AXIS - GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, F("G28" STR_J)); - #endif - #if HAS_K_AXIS - GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, F("G28" STR_K)); - #endif + MAIN_AXIS_MAP(_HOME_ITEM); #endif #endif From 22e82a13d993e5b0ac1e7f56a77eabbf6da79dfe Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2022 05:55:12 -0500 Subject: [PATCH 384/502] =?UTF-8?q?=F0=9F=8E=A8=20Simplify=20move=20menus?= =?UTF-8?q?=20with=20substitution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- Marlin/src/lcd/menu/menu_motion.cpp | 61 ++++++++++---------------- Marlin/src/libs/L64XX/L64XX_Marlin.cpp | 2 +- 3 files changed, 24 insertions(+), 41 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 2924e9d52391..062d766b42f1 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -483,7 +483,7 @@ void menu_backlash(); // M204 T Travel Acceleration EDIT_ITEM_FAST(float5_25, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 25, max_accel); - #define EDIT_AMAX(Q,L) EDIT_ITEM_FAST(long5_25, MSG_AMAX_##Q, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, max_accel_edit_scaled[_AXIS(Q)], []{ planner.reset_acceleration_rates(); }) + #define EDIT_AMAX(Q,L) EDIT_ITEM_FAST_N(long5_25, _AXIS(Q), MSG_AMAX_N, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, max_accel_edit_scaled[_AXIS(Q)], []{ planner.reset_acceleration_rates(); }) LINEAR_AXIS_CODE( EDIT_AMAX(A, 100), EDIT_AMAX(B, 100), EDIT_AMAX(C, 10), EDIT_AMAX(I, 10), EDIT_AMAX(J, 10), EDIT_AMAX(K, 10) diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 2e79d2add24c..8d83056bf4db 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -57,9 +57,7 @@ // "Motion" > "Move Axis" submenu // -// TODO: Use substitution here with MSG_MOVE_N - -static void _lcd_move_xyz(FSTR_P const name, const AxisEnum axis) { +static void _lcd_move_xyz(const AxisEnum axis) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); if (ui.encoderPosition && !ui.manual_move.processing) { // Get motion limit from software endstops, if any @@ -86,28 +84,20 @@ static void _lcd_move_xyz(FSTR_P const name, const AxisEnum axis) { const float pos = ui.manual_move.axis_value(axis); if (parser.using_inch_units()) { const float imp_pos = LINEAR_UNIT(pos); - MenuEditItemBase::draw_edit_screen(name, ftostr63(imp_pos)); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_N), ftostr63(imp_pos)); } else - MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? (LARGE_AREA_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos)); + MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_N), ui.manual_move.menu_scale >= 0.1f ? (LARGE_AREA_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos)); } } -void lcd_move_x() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_X), X_AXIS); } -#if HAS_Y_AXIS - void lcd_move_y() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_Y), Y_AXIS); } -#endif -#if HAS_Z_AXIS - void lcd_move_z() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_Z), Z_AXIS); } -#endif -#if HAS_I_AXIS - void lcd_move_i() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_I), I_AXIS); } -#endif -#if HAS_J_AXIS - void lcd_move_j() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_J), J_AXIS); } -#endif -#if HAS_K_AXIS - void lcd_move_k() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_K), K_AXIS); } -#endif + +void _lcd_move_axis_n() { _lcd_move_xyz(AxisEnum(MenuItemBase::itemIndex)); } + +// Move functions for non-menu code that hasn't set itemIndex (e.g., keypad) +void lcd_move_axis(const AxisEnum axis) { MenuEditItemBase::itemIndex = int8_t(axis); _lcd_move_axis_n(); } + +// Move Z easy accessor +void lcd_move_z() { lcd_move_axis(Z_AXIS); } #if E_MANUAL @@ -193,6 +183,8 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int END_MENU(); } +void _menu_move_n_distance() { _menu_move_distance(AxisEnum(MenuItemBase::itemIndex), _lcd_move_axis_n); } + #if E_MANUAL inline void _goto_menu_move_distance_e() { @@ -226,29 +218,20 @@ void menu_move() { EDIT_ITEM(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstop._enabled); #endif + // Move submenu for each axis if (NONE(IS_KINEMATIC, NO_MOTION_BEFORE_HOMING) || all_axes_homed()) { if (TERN1(DELTA, current_position.z <= delta_clip_start_height)) { - SUBMENU(MSG_MOVE_X, []{ _menu_move_distance(X_AXIS, lcd_move_x); }); - #if HAS_Y_AXIS - SUBMENU(MSG_MOVE_Y, []{ _menu_move_distance(Y_AXIS, lcd_move_y); }); - #endif + for (uint8_t a = X_AXIS; a <= min(int(Y_AXIS), LINEAR_AXES - 1); a++) + SUBMENU_N(a, MSG_MOVE_N, _menu_move_n_distance); } - #if ENABLED(DELTA) - else + else { + #if ENABLED(DELTA) ACTION_ITEM(MSG_FREE_XY, []{ line_to_z(delta_clip_start_height); ui.synchronize(); }); - #endif - + #endif + } #if HAS_Z_AXIS - SUBMENU(MSG_MOVE_Z, []{ _menu_move_distance(Z_AXIS, lcd_move_z); }); - #endif - #if HAS_I_AXIS - SUBMENU(MSG_MOVE_I, []{ _menu_move_distance(I_AXIS, lcd_move_i); }); - #endif - #if HAS_J_AXIS - SUBMENU(MSG_MOVE_J, []{ _menu_move_distance(J_AXIS, lcd_move_j); }); - #endif - #if HAS_K_AXIS - SUBMENU(MSG_MOVE_K, []{ _menu_move_distance(K_AXIS, lcd_move_k); }); + for (uint8_t a = Z_AXIS; a < LINEAR_AXES; a++) + SUBMENU_N(a, MSG_MOVE_N, _menu_move_n_distance); #endif } else diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp index 1dc27d546538..a9bb67811567 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp @@ -68,7 +68,7 @@ uint8_t L64XX_Marlin::dir_commands[MAX_L64XX]; // array to hold direction comma #define _EN_ITEM(N) , ENABLED(INVERT_E##N##_DIR) const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = { - NUM_AXIS_LIST(ENABLED(INVERT_X_DIR), ENABLED(INVERT_Y_DIR), ENABLED(INVERT_Z_DIR), ENABLED(INVERT_I_DIR), ENABLED(INVERT_J_DIR), ENABLED(INVERT_K_DIR)) + LINEAR_AXIS_LIST(ENABLED(INVERT_X_DIR), ENABLED(INVERT_Y_DIR), ENABLED(INVERT_Z_DIR), ENABLED(INVERT_I_DIR), ENABLED(INVERT_J_DIR), ENABLED(INVERT_K_DIR)) , ENABLED(INVERT_X_DIR) ^ BOTH(HAS_DUAL_X_STEPPERS, INVERT_X2_VS_X_DIR) // X2 , ENABLED(INVERT_Y_DIR) ^ BOTH(HAS_DUAL_Y_STEPPERS, INVERT_Y2_VS_Y_DIR) // Y2 , ENABLED(INVERT_Z_DIR) ^ ENABLED(INVERT_Z2_VS_Z_DIR) // Z2 From 0d1d125bc69bf1634faecea6d0a2862677f584d3 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:33:25 +1200 Subject: [PATCH 385/502] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20Fix=20SD=20moun?= =?UTF-8?q?t=20bug=20(#24319)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/sd/cardreader.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 5e03795692da..3fff79653933 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -495,12 +495,7 @@ void CardReader::manage_media() { // Try to mount the media (only later with SD_IGNORE_AT_STARTUP) if (TERN1(SD_IGNORE_AT_STARTUP, old_stat != 2)) mount(); - if (!isMounted()) { // Not mounted? - stat = 0; - #if HAS_SD_DETECT && DISABLED(SD_IGNORE_AT_STARTUP) - prev_stat = 0; - #endif - } + if (!isMounted()) stat = 0; // Not mounted? TERN_(RESET_STEPPERS_ON_MEDIA_INSERT, reset_stepper_drivers()); // Workaround for Cheetah bug } @@ -512,21 +507,13 @@ void CardReader::manage_media() { if (!stat) return; // Exit if no media is present - static bool did_first_insert = false; - if (did_first_insert) return; // Did a media insert already happen? - did_first_insert = true; // Definitely handling this media insert... + if (old_stat != 2) return; // First mount? DEBUG_ECHOLNPGM("First mount."); // Load settings the first time media is inserted (not just during init) TERN_(SDCARD_EEPROM_EMULATION, settings.first_load()); - #if HAS_USB_FLASH_DRIVE - const millis_t ms = millis(); - DEBUG_ECHOLNPGM("USB mount waiting time = ", ms); - if (ms > 5000) return; // Too late to be considered "already inserted"? - #endif - bool do_auto = true; UNUSED(do_auto); // Check for PLR file. From 000042702108a0c0e8428350961398c4d39e3273 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Wed, 22 Jun 2022 03:45:22 +0100 Subject: [PATCH 386/502] =?UTF-8?q?=F0=9F=A9=B9=20LCD=20strings=20followup?= =?UTF-8?q?,=20fix=20warning=20(#24328)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_x_twist.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_x_twist.cpp b/Marlin/src/lcd/menu/menu_x_twist.cpp index e46745e8b761..a069b427c6bf 100644 --- a/Marlin/src/lcd/menu/menu_x_twist.cpp +++ b/Marlin/src/lcd/menu/menu_x_twist.cpp @@ -99,12 +99,8 @@ void xatc_wizard_menu() { SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move_z( 1); }); SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move_z( 0.1f); }); - if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) { - // Determine digits needed right of decimal - const uint8_t digs = !UNEAR_ZERO((FINE_MANUAL_MOVE) * 1000 - int((FINE_MANUAL_MOVE) * 1000)) ? 4 : - !UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2; + if ((FINE_MANUAL_MOVE) > 0.0f && (FINE_MANUAL_MOVE) < 0.1f) SUBMENU_f(F(STRINGIFY(FINE_MANUAL_MOVE)), MSG_MOVE_N_MM, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); }); - } ACTION_ITEM(MSG_BUTTON_DONE, xatc_wizard_set_offset_and_go_to_next_point); From 7edd37bc5aeeff9c55442bf6d142c3cb9357995c Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:13:18 +1200 Subject: [PATCH 387/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20M423=20invocation?= =?UTF-8?q?=20(#24360)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #23745 --- Marlin/src/gcode/gcode.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index f6e6dda5f87f..3ce48e8e0a5f 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -845,6 +845,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 421: M421(); break; // M421: Set a Mesh Bed Leveling Z coordinate #endif + #if ENABLED(X_AXIS_TWIST_COMPENSATION) + case 423: M423(); break; // M423: Reset, modify, or report X-Twist Compensation data + #endif + #if ENABLED(BACKLASH_GCODE) case 425: M425(); break; // M425: Tune backlash compensation #endif From 185fe5696c9843096a0619797566d7e27d573d75 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Wed, 22 Jun 2022 05:33:03 -0300 Subject: [PATCH 388/502] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20Fix=20BIQU=20BX?= =?UTF-8?q?=20touch=20freeze=20(#24383)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32/tft/gt911.cpp | 16 ++++++++++------ Marlin/src/HAL/STM32/tft/gt911.h | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Marlin/src/HAL/STM32/tft/gt911.cpp b/Marlin/src/HAL/STM32/tft/gt911.cpp index 92e14edb2057..180abc68b054 100644 --- a/Marlin/src/HAL/STM32/tft/gt911.cpp +++ b/Marlin/src/HAL/STM32/tft/gt911.cpp @@ -159,24 +159,28 @@ void GT911::read_reg(uint16_t reg, uint8_t reg_len, uint8_t* r_data, uint8_t r_l void GT911::Init() { OUT_WRITE(GT911_RST_PIN, LOW); OUT_WRITE(GT911_INT_PIN, LOW); - delay(20); + delay(11); + WRITE(GT911_INT_PIN, HIGH); + delayMicroseconds(110); WRITE(GT911_RST_PIN, HIGH); + delay(6); + WRITE(GT911_INT_PIN, LOW); + delay(55); SET_INPUT(GT911_INT_PIN); sw_iic.init(); - uint8_t clear_reg = 0x0000; - write_reg(0x814E, 2, &clear_reg, 2); // Reset to 0 for start + uint8_t clear_reg = 0x00; + write_reg(0x814E, 2, &clear_reg, 1); // Reset to 0 for start } bool GT911::getFirstTouchPoint(int16_t *x, int16_t *y) { read_reg(0x814E, 2, ®.REG.status, 1); - if (reg.REG.status & 0x80) { + if (reg.REG.status >= 0x80 && reg.REG.status <= 0x85) { + read_reg(0x8150, 2, reg.map + 2, 38); uint8_t clear_reg = 0x00; write_reg(0x814E, 2, &clear_reg, 1); // Reset to 0 for start - read_reg(0x8150, 2, reg.map + 2, 8 * (reg.REG.status & 0x0F)); - // First touch point *x = ((reg.REG.point[0].xh & 0x0F) << 8) | reg.REG.point[0].xl; *y = ((reg.REG.point[0].yh & 0x0F) << 8) | reg.REG.point[0].yl; diff --git a/Marlin/src/HAL/STM32/tft/gt911.h b/Marlin/src/HAL/STM32/tft/gt911.h index 752a554d98ed..6ecfe8b82ec7 100644 --- a/Marlin/src/HAL/STM32/tft/gt911.h +++ b/Marlin/src/HAL/STM32/tft/gt911.h @@ -23,7 +23,7 @@ #include "../../../inc/MarlinConfig.h" -#define GT911_SLAVE_ADDRESS 0xBA +#define GT911_SLAVE_ADDRESS 0x28 #if !PIN_EXISTS(GT911_RST) #error "GT911_RST_PIN is not defined." From 010fbcccf7fc2aa7c421fa5df1a9d1a32f477fcc Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 22 Jun 2022 22:08:24 +1200 Subject: [PATCH 389/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20DGUS=20(MKS)=20com?= =?UTF-8?q?pile=20(#24378)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/pause.cpp | 10 +++++++--- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/inc/Conditionals_adv.h | 8 ++++---- .../lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 19 +++++++++---------- Marlin/src/lcd/marlinui.h | 3 ++- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index ac5852f91a1a..e9cb2df594d2 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -711,9 +711,13 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_ TERN_(HAS_FILAMENT_SENSOR, runout.reset()); - TERN(DWIN_LCD_PROUI, DWIN_Print_Resume(), ui.reset_status()); - TERN_(HAS_MARLINUI_MENU, ui.return_to_status()); - TERN_(DWIN_LCD_PROUI, HMI_ReturnScreen()); + #if ENABLED(DWIN_LCD_PROUI) + DWIN_Print_Resume(); + HMI_ReturnScreen(); + #else + ui.reset_status(); + ui.return_to_status(); + #endif } #endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 5b6313b19d70..ac729d9fed75 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -513,7 +513,7 @@ #define HAS_LCDPRINT 1 #endif -#if ANY(HAS_DISPLAY, HAS_DWIN_E3V2) +#if HAS_DISPLAY || HAS_DWIN_E3V2 #define HAS_STATUS_MESSAGE 1 #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 0490f33eb0dd..a137b86e58d6 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1003,13 +1003,13 @@ * LCD_SERIAL_PORT must be defined ahead of HAL.h */ #ifndef LCD_SERIAL_PORT - #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI + #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI || HAS_DGUS_LCD #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO) #define LCD_SERIAL_PORT 1 - #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423) - #define LCD_SERIAL_PORT 2 // Creality Ender3S1 board + #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423, MKS_ROBIN) + #define LCD_SERIAL_PORT 2 // Creality Ender3S1, MKS Robin #else - #define LCD_SERIAL_PORT 3 // Creality 4.x board + #define LCD_SERIAL_PORT 3 // Other boards #endif #endif #ifdef LCD_SERIAL_PORT diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 18ac433b719a..2d4fe2e29d3a 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -258,7 +258,7 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendTMCStepValue(DGUS_VP_Variable &var) { ) filelist.refresh(); } - void DGUSScreenHandler::SDPrintingFinished() { + void DGUSScreenHandlerMKS::SDPrintingFinished() { if (DGUSAutoTurnOff) { queue.exhaust(); gcode.process_subcommands_now(F("M81")); @@ -416,15 +416,15 @@ void DGUSScreenHandlerMKS::LanguageChange(DGUS_VP_Variable &var, void *val_ptr) case MKS_SimpleChinese: DGUS_LanguageDisplay(MKS_SimpleChinese); mks_language_index = MKS_SimpleChinese; - dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_Choose); - dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_NoChoose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, (uint8_t)MKS_Language_Choose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, (uint8_t)MKS_Language_NoChoose); settings.save(); break; case MKS_English: DGUS_LanguageDisplay(MKS_English); mks_language_index = MKS_English; - dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_NoChoose); - dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_Choose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, (uint8_t)MKS_Language_NoChoose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, (uint8_t)MKS_Language_Choose); settings.save(); break; default: break; @@ -1125,7 +1125,6 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr) #if ENABLED(BABYSTEPPING) void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) { DEBUG_ECHOLNPGM("HandleLiveAdjustZ"); - char babystep_buf[30]; float step = ZOffset_distance; uint16_t flag = swap16(*(uint16_t*)val_ptr); @@ -1446,12 +1445,12 @@ bool DGUSScreenHandlerMKS::loop() { void DGUSScreenHandlerMKS::LanguagePInit() { switch (mks_language_index) { case MKS_SimpleChinese: - dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_Choose); - dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_NoChoose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, (uint8_t)MKS_Language_Choose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, (uint8_t)MKS_Language_NoChoose); break; case MKS_English: - dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, MKS_Language_NoChoose); - dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, MKS_Language_Choose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE1, (uint8_t)MKS_Language_NoChoose); + dgusdisplay.WriteVariable(VP_LANGUAGE_CHANGE2, (uint8_t)MKS_Language_Choose); break; default: break; diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 66e5e0c26181..8ae8a8b7f5ce 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -502,7 +502,6 @@ class MarlinUI { #else // No LCD static void update() {} - static void return_to_status() {} static void kill_screen(FSTR_P const, FSTR_P const) {} #endif @@ -609,6 +608,8 @@ class MarlinUI { #else + static void return_to_status() {} + static constexpr bool on_status_screen() { return true; } #if HAS_WIRED_LCD From dd68461bb1a2bc714f6b48008d2cf87c1e9e1d4e Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 23 Jun 2022 06:18:36 -0300 Subject: [PATCH 390/502] =?UTF-8?q?=E2=9C=A8=20Classic=20UI=20BIQU=20BX=20?= =?UTF-8?q?(#24387)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 3 +- Marlin/src/inc/SanityCheck.h | 4 +- Marlin/src/lcd/dogm/HAL_LCD_com_defines.h | 2 +- Marlin/src/lcd/touch/touch_buttons.cpp | 45 +++++++++++--------- Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h | 7 ++- 5 files changed, 35 insertions(+), 26 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index ac729d9fed75..53e68c5ab1f9 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1389,7 +1389,8 @@ #elif ENABLED(TFT_RES_1024x600) #define TFT_WIDTH 1024 #define TFT_HEIGHT 600 - #define GRAPHICAL_TFT_UPSCALE 4 + #define GRAPHICAL_TFT_UPSCALE 6 + #define TFT_PIXEL_OFFSET_X 120 #endif // FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi|ltdc).h diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 4e5d3a96aaea..3c3a66ea6f4b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2829,8 +2829,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif -#if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 4) - #error "GRAPHICAL_TFT_UPSCALE must be 2, 3, or 4." +#if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 6) + #error "GRAPHICAL_TFT_UPSCALE must be between 2 and 6." #endif #if BOTH(CHIRON_TFT_STANDARD, CHIRON_TFT_NEW) diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h index e5c6524a9ec4..f38c9d76e3ba 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h @@ -124,7 +124,7 @@ #ifndef U8G_COM_SSD_I2C_HAL #define U8G_COM_SSD_I2C_HAL u8g_com_null_fn #endif -#if HAS_FSMC_GRAPHICAL_TFT || HAS_SPI_GRAPHICAL_TFT +#if HAS_FSMC_GRAPHICAL_TFT || HAS_SPI_GRAPHICAL_TFT || HAS_LTDC_GRAPHICAL_TFT uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); #define U8G_COM_HAL_TFT_FN u8g_com_hal_tft_fn #else diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index dcdc7def8667..604f366ed4f2 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -68,26 +68,31 @@ uint8_t TouchButtons::read_buttons() { #ifdef HAS_WIRED_LCD int16_t x, y; - const bool is_touched = (TERN(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration.orientation, TOUCH_ORIENTATION) == TOUCH_PORTRAIT ? touchIO.getRawPoint(&y, &x) : touchIO.getRawPoint(&x, &y)); - #if HAS_TOUCH_SLEEP - if (is_touched) - wakeUp(); - else if (!isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen()) - sleepTimeout(); - #endif - if (!is_touched) return 0; - - #if ENABLED(TOUCH_SCREEN_CALIBRATION) - const calibrationState state = touch_calibration.get_calibration_state(); - if (WITHIN(state, CALIBRATION_TOP_LEFT, CALIBRATION_BOTTOM_RIGHT)) { - if (touch_calibration.handleTouch(x, y)) ui.refresh(); - return 0; - } - x = int16_t((int32_t(x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x; - y = int16_t((int32_t(y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y; - #else - x = uint16_t((uint32_t(x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X; - y = uint16_t((uint32_t(y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y; + #if ENABLED(TFT_TOUCH_DEVICE_XPT2046) + const bool is_touched = (TERN(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration.orientation, TOUCH_ORIENTATION) == TOUCH_PORTRAIT ? touchIO.getRawPoint(&y, &x) : touchIO.getRawPoint(&x, &y)); + #if HAS_TOUCH_SLEEP + if (is_touched) + wakeUp(); + else if (!isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen()) + sleepTimeout(); + #endif + if (!is_touched) return 0; + + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + const calibrationState state = touch_calibration.get_calibration_state(); + if (WITHIN(state, CALIBRATION_TOP_LEFT, CALIBRATION_BOTTOM_RIGHT)) { + if (touch_calibration.handleTouch(x, y)) ui.refresh(); + return 0; + } + x = int16_t((int32_t(x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x; + y = int16_t((int32_t(y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y; + #else + x = uint16_t((uint32_t(x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X; + y = uint16_t((uint32_t(y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y; + #endif + #elif ENABLED(TFT_TOUCH_DEVICE_GT911) + bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? touchIO.getPoint(&y, &x) : touchIO.getPoint(&x, &y)); + if (!is_touched) return 0; #endif // Touch within the button area simulates an encoder button diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h index 5a772eb21b09..ddc0a202ea30 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX.h @@ -33,6 +33,7 @@ #define MARLIN_EEPROM_SIZE 0x1000 // 4K (24C32) #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support +//#define SWD_DEBUG // Use pins PA13 and PA14 on STM32H7 for the SWD debugger // // Limit Switches @@ -47,8 +48,10 @@ #define FIL_RUNOUT_PIN PD13 #define FIL_RUNOUT2_PIN PB13 -#define LED_PIN PA13 -#define BEEPER_PIN PA14 +#ifndef SWD_DEBUG + #define LED_PIN PA13 + #define BEEPER_PIN PA14 +#endif #define POWER_MONITOR_PIN PB0 #define RPI_POWER_PIN PE5 From ae8365a4e56d91374e1ea20e6edb1c0bf041ad46 Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Thu, 23 Jun 2022 23:58:26 -0500 Subject: [PATCH 391/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Lerdge=20build=20/?= =?UTF-8?q?=20encrypt=20(#24391)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- buildroot/share/PlatformIO/scripts/lerdge.py | 10 +-- buildroot/share/PlatformIO/scripts/marlin.py | 4 +- .../PlatformIO/scripts/offset_and_rename.py | 10 +-- ini/stm32f1.ini | 36 ++++----- ini/stm32f4.ini | 80 +++++++++---------- 5 files changed, 70 insertions(+), 70 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/lerdge.py b/buildroot/share/PlatformIO/scripts/lerdge.py index 505a935560a9..06e454393073 100644 --- a/buildroot/share/PlatformIO/scripts/lerdge.py +++ b/buildroot/share/PlatformIO/scripts/lerdge.py @@ -26,10 +26,10 @@ def encrypt_file(input, output_file, file_length): input_file[i] = encryptByte(input_file[i]) output_file.write(input_file) - # Encrypt ${PROGNAME}.bin and save it with the name given in build.encrypt + # Encrypt ${PROGNAME}.bin and save it with the name given in build.crypt_lerdge def encrypt(source, target, env): fwpath = target[0].path - enname = board.get("build.encrypt") + enname = board.get("build.crypt_lerdge") print("Encrypting %s to %s" % (fwpath, enname)) fwfile = open(fwpath, "rb") enfile = open(target[0].dir.path + "/" + enname, "wb") @@ -41,9 +41,9 @@ def encrypt(source, target, env): enfile.close() os.remove(fwpath) - if 'encrypt' in board.get("build").keys(): - if board.get("build.encrypt") != "": + if 'crypt_lerdge' in board.get("build").keys(): + if board.get("build.crypt_lerdge") != "": marlin.add_post_action(encrypt) else: - print("LERDGE builds require output file via board_build.encrypt = 'filename' parameter") + print("LERDGE builds require output file via board_build.crypt_lerdge = 'filename' parameter") exit(1) diff --git a/buildroot/share/PlatformIO/scripts/marlin.py b/buildroot/share/PlatformIO/scripts/marlin.py index 8ac36b7d59b5..580268c42324 100644 --- a/buildroot/share/PlatformIO/scripts/marlin.py +++ b/buildroot/share/PlatformIO/scripts/marlin.py @@ -41,8 +41,8 @@ def custom_ld_script(ldname): elif flag == "-T": env["LINKFLAGS"][i + 1] = apath -# Encrypt ${PROGNAME}.bin and save it with a new name -# Called by specific encrypt() functions, mostly for MKS boards +# Encrypt ${PROGNAME}.bin and save it with a new name. This applies (mostly) to MKS boards +# This PostAction is set up by offset_and_rename.py for envs with 'build.encrypt_mks'. def encrypt_mks(source, target, env, new_name): import sys diff --git a/buildroot/share/PlatformIO/scripts/offset_and_rename.py b/buildroot/share/PlatformIO/scripts/offset_and_rename.py index ddbb786fecd1..6f445246190f 100644 --- a/buildroot/share/PlatformIO/scripts/offset_and_rename.py +++ b/buildroot/share/PlatformIO/scripts/offset_and_rename.py @@ -39,15 +39,15 @@ env["LINKFLAGS"][i] = "-Wl,--defsym=LD_MAX_DATA_SIZE=" + str(maximum_ram_size - 40) # - # For build.encrypt rename and encode the firmware file. + # For build.encrypt_mks rename and encode the firmware file. # - if 'encrypt' in board_keys: + if 'encrypt_mks' in board_keys: - # Encrypt ${PROGNAME}.bin and save it with the name given in build.encrypt + # Encrypt ${PROGNAME}.bin and save it with the name given in build.encrypt_mks def encrypt(source, target, env): - marlin.encrypt_mks(source, target, env, board.get("build.encrypt")) + marlin.encrypt_mks(source, target, env, board.get("build.encrypt_mks")) - if board.get("build.encrypt") != "": + if board.get("build.encrypt_mks") != "": marlin.add_post_action(encrypt) # diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index a4ad79adfaff..8835c1acd8ce 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -89,22 +89,22 @@ board_upload.offset_address = 0x08005000 # Uses HAL STM32 to support Marlin UI for TFT screen with optional touch panel # [env:mks_robin] -extends = stm32_variant -board = genericSTM32F103ZE -board_build.variant = MARLIN_F103Zx -board_build.encrypt = Robin.bin -board_build.offset = 0x7000 -build_flags = ${stm32_variant.build_flags} - -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 -build_unflags = ${stm32_variant.build_unflags} - -DUSBCON -DUSBD_USE_CDC +extends = stm32_variant +board = genericSTM32F103ZE +board_build.variant = MARLIN_F103Zx +board_build.encrypt_mks = Robin.bin +board_build.offset = 0x7000 +build_flags = ${stm32_variant.build_flags} + -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 +build_unflags = ${stm32_variant.build_unflags} + -DUSBCON -DUSBD_USE_CDC # # MKS Robin E3/E3D (STM32F103RCT6) with TMC2209 # [env:mks_robin_e3] extends = common_STM32F103RC_variant -board_build.encrypt = Robin_e3.bin +board_build.encrypt_mks = Robin_e3.bin board_build.offset = 0x5000 board_upload.offset_address = 0x08005000 build_flags = ${common_STM32F103RC_variant.build_flags} @@ -205,7 +205,7 @@ build_unflags = ${stm32_variant.build_unflags} -DUSBD_USE_CDC extends = stm32_variant board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx -board_build.encrypt = Robin_mini.bin +board_build.encrypt_mks = Robin_mini.bin board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 build_flags = ${stm32_variant.build_flags} @@ -221,7 +221,7 @@ build_unflags = ${stm32_variant.build_unflags} extends = stm32_variant board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx -board_build.encrypt = Robin_nano35.bin +board_build.encrypt_mks = Robin_nano35.bin board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 build_flags = ${stm32_variant.build_flags} @@ -274,7 +274,7 @@ build_flags = ${stm32_variant.build_flags} -DSS_TIMER=4 extends = stm32_variant board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx -board_build.encrypt = Robin_mini.bin +board_build.encrypt_mks = Robin_mini.bin board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 build_flags = ${stm32_variant.build_flags} @@ -287,7 +287,7 @@ build_flags = ${stm32_variant.build_flags} extends = stm32_variant board = genericSTM32F103RC board_build.variant = MARLIN_F103Rx -board_build.encrypt = mksLite.bin +board_build.encrypt_mks = mksLite.bin board_build.offset = 0x5000 board_upload.offset_address = 0x08005000 @@ -296,14 +296,14 @@ board_upload.offset_address = 0x08005000 # [env:mks_robin_lite3] extends = env:mks_robin_lite -board_build.encrypt = mksLite3.bin +board_build.encrypt_mks = mksLite3.bin # # MKS Robin Pro (STM32F103ZET6) # [env:mks_robin_pro] -extends = env:mks_robin -board_build.encrypt = Robin_pro.bin +extends = env:mks_robin +board_build.encrypt_mks = Robin_pro.bin # # MKS Robin E3p (STM32F103VET6) @@ -313,7 +313,7 @@ board_build.encrypt = Robin_pro.bin extends = stm32_variant board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx -board_build.encrypt = Robin_e3p.bin +board_build.encrypt_mks = Robin_e3p.bin board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 build_flags = ${stm32_variant.build_flags} diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 688cc1054736..8bcbb88d9444 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -113,7 +113,7 @@ extra_scripts = ${stm32_variant.extra_scripts} extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx -board_build.encrypt = firmware.srec +board_build.encrypt_mks = firmware.srec board_build.offset = 0x10000 board_upload.offset_address = 0x08010000 build_flags = ${stm32_variant.build_flags} @@ -302,24 +302,24 @@ build_flags = ${stm_flash_drive.build_flags} # Lerdge base # [lerdge_common] -extends = stm32_variant -board = marlin_STM32F407ZGT6 -board_build.variant = MARLIN_LERDGE -board_build.offset = 0x10000 -build_flags = ${stm32_variant.build_flags} - -DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4 - -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DLERDGE_TFT35 -build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -extra_scripts = ${common_stm32.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py - buildroot/share/PlatformIO/scripts/lerdge.py +extends = stm32_variant +board = marlin_STM32F407ZGT6 +board_build.variant = MARLIN_LERDGE +board_build.crypt_lerdge = firmware.bin +board_build.offset = 0x10000 +build_flags = ${stm32_variant.build_flags} + -DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4 + -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DLERDGE_TFT35 +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 +extra_scripts = ${stm32_variant.extra_scripts} + buildroot/share/PlatformIO/scripts/lerdge.py # # Lerdge X (STM32F407VE) # [env:LERDGEX] -extends = lerdge_common -board_build.encrypt = Lerdge_X_firmware_force.bin +extends = lerdge_common +board_build.crypt_lerdge = Lerdge_X_firmware_force.bin # # Lerdge X with USB Flash Drive Support @@ -333,8 +333,8 @@ build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} # Lerdge S (STM32F407ZG) # [env:LERDGES] -extends = lerdge_common -board_build.encrypt = Lerdge_firmware_force.bin +extends = lerdge_common +board_build.crypt_lerdge = Lerdge_firmware_force.bin # # Lerdge S with USB Flash Drive Support @@ -348,9 +348,9 @@ build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} # Lerdge K (STM32F407ZG) # [env:LERDGEK] -extends = lerdge_common -board_build.encrypt = Lerdge_K_firmware_force.bin -build_flags = ${lerdge_common.build_flags} -DLERDGEK +extends = lerdge_common +board_build.crypt_lerdge = Lerdge_K_firmware_force.bin +build_flags = ${lerdge_common.build_flags} -DLERDGEK # # Lerdge K with USB Flash Drive Support @@ -364,17 +364,17 @@ build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} # RUMBA32 # [env:rumba32] -extends = stm32_variant -board = rumba32_f446ve -board_build.variant = MARLIN_F446VE -board_build.offset = 0x0000 -build_flags = ${stm32_variant.build_flags} - -Os -DHAL_PCD_MODULE_ENABLED - -DDISABLE_GENERIC_SERIALUSB - -DHAL_UART_MODULE_ENABLED - -DTIMER_SERIAL=TIM9 -monitor_speed = 500000 -upload_protocol = dfu +extends = stm32_variant +board = rumba32_f446ve +board_build.variant = MARLIN_F446VE +board_build.offset = 0x0000 +build_flags = ${stm32_variant.build_flags} + -Os -DHAL_PCD_MODULE_ENABLED + -DDISABLE_GENERIC_SERIALUSB + -DHAL_UART_MODULE_ENABLED + -DTIMER_SERIAL=TIM9 +monitor_speed = 500000 +upload_protocol = dfu # # MKS Robin Pro V2 @@ -547,17 +547,17 @@ build_unflags = -DUSBD_USE_CDC # TH3D EZBoard v2.0 (STM32F405RGT6 ARM Cortex-M4) # [env:TH3D_EZBoard_V2] -extends = stm32_variant -board = genericSTM32F405RG -board_build.variant = MARLIN_TH3D_EZBOARD_V2 -board_build.encrypt = firmware.bin -board_build.offset = 0xC000 +extends = stm32_variant +board = genericSTM32F405RG +board_build.variant = MARLIN_TH3D_EZBOARD_V2 +board_build.encrypt_mks = firmware.bin +board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 -build_flags = ${stm32_variant.build_flags} -DHSE_VALUE=12000000U -O0 -debug_tool = stlink -upload_protocol = stlink -extra_scripts = ${stm32_variant.extra_scripts} - buildroot/share/PlatformIO/scripts/openblt.py +build_flags = ${stm32_variant.build_flags} -DHSE_VALUE=12000000U -O0 +debug_tool = stlink +upload_protocol = stlink +extra_scripts = ${stm32_variant.extra_scripts} + buildroot/share/PlatformIO/scripts/openblt.py # # BOARD_MKS_ROBIN_NANO_V1_3_F4 From 1efe48ef656b38e6f60bbd193e66ae9c54f85a9d Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Sat, 18 Jun 2022 05:17:12 +0100 Subject: [PATCH 392/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20G2/G3=20Arcs=20stu?= =?UTF-8?q?tter=20/=20JD=20speed=20(#24362)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/motion/G2_G3.cpp | 179 +++++++++++++++--------------- 1 file changed, 89 insertions(+), 90 deletions(-) diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 0c7bdc7a3a40..0397188a7f95 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -179,8 +179,8 @@ void plan_arc( // Feedrate for the move, scaled by the feedrate multiplier const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); - // Get the nominal segment length based on settings - const float nominal_segment_mm = ( + // Get the ideal segment length for the move based on settings + const float ideal_segment_mm = ( #if ARC_SEGMENTS_PER_SEC // Length based on segments per second and feedrate constrain(scaled_fr_mm_s * RECIPROCAL(ARC_SEGMENTS_PER_SEC), MIN_ARC_SEGMENT_MM, MAX_ARC_SEGMENT_MM) #else @@ -188,19 +188,18 @@ void plan_arc( #endif ); - // Number of whole segments based on the nominal segment length - const float nominal_segments = _MAX(FLOOR(flat_mm / nominal_segment_mm), min_segments); + // Number of whole segments based on the ideal segment length + const float nominal_segments = _MAX(FLOOR(flat_mm / ideal_segment_mm), min_segments), + nominal_segment_mm = flat_mm / nominal_segments; - // A new segment length based on the required minimum - const float segment_mm = constrain(flat_mm / nominal_segments, MIN_ARC_SEGMENT_MM, MAX_ARC_SEGMENT_MM); + // The number of whole segments in the arc, with best attempt to honor MIN_ARC_SEGMENT_MM and MAX_ARC_SEGMENT_MM + const uint16_t segments = nominal_segment_mm > (MAX_ARC_SEGMENT_MM) ? CEIL(flat_mm / (MAX_ARC_SEGMENT_MM)) : + nominal_segment_mm < (MIN_ARC_SEGMENT_MM) ? _MAX(1, FLOOR(flat_mm / (MIN_ARC_SEGMENT_MM))) : + nominal_segments; - // The number of whole segments in the arc, ignoring the remainder - uint16_t segments = FLOOR(flat_mm / segment_mm); - - // Are the segments now too few to reach the destination? - const float segmented_length = segment_mm * segments; - const bool tooshort = segmented_length < flat_mm - 0.0001f; - const float proportion = tooshort ? segmented_length / flat_mm : 1.0f; + #if ENABLED(SCARA_FEEDRATE_SCALING) + const float inv_duration = (scaled_fr_mm_s / flat_mm) * segments; + #endif /** * Vector rotation by transformation matrix: r is the original vector, r_T is the rotated vector, @@ -228,98 +227,98 @@ void plan_arc( * a correction, the planner should have caught up to the lag caused by the initial plan_arc overhead. * This is important when there are successive arc motions. */ - // Vector rotation matrix values - xyze_pos_t raw; - const float theta_per_segment = proportion * angular_travel / segments, - sq_theta_per_segment = sq(theta_per_segment), - sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, - cos_T = 1 - 0.5f * sq_theta_per_segment; // Small angle approximation - - #if DISABLED(AUTO_BED_LEVELING_UBL) - ARC_LIJK_CODE( - const float per_segment_L = proportion * travel_L / segments, - const float per_segment_I = proportion * travel_I / segments, - const float per_segment_J = proportion * travel_J / segments, - const float per_segment_K = proportion * travel_K / segments - ); - #endif - - CODE_ITEM_E(const float extruder_per_segment = proportion * travel_E / segments); - // For shortened segments, run all but the remainder in the loop - if (tooshort) segments++; + xyze_pos_t raw; - // Initialize all linear axes and E - ARC_LIJKE_CODE( - raw[axis_l] = current_position[axis_l], - raw.i = current_position.i, - raw.j = current_position.j, - raw.k = current_position.k, - raw.e = current_position.e - ); + // do not calculate rotation parameters for trivial single-segment arcs + if (segments > 1) { + // Vector rotation matrix values + const float theta_per_segment = angular_travel / segments, + sq_theta_per_segment = sq(theta_per_segment), + sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, + cos_T = 1 - 0.5f * sq_theta_per_segment; // Small angle approximation + + #if DISABLED(AUTO_BED_LEVELING_UBL) + ARC_LIJK_CODE( + const float per_segment_L = travel_L / segments, + const float per_segment_I = travel_I / segments, + const float per_segment_J = travel_J / segments, + const float per_segment_K = travel_K / segments + ); + #endif - #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = scaled_fr_mm_s / segment_mm; - #endif + CODE_ITEM_E(const float extruder_per_segment = travel_E / segments); - millis_t next_idle_ms = millis() + 200UL; + // Initialize all linear axes and E + ARC_LIJKE_CODE( + raw[axis_l] = current_position[axis_l], + raw.i = current_position.i, + raw.j = current_position.j, + raw.k = current_position.k, + raw.e = current_position.e + ); - #if N_ARC_CORRECTION > 1 - int8_t arc_recalc_count = N_ARC_CORRECTION; - #endif + millis_t next_idle_ms = millis() + 200UL; - for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times + #if N_ARC_CORRECTION > 1 + int8_t arc_recalc_count = N_ARC_CORRECTION; + #endif - thermalManager.manage_heater(); - const millis_t ms = millis(); - if (ELAPSED(ms, next_idle_ms)) { - next_idle_ms = ms + 200UL; - idle(); - } + for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times - #if N_ARC_CORRECTION > 1 - if (--arc_recalc_count) { - // Apply vector rotation matrix to previous rvec.a / 1 - const float r_new_Y = rvec.a * sin_T + rvec.b * cos_T; - rvec.a = rvec.a * cos_T - rvec.b * sin_T; - rvec.b = r_new_Y; + thermalManager.manage_heater(); + const millis_t ms = millis(); + if (ELAPSED(ms, next_idle_ms)) { + next_idle_ms = ms + 200UL; + idle(); } - else - #endif - { + #if N_ARC_CORRECTION > 1 - arc_recalc_count = N_ARC_CORRECTION; + if (--arc_recalc_count) { + // Apply vector rotation matrix to previous rvec.a / 1 + const float r_new_Y = rvec.a * sin_T + rvec.b * cos_T; + rvec.a = rvec.a * cos_T - rvec.b * sin_T; + rvec.b = r_new_Y; + } + else #endif + { + #if N_ARC_CORRECTION > 1 + arc_recalc_count = N_ARC_CORRECTION; + #endif + + // Arc correction to radius vector. Computed only every N_ARC_CORRECTION increments. + // Compute exact location by applying transformation matrix from initial radius vector(=-offset). + // To reduce stuttering, the sin and cos could be computed at different times. + // For now, compute both at the same time. + const float cos_Ti = cos(i * theta_per_segment), sin_Ti = sin(i * theta_per_segment); + rvec.a = -offset[0] * cos_Ti + offset[1] * sin_Ti; + rvec.b = -offset[0] * sin_Ti - offset[1] * cos_Ti; + } - // Arc correction to radius vector. Computed only every N_ARC_CORRECTION increments. - // Compute exact location by applying transformation matrix from initial radius vector(=-offset). - // To reduce stuttering, the sin and cos could be computed at different times. - // For now, compute both at the same time. - const float cos_Ti = cos(i * theta_per_segment), sin_Ti = sin(i * theta_per_segment); - rvec.a = -offset[0] * cos_Ti + offset[1] * sin_Ti; - rvec.b = -offset[0] * sin_Ti - offset[1] * cos_Ti; - } - - // Update raw location - raw[axis_p] = center_P + rvec.a; - raw[axis_q] = center_Q + rvec.b; - ARC_LIJKE_CODE( - #if ENABLED(AUTO_BED_LEVELING_UBL) - raw[axis_l] = start_L, raw.i = start_I, raw.j = start_J, raw.k = start_K - #else - raw[axis_l] += per_segment_L, raw.i += per_segment_I, raw.j += per_segment_J, raw.k += per_segment_K - #endif - , raw.e += extruder_per_segment - ); + // Update raw location + raw[axis_p] = center_P + rvec.a; + raw[axis_q] = center_Q + rvec.b; + ARC_LIJKE_CODE( + #if ENABLED(AUTO_BED_LEVELING_UBL) + raw[axis_l] = start_L, + raw.i = start_I, raw.j = start_J, raw.k = start_K + #else + raw[axis_l] += per_segment_L, + raw.i += per_segment_I, raw.j += per_segment_J, raw.k += per_segment_K + #endif + , raw.e += extruder_per_segment + ); - apply_motion_limits(raw); + apply_motion_limits(raw); - #if HAS_LEVELING && !PLANNER_LEVELING - planner.apply_leveling(raw); - #endif + #if HAS_LEVELING && !PLANNER_LEVELING + planner.apply_leveling(raw); + #endif - if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, 0 OPTARG(SCARA_FEEDRATE_SCALING, inv_duration))) - break; + if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, 0 OPTARG(SCARA_FEEDRATE_SCALING, inv_duration))) + break; + } } // Ensure last segment arrives at target location. From 4dad5871888fd99fea0ec918c04f1c134f49ab8a Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Tue, 21 Jun 2022 22:09:24 -0400 Subject: [PATCH 393/502] =?UTF-8?q?=F0=9F=90=9B=20Resolve=20DUE=20Servo=20?= =?UTF-8?q?pulse=20issue=20(#24305)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: sjasonsmith <20053467+sjasonsmith@users.noreply.github.com> Co-authored-by: Scott Lahteine --- Marlin/src/HAL/AVR/Servo.cpp | 200 ++++++++++++++------------ Marlin/src/HAL/DUE/Servo.cpp | 129 +++++++++-------- Marlin/src/HAL/DUE/ServoTimers.h | 2 +- Marlin/src/HAL/DUE/timers.cpp | 11 +- Marlin/src/HAL/DUE/timers.h | 3 +- Marlin/src/HAL/SAMD51/Servo.cpp | 43 +++--- Marlin/src/HAL/shared/servo_private.h | 4 +- Marlin/src/core/serial.cpp | 4 +- Marlin/src/core/types.h | 10 +- 9 files changed, 213 insertions(+), 193 deletions(-) diff --git a/Marlin/src/HAL/AVR/Servo.cpp b/Marlin/src/HAL/AVR/Servo.cpp index 6dc1e2fb0732..0a1ef5337ae9 100644 --- a/Marlin/src/HAL/AVR/Servo.cpp +++ b/Marlin/src/HAL/AVR/Servo.cpp @@ -67,26 +67,25 @@ static volatile int8_t Channel[_Nbr_16timers]; // counter for the s /************ static functions common to all instances ***********************/ static inline void handle_interrupts(const timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) { - if (Channel[timer] < 0) - *TCNTn = 0; // channel set to -1 indicated that refresh interval completed so reset the timer - else { - if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && SERVO(timer, Channel[timer]).Pin.isActive) - extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // pulse this channel low if activated - } - - Channel[timer]++; // increment to the next channel - if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && Channel[timer] < SERVOS_PER_TIMER) { - *OCRnA = *TCNTn + SERVO(timer, Channel[timer]).ticks; - if (SERVO(timer, Channel[timer]).Pin.isActive) // check if activated - extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, HIGH); // it's an active channel so pulse it high + int8_t cho = Channel[timer]; // Handle the prior Channel[timer] first + if (cho < 0) // Channel -1 indicates the refresh interval completed... + *TCNTn = 0; // ...so reset the timer + else if (SERVO_INDEX(timer, cho) < ServoCount) // prior channel handled? + extDigitalWrite(SERVO(timer, cho).Pin.nbr, LOW); // pulse the prior channel LOW + + Channel[timer] = ++cho; // Handle the next channel (or 0) + if (cho < SERVOS_PER_TIMER && SERVO_INDEX(timer, cho) < ServoCount) { + *OCRnA = *TCNTn + SERVO(timer, cho).ticks; // set compare to current ticks plus duration + if (SERVO(timer, cho).Pin.isActive) // activated? + extDigitalWrite(SERVO(timer, cho).Pin.nbr, HIGH); // yes: pulse HIGH } else { // finished all channels so wait for the refresh period to expire before starting over - if (((unsigned)*TCNTn) + 4 < usToTicks(REFRESH_INTERVAL)) // allow a few ticks to ensure the next OCR1A not missed - *OCRnA = (unsigned int)usToTicks(REFRESH_INTERVAL); - else - *OCRnA = *TCNTn + 4; // at least REFRESH_INTERVAL has elapsed - Channel[timer] = -1; // this will get incremented at the end of the refresh period to start again at the first channel + const unsigned int cval = ((unsigned)*TCNTn) + 32 / (SERVO_TIMER_PRESCALER), // allow 32 cycles to ensure the next OCR1A not missed + ival = (unsigned int)usToTicks(REFRESH_INTERVAL); // at least REFRESH_INTERVAL has elapsed + *OCRnA = max(cval, ival); + + Channel[timer] = -1; // reset the timer counter to 0 on the next call } } @@ -123,91 +122,102 @@ static inline void handle_interrupts(const timer16_Sequence_t timer, volatile ui /****************** end of static functions ******************************/ -void initISR(timer16_Sequence_t timer) { - #ifdef _useTimer1 - if (timer == _timer1) { - TCCR1A = 0; // normal counting mode - TCCR1B = _BV(CS11); // set prescaler of 8 - TCNT1 = 0; // clear the timer count - #if defined(__AVR_ATmega8__) || defined(__AVR_ATmega128__) - SBI(TIFR, OCF1A); // clear any pending interrupts; - SBI(TIMSK, OCIE1A); // enable the output compare interrupt - #else - // here if not ATmega8 or ATmega128 - SBI(TIFR1, OCF1A); // clear any pending interrupts; - SBI(TIMSK1, OCIE1A); // enable the output compare interrupt - #endif - #ifdef WIRING - timerAttach(TIMER1OUTCOMPAREA_INT, Timer1Service); - #endif - } - #endif - - #ifdef _useTimer3 - if (timer == _timer3) { - TCCR3A = 0; // normal counting mode - TCCR3B = _BV(CS31); // set prescaler of 8 - TCNT3 = 0; // clear the timer count - #ifdef __AVR_ATmega128__ - SBI(TIFR, OCF3A); // clear any pending interrupts; - SBI(ETIMSK, OCIE3A); // enable the output compare interrupt - #else - SBI(TIFR3, OCF3A); // clear any pending interrupts; - SBI(TIMSK3, OCIE3A); // enable the output compare interrupt - #endif - #ifdef WIRING - timerAttach(TIMER3OUTCOMPAREA_INT, Timer3Service); // for Wiring platform only - #endif - } - #endif - - #ifdef _useTimer4 - if (timer == _timer4) { - TCCR4A = 0; // normal counting mode - TCCR4B = _BV(CS41); // set prescaler of 8 - TCNT4 = 0; // clear the timer count - TIFR4 = _BV(OCF4A); // clear any pending interrupts; - TIMSK4 = _BV(OCIE4A); // enable the output compare interrupt - } - #endif - - #ifdef _useTimer5 - if (timer == _timer5) { - TCCR5A = 0; // normal counting mode - TCCR5B = _BV(CS51); // set prescaler of 8 - TCNT5 = 0; // clear the timer count - TIFR5 = _BV(OCF5A); // clear any pending interrupts; - TIMSK5 = _BV(OCIE5A); // enable the output compare interrupt - } - #endif -} - -void finISR(timer16_Sequence_t timer) { - // Disable use of the given timer - #ifdef WIRING - if (timer == _timer1) { - CBI( - #if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - TIMSK1 +void initISR(const timer16_Sequence_t timer_index) { + switch (timer_index) { + default: break; + + #ifdef _useTimer1 + case _timer1: + TCCR1A = 0; // normal counting mode + TCCR1B = _BV(CS11); // set prescaler of 8 + TCNT1 = 0; // clear the timer count + #if defined(__AVR_ATmega8__) || defined(__AVR_ATmega128__) + SBI(TIFR, OCF1A); // clear any pending interrupts; + SBI(TIMSK, OCIE1A); // enable the output compare interrupt #else - TIMSK + // here if not ATmega8 or ATmega128 + SBI(TIFR1, OCF1A); // clear any pending interrupts; + SBI(TIMSK1, OCIE1A); // enable the output compare interrupt #endif - , OCIE1A); // disable timer 1 output compare interrupt - timerDetach(TIMER1OUTCOMPAREA_INT); - } - else if (timer == _timer3) { - CBI( - #if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) - TIMSK3 + #ifdef WIRING + timerAttach(TIMER1OUTCOMPAREA_INT, Timer1Service); + #endif + break; + #endif + + #ifdef _useTimer3 + case _timer3: + TCCR3A = 0; // normal counting mode + TCCR3B = _BV(CS31); // set prescaler of 8 + TCNT3 = 0; // clear the timer count + #ifdef __AVR_ATmega128__ + SBI(TIFR, OCF3A); // clear any pending interrupts; + SBI(ETIMSK, OCIE3A); // enable the output compare interrupt #else - ETIMSK + SBI(TIFR3, OCF3A); // clear any pending interrupts; + SBI(TIMSK3, OCIE3A); // enable the output compare interrupt + #endif + #ifdef WIRING + timerAttach(TIMER3OUTCOMPAREA_INT, Timer3Service); // for Wiring platform only #endif - , OCIE3A); // disable the timer3 output compare A interrupt - timerDetach(TIMER3OUTCOMPAREA_INT); + break; + #endif + + #ifdef _useTimer4 + case _timer4: + TCCR4A = 0; // normal counting mode + TCCR4B = _BV(CS41); // set prescaler of 8 + TCNT4 = 0; // clear the timer count + TIFR4 = _BV(OCF4A); // clear any pending interrupts; + TIMSK4 = _BV(OCIE4A); // enable the output compare interrupt + break; + #endif + + #ifdef _useTimer5 + case _timer5: + TCCR5A = 0; // normal counting mode + TCCR5B = _BV(CS51); // set prescaler of 8 + TCNT5 = 0; // clear the timer count + TIFR5 = _BV(OCF5A); // clear any pending interrupts; + TIMSK5 = _BV(OCIE5A); // enable the output compare interrupt + break; + #endif + } +} + +void finISR(const timer16_Sequence_t timer_index) { + // Disable use of the given timer + #ifdef WIRING + switch (timer_index) { + default: break; + + case _timer1: + CBI( + #if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) + TIMSK1 + #else + TIMSK + #endif + , OCIE1A // disable timer 1 output compare interrupt + ); + timerDetach(TIMER1OUTCOMPAREA_INT); + break; + + case _timer3: + CBI( + #if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) + TIMSK3 + #else + ETIMSK + #endif + , OCIE3A // disable the timer3 output compare A interrupt + ); + timerDetach(TIMER3OUTCOMPAREA_INT); + break; } #else // !WIRING // For arduino - in future: call here to a currently undefined function to reset the timer - UNUSED(timer); + UNUSED(timer_index); #endif } diff --git a/Marlin/src/HAL/DUE/Servo.cpp b/Marlin/src/HAL/DUE/Servo.cpp index 72a7d649ef04..2dab88238dd6 100644 --- a/Marlin/src/HAL/DUE/Servo.cpp +++ b/Marlin/src/HAL/DUE/Servo.cpp @@ -47,7 +47,7 @@ #include "../shared/servo.h" #include "../shared/servo_private.h" -static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval) +static Flags<_Nbr_16timers> DisablePending; // ISR should disable the timer at the next timer reset // ------------------------ /// Interrupt handler for the TC0 channel 1. @@ -71,82 +71,91 @@ void Servo_Handler(const timer16_Sequence_t, Tc*, const uint8_t); #endif void Servo_Handler(const timer16_Sequence_t timer, Tc *tc, const uint8_t channel) { - // clear interrupt - tc->TC_CHANNEL[channel].TC_SR; - if (Channel[timer] < 0) - tc->TC_CHANNEL[channel].TC_CCR |= TC_CCR_SWTRG; // channel set to -1 indicated that refresh interval completed so reset the timer - else if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && SERVO(timer, Channel[timer]).Pin.isActive) - extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // pulse this channel low if activated - - Channel[timer]++; // increment to the next channel - if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && Channel[timer] < SERVOS_PER_TIMER) { - tc->TC_CHANNEL[channel].TC_RA = tc->TC_CHANNEL[channel].TC_CV + SERVO(timer,Channel[timer]).ticks; - if (SERVO(timer,Channel[timer]).Pin.isActive) // check if activated - extDigitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, HIGH); // its an active channel so pulse it high + static int8_t Channel[_Nbr_16timers]; // Servo counters to pulse (or -1 for refresh interval) + int8_t cho = Channel[timer]; // Handle the prior Channel[timer] first + if (cho < 0) { // Channel -1 indicates the refresh interval completed... + tc->TC_CHANNEL[channel].TC_CCR |= TC_CCR_SWTRG; // ...so reset the timer + if (DisablePending[timer]) { + // Disabling only after the full servo period expires prevents + // pulses being too close together if immediately re-enabled. + DisablePending.clear(timer); + TC_Stop(tc, channel); + tc->TC_CHANNEL[channel].TC_SR; // clear interrupt + return; + } + } + else if (SERVO_INDEX(timer, cho) < ServoCount) // prior channel handled? + extDigitalWrite(SERVO(timer, cho).Pin.nbr, LOW); // pulse the prior channel LOW + + Channel[timer] = ++cho; // go to the next channel (or 0) + if (cho < SERVOS_PER_TIMER && SERVO_INDEX(timer, cho) < ServoCount) { + tc->TC_CHANNEL[channel].TC_RA = tc->TC_CHANNEL[channel].TC_CV + SERVO(timer, cho).ticks; + if (SERVO(timer, cho).Pin.isActive) // activated? + extDigitalWrite(SERVO(timer, cho).Pin.nbr, HIGH); // yes: pulse HIGH } else { // finished all channels so wait for the refresh period to expire before starting over - tc->TC_CHANNEL[channel].TC_RA = - tc->TC_CHANNEL[channel].TC_CV < usToTicks(REFRESH_INTERVAL) - 4 - ? (unsigned int)usToTicks(REFRESH_INTERVAL) // allow a few ticks to ensure the next OCR1A not missed - : tc->TC_CHANNEL[channel].TC_CV + 4; // at least REFRESH_INTERVAL has elapsed - Channel[timer] = -1; // this will get incremented at the end of the refresh period to start again at the first channel + const unsigned int cval = tc->TC_CHANNEL[channel].TC_CV + 128 / (SERVO_TIMER_PRESCALER), // allow 128 cycles to ensure the next CV not missed + ival = (unsigned int)usToTicks(REFRESH_INTERVAL); // at least REFRESH_INTERVAL has elapsed + tc->TC_CHANNEL[channel].TC_RA = max(cval, ival); + + Channel[timer] = -1; // reset the timer CCR on the next call } + + tc->TC_CHANNEL[channel].TC_SR; // clear interrupt } static void _initISR(Tc *tc, uint32_t channel, uint32_t id, IRQn_Type irqn) { pmc_enable_periph_clk(id); TC_Configure(tc, channel, - TC_CMR_TCCLKS_TIMER_CLOCK3 | // MCK/32 - TC_CMR_WAVE | // Waveform mode - TC_CMR_WAVSEL_UP_RC ); // Counter running up and reset when equals to RC - - /* 84MHz, MCK/32, for 1.5ms: 3937 */ - TC_SetRA(tc, channel, 2625); // 1ms - - /* Configure and enable interrupt */ + TC_CMR_WAVE // Waveform mode + | TC_CMR_WAVSEL_UP_RC // Counter running up and reset when equal to RC + | (SERVO_TIMER_PRESCALER == 2 ? TC_CMR_TCCLKS_TIMER_CLOCK1 : 0) // MCK/2 + | (SERVO_TIMER_PRESCALER == 8 ? TC_CMR_TCCLKS_TIMER_CLOCK2 : 0) // MCK/8 + | (SERVO_TIMER_PRESCALER == 32 ? TC_CMR_TCCLKS_TIMER_CLOCK3 : 0) // MCK/32 + | (SERVO_TIMER_PRESCALER == 128 ? TC_CMR_TCCLKS_TIMER_CLOCK4 : 0) // MCK/128 + ); + + // Wait 1ms before the first ISR + TC_SetRA(tc, channel, (F_CPU) / (SERVO_TIMER_PRESCALER) / 1000UL); // 1ms + + // Configure and enable interrupt NVIC_EnableIRQ(irqn); - // TC_IER_CPAS: RA Compare - tc->TC_CHANNEL[channel].TC_IER = TC_IER_CPAS; + tc->TC_CHANNEL[channel].TC_IER = TC_IER_CPAS; // TC_IER_CPAS: RA Compare // Enables the timer clock and performs a software reset to start the counting TC_Start(tc, channel); } -void initISR(const timer16_Sequence_t timer) { - #ifdef _useTimer1 - if (timer == _timer1) _initISR(TC_FOR_TIMER1, CHANNEL_FOR_TIMER1, ID_TC_FOR_TIMER1, IRQn_FOR_TIMER1); - #endif - #ifdef _useTimer2 - if (timer == _timer2) _initISR(TC_FOR_TIMER2, CHANNEL_FOR_TIMER2, ID_TC_FOR_TIMER2, IRQn_FOR_TIMER2); - #endif - #ifdef _useTimer3 - if (timer == _timer3) _initISR(TC_FOR_TIMER3, CHANNEL_FOR_TIMER3, ID_TC_FOR_TIMER3, IRQn_FOR_TIMER3); - #endif - #ifdef _useTimer4 - if (timer == _timer4) _initISR(TC_FOR_TIMER4, CHANNEL_FOR_TIMER4, ID_TC_FOR_TIMER4, IRQn_FOR_TIMER4); - #endif - #ifdef _useTimer5 - if (timer == _timer5) _initISR(TC_FOR_TIMER5, CHANNEL_FOR_TIMER5, ID_TC_FOR_TIMER5, IRQn_FOR_TIMER5); - #endif +void initISR(const timer16_Sequence_t timer_index) { + CRITICAL_SECTION_START(); + const bool disable_soon = DisablePending[timer_index]; + DisablePending.clear(timer_index); + CRITICAL_SECTION_END(); + + if (!disable_soon) switch (timer_index) { + default: break; + #ifdef _useTimer1 + case _timer1: return _initISR(TC_FOR_TIMER1, CHANNEL_FOR_TIMER1, ID_TC_FOR_TIMER1, IRQn_FOR_TIMER1); + #endif + #ifdef _useTimer2 + case _timer2: return _initISR(TC_FOR_TIMER2, CHANNEL_FOR_TIMER2, ID_TC_FOR_TIMER2, IRQn_FOR_TIMER2); + #endif + #ifdef _useTimer3 + case _timer3: return _initISR(TC_FOR_TIMER3, CHANNEL_FOR_TIMER3, ID_TC_FOR_TIMER3, IRQn_FOR_TIMER3); + #endif + #ifdef _useTimer4 + case _timer4: return _initISR(TC_FOR_TIMER4, CHANNEL_FOR_TIMER4, ID_TC_FOR_TIMER4, IRQn_FOR_TIMER4); + #endif + #ifdef _useTimer5 + case _timer5: return _initISR(TC_FOR_TIMER5, CHANNEL_FOR_TIMER5, ID_TC_FOR_TIMER5, IRQn_FOR_TIMER5); + #endif + } } -void finISR(timer16_Sequence_t) { - #ifdef _useTimer1 - TC_Stop(TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); - #endif - #ifdef _useTimer2 - TC_Stop(TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); - #endif - #ifdef _useTimer3 - TC_Stop(TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); - #endif - #ifdef _useTimer4 - TC_Stop(TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); - #endif - #ifdef _useTimer5 - TC_Stop(TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); - #endif +void finISR(const timer16_Sequence_t timer_index) { + // Timer is disabled from the ISR, to ensure proper final pulse length. + DisablePending.set(timer_index); } #endif // HAS_SERVOS diff --git a/Marlin/src/HAL/DUE/ServoTimers.h b/Marlin/src/HAL/DUE/ServoTimers.h index c32c93825399..95bd404c8061 100644 --- a/Marlin/src/HAL/DUE/ServoTimers.h +++ b/Marlin/src/HAL/DUE/ServoTimers.h @@ -37,7 +37,7 @@ #define _useTimer5 #define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays -#define SERVO_TIMER_PRESCALER 32 // timer prescaler +#define SERVO_TIMER_PRESCALER 2 // timer prescaler /* TC0, chan 0 => TC0_Handler diff --git a/Marlin/src/HAL/DUE/timers.cpp b/Marlin/src/HAL/DUE/timers.cpp index a7bf7fbd6d85..e5647817b6f0 100644 --- a/Marlin/src/HAL/DUE/timers.cpp +++ b/Marlin/src/HAL/DUE/timers.cpp @@ -89,10 +89,17 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { NVIC_SetPriority(irq, timer_config[timer_num].priority); // wave mode, reset counter on match with RC, - TC_Configure(tc, channel, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK1); + TC_Configure(tc, channel, + TC_CMR_WAVE + | TC_CMR_WAVSEL_UP_RC + | (HAL_TIMER_PRESCALER == 2 ? TC_CMR_TCCLKS_TIMER_CLOCK1 : 0) + | (HAL_TIMER_PRESCALER == 8 ? TC_CMR_TCCLKS_TIMER_CLOCK2 : 0) + | (HAL_TIMER_PRESCALER == 32 ? TC_CMR_TCCLKS_TIMER_CLOCK3 : 0) + | (HAL_TIMER_PRESCALER == 128 ? TC_CMR_TCCLKS_TIMER_CLOCK4 : 0) + ); // Set compare value - TC_SetRC(tc, channel, VARIANT_MCK / 2 / frequency); + TC_SetRC(tc, channel, VARIANT_MCK / (HAL_TIMER_PRESCALER) / frequency); // And start timer TC_Start(tc, channel); diff --git a/Marlin/src/HAL/DUE/timers.h b/Marlin/src/HAL/DUE/timers.h index bcfd07e268c5..dc35c77e6384 100644 --- a/Marlin/src/HAL/DUE/timers.h +++ b/Marlin/src/HAL/DUE/timers.h @@ -35,7 +35,8 @@ typedef uint32_t hal_timer_t; #define HAL_TIMER_TYPE_MAX 0xFFFFFFFF -#define HAL_TIMER_RATE ((F_CPU) / 2) // frequency of timers peripherals +#define HAL_TIMER_PRESCALER 2 +#define HAL_TIMER_RATE ((F_CPU) / (HAL_TIMER_PRESCALER)) // frequency of timers peripherals #ifndef MF_TIMER_STEP #define MF_TIMER_STEP 2 // Timer Index for Stepper diff --git a/Marlin/src/HAL/SAMD51/Servo.cpp b/Marlin/src/HAL/SAMD51/Servo.cpp index 04461653f94f..665322fe24bc 100644 --- a/Marlin/src/HAL/SAMD51/Servo.cpp +++ b/Marlin/src/HAL/SAMD51/Servo.cpp @@ -77,7 +77,8 @@ HAL_SERVO_TIMER_ISR() { ; const uint8_t tcChannel = TIMER_TCCHANNEL(timer); - if (currentServoIndex[timer] < 0) { + int8_t cho = currentServoIndex[timer]; // Handle the prior servo first + if (cho < 0) { // Servo -1 indicates the refresh interval completed... #if defined(_useTimer1) && defined(_useTimer2) if (currentServoIndex[timer ^ 1] >= 0) { // Wait for both channels @@ -86,41 +87,33 @@ HAL_SERVO_TIMER_ISR() { return; } #endif - tc->COUNT16.COUNT.reg = TC_COUNTER_START_VAL; + tc->COUNT16.COUNT.reg = TC_COUNTER_START_VAL; // ...so reset the timer SYNC(tc->COUNT16.SYNCBUSY.bit.COUNT); } - else if (SERVO_INDEX(timer, currentServoIndex[timer]) < ServoCount && SERVO(timer, currentServoIndex[timer]).Pin.isActive) - digitalWrite(SERVO(timer, currentServoIndex[timer]).Pin.nbr, LOW); // pulse this channel low if activated - - // Select the next servo controlled by this timer - currentServoIndex[timer]++; + else if (SERVO_INDEX(timer, cho) < ServoCount) // prior channel handled? + digitalWrite(SERVO(timer, cho).Pin.nbr, LOW); // pulse the prior channel LOW - if (SERVO_INDEX(timer, currentServoIndex[timer]) < ServoCount && currentServoIndex[timer] < SERVOS_PER_TIMER) { - if (SERVO(timer, currentServoIndex[timer]).Pin.isActive) // check if activated - digitalWrite(SERVO(timer, currentServoIndex[timer]).Pin.nbr, HIGH); // it's an active channel so pulse it high + currentServoIndex[timer] = ++cho; // go to the next channel (or 0) + if (cho < SERVOS_PER_TIMER && SERVO_INDEX(timer, cho) < ServoCount) { + if (SERVO(timer, cho).Pin.isActive) // activated? + digitalWrite(SERVO(timer, cho).Pin.nbr, HIGH); // yes: pulse HIGH - tc->COUNT16.CC[tcChannel].reg = getTimerCount() - (uint16_t)SERVO(timer, currentServoIndex[timer]).ticks; + tc->COUNT16.CC[tcChannel].reg = getTimerCount() - (uint16_t)SERVO(timer, cho).ticks; } else { // finished all channels so wait for the refresh period to expire before starting over - currentServoIndex[timer] = -1; // this will get incremented at the end of the refresh period to start again at the first channel - - const uint16_t tcCounterValue = getTimerCount(); - - if ((TC_COUNTER_START_VAL - tcCounterValue) + 4UL < usToTicks(REFRESH_INTERVAL)) // allow a few ticks to ensure the next OCR1A not missed - tc->COUNT16.CC[tcChannel].reg = TC_COUNTER_START_VAL - (uint16_t)usToTicks(REFRESH_INTERVAL); - else - tc->COUNT16.CC[tcChannel].reg = (uint16_t)(tcCounterValue - 4UL); // at least REFRESH_INTERVAL has elapsed + currentServoIndex[timer] = -1; // reset the timer COUNT.reg on the next call + const uint16_t cval = getTimerCount() - 256 / (SERVO_TIMER_PRESCALER), // allow 256 cycles to ensure the next CV not missed + ival = (TC_COUNTER_START_VAL) - (uint16_t)usToTicks(REFRESH_INTERVAL); // at least REFRESH_INTERVAL has elapsed + tc->COUNT16.CC[tcChannel].reg = min(cval, ival); } if (tcChannel == 0) { SYNC(tc->COUNT16.SYNCBUSY.bit.CC0); - // Clear the interrupt - tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC0; + tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC0; // Clear the interrupt } else { SYNC(tc->COUNT16.SYNCBUSY.bit.CC1); - // Clear the interrupt - tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC1; + tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC1; // Clear the interrupt } } @@ -201,9 +194,9 @@ void initISR(const timer16_Sequence_t timer) { } } -void finISR(const timer16_Sequence_t timer) { +void finISR(const timer16_Sequence_t timer_index) { Tc * const tc = timer_config[SERVO_TC].pTc; - const uint8_t tcChannel = TIMER_TCCHANNEL(timer); + const uint8_t tcChannel = TIMER_TCCHANNEL(timer_index); // Disable the match channel interrupt request tc->COUNT16.INTENCLR.reg = (tcChannel == 0) ? TC_INTENCLR_MC0 : TC_INTENCLR_MC1; diff --git a/Marlin/src/HAL/shared/servo_private.h b/Marlin/src/HAL/shared/servo_private.h index 021e0cb81d01..10cc5a198821 100644 --- a/Marlin/src/HAL/shared/servo_private.h +++ b/Marlin/src/HAL/shared/servo_private.h @@ -94,5 +94,5 @@ extern ServoInfo_t servo_info[MAX_SERVOS]; // Public functions -extern void initISR(const timer16_Sequence_t timer); -extern void finISR(const timer16_Sequence_t timer); +void initISR(const timer16_Sequence_t timer_index); +void finISR(const timer16_Sequence_t timer_index); diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 562cddbaa07a..743a0601087a 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -73,8 +73,8 @@ void serial_print_P(PGM_P str) { while (const char c = pgm_read_byte(str++)) SERIAL_CHAR(c); } -void serial_echo_start() { static PGMSTR(echomagic, "echo:"); serial_print_P(echomagic); } -void serial_error_start() { static PGMSTR(errormagic, "Error:"); serial_print_P(errormagic); } +void serial_echo_start() { serial_print(F("echo:")); } +void serial_error_start() { serial_print(F("Error:")); } void serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); } diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 0f5cff46678f..e6a706bd0ce0 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -93,9 +93,9 @@ struct Flags { void set(const int n) { b |= (bits_t)_BV(n); } void clear(const int n) { b &= ~(bits_t)_BV(n); } bool test(const int n) const { return TEST(b, n); } - bool operator[](const int n) { return test(n); } + const bool operator[](const int n) { return test(n); } const bool operator[](const int n) const { return test(n); } - const int size() const { return sizeof(b); } + int size() const { return sizeof(b); } }; // Specialization for a single bool flag @@ -107,9 +107,9 @@ struct Flags<1> { void set(const int) { b = true; } void clear(const int) { b = false; } bool test(const int) const { return b; } - bool operator[](const int) { return b; } - const bool operator[](const int) const { return b; } - const int size() const { return sizeof(b); } + bool& operator[](const int) { return b; } + bool operator[](const int) const { return b; } + int size() const { return sizeof(b); } }; typedef Flags<8> flags_8_t; From b220342b26b3ed327ce6723e4912163bd76661f5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Jun 2022 22:07:06 -0500 Subject: [PATCH 394/502] =?UTF-8?q?=F0=9F=8C=90=20Drop=20unused=20delta=20?= =?UTF-8?q?strings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_cz.h | 2 -- Marlin/src/lcd/language/language_de.h | 2 -- Marlin/src/lcd/language/language_en.h | 2 -- Marlin/src/lcd/language/language_es.h | 2 -- Marlin/src/lcd/language/language_eu.h | 1 - Marlin/src/lcd/language/language_fr.h | 2 -- Marlin/src/lcd/language/language_gl.h | 2 -- Marlin/src/lcd/language/language_hu.h | 2 -- Marlin/src/lcd/language/language_it.h | 2 -- Marlin/src/lcd/language/language_nl.h | 2 +- Marlin/src/lcd/language/language_pl.h | 2 -- Marlin/src/lcd/language/language_pt_br.h | 2 -- Marlin/src/lcd/language/language_ro.h | 2 -- Marlin/src/lcd/language/language_ru.h | 6 ------ Marlin/src/lcd/language/language_sk.h | 2 -- Marlin/src/lcd/language/language_sv.h | 2 -- Marlin/src/lcd/language/language_tr.h | 2 -- Marlin/src/lcd/language/language_uk.h | 2 -- Marlin/src/lcd/language/language_vi.h | 2 -- Marlin/src/lcd/language/language_zh_CN.h | 2 -- Marlin/src/lcd/language/language_zh_TW.h | 2 -- 21 files changed, 1 insertion(+), 44 deletions(-) diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index d78b43f9a9e0..555fec1d20a2 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -432,8 +432,6 @@ namespace Language_cz { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibrovat Střed"); LSTR MSG_DELTA_SETTINGS = _UxGT("Delta nastavení"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Autokalibrace"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Nast.výšku delty"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Nast. Z-ofset"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Diag rameno"); LSTR MSG_DELTA_HEIGHT = _UxGT("Výška"); LSTR MSG_DELTA_RADIUS = _UxGT("Poloměr"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 2b22319361aa..a9fa16c77cbe 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -544,8 +544,6 @@ namespace Language_de { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibriere Mitte"); LSTR MSG_DELTA_SETTINGS = _UxGT("Delta Einst. anzeig."); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Autom. Kalibrierung"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta Höhe setzen"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Sondenversatz Z"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Diag Rod"); LSTR MSG_DELTA_HEIGHT = _UxGT("Höhe"); LSTR MSG_DELTA_RADIUS = _UxGT("Radius"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 81f30b61d8ef..6e6811d62b08 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -600,8 +600,6 @@ namespace Language_en { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrate Center"); LSTR MSG_DELTA_SETTINGS = _UxGT("Delta Settings"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibration"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Set Delta Height"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Probe Z-offset"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Diag Rod"); LSTR MSG_DELTA_HEIGHT = _UxGT("Height"); LSTR MSG_DELTA_RADIUS = _UxGT("Radius"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index cc331efd4562..9cb86c5c3246 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -430,8 +430,6 @@ namespace Language_es { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); LSTR MSG_DELTA_SETTINGS = _UxGT("Configuración Delta"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibración"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Est. Altura Delta"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Ajustar Sonda Z"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Barra Diagonal"); LSTR MSG_DELTA_HEIGHT = _UxGT("Altura"); LSTR MSG_DELTA_RADIUS = _UxGT("Radio"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 09a0fbeb6ac6..5504d4da942e 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -257,7 +257,6 @@ namespace Language_eu { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibratu Zentrua"); LSTR MSG_DELTA_SETTINGS = _UxGT("Delta ezarpenak"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Kalibraketa"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta Alt. Ezar."); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Barra diagonala"); LSTR MSG_DELTA_HEIGHT = _UxGT("Altuera"); LSTR MSG_DELTA_RADIUS = _UxGT("Erradioa"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 6081234607f4..55b1b4e2e9c9 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -460,8 +460,6 @@ namespace Language_fr { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrer centre"); LSTR MSG_DELTA_SETTINGS = _UxGT("Réglages Delta"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Calibration Auto"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Hauteur Delta"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Delta Z sonde"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Diagonale"); LSTR MSG_DELTA_HEIGHT = _UxGT("Hauteur"); LSTR MSG_DELTA_RADIUS = _UxGT("Rayon"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index dabd35efcf9b..827130de6c46 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -445,8 +445,6 @@ namespace Language_gl { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); LSTR MSG_DELTA_SETTINGS = _UxGT("Configuración Delta"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibración"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Ax. Altura Delta"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Axustar Sonda Z"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Barra Diagonal"); LSTR MSG_DELTA_HEIGHT = _UxGT("Altura"); LSTR MSG_DELTA_RADIUS = _UxGT("Radio"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 81db96df1702..eebcb759e5e8 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -508,8 +508,6 @@ namespace Language_hu { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Központ kalibrálás"); LSTR MSG_DELTA_SETTINGS = _UxGT("Delta beállítások"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto kalibráció"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta magasság kalib."); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Z eltolás"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Diag rúd"); LSTR MSG_DELTA_HEIGHT = _UxGT("Magasság"); LSTR MSG_DELTA_RADIUS = _UxGT("Sugár"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index b043ac26e168..1a1179f2c7fc 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -554,8 +554,6 @@ namespace Language_it { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibra centro"); LSTR MSG_DELTA_SETTINGS = _UxGT("Impostaz. Delta"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto calibrazione"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Imp. altezza Delta"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Offset sonda-Z"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Barra Diagonale"); LSTR MSG_DELTA_HEIGHT = _UxGT("Altezza"); LSTR MSG_DELTA_RADIUS = _UxGT("Raggio"); diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 6b308ba48bac..ca51198034ea 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -173,8 +173,8 @@ namespace Language_nl { LSTR MSG_DELTA_CALIBRATE_Y = _UxGT("Kalibreer Y"); LSTR MSG_DELTA_CALIBRATE_Z = _UxGT("Kalibreer Z"); LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibreer Midden"); + LSTR MSG_DELTA_SETTINGS = _UxGT("Delta conf"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibratie"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Zet Delta Hoogte"); LSTR MSG_CASE_LIGHT = _UxGT("Case licht"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 630f94ab12df..34155f87fed8 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -400,8 +400,6 @@ namespace Language_pl { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibruj środek"); LSTR MSG_DELTA_SETTINGS = _UxGT("Ustawienia delty"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto kalibrowanie"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Ustaw wysokość delty"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Przesun. Z sondy"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Ukośne ramię"); LSTR MSG_DELTA_HEIGHT = _UxGT("Wysokość"); LSTR MSG_DELTA_RADIUS = _UxGT("Promień"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 5b73d6df6def..0f0f8c5287c2 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -373,8 +373,6 @@ namespace Language_pt_br { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrar Centro"); LSTR MSG_DELTA_SETTINGS = _UxGT("Configuração Delta"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto-Calibração"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Calibrar Altura"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Desloc. Sonda Z"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Haste Diagonal"); LSTR MSG_DELTA_HEIGHT = _UxGT("Altura"); LSTR MSG_DELTA_RADIUS = _UxGT("Raio"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 79160624e7a4..3bd15f18a492 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -452,8 +452,6 @@ namespace Language_ro { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibrate Center"); LSTR MSG_DELTA_SETTINGS = _UxGT("Delta Settings"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Calibration"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Set Delta Height"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Probe Z-offset"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Diag Rod"); LSTR MSG_DELTA_HEIGHT = _UxGT("Inaltime"); LSTR MSG_DELTA_RADIUS = _UxGT("Radius"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 5f05f1d2beb3..c9b4683bb20d 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -628,12 +628,6 @@ namespace Language_ru { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Калибровать центр"); LSTR MSG_DELTA_SETTINGS = _UxGT("Настройки Delta"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Авто калибровка"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Высота Delta"); - #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Зондировать Z-смещения"); - #else - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Зондир. Z-смещения"); - #endif LSTR MSG_DELTA_DIAG_ROD = _UxGT("Стержень диаг."); LSTR MSG_DELTA_HEIGHT = _UxGT("Высота"); LSTR MSG_DELTA_RADIUS = _UxGT("Радиус"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 124080de0b85..89203538984e 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -540,8 +540,6 @@ namespace Language_sk { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibrovať stred"); LSTR MSG_DELTA_SETTINGS = _UxGT("Delta nastavenia"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto-kalibrácia"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Nast. výšku delty"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Ofset sondy Z"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Diag. rameno"); LSTR MSG_DELTA_HEIGHT = _UxGT("Výška"); LSTR MSG_DELTA_RADIUS = _UxGT("Polomer"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index 6e6d3e11ecd0..6bfb7100f4ef 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -489,8 +489,6 @@ namespace Language_sv { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Kalibrera Center"); LSTR MSG_DELTA_SETTINGS = _UxGT("Delta Inställningar"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto Kalibrering"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Sätt Delta Höjd"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Sond Z-offset"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Diag Rod"); LSTR MSG_DELTA_HEIGHT = _UxGT("Höjd"); LSTR MSG_DELTA_RADIUS = _UxGT("Radius"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index b981127ed1cd..c9967f72ec2d 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -426,8 +426,6 @@ namespace Language_tr { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Ayarla Merkez"); LSTR MSG_DELTA_SETTINGS = _UxGT("Delta Ayarları"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Oto Kalibrasyon"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Delta Yük. Ayarla"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Z Prob Ofseti"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Çapral Mil"); LSTR MSG_DELTA_HEIGHT = _UxGT("Yükseklik"); LSTR MSG_DELTA_RADIUS = _UxGT("Yarıçap"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 3c47ccada916..6170faedaeea 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -652,8 +652,6 @@ namespace Language_uk { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Калібр. центр"); LSTR MSG_DELTA_SETTINGS = _UxGT("Параметри Delta"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Автокалібрування"); - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Встан. Висоту Delta"); - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Z-зміщення зонду"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("Діагональ стрижня"); LSTR MSG_DELTA_HEIGHT = _UxGT("Висота"); LSTR MSG_DELTA_RADIUS = _UxGT("Радіус"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index f963e3e346bc..989a201d4d92 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -355,8 +355,6 @@ namespace Language_vi { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Chỉnh Z Center"); // Calibrate Center LSTR MSG_DELTA_SETTINGS = _UxGT("Cài Đặt Delta"); // Delta Settings LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Cân Chỉnh Tự Động"); // Auto Calibration - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Đặt Chiều Cao Delta"); // Set Delta Height - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Đầu Dò Z-Bù Đắp"); // Probe Z-offset LSTR MSG_DELTA_DIAG_ROD = _UxGT("Gậy Chéo"); // Diag Rod LSTR MSG_DELTA_HEIGHT = _UxGT("Chiều Cao"); // Height LSTR MSG_DELTA_RADIUS = _UxGT("Bán Kính"); // Radius diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index a4816ff899c0..fc61b020ffc2 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -454,8 +454,6 @@ namespace Language_zh_CN { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("⊿校准中心"); // "Calibrate Center" LSTR MSG_DELTA_SETTINGS = _UxGT("⊿设置"); // "Delta Settings" LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("⊿自动校准"); // "Auto Calibration" - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("设置⊿高度"); // "Set Delta Height" - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("探针Z偏移量"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("⊿斜柱"); // "Diag Rod" LSTR MSG_DELTA_HEIGHT = _UxGT("⊿高度"); // "Height" LSTR MSG_DELTA_RADIUS = _UxGT("⊿半径"); // "Radius" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 5f7c85c8383d..b35a486e4f6a 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -403,8 +403,6 @@ namespace Language_zh_TW { LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("⊿校準中心"); // "Calibrate Center" LSTR MSG_DELTA_SETTINGS = _UxGT("⊿設置"); // "Delta Settings" LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("⊿自動校準"); // "Auto Calibration" - LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("設置⊿高度"); // "Set Delta Height" - LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Z偏移"); LSTR MSG_DELTA_DIAG_ROD = _UxGT("⊿斜柱"); // "Diag Rod" LSTR MSG_DELTA_HEIGHT = _UxGT("⊿高度"); // "Height" LSTR MSG_DELTA_RADIUS = _UxGT("⊿半徑"); // "Radius" From f3c64fd397b28d132e72852956a36e64d9d53f43 Mon Sep 17 00:00:00 2001 From: sgparry Date: Sun, 26 Jun 2022 07:49:57 +0100 Subject: [PATCH 395/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20LCD=20contrast=20w?= =?UTF-8?q?ith=20K8800=20board?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/ramps/pins_K8800.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/Marlin/src/pins/ramps/pins_K8800.h b/Marlin/src/pins/ramps/pins_K8800.h index f1362ec61d34..17bb59fdc9d0 100644 --- a/Marlin/src/pins/ramps/pins_K8800.h +++ b/Marlin/src/pins/ramps/pins_K8800.h @@ -105,9 +105,6 @@ #define LCD_PINS_D6 33 #define LCD_PINS_D7 31 - #define LCD_CONTRAST_MIN 0 - #define LCD_CONTRAST_MAX 100 - #define LCD_CONTRAST_INIT 30 //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #if IS_NEWPANEL From ed796c83541a9cbbb615fe7be6007735ad279f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Morav=C4=8D=C3=ADk?= Date: Sun, 26 Jun 2022 08:51:16 +0200 Subject: [PATCH 396/502] =?UTF-8?q?=F0=9F=8C=90=20Update=20Slovak=20langua?= =?UTF-8?q?ge=20(#24397)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_sk.h | 92 +++++++++++++++++++++++---- 1 file changed, 78 insertions(+), 14 deletions(-) diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 89203538984e..ef1396e81ff3 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -50,7 +50,10 @@ namespace Language_sk { LSTR WELCOME_MSG = MACHINE_NAME _UxGT(" pripravená."); LSTR MSG_YES = _UxGT("ÁNO"); LSTR MSG_NO = _UxGT("NIE"); + LSTR MSG_HIGH = _UxGT("VYSOKÁ"); + LSTR MSG_LOW = _UxGT("NÍZKA"); LSTR MSG_BACK = _UxGT("Naspäť"); + LSTR MSG_ERROR = _UxGT("Chyba"); LSTR MSG_MEDIA_ABORTING = _UxGT("Ruším..."); LSTR MSG_MEDIA_INSERTED = _UxGT("Karta vložená"); LSTR MSG_MEDIA_REMOVED = _UxGT("Karta vybraná"); @@ -64,6 +67,8 @@ namespace Language_sk { LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft. endstopy"); LSTR MSG_MAIN = _UxGT("Hlavná ponuka"); LSTR MSG_ADVANCED_SETTINGS = _UxGT("Pokročilé nastav."); + LSTR MSG_TOOLBAR_SETUP = _UxGT("Panel nástrojov"); + LSTR MSG_OPTION_DISABLED = _UxGT("Možnosť vypnutá"); LSTR MSG_CONFIGURATION = _UxGT("Konfigurácia"); LSTR MSG_RUN_AUTO_FILES = _UxGT("Auto-štart"); LSTR MSG_DISABLE_STEPPERS = _UxGT("Uvolniť motory"); @@ -77,6 +82,7 @@ namespace Language_sk { LSTR MSG_AUTO_HOME_Z = _UxGT("Domov os Z"); LSTR MSG_FILAMENT_SET = _UxGT("Nastav. filamentu"); LSTR MSG_FILAMENT_MAN = _UxGT("Správa filamentu"); + LSTR MSG_MANUAL_LEVELING = _UxGT("Ručné rovnanie"); LSTR MSG_LEVBED_FL = _UxGT("Ľavý predný"); LSTR MSG_LEVBED_FR = _UxGT("Pravý predný"); LSTR MSG_LEVBED_C = _UxGT("Stred"); @@ -109,7 +115,14 @@ namespace Language_sk { LSTR MSG_PREHEAT_1_ALL = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" všetko"); LSTR MSG_PREHEAT_1_BEDONLY = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" podlož"); LSTR MSG_PREHEAT_1_SETTINGS = _UxGT("Zahriať ") PREHEAT_1_LABEL _UxGT(" nast."); - + #ifdef PREHEAT_2_LABEL + LSTR MSG_PREHEAT_2 = _UxGT("Zahriať ") PREHEAT_2_LABEL; + LSTR MSG_PREHEAT_2_SETTINGS = _UxGT("Zahriať ") PREHEAT_2_LABEL _UxGT(" nast."); + #endif + #ifdef PREHEAT_3_LABEL + LSTR MSG_PREHEAT_3 = _UxGT("Zahriať ") PREHEAT_3_LABEL; + LSTR MSG_PREHEAT_3_SETTINGS = _UxGT("Zahriať ") PREHEAT_3_LABEL _UxGT(" nast."); + #endif LSTR MSG_PREHEAT_M = _UxGT("Zahriať $"); LSTR MSG_PREHEAT_M_H = _UxGT("Zahriať $ ~"); LSTR MSG_PREHEAT_M_END = _UxGT("Zahriať $ hotend"); @@ -144,7 +157,8 @@ namespace Language_sk { LSTR MSG_BED_LEVELING = _UxGT("Vyrovnanie podložky"); LSTR MSG_LEVEL_BED = _UxGT("Vyrovnať podložku"); LSTR MSG_BED_TRAMMING = _UxGT("Vyrovnať rohy"); - LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Zdvyhnite podl., kým sa nezopne sonda"); + LSTR MSG_BED_TRAMMING_MANUAL = _UxGT("Ručné vyrovnanie"); + LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Zdvihnite podl., kým sa nezopne sonda"); LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Rohy sú vrámci odchyl. Vyrovnajte podl."); LSTR MSG_BED_TRAMMING_GOOD_POINTS = _UxGT("Dobré body: "); LSTR MSG_BED_TRAMMING_LAST_Z = _UxGT("Posl. Z: "); @@ -155,10 +169,19 @@ namespace Language_sk { LSTR MSG_MESH_VIEW = _UxGT("Zobraz. sieť bodov"); LSTR MSG_EDITING_STOPPED = _UxGT("Koniec úprav siete"); LSTR MSG_NO_VALID_MESH = _UxGT("Neplatná sieť bodov"); + LSTR MSG_ACTIVATE_MESH = _UxGT("Zapnúť vyrovnanie"); LSTR MSG_PROBING_POINT = _UxGT("Skúšam bod"); LSTR MSG_MESH_X = _UxGT("Index X"); LSTR MSG_MESH_Y = _UxGT("Index Y"); + LSTR MSG_MESH_INSET = _UxGT("Vložiť sieť"); + LSTR MSG_MESH_MIN_X = _UxGT("Min. X sieťe"); + LSTR MSG_MESH_MAX_X = _UxGT("Max. X sieťe"); + LSTR MSG_MESH_MIN_Y = _UxGT("Min. Y sieťe"); + LSTR MSG_MESH_MAX_Y = _UxGT("Max. Y sieťe"); + LSTR MSG_MESH_AMAX = _UxGT("Maximál. oblasť"); + LSTR MSG_MESH_CENTER = _UxGT("Stredová oblasť"); LSTR MSG_MESH_EDIT_Z = _UxGT("Hodnota Z"); + LSTR MSG_MESH_CANCEL = _UxGT("Mriežka zrušená"); LSTR MSG_CUSTOM_COMMANDS = _UxGT("Vlastné príkazy"); LSTR MSG_M48_TEST = _UxGT("M48 Test sondy"); LSTR MSG_M48_POINT = _UxGT("M48 Bod"); @@ -177,6 +200,9 @@ namespace Language_sk { LSTR MSG_UBL_TOOLS = _UxGT("Nástroje UBL"); LSTR MSG_UBL_LEVEL_BED = _UxGT("UBL rovnanie"); LSTR MSG_LCD_TILTING_MESH = _UxGT("Vyrovnávam bod"); + LSTR MSG_UBL_TILT_MESH = _UxGT("Nakloniť sieť"); + LSTR MSG_UBL_TILTING_GRID = _UxGT("Veľkosť nakl. siete"); + LSTR MSG_UBL_MESH_TILTED = _UxGT("Sieť naklonená"); LSTR MSG_UBL_MANUAL_MESH = _UxGT("Manuálna sieť bodov"); LSTR MSG_UBL_MESH_WIZARD = _UxGT("Spriev. UBL rovnan."); LSTR MSG_UBL_BC_INSERT = _UxGT("Položte a zmerajte"); @@ -225,6 +251,7 @@ namespace Language_sk { LSTR MSG_UBL_MANUAL_FILLIN = _UxGT("Ručné vyplnenie"); LSTR MSG_UBL_SMART_FILLIN = _UxGT("Chytré vyplnenie"); LSTR MSG_UBL_FILLIN_MESH = _UxGT("Vyplniť mriežku"); + LSTR MSG_UBL_MESH_FILLED = _UxGT("Doplnené chýb. body"); LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Zrušiť všetko"); LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Zrušiť najbližší"); LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Upraviť všetky"); @@ -233,6 +260,7 @@ namespace Language_sk { LSTR MSG_UBL_STORAGE_SLOT = _UxGT("Pamäťový slot"); LSTR MSG_UBL_LOAD_MESH = _UxGT("Načítať sieť bodov"); LSTR MSG_UBL_SAVE_MESH = _UxGT("Uložiť sieť bodov"); + LSTR MSG_UBL_INVALID_SLOT = _UxGT("Najskôr zvol. slot siete"); LSTR MSG_MESH_LOADED = _UxGT("Sieť %i načítaná"); LSTR MSG_MESH_SAVED = _UxGT("Sieť %i uložená"); LSTR MSG_UBL_NO_STORAGE = _UxGT("Nedostatok miesta"); @@ -325,9 +353,21 @@ namespace Language_sk { LSTR MSG_PID_AUTOTUNE_E = _UxGT("Kalibrácia PID *"); LSTR MSG_PID_CYCLE = _UxGT("Cykly PID"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Kal. PID dokončená"); + LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Kal. PID zlyhala!"); + LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Zlý extrudér"); + LSTR MSG_TEMP_TOO_HIGH = _UxGT("Príliš vysoká tepl."); + LSTR MSG_TIMEOUT = _UxGT("Čas vypršal."); LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-kal. zlyhala! Zlý extrúder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-kal. zlyhala! Príliš vysoká tepl."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-kal. zlyhala! Čas vypršal."); + LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Test. tepl. straty"); + LSTR MSG_MPC_AUTOTUNE = _UxGT("Auto-kal. MPC"); + LSTR MSG_MPC_EDIT = _UxGT("Upraviť * MPC"); + LSTR MSG_MPC_POWER_E = _UxGT("Výkon *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Blokovať C *"); + LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Rozliš. senz. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H okolia *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("H vent. okolia *"); LSTR MSG_SELECT = _UxGT("Vybrať"); LSTR MSG_SELECT_E = _UxGT("Vybrať *"); LSTR MSG_ACC = _UxGT("Zrýchlenie"); @@ -379,6 +419,9 @@ namespace Language_sk { LSTR MSG_ADVANCE_K_E = _UxGT("K pre posun *"); LSTR MSG_CONTRAST = _UxGT("Kontrast LCD"); LSTR MSG_BRIGHTNESS = _UxGT("Jas LCD"); + LSTR MSG_LCD_TIMEOUT_SEC = _UxGT("Čas. limit LCD (s)"); + LSTR MSG_SCREEN_TIMEOUT = _UxGT("Čas. limit LCD (m)"); + LSTR MSG_BRIGHTNESS_OFF = _UxGT("Podsviet. vyp."); LSTR MSG_STORE_EEPROM = _UxGT("Uložiť nastavenie"); LSTR MSG_LOAD_EEPROM = _UxGT("Načítať nastavenie"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Obnoviť nastavenie"); @@ -391,6 +434,10 @@ namespace Language_sk { LSTR MSG_RESET_PRINTER = _UxGT("Reštart. tlačiar."); LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Obnoviť"); LSTR MSG_INFO_SCREEN = _UxGT("Info. obrazovka"); + LSTR MSG_INFO_MACHINENAME = _UxGT("Názov stroja"); + LSTR MSG_INFO_SIZE = _UxGT("Rozmer"); + LSTR MSG_INFO_FWVERSION = _UxGT("Verzia firmvéru"); + LSTR MSG_INFO_BUILD = _UxGT("Čas zostavenia"); LSTR MSG_PREPARE = _UxGT("Príprava tlače"); LSTR MSG_TUNE = _UxGT("Doladenie tlače"); LSTR MSG_POWER_MONITOR = _UxGT("Monitor napájania"); @@ -405,6 +452,8 @@ namespace Language_sk { LSTR MSG_BUTTON_RESET = _UxGT("Vynulovať"); LSTR MSG_BUTTON_IGNORE = _UxGT("Ignorovať"); LSTR MSG_BUTTON_CANCEL = _UxGT("Zrušiť"); + LSTR MSG_BUTTON_CONFIRM = _UxGT("Potvrdiť"); + LSTR MSG_BUTTON_CONTINUE = _UxGT("Pokračovať"); LSTR MSG_BUTTON_DONE = _UxGT("Hotovo"); LSTR MSG_BUTTON_BACK = _UxGT("Naspäť"); LSTR MSG_BUTTON_PROCEED = _UxGT("Pokračovať"); @@ -414,6 +463,8 @@ namespace Language_sk { LSTR MSG_BUTTON_PAUSE = _UxGT("Pauza"); LSTR MSG_BUTTON_RESUME = _UxGT("Obnoviť"); LSTR MSG_BUTTON_ADVANCED = _UxGT("Pokročilé"); + LSTR MSG_BUTTON_SAVE = _UxGT("Uložiť"); + LSTR MSG_BUTTON_PURGE = _UxGT("Vytlačiť"); LSTR MSG_PAUSING = _UxGT("Pozastavujem..."); LSTR MSG_PAUSE_PRINT = _UxGT("Pozastaviť tlač"); LSTR MSG_ADVANCED_PAUSE = _UxGT("Pokročil. pauza"); @@ -433,11 +484,15 @@ namespace Language_sk { LSTR MSG_PRINT_PAUSED = _UxGT("Tlač pozastavená"); LSTR MSG_PRINTING = _UxGT("Tlačím..."); LSTR MSG_STOPPING = _UxGT("Zastavujem..."); + LSTR MSG_REMAINING_TIME = _UxGT("Zostávajúci"); LSTR MSG_PRINT_ABORTED = _UxGT("Tlač zrušená"); LSTR MSG_PRINT_DONE = _UxGT("Tlač dokončená"); + LSTR MSG_PRINTER_KILLED = _UxGT("Tlačiareň zastavená!"); + LSTR MSG_TURN_OFF = _UxGT("Vypnite tlačiareň"); LSTR MSG_NO_MOVE = _UxGT("Žiadny pohyb."); LSTR MSG_KILLED = _UxGT("PRERUŠENÉ. "); LSTR MSG_STOPPED = _UxGT("ZASTAVENÉ. "); + LSTR MSG_FWRETRACT = _UxGT("Firmv. retrakcia"); LSTR MSG_CONTROL_RETRACT = _UxGT("Retrakt mm"); LSTR MSG_CONTROL_RETRACT_SWAP = _UxGT("Výmena Re.mm"); LSTR MSG_CONTROL_RETRACTF = _UxGT("Retraktovať V"); @@ -503,6 +558,9 @@ namespace Language_sk { LSTR MSG_ZPROBE_XOFFSET = _UxGT("X ofset"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Y ofset"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Z ofset"); + LSTR MSG_ZPROBE_MARGIN = _UxGT("Hranica sondy"); + LSTR MSG_Z_FEED_RATE = _UxGT("Rýchl. posunu Z"); + LSTR MSG_ENABLE_HS_MODE = _UxGT("Povoliť rež. HS"); LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Pos. trysku k podl."); LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); @@ -566,30 +624,32 @@ namespace Language_sk { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jas svetla"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Nesprávna tlačiareň"); + LSTR MSG_COLORS_GET = _UxGT("Zvoliť farbu"); + LSTR MSG_COLORS_SELECT = _UxGT("Zvoliť farby"); + LSTR MSG_COLORS_APPLIED = _UxGT("Farby aplikované"); + LSTR MSG_COLORS_RED = _UxGT("Červená"); + LSTR MSG_COLORS_GREEN = _UxGT("Zelená"); + LSTR MSG_COLORS_BLUE = _UxGT("Modrá"); + LSTR MSG_COLORS_WHITE = _UxGT("Biela"); + LSTR MSG_UI_LANGUAGE = _UxGT("Jazyk rozhrania"); + LSTR MSG_SOUND_ENABLE = _UxGT("Povoliť zvuky"); + LSTR MSG_LOCKSCREEN = _UxGT("Uzamknúť obrazovku"); + LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Tlačiareň je uzamknutá,"); + LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("potiahnite pre odomknutie."); + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Prosím čakajte do reštartu."); + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nie je vložená karta."); - LSTR MSG_REMAINING_TIME = _UxGT("Zostávajúci čas"); - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Prosím čakajte do reštartu. "); LSTR MSG_PLEASE_PREHEAT = _UxGT("Prosím zahrejte hotend."); LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Vynulovať počítadlo"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Počet tlačí"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Celkový čas"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Najdlhšia tlač"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Celkom vytlačené"); - LSTR MSG_COLORS_GET = _UxGT("Zvoliť farbu"); - LSTR MSG_COLORS_SELECT = _UxGT("Zvoliť farby"); - LSTR MSG_COLORS_APPLIED = _UxGT("Farby aplikované"); - LSTR MSG_COLORS_RED = _UxGT("Červená"); - LSTR MSG_COLORS_GREEN = _UxGT("Zelená"); - LSTR MSG_COLORS_BLUE = _UxGT("Modrá"); - LSTR MSG_UI_LANGUAGE = _UxGT("Jazyk rozhrania"); - LSTR MSG_SOUND_ENABLE = _UxGT("Povoliť zvuky"); - LSTR MSG_LOCKSCREEN = _UxGT("Uzamknúť obrazovku"); #else LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Žiadna karta"); LSTR MSG_PLEASE_PREHEAT = _UxGT("Prosím zahrejte"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Tlače"); - LSTR MSG_REMAINING_TIME = _UxGT("Zostávajúci"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Čas"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Najdlhšia"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Vytlačené"); @@ -610,10 +670,14 @@ namespace Language_sk { LSTR MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("MOŽNOSTI POKRAČ.:"); LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Vytlačiť viacej"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Obnoviť tlač"); + LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Vytlač. alebo pokrač.?"); LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Tryska: "); LSTR MSG_RUNOUT_SENSOR = _UxGT("Senzor filamentu"); LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Vzd. mm fil. senz."); LSTR MSG_RUNOUT_ENABLE = _UxGT("Zapnúť senzor"); + LSTR MSG_RUNOUT_ACTIVE = _UxGT("Senz. fil. zapn."); + LSTR MSG_INVERT_EXTRUDER = _UxGT("Invert. extrudér"); + LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Min. tepl. extrud."); LSTR MSG_FANCHECK = _UxGT("Kontrola rýchl."); LSTR MSG_KILL_HOMING_FAILED = _UxGT("Parkovanie zlyhalo"); LSTR MSG_LCD_PROBING_FAILED = _UxGT("Kalibrácia zlyhala"); From 4039075a1d7b96482a59987fb78f3e500ede0efb Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Sun, 26 Jun 2022 08:52:19 +0200 Subject: [PATCH 397/502] =?UTF-8?q?=F0=9F=8C=90=20Update=20Italian=20langu?= =?UTF-8?q?age=20(#24398)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_it.h | 81 ++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 15 deletions(-) diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 1a1179f2c7fc..f0c21deb96cd 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -47,7 +47,10 @@ namespace Language_it { LSTR WELCOME_MSG = MACHINE_NAME _UxGT(" pronta."); LSTR MSG_YES = _UxGT("Si"); LSTR MSG_NO = _UxGT("No"); + LSTR MSG_HIGH = _UxGT("ALTO"); + LSTR MSG_LOW = _UxGT("BASSO"); LSTR MSG_BACK = _UxGT("Indietro"); + LSTR MSG_ERROR = _UxGT("Errore"); LSTR MSG_MEDIA_ABORTING = _UxGT("Annullando..."); LSTR MSG_MEDIA_INSERTED = _UxGT("Media inserito"); LSTR MSG_MEDIA_REMOVED = _UxGT("Media rimosso"); @@ -61,6 +64,8 @@ namespace Language_it { LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Finecorsa Soft"); LSTR MSG_MAIN = _UxGT("Menu principale"); LSTR MSG_ADVANCED_SETTINGS = _UxGT("Impostaz. avanzate"); + LSTR MSG_TOOLBAR_SETUP = _UxGT("Cnf barra strumenti"); + LSTR MSG_OPTION_DISABLED = _UxGT("Opzione disab."); LSTR MSG_CONFIGURATION = _UxGT("Configurazione"); LSTR MSG_RUN_AUTO_FILES = _UxGT("Esegui files auto"); LSTR MSG_DISABLE_STEPPERS = _UxGT("Disabilita Motori"); @@ -74,6 +79,7 @@ namespace Language_it { LSTR MSG_AUTO_HOME_Z = _UxGT("Home Z"); LSTR MSG_FILAMENT_SET = _UxGT("Impostaz.filamento"); LSTR MSG_FILAMENT_MAN = _UxGT("Gestione filamento"); + LSTR MSG_MANUAL_LEVELING = _UxGT("Livel.manuale"); LSTR MSG_LEVBED_FL = _UxGT("Davanti Sinistra"); LSTR MSG_LEVBED_FR = _UxGT("Davanti Destra"); LSTR MSG_LEVBED_C = _UxGT("Centro"); @@ -106,7 +112,14 @@ namespace Language_it { LSTR MSG_PREHEAT_1_ALL = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Tutto"); LSTR MSG_PREHEAT_1_BEDONLY = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Piatto"); LSTR MSG_PREHEAT_1_SETTINGS = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" conf"); - + #ifdef PREHEAT_2_LABEL + LSTR MSG_PREHEAT_2 = _UxGT("Preris.") PREHEAT_2_LABEL; + LSTR MSG_PREHEAT_2_SETTINGS = _UxGT("Preris.") PREHEAT_2_LABEL _UxGT(" conf"); + #endif + #ifdef PREHEAT_3_LABEL + LSTR MSG_PREHEAT_3 = _UxGT("Preris.") PREHEAT_3_LABEL; + LSTR MSG_PREHEAT_3_SETTINGS = _UxGT("Preris.") PREHEAT_3_LABEL _UxGT(" conf"); + #endif LSTR MSG_PREHEAT_M = _UxGT("Preriscalda $"); LSTR MSG_PREHEAT_M_H = _UxGT("Preriscalda $ ~"); LSTR MSG_PREHEAT_M_END = _UxGT("Preris.$ Ugello"); @@ -153,10 +166,19 @@ namespace Language_it { LSTR MSG_MESH_VIEW = _UxGT("Visualizza Mesh"); LSTR MSG_EDITING_STOPPED = _UxGT("Modif. Mesh Fermata"); LSTR MSG_NO_VALID_MESH = _UxGT("Mesh non valida"); + LSTR MSG_ACTIVATE_MESH = _UxGT("Attiva livellamento"); LSTR MSG_PROBING_POINT = _UxGT("Punto sondato"); LSTR MSG_MESH_X = _UxGT("Indice X"); LSTR MSG_MESH_Y = _UxGT("Indice Y"); + LSTR MSG_MESH_INSET = _UxGT("Mesh Inset"); + LSTR MSG_MESH_MIN_X = _UxGT("Mesh X minimo"); + LSTR MSG_MESH_MAX_X = _UxGT("Mesh X massimo"); + LSTR MSG_MESH_MIN_Y = _UxGT("Mesh Y minimo"); + LSTR MSG_MESH_MAX_Y = _UxGT("Mesh Y massimo"); + LSTR MSG_MESH_AMAX = _UxGT("Massimizza area"); + LSTR MSG_MESH_CENTER = _UxGT("Area centrale"); LSTR MSG_MESH_EDIT_Z = _UxGT("Valore di Z"); + LSTR MSG_MESH_CANCEL = _UxGT("Mesh cancellato"); LSTR MSG_CUSTOM_COMMANDS = _UxGT("Comandi personaliz."); LSTR MSG_M48_TEST = _UxGT("Test sonda M48"); LSTR MSG_M48_POINT = _UxGT("Punto M48"); @@ -175,6 +197,9 @@ namespace Language_it { LSTR MSG_UBL_TOOLS = _UxGT("Strumenti UBL"); LSTR MSG_UBL_LEVEL_BED = _UxGT("Livel.letto unificato"); LSTR MSG_LCD_TILTING_MESH = _UxGT("Punto inclinaz."); + LSTR MSG_UBL_TILT_MESH = _UxGT("Inclina Mesh"); + LSTR MSG_UBL_TILTING_GRID = _UxGT("Dim.griglia inclin."); + LSTR MSG_UBL_MESH_TILTED = _UxGT("Mesh inclinata"); LSTR MSG_UBL_MANUAL_MESH = _UxGT("Mesh Manuale"); LSTR MSG_UBL_MESH_WIZARD = _UxGT("Creaz.guid.mesh UBL"); LSTR MSG_UBL_BC_INSERT = _UxGT("Metti spes. e misura"); @@ -225,6 +250,7 @@ namespace Language_it { LSTR MSG_UBL_MANUAL_FILLIN = _UxGT("Riempimento Manuale"); LSTR MSG_UBL_SMART_FILLIN = _UxGT("Riempimento Smart"); LSTR MSG_UBL_FILLIN_MESH = _UxGT("Riempimento Mesh"); + LSTR MSG_UBL_MESH_FILLED = _UxGT("Pts mancanti riempiti"); LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Invalida Tutto"); LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalid.Punto Vicino"); LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Ritocca Tutto"); @@ -233,6 +259,7 @@ namespace Language_it { LSTR MSG_UBL_STORAGE_SLOT = _UxGT("Slot di memoria"); LSTR MSG_UBL_LOAD_MESH = _UxGT("Carica Mesh Piatto"); LSTR MSG_UBL_SAVE_MESH = _UxGT("Salva Mesh Piatto"); + LSTR MSG_UBL_INVALID_SLOT = _UxGT("Prima selez. uno slot Mesh"); LSTR MSG_MESH_LOADED = _UxGT("Mesh %i caricata"); LSTR MSG_MESH_SAVED = _UxGT("Mesh %i salvata"); LSTR MSG_UBL_NO_STORAGE = _UxGT("Nessuna memoria"); @@ -290,6 +317,7 @@ namespace Language_it { LSTR MSG_MOVE_001IN = _UxGT("Muovi di 0.01\""); LSTR MSG_MOVE_01IN = _UxGT("Muovi di 0.1\""); LSTR MSG_MOVE_1IN = _UxGT("Muovi di 1\""); + LSTR MSG_SPEED = _UxGT("Velocità"); LSTR MSG_BED_Z = _UxGT("Piatto Z"); LSTR MSG_NOZZLE = _UxGT("Ugello"); LSTR MSG_NOZZLE_N = _UxGT("Ugello ~"); @@ -324,6 +352,10 @@ namespace Language_it { LSTR MSG_PID_AUTOTUNE_E = _UxGT("Calib.PID *"); LSTR MSG_PID_CYCLE = _UxGT("Ciclo PID"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Calibr.PID eseguita"); + LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Calibr.PID fallito!"); + LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Estrusore invalido."); + LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temp.troppo alta."); + LSTR MSG_TIMEOUT = _UxGT("Tempo scaduto."); LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Calibrazione fallita! Estrusore errato."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita! Temperatura troppo alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Calibrazione fallita! Tempo scaduto."); @@ -401,6 +433,10 @@ namespace Language_it { LSTR MSG_RESET_PRINTER = _UxGT("Resetta stampante"); LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Aggiorna"); LSTR MSG_INFO_SCREEN = _UxGT("Schermata info"); + LSTR MSG_INFO_MACHINENAME = _UxGT("Nome macchina"); + LSTR MSG_INFO_SIZE = _UxGT("Dimens."); + LSTR MSG_INFO_FWVERSION = _UxGT("Versione firmware"); + LSTR MSG_INFO_BUILD = _UxGT("Dataora compilaz."); LSTR MSG_PREPARE = _UxGT("Prepara"); LSTR MSG_TUNE = _UxGT("Regola"); LSTR MSG_POWER_MONITOR = _UxGT("Controllo aliment."); @@ -426,7 +462,8 @@ namespace Language_it { LSTR MSG_BUTTON_PAUSE = _UxGT("Pausa"); LSTR MSG_BUTTON_RESUME = _UxGT("Riprendi"); LSTR MSG_BUTTON_ADVANCED = _UxGT("Avanzato"); - LSTR MSG_BUTTON_SAVE = _UxGT("Save"); + LSTR MSG_BUTTON_SAVE = _UxGT("Memorizza"); + LSTR MSG_BUTTON_PURGE = _UxGT("Spurga"); LSTR MSG_PAUSING = _UxGT("Messa in pausa..."); LSTR MSG_PAUSE_PRINT = _UxGT("Pausa stampa"); LSTR MSG_ADVANCED_PAUSE = _UxGT("Pausa Avanzata"); @@ -449,9 +486,12 @@ namespace Language_it { LSTR MSG_REMAINING_TIME = _UxGT("Rimanente"); LSTR MSG_PRINT_ABORTED = _UxGT("Stampa Annullata"); LSTR MSG_PRINT_DONE = _UxGT("Stampa Eseguita"); + LSTR MSG_PRINTER_KILLED = _UxGT("Stampante uccisa!"); + LSTR MSG_TURN_OFF = _UxGT("Spegni stampante"); LSTR MSG_NO_MOVE = _UxGT("Nessun Movimento"); LSTR MSG_KILLED = _UxGT("UCCISO. "); LSTR MSG_STOPPED = _UxGT("ARRESTATO. "); + LSTR MSG_FWRETRACT = _UxGT("Ritraz.da firmware"); LSTR MSG_CONTROL_RETRACT = _UxGT("Ritrai mm"); LSTR MSG_CONTROL_RETRACT_SWAP = _UxGT("Scamb. Ritrai mm"); LSTR MSG_CONTROL_RETRACTF = _UxGT("Ritrai V"); @@ -517,6 +557,9 @@ namespace Language_it { LSTR MSG_ZPROBE_XOFFSET = _UxGT("Offset X sonda"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Offset Y sonda"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Offset Z sonda"); + LSTR MSG_ZPROBE_MARGIN = _UxGT("Margine sonda"); + LSTR MSG_Z_FEED_RATE = _UxGT("Velocità Z"); + LSTR MSG_ENABLE_HS_MODE = _UxGT("Abilita modo HS"); LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Muovi ugel.su letto"); LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); @@ -580,34 +623,38 @@ namespace Language_it { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Luminosità Luci"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("STAMPANTE ERRATA"); + LSTR MSG_COLORS_GET = _UxGT("Ottieni colori"); + LSTR MSG_COLORS_SELECT = _UxGT("Selez.colori"); + LSTR MSG_COLORS_APPLIED = _UxGT("Colori applicati"); + LSTR MSG_COLORS_RED = _UxGT("Rosso"); + LSTR MSG_COLORS_GREEN = _UxGT("Verde"); + LSTR MSG_COLORS_BLUE = _UxGT("Blu"); + LSTR MSG_COLORS_WHITE = _UxGT("Bianco"); + LSTR MSG_UI_LANGUAGE = _UxGT("Lingua UI"); + LSTR MSG_SOUND_ENABLE = _UxGT("Abilita suono"); + LSTR MSG_LOCKSCREEN = _UxGT("Blocca Schermo"); + LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Stamp. bloccata,"); + LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Scroll x sbloccare."); + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Attendere fino al riavvio."); + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nessun supporto inserito."); - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Attendere fino al riavvio."); LSTR MSG_PLEASE_PREHEAT = _UxGT("Si prega di preriscaldare l'hot end."); LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Azzera contatori stampa"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Contatori stampa"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completati"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tempo totale"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Lavoro più lungo"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Totale estruso"); - LSTR MSG_COLORS_GET = _UxGT("Get Color"); - LSTR MSG_COLORS_SELECT = _UxGT("Seleziona colori"); - LSTR MSG_COLORS_APPLIED = _UxGT("Colori applicati"); - LSTR MSG_COLORS_RED = _UxGT("Rosso"); - LSTR MSG_COLORS_GREEN = _UxGT("Verde"); - LSTR MSG_COLORS_BLUE = _UxGT("Blu"); - LSTR MSG_COLORS_WHITE = _UxGT("Bianco"); - LSTR MSG_UI_LANGUAGE = _UxGT("Lingua UI"); - LSTR MSG_SOUND_ENABLE = _UxGT("Abilita suono"); - LSTR MSG_LOCKSCREEN = _UxGT("Blocca Schermo"); #else LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No Supporto"); + LSTR MSG_PLEASE_PREHEAT = _UxGT("Prerisc. hot end."); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Stampe"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completati"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Durata"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Più lungo"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Estruso"); #endif + + LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completate"); LSTR MSG_INFO_MIN_TEMP = _UxGT("Temp min"); LSTR MSG_INFO_MAX_TEMP = _UxGT("Temp max"); LSTR MSG_INFO_PSU = _UxGT("Alimentatore"); @@ -622,10 +669,14 @@ namespace Language_it { LSTR MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("OPZIONI RIPRESA:"); LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Spurga di più"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Riprendi stampa"); + LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Spurga o continua?"); LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Ugello: "); LSTR MSG_RUNOUT_SENSOR = _UxGT("Sens.filo termin."); // Max 17 characters LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Dist mm filo term."); LSTR MSG_RUNOUT_ENABLE = _UxGT("Abil.filo termin."); + LSTR MSG_RUNOUT_ACTIVE = _UxGT("Filo termin. attivo"); + LSTR MSG_INVERT_EXTRUDER = _UxGT("Inverti estrusore"); + LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Temp.min estrusore"); LSTR MSG_FANCHECK = _UxGT("Verif.tacho vent."); // Max 17 characters LSTR MSG_KILL_HOMING_FAILED = _UxGT("Home fallito"); LSTR MSG_LCD_PROBING_FAILED = _UxGT("Sondaggio fallito"); From 3af5c32ea23e8bca1e7c233006987286e980f982 Mon Sep 17 00:00:00 2001 From: Shlee Date: Sun, 26 Jun 2022 06:56:57 +0000 Subject: [PATCH 398/502] =?UTF-8?q?=F0=9F=93=9D=20Add=20STM32F4=20example,?= =?UTF-8?q?=20Ruby=20(#24399)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e54c8f093a7e..6b7d7ab18e4e 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ To build Marlin 2.0 you'll need [Arduino IDE 1.8.8 or newer](https://www.arduino [LPC1768](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512-kb-flash-64-kb-sram-ethernet-usb-lqfp100-package:LPC1768FBD100)|ARM® Cortex-M3|MKS SBASE, Re-ARM, Selena Compact [LPC1769](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512-kb-flash-64-kb-sram-ethernet-usb-lqfp100-package:LPC1769FBD100)|ARM® Cortex-M3|Smoothieboard, Azteeg X5 mini, TH3D EZBoard [STM32F103](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html)|ARM® Cortex-M3|Malyan M200, GTM32 Pro, MKS Robin, BTT SKR Mini - [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html)|ARM® Cortex-M4|ARMED, Rumba32, SKR Pro, Lerdge, FYSETC S6 + [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html)|ARM® Cortex-M4|ARMED, Rumba32, SKR Pro, Lerdge, FYSETC S6, Artillery Ruby [STM32F7x6](https://www.st.com/en/microcontrollers-microprocessors/stm32f7x6.html)|ARM® Cortex-M7|The Borg, RemRam V1 [SAMD51P20A](https://www.adafruit.com/product/4064)|ARM® Cortex-M4|Adafruit Grand Central M4 [Teensy 3.5](https://www.pjrc.com/store/teensy35.html)|ARM® Cortex-M4| From a7c58c1fd6463407331596623f8ff07c8a07481a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Jun 2022 05:47:18 -0500 Subject: [PATCH 399/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Manual=20Move=20ax?= =?UTF-8?q?is=20selection=20(#24404)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 18 ++++----- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 3 +- Marlin/src/lcd/language/language_en.h | 2 +- Marlin/src/lcd/marlinui.cpp | 9 +++-- Marlin/src/lcd/marlinui.h | 18 ++++----- Marlin/src/lcd/menu/menu_motion.cpp | 43 ++++++++-------------- Marlin/src/lcd/tft/ui_1024x600.cpp | 3 +- Marlin/src/lcd/tft/ui_320x240.cpp | 3 +- Marlin/src/lcd/tft/ui_480x320.cpp | 3 +- 9 files changed, 44 insertions(+), 58 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 19155fd5e55d..5f1507feb332 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -283,7 +283,7 @@ CrealityDWINClass CrealityDWIN; #endif - void manual_move(bool zmove=false) { + void manual_mesh_move(const bool zmove=false) { if (zmove) { planner.synchronize(); current_position.z = goto_mesh_value ? bedlevel.z_values[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; @@ -3035,7 +3035,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ mesh_conf.goto_mesh_value = true; mesh_conf.mesh_x = mesh_conf.mesh_y = 0; Popup_Handler(MoveWait); - mesh_conf.manual_move(); + mesh_conf.manual_mesh_move(); Draw_Menu(UBLMesh); #endif #elif HAS_BED_PROBE @@ -3091,7 +3091,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ TERN_(HAS_HEATED_BED, thermalManager.wait_for_bed_heating()); #endif Popup_Handler(MoveWait); - mesh_conf.manual_move(); + mesh_conf.manual_mesh_move(); Draw_Menu(LevelManual); } break; @@ -3328,7 +3328,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ mesh_conf.mesh_x++; else mesh_conf.mesh_x--; - mesh_conf.manual_move(); + mesh_conf.manual_mesh_move(); } } break; @@ -3375,7 +3375,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ else { mesh_conf.goto_mesh_value = !mesh_conf.goto_mesh_value; current_position.z = 0; - mesh_conf.manual_move(true); + mesh_conf.manual_mesh_move(true); Draw_Checkbox(row, mesh_conf.goto_mesh_value); } break; @@ -3428,7 +3428,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ mesh_conf.mesh_x++; else mesh_conf.mesh_x--; - mesh_conf.manual_move(); + mesh_conf.manual_mesh_move(); } else { gcode.process_subcommands_now(F("G29 S")); @@ -3449,7 +3449,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ mesh_conf.mesh_x--; else mesh_conf.mesh_x++; - mesh_conf.manual_move(); + mesh_conf.manual_mesh_move(); } } break; @@ -4109,8 +4109,8 @@ void CrealityDWINClass::Value_Control() { planner.buffer_line(current_position, homing_feedrate(Z_AXIS), active_extruder); planner.synchronize(); break; - case UBLMesh: mesh_conf.manual_move(true); break; - case LevelManual: mesh_conf.manual_move(selection == LEVELING_M_OFFSET); break; + case UBLMesh: mesh_conf.manual_mesh_move(true); break; + case LevelManual: mesh_conf.manual_mesh_move(selection == LEVELING_M_OFFSET); break; #endif } if (valuepointer == &planner.flow_percentage[0]) diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index ce1758f1da64..0727ab0b70ca 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -410,8 +410,7 @@ void MarlinUI::draw_status_message(const bool blink) { const dwin_coord_t by = (row * MENU_LINE_HEIGHT) + MENU_FONT_HEIGHT + EXTRA_ROW_HEIGHT / 2; DWIN_Draw_String(true, font16x32, Color_Yellow, Color_Bg_Black, (LCD_PIXEL_WIDTH - vallen * 16) / 2, by, S(dwin_string.string())); - extern screenFunc_t _manual_move_func_ptr; - if (ui.currentScreen != _manual_move_func_ptr && !ui.external_control) { + if (ui.can_show_slider()) { const dwin_coord_t slider_length = LCD_PIXEL_WIDTH - TERN(DWIN_MARLINUI_LANDSCAPE, 120, 20), slider_height = 16, diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 6e6811d62b08..f2a9cb0c0868 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -309,7 +309,7 @@ namespace Language_en { LSTR MSG_MOVE_Z = _UxGT("Move Z"); LSTR MSG_MOVE_N = _UxGT("Move @"); LSTR MSG_MOVE_E = _UxGT("Move Extruder"); - LSTR MSG_MOVE_EN = _UxGT("Move E*"); + LSTR MSG_MOVE_EN = _UxGT("Move *"); LSTR MSG_HOTEND_TOO_COLD = _UxGT("Hotend too cold"); LSTR MSG_MOVE_N_MM = _UxGT("Move $mm"); LSTR MSG_MOVE_01MM = _UxGT("Move 0.1mm"); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index d0c966303324..51c87d9fb844 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -766,6 +766,7 @@ void MarlinUI::init() { millis_t ManualMove::start_time = 0; float ManualMove::menu_scale = 1; + screenFunc_t ManualMove::screen_ptr; #if IS_KINEMATIC float ManualMove::offset = 0; xyze_pos_t ManualMove::all_axes_destination = { 0 }; @@ -775,6 +776,9 @@ void MarlinUI::init() { int8_t ManualMove::e_index = 0; #endif AxisEnum ManualMove::axis = NO_AXIS_ENUM; + #if ENABLED(MANUAL_E_MOVES_RELATIVE) + float ManualMove::e_origin = 0; + #endif /** * If a manual move has been posted and its time has arrived, and if the planner @@ -791,9 +795,6 @@ void MarlinUI::init() { * For kinematic machines: * - Set manual_move.offset to modify one axis and post the move. * This is used to achieve more rapid stepping on kinematic machines. - * - * Currently used by the _lcd_move_xyz function in menu_motion.cpp - * and the ubl_map_move_to_xy function in menu_ubl.cpp. */ void ManualMove::task() { @@ -864,7 +865,7 @@ void MarlinUI::init() { void MarlinUI::external_encoder() { if (external_control && encoderDiff) { - bedlevel.encoder_diff += encoderDiff; // Encoder for UBL G29 mesh editing + bedlevel.encoder_diff += encoderDiff; // Encoder for UBL G29 mesh editing encoderDiff = 0; // Hide encoder events from the screen handler refresh(LCDVIEW_REDRAW_NOW); // ...but keep the refresh. } diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 8ae8a8b7f5ce..1c2c48432322 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -137,12 +137,16 @@ typedef bool (*statusResetFunc_t)(); static xyze_pos_t all_axes_destination; #endif public: + static screenFunc_t screen_ptr; static float menu_scale; #if IS_KINEMATIC static float offset; #endif + #if ENABLED(MANUAL_E_MOVES_RELATIVE) + static float e_origin; + #endif template - void set_destination(const T& dest) { + static void set_destination(const T& dest) { #if IS_KINEMATIC // Moves are segmented, so the entire move is not submitted at once. // Using a separate variable prevents corrupting the in-progress move. @@ -153,10 +157,10 @@ typedef bool (*statusResetFunc_t)(); current_position.set(dest); #endif } - float axis_value(const AxisEnum axis) { + static float axis_value(const AxisEnum axis) { return NATIVE_TO_LOGICAL(processing ? destination[axis] : SUM_TERN(IS_KINEMATIC, current_position[axis], offset), axis); } - bool apply_diff(const AxisEnum axis, const_float_t diff, const_float_t min, const_float_t max) { + static bool apply_diff(const AxisEnum axis, const_float_t diff, const_float_t min, const_float_t max) { #if IS_KINEMATIC float &valref = offset; const float rmin = min - current_position[axis], rmax = max - current_position[axis]; @@ -166,12 +170,7 @@ typedef bool (*statusResetFunc_t)(); #endif valref += diff; const float pre = valref; - if (min != max) { - if (diff < 0) - NOLESS(valref, rmin); - else - NOMORE(valref, rmax); - } + if (min != max) { if (diff < 0) NOLESS(valref, rmin); else NOMORE(valref, rmax); } return pre != valref; } #if IS_KINEMATIC @@ -552,6 +551,7 @@ class MarlinUI { // Manual Movement static ManualMove manual_move; + static bool can_show_slider() { return !external_control && currentScreen != manual_move.screen_ptr; } // Select Screen (modal NO/YES style dialog) static bool selection; diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 8d83056bf4db..92deaf913333 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -49,15 +49,11 @@ #include "../../feature/bedlevel/bedlevel.h" #endif -#if ENABLED(MANUAL_E_MOVES_RELATIVE) - float manual_move_e_origin = 0; -#endif - // // "Motion" > "Move Axis" submenu // -static void _lcd_move_xyz(const AxisEnum axis) { +void lcd_move_axis(const AxisEnum axis) { if (ui.use_click()) return ui.goto_previous_screen_no_defer(); if (ui.encoderPosition && !ui.manual_move.processing) { // Get motion limit from software endstops, if any @@ -91,11 +87,6 @@ static void _lcd_move_xyz(const AxisEnum axis) { } } -void _lcd_move_axis_n() { _lcd_move_xyz(AxisEnum(MenuItemBase::itemIndex)); } - -// Move functions for non-menu code that hasn't set itemIndex (e.g., keypad) -void lcd_move_axis(const AxisEnum axis) { MenuEditItemBase::itemIndex = int8_t(axis); _lcd_move_axis_n(); } - // Move Z easy accessor void lcd_move_z() { lcd_move_axis(Z_AXIS); } @@ -118,7 +109,7 @@ void lcd_move_z() { lcd_move_axis(Z_AXIS); } GET_TEXT_F(TERN(MULTI_E_MANUAL, MSG_MOVE_EN, MSG_MOVE_E)), ftostr41sign(current_position.e PLUS_TERN0(IS_KINEMATIC, ui.manual_move.offset) - MINUS_TERN0(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin) + MINUS_TERN0(MANUAL_E_MOVES_RELATIVE, ui.manual_move.e_origin) ) ); } // should_draw @@ -143,25 +134,23 @@ void lcd_move_z() { lcd_move_axis(Z_AXIS); } #define FINE_MANUAL_MOVE 0.025 #endif -screenFunc_t _manual_move_func_ptr; - void _goto_manual_move(const_float_t scale) { ui.defer_status_screen(); ui.manual_move.menu_scale = scale; - ui.goto_screen(_manual_move_func_ptr); + ui.goto_screen(ui.manual_move.screen_ptr); thermalManager.set_menu_cold_override(true); } void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int8_t eindex=active_extruder) { - _manual_move_func_ptr = func; + ui.manual_move.screen_ptr = func; START_MENU(); if (LCD_HEIGHT >= 4) { if (axis < LINEAR_AXES) STATIC_ITEM_N(axis, MSG_MOVE_N, SS_DEFAULT|SS_INVERT); else { - TERN_(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin = current_position.e); - STATIC_ITEM(MSG_MOVE_E, SS_DEFAULT|SS_INVERT); + TERN_(MANUAL_E_MOVES_RELATIVE, ui.manual_move.e_origin = current_position.e); + STATIC_ITEM_N(eindex, MSG_MOVE_EN, SS_DEFAULT|SS_INVERT); } } @@ -183,8 +172,6 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int END_MENU(); } -void _menu_move_n_distance() { _menu_move_distance(AxisEnum(MenuItemBase::itemIndex), _lcd_move_axis_n); } - #if E_MANUAL inline void _goto_menu_move_distance_e() { @@ -221,8 +208,10 @@ void menu_move() { // Move submenu for each axis if (NONE(IS_KINEMATIC, NO_MOTION_BEFORE_HOMING) || all_axes_homed()) { if (TERN1(DELTA, current_position.z <= delta_clip_start_height)) { - for (uint8_t a = X_AXIS; a <= min(int(Y_AXIS), LINEAR_AXES - 1); a++) - SUBMENU_N(a, MSG_MOVE_N, _menu_move_n_distance); + SUBMENU_N(X_AXIS, MSG_MOVE_N, []{ _menu_move_distance(X_AXIS, []{ lcd_move_axis(X_AXIS); }); }); + #if HAS_Y_AXIS + SUBMENU_N(Y_AXIS, MSG_MOVE_N, []{ _menu_move_distance(Y_AXIS, []{ lcd_move_axis(Y_AXIS); }); }); + #endif } else { #if ENABLED(DELTA) @@ -230,8 +219,8 @@ void menu_move() { #endif } #if HAS_Z_AXIS - for (uint8_t a = Z_AXIS; a < LINEAR_AXES; a++) - SUBMENU_N(a, MSG_MOVE_N, _menu_move_n_distance); + #define _AXIS_MOVE(N) SUBMENU_N(N, MSG_MOVE_N, []{ _menu_move_distance(AxisEnum(N), []{ lcd_move_axis(AxisEnum(N)); }); }); + REPEAT_S(2, LINEAR_AXES, _AXIS_MOVE); #endif } else @@ -276,9 +265,9 @@ void menu_move() { #if E_MANUAL // The current extruder - SUBMENU(MSG_MOVE_E, []{ _menu_move_distance_e_maybe(); }); + SUBMENU(MSG_MOVE_E, _menu_move_distance_e_maybe); - #define SUBMENU_MOVE_E(N) SUBMENU_N(N, MSG_MOVE_EN, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(MenuItemBase::itemIndex); }, MenuItemBase::itemIndex); }); + #define SUBMENU_MOVE_E(N) SUBMENU_N(N, MSG_MOVE_EN, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(N); }, N); }); #if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE) @@ -289,8 +278,8 @@ void menu_move() { #elif MULTI_E_MANUAL - // Independent extruders with one E-stepper per hotend - LOOP_L_N(n, E_MANUAL) SUBMENU_MOVE_E(n); + // Independent extruders with one E stepper per hotend + REPEAT(E_MANUAL, SUBMENU_MOVE_E); #endif diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 15a51f56b8ec..ad9f8111815a 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -394,8 +394,7 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va } #endif - extern screenFunc_t _manual_move_func_ptr; - if (ui.currentScreen != _manual_move_func_ptr && !ui.external_control) { + if (ui.can_show_slider()) { #define SLIDER_LENGTH 600 #define SLIDER_Y_POSITION 200 diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index a4fcc35bd039..56887478f0a6 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -383,8 +383,7 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va } #endif - extern screenFunc_t _manual_move_func_ptr; - if (ui.currentScreen != _manual_move_func_ptr && !ui.external_control) { + if (ui.can_show_slider()) { #define SLIDER_LENGTH 224 #define SLIDER_Y_POSITION 140 diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 8a5fa6335420..d4a04d690080 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -388,8 +388,7 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va } #endif - extern screenFunc_t _manual_move_func_ptr; - if (ui.currentScreen != _manual_move_func_ptr && !ui.external_control) { + if (ui.can_show_slider()) { #define SLIDER_LENGTH 336 #define SLIDER_Y_POSITION 186 From 843c04baa6df0db350ff759abcfa3f3fe431e5a2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Jun 2022 10:01:22 -0500 Subject: [PATCH 400/502] =?UTF-8?q?=F0=9F=8E=A8=20=20Misc.=20shorthand=20o?= =?UTF-8?q?perators?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/DUE/usb/compiler.h | 2 +- Marlin/src/HAL/LINUX/eeprom.cpp | 16 ++++++++-------- Marlin/src/HAL/LINUX/hardware/Heater.h | 4 ++-- Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp | 4 ++-- Marlin/src/feature/power_monitor.h | 2 +- .../src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp | 4 ++-- Marlin/src/lcd/extui/mks_ui/wifi_module.cpp | 2 +- Marlin/src/lcd/tft/touch.cpp | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Marlin/src/HAL/DUE/usb/compiler.h b/Marlin/src/HAL/DUE/usb/compiler.h index f89e554c4562..633197914eef 100644 --- a/Marlin/src/HAL/DUE/usb/compiler.h +++ b/Marlin/src/HAL/DUE/usb/compiler.h @@ -1059,7 +1059,7 @@ static inline void convert_64_bit_to_byte_array(uint64_t value, uint8_t *data) while (val_index < 8) { data[val_index++] = value & 0xFF; - value = value >> 8; + value >>= 8; } } diff --git a/Marlin/src/HAL/LINUX/eeprom.cpp b/Marlin/src/HAL/LINUX/eeprom.cpp index 532f323c6edb..f878bba6a51b 100644 --- a/Marlin/src/HAL/LINUX/eeprom.cpp +++ b/Marlin/src/HAL/LINUX/eeprom.cpp @@ -69,12 +69,12 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui std::size_t bytes_written = 0; for (std::size_t i = 0; i < size; i++) { - buffer[pos+i] = value[i]; - bytes_written ++; + buffer[pos + i] = value[i]; + bytes_written++; } crc16(crc, value, size); - pos = pos + size; + pos += size; return (bytes_written != size); // return true for any error } @@ -82,21 +82,21 @@ bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uin std::size_t bytes_read = 0; if (writing) { for (std::size_t i = 0; i < size; i++) { - value[i] = buffer[pos+i]; - bytes_read ++; + value[i] = buffer[pos + i]; + bytes_read++; } crc16(crc, value, size); } else { uint8_t temp[size]; for (std::size_t i = 0; i < size; i++) { - temp[i] = buffer[pos+i]; - bytes_read ++; + temp[i] = buffer[pos + i]; + bytes_read++; } crc16(crc, temp, size); } - pos = pos + size; + pos += size; return bytes_read != size; // return true for any error } diff --git a/Marlin/src/HAL/LINUX/hardware/Heater.h b/Marlin/src/HAL/LINUX/hardware/Heater.h index b17078d0b739..6d590ce6c55e 100644 --- a/Marlin/src/HAL/LINUX/hardware/Heater.h +++ b/Marlin/src/HAL/LINUX/hardware/Heater.h @@ -26,8 +26,8 @@ struct LowpassFilter { uint64_t data_delay = 0; uint16_t update(uint16_t value) { - data_delay = data_delay - (data_delay >> 6) + value; - return (uint16_t)(data_delay >> 6); + data_delay += value - (data_delay >> 6); + return uint16_t(data_delay >> 6); } }; diff --git a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp index f1ee81ed4acb..148927a19f52 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp @@ -135,11 +135,11 @@ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabStat while ((instruction = UnwTabGetNextInstruction(cb, ucb)) != -1) { if ((instruction & 0xC0) == 0x00) { // ARM_EXIDX_CMD_DATA_POP - /* vsp = vsp + (xxxxxx << 2) + 4 */ + /* vsp += (xxxxxx << 2) + 4 */ ucb->vrs[13] += ((instruction & 0x3F) << 2) + 4; } else if ((instruction & 0xC0) == 0x40) { // ARM_EXIDX_CMD_DATA_PUSH - /* vsp = vsp - (xxxxxx << 2) - 4 */ + /* vsp -= (xxxxxx << 2) - 4 */ ucb->vrs[13] -= ((instruction & 0x3F) << 2) - 4; } else if ((instruction & 0xF0) == 0x80) { diff --git a/Marlin/src/feature/power_monitor.h b/Marlin/src/feature/power_monitor.h index f6e0b292e30c..fa0690905333 100644 --- a/Marlin/src/feature/power_monitor.h +++ b/Marlin/src/feature/power_monitor.h @@ -32,7 +32,7 @@ struct pm_lpf_t { uint32_t filter_buf; float value; void add_sample(const uint16_t sample) { - filter_buf = filter_buf - (filter_buf >> K_VALUE) + (uint32_t(sample) << K_SCALE); + filter_buf += (uint32_t(sample) << K_SCALE) - (filter_buf >> K_VALUE); } void capture() { value = filter_buf * (SCALE * (1.0f / (1UL << (PM_K_VALUE + PM_K_SCALE)))); diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 2d4fe2e29d3a..531788cc3f1f 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -1141,7 +1141,7 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr) else queue.inject(F("M290 Z-0.01")); - z_offset_add = z_offset_add - ZOffset_distance; + z_offset_add -= ZOffset_distance; break; case 1: @@ -1156,7 +1156,7 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr) else queue.inject(F("M290 Z-0.01")); - z_offset_add = z_offset_add + ZOffset_distance; + z_offset_add += ZOffset_distance; break; default: diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp index 73a76323fd2b..23a39aabc469 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp @@ -1638,7 +1638,7 @@ void esp_data_parser(char *cmdRxBuf, int len) { esp_msg_index += cpyLen; - leftLen = leftLen - cpyLen; + leftLen -= cpyLen; tail_pos = charAtArray(esp_msg_buf, esp_msg_index, ESP_PROTOC_TAIL); if (tail_pos == -1) { diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index a152907a9dde..050b59f39f90 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -175,7 +175,7 @@ void Touch::touch(touch_control_t *control) { ui.refresh(); break; case PAGE_DOWN: - encoderTopLine = encoderTopLine + 2 * LCD_HEIGHT < screen_items ? encoderTopLine + LCD_HEIGHT : screen_items - LCD_HEIGHT; + encoderTopLine = (encoderTopLine + 2 * LCD_HEIGHT < screen_items) ? encoderTopLine + LCD_HEIGHT : screen_items - LCD_HEIGHT; ui.encoderPosition = ui.encoderPosition + LCD_HEIGHT < (uint32_t)screen_items ? ui.encoderPosition + LCD_HEIGHT : screen_items; ui.refresh(); break; From dbdb39f60ff1a97050f09d76f8f4de101d03d30a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Jun 2022 22:32:00 -0500 Subject: [PATCH 401/502] =?UTF-8?q?=F0=9F=93=9D=20=20Note=20about=20UBL=20?= =?UTF-8?q?bad=20splits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp index e6eec0de63fd..9fa2257dc8a6 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp @@ -36,8 +36,18 @@ #include "../../../MarlinCore.h" #include +//#define DEBUG_UBL_MOTION +#define DEBUG_OUT ENABLED(DEBUG_UBL_MOTION) +#include "../../../core/debug_out.h" + #if !UBL_SEGMENTED + // TODO: The first and last parts of a move might result in very short segment(s) + // after getting split on the cell boundary, so moves like that should not + // get split. This will be most common for moves that start/end near the + // corners of cells. To fix the issue, simply check if the start/end of the line + // is very close to a cell boundary in advance and don't split the line there. + void unified_bed_leveling::line_to_destination_cartesian(const_feedRate_t scaled_fr_mm_s, const uint8_t extruder) { /** * Much of the nozzle movement will be within the same cell. So we will do as little computation @@ -176,7 +186,9 @@ dest.z += z0; planner.buffer_segment(dest, scaled_fr_mm_s, extruder); - } //else printf("FIRST MOVE PRUNED "); + } + else + DEBUG_ECHOLNPGM("[ubl] skip Y segment"); } // At the final destination? Usually not, but when on a Y Mesh Line it's completed. @@ -225,7 +237,9 @@ dest.z += z0; if (!planner.buffer_segment(dest, scaled_fr_mm_s, extruder)) break; - } //else printf("FIRST MOVE PRUNED "); + } + else + DEBUG_ECHOLNPGM("[ubl] skip Y segment"); } if (xy_pos_t(current_position) != xy_pos_t(end)) From 1690f49656788ddb580c0f8311095800ad65881b Mon Sep 17 00:00:00 2001 From: John Lagonikas <39417467+zeleps@users.noreply.github.com> Date: Wed, 29 Jun 2022 01:53:05 +0300 Subject: [PATCH 402/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MAX31865=20PT1000?= =?UTF-8?q?=20normalization=20(#24407)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/libs/MAX31865.cpp | 65 +++++++++++++++++++++++------------- Marlin/src/libs/MAX31865.h | 13 ++------ 2 files changed, 45 insertions(+), 33 deletions(-) diff --git a/Marlin/src/libs/MAX31865.cpp b/Marlin/src/libs/MAX31865.cpp index c042504cf872..0d709b1b0b42 100644 --- a/Marlin/src/libs/MAX31865.cpp +++ b/Marlin/src/libs/MAX31865.cpp @@ -133,13 +133,13 @@ SPISettings MAX31865::spiConfig = SPISettings( /** * Initialize the SPI interface and set the number of RTD wires used * - * @param wires The number of wires in enum format. Can be MAX31865_2WIRE, MAX31865_3WIRE, or MAX31865_4WIRE. - * @param zero The resistance of the RTD at 0 degC, in ohms. - * @param ref The resistance of the reference resistor, in ohms. - * @param wire The resistance of the wire connecting the sensor to the RTD, in ohms. + * @param wires The number of wires as an enum: MAX31865_2WIRE, MAX31865_3WIRE, or MAX31865_4WIRE. + * @param zero_res The resistance of the RTD at 0°C, in ohms. + * @param ref_res The resistance of the reference resistor, in ohms. + * @param wire_res The resistance of the wire connecting the sensor to the RTD, in ohms. */ -void MAX31865::begin(max31865_numwires_t wires, float zero_res, float ref_res, float wire_res) { - zeroRes = zero_res; +void MAX31865::begin(max31865_numwires_t wires, const_float_t zero_res, const_float_t ref_res, const_float_t wire_res) { + resNormalizer = 100.0f / zero_res; // reciprocal of resistance, scaled by 100 refRes = ref_res; wireRes = wire_res; @@ -437,42 +437,61 @@ float MAX31865::temperature() { * * @return Temperature in C */ -float MAX31865::temperature(uint16_t adc_val) { +float MAX31865::temperature(const uint16_t adc_val) { return temperature(((adc_val) * RECIPROCAL(32768.0f)) * refRes - wireRes); } /** * Calculate the temperature in C from the RTD resistance. - * Uses the technique outlined in this PDF: - * http://www.analog.com/media/en/technical-documentation/application-notes/AN709_0.pdf * * @param rtd_res the resistance value in ohms - * @return the temperature in degC + * @return the temperature in °C */ float MAX31865::temperature(float rtd_res) { + + rtd_res *= resNormalizer; // normalize to 100 ohm + + // Constants for calculating temperature from the measured RTD resistance. + // http://www.analog.com/media/en/technical-documentation/application-notes/AN709_0.pdf + constexpr float RTD_Z1 = -0.0039083, + RTD_Z2 = +1.758480889e-5, + RTD_Z3 = -2.31e-8, + RTD_Z4 = -1.155e-6; + + // Callender-Van Dusen equation float temp = (RTD_Z1 + sqrt(RTD_Z2 + (RTD_Z3 * rtd_res))) * RECIPROCAL(RTD_Z4); - // From the PDF... // // The previous equation is valid only for temperatures of 0°C and above. // The equation for RRTD(t) that defines negative temperature behavior is a // fourth-order polynomial (after expanding the third term) and is quite // impractical to solve for a single expression of temperature as a function - // of resistance. + // of resistance. So here we use a Linear Approximation instead. // if (temp < 0) { - rtd_res = (rtd_res / zeroRes) * 100; // normalize to 100 ohm - float rpoly = rtd_res; + #ifndef MAX31865_APPROX + #define MAX31865_APPROX 5 + #endif + + constexpr float RTD_C[] = { + #if MAX31865_APPROX == 5 + -242.02, +2.2228, +2.5859e-3, -4.8260e-6, -2.8183e-8, +1.5243e-10 + #elif MAX31865_APPROX == 4 + -241.96, +2.2163, +2.8541e-3, -9.9121e-6, -1.7152e-8 + #elif MAX31865_APPROX == 3 + -242.09, +2.2276, +2.5178e-3, -5.8620e-6 + #else + -242.97, +2.2838, +1.4727e-3 + #endif + }; - temp = -242.02 + (2.2228 * rpoly); - rpoly *= rtd_res; // square - temp += 2.5859e-3 * rpoly; - rpoly *= rtd_res; // ^3 - temp -= 4.8260e-6 * rpoly; - rpoly *= rtd_res; // ^4 - temp -= 2.8183e-8 * rpoly; - rpoly *= rtd_res; // ^5 - temp += 1.5243e-10 * rpoly; + float rpoly = rtd_res; + temp = RTD_C[0]; + temp += rpoly * RTD_C[1]; + rpoly *= rtd_res; temp += rpoly * RTD_C[2]; + if (MAX31865_APPROX >= 3) rpoly *= rtd_res; temp += rpoly * RTD_C[3]; + if (MAX31865_APPROX >= 4) rpoly *= rtd_res; temp += rpoly * RTD_C[4]; + if (MAX31865_APPROX >= 5) rpoly *= rtd_res; temp += rpoly * RTD_C[5]; } return temp; diff --git a/Marlin/src/libs/MAX31865.h b/Marlin/src/libs/MAX31865.h index baea455485d4..95bde756cee7 100644 --- a/Marlin/src/libs/MAX31865.h +++ b/Marlin/src/libs/MAX31865.h @@ -73,13 +73,6 @@ #define MAX31865_FAULT_RTDINLOW 0x08 // D3 #define MAX31865_FAULT_OVUV 0x04 // D2 -// http://www.analog.com/media/en/technical-documentation/application-notes/AN709_0.pdf -// constants for calculating temperature from the measured RTD resistance. -#define RTD_Z1 -0.0039083 -#define RTD_Z2 0.00001758480889 -#define RTD_Z3 -0.0000000231 -#define RTD_Z4 -0.000001155 - typedef enum max31865_numwires { MAX31865_2WIRE = 0, MAX31865_3WIRE = 1, @@ -103,7 +96,7 @@ class MAX31865 { uint16_t spiDelay; - float zeroRes, refRes, wireRes; + float resNormalizer, refRes, wireRes; #if ENABLED(MAX31865_USE_READ_ERROR_DETECTION) millis_t lastReadStamp = 0; @@ -160,7 +153,7 @@ class MAX31865 { int8_t spi_clk); #endif - void begin(max31865_numwires_t wires, float zero_res, float ref_res, float wire_res); + void begin(max31865_numwires_t wires, const_float_t zero_res, const_float_t ref_res, const_float_t wire_res); uint8_t readFault(); void clearFault(); @@ -168,6 +161,6 @@ class MAX31865 { uint16_t readRaw(); float readResistance(); float temperature(); - float temperature(uint16_t adc_val); + float temperature(const uint16_t adc_val); float temperature(float rtd_res); }; From 0d34c2e287b582598a75cad0bb6ddd8bbd1fbba6 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Wed, 29 Jun 2022 06:24:22 -0700 Subject: [PATCH 403/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Axis=20Homing=20(#?= =?UTF-8?q?24425)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to 4520a51 --- Marlin/src/lcd/menu/menu_motion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 92deaf913333..3f7a1f4e0219 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -288,7 +288,7 @@ void menu_move() { END_MENU(); } -#define _HOME_ITEM(N) GCODES_ITEM_N(N##_AXIS, MSG_AUTO_HOME_A, F("G28X" STR_##N)); +#define _HOME_ITEM(N) GCODES_ITEM_N(N##_AXIS, MSG_AUTO_HOME_A, F("G28" STR_##N)); #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) // From 0d04aa960f49196eca9f3da17846460b322d10c6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 29 Jun 2022 17:14:23 -0500 Subject: [PATCH 404/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20memset=20block=20w?= =?UTF-8?q?arning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/planner.cpp | 2 +- Marlin/src/module/planner.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 1d8b6e716ec7..1b70d748e4d0 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2821,7 +2821,7 @@ void Planner::buffer_sync_block(TERN_(LASER_SYNCHRONOUS_M106_M107, uint8_t sync_ block_t * const block = get_next_free_block(next_buffer_head); // Clear block - memset(block, 0, sizeof(block_t)); + block->reset(); block->flag = sync_flag; diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 1af5ccc8106a..38f958c10f9d 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -251,6 +251,8 @@ typedef struct block_t { block_laser_t laser; #endif + void reset() { memset((char*)this, 0, sizeof(*this)); } + } block_t; #if ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL, POWER_LOSS_RECOVERY) From b3018da60c6cf12f22c9e9b7954bcddc2cb4b686 Mon Sep 17 00:00:00 2001 From: Moonglow Date: Fri, 1 Jul 2022 05:51:55 +0300 Subject: [PATCH 405/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20M149=20(#24430)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/units/M149.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/gcode/units/M149.cpp b/Marlin/src/gcode/units/M149.cpp index 3f1ea3654ec4..a04247cbcb17 100644 --- a/Marlin/src/gcode/units/M149.cpp +++ b/Marlin/src/gcode/units/M149.cpp @@ -30,9 +30,9 @@ * M149: Set temperature units */ void GcodeSuite::M149() { - if (parser.seenval('C')) parser.set_input_temp_units(TEMPUNIT_C); - else if (parser.seenval('K')) parser.set_input_temp_units(TEMPUNIT_K); - else if (parser.seenval('F')) parser.set_input_temp_units(TEMPUNIT_F); + if (parser.seen('C')) parser.set_input_temp_units(TEMPUNIT_C); + else if (parser.seen('K')) parser.set_input_temp_units(TEMPUNIT_K); + else if (parser.seen('F')) parser.set_input_temp_units(TEMPUNIT_F); else M149_report(); } From 86e6f9e38ea7a4653f11094221bcf4be20d0fef3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jul 2022 20:10:51 -0500 Subject: [PATCH 406/502] =?UTF-8?q?=F0=9F=A9=B9=20Remove=20obsolete=20spli?= =?UTF-8?q?t=5Fmove?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/planner.cpp | 39 +++++++++++++++++++++-------------- Marlin/src/module/planner.h | 23 +++++++++++++-------- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 1b70d748e4d0..70abe1666723 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1789,11 +1789,12 @@ bool Planner::_buffer_steps(const xyze_long_t &target if (cleaning_buffer_counter) return false; // Fill the block with the specified movement - if (!_populate_block(block, false, target - OPTARG(HAS_POSITION_FLOAT, target_float) - OPTARG(HAS_DIST_MM_ARG, cart_dist_mm) - , fr_mm_s, extruder, millimeters - )) { + if (!_populate_block(block, target + OPTARG(HAS_POSITION_FLOAT, target_float) + OPTARG(HAS_DIST_MM_ARG, cart_dist_mm) + , fr_mm_s, extruder, millimeters + ) + ) { // Movement was not queued, probably because it was too short. // Simply accept that as movement queued and done return true; @@ -1820,17 +1821,24 @@ bool Planner::_buffer_steps(const xyze_long_t &target } /** - * Planner::_populate_block - * - * Fills a new linear movement in the block (in terms of steps). + * @brief Populate a block in preparation for insertion + * @details Populate the fields of a new linear movement block + * that will be added to the queue and processed soon + * by the Stepper ISR. * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder + * @param block A block to populate + * @param target Target position in steps units + * @param target_float Target position in native mm + * @param cart_dist_mm The pre-calculated move lengths for all axes, in mm + * @param fr_mm_s (target) speed of the move + * @param extruder target extruder + * @param millimeters A pre-calculated linear distance for the move, in mm, + * or 0.0 to have the distance calculated here. * - * Returns true if movement is acceptable, false otherwise + * @return true if movement is acceptable, false otherwise */ -bool Planner::_populate_block(block_t * const block, bool split_move, +bool Planner::_populate_block( + block_t * const block, const abce_long_t &target OPTARG(HAS_POSITION_FLOAT, const xyze_pos_t &target_float) OPTARG(HAS_DIST_MM_ARG, const xyze_float_t &cart_dist_mm) @@ -2774,9 +2782,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Initialize block entry speed. Compute based on deceleration to user-defined MINIMUM_PLANNER_SPEED. const float v_allowable_sqr = max_allowable_speed_sqr(-block->acceleration, sq(float(MINIMUM_PLANNER_SPEED)), block->millimeters); - // If we are trying to add a split block, start with the - // max. allowed speed to avoid an interrupted first move. - block->entry_speed_sqr = !split_move ? sq(float(MINIMUM_PLANNER_SPEED)) : _MIN(vmax_junction_sqr, v_allowable_sqr); + // Start with the minimum allowed speed + block->entry_speed_sqr = sq(float(MINIMUM_PLANNER_SPEED)); // Initialize planner efficiency flags // Set flag if block will always reach maximum junction speed regardless of entry/exit speeds. diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 38f958c10f9d..42434002be5c 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -737,18 +737,23 @@ class Planner { ); /** - * Planner::_populate_block + * @brief Populate a block in preparation for insertion + * @details Populate the fields of a new linear movement block + * that will be added to the queue and processed soon + * by the Stepper ISR. * - * Fills a new linear movement in the block (in terms of steps). + * @param block A block to populate + * @param target Target position in steps units + * @param target_float Target position in native mm + * @param cart_dist_mm The pre-calculated move lengths for all axes, in mm + * @param fr_mm_s (target) speed of the move + * @param extruder target extruder + * @param millimeters A pre-calculated linear distance for the move, in mm, + * or 0.0 to have the distance calculated here. * - * target - target position in steps units - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known - * - * Returns true is movement is acceptable, false otherwise + * @return true if movement is acceptable, false otherwise */ - static bool _populate_block(block_t * const block, bool split_move, const xyze_long_t &target + static bool _populate_block(block_t * const block, const xyze_long_t &target OPTARG(HAS_POSITION_FLOAT, const xyze_pos_t &target_float) OPTARG(HAS_DIST_MM_ARG, const xyze_float_t &cart_dist_mm) , feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters=0.0 From b79231cc59d6746f6714af102763d59488ea753a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Jul 2022 21:17:32 -0500 Subject: [PATCH 407/502] =?UTF-8?q?=F0=9F=A9=B9=20Remove=20poison=20wchar?= =?UTF-8?q?=5Ft=20macro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/power_monitor.cpp | 6 +- Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp | 12 +- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 138 +++++++++--------- Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp | 12 +- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 18 +-- Marlin/src/lcd/dogm/lcdprint_u8g.cpp | 2 +- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 36 ++--- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 44 +++--- Marlin/src/lcd/dogm/u8g_fontutf8.cpp | 26 ++-- Marlin/src/lcd/dogm/u8g_fontutf8.h | 2 +- Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp | 26 ++-- Marlin/src/lcd/e3v2/marlinui/dwin_string.h | 8 +- .../src/lcd/e3v2/marlinui/lcdprint_dwin.cpp | 10 +- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 8 +- Marlin/src/lcd/fontutils.cpp | 6 +- Marlin/src/lcd/fontutils.h | 27 ++-- Marlin/src/lcd/lcdprint.cpp | 36 ++--- Marlin/src/lcd/lcdprint.h | 10 +- Marlin/src/lcd/marlinui.cpp | 20 +-- Marlin/src/lcd/menu/menu_bed_corners.cpp | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- Marlin/src/lcd/menu/menu_password.cpp | 6 +- Marlin/src/lcd/menu/menu_tune.cpp | 4 +- Marlin/src/lcd/tft/tft_string.cpp | 16 +- Marlin/src/lcd/tft/tft_string.h | 4 +- Marlin/src/lcd/tft/ui_common.cpp | 2 +- 26 files changed, 244 insertions(+), 239 deletions(-) diff --git a/Marlin/src/feature/power_monitor.cpp b/Marlin/src/feature/power_monitor.cpp index 504f1ea48e3b..5a9db1ec24a1 100644 --- a/Marlin/src/feature/power_monitor.cpp +++ b/Marlin/src/feature/power_monitor.cpp @@ -53,7 +53,7 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor void PowerMonitor::draw_current() { const float amps = getAmps(); lcd_put_u8str(amps < 100 ? ftostr31ns(amps) : ui16tostr4rj((uint16_t)amps)); - lcd_put_wchar('A'); + lcd_put_lchar('A'); } #endif @@ -61,7 +61,7 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor void PowerMonitor::draw_voltage() { const float volts = getVolts(); lcd_put_u8str(volts < 100 ? ftostr31ns(volts) : ui16tostr4rj((uint16_t)volts)); - lcd_put_wchar('V'); + lcd_put_lchar('V'); } #endif @@ -69,7 +69,7 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor void PowerMonitor::draw_power() { const float power = getPower(); lcd_put_u8str(power < 100 ? ftostr31ns(power) : ui16tostr4rj((uint16_t)power)); - lcd_put_wchar('W'); + lcd_put_lchar('W'); } #endif diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index 1e82fe403d9f..fe31c21e3959 100644 --- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -50,7 +50,7 @@ extern LCD_CLASS lcd; int lcd_glyph_height() { return 1; } typedef struct _hd44780_charmap_t { - wchar_t uchar; // the unicode char + lchar_t uchar; // the unicode char uint8_t idx; // the glyph of the char in the ROM uint8_t idx2; // the char used to be combined with the idx to simulate a single char } hd44780_charmap_t; @@ -992,7 +992,7 @@ void lcd_put_int(const int i) { lcd.print(i); } // return < 0 on error // return the advanced cols -int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { +int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) { // find the HD44780 internal ROM first int ret; @@ -1051,10 +1051,10 @@ static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_by pixel_len_t ret = 0; const uint8_t *p = (uint8_t *)utf8_str; while (ret < max_length) { - wchar_t ch = 0; - p = get_utf8_value_cb(p, cb_read_byte, &ch); - if (!ch) break; - ret += lcd_put_wchar_max(ch, max_length - ret); + lchar_t wc; + p = get_utf8_value_cb(p, cb_read_byte, wc); + if (!wc) break; + ret += lcd_put_lchar_max(wc, max_length - ret); } return (int)ret; } diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index da4db8b2d419..d8306dbf945d 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -405,7 +405,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); } void lcd_erase_line(const lcd_uint_t line) { lcd_moveto(0, line); for (uint8_t i = LCD_WIDTH + 1; --i;) - lcd_put_wchar(' '); + lcd_put_lchar(' '); } // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line @@ -413,7 +413,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); } uint8_t slen = utf8_strlen(ftxt); if (slen < len) { lcd_put_u8str_max(col, line, ftxt, len); - for (; slen < len; ++slen) lcd_put_wchar(' '); + for (; slen < len; ++slen) lcd_put_lchar(' '); safe_delay(time); } else { @@ -425,7 +425,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); } lcd_put_u8str_max_P(col, line, p, len); // Fill with spaces - for (uint8_t ix = slen - i; ix < len; ++ix) lcd_put_wchar(' '); + for (uint8_t ix = slen - i; ix < len; ++ix) lcd_put_lchar(' '); // Delay safe_delay(dly); @@ -439,9 +439,9 @@ void MarlinUI::clear_lcd() { lcd.clear(); } static void logo_lines(FSTR_P const extra) { int16_t indent = (LCD_WIDTH - 8 - utf8_strlen(extra)) / 2; - lcd_put_wchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" )); lcd_put_wchar('\x01'); + lcd_put_lchar(indent, 0, '\x00'); lcd_put_u8str(F( "------" )); lcd_put_lchar('\x01'); lcd_put_u8str(indent, 1, F("|Marlin|")); lcd_put_u8str(extra); - lcd_put_wchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" )); lcd_put_wchar('\x03'); + lcd_put_lchar(indent, 2, '\x02'); lcd_put_u8str(F( "------" )); lcd_put_lchar('\x03'); } void MarlinUI::show_bootscreen() { @@ -510,11 +510,11 @@ void MarlinUI::draw_kill_screen() { // Homed and known, display constantly. // FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) { - lcd_put_wchar('X' + uint8_t(axis)); + lcd_put_lchar('X' + uint8_t(axis)); if (blink) lcd_put_u8str(value); else if (axis_should_home(axis)) - while (const char c = *value++) lcd_put_wchar(c <= '.' ? c : '?'); + while (const char c = *value++) lcd_put_lchar(c <= '.' ? c : '?'); else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis)) lcd_put_u8str(axis == Z_AXIS ? F(" ") : F(" ")); else @@ -531,27 +531,27 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr const celsius_t t1 = thermalManager.wholeDegHotend(heater_id), t2 = thermalManager.degTargetHotend(heater_id); #endif - if (prefix >= 0) lcd_put_wchar(prefix); + if (prefix >= 0) lcd_put_lchar(prefix); lcd_put_u8str(t1 < 0 ? "err" : i16tostr3rj(t1)); - lcd_put_wchar('/'); + lcd_put_lchar('/'); #if !HEATER_IDLE_HANDLER UNUSED(blink); #else if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) { - lcd_put_wchar(' '); - if (t2 >= 10) lcd_put_wchar(' '); - if (t2 >= 100) lcd_put_wchar(' '); + lcd_put_lchar(' '); + if (t2 >= 10) lcd_put_lchar(' '); + if (t2 >= 100) lcd_put_lchar(' '); } else #endif lcd_put_u8str(i16tostr3left(t2)); if (prefix >= 0) { - lcd_put_wchar(LCD_STR_DEGREE[0]); - lcd_put_wchar(' '); - if (t2 < 10) lcd_put_wchar(' '); + lcd_put_lchar(LCD_STR_DEGREE[0]); + lcd_put_lchar(' '); + if (t2 < 10) lcd_put_lchar(' '); } } @@ -559,27 +559,27 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) { const celsius_t t2 = thermalManager.degTargetCooler(); - if (prefix >= 0) lcd_put_wchar(prefix); + if (prefix >= 0) lcd_put_lchar(prefix); lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegCooler())); - lcd_put_wchar('/'); + lcd_put_lchar('/'); #if !HEATER_IDLE_HANDLER UNUSED(blink); #else if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) { - lcd_put_wchar(' '); - if (t2 >= 10) lcd_put_wchar(' '); - if (t2 >= 100) lcd_put_wchar(' '); + lcd_put_lchar(' '); + if (t2 >= 10) lcd_put_lchar(' '); + if (t2 >= 100) lcd_put_lchar(' '); } else #endif lcd_put_u8str(i16tostr3left(t2)); if (prefix >= 0) { - lcd_put_wchar(LCD_STR_DEGREE[0]); - lcd_put_wchar(' '); - if (t2 < 10) lcd_put_wchar(' '); + lcd_put_lchar(LCD_STR_DEGREE[0]); + lcd_put_lchar(' '); + if (t2 < 10) lcd_put_lchar(' '); } } #endif @@ -588,7 +588,7 @@ FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) { FORCE_INLINE void _draw_flowmeter_status() { lcd_put_u8str("~"); lcd_put_u8str(ftostr11ns(cooler.flowrate)); - lcd_put_wchar('L'); + lcd_put_lchar('L'); } #endif @@ -602,7 +602,7 @@ FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) { } else { lcd_put_u8str(ftostr12ns(ammeter.current)); - lcd_put_wchar('A'); + lcd_put_lchar('A'); } } #endif @@ -620,7 +620,7 @@ FORCE_INLINE void _draw_bed_status(const bool blink) { lcd_put_u8str(ui8tostr3rj(progress)); else lcd_put_u8str(F("---")); - lcd_put_wchar('%'); + lcd_put_lchar('%'); } #endif @@ -667,7 +667,7 @@ void MarlinUI::draw_status_message(const bool blink) { lcd_put_u8str(ftostr12ns(filwidth.measured_mm)); lcd_put_u8str(F(" V")); lcd_put_u8str(i16tostr3rj(planner.volumetric_percent(parser.volumetric_enabled))); - lcd_put_wchar('%'); + lcd_put_lchar('%'); return; } @@ -686,7 +686,7 @@ void MarlinUI::draw_status_message(const bool blink) { lcd_put_u8str(status_message); // Fill the rest with spaces - while (slen < LCD_WIDTH) { lcd_put_wchar(' '); ++slen; } + while (slen < LCD_WIDTH) { lcd_put_lchar(' '); ++slen; } } else { // String is larger than the available space in screen. @@ -700,11 +700,11 @@ void MarlinUI::draw_status_message(const bool blink) { // If the remaining string doesn't completely fill the screen if (rlen < LCD_WIDTH) { uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters - lcd_put_wchar(' '); // Always at 1+ spaces left, draw a space + lcd_put_lchar(' '); // Always at 1+ spaces left, draw a space if (--chars) { // Draw a second space if there's room - lcd_put_wchar(' '); + lcd_put_lchar(' '); if (--chars) { // Draw a third space if there's room - lcd_put_wchar(' '); + lcd_put_lchar(' '); if (--chars) lcd_put_u8str_max(status_message, chars); // Print a second copy of the message } @@ -726,7 +726,7 @@ void MarlinUI::draw_status_message(const bool blink) { // Fill the rest with spaces if there are missing spaces while (slen < LCD_WIDTH) { - lcd_put_wchar(' '); + lcd_put_lchar(' '); ++slen; } #endif @@ -778,7 +778,7 @@ inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos, const bool blink) duration_t remaining = (progress > 0) ? ((elapsed * 25600 / progress) >> 8) - elapsed : 0; #endif timepos -= remaining.toDigital(buffer); - lcd_put_wchar(timepos, 2, 'R'); + lcd_put_lchar(timepos, 2, 'R'); } #else constexpr bool show_remain = false; @@ -787,7 +787,7 @@ inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos, const bool blink) if (!show_remain) { duration_t elapsed = print_job_timer.duration(); timepos -= elapsed.toDigital(buffer); - lcd_put_wchar(timepos, 2, LCD_STR_CLOCK[0]); + lcd_put_lchar(timepos, 2, LCD_STR_CLOCK[0]); } lcd_put_u8str(buffer); return timepos; @@ -912,7 +912,7 @@ void MarlinUI::draw_status_screen() { else { const xy_pos_t lpos = current_position.asLogical(); _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink); - lcd_put_wchar(' '); + lcd_put_lchar(' '); _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink); } @@ -926,7 +926,7 @@ void MarlinUI::draw_status_screen() { _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink); #if HAS_LEVELING && !HAS_HEATED_BED - lcd_put_wchar(planner.leveling_active || blink ? '_' : ' '); + lcd_put_lchar(planner.leveling_active || blink ? '_' : ' '); #endif #endif // LCD_HEIGHT > 2 @@ -935,9 +935,9 @@ void MarlinUI::draw_status_screen() { #if LCD_HEIGHT > 3 - lcd_put_wchar(0, 2, LCD_STR_FEEDRATE[0]); + lcd_put_lchar(0, 2, LCD_STR_FEEDRATE[0]); lcd_put_u8str(i16tostr3rj(feedrate_percentage)); - lcd_put_wchar('%'); + lcd_put_lchar('%'); const uint8_t timepos = draw_elapsed_or_remaining_time(LCD_WIDTH - 1, blink); @@ -969,9 +969,9 @@ void MarlinUI::draw_status_screen() { per = planner.flow_percentage[0]; #endif } - lcd_put_wchar(c); + lcd_put_lchar(c); lcd_put_u8str(i16tostr3rj(per)); - lcd_put_wchar('%'); + lcd_put_lchar('%'); #endif #endif @@ -993,7 +993,7 @@ void MarlinUI::draw_status_screen() { _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink); #if HAS_LEVELING && (HAS_MULTI_HOTEND || !HAS_HEATED_BED) - lcd_put_wchar(LCD_WIDTH - 1, 0, planner.leveling_active || blink ? '_' : ' '); + lcd_put_lchar(LCD_WIDTH - 1, 0, planner.leveling_active || blink ? '_' : ' '); #endif // ========== Line 2 ========== @@ -1008,9 +1008,9 @@ void MarlinUI::draw_status_screen() { _draw_bed_status(blink); #endif - lcd_put_wchar(LCD_WIDTH - 9, 1, LCD_STR_FEEDRATE[0]); + lcd_put_lchar(LCD_WIDTH - 9, 1, LCD_STR_FEEDRATE[0]); lcd_put_u8str(i16tostr3rj(feedrate_percentage)); - lcd_put_wchar('%'); + lcd_put_lchar('%'); // ========== Line 3 ========== @@ -1075,29 +1075,29 @@ void MarlinUI::draw_status_screen() { vlen = vstr ? utf8_strlen(vstr) : 0; if (style & SS_CENTER) { int8_t pad = (LCD_WIDTH - plen - vlen) / 2; - while (--pad >= 0) { lcd_put_wchar(' '); n--; } + while (--pad >= 0) { lcd_put_lchar(' '); n--; } } if (plen) n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); if (vlen) n -= lcd_put_u8str_max(vstr, n); - for (; n > 0; --n) lcd_put_wchar(' '); + for (; n > 0; --n) lcd_put_lchar(' '); } // Draw a generic menu item with pre_char (if selected) and post_char void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) { - lcd_put_wchar(0, row, sel ? pre_char : ' '); + lcd_put_lchar(0, row, sel ? pre_char : ' '); uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2); - for (; n; --n) lcd_put_wchar(' '); - lcd_put_wchar(post_char); + for (; n; --n) lcd_put_lchar(' '); + lcd_put_lchar(post_char); } // Draw a menu item with a (potentially) editable value void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) { const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0; - lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); + lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vlen); if (vlen) { - lcd_put_wchar(':'); - for (; n; --n) lcd_put_wchar(' '); + lcd_put_lchar(':'); + for (; n; --n) lcd_put_lchar(' '); if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); } } @@ -1107,10 +1107,10 @@ void MarlinUI::draw_status_screen() { ui.encoder_direction_normal(); uint8_t n = lcd_put_u8str(0, 1, ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1); if (value) { - lcd_put_wchar(':'); n--; + lcd_put_lchar(':'); n--; const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space const lcd_uint_t valrow = n < len ? 2 : 1; // Value on the next row if it won't fit - lcd_put_wchar(LCD_WIDTH - len, valrow, ' '); // Right-justified, padded, leading space + lcd_put_lchar(LCD_WIDTH - len, valrow, ' '); // Right-justified, padded, leading space lcd_put_u8str(value); } } @@ -1120,22 +1120,22 @@ void MarlinUI::draw_status_screen() { ui.draw_select_screen_prompt(pref, string, suff); if (no) { SETCURSOR(0, LCD_HEIGHT - 1); - lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str(no); lcd_put_wchar(yesno ? ' ' : ']'); + lcd_put_lchar(yesno ? ' ' : '['); lcd_put_u8str(no); lcd_put_lchar(yesno ? ' ' : ']'); } if (yes) { SETCURSOR_RJ(utf8_strlen(yes) + 2, LCD_HEIGHT - 1); - lcd_put_wchar(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd_put_wchar(yesno ? ']' : ' '); + lcd_put_lchar(yesno ? '[' : ' '); lcd_put_u8str(yes); lcd_put_lchar(yesno ? ']' : ' '); } } #if ENABLED(SDSUPPORT) void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { - lcd_put_wchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); + lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); constexpr uint8_t maxlen = LCD_WIDTH - 2; uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); - for (; n; --n) lcd_put_wchar(' '); - lcd_put_wchar(isDir ? LCD_STR_FOLDER[0] : ' '); + for (; n; --n) lcd_put_lchar(' '); + lcd_put_lchar(isDir ? LCD_STR_FOLDER[0] : ' '); } #endif @@ -1253,7 +1253,7 @@ void MarlinUI::draw_status_screen() { void prep_and_put_map_char(custom_char &chrdata, const coordinate &ul, const coordinate &lr, const coordinate &brc, const uint8_t cl, const char c, const lcd_uint_t x, const lcd_uint_t y) { add_edges_to_custom_char(chrdata, ul, lr, brc, cl); lcd.createChar(c, (uint8_t*)&chrdata); - lcd_put_wchar(x, y, c); + lcd_put_lchar(x, y, c); } void MarlinUI::ubl_plot(const uint8_t x_plot, const uint8_t y_plot) { @@ -1270,7 +1270,7 @@ void MarlinUI::draw_status_screen() { #define _LCD_W_POS 8 #define _PLOT_X 0 #define _MAP_X 1 - #define _LABEL(X,Y,C) lcd_put_wchar(X, Y, C) + #define _LABEL(X,Y,C) lcd_put_lchar(X, Y, C) #define _XLABEL(X,Y) _LABEL('X',X,Y) #define _YLABEL(X,Y) _LABEL('Y',X,Y) #define _ZLABEL(X,Y) _LABEL('Z',X,Y) @@ -1333,13 +1333,13 @@ void MarlinUI::draw_status_screen() { n_cols = right_edge / (HD44780_CHAR_WIDTH) + 1; for (i = 0; i < n_cols; i++) { - lcd_put_wchar(i, 0, CHAR_LINE_TOP); // Box Top line - lcd_put_wchar(i, n_rows - 1, CHAR_LINE_BOT); // Box Bottom line + lcd_put_lchar(i, 0, CHAR_LINE_TOP); // Box Top line + lcd_put_lchar(i, n_rows - 1, CHAR_LINE_BOT); // Box Bottom line } for (j = 0; j < n_rows; j++) { - lcd_put_wchar(0, j, CHAR_EDGE_L); // Box Left edge - lcd_put_wchar(n_cols - 1, j, CHAR_EDGE_R); // Box Right edge + lcd_put_lchar(0, j, CHAR_EDGE_L); // Box Left edge + lcd_put_lchar(n_cols - 1, j, CHAR_EDGE_R); // Box Right edge } /** @@ -1349,8 +1349,8 @@ void MarlinUI::draw_status_screen() { k = pixels_per_y_mesh_pnt * (GRID_MAX_POINTS_Y) + 2; l = (HD44780_CHAR_HEIGHT) * n_rows; if (l > k && l - k >= (HD44780_CHAR_HEIGHT) / 2) { - lcd_put_wchar(0, n_rows - 1, ' '); // Box Left edge - lcd_put_wchar(n_cols - 1, n_rows - 1, ' '); // Box Right edge + lcd_put_lchar(0, n_rows - 1, ' '); // Box Left edge + lcd_put_lchar(n_cols - 1, n_rows - 1, ' '); // Box Right edge } clear_custom_char(&new_char); @@ -1464,11 +1464,11 @@ void MarlinUI::draw_status_screen() { /** * Print plot position */ - lcd_put_wchar(_LCD_W_POS, 0, '('); + lcd_put_lchar(_LCD_W_POS, 0, '('); lcd_put_u8str(ui8tostr3rj(x_plot)); - lcd_put_wchar(','); + lcd_put_lchar(','); lcd_put_u8str(ui8tostr3rj(y_plot)); - lcd_put_wchar(')'); + lcd_put_lchar(')'); #if LCD_HEIGHT <= 3 // 16x2 or 20x2 display diff --git a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp index 7b15b786055c..e681ff0a9170 100644 --- a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp @@ -48,7 +48,7 @@ int lcd_glyph_height() { return 1; } typedef struct _TFTGLCD_charmap_t { - wchar_t uchar; // the unicode char + lchar_t uchar; // the unicode char uint8_t idx; // the glyph of the char in the ROM uint8_t idx2; // the char used to be combined with the idx to simulate a single char } TFTGLCD_charmap_t; @@ -991,7 +991,7 @@ void lcd_put_int(const int i) { // return < 0 on error // return the advanced cols -int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { +int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) { // find the HD44780 internal ROM first int ret; @@ -1049,10 +1049,10 @@ static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_by pixel_len_t ret = 0; const uint8_t *p = (uint8_t *)utf8_str; while (ret < max_length) { - wchar_t ch = 0; - p = get_utf8_value_cb(p, cb_read_byte, &ch); - if (!ch) break; - ret += lcd_put_wchar_max(ch, max_length - ret); + lchar_t wc; + p = get_utf8_value_cb(p, cb_read_byte, wc); + if (!wc) break; + ret += lcd_put_lchar_max(wc, max_length - ret); } return (int)ret; } diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 46564bb1e6e2..f3d98ec55584 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -524,16 +524,16 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const UNUSED(blink); #else if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) { - lcd_put_wchar(' '); - if (t2 >= 10) lcd_put_wchar(' '); - if (t2 >= 100) lcd_put_wchar(' '); + lcd_put_lchar(' '); + if (t2 >= 10) lcd_put_lchar(' '); + if (t2 >= 100) lcd_put_lchar(' '); } else #endif lcd_put_u8str(i16tostr3left(t2)); - lcd_put_wchar(' '); - if (t2 < 10) lcd_put_wchar(' '); + lcd_put_lchar(' '); + if (t2 < 10) lcd_put_lchar(' '); if (t2) picBits |= ICON_TEMP1; else picBits &= ~ICON_TEMP1; @@ -545,7 +545,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const FORCE_INLINE void _draw_flowmeter_status() { lcd_moveto(5, 5); lcd_put_u8str(F("FLOW")); - lcd_moveto(7, 6); lcd_put_wchar('L'); + lcd_moveto(7, 6); lcd_put_lchar('L'); lcd_moveto(6, 7); lcd_put_u8str(ftostr11ns(cooler.flowrate)); if (cooler.flowrate) picBits |= ICON_FAN; @@ -564,7 +564,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const { lcd_put_u8str("mA"); lcd_moveto(10, 7); - lcd_put_wchar(' '); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f))); + lcd_put_lchar(' '); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f))); } else { lcd_put_u8str(" A"); @@ -585,9 +585,9 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #if CUTTER_UNIT_IS(RPM) lcd_moveto(16, 6); lcd_put_u8str(F("RPM")); lcd_moveto(15, 7); lcd_put_u8str(ftostr31ns(float(cutter.unitPower) / 1000)); - lcd_put_wchar('K'); + lcd_put_lchar('K'); #elif CUTTER_UNIT_IS(PERCENT) - lcd_moveto(17, 6); lcd_put_wchar('%'); + lcd_moveto(17, 6); lcd_put_lchar('%'); lcd_moveto(18, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); #else lcd_moveto(17, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower)); diff --git a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp index f5c13798f234..48b2e92a118d 100644 --- a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp +++ b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp @@ -28,7 +28,7 @@ void lcd_put_int(const int i) { u8g.print(i); } // return < 0 on error // return the advanced pixels -int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { +int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) { if (c < 256) { u8g.print((char)c); return u8g_GetFontBBXWidth(u8g.getU8g()); diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 3c661a44294a..e32715988d2f 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -371,11 +371,11 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop if (!PAGE_CONTAINS(y1 + 1, y2 + 2)) return; - lcd_put_wchar(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), y2, 'E'); - lcd_put_wchar((char)('1' + extruder)); - lcd_put_wchar(' '); + lcd_put_lchar(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), y2, 'E'); + lcd_put_lchar((char)('1' + extruder)); + lcd_put_lchar(' '); lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegHotend(extruder))); - lcd_put_wchar('/'); + lcd_put_lchar('/'); if (get_blink() || !thermalManager.heater_idle[extruder].timed_out) lcd_put_u8str(i16tostr3rj(thermalManager.degTargetHotend(extruder))); @@ -421,12 +421,12 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop vlen = vstr ? utf8_strlen(vstr) : 0; if (style & SS_CENTER) { int pad = (LCD_PIXEL_WIDTH - plen - vlen * MENU_FONT_WIDTH) / MENU_FONT_WIDTH / 2; - while (--pad >= 0) n -= lcd_put_wchar(' '); + while (--pad >= 0) n -= lcd_put_lchar(' '); } if (plen) n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); if (vlen) n -= lcd_put_u8str_max(vstr, n); - while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); + while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' '); } } @@ -434,9 +434,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) { if (mark_as_selected(row, sel)) { pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1) * (MENU_FONT_WIDTH); - while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); - lcd_put_wchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char); - lcd_put_wchar(' '); + while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' '); + lcd_put_lchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char); + lcd_put_lchar(' '); } } @@ -449,8 +449,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH); if (vallen) { - lcd_put_wchar(':'); - while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); + lcd_put_lchar(':'); + while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' '); lcd_moveto(LCD_PIXEL_WIDTH - _MAX((MENU_FONT_WIDTH) * vallen, pixelwidth + 2), row_y2); if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); } @@ -494,14 +494,14 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // If a value is included, print a colon, then print the value right-justified if (value) { - lcd_put_wchar(':'); + lcd_put_lchar(':'); if (extra_row) { // Assume that value is numeric (with no descender) baseline += EDIT_FONT_ASCENT + 2; onpage = PAGE_CONTAINS(baseline - (EDIT_FONT_ASCENT - 1), baseline); } if (onpage) { - lcd_put_wchar(((lcd_chr_fit - 1) - (vallen * prop + 1)) * one_chr_width, baseline, ' '); // Right-justified, padded, add a leading space + lcd_put_lchar(((lcd_chr_fit - 1) - (vallen * prop + 1)) * one_chr_width, baseline, ' '); // Right-justified, padded, add a leading space lcd_put_u8str(value); } } @@ -533,10 +533,10 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { if (mark_as_selected(row, sel)) { const uint8_t maxlen = LCD_WIDTH - isDir; - if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]); + if (isDir) lcd_put_lchar(LCD_STR_FOLDER[0]); const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH); pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); - while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); + while (n > MENU_FONT_WIDTH) n -= lcd_put_lchar(' '); } } @@ -611,11 +611,11 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Print plot position if (PAGE_CONTAINS(LCD_PIXEL_HEIGHT - (INFO_FONT_HEIGHT - 1), LCD_PIXEL_HEIGHT)) { - lcd_put_wchar(5, LCD_PIXEL_HEIGHT, '('); + lcd_put_lchar(5, LCD_PIXEL_HEIGHT, '('); u8g.print(x_plot); - lcd_put_wchar(','); + lcd_put_lchar(','); u8g.print(y_plot); - lcd_put_wchar(')'); + lcd_put_lchar(')'); // Show the location value lcd_put_u8str_P(74, LCD_PIXEL_HEIGHT, Z_LBL); diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 7e5329aeef3a..3e3190287d5c 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -200,7 +200,7 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co const char *str = i16tostr3rj(temp); const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1; lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]); - lcd_put_wchar(LCD_STR_DEGREE[0]); + lcd_put_lchar(LCD_STR_DEGREE[0]); } } @@ -432,13 +432,13 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const const bool is_inch = parser.using_inch_units(); const AxisEnum a = TERN(LCD_SHOW_E_TOTAL, axis == E_AXIS ? X_AXIS : axis, axis); const uint8_t offs = a * (is_inch ? XYZ_SPACING_IN : XYZ_SPACING); - lcd_put_wchar((is_inch ? X_LABEL_POS_IN : X_LABEL_POS) + offs, XYZ_BASELINE, axis_codes[axis]); + lcd_put_lchar((is_inch ? X_LABEL_POS_IN : X_LABEL_POS) + offs, XYZ_BASELINE, axis_codes[axis]); lcd_moveto((is_inch ? X_VALUE_POS_IN : X_VALUE_POS) + offs, XYZ_BASELINE); if (blink) lcd_put_u8str(value); else if (axis_should_home(axis)) - while (const char c = *value++) lcd_put_wchar(c <= '.' ? c : '?'); + while (const char c = *value++) lcd_put_lchar(c <= '.' ? c : '?'); else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis)) lcd_put_u8str(axis == Z_AXIS ? F(" ") : F(" ")); else @@ -675,7 +675,7 @@ void MarlinUI::draw_status_screen() { lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower)); #elif CUTTER_UNIT_IS(RPM) lcd_put_u8str(STATUS_CUTTER_TEXT_X - 2, STATUS_CUTTER_TEXT_Y, ftostr61rj(float(cutter.unitPower) / 1000)); - lcd_put_wchar('K'); + lcd_put_lchar('K'); #else lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, cutter_power2str(cutter.unitPower)); #endif @@ -734,7 +734,7 @@ void MarlinUI::draw_status_screen() { } #endif lcd_put_u8str(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y, i16tostr3rj(thermalManager.pwmToPercent(spd))); - lcd_put_wchar(c); + lcd_put_lchar(c); } } #endif @@ -783,7 +783,7 @@ void MarlinUI::draw_status_screen() { if (progress_state == 0) { if (progress_string[0]) { lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string); - lcd_put_wchar('%'); + lcd_put_lchar('%'); } } else if (progress_state == 2 && estimation_string[0]) { @@ -804,7 +804,7 @@ void MarlinUI::draw_status_screen() { #if ENABLED(SHOW_SD_PERCENT) if (progress_string[0]) { lcd_put_u8str(55, EXTRAS_BASELINE, progress_string); // Percent complete - lcd_put_wchar('%'); + lcd_put_lchar('%'); } #endif @@ -814,7 +814,7 @@ void MarlinUI::draw_status_screen() { #if ENABLED(SHOW_REMAINING_TIME) if (blink && estimation_string[0]) { - lcd_put_wchar(estimation_x_pos, EXTRAS_BASELINE, 'R'); + lcd_put_lchar(estimation_x_pos, EXTRAS_BASELINE, 'R'); lcd_put_u8str(estimation_string); } else @@ -912,11 +912,11 @@ void MarlinUI::draw_status_screen() { if (PAGE_CONTAINS(EXTRAS_2_BASELINE - INFO_FONT_ASCENT, EXTRAS_2_BASELINE - 1)) { set_font(FONT_MENU); - lcd_put_wchar(3, EXTRAS_2_BASELINE, LCD_STR_FEEDRATE[0]); + lcd_put_lchar(3, EXTRAS_2_BASELINE, LCD_STR_FEEDRATE[0]); set_font(FONT_STATUSMENU); lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3rj(feedrate_percentage)); - lcd_put_wchar('%'); + lcd_put_lchar('%'); // // Filament sensor display if SD is disabled @@ -924,10 +924,10 @@ void MarlinUI::draw_status_screen() { #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) lcd_put_u8str(56, EXTRAS_2_BASELINE, wstring); lcd_put_u8str(102, EXTRAS_2_BASELINE, mstring); - lcd_put_wchar('%'); + lcd_put_lchar('%'); set_font(FONT_MENU); - lcd_put_wchar(47, EXTRAS_2_BASELINE, LCD_STR_FILAM_DIA[0]); // lcd_put_u8str(F(LCD_STR_FILAM_DIA)); - lcd_put_wchar(93, EXTRAS_2_BASELINE, LCD_STR_FILAM_MUL[0]); + lcd_put_lchar(47, EXTRAS_2_BASELINE, LCD_STR_FILAM_DIA[0]); // lcd_put_u8str(F(LCD_STR_FILAM_DIA)); + lcd_put_lchar(93, EXTRAS_2_BASELINE, LCD_STR_FILAM_MUL[0]); #endif } @@ -941,12 +941,12 @@ void MarlinUI::draw_status_screen() { // Alternate Status message and Filament display if (ELAPSED(millis(), next_filament_display)) { lcd_put_u8str(F(LCD_STR_FILAM_DIA)); - lcd_put_wchar(':'); + lcd_put_lchar(':'); lcd_put_u8str(wstring); lcd_put_u8str(F(" " LCD_STR_FILAM_MUL)); - lcd_put_wchar(':'); + lcd_put_lchar(':'); lcd_put_u8str(mstring); - lcd_put_wchar('%'); + lcd_put_lchar('%'); return; } #endif @@ -979,7 +979,7 @@ void MarlinUI::draw_status_message(const bool blink) { if (slen <= lcd_width) { // The string fits within the line. Print with no scrolling lcd_put_u8str(status_message); - while (slen < lcd_width) { lcd_put_wchar(' '); ++slen; } + while (slen < lcd_width) { lcd_put_lchar(' '); ++slen; } } else { // String is longer than the available space @@ -997,14 +997,14 @@ void MarlinUI::draw_status_message(const bool blink) { // If the remaining string doesn't completely fill the screen if (rlen < lcd_width) { uint8_t chars = lcd_width - rlen; // Amount of space left in characters - lcd_put_wchar(' '); // Always at 1+ spaces left, draw a space + lcd_put_lchar(' '); // Always at 1+ spaces left, draw a space if (--chars) { // Draw a second space if there's room - lcd_put_wchar(' '); + lcd_put_lchar(' '); if (--chars) { // Draw a third space if there's room - lcd_put_wchar(' '); + lcd_put_lchar(' '); if (--chars) { // Print a second copy of the message lcd_put_u8str_max(status_message, pixel_width - (rlen + 2) * (MENU_FONT_WIDTH)); - lcd_put_wchar(' '); + lcd_put_lchar(' '); } } } @@ -1019,7 +1019,7 @@ void MarlinUI::draw_status_message(const bool blink) { lcd_put_u8str_max(status_message, pixel_width); // Fill the rest with spaces - for (; slen < lcd_width; ++slen) lcd_put_wchar(' '); + for (; slen < lcd_width; ++slen) lcd_put_lchar(' '); #endif // !STATUS_MESSAGE_SCROLLING diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp index 8ba0e7d50a8b..d5e0e5bafff3 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp @@ -60,11 +60,11 @@ static int fontgroup_init(font_group_t * root, const uxg_fontinfo_t * fntinfo, i return 0; } -static const font_t* fontgroup_find(font_group_t * root, wchar_t val) { - uxg_fontinfo_t vcmp = {(uint16_t)(val / 128), (uint8_t)(val % 128 + 128), (uint8_t)(val % 128 + 128), 0, 0}; - size_t idx = 0; +static const font_t* fontgroup_find(font_group_t * root, const lchar_t &val) { + if (val <= 0xFF) return nullptr; - if (val < 256) return nullptr; + uxg_fontinfo_t vcmp = { uint16_t(val >> 7), uint8_t((val & 0x7F) + 0x80), uint8_t((val & 0x7F) + 0x80), 0, 0 }; + size_t idx = 0; if (pf_bsearch_r((void*)root->m_fntifo, root->m_fntinfo_num, pf_bsearch_cb_comp_fntifo_pgm, (void*)&vcmp, &idx) < 0) return nullptr; @@ -73,7 +73,7 @@ static const font_t* fontgroup_find(font_group_t * root, wchar_t val) { return vcmp.fntdata; } -static void fontgroup_drawwchar(font_group_t *group, const font_t *fnt_default, wchar_t val, void * userdata, fontgroup_cb_draw_t cb_draw_ram) { +static void fontgroup_drawwchar(font_group_t *group, const font_t *fnt_default, const lchar_t &val, void * userdata, fontgroup_cb_draw_t cb_draw_ram) { uint8_t buf[2] = {0, 0}; const font_t * fntpqm = (font_t*)fontgroup_find(group, val); if (!fntpqm) { @@ -106,10 +106,10 @@ static void fontgroup_drawwchar(font_group_t *group, const font_t *fnt_default, static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default, const char *utf8_msg, read_byte_cb_t cb_read_byte, void * userdata, fontgroup_cb_draw_t cb_draw_ram) { const uint8_t *p = (uint8_t*)utf8_msg; for (;;) { - wchar_t val = 0; - p = get_utf8_value_cb(p, cb_read_byte, &val); - if (!val) break; - fontgroup_drawwchar(group, fnt_default, val, userdata, cb_draw_ram); + lchar_t wc; + p = get_utf8_value_cb(p, cb_read_byte, wc); + if (!wc) break; + fontgroup_drawwchar(group, fnt_default, wc, userdata, cb_draw_ram); } } @@ -149,19 +149,19 @@ static int fontgroup_cb_draw_u8g(void *userdata, const font_t *fnt_current, cons } /** - * @brief Draw a wchar_t at the specified position + * @brief Draw a lchar_t at the specified position * * @param pu8g : U8G pointer * @param x : position x axis * @param y : position y axis - * @param ch : the wchar_t + * @param wc : the lchar_t * @param max_width : the pixel width of the string allowed * * @return number of pixels advanced * * Draw a UTF-8 string at the specified position */ -unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_width) { +unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, const lchar_t &wc, pixel_len_t max_width) { struct _uxg_drawu8_data_t data; font_group_t *group = &g_fontgroup_root; const font_t *fnt_default = uxg_GetFont(pu8g); @@ -176,7 +176,7 @@ unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t data.adv = 0; data.max_width = max_width; data.fnt_prev = nullptr; - fontgroup_drawwchar(group, fnt_default, ch, (void*)&data, fontgroup_cb_draw_u8g); + fontgroup_drawwchar(group, fnt_default, wc, (void*)&data, fontgroup_cb_draw_u8g); u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default); return data.adv; diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.h b/Marlin/src/lcd/dogm/u8g_fontutf8.h index 5933f027cc79..0109b6674cbe 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.h +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.h @@ -26,7 +26,7 @@ typedef struct _uxg_fontinfo_t { int uxg_SetUtf8Fonts(const uxg_fontinfo_t * fntinfo, int number); // fntinfo is type of PROGMEM -unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, const pixel_len_t max_length); +unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, const lchar_t &ch, const pixel_len_t max_length); unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, const pixel_len_t max_length); unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, const pixel_len_t max_length); diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp b/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp index d631cbfafc8d..24c43bc513ec 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp @@ -50,12 +50,12 @@ uint8_t read_byte(const uint8_t *byte) { return *byte; } * @ displays an axis name such as XYZUVW, or E for an extruder */ void DWIN_String::add(const char *tpl, const int8_t index, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/) { - wchar_t wchar; + lchar_t wc; while (*tpl) { - tpl = get_utf8_value_cb(tpl, read_byte, &wchar); - if (wchar > 255) wchar |= 0x0080; - const uint8_t ch = uint8_t(wchar & 0x00FF); + tpl = get_utf8_value_cb(tpl, read_byte, wc); + if (wc > 255) wc |= 0x0080; + const uint8_t ch = uint8_t(wc & 0x00FF); if (ch == '=' || ch == '~' || ch == '*') { if (index >= 0) { @@ -80,32 +80,32 @@ void DWIN_String::add(const char *tpl, const int8_t index, const char *cstr/*=nu } void DWIN_String::add(const char *cstr, uint8_t max_len/*=MAX_STRING_LENGTH*/) { - wchar_t wchar; + lchar_t wc; while (*cstr && max_len) { - cstr = get_utf8_value_cb(cstr, read_byte, &wchar); + cstr = get_utf8_value_cb(cstr, read_byte, wc); /* - if (wchar > 255) wchar |= 0x0080; - uint8_t ch = uint8_t(wchar & 0x00FF); + if (wc > 255) wc |= 0x0080; + const uint8_t ch = uint8_t(wc & 0x00FF); add_character(ch); */ - add(wchar); + add(wc); max_len--; } eol(); } -void DWIN_String::add(const wchar_t character) { +void DWIN_String::add(const lchar_t &wc) { int ret; size_t idx = 0; dwin_charmap_t pinval; dwin_charmap_t *copy_address = nullptr; - pinval.uchar = character; + pinval.uchar = wc; pinval.idx = -1; // For 8-bit ASCII just print the single character char str[] = { '?', 0 }; - if (character < 255) { - str[0] = (char)character; + if (wc < 255) { + str[0] = (char)wc; } else { copy_address = nullptr; diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h index c29777ae7b12..686b1aa2b17a 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h @@ -29,7 +29,7 @@ #include typedef struct _dwin_charmap_t { - wchar_t uchar; // the unicode char + lchar_t uchar; // the unicode char uint8_t idx; // the glyph of the char in the ROM uint8_t idx2; // the char used to be combined with the idx to simulate a single char } dwin_charmap_t; @@ -69,10 +69,10 @@ class DWIN_String { /** * @brief Append a UTF-8 character * - * @param character The UTF-8 character + * @param wc The UTF-8 character */ - static void add(wchar_t character); - static void set(wchar_t character) { set(); add(character); } + static void add(const lchar_t &wc); + static void set(const lchar_t &wc) { set(); add(wc); } /** * @brief Append / Set C-string diff --git a/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp b/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp index 278f17fac994..e603882e0cfd 100644 --- a/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp @@ -63,7 +63,7 @@ int lcd_put_dwin_string() { // return < 0 on error // return the advanced cols -int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { +int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) { dwin_string.set(c); dwin_string.truncate(max_length); // Draw the char(s) at the cursor and advance the cursor @@ -87,10 +87,10 @@ static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_by const uint8_t *p = (uint8_t *)utf8_str; dwin_string.set(); while (dwin_string.length < max_length) { - wchar_t ch = 0; - p = get_utf8_value_cb(p, cb_read_byte, &ch); - if (!ch) break; - dwin_string.add(ch); + lchar_t wc; + p = get_utf8_value_cb(p, cb_read_byte, wc); + if (!wc) break; + dwin_string.add(wc); } DWIN_Draw_String(dwin_font.solid, dwin_font.index, dwin_font.fg, dwin_font.bg, cursor.x, cursor.y, dwin_string.string()); lcd_advance_cursor(dwin_string.length); diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 0727ab0b70ca..455fce272a1c 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -213,7 +213,7 @@ void MarlinUI::draw_status_message(const bool blink) { lcd_put_u8str(status_message); // Fill the rest with spaces - while (slen < max_status_chars) { lcd_put_wchar(' '); ++slen; } + while (slen < max_status_chars) { lcd_put_lchar(' '); ++slen; } } } else { @@ -227,10 +227,10 @@ void MarlinUI::draw_status_message(const bool blink) { // If the string doesn't completely fill the line... if (rlen < max_status_chars) { - lcd_put_wchar('.'); // Always at 1+ spaces left, draw a dot + lcd_put_lchar('.'); // 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 - lcd_put_wchar('.'); + lcd_put_lchar('.'); if (--chars) lcd_put_u8str_max(status_message, chars); // Print a second copy of the message } @@ -254,7 +254,7 @@ void MarlinUI::draw_status_message(const bool blink) { lcd_put_u8str_max(status_message, max_status_chars); // Fill the rest with spaces if there are missing spaces - while (slen < max_status_chars) { lcd_put_wchar(' '); ++slen; } + while (slen < max_status_chars) { lcd_put_lchar(' '); ++slen; } } #endif diff --git a/Marlin/src/lcd/fontutils.cpp b/Marlin/src/lcd/fontutils.cpp index a97e63ac4d3a..46329fd4be62 100644 --- a/Marlin/src/lcd/fontutils.cpp +++ b/Marlin/src/lcd/fontutils.cpp @@ -31,8 +31,6 @@ #include "../inc/MarlinConfig.h" -#define MAX_UTF8_CHAR_SIZE 4 - #if HAS_WIRED_LCD #include "marlinui.h" #include "../MarlinCore.h" @@ -99,7 +97,7 @@ static inline bool utf8_is_start_byte_of_char(const uint8_t b) { /* This function gets the character at the pstart position, interpreting UTF8 multibyte sequences and returns the pointer to the next character */ -const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval) { +const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_byte, lchar_t &pval) { uint32_t val = 0; const uint8_t *p = pstart; @@ -158,7 +156,7 @@ const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_b else for (; 0xFC < (0xFE & valcur); ) { p++; valcur = cb_read_byte(p); } - if (pval) *pval = val; + pval = val; return p; } diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index e01962d7ad80..69edf1a0c839 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -31,36 +31,41 @@ #pragma once #include -#include // wchar_t #include // uint32_t #include "../HAL/shared/Marduino.h" #include "../core/macros.h" +#define MAX_UTF8_CHAR_SIZE 4 + +// Use a longer character type (if needed) because wchar_t is only 16 bits wide +#ifdef MAX_UTF8_CHAR_SIZE + #if MAX_UTF8_CHAR_SIZE > 2 + typedef uint32_t lchar_t; + #else + typedef wchar_t lchar_t; + #endif +#else + #define wchar_t uint32_t +#endif + // read a byte from ROM or RAM typedef uint8_t (*read_byte_cb_t)(const uint8_t * str); uint8_t read_byte_ram(const uint8_t *str); uint8_t read_byte_rom(const uint8_t *str); -// there's overflow of the wchar_t due to the 2-byte size in Arduino -// sizeof(wchar_t)=2; sizeof(size_t)=2; sizeof(uint32_t)=4; -// sizeof(int)=2; sizeof(long)=4; sizeof(unsigned)=2; -//#undef wchar_t -#define wchar_t uint32_t -//typedef uint32_t wchar_t; - typedef uint16_t pixel_len_t; #define PIXEL_LEN_NOLIMIT ((pixel_len_t)(-1)) /* Perform binary search */ -typedef int (* pf_bsearch_cb_comp_t)(void *userdata, size_t idx, void * data_pin); /*"data_list[idx] - *data_pin"*/ +typedef int (* pf_bsearch_cb_comp_t)(void *userdata, size_t idx, void * data_pin); int pf_bsearch_r(void *userdata, size_t num_data, pf_bsearch_cb_comp_t cb_comp, void *data_pinpoint, size_t *ret_idx); /* Get the character, decoding multibyte UTF8 characters and returning a pointer to the start of the next UTF8 character */ -const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval); +const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_byte, lchar_t &pval); -inline const char* get_utf8_value_cb(const char *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval) { +inline const char* get_utf8_value_cb(const char *pstart, read_byte_cb_t cb_read_byte, lchar_t &pval) { return (const char *)get_utf8_value_cb((const uint8_t *)pstart, cb_read_byte, pval); } diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 692181306993..064b1c4d9888 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -47,19 +47,19 @@ lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr/ const uint8_t *p = (uint8_t*)ptpl; int8_t n = maxlen; while (n > 0) { - wchar_t ch; - p = get_utf8_value_cb(p, read_byte_rom, &ch); - if (!ch) break; - if (ch == '=' || ch == '~' || ch == '*') { + lchar_t wc; + p = get_utf8_value_cb(p, read_byte_rom, wc); + if (!wc) break; + if (wc == '=' || wc == '~' || wc == '*') { if (ind >= 0) { - if (ch == '*') { lcd_put_wchar('E'); n--; } + if (wc == '*') { lcd_put_lchar('E'); n--; } if (n) { - int8_t inum = ind + ((ch == '=') ? 0 : LCD_FIRST_TOOL); + int8_t inum = ind + ((wc == '=') ? 0 : LCD_FIRST_TOOL); if (inum >= 10) { - lcd_put_wchar('0' + (inum / 10)); n--; + lcd_put_lchar('0' + (inum / 10)); n--; inum %= 10; } - if (n) { lcd_put_wchar('0' + inum); n--; } + if (n) { lcd_put_lchar('0' + inum); n--; } } } else { @@ -71,19 +71,19 @@ lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr/ break; } } - else if (ch == '$' && fstr) { + else if (wc == '$' && fstr) { n -= lcd_put_u8str_max_P(FTOP(fstr), n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); } - else if (ch == '$' && cstr) { + else if (wc == '$' && cstr) { n -= lcd_put_u8str_max(cstr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); } - else if (ch == '@') { - lcd_put_wchar(axis_codes[ind]); + else if (wc == '@') { + lcd_put_lchar(axis_codes[ind]); n--; } else { - lcd_put_wchar(ch); - n -= ch > 255 ? prop : 1; + lcd_put_lchar(wc); + n -= wc > 255 ? prop : 1; } } return n; @@ -97,10 +97,10 @@ int calculateWidth(PGM_P const pstr) { int n = 0; do { - wchar_t ch; - p = get_utf8_value_cb(p, read_byte_rom, &ch); - if (!ch) break; - n += (ch > 255) ? prop : 1; + lchar_t wc; + p = get_utf8_value_cb(p, read_byte_rom, wc); + if (!wc) break; + n += (wc > 255) ? prop : 1; } while (1); return n * MENU_FONT_WIDTH; diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index 2eb47c534b05..bcf85cb69396 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -138,7 +138,7 @@ int lcd_glyph_height(); * * @return the output width (in pixels on GLCD) */ -int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length); +int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length); /** * @brief Draw a SRAM UTF-8 string @@ -267,17 +267,17 @@ inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, const char /** * @brief Draw a UTF-8 character with no width limit * - * @param c The wchar to draw + * @param c The lchar to draw * @return the output width (in pixels on GLCD) */ -inline int lcd_put_wchar(const wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); } +inline int lcd_put_lchar(const lchar_t &c) { return lcd_put_lchar_max(c, PIXEL_LEN_NOLIMIT); } /** * @param col * @param row */ -inline int lcd_put_wchar(const lcd_uint_t col, const lcd_uint_t row, const wchar_t c) { +inline int lcd_put_lchar(const lcd_uint_t col, const lcd_uint_t row, const lchar_t &c) { lcd_moveto(col, row); - return lcd_put_wchar(c); + return lcd_put_lchar(c); } /** diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 51c87d9fb844..2a3e2bb14d1f 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -417,26 +417,26 @@ void MarlinUI::init() { }; const uint8_t *p = (uint8_t*)string; - wchar_t ch; + lchar_t wc; if (wordwrap) { const uint8_t *wrd = nullptr; uint8_t c = 0; // find the end of the part for (;;) { if (!wrd) wrd = p; // Get word start /before/ advancing - p = get_utf8_value_cb(p, cb_read_byte, &ch); - const bool eol = !ch; // zero ends the string + p = get_utf8_value_cb(p, cb_read_byte, wc); + const bool eol = !wc; // zero ends the string // End or a break between phrases? - if (eol || ch == ' ' || ch == '-' || ch == '+' || ch == '.') { - if (!c && ch == ' ') { if (wrd) wrd++; continue; } // collapse extra spaces + if (eol || wc == ' ' || wc == '-' || wc == '+' || wc == '.') { + if (!c && wc == ' ') { if (wrd) wrd++; continue; } // collapse extra spaces // Past the right and the word is not too long? if (col + c > LCD_WIDTH && col >= (LCD_WIDTH) / 4) _newline(); // should it wrap? c += !eol; // +1 so the space will be printed col += c; // advance col to new position while (c) { // character countdown --c; // count down to zero - wrd = get_utf8_value_cb(wrd, cb_read_byte, &ch); // get characters again - lcd_put_wchar(ch); // character to the LCD + wrd = get_utf8_value_cb(wrd, cb_read_byte, wc); // get characters again + lcd_put_lchar(wc); // character to the LCD } if (eol) break; // all done! wrd = nullptr; // set up for next word @@ -446,9 +446,9 @@ void MarlinUI::init() { } else { for (;;) { - p = get_utf8_value_cb(p, cb_read_byte, &ch); - if (!ch) break; - lcd_put_wchar(ch); + p = get_utf8_value_cb(p, cb_read_byte, wc); + if (!wc) break; + lcd_put_lchar(wc); col++; if (col >= LCD_WIDTH) _newline(); } diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 3fe0c582cb10..c4a63dafc6ac 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -178,7 +178,7 @@ static void _lcd_level_bed_corners_get_next_position() { lcd_put_u8str(GET_TEXT_F(MSG_BED_TRAMMING_GOOD_POINTS)); IF_ENABLED(TFT_COLOR_UI, lcd_moveto(12, cy)); lcd_put_u8str(GOOD_POINTS_TO_STR(good_points)); - lcd_put_wchar('/'); + lcd_put_lchar('/'); lcd_put_u8str(GOOD_POINTS_TO_STR(nr_edge_points)); } diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 8b6af33fd11e..1f2257a77fe3 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -79,7 +79,7 @@ void menu_advanced_settings(); LIMIT(bar_percent, 0, 100); ui.encoderPosition = 0; MenuItem_static::draw(0, GET_TEXT_F(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT); - lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_wchar('%'); + lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_lchar('%'); lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent); } diff --git a/Marlin/src/lcd/menu/menu_password.cpp b/Marlin/src/lcd/menu/menu_password.cpp index 89ea42d70477..d29b77311fd3 100644 --- a/Marlin/src/lcd/menu/menu_password.cpp +++ b/Marlin/src/lcd/menu/menu_password.cpp @@ -61,10 +61,10 @@ void Password::menu_password_entry() { FSTR_P const label = GET_TEXT_F(MSG_ENTER_DIGIT); EDIT_ITEM_F(uint8, label, &editable.uint8, 0, 9, digit_entered); MENU_ITEM_ADDON_START(utf8_strlen(label) + 1); - lcd_put_wchar(' '); - lcd_put_wchar('1' + digit_no); + lcd_put_lchar(' '); + lcd_put_lchar('1' + digit_no); SETCURSOR_X(LCD_WIDTH - 2); - lcd_put_wchar('>'); + lcd_put_lchar('>'); MENU_ITEM_ADDON_END(); ACTION_ITEM(MSG_START_OVER, start_over); diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index b13c55f80a3b..bc5200196717 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -76,12 +76,12 @@ #if ENABLED(TFT_COLOR_UI) lcd_moveto(4, 3); lcd_put_u8str(GET_TEXT_F(MSG_BABYSTEP_TOTAL)); - lcd_put_wchar(':'); + lcd_put_lchar(':'); lcd_moveto(10, 3); #else lcd_moveto(0, TERN(HAS_MARLINUI_U8GLIB, LCD_PIXEL_HEIGHT - MENU_FONT_DESCENT, LCD_HEIGHT - 1)); lcd_put_u8str(GET_TEXT_F(MSG_BABYSTEP_TOTAL)); - lcd_put_wchar(':'); + lcd_put_lchar(':'); #endif lcd_put_u8str(BABYSTEP_TO_STR(mps * babystep.axis_total[BS_TOTAL_IND(axis)])); } diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp index 8585d1d82ffa..0b85f1809242 100644 --- a/Marlin/src/lcd/tft/tft_string.cpp +++ b/Marlin/src/lcd/tft/tft_string.cpp @@ -94,12 +94,12 @@ void TFT_String::set() { * @ displays an axis name such as XYZUVW, or E for an extruder */ void TFT_String::add(const char *tpl, const int8_t index, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/) { - wchar_t wchar; + lchar_t wc; while (*tpl) { - tpl = get_utf8_value_cb(tpl, read_byte_ram, &wchar); - if (wchar > 255) wchar |= 0x0080; - const uint8_t ch = uint8_t(wchar & 0x00FF); + tpl = get_utf8_value_cb(tpl, read_byte_ram, wc); + if (wc > 255) wc |= 0x0080; + const uint8_t ch = uint8_t(wc & 0x00FF); if (ch == '=' || ch == '~' || ch == '*') { if (index >= 0) { @@ -124,11 +124,11 @@ void TFT_String::add(const char *tpl, const int8_t index, const char *cstr/*=nul } void TFT_String::add(const char *cstr, uint8_t max_len/*=MAX_STRING_LENGTH*/) { - wchar_t wchar; + lchar_t wc; while (*cstr && max_len) { - cstr = get_utf8_value_cb(cstr, read_byte_ram, &wchar); - if (wchar > 255) wchar |= 0x0080; - const uint8_t ch = uint8_t(wchar & 0x00FF); + cstr = get_utf8_value_cb(cstr, read_byte_ram, wc); + if (wc > 255) wc |= 0x0080; + const uint8_t ch = uint8_t(wc & 0x00FF); add_character(ch); max_len--; } diff --git a/Marlin/src/lcd/tft/tft_string.h b/Marlin/src/lcd/tft/tft_string.h index 5940a48ac98b..d43e0b0df2b4 100644 --- a/Marlin/src/lcd/tft/tft_string.h +++ b/Marlin/src/lcd/tft/tft_string.h @@ -25,6 +25,8 @@ #include +#include "../fontutils.h" + extern const uint8_t ISO10646_1_5x7[]; extern const uint8_t font10x20[]; @@ -97,7 +99,7 @@ class TFT_String { * @param character The ASCII character */ static void add(const char character) { add_character(character); eol(); } - static void set(wchar_t character) { set(); add(character); } + static void set(const lchar_t &character) { set(); add(character); } /** * @brief Append / Set C-string diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index c9e069dbbd6f..bb0578576632 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -96,7 +96,7 @@ void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { lcd_gotopixel(int(col) * (TFT_COL_WIDTH), int(row) * MENU_LINE_HEIGHT); } -int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) { +int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) { if (max_length < 1) return 0; tft_string.set(c); tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); From a5b076dff727fba479fe00e97e9d9332953addb3 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 3 Jul 2022 08:08:40 -0700 Subject: [PATCH 408/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20MKS=20TinyBee=20AD?= =?UTF-8?q?C=20Vref=20(#24432)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 10e8fbc0c629..54be29234d60 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -115,7 +115,7 @@ // // ADC Reference Voltage // -#define ADC_REFERENCE_VOLTAGE 2.5 // 2.5V reference VDDA +#define ADC_REFERENCE_VOLTAGE 2.565 // 2.5V reference VDDA /** * ------ ------ From 5bf02e39a9159b0397a93f10571841f4d1bbc807 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 3 Jul 2022 09:08:43 -0700 Subject: [PATCH 409/502] =?UTF-8?q?=F0=9F=9A=B8=20MPCTEMP:=20Home=20before?= =?UTF-8?q?=20cooling=20(#24434)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index d9db3dce1cbd..acbc02fd3b52 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -918,13 +918,13 @@ volatile bool Temperature::raw_temps_ready = false; MPC_t &constants = hotend.constants; // Move to center of bed, just above bed height and cool with max fan + gcode.home_all_axes(true); disable_all_heaters(); #if HAS_FAN zero_fan_speeds(); set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); planner.sync_fan_speeds(fan_speed); #endif - gcode.home_all_axes(true); const xyz_pos_t tuningpos = MPC_TUNING_POS; do_blocking_move_to(tuningpos); From 8f84ce72e118478e582d45e97b7f7f0727e59522 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 8 Jul 2022 22:45:17 -0500 Subject: [PATCH 410/502] Fix SDIO for STM32 Followup to #24271 --- Marlin/src/HAL/STM32/sdio.cpp | 527 +++++++++++++++++++++++----------- 1 file changed, 355 insertions(+), 172 deletions(-) diff --git a/Marlin/src/HAL/STM32/sdio.cpp b/Marlin/src/HAL/STM32/sdio.cpp index e958d8c3bc48..433300671350 100644 --- a/Marlin/src/HAL/STM32/sdio.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -33,227 +33,410 @@ #include #include -// use local drivers #if defined(STM32F103xE) || defined(STM32F103xG) - #include + #include + #include #elif defined(STM32F4xx) - #include + #include + #include + #include + #include #elif defined(STM32F7xx) - #include + #include + #include + #include + #include #elif defined(STM32H7xx) - #include + #define SDIO_FOR_STM32H7 + #include + #include + #include + #include #else - #error "SDIO only supported with STM32F103xE, STM32F103xG, STM32F4xx, STM32F7xx, or STM32H7xx." + #error "SDIO is only supported with STM32F103xE, STM32F103xG, STM32F4xx, STM32F7xx, and STM32H7xx." #endif +// SDIO Max Clock (naming from STM Manual, don't change) +#define SDIOCLK 48000000 + // Target Clock, configurable. Default is 18MHz, from STM32F1 #ifndef SDIO_CLOCK #define SDIO_CLOCK 18000000 // 18 MHz #endif -#define SD_TIMEOUT 1000 // ms +SD_HandleTypeDef hsd; // SDIO structure -// SDIO Max Clock (naming from STM Manual, don't change) -#define SDIOCLK 48000000 +static uint32_t clock_to_divider(uint32_t clk) { + #ifdef SDIO_FOR_STM32H7 + // SDMMC_CK frequency = sdmmc_ker_ck / [2 * CLKDIV]. + uint32_t sdmmc_clk = HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SDMMC); + return sdmmc_clk / (2U * SDIO_CLOCK) + (sdmmc_clk % (2U * SDIO_CLOCK) != 0); + #else + // limit the SDIO master clock to 8/3 of PCLK2. See STM32 Manuals + // Also limited to no more than 48Mhz (SDIOCLK). + const uint32_t pclk2 = HAL_RCC_GetPCLK2Freq(); + clk = min(clk, (uint32_t)(pclk2 * 8 / 3)); + clk = min(clk, (uint32_t)SDIOCLK); + // Round up divider, so we don't run the card over the speed supported, + // and subtract by 2, because STM32 will add 2, as written in the manual: + // SDIO_CK frequency = SDIOCLK / [CLKDIV + 2] + return pclk2 / clk + (pclk2 % clk != 0) - 2; + #endif +} -#if defined(STM32F1xx) - DMA_HandleTypeDef hdma_sdio; - extern "C" void DMA2_Channel4_5_IRQHandler(void) { - HAL_DMA_IRQHandler(&hdma_sdio); - } -#elif defined(STM32F4xx) - DMA_HandleTypeDef hdma_sdio_rx; - DMA_HandleTypeDef hdma_sdio_tx; - extern "C" void DMA2_Stream3_IRQHandler(void) { - HAL_DMA_IRQHandler(&hdma_sdio_rx); +// Start the SDIO clock +void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { + UNUSED(hsd); + #ifdef SDIO_FOR_STM32H7 + pinmap_pinout(PC_12, PinMap_SD); + pinmap_pinout(PD_2, PinMap_SD); + pinmap_pinout(PC_8, PinMap_SD); + #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // Define D1-D3 only for 4-bit wide SDIO bus + pinmap_pinout(PC_9, PinMap_SD); + pinmap_pinout(PC_10, PinMap_SD); + pinmap_pinout(PC_11, PinMap_SD); + #endif + __HAL_RCC_SDMMC1_CLK_ENABLE(); + HAL_NVIC_EnableIRQ(SDMMC1_IRQn); + #else + __HAL_RCC_SDIO_CLK_ENABLE(); + #endif +} + +#ifdef SDIO_FOR_STM32H7 + + #define SD_TIMEOUT 1000 // ms + + extern "C" void SDMMC1_IRQHandler(void) { HAL_SD_IRQHandler(&hsd); } + + uint8_t waitingRxCplt = 0, waitingTxCplt = 0; + void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsdio) { waitingTxCplt = 0; } + void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsdio) { waitingRxCplt = 0; } + + void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd) { + __HAL_RCC_SDMMC1_FORCE_RESET(); delay(10); + __HAL_RCC_SDMMC1_RELEASE_RESET(); delay(10); } - extern "C" void DMA2_Stream6_IRQHandler(void) { - HAL_DMA_IRQHandler(&hdma_sdio_tx); + bool SDIO_Init() { + HAL_StatusTypeDef sd_state = HAL_OK; + if (hsd.Instance == SDMMC1) HAL_SD_DeInit(&hsd); + + // HAL SD initialization + hsd.Instance = SDMMC1; + hsd.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING; + hsd.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE; + hsd.Init.BusWide = SDMMC_BUS_WIDE_1B; + hsd.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE; + hsd.Init.ClockDiv = clock_to_divider(SDIO_CLOCK); + sd_state = HAL_SD_Init(&hsd); + + #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) + if (sd_state == HAL_OK) + sd_state = HAL_SD_ConfigWideBusOperation(&hsd, SDMMC_BUS_WIDE_4B); + #endif + + return (sd_state == HAL_OK); } -#elif defined(STM32H7xx) - #define __HAL_RCC_SDIO_FORCE_RESET __HAL_RCC_SDMMC1_FORCE_RESET - #define __HAL_RCC_SDIO_RELEASE_RESET __HAL_RCC_SDMMC1_RELEASE_RESET - #define __HAL_RCC_SDIO_CLK_ENABLE __HAL_RCC_SDMMC1_CLK_ENABLE - #define SDIO SDMMC1 - #define SDIO_IRQn SDMMC1_IRQn - #define SDIO_IRQHandler SDMMC1_IRQHandler - #define SDIO_CLOCK_EDGE_RISING SDMMC_CLOCK_EDGE_RISING - #define SDIO_CLOCK_POWER_SAVE_DISABLE SDMMC_CLOCK_POWER_SAVE_DISABLE - #define SDIO_BUS_WIDE_1B SDMMC_BUS_WIDE_1B - #define SDIO_BUS_WIDE_4B SDMMC_BUS_WIDE_4B - #define SDIO_HARDWARE_FLOW_CONTROL_DISABLE SDMMC_HARDWARE_FLOW_CONTROL_DISABLE -#endif -uint8_t waitingRxCplt = 0; -uint8_t waitingTxCplt = 0; -SD_HandleTypeDef hsd; +#else // !SDIO_FOR_STM32H7 -extern "C" void SDIO_IRQHandler(void) { - HAL_SD_IRQHandler(&hsd); -} + #define SD_TIMEOUT 500 // ms -void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsdio) { - waitingTxCplt = 0; -} + // SDIO retries, configurable. Default is 3, from STM32F1 + #ifndef SDIO_READ_RETRIES + #define SDIO_READ_RETRIES 3 + #endif -void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsdio) { - waitingRxCplt = 0; -} + // F4 supports one DMA for RX and another for TX, but Marlin will never + // do read and write at same time, so we use the same DMA for both. + DMA_HandleTypeDef hdma_sdio; -void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { - pinmap_pinout(PC_12, PinMap_SD); - pinmap_pinout(PD_2, PinMap_SD); - pinmap_pinout(PC_8, PinMap_SD); - #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // define D1-D3 only if have a four bit wide SDIO bus - // D1-D3 - pinmap_pinout(PC_9, PinMap_SD); - pinmap_pinout(PC_10, PinMap_SD); - pinmap_pinout(PC_11, PinMap_SD); + #ifdef STM32F1xx + #define DMA_IRQ_HANDLER DMA2_Channel4_5_IRQHandler + #elif defined(STM32F4xx) + #define DMA_IRQ_HANDLER DMA2_Stream3_IRQHandler + #else + #error "Unknown STM32 architecture." #endif - __HAL_RCC_SDIO_CLK_ENABLE(); - HAL_NVIC_EnableIRQ(SDIO_IRQn); + extern "C" void SDIO_IRQHandler(void) { HAL_SD_IRQHandler(&hsd); } + extern "C" void DMA_IRQ_HANDLER(void) { HAL_DMA_IRQHandler(&hdma_sdio); } + + /* + SDIO_INIT_CLK_DIV is 118 + SDIO clock frequency is 48MHz / (TRANSFER_CLOCK_DIV + 2) + SDIO init clock frequency should not exceed 400kHz = 48MHz / (118 + 2) + + Default TRANSFER_CLOCK_DIV is 2 (118 / 40) + Default SDIO clock frequency is 48MHz / (2 + 2) = 12 MHz + This might be too fast for stable SDIO operations + + MKS Robin SDIO seems stable with BusWide 1bit and ClockDiv 8 (i.e., 4.8MHz SDIO clock frequency) + More testing is required as there are clearly some 4bit init problems. + */ + + void go_to_transfer_speed() { + /* Default SDIO peripheral configuration for SD card initialization */ + hsd.Init.ClockEdge = hsd.Init.ClockEdge; + hsd.Init.ClockBypass = hsd.Init.ClockBypass; + hsd.Init.ClockPowerSave = hsd.Init.ClockPowerSave; + hsd.Init.BusWide = hsd.Init.BusWide; + hsd.Init.HardwareFlowControl = hsd.Init.HardwareFlowControl; + hsd.Init.ClockDiv = clock_to_divider(SDIO_CLOCK); + + /* Initialize SDIO peripheral interface with default configuration */ + SDIO_Init(hsd.Instance, hsd.Init); + } - // DMA Config - #if defined(STM32F1xx) - __HAL_RCC_DMA2_CLK_ENABLE(); - HAL_NVIC_EnableIRQ(DMA2_Channel4_5_IRQn); - hdma_sdio.Instance = DMA2_Channel4; - hdma_sdio.Init.Direction = DMA_PERIPH_TO_MEMORY; + void SD_LowLevel_Init() { + uint32_t tempreg; + + // Enable GPIO clocks + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + + GPIO_InitTypeDef GPIO_InitStruct; + + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = 1; // GPIO_NOPULL + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + + #if DISABLED(STM32F1xx) + GPIO_InitStruct.Alternate = GPIO_AF12_SDIO; + #endif + + GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_12; // D0 & SCK + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // define D1-D3 only if have a four bit wide SDIO bus + GPIO_InitStruct.Pin = GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11; // D1-D3 + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + #endif + + // Configure PD.02 CMD line + GPIO_InitStruct.Pin = GPIO_PIN_2; + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + + // Setup DMA + #ifdef STM32F1xx + hdma_sdio.Init.Mode = DMA_NORMAL; + hdma_sdio.Instance = DMA2_Channel4; + HAL_NVIC_EnableIRQ(DMA2_Channel4_5_IRQn); + #elif defined(STM32F4xx) + hdma_sdio.Init.Mode = DMA_PFCTRL; + hdma_sdio.Instance = DMA2_Stream3; + hdma_sdio.Init.Channel = DMA_CHANNEL_4; + hdma_sdio.Init.FIFOMode = DMA_FIFOMODE_ENABLE; + hdma_sdio.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; + hdma_sdio.Init.MemBurst = DMA_MBURST_INC4; + hdma_sdio.Init.PeriphBurst = DMA_PBURST_INC4; + HAL_NVIC_EnableIRQ(DMA2_Stream3_IRQn); + #endif + HAL_NVIC_EnableIRQ(SDIO_IRQn); hdma_sdio.Init.PeriphInc = DMA_PINC_DISABLE; hdma_sdio.Init.MemInc = DMA_MINC_ENABLE; hdma_sdio.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; hdma_sdio.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; - hdma_sdio.Init.Mode = DMA_NORMAL; hdma_sdio.Init.Priority = DMA_PRIORITY_LOW; - HAL_DMA_Init(&hdma_sdio); + __HAL_LINKDMA(&hsd, hdmarx, hdma_sdio); + __HAL_LINKDMA(&hsd, hdmatx, hdma_sdio); + + #ifdef STM32F1xx + __HAL_RCC_SDIO_CLK_ENABLE(); + __HAL_RCC_DMA2_CLK_ENABLE(); + #else + __HAL_RCC_SDIO_FORCE_RESET(); delay(2); + __HAL_RCC_SDIO_RELEASE_RESET(); delay(2); + __HAL_RCC_SDIO_CLK_ENABLE(); + + __HAL_RCC_DMA2_FORCE_RESET(); delay(2); + __HAL_RCC_DMA2_RELEASE_RESET(); delay(2); + __HAL_RCC_DMA2_CLK_ENABLE(); + #endif + + // Initialize the SDIO (with initial <400Khz Clock) + tempreg = 0 // Reset value + | SDIO_CLKCR_CLKEN // Clock enabled + | SDIO_INIT_CLK_DIV; // Clock Divider. Clock = 48000 / (118 + 2) = 400Khz + // Keep the rest at 0 => HW_Flow Disabled, Rising Clock Edge, Disable CLK ByPass, Bus Width = 0, Power save Disable + SDIO->CLKCR = tempreg; + + // Power up the SDIO + SDIO_PowerState_ON(SDIO); + hsd.Instance = SDIO; + } - __HAL_LINKDMA(hsd, hdmarx ,hdma_sdio); - __HAL_LINKDMA(hsd, hdmatx, hdma_sdio); - #elif defined(STM32F4xx) - __HAL_RCC_DMA2_CLK_ENABLE(); - HAL_NVIC_EnableIRQ(DMA2_Stream3_IRQn); - HAL_NVIC_EnableIRQ(DMA2_Stream6_IRQn); - hdma_sdio_rx.Instance = DMA2_Stream3; - hdma_sdio_rx.Init.Channel = DMA_CHANNEL_4; - hdma_sdio_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; - hdma_sdio_rx.Init.PeriphInc = DMA_PINC_DISABLE; - hdma_sdio_rx.Init.MemInc = DMA_MINC_ENABLE; - hdma_sdio_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; - hdma_sdio_rx.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; - hdma_sdio_rx.Init.Mode = DMA_PFCTRL; - hdma_sdio_rx.Init.Priority = DMA_PRIORITY_LOW; - hdma_sdio_rx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; - hdma_sdio_rx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; - hdma_sdio_rx.Init.MemBurst = DMA_MBURST_INC4; - hdma_sdio_rx.Init.PeriphBurst = DMA_PBURST_INC4; - HAL_DMA_Init(&hdma_sdio_rx); - - __HAL_LINKDMA(hsd,hdmarx,hdma_sdio_rx); - - hdma_sdio_tx.Instance = DMA2_Stream6; - hdma_sdio_tx.Init.Channel = DMA_CHANNEL_4; - hdma_sdio_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; - hdma_sdio_tx.Init.PeriphInc = DMA_PINC_DISABLE; - hdma_sdio_tx.Init.MemInc = DMA_MINC_ENABLE; - hdma_sdio_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD; - hdma_sdio_tx.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; - hdma_sdio_tx.Init.Mode = DMA_PFCTRL; - hdma_sdio_tx.Init.Priority = DMA_PRIORITY_LOW; - hdma_sdio_tx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; - hdma_sdio_tx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; - hdma_sdio_tx.Init.MemBurst = DMA_MBURST_INC4; - hdma_sdio_tx.Init.PeriphBurst = DMA_PBURST_INC4; - HAL_DMA_Init(&hdma_sdio_tx); - - __HAL_LINKDMA(hsd,hdmatx,hdma_sdio_tx); - #endif -} + bool SDIO_Init() { + uint8_t retryCnt = SDIO_READ_RETRIES; -void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd) { - #if !defined(STM32F1xx) - __HAL_RCC_SDIO_FORCE_RESET(); - delay(10); - __HAL_RCC_SDIO_RELEASE_RESET(); - delay(10); - #endif -} + bool status; + hsd.Instance = SDIO; + hsd.State = HAL_SD_STATE_RESET; -static uint32_t clock_to_divider(uint32_t clk) { - #if defined(STM32H7xx) - // SDMMC_CK frequency = sdmmc_ker_ck / [2 * CLKDIV]. - uint32_t sdmmc_clk = HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SDMMC); - return sdmmc_clk / (2U * SDIO_CLOCK) + (sdmmc_clk % (2U * SDIO_CLOCK) != 0); - #else - // limit the SDIO master clock to 8/3 of PCLK2. See STM32 Manuals - // Also limited to no more than 48Mhz (SDIOCLK). - const uint32_t pclk2 = HAL_RCC_GetPCLK2Freq(); - clk = min(clk, (uint32_t)(pclk2 * 8 / 3)); - clk = min(clk, (uint32_t)SDIOCLK); - // Round up divider, so we don't run the card over the speed supported, - // and subtract by 2, because STM32 will add 2, as written in the manual: - // SDIO_CK frequency = SDIOCLK / [CLKDIV + 2] - return pclk2 / clk + (pclk2 % clk != 0) - 2; - #endif -} + SD_LowLevel_Init(); -bool SDIO_Init() { - HAL_StatusTypeDef sd_state = HAL_OK; - if (hsd.Instance == SDIO) - HAL_SD_DeInit(&hsd); - - /* HAL SD initialization */ - hsd.Instance = SDIO; - hsd.Init.ClockEdge = SDIO_CLOCK_EDGE_RISING; - hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_DISABLE; - hsd.Init.BusWide = SDIO_BUS_WIDE_1B; - hsd.Init.HardwareFlowControl = SDIO_HARDWARE_FLOW_CONTROL_DISABLE; - hsd.Init.ClockDiv = clock_to_divider(SDIO_CLOCK); - sd_state = HAL_SD_Init(&hsd); - - #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) - if (sd_state == HAL_OK) { - sd_state = HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B); + uint8_t retry_Cnt = retryCnt; + for (;;) { + hal.watchdog_refresh(); + status = (bool) HAL_SD_Init(&hsd); + if (!status) break; + if (!--retry_Cnt) return false; // return failing status if retries are exhausted } - #endif - return (sd_state == HAL_OK) ? true : false; -} + go_to_transfer_speed(); + + #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined + retry_Cnt = retryCnt; + for (;;) { + hal.watchdog_refresh(); + if (!HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B)) break; // some cards are only 1 bit wide so a pass here is not required + if (!--retry_Cnt) break; + } + if (!retry_Cnt) { // wide bus failed, go back to one bit wide mode + hsd.State = (HAL_SD_StateTypeDef) 0; // HAL_SD_STATE_RESET + SD_LowLevel_Init(); + retry_Cnt = retryCnt; + for (;;) { + hal.watchdog_refresh(); + status = (bool) HAL_SD_Init(&hsd); + if (!status) break; + if (!--retry_Cnt) return false; // return failing status if retries are exhausted + } + go_to_transfer_speed(); + } + #endif + + return true; + } -bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { - uint32_t timeout = HAL_GetTick() + SD_TIMEOUT; + /** + * @brief Read or Write a block + * @details Read or Write a block with SDIO + * + * @param block The block index + * @param src The data buffer source for a write + * @param dst The data buffer destination for a read + * + * @return true on success + */ + static bool SDIO_ReadWriteBlock_DMA(uint32_t block, const uint8_t *src, uint8_t *dst) { + if (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) return false; + + hal.watchdog_refresh(); + + HAL_StatusTypeDef ret; + if (src) { + hdma_sdio.Init.Direction = DMA_MEMORY_TO_PERIPH; + HAL_DMA_Init(&hdma_sdio); + ret = HAL_SD_WriteBlocks_DMA(&hsd, (uint8_t*)src, block, 1); + } + else { + hdma_sdio.Init.Direction = DMA_PERIPH_TO_MEMORY; + HAL_DMA_Init(&hdma_sdio); + ret = HAL_SD_ReadBlocks_DMA(&hsd, (uint8_t*)dst, block, 1); + } - while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) { - if (HAL_GetTick() >= timeout) return false; + if (ret != HAL_OK) { + HAL_DMA_Abort_IT(&hdma_sdio); + HAL_DMA_DeInit(&hdma_sdio); + return false; + } + + millis_t timeout = millis() + SD_TIMEOUT; + // Wait the transfer + while (hsd.State != HAL_SD_STATE_READY) { + if (ELAPSED(millis(), timeout)) { + HAL_DMA_Abort_IT(&hdma_sdio); + HAL_DMA_DeInit(&hdma_sdio); + return false; + } + } + + while (__HAL_DMA_GET_FLAG(&hdma_sdio, __HAL_DMA_GET_TC_FLAG_INDEX(&hdma_sdio)) != 0 + || __HAL_DMA_GET_FLAG(&hdma_sdio, __HAL_DMA_GET_TE_FLAG_INDEX(&hdma_sdio)) != 0) { /* nada */ } + + HAL_DMA_Abort_IT(&hdma_sdio); + HAL_DMA_DeInit(&hdma_sdio); + + timeout = millis() + SD_TIMEOUT; + while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) if (ELAPSED(millis(), timeout)) return false; + + return true; } - waitingRxCplt = 1; - if (HAL_SD_ReadBlocks_DMA(&hsd, (uint8_t *)dst, block, 1) != HAL_OK) - return false; +#endif // !SDIO_FOR_STM32H7 + +/** + * @brief Read a block + * @details Read a block to media with SDIO + * + * @param block The block index + * @param src The block buffer + * + * @return true on success + */ +bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { + #ifdef SDIO_FOR_STM32H7 + + uint32_t timeout = HAL_GetTick() + SD_TIMEOUT; + + while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) + if (HAL_GetTick() >= timeout) return false; - timeout = HAL_GetTick() + SD_TIMEOUT; - while (waitingRxCplt) - if (HAL_GetTick() >= timeout) return false; + waitingRxCplt = 1; + if (HAL_SD_ReadBlocks_DMA(&hsd, (uint8_t*)dst, block, 1) != HAL_OK) + return false; + + timeout = HAL_GetTick() + SD_TIMEOUT; + while (waitingRxCplt) + if (HAL_GetTick() >= timeout) return false; + + return true; + + #else + + uint8_t retries = SDIO_READ_RETRIES; + while (retries--) if (SDIO_ReadWriteBlock_DMA(block, nullptr, dst)) return true; + return false; - return true; + #endif } +/** + * @brief Write a block + * @details Write a block to media with SDIO + * + * @param block The block index + * @param src The block data + * + * @return true on success + */ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { - uint32_t timeout = HAL_GetTick() + SD_TIMEOUT; + #ifdef SDIO_FOR_STM32H7 - while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) - if (HAL_GetTick() >= timeout) return false; + uint32_t timeout = HAL_GetTick() + SD_TIMEOUT; - waitingTxCplt = 1; - if (HAL_SD_WriteBlocks_DMA(&hsd, (uint8_t *)src, block, 1) != HAL_OK) - return false; + while (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) + if (HAL_GetTick() >= timeout) return false; + + waitingTxCplt = 1; + if (HAL_SD_WriteBlocks_DMA(&hsd, (uint8_t*)src, block, 1) != HAL_OK) + return false; - timeout = HAL_GetTick() + SD_TIMEOUT; - while (waitingTxCplt) - if (HAL_GetTick() >= timeout) return false; + timeout = HAL_GetTick() + SD_TIMEOUT; + while (waitingTxCplt) + if (HAL_GetTick() >= timeout) return false; - return true; + return true; + + #else + + uint8_t retries = SDIO_READ_RETRIES; + while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true; + return false; + + #endif } bool SDIO_IsReady() { From 686d1fbb510b5060d4a23baae67a8fda0374b65c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 13 Jul 2022 21:22:53 -0500 Subject: [PATCH 411/502] =?UTF-8?q?=F0=9F=8E=A8=20ANY=20=3D>=20EITHER?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 4 ++-- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 2 +- .../ftdi_eve_lib/basic/commands.cpp | 2 +- .../lcd/extui/ftdi_eve_touch_ui/theme/colors.h | 16 ++++++++-------- Marlin/src/libs/nozzle.cpp | 2 +- Marlin/src/module/probe.cpp | 2 +- Marlin/src/module/temperature.cpp | 10 +++++----- Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 2 +- Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 2 +- Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 2 +- Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h | 2 +- Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h | 2 +- Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h | 2 +- Marlin/src/pins/rambo/pins_RAMBO.h | 2 +- Marlin/src/pins/rambo/pins_SCOOVO_X9H.h | 2 +- Marlin/src/pins/ramps/pins_AZTEEG_X3.h | 2 +- Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h | 4 ++-- Marlin/src/pins/ramps/pins_MKS_GEN_13.h | 2 +- Marlin/src/pins/ramps/pins_RAMPS.h | 2 +- Marlin/src/pins/ramps/pins_TRIGORILLA_14.h | 2 +- Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h | 2 +- Marlin/src/pins/sam/pins_RAMPS_FD_V1.h | 2 +- Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h | 2 +- Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h | 2 +- Marlin/src/pins/samd/pins_RAMPS_144.h | 2 +- Marlin/src/pins/stm32f1/pins_BEAST.h | 2 +- Marlin/src/pins/stm32f1/pins_CHITU3D.h | 2 +- Marlin/src/pins/stm32f1/pins_STM32F1R.h | 2 +- Marlin/src/pins/stm32f1/pins_STM3R_MINI.h | 2 +- Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h | 2 +- Marlin/src/pins/teensy2/pins_PRINTRBOARD.h | 2 +- Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h | 2 +- 33 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 53e68c5ab1f9..e54c059c6a6e 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -461,7 +461,7 @@ #define HAS_DGUS_LCD_CLASSIC 1 #endif -#if ANY(HAS_DGUS_LCD_CLASSIC, DGUS_LCD_UI_RELOADED) +#if EITHER(HAS_DGUS_LCD_CLASSIC, DGUS_LCD_UI_RELOADED) #define HAS_DGUS_LCD 1 #endif @@ -1353,7 +1353,7 @@ #define TFT_DEFAULT_ORIENTATION 0 #define TFT_RES_480x272 #define TFT_INTERFACE_FSMC -#elif ANY(MKS_ROBIN_TFT_V1_1R, LONGER_LK_TFT28) // ILI9328 or R61505 +#elif EITHER(MKS_ROBIN_TFT_V1_1R, LONGER_LK_TFT28) // ILI9328 or R61505 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index dd6b165328fe..e581bb47c065 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -48,7 +48,7 @@ // Set additional flags to let HALs choose in their Conditionals_post.h #if ANY(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION, QSPI_EEPROM) #define USE_EMULATED_EEPROM 1 - #elif ANY(I2C_EEPROM, SPI_EEPROM) + #elif EITHER(I2C_EEPROM, SPI_EEPROM) #define USE_WIRED_EEPROM 1 #elif ENABLED(IIC_BL24CXX_EEPROM) // nothing diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 455fce272a1c..ab21c7be4a9c 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -565,7 +565,7 @@ void MarlinUI::draw_status_message(const bool blink) { #endif // AUTO_BED_LEVELING_UBL - #if ANY(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) + #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) void MarlinUI::zoffset_overlay(const int8_t dir) { const int rot_up = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCCW, ICON_RotateCW), diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp index a796c8edcf5f..662753a1547c 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp @@ -1208,7 +1208,7 @@ void CLCD::default_display_orientation() { + ENABLED(TOUCH_UI_INVERTED) * 1 ); cmd.execute(); - #elif ANY(TOUCH_UI_PORTRAIT, TOUCH_UI_MIRRORED) + #elif EITHER(TOUCH_UI_PORTRAIT, TOUCH_UI_MIRRORED) #error "PORTRAIT or MIRRORED orientation not supported on the FT800." #elif ENABLED(TOUCH_UI_INVERTED) mem_write_32(REG::ROTATE, 1); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/colors.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/colors.h index 995379fcdab7..70c2be4ec23f 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/colors.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/colors.h @@ -37,14 +37,14 @@ namespace Theme { #else // Use linear accent colors - #if ANY(TOUCH_UI_ROYAL_THEME, TOUCH_UI_FROZEN_THEME) - // Dark blue accent colors - constexpr int accent_hue = 216; - constexpr float accent_sat = 0.7; + #if EITHER(TOUCH_UI_ROYAL_THEME, TOUCH_UI_FROZEN_THEME) + // Dark blue accent colors + constexpr int accent_hue = 216; + constexpr float accent_sat = 0.7; #else - // Green accent colors - constexpr int accent_hue = 68; - constexpr float accent_sat = 0.68; + // Green accent colors + constexpr int accent_hue = 68; + constexpr float accent_sat = 0.68; #endif // Shades of accent color @@ -88,7 +88,7 @@ namespace Theme { constexpr uint32_t bed_mesh_lines_rgb = 0xFFFFFF; constexpr uint32_t bed_mesh_shadow_rgb = 0x444444; - #elif ANY(TOUCH_UI_COCOA_THEME, TOUCH_UI_FROZEN_THEME) + #elif EITHER(TOUCH_UI_COCOA_THEME, TOUCH_UI_FROZEN_THEME) constexpr uint32_t theme_darkest = accent_color_1; constexpr uint32_t theme_dark = accent_color_4; diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index 4ca8fa2cae1e..575e74a81472 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -161,7 +161,7 @@ Nozzle nozzle; void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const_float_t radius, const uint8_t &objects, const uint8_t cleans) { xyz_pos_t start[HOTENDS] = NOZZLE_CLEAN_START_POINT, end[HOTENDS] = NOZZLE_CLEAN_END_POINT, middle[HOTENDS] = NOZZLE_CLEAN_CIRCLE_MIDDLE; - const uint8_t arrPos = ANY(SINGLENOZZLE, MIXING_EXTRUDER) ? 0 : active_extruder; + const uint8_t arrPos = EITHER(SINGLENOZZLE, MIXING_EXTRUDER) ? 0 : active_extruder; #if NOZZLE_CLEAN_MIN_TEMP > 20 if (thermalManager.degTargetHotend(arrPos) < NOZZLE_CLEAN_MIN_TEMP) { diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 519a94d73833..89bd8b8042c1 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -48,7 +48,7 @@ #include "delta.h" #endif -#if ANY(HAS_QUIET_PROBING, USE_SENSORLESS) +#if EITHER(HAS_QUIET_PROBING, USE_SENSORLESS) #include "stepper/indirection.h" #if BOTH(HAS_QUIET_PROBING, PROBING_ESTEPPERS_OFF) #include "stepper.h" diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index acbc02fd3b52..435c98d56aa5 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -904,7 +904,7 @@ volatile bool Temperature::raw_temps_ready = false; temp_hotend[active_extruder].target = 0.0f; temp_hotend[active_extruder].soft_pwm_amount = 0; #if HAS_FAN - set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); + set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); planner.sync_fan_speeds(fan_speed); #endif @@ -922,7 +922,7 @@ volatile bool Temperature::raw_temps_ready = false; disable_all_heaters(); #if HAS_FAN zero_fan_speeds(); - set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); + set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); planner.sync_fan_speeds(fan_speed); #endif const xyz_pos_t tuningpos = MPC_TUNING_POS; @@ -949,7 +949,7 @@ volatile bool Temperature::raw_temps_ready = false; } #if HAS_FAN - set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); + set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); planner.sync_fan_speeds(fan_speed); #endif @@ -1031,7 +1031,7 @@ volatile bool Temperature::raw_temps_ready = false; total_energy_fan0 += constants.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * constants.block_heat_capacity; #if HAS_FAN else if (ELAPSED(ms, test_end_ms) && !fan0_done) { - set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); + set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); planner.sync_fan_speeds(fan_speed); settle_end_ms = ms + settle_time; test_end_ms = settle_end_ms + test_duration; @@ -1433,7 +1433,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { float ambient_xfer_coeff = constants.ambient_xfer_coeff_fan0; #if ENABLED(MPC_INCLUDE_FAN) - const uint8_t fan_index = ANY(MPC_FAN_0_ACTIVE_HOTEND, MPC_FAN_0_ALL_HOTENDS) ? 0 : ee; + const uint8_t fan_index = EITHER(MPC_FAN_0_ACTIVE_HOTEND, MPC_FAN_0_ALL_HOTENDS) ? 0 : ee; const float fan_fraction = TERN_(MPC_FAN_0_ACTIVE_HOTEND, !this_hotend ? 0.0f : ) fan_speed[fan_index] * RECIPROCAL(255); ambient_xfer_coeff += fan_fraction * constants.fan255_adjustment; #endif diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index 7953f678fa48..9e2eedd68e80 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -582,7 +582,7 @@ #define LCD_SDSS SDSS #define SD_DETECT_PIN 49 - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #define DOGLCD_CS 45 #define DOGLCD_A0 44 diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index 7f9e530f3c72..cf12a98aef28 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -238,7 +238,7 @@ #define LCD_SDSS P0_28 // EXP2.4 #define LCD_PINS_ENABLE P0_18 // EXP1.3 #define LCD_PINS_D4 P0_15 // EXP1.5 - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define DOGLCD_SCK SD_SCK_PIN #define DOGLCD_MOSI SD_MOSI_PIN #endif diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index b08ac536b3d0..0ebdb538849b 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -349,7 +349,7 @@ //#define SHIFT_EN_PIN P1_22 // (41) J5-4 & AUX-4 #endif - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define DOGLCD_CS P0_16 // (16) #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 #define DOGLCD_SCK SD_SCK_PIN diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h index 7ce78ad2832d..bc7cada8da05 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h @@ -107,7 +107,7 @@ // Display // -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN P1_31 #define DOGLCD_A0 P2_06 #define DOGLCD_CS P0_16 diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h index 4fbc19eed843..c33fe6e28f45 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h @@ -154,7 +154,7 @@ //#define SHIFT_EN_PIN P1_22 // (41) J5-4 & AUX-4 #endif - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN P1_30 // (37) may change if cable changes #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2 #define DOGLCD_SCK SD_SCK_PIN diff --git a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h index e80116efd036..cfaca164f89e 100644 --- a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h @@ -91,7 +91,7 @@ // // LCD / Controller // -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN P1_31 #define DOGLCD_A0 P2_11 diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index 5484b193b93b..cb7a05913414 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -208,7 +208,7 @@ #define LCD_PINS_D6 74 #define LCD_PINS_D7 75 - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN 44 // NB: Panucatt's Viki 2.0 wiring diagram (v1.2) indicates that the // beeper/buzzer is connected to pin 33; however, the pin used in the diff --git a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h index 4c2645e64b2a..533284a4bf5e 100644 --- a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h +++ b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h @@ -143,7 +143,7 @@ #define HOME_PIN BTN_HOME -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN 44 // Pins for DOGM SPI LCD Support #define DOGLCD_A0 70 diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h index ee8cafa89766..a6b52da8a25f 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h @@ -51,7 +51,7 @@ #undef STAT_LED_RED_PIN #undef STAT_LED_BLUE_PIN -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) #undef DOGLCD_A0 #undef DOGLCD_CS diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h index e3baea76e4de..2159bb87b902 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h @@ -142,7 +142,7 @@ #undef BEEPER_PIN #define BEEPER_PIN 33 -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) #undef SD_DETECT_PIN #define SD_DETECT_PIN 49 // For easy adapter board #undef BEEPER_PIN @@ -169,7 +169,7 @@ #undef SPINDLE_DIR_PIN #if HAS_CUTTER // EXP2 header - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define BTN_EN2 31 // Pin 7 needed for Spindle PWM #endif #define SPINDLE_LASER_PWM_PIN 7 // Hardware PWM diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h index 5f373f99d74b..f000b5db072d 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h @@ -60,7 +60,7 @@ // // LCD / Controller // -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) /** * VIKI2 Has two groups of wires with... * diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 4ab7f4007331..991b9334b670 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -698,7 +698,7 @@ #define LCD_SDSS SDSS #define SD_DETECT_PIN EXP2_04_PIN - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #define DOGLCD_CS AUX4_05_PIN #define DOGLCD_A0 AUX2_07_PIN diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h index 994a54297f7c..b685ff0094d0 100644 --- a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h +++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h @@ -128,7 +128,7 @@ // LCD Display input pins #if IS_NEWPANEL - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #undef DOGLCD_A0 #define DOGLCD_A0 23 #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h index 37060ab94541..146c519ff962 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h @@ -163,7 +163,7 @@ // // LCD / Controller // -#if ANY(BOARD_REV_1_0, BOARD_REV_1_1_TO_1_3) +#if EITHER(BOARD_REV_1_0, BOARD_REV_1_1_TO_1_3) #define LCD_PINS_RS 24 #define LCD_PINS_ENABLE 22 diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index 980a957a505a..4cb0f60328ca 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -217,7 +217,7 @@ #endif - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define DOGLCD_A0 EXP1_04_PIN #define KILL_PIN 51 #define STAT_LED_BLUE_PIN EXP1_08_PIN diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h index 382c607d239b..264b2e80c6bc 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h @@ -373,7 +373,7 @@ //#define LCD_SDSS SDSS //#define SD_DETECT_PIN EXP2_01_PIN - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) // TO TEST //#define DOGLCD_CS 45 diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h index 0f4bb1d0b591..e90be4eda1ec 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h @@ -424,7 +424,7 @@ //#define LCD_SDSS SDSS //#define SD_DETECT_PIN EXP2_01_PIN - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) // TO TEST //#define DOGLCD_CS 45 diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index 406162c0896e..2c42506a5f4d 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -408,7 +408,7 @@ //#define LCD_SDSS SDSS //#define SD_DETECT_PIN 49 - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) // TO TEST //#define DOGLCD_CS 45 diff --git a/Marlin/src/pins/stm32f1/pins_BEAST.h b/Marlin/src/pins/stm32f1/pins_BEAST.h index d494b29c1448..4dafe2f27365 100644 --- a/Marlin/src/pins/stm32f1/pins_BEAST.h +++ b/Marlin/src/pins/stm32f1/pins_BEAST.h @@ -131,7 +131,7 @@ #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) #error "LCD_I2C_VIKI is not supported." - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index 1f56e59a23c5..3b66096a270d 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -171,7 +171,7 @@ #define LCD_SDSS PD5 // 53 #define SD_DETECT_PIN PD1 // 49 - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #define BEEPER_PIN PC1 // 33 diff --git a/Marlin/src/pins/stm32f1/pins_STM32F1R.h b/Marlin/src/pins/stm32f1/pins_STM32F1R.h index c08b707d7e99..634cadc1aa8e 100644 --- a/Marlin/src/pins/stm32f1/pins_STM32F1R.h +++ b/Marlin/src/pins/stm32f1/pins_STM32F1R.h @@ -120,7 +120,7 @@ #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) #error "LCD_I2C_VIKI is not supported." - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index e189fc3f97b9..eee7dbf31669 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -144,7 +144,7 @@ #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) #error "LCD_I2C_VIKI is not supported." - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h index 736c79b6e034..4c05f41dc67e 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h @@ -283,7 +283,7 @@ #endif #endif -#if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI) +#if EITHER(TFT_COLOR_UI, TFT_CLASSIC_UI) #define TFT_CS_PIN EXP1_04_PIN #define TFT_SCK_PIN EXP2_09_PIN #define TFT_MISO_PIN EXP2_10_PIN diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h index 82d9cec8949b..ddf0d53ea60a 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h @@ -130,7 +130,7 @@ #define LCD_PINS_D6 5 // D5 JP11-6 #define LCD_PINS_D7 4 // D4 JP11-5 - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN 8 // E0 JP11-10 #define DOGLCD_A0 40 // F2 JP2-2 diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h index 1ac953c89f8b..18673980870f 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h @@ -207,7 +207,7 @@ #define LCD_PINS_D6 5 // D5 JP11-6 #define LCD_PINS_D7 4 // D4 JP11-5 - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN 8 // E0 JP11-10 #define DOGLCD_A0 40 // F2 JP2-2 From adeca472922700cc63a0d0e1324c5b0cf91be68c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2022 21:03:11 -0500 Subject: [PATCH 412/502] =?UTF-8?q?=F0=9F=94=A8=20Fix=20Warnings.cpp=20for?= =?UTF-8?q?ce-recompile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/preflight-checks.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index dbd0510b5dff..50b3ed88c7bc 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -81,10 +81,12 @@ def sanity_check_target(): # # Give warnings on every build # - srcpath = os.path.join(env['PROJECT_BUILD_DIR'], build_env, "src", "src") - warnfile = os.path.join(srcpath, "inc", "Warnings.cpp.o") - if os.path.exists(warnfile): - os.remove(warnfile) + build_dir = os.path.join(env['PROJECT_BUILD_DIR'], build_env); + for outdir in [ build_dir, os.path.join(build_dir, "debug") ]: + for wext in [ ".cpp", "" ]: + warnfile = os.path.join(outdir, "src", "src", "inc", "Warnings" + wext + ".o") + if os.path.exists(warnfile): + os.remove(warnfile) # # Rebuild 'settings.cpp' for EEPROM_INIT_NOW From 495002e158e289ee7c90663aaa0aeb61942cb28d Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Sat, 23 Jul 2022 05:32:28 +0100 Subject: [PATCH 413/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=202d=20mesh=20print?= =?UTF-8?q?=20(#24536)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/bedlevel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 1ca9696a3a30..2207884c3637 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -154,7 +154,7 @@ void reset_bed_level() { #endif LOOP_L_N(x, sx) { SERIAL_CHAR(' '); - const float offset = values[x * sx + y]; + const float offset = values[x * sy + y]; if (!isnan(offset)) { if (offset >= 0) SERIAL_CHAR('+'); SERIAL_ECHO_F(offset, int(precision)); From 5e0a39265ac82952a0ec73144de6f9d2497b6b48 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 23 Jul 2022 19:14:57 -0500 Subject: [PATCH 414/502] =?UTF-8?q?=F0=9F=8E=A8=20Clean=20up=20extra=20axe?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #24120 --- Marlin/src/inc/Conditionals_LCD.h | 42 ------------------------------- 1 file changed, 42 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index e54c059c6a6e..b31395493cca 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -811,48 +811,6 @@ #undef MANUAL_K_HOME_POS #endif -#if !HAS_U_AXIS - #undef ENDSTOPPULLUP_UMIN - #undef ENDSTOPPULLUP_UMAX - #undef U_MIN_ENDSTOP_INVERTING - #undef U_MAX_ENDSTOP_INVERTING - #undef U_ENABLE_ON - #undef DISABLE_U - #undef INVERT_U_DIR - #undef U_HOME_DIR - #undef U_MIN_POS - #undef U_MAX_POS - #undef MANUAL_U_HOME_POS -#endif - -#if !HAS_V_AXIS - #undef ENDSTOPPULLUP_VMIN - #undef ENDSTOPPULLUP_VMAX - #undef V_MIN_ENDSTOP_INVERTING - #undef V_MAX_ENDSTOP_INVERTING - #undef V_ENABLE_ON - #undef DISABLE_V - #undef INVERT_V_DIR - #undef V_HOME_DIR - #undef V_MIN_POS - #undef V_MAX_POS - #undef MANUAL_V_HOME_POS -#endif - -#if !HAS_W_AXIS - #undef ENDSTOPPULLUP_WMIN - #undef ENDSTOPPULLUP_WMAX - #undef W_MIN_ENDSTOP_INVERTING - #undef W_MAX_ENDSTOP_INVERTING - #undef W_ENABLE_ON - #undef DISABLE_W - #undef INVERT_W_DIR - #undef W_HOME_DIR - #undef W_MIN_POS - #undef W_MAX_POS - #undef MANUAL_W_HOME_POS -#endif - #ifdef X2_DRIVER_TYPE #define HAS_X2_STEPPER 1 // Dual X Carriage isn't known yet. TODO: Consider moving it to Configuration.h. From 2bf6573098687b203ee1f3adf3f66b7a3e05163b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 9 Jul 2022 11:08:53 -0500 Subject: [PATCH 415/502] =?UTF-8?q?=F0=9F=90=9B=20Fix=20SDIO=20for=20STM32?= =?UTF-8?q?=20(#24470)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #24271 --- Marlin/src/HAL/STM32/sdio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/STM32/sdio.cpp b/Marlin/src/HAL/STM32/sdio.cpp index 433300671350..41fe90b82540 100644 --- a/Marlin/src/HAL/STM32/sdio.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -369,7 +369,7 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { /** * @brief Read a block - * @details Read a block to media with SDIO + * @details Read a block from media with SDIO * * @param block The block index * @param src The block buffer From 1ffc4ba861cce00457c4ce79503eacac58297c29 Mon Sep 17 00:00:00 2001 From: DerAndere <26200979+DerAndere1@users.noreply.github.com> Date: Mon, 18 Apr 2022 06:03:39 +0200 Subject: [PATCH 416/502] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20some=20parameters?= =?UTF-8?q?=20w/out=20values=20(#24051)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/utility.h | 1 + Marlin/src/gcode/calibrate/M666.cpp | 2 +- Marlin/src/gcode/config/M281.cpp | 4 ++-- Marlin/src/gcode/config/M304.cpp | 6 +++--- Marlin/src/gcode/config/M305.cpp | 8 ++++---- Marlin/src/gcode/control/M17_M18_M84.cpp | 20 ++++---------------- Marlin/src/gcode/control/M280.cpp | 2 +- Marlin/src/gcode/control/M3-M5.cpp | 2 +- Marlin/src/gcode/control/M350_M351.cpp | 6 +++--- Marlin/src/gcode/control/M605.cpp | 6 +++--- Marlin/src/gcode/feature/cancel/M486.cpp | 6 +++--- Marlin/src/gcode/feature/i2c/M260_M261.cpp | 6 +++--- Marlin/src/gcode/feature/pause/G61.cpp | 2 +- Marlin/src/gcode/feature/pause/M603.cpp | 4 ++-- Marlin/src/gcode/feature/pause/M701_M702.cpp | 4 ++-- Marlin/src/gcode/feature/runout/M412.cpp | 2 +- Marlin/src/gcode/geometry/M206_M428.cpp | 9 ++++----- 17 files changed, 39 insertions(+), 51 deletions(-) diff --git a/Marlin/src/core/utility.h b/Marlin/src/core/utility.h index d248091ce575..91c9533ab070 100644 --- a/Marlin/src/core/utility.h +++ b/Marlin/src/core/utility.h @@ -78,6 +78,7 @@ class restorer { constexpr uint8_t ui8_to_percent(const uint8_t i) { return (int(i) * 100 + 127) / 255; } const xyze_char_t axis_codes LOGICAL_AXIS_ARRAY('E', 'X', 'Y', 'Z', AXIS4_NAME, AXIS5_NAME, AXIS6_NAME); +const xyze_char_t iaxis_codes LOGICAL_AXIS_ARRAY('E', 'X', 'Y', 'Z', 'I', 'J', 'K'); #if LINEAR_AXES <= XYZ #define AXIS_CHAR(A) ((char)('X' + A)) diff --git a/Marlin/src/gcode/calibrate/M666.cpp b/Marlin/src/gcode/calibrate/M666.cpp index aa8ba26bb6b2..37d8a8facf59 100644 --- a/Marlin/src/gcode/calibrate/M666.cpp +++ b/Marlin/src/gcode/calibrate/M666.cpp @@ -45,7 +45,7 @@ DEBUG_SECTION(log_M666, "M666", DEBUGGING(LEVELING)); bool is_err = false, is_set = false; LOOP_LINEAR_AXES(i) { - if (parser.seen(AXIS_CHAR(i))) { + if (parser.seenval(AXIS_CHAR(i))) { is_set = true; const float v = parser.value_linear_units(); if (v > 0) diff --git a/Marlin/src/gcode/config/M281.cpp b/Marlin/src/gcode/config/M281.cpp index b90de6be30f9..e4ef3ab40b8c 100644 --- a/Marlin/src/gcode/config/M281.cpp +++ b/Marlin/src/gcode/config/M281.cpp @@ -47,8 +47,8 @@ void GcodeSuite::M281() { return; } #endif - if (parser.seen('L')) servo_angles[servo_index][0] = parser.value_int(); - if (parser.seen('U')) servo_angles[servo_index][1] = parser.value_int(); + if (parser.seenval('L')) servo_angles[servo_index][0] = parser.value_int(); + if (parser.seenval('U')) servo_angles[servo_index][1] = parser.value_int(); } else SERIAL_ERROR_MSG("Servo ", servo_index, " out of range"); diff --git a/Marlin/src/gcode/config/M304.cpp b/Marlin/src/gcode/config/M304.cpp index 97dc4be25e1c..c970288238f5 100644 --- a/Marlin/src/gcode/config/M304.cpp +++ b/Marlin/src/gcode/config/M304.cpp @@ -36,9 +36,9 @@ */ void GcodeSuite::M304() { if (!parser.seen("PID")) return M304_report(); - if (parser.seen('P')) thermalManager.temp_bed.pid.Kp = parser.value_float(); - if (parser.seen('I')) thermalManager.temp_bed.pid.Ki = scalePID_i(parser.value_float()); - if (parser.seen('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float()); + if (parser.seenval('P')) thermalManager.temp_bed.pid.Kp = parser.value_float(); + if (parser.seenval('I')) thermalManager.temp_bed.pid.Ki = scalePID_i(parser.value_float()); + if (parser.seenval('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float()); } void GcodeSuite::M304_report(const bool forReplay/*=true*/) { diff --git a/Marlin/src/gcode/config/M305.cpp b/Marlin/src/gcode/config/M305.cpp index 6957eef050dd..e7746923b318 100644 --- a/Marlin/src/gcode/config/M305.cpp +++ b/Marlin/src/gcode/config/M305.cpp @@ -52,19 +52,19 @@ void GcodeSuite::M305() { if (t_index >= (USER_THERMISTORS) || (do_set && t_index < 0)) SERIAL_ECHO_MSG("!Invalid index. (0 <= P <= ", USER_THERMISTORS - 1, ")"); else if (do_set) { - if (parser.seen('R')) // Pullup resistor value + if (parser.seenval('R')) // Pullup resistor value if (!thermalManager.set_pull_up_res(t_index, parser.value_float())) SERIAL_ECHO_MSG("!Invalid series resistance. (0 < R < 1000000)"); - if (parser.seen('T')) // Resistance at 25C + if (parser.seenval('T')) // Resistance at 25C if (!thermalManager.set_res25(t_index, parser.value_float())) SERIAL_ECHO_MSG("!Invalid 25C resistance. (0 < T < 10000000)"); - if (parser.seen('B')) // Beta value + if (parser.seenval('B')) // Beta value if (!thermalManager.set_beta(t_index, parser.value_float())) SERIAL_ECHO_MSG("!Invalid beta. (0 < B < 1000000)"); - if (parser.seen('C')) // Steinhart-Hart C coefficient + if (parser.seenval('C')) // Steinhart-Hart C coefficient if (!thermalManager.set_sh_coeff(t_index, parser.value_float())) SERIAL_ECHO_MSG("!Invalid Steinhart-Hart C coeff. (-0.01 < C < +0.01)"); } // If not setting then report parameters diff --git a/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin/src/gcode/control/M17_M18_M84.cpp index ac3a602687a9..7630dcff46c2 100644 --- a/Marlin/src/gcode/control/M17_M18_M84.cpp +++ b/Marlin/src/gcode/control/M17_M18_M84.cpp @@ -125,14 +125,8 @@ void GcodeSuite::M17() { stepper.enable_e_steppers(); } #endif - LINEAR_AXIS_CODE( - if (parser.seen_test('X')) stepper.enable_axis(X_AXIS), - if (parser.seen_test('Y')) stepper.enable_axis(Y_AXIS), - if (parser.seen_test('Z')) stepper.enable_axis(Z_AXIS), - if (parser.seen_test(AXIS4_NAME)) stepper.enable_axis(I_AXIS), - if (parser.seen_test(AXIS5_NAME)) stepper.enable_axis(J_AXIS), - if (parser.seen_test(AXIS6_NAME)) stepper.enable_axis(K_AXIS) - ); + LOOP_LINEAR_AXES(a) + if (parser.seen_test(AXIS_CHAR(a))) stepper.enable_axis((AxisEnum)a); } } else { @@ -238,14 +232,8 @@ void GcodeSuite::M18_M84() { stepper.disable_e_steppers(); } #endif - LINEAR_AXIS_CODE( - if (parser.seen_test('X')) stepper.disable_axis(X_AXIS), - if (parser.seen_test('Y')) stepper.disable_axis(Y_AXIS), - if (parser.seen_test('Z')) stepper.disable_axis(Z_AXIS), - if (parser.seen_test(AXIS4_NAME)) stepper.disable_axis(I_AXIS), - if (parser.seen_test(AXIS5_NAME)) stepper.disable_axis(J_AXIS), - if (parser.seen_test(AXIS6_NAME)) stepper.disable_axis(K_AXIS) - ); + LOOP_LINEAR_AXES(a) + if (parser.seen_test(AXIS_CHAR(a))) stepper.disable_axis((AxisEnum)a); } } else diff --git a/Marlin/src/gcode/control/M280.cpp b/Marlin/src/gcode/control/M280.cpp index 930542999ee2..82981e44bcee 100644 --- a/Marlin/src/gcode/control/M280.cpp +++ b/Marlin/src/gcode/control/M280.cpp @@ -48,7 +48,7 @@ void GcodeSuite::M280() { const int anew = parser.value_int(); if (anew >= 0) { #if ENABLED(POLARGRAPH) - if (parser.seen('T')) { // (ms) Total duration of servo move + if (parser.seenval('T')) { // (ms) Total duration of servo move const int16_t t = constrain(parser.value_int(), 0, 10000); const int aold = servo[servo_index].read(); millis_t now = millis(); diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index a619b1b76208..817ed4fcb4d9 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -93,7 +93,7 @@ void GcodeSuite::M3_M4(const bool is_M4) { // Laser power in inline mode cutter.inline_direction(is_M4); // Should always be unused #if ENABLED(SPINDLE_LASER_USE_PWM) - if (parser.seen('O')) { + if (parser.seenval('O')) { cutter.unitPower = cutter.power_to_range(parser.value_byte(), 0); cutter.inline_ocr_power(cutter.unitPower); // The OCR is a value from 0 to 255 (uint8_t) } diff --git a/Marlin/src/gcode/control/M350_M351.cpp b/Marlin/src/gcode/control/M350_M351.cpp index a92238e4bbf2..d0ab75bb00a5 100644 --- a/Marlin/src/gcode/control/M350_M351.cpp +++ b/Marlin/src/gcode/control/M350_M351.cpp @@ -33,9 +33,9 @@ * Warning: Steps-per-unit remains unchanged. */ void GcodeSuite::M350() { - if (parser.seen('S')) LOOP_LE_N(i, 4) stepper.microstep_mode(i, parser.value_byte()); - LOOP_LOGICAL_AXES(i) if (parser.seen(axis_codes[i])) stepper.microstep_mode(i, parser.value_byte()); - if (parser.seen('B')) stepper.microstep_mode(4, parser.value_byte()); + if (parser.seen('S')) LOOP_DISTINCT_AXES(i) stepper.microstep_mode(i, parser.value_byte()); + LOOP_LOGICAL_AXES(i) if (parser.seenval(AXIS_CHAR(i))) stepper.microstep_mode(i, parser.value_byte()); + if (parser.seenval('B')) stepper.microstep_mode(E_AXIS + 1, parser.value_byte()); stepper.microstep_readings(); } diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index 788659e7e27a..c327b977eea0 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -64,7 +64,7 @@ void GcodeSuite::M605() { planner.synchronize(); - if (parser.seen('S')) { + if (parser.seenval('S')) { const DualXMode previous_mode = dual_x_carriage_mode; dual_x_carriage_mode = (DualXMode)parser.value_byte(); @@ -78,8 +78,8 @@ case DXC_DUPLICATION_MODE: // Set the X offset, but no less than the safety gap - if (parser.seen('X')) duplicate_extruder_x_offset = _MAX(parser.value_linear_units(), (X2_MIN_POS) - (X1_MIN_POS)); - if (parser.seen('R')) duplicate_extruder_temp_offset = parser.value_celsius_diff(); + if (parser.seenval('X')) duplicate_extruder_x_offset = _MAX(parser.value_linear_units(), (X2_MIN_POS) - (X1_MIN_POS)); + if (parser.seenval('R')) duplicate_extruder_temp_offset = parser.value_celsius_diff(); // Always switch back to tool 0 if (active_extruder != 0) tool_change(0); break; diff --git a/Marlin/src/gcode/feature/cancel/M486.cpp b/Marlin/src/gcode/feature/cancel/M486.cpp index 1f14ae0fd26c..c1e90d1b9610 100644 --- a/Marlin/src/gcode/feature/cancel/M486.cpp +++ b/Marlin/src/gcode/feature/cancel/M486.cpp @@ -44,14 +44,14 @@ void GcodeSuite::M486() { cancelable.object_count = parser.intval('T', 1); } - if (parser.seen('S')) + if (parser.seenval('S')) cancelable.set_active_object(parser.value_int()); if (parser.seen('C')) cancelable.cancel_active_object(); - if (parser.seen('P')) cancelable.cancel_object(parser.value_int()); + if (parser.seenval('P')) cancelable.cancel_object(parser.value_int()); - if (parser.seen('U')) cancelable.uncancel_object(parser.value_int()); + if (parser.seenval('U')) cancelable.uncancel_object(parser.value_int()); } #endif // CANCEL_OBJECTS diff --git a/Marlin/src/gcode/feature/i2c/M260_M261.cpp b/Marlin/src/gcode/feature/i2c/M260_M261.cpp index e978fb5048fb..cf9bb7e583f4 100644 --- a/Marlin/src/gcode/feature/i2c/M260_M261.cpp +++ b/Marlin/src/gcode/feature/i2c/M260_M261.cpp @@ -45,10 +45,10 @@ */ void GcodeSuite::M260() { // Set the target address - if (parser.seen('A')) i2c.address(parser.value_byte()); + if (parser.seenval('A')) i2c.address(parser.value_byte()); // Add a new byte to the buffer - if (parser.seen('B')) i2c.addbyte(parser.value_byte()); + if (parser.seenval('B')) i2c.addbyte(parser.value_byte()); // Flush the buffer to the bus if (parser.seen('S')) i2c.send(); @@ -63,7 +63,7 @@ void GcodeSuite::M260() { * Usage: M261 A B S