aboutsummaryrefslogtreecommitdiff
path: root/libraries/SoftwareSerial/SoftwareSerial.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/SoftwareSerial/SoftwareSerial.h')
-rw-r--r--libraries/SoftwareSerial/SoftwareSerial.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/libraries/SoftwareSerial/SoftwareSerial.h b/libraries/SoftwareSerial/SoftwareSerial.h
index a6a60b5..274f3df 100644
--- a/libraries/SoftwareSerial/SoftwareSerial.h
+++ b/libraries/SoftwareSerial/SoftwareSerial.h
@@ -53,7 +53,10 @@ private:
volatile uint8_t *_receivePortRegister;
uint8_t _transmitBitMask;
volatile uint8_t *_transmitPortRegister;
+ volatile uint8_t *_pcint_maskreg;
+ uint8_t _pcint_maskvalue;
+ // Expressed as 4-cycle delays (must never be 0!)
uint16_t _rx_delay_centering;
uint16_t _rx_delay_intrabit;
uint16_t _rx_delay_stopbit;
@@ -69,11 +72,15 @@ private:
static SoftwareSerial *active_object;
// private methods
- void recv();
+ void recv() __attribute__((__always_inline__));
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) __attribute__((__always_inline__));
+
+ // Return num - sub, or 1 if the result would be < 1
+ static uint16_t subtract_cap(uint16_t num, uint16_t sub);
// private static method for timing
static inline void tunedDelay(uint16_t delay);
@@ -86,18 +93,20 @@ public:
bool listen();
void end();
bool isListening() { return this == active_object; }
- bool overflow() { bool ret = _buffer_overflow; _buffer_overflow = false; return ret; }
+ bool stopListening();
+ bool overflow() { bool ret = _buffer_overflow; if (ret) _buffer_overflow = false; return ret; }
int peek();
virtual size_t write(uint8_t byte);
virtual int read();
virtual int available();
virtual void flush();
+ operator bool() { return true; }
using Print::write;
// public only for easy access by interrupt handlers
- static inline void handle_interrupt();
+ static inline void handle_interrupt() __attribute__((__always_inline__));
};
// Arduino 0012 workaround