Skip to content

Commit 389d2d6

Browse files
committed
Serial: split singletons into multiple files
allows the linker to remove unneeded objects Former-commit-id: b68a559
1 parent 871dc98 commit 389d2d6

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

cores/arduino/SerialObj1.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "Serial.h"
2+
3+
#if SERIAL_HOWMANY > 0
4+
UART _UART1_(UART1_TX_PIN, UART1_RX_PIN);
5+
#endif

cores/arduino/SerialObjs.cpp renamed to cores/arduino/SerialObj2.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#include "Serial.h"
22

3-
#if SERIAL_HOWMANY > 0
4-
UART _UART1_(UART1_TX_PIN, UART1_RX_PIN);
5-
#endif
6-
73
#if SERIAL_HOWMANY > 1
84
UART _UART2_(UART2_TX_PIN, UART2_RX_PIN);
95
#endif

cores/arduino/SerialObj3.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "Serial.h"
2+
3+
#if SERIAL_HOWMANY > 2
4+
UART _UART3_(UART3_TX_PIN, UART3_RX_PIN);
5+
#endif
6+
7+
#if SERIAL_HOWMANY > 3
8+
UART _UART4_(UART4_TX_PIN, UART4_RX_PIN);
9+
#endif
10+
11+
#if SERIAL_HOWMANY > 4
12+
UART _UART5_(UART5_TX_PIN, UART5_RX_PIN);
13+
#endif

0 commit comments

Comments
 (0)