diff --git a/src/ESP32SJA1000.cpp b/src/ESP32SJA1000.cpp index 309e030..59acfbe 100644 --- a/src/ESP32SJA1000.cpp +++ b/src/ESP32SJA1000.cpp @@ -372,6 +372,16 @@ void ESP32SJA1000Class::dumpRegisters(Stream& out) } } +int ESP32SJA1000Class::readTEC() +{ + return readRegister(REG_TXERR); +} + +int ESP32SJA1000Class::readREC() +{ + return readRegister(REG_RXERR); +} + void ESP32SJA1000Class::handleInterrupt() { uint8_t ir = readRegister(REG_IR); diff --git a/src/ESP32SJA1000.h b/src/ESP32SJA1000.h index b83cddc..338c30a 100644 --- a/src/ESP32SJA1000.h +++ b/src/ESP32SJA1000.h @@ -40,6 +40,9 @@ class ESP32SJA1000Class : public CANControllerClass { void dumpRegisters(Stream& out); + int readTEC(); + int readREC(); + private: void reset();