[PHY] Added method to manually drop synchronization in direct mode
This commit is contained in:
parent
39489aeae6
commit
88f528a789
3 changed files with 18 additions and 2 deletions
|
@ -244,6 +244,9 @@ sendMicE KEYWORD2
|
|||
# Pager
|
||||
sendTone KEYWORD2
|
||||
|
||||
# PhysicalLayer
|
||||
dropSync KEYWORD2
|
||||
|
||||
#######################################
|
||||
# Constants (LITERAL1)
|
||||
#######################################
|
||||
|
|
|
@ -195,11 +195,17 @@ int16_t PhysicalLayer::available() {
|
|||
return(_bufferWritePos);
|
||||
}
|
||||
|
||||
uint8_t PhysicalLayer::read() {
|
||||
void PhysicalLayer::dropSync() {
|
||||
if(_directSyncWordLen > 0) {
|
||||
_gotSync = false;
|
||||
_syncBuffer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t PhysicalLayer::read(bool drop) {
|
||||
if(drop) {
|
||||
dropSync();
|
||||
}
|
||||
_bufferWritePos--;
|
||||
return(_buffer[_bufferReadPos++]);
|
||||
}
|
||||
|
|
|
@ -318,12 +318,19 @@ class PhysicalLayer {
|
|||
*/
|
||||
int16_t available();
|
||||
|
||||
/*!
|
||||
\brief Forcefully drop synchronization.
|
||||
*/
|
||||
void dropSync();
|
||||
|
||||
/*!
|
||||
\brief Get data from direct mode buffer.
|
||||
|
||||
\param drop Drop synchronization on read - next reading will require waiting for the sync word again. Defautls to true.
|
||||
|
||||
\returns Byte from direct mode buffer.
|
||||
*/
|
||||
uint8_t read();
|
||||
uint8_t read(bool drop = true);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Add table
Reference in a new issue