mirror of
https://github.com/lowobservable/coax.git
synced 2026-03-04 18:55:35 +00:00
Implement receiver error
This commit is contained in:
@@ -229,9 +229,22 @@ static int /* ssize_t */ CoaxTransceiver::receive(uint16_t *buffer, size_t buffe
|
||||
NOP;
|
||||
}
|
||||
|
||||
uint16_t count = rxBufferCount;
|
||||
|
||||
rxState = RX_STATE_DISABLED;
|
||||
|
||||
return rxBufferCount;
|
||||
if (count < 0) {
|
||||
return count;
|
||||
}
|
||||
|
||||
// Check for receiver errors.
|
||||
for (int index = 0; index < count; index++) {
|
||||
if (buffer[index] & 0x8000) {
|
||||
return ERROR_RX_RECEIVER;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static void CoaxTransceiver::rxActiveInterrupt() {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#define ERROR_TX_RECEIVER_ACTIVE -1
|
||||
#define ERROR_RX_TIMEOUT -2
|
||||
#define ERROR_RX_OVERFLOW -3
|
||||
#define ERROR_RX_RECEIVER -4
|
||||
|
||||
class CoaxTransceiver {
|
||||
public:
|
||||
|
||||
@@ -150,7 +150,8 @@ ERROR_MAP = {
|
||||
|
||||
101: InterfaceError('Receiver active'),
|
||||
102: ReceiveTimeout(),
|
||||
103: ReceiveError('Receiver buffer overflow')
|
||||
103: ReceiveError('Receiver buffer overflow'),
|
||||
104: ReceiveError('Receiver error')
|
||||
}
|
||||
|
||||
def _convert_error(message):
|
||||
|
||||
Reference in New Issue
Block a user