From 7c4640ad91c2214943245b3ced9b4d83fcb7c72d Mon Sep 17 00:00:00 2001 From: pmantoine Date: Sat, 3 Sep 2022 13:06:02 +0800 Subject: [PATCH] STM32 Serial1 defs for F411RE and F446ZE --- DCCTimerSTM32.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/DCCTimerSTM32.cpp b/DCCTimerSTM32.cpp index 3f66a5f..2cacaff 100644 --- a/DCCTimerSTM32.cpp +++ b/DCCTimerSTM32.cpp @@ -32,8 +32,17 @@ #include "DIAG.h" //PMA temp debug #include "DCCTimer.h" -// STM32 doesn't have Serial1 defined by default -HardwareSerial Serial1(PA10, PA15); // Rx=PA10, Tx=PA15 +#define STM32F411RE // PMA - ideally this ought to be derived from within the STM32 support somehow + +#if defined(STM32F411RE) +// STM32F411RE doesn't have Serial1 defined by default +HardwareSerial Serial1(PB7, PA15); // Rx=PB7, Tx=PA15 -- CN7 pins 17 and 21 - F411RE +#elif defined(STM32F446ZE) +// STM32F446ZE doesn't have Serial1 defined by default +HardwareSerial Serial1(PG9, PG14); // Rx=PG9, Tx=PG14 -- D0, D1 - F446ZE +#else +#warning Serial1 not defined +#endif INTERRUPT_CALLBACK interruptHandler=0; // Let's use STM32's timer #11 until disabused of this notion