Make CAN failures common define

This commit is contained in:
Daniel 2024-04-02 22:53:52 +03:00
parent c49f3074f2
commit da9d45cd69
3 changed files with 1 additions and 2 deletions

View file

@ -16,7 +16,6 @@ static unsigned long previousMillis5000 = 0; // will store last time a 5000ms
static unsigned long previousMillis10000 = 0; // will store last time a 10000ms CAN Message was send
static uint8_t CANstillAlive = 12; // counter for checking if CAN is still alive
static uint16_t CANerror = 0; // counter on how many CAN errors encountered
#define MAX_CAN_FAILURES 500 // Amount of malformed CAN messages to allow before raising a warning
#define ALIVE_MAX_VALUE 14 // BMW CAN messages contain alive counter, goes from 0...14
static const uint16_t WUPonDuration = 477; // in milliseconds how long WUP should be ON after poweron

View file

@ -13,7 +13,6 @@ static unsigned long previousMillis10 = 0; // will store last time a 10ms CAN
static unsigned long previousMillis100 = 0; // will store last time a 100ms CAN Message was send
static unsigned long previousMillis10s = 0; // will store last time a 1s CAN Message was send
static uint16_t CANerror = 0; //counter on how many CAN errors encountered
#define MAX_CAN_FAILURES 5000 //Amount of malformed CAN messages to allow before raising a warning
static uint8_t CANstillAlive = 12; //counter for checking if CAN is still alive
static uint8_t mprun10r = 0; //counter 0-20 for 0x1F2 message
static uint8_t mprun10 = 0; //counter 0-3

View file

@ -55,6 +55,7 @@
// Common definitions
#define MAX_AMOUNT_CELLS 192
#define MAX_CAN_FAILURES 500 // Amount of malformed CAN messages to allow before raising a warning
#define INTERVAL_10_MS 10
#define INTERVAL_20_MS 20