1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

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.
This commit is contained in:
Matthijs Kooijman 2014-04-23 15:52:57 +02:00
parent 5af847d3a4
commit 9d8f350ffe

View File

@ -69,7 +69,7 @@ private:
static SoftwareSerial *active_object; static SoftwareSerial *active_object;
// private methods // private methods
void recv(); void recv() __attribute__((__always_inline__));
uint8_t rx_pin_read(); uint8_t rx_pin_read();
void tx_pin_write(uint8_t pin_state) __attribute__((__always_inline__)); void tx_pin_write(uint8_t pin_state) __attribute__((__always_inline__));
void setTX(uint8_t transmitPin); void setTX(uint8_t transmitPin);
@ -99,7 +99,7 @@ public:
using Print::write; using Print::write;
// public only for easy access by interrupt handlers // public only for easy access by interrupt handlers
static inline void handle_interrupt(); static inline void handle_interrupt() __attribute__((__always_inline__));
}; };
// Arduino 0012 workaround // Arduino 0012 workaround