From 13bb2393e13148732861c690d523f07972f4abd8 Mon Sep 17 00:00:00 2001 From: Pyro-Fox <36782094+Pyro-Fox@users.noreply.github.com> Date: Sat, 9 Oct 2021 15:09:50 -0700 Subject: [PATCH 01/18] =?UTF-8?q?=F0=9F=90=9B=20LCD=20string=20followup=20?= =?UTF-8?q?(#22892)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_bed_corners.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 178d466478..79193fbef3 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -179,7 +179,7 @@ static void _lcd_level_bed_corners_get_next_position() { // Display # of good points found vs total needed if (PAGE_CONTAINS(y - (MENU_FONT_HEIGHT), y)) { SETCURSOR(TERN(TFT_COLOR_UI, 2, 0), cy); - lcd_put_u8str_(GET_TEXT_F(MSG_BED_TRAMMING_GOOD_POINTS)); + 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('/'); From 886c59dc1045787042fa3b824bdc56655d10d655 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sun, 10 Oct 2021 01:05:24 +0200 Subject: [PATCH 02/18] =?UTF-8?q?=F0=9F=90=9B=20Queue=20string=20followup?= =?UTF-8?q?=20(#22900)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/queue.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index c5562da3aa..2e3e26d179 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -148,6 +148,12 @@ public: */ static bool enqueue_one(FSTR_P const fgcode); + /** + * Enqueue with Serial Echo + * Return true on success + */ + static bool enqueue_one(const char *cmd); + /** * Enqueue from program memory and return only when commands are actually enqueued */ @@ -253,12 +259,6 @@ private: // Process the next "immediate" command (SRAM) static bool process_injected_command(); - /** - * Enqueue with Serial Echo - * Return true on success - */ - static bool enqueue_one(const char *cmd); - static void gcode_line_error(FSTR_P const ferr, const serial_index_t serial_ind); friend class GcodeSuite; From 33809ae000da2cf1a5a2b0641b235a6bb68d245a Mon Sep 17 00:00:00 2001 From: Minims Date: Sun, 10 Oct 2021 01:10:21 +0200 Subject: [PATCH 03/18] =?UTF-8?q?=F0=9F=A9=B9=20Adjust=20GTR=201.0=20ST792?= =?UTF-8?q?0=20display=20delay=20(#22904)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 0715380e22..95f74efe84 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -484,8 +484,8 @@ // Alter timing for graphical display #if IS_U8GLIB_ST7920 - #define BOARD_ST7920_DELAY_1 96 - #define BOARD_ST7920_DELAY_2 48 + #define BOARD_ST7920_DELAY_1 125 + #define BOARD_ST7920_DELAY_2 90 #define BOARD_ST7920_DELAY_3 600 #endif From b3fd0a50505455bbd4d0487b202ab75797a79421 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sat, 9 Oct 2021 19:13:19 -0400 Subject: [PATCH 04/18] =?UTF-8?q?=F0=9F=90=9B=20Fix=20IDEX=20Duplication?= =?UTF-8?q?=20Mode=20Positioning=20(#22914)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixing #22538 --- Marlin/src/module/motion.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 1f13bd22ee..f5dd5d34c9 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1194,6 +1194,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { case DXC_DUPLICATION_MODE: if (active_extruder == 0) { // Restore planner to parked head (T1) X position + float x0_pos = current_position.x; xyze_pos_t pos_now = current_position; pos_now.x = inactive_extruder_x; planner.set_position_mm(pos_now); @@ -1201,7 +1202,9 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) { // Keep the same X or add the duplication X offset xyze_pos_t new_pos = pos_now; if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) - new_pos.x += duplicate_extruder_x_offset; + new_pos.x = x0_pos + duplicate_extruder_x_offset; + else + new_pos.x = _MIN(X_BED_SIZE - x0_pos, X_MAX_POS); // Move duplicate extruder into the correct position if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Set planner X", inactive_extruder_x, " ... Line to X", new_pos.x); From 0c86cc89f0c74e58949f8c5a0351d57dffab8019 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 10 Oct 2021 01:03:22 +0000 Subject: [PATCH 05/18] [cron] Bump distribution date (2021-10-10) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 61faf18354..68ad186971 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2021-10-09" +//#define STRING_DISTRIBUTION_DATE "2021-10-10" /** * 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 264f24e3bc..95e291e598 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2021-10-09" + #define STRING_DISTRIBUTION_DATE "2021-10-10" #endif /** From 90fa48ffd565ae28e8a0bfcf2d5f8b5a2de2e558 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 11 Oct 2021 01:03:10 +0000 Subject: [PATCH 06/18] [cron] Bump distribution date (2021-10-11) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 68ad186971..43788a7179 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2021-10-10" +//#define STRING_DISTRIBUTION_DATE "2021-10-11" /** * 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 95e291e598..1e0c68a971 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2021-10-10" + #define STRING_DISTRIBUTION_DATE "2021-10-11" #endif /** From ad14b5052cd60b6ab79bb236529241696266bf30 Mon Sep 17 00:00:00 2001 From: Stuart Pittaway <1201909+stuartpittaway@users.noreply.github.com> Date: Mon, 11 Oct 2021 23:42:29 +0100 Subject: [PATCH 07/18] =?UTF-8?q?=E2=9C=A8=20M261=20S=20I2C=20output=20for?= =?UTF-8?q?mat=20(#22890)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/feature/twibus.cpp | 61 +++++++++++++++++++--- Marlin/src/feature/twibus.h | 10 ++-- Marlin/src/gcode/feature/i2c/M260_M261.cpp | 7 +-- Marlin/src/libs/hex_print.h | 2 +- 4 files changed, 64 insertions(+), 16 deletions(-) diff --git a/Marlin/src/feature/twibus.cpp b/Marlin/src/feature/twibus.cpp index 55e4da75cf..0e23b48a40 100644 --- a/Marlin/src/feature/twibus.cpp +++ b/Marlin/src/feature/twibus.cpp @@ -28,11 +28,17 @@ #include +#include "../libs/hex_print.h" + TWIBus i2c; TWIBus::TWIBus() { #if I2C_SLAVE_ADDRESS == 0 - Wire.begin(); // No address joins the BUS as the master + Wire.begin( // No address joins the BUS as the master + #if PINS_EXIST(I2C_SCL, I2C_SDA) && DISABLED(SOFT_I2C_EEPROM) + pin_t(I2C_SDA_PIN), pin_t(I2C_SCL_PIN) + #endif + ); #else Wire.begin(I2C_SLAVE_ADDRESS); // Join the bus as a slave #endif @@ -88,14 +94,53 @@ void TWIBus::echoprefix(uint8_t bytes, FSTR_P const pref, uint8_t adr) { } // static -void TWIBus::echodata(uint8_t bytes, FSTR_P const pref, uint8_t adr) { - echoprefix(bytes, pref, adr); - while (bytes-- && Wire.available()) SERIAL_CHAR(Wire.read()); +void TWIBus::echodata(uint8_t bytes, FSTR_P const pref, uint8_t adr, const uint8_t style/*=0*/) { + union TwoBytesToInt16 { uint8_t bytes[2]; int16_t integervalue; }; + TwoBytesToInt16 ConversionUnion; + + echoprefix(bytes, pref, adr); + + while (bytes-- && Wire.available()) { + int value = Wire.read(); + switch (style) { + + // Style 1, HEX DUMP + case 1: + SERIAL_CHAR(hex_nybble((value & 0xF0) >> 4)); + SERIAL_CHAR(hex_nybble(value & 0x0F)); + if (bytes) SERIAL_CHAR(' '); + break; + + // Style 2, signed two byte integer (int16) + case 2: + if (bytes == 1) + ConversionUnion.bytes[1] = (uint8_t)value; + else if (bytes == 0) { + ConversionUnion.bytes[0] = (uint8_t)value; + // Output value in base 10 (standard decimal) + SERIAL_ECHO(ConversionUnion.integervalue); + } + break; + + // Style 3, unsigned byte, base 10 (uint8) + case 3: + SERIAL_ECHO(value); + if (bytes) SERIAL_CHAR(' '); + break; + + // Default style (zero), raw serial output + default: + // This can cause issues with some serial consoles, Pronterface is an example where things go wrong + SERIAL_CHAR(value); + break; + } + } + SERIAL_EOL(); } -void TWIBus::echobuffer(FSTR_P const pref, uint8_t adr) { - echoprefix(buffer_s, pref, adr); +void TWIBus::echobuffer(FSTR_P const prefix, uint8_t adr) { + echoprefix(buffer_s, prefix, adr); LOOP_L_N(i, buffer_s) SERIAL_CHAR(buffer[i]); SERIAL_EOL(); } @@ -114,11 +159,11 @@ bool TWIBus::request(const uint8_t bytes) { return true; } -void TWIBus::relay(const uint8_t bytes) { +void TWIBus::relay(const uint8_t bytes, const uint8_t style/*=0*/) { debug(F("relay"), bytes); if (request(bytes)) - echodata(bytes, F("i2c-reply"), addr); + echodata(bytes, F("i2c-reply"), addr, style); } uint8_t TWIBus::capture(char *dst, const uint8_t bytes) { diff --git a/Marlin/src/feature/twibus.h b/Marlin/src/feature/twibus.h index 2a8a7fef6a..d2c7270303 100644 --- a/Marlin/src/feature/twibus.h +++ b/Marlin/src/feature/twibus.h @@ -142,7 +142,7 @@ class TWIBus { * * @param bytes the number of bytes to request */ - static void echoprefix(uint8_t bytes, FSTR_P prefix, uint8_t adr); + static void echoprefix(uint8_t bytes, FSTR_P const prefix, uint8_t adr); /** * @brief Echo data on the bus to serial @@ -150,8 +150,9 @@ class TWIBus { * to serial in a parser-friendly format. * * @param bytes the number of bytes to request + * @param style Output format for the bytes, 0 = Raw byte [default], 1 = Hex characters, 2 = uint16_t */ - static void echodata(uint8_t bytes, FSTR_P prefix, uint8_t adr); + static void echodata(uint8_t bytes, FSTR_P const prefix, uint8_t adr, const uint8_t style=0); /** * @brief Echo data in the buffer to serial @@ -160,7 +161,7 @@ class TWIBus { * * @param bytes the number of bytes to request */ - void echobuffer(FSTR_P prefix, uint8_t adr); + void echobuffer(FSTR_P const prefix, uint8_t adr); /** * @brief Request data from the slave device and wait. @@ -192,10 +193,11 @@ class TWIBus { * @brief Request data from the slave device, echo to serial. * @details Request a number of bytes from a slave device and output * the returned data to serial in a parser-friendly format. + * @style Output format for the bytes, 0 = raw byte [default], 1 = Hex characters, 2 = uint16_t * * @param bytes the number of bytes to request */ - void relay(const uint8_t bytes); + void relay(const uint8_t bytes, const uint8_t style=0); #if I2C_SLAVE_ADDRESS > 0 diff --git a/Marlin/src/gcode/feature/i2c/M260_M261.cpp b/Marlin/src/gcode/feature/i2c/M260_M261.cpp index 438d1527f5..e978fb5048 100644 --- a/Marlin/src/gcode/feature/i2c/M260_M261.cpp +++ b/Marlin/src/gcode/feature/i2c/M260_M261.cpp @@ -60,15 +60,16 @@ void GcodeSuite::M260() { /** * M261: Request X bytes from I2C slave device * - * Usage: M261 A B + * Usage: M261 A B S