mirror of
https://github.com/lowobservable/coax.git
synced 2026-01-27 04:42:06 +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:
|
||||
|
||||
Reference in New Issue
Block a user