aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2014-04-22 17:45:21 +0200
committerMatthijs Kooijman <matthijs@stdin.nl>2015-01-26 17:03:25 +0100
commitfe390c3cc8e8b908d8207be80aaa34f804d82c79 (patch)
treefde1519a8b2dc450837e4aebc054b473fbdf3e1c
parentddcdc901a7b5eb9504f4fb3debf16e985e734b5f (diff)
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.
-rw-r--r--libraries/SoftwareSerial/SoftwareSerial.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libraries/SoftwareSerial/SoftwareSerial.h b/libraries/SoftwareSerial/SoftwareSerial.h
index 27c0bfc..778fffb 100644
--- a/libraries/SoftwareSerial/SoftwareSerial.h
+++ b/libraries/SoftwareSerial/SoftwareSerial.h
@@ -71,7 +71,7 @@ private:
// private methods
void recv();
uint8_t rx_pin_read();
- void tx_pin_write(uint8_t pin_state);
+ void tx_pin_write(uint8_t pin_state) __attribute__((__always_inline__));
void setTX(uint8_t transmitPin);
void setRX(uint8_t receivePin);
void setRxIntMsk(bool enable);