diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp index ff1b6569ba..9bc224bd2b 100644 --- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp +++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp @@ -739,24 +739,24 @@ #endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) +#ifdef INTERNAL_SERIAL_PORT -#if defined(INTERNAL_SERIAL_PORT) + ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_RX_vect)) { + MarlinSerial>::store_rxd_char(); + } - ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_RX_vect)) { - MarlinSerial>::store_rxd_char(); - } + ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_UDRE_vect)) { + MarlinSerial>::_tx_udr_empty_irq(); + } - ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_UDRE_vect)) { - MarlinSerial>::_tx_udr_empty_irq(); - } + // Preinstantiate + template class MarlinSerial>; - // Preinstantiate - template class MarlinSerial>; - - // Instantiate - MarlinSerial> internalSerial; + // Instantiate + MarlinSerial> internalSerial; #endif + // For AT90USB targets use the UART for BT interfacing #if defined(USBCON) && ENABLED(BLUETOOTH) HardwareSerial bluetoothSerial; diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h index bd0a6234f0..5ada120c6d 100644 --- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h +++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h @@ -276,7 +276,7 @@ #endif // !USBCON -#if defined(INTERNAL_SERIAL_PORT) +#ifdef INTERNAL_SERIAL_PORT template struct MarlinInternalSerialCfg { static constexpr int PORT = serial; diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h index 0785cb79a6..79f7f2f358 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h @@ -47,7 +47,7 @@ uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); #define U8G_COM_SSD_I2C_HAL u8g_com_arduino_ssd_i2c_fn - #if defined(ARDUINO_ARCH_STM32F1) + #ifdef ARDUINO_ARCH_STM32F1 uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); #define U8G_COM_HAL_FSMC_FN u8g_com_stm32duino_fsmc_fn #else