Skip to content

Commit 03f242b

Browse files
Mark SoftwareSerial::recv and handle_interrupt as always_inline
Since those functions are only called once now, it makes sense to inline them. This saves a few bytes of program space, but also saves a few cycles in the critical RX path.
1 parent 17b9b53 commit 03f242b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: libraries/SoftwareSerial/SoftwareSerial.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class SoftwareSerial : public Stream
6969
static SoftwareSerial *active_object;
7070

7171
// private methods
72-
void recv();
72+
void recv() __attribute__((__always_inline__));
7373
uint8_t rx_pin_read();
7474
void tx_pin_write(uint8_t pin_state) __attribute__((__always_inline__));
7575
void setTX(uint8_t transmitPin);
@@ -99,7 +99,7 @@ class SoftwareSerial : public Stream
9999
using Print::write;
100100

101101
// public only for easy access by interrupt handlers
102-
static inline void handle_interrupt();
102+
static inline void handle_interrupt() __attribute__((__always_inline__));
103103
};
104104

105105
// Arduino 0012 workaround

0 commit comments

Comments
 (0)