From 913f0a0c86a2a958ace4b3d412874a267e66e410 Mon Sep 17 00:00:00 2001 From: pmantoine Date: Sun, 27 Nov 2022 21:04:49 +0800 Subject: [PATCH] STM32F412ZG/F446ZE serial support update --- DCCTimerSTM32.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/DCCTimerSTM32.cpp b/DCCTimerSTM32.cpp index eb0d365..831c87e 100644 --- a/DCCTimerSTM32.cpp +++ b/DCCTimerSTM32.cpp @@ -28,13 +28,9 @@ // This is to avoid repetition and duplication. #ifdef ARDUINO_ARCH_STM32 -#include "FSH.h" //PMA temp debug -#include "DIAG.h" //PMA temp debug #include "DCCTimer.h" -#define STM32F411RE // PMA - ideally this ought to be derived from within the STM32 support somehow - -#if defined(STM32F411RE) +#if defined(ARDUINO_NUCLEO_F411RE) // STM32F411RE doesn't have Serial1 defined by default HardwareSerial Serial1(PB7, PA15); // Rx=PB7, Tx=PA15 -- CN7 pins 17 and 21 - F411RE // Serial2 is defined to use USART2 by default, but is in fact used as the diag console @@ -42,9 +38,9 @@ HardwareSerial Serial1(PB7, PA15); // Rx=PB7, Tx=PA15 -- CN7 pins 17 and 21 - F // for other DCC-EX uses like WiFi, DFPlayer, etc. // Let's define Serial6 as an additional serial port (the only other option for the F411RE) HardwareSerial Serial6(PA12, PA11); // Rx=PA12, Tx=PA11 -- CN10 pins 12 and 14 - F411RE -#elif defined(STM32F446ZE) -// STM32F446ZE doesn't have Serial1 defined by default -HardwareSerial Serial1(PG9, PG14); // Rx=PG9, Tx=PG14 -- D0, D1 - F446ZE +#elif defined(ARDUINO_BLAH_F412ZG) || defined(ARDUINO_NUCLEO_F412ZG) || defined(ARDUINO_NUCLEO_F446ZE) +// Nucleo-144 boards don't have Serial1 defined by default +HardwareSerial Serial1(PG9, PG14); // Rx=PG9, Tx=PG14 -- D0, D1 - F412ZG/F446ZE #else #warning Serial1 not defined #endif