From 568f292883d422bdd226d7faf2d2eba16a4a0ed9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 23 Sep 2020 21:36:31 -0500 Subject: [PATCH] HAL/serial followup --- Marlin/src/HAL/AVR/HAL.h | 1 - Marlin/src/HAL/SAMD51/HAL.h | 2 +- Marlin/src/HAL/STM32F1/HAL.h | 2 +- Marlin/src/HAL/TEENSY40_41/HAL.h | 2 +- .../lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp | 6 +++++- Marlin/src/lcd/extui/malyan_lcd.cpp | 6 +++++- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index fcaaf75c4..af7e14267 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -86,7 +86,6 @@ typedef int8_t pin_t; #if !WITHIN(SERIAL_PORT, -1, 3) #error "SERIAL_PORT must be from -1 to 3. Please update your configuration." #endif - #define MYSERIAL0 customizedSerial1 #ifdef SERIAL_PORT_2 diff --git a/Marlin/src/HAL/SAMD51/HAL.h b/Marlin/src/HAL/SAMD51/HAL.h index b516cb769..c72613e77 100644 --- a/Marlin/src/HAL/SAMD51/HAL.h +++ b/Marlin/src/HAL/SAMD51/HAL.h @@ -50,7 +50,7 @@ #if SERIAL_PORT_2 == -1 #define MYSERIAL1 Serial #elif WITHIN(SERIAL_PORT_2, 0, 3) - #define MYSERIAL0 MSERIAL(SERIAL_PORT_2) + #define MYSERIAL1 MSERIAL(SERIAL_PORT_2) #else #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration." #endif diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index 47414cb45..0f3c3e146 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -108,7 +108,7 @@ #endif #endif -#ifdef DGUS_SERIAL +#ifdef DGUS_SERIAL_PORT #if DGUS_SERIAL_PORT == 0 #error "DGUS_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration." #elif DGUS_SERIAL_PORT == SERIAL_PORT diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index 77f7af295..b3b0144d1 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -66,7 +66,7 @@ #if SERIAL_PORT_2 == -1 #define MYSERIAL1 usbSerial #elif WITHIN(SERIAL_PORT_2, 0, 8) - #define MYSERIAL0 MSERIAL(SERIAL_PORT_2) + #define MYSERIAL1 MSERIAL(SERIAL_PORT_2) #else #error "SERIAL_PORT_2 must be from -1 to 8. Please update your configuration." #endif diff --git a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp index a7173b1ad..16779c077 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -113,7 +113,11 @@ static void sendLine_P(PGM_P str) { AnycubicTFTClass::AnycubicTFTClass() {} void AnycubicTFTClass::OnSetup() { - ANYCUBIC_LCD_SERIAL.begin(115200); + #ifndef LCD_BAUDRATE + #define LCD_BAUDRATE 115200 + #endif + LCD_SERIAL.begin(LCD_BAUDRATE); + SENDLINE_DBG_PGM("J17", "TFT Serial Debug: Main board reset... J17"); // J17 Main board reset ExtUI::delay_ms(10); diff --git a/Marlin/src/lcd/extui/malyan_lcd.cpp b/Marlin/src/lcd/extui/malyan_lcd.cpp index ece1b1423..79a5fb961 100644 --- a/Marlin/src/lcd/extui/malyan_lcd.cpp +++ b/Marlin/src/lcd/extui/malyan_lcd.cpp @@ -428,7 +428,11 @@ namespace ExtUI { * it and translate into ExtUI operations where possible. */ inbound_count = 0; - LCD_SERIAL.begin(500000); + + #ifndef LCD_BAUDRATE + #define LCD_BAUDRATE 500000 + #endif + LCD_SERIAL.begin(LCD_BAUDRATE); // Signal init write_to_lcd_P(PSTR("{SYS:STARTED}\r\n"));