aboutsummaryrefslogtreecommitdiff
path: root/libraries/SoftwareSerial
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/SoftwareSerial')
-rw-r--r--libraries/SoftwareSerial/SoftwareSerial.cpp14
-rw-r--r--libraries/SoftwareSerial/SoftwareSerial.h5
-rw-r--r--libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino2
-rw-r--r--libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino2
-rw-r--r--libraries/SoftwareSerial/library.properties1
5 files changed, 10 insertions, 14 deletions
diff --git a/libraries/SoftwareSerial/SoftwareSerial.cpp b/libraries/SoftwareSerial/SoftwareSerial.cpp
index 527f3f9..0a16ff7 100644
--- a/libraries/SoftwareSerial/SoftwareSerial.cpp
+++ b/libraries/SoftwareSerial/SoftwareSerial.cpp
@@ -57,9 +57,9 @@ volatile uint8_t SoftwareSerial::_receive_buffer_head = 0;
//
// This function generates a brief pulse
// for debugging or measuring on an oscilloscope.
+#if _DEBUG
inline void DebugPulse(uint8_t pin, uint8_t count)
{
-#if _DEBUG
volatile uint8_t *pport = portOutputRegister(digitalPinToPort(pin));
uint8_t val = *pport;
@@ -68,8 +68,10 @@ inline void DebugPulse(uint8_t pin, uint8_t count)
*pport = val | digitalPinToBitMask(pin);
*pport = val;
}
-#endif
}
+#else
+inline void DebugPulse(uint8_t, uint8_t) {}
+#endif
//
// Private methods
@@ -467,13 +469,7 @@ size_t SoftwareSerial::write(uint8_t b)
void SoftwareSerial::flush()
{
- if (!isListening())
- return;
-
- uint8_t oldSREG = SREG;
- cli();
- _receive_buffer_head = _receive_buffer_tail = 0;
- SREG = oldSREG;
+ // There is no tx buffering, simply return
}
int SoftwareSerial::peek()
diff --git a/libraries/SoftwareSerial/SoftwareSerial.h b/libraries/SoftwareSerial/SoftwareSerial.h
index 274f3df..622e2a5 100644
--- a/libraries/SoftwareSerial/SoftwareSerial.h
+++ b/libraries/SoftwareSerial/SoftwareSerial.h
@@ -72,12 +72,11 @@ private:
static SoftwareSerial *active_object;
// private methods
- void recv() __attribute__((__always_inline__));
+ inline void recv() __attribute__((__always_inline__));
uint8_t rx_pin_read();
- 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__));
+ inline 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);
diff --git a/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino b/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino
index d35303d..aba6ebe 100644
--- a/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino
+++ b/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino
@@ -33,7 +33,7 @@ void setup() {
// Open serial communications and wait for port to open:
Serial.begin(57600);
while (!Serial) {
- ; // wait for serial port to connect. Needed for Leonardo only
+ ; // wait for serial port to connect. Needed for native USB port only
}
diff --git a/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino b/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino
index 2c501e5..26659d6 100644
--- a/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino
+++ b/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino
@@ -46,7 +46,7 @@ void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
- ; // wait for serial port to connect. Needed for Leonardo only
+ ; // wait for serial port to connect. Needed for native USB port only
}
diff --git a/libraries/SoftwareSerial/library.properties b/libraries/SoftwareSerial/library.properties
index 37eb04b..c42cbde 100644
--- a/libraries/SoftwareSerial/library.properties
+++ b/libraries/SoftwareSerial/library.properties
@@ -4,6 +4,7 @@ author=Arduino
maintainer=Arduino <info@arduino.cc>
sentence=Enables serial communication on digital pins. For all Arduino boards, BUT Arduino DUE.
paragraph=
+category=Communication
url=http://www.arduino.cc/en/Reference/SoftwareSerial
architectures=avr