1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-16 07:23:07 +01:00

add bus off recovery

This commit is contained in:
andreas
2023-08-24 20:00:19 +02:00
parent 3be08a0c26
commit 41d8578681
3 changed files with 52 additions and 2 deletions

View File

@@ -6,6 +6,15 @@
class Nmea2kTwai : public tNMEA2000{
public:
Nmea2kTwai(gpio_num_t _TxPin, gpio_num_t _RxPin,GwLog *logger);
typedef enum{
ST_STOPPED,
ST_RUNNING,
ST_BUS_OFF,
ST_RECOVERING,
ST_ERROR
} STATE;
STATE getState();
bool startRecovery();
protected:
// Virtual functions for different interfaces. Currently there are own classes
// for Arduino due internal CAN (NMEA2000_due), external MCP2515 SPI CAN bus controller (NMEA2000_mcp),
@@ -17,6 +26,8 @@ class Nmea2kTwai : public tNMEA2000{
// and you want to change size of library send frame buffer size. See e.g. NMEA2000_teensy.cpp.
virtual void InitCANFrameBuffers();
private:
gpio_num_t TxPin;
gpio_num_t RxPin;