Skip to content

Commit bd32c34

Browse files
committed
[Nucleo F030R8] Disable Serial1 by default
To save RAM space, Serial1 is disabled by default. To enable Serial1 (USART1 on PA10, PA9) add -DENABLE_SERIAL1 Thanks @RickKimball Signed-off-by: Frederic Pillon <[email protected]>
1 parent c99a583 commit bd32c34

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

boards.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.board=NUCLEO_F030R8
8686
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.series=STM32F0xx
8787
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.variant=NUCLEO_F030R8
8888
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.cmsis_lib_gcc=arm_cortexM0l_math
89+
#To enable Serial1 (USART1 on PA10, PA9) add -DENABLE_SERIAL1
8990
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.extra_flags=-DSTM32F030x8
9091

9192
# NUCLEO_F303RE board

variants/NUCLEO_F030R8/variant.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,25 @@ const PinName digital_arduino[] = {
9494
* UART objects
9595
*/
9696
HardwareSerial Serial(PA3, PA2); //Connected to ST-Link
97+
#ifdef ENABLE_SERIAL1
9798
HardwareSerial Serial1(PA10, PA9);
99+
#endif
98100

99101
// Need rework to be generic
100102

101103
void serialEvent() __attribute__((weak));
102104
void serialEvent() { }
105+
#ifdef ENABLE_SERIAL1
103106
void serialEvent1() __attribute__((weak));
104107
void serialEvent1() { }
108+
#endif
105109

106110
void serialEventRun(void)
107111
{
108112
if (Serial.available()) serialEvent();
113+
#ifdef ENABLE_SERIAL1
109114
if (Serial1.available()) serialEvent1();
115+
#endif
110116
}
111117

112118
// ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)