[PHY] Added method to manually drop synchronization in direct mode

pull/609/head
jgromes 2022-10-19 18:10:45 +02:00
rodzic 39489aeae6
commit 88f528a789
3 zmienionych plików z 18 dodań i 2 usunięć

Wyświetl plik

@ -244,6 +244,9 @@ sendMicE KEYWORD2
# Pager
sendTone KEYWORD2
# PhysicalLayer
dropSync KEYWORD2
#######################################
# Constants (LITERAL1)
#######################################

Wyświetl plik

@ -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++]);
}

Wyświetl plik

@ -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
/*!