Skip to content

Commit fe390c3

Browse files
committedJan 26, 2015
Mark SoftwareSerial::tx_pin_write as "always_inline"
Somehow gcc 4.8 doesn't inline this function, even though it is always called with constant arguments and can be reduced to just a few instructions when inlined. Adding the always_inline attribute makes gcc inline it, saving 46 bytes on the Arduino uno. gcc 4.3 already inlined this function, so there are no space savings there.
1 parent ddcdc90 commit fe390c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎libraries/SoftwareSerial/SoftwareSerial.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class SoftwareSerial : public Stream
7171
// private methods
7272
void recv();
7373
uint8_t rx_pin_read();
74-
void tx_pin_write(uint8_t pin_state);
74+
void tx_pin_write(uint8_t pin_state) __attribute__((__always_inline__));
7575
void setTX(uint8_t transmitPin);
7676
void setRX(uint8_t receivePin);
7777
void setRxIntMsk(bool enable);

0 commit comments

Comments
 (0)