Skip to content

Commit 2b868aa

Browse files
Palatisdevyte
authored andcommitted
allow disabling global Serial and Serial1 object (#2807)
allow the user to disable specific global `Serial` objects to save memory. that's 0x1c bytes per object.
1 parent 2880354 commit 2b868aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cores/esp8266/HardwareSerial.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,10 @@ HardwareSerial::operator bool() const
180180
}
181181

182182

183+
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
183184
HardwareSerial Serial(UART0);
185+
#endif
186+
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL1)
184187
HardwareSerial Serial1(UART1);
188+
#endif
189+

0 commit comments

Comments
 (0)