mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Add SoftwareSerial::stopListening()
This allows one to explicitly stop a SoftwareSerial instance from listening, without having to make another one listening.
This commit is contained in:
parent
db1a4ad139
commit
934393398b
@ -195,6 +195,17 @@ bool SoftwareSerial::listen()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stop listening. Returns true if we were actually listening.
|
||||||
|
bool SoftwareSerial::stopListening()
|
||||||
|
{
|
||||||
|
if (active_object == this)
|
||||||
|
{
|
||||||
|
active_object = NULL;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// The receive routine called by the interrupt handler
|
// The receive routine called by the interrupt handler
|
||||||
//
|
//
|
||||||
|
@ -87,6 +87,7 @@ public:
|
|||||||
bool listen();
|
bool listen();
|
||||||
void end();
|
void end();
|
||||||
bool isListening() { return this == active_object; }
|
bool isListening() { return this == active_object; }
|
||||||
|
bool stopListening();
|
||||||
bool overflow() { bool ret = _buffer_overflow; _buffer_overflow = false; return ret; }
|
bool overflow() { bool ret = _buffer_overflow; _buffer_overflow = false; return ret; }
|
||||||
int peek();
|
int peek();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user