mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Make CAN failures common define
This commit is contained in:
parent
c49f3074f2
commit
da9d45cd69
3 changed files with 1 additions and 2 deletions
|
@ -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 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 uint8_t CANstillAlive = 12; // counter for checking if CAN is still alive
|
||||||
static uint16_t CANerror = 0; // counter on how many CAN errors encountered
|
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
|
#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
|
static const uint16_t WUPonDuration = 477; // in milliseconds how long WUP should be ON after poweron
|
||||||
|
|
|
@ -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 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 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
|
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 CANstillAlive = 12; //counter for checking if CAN is still alive
|
||||||
static uint8_t mprun10r = 0; //counter 0-20 for 0x1F2 message
|
static uint8_t mprun10r = 0; //counter 0-20 for 0x1F2 message
|
||||||
static uint8_t mprun10 = 0; //counter 0-3
|
static uint8_t mprun10 = 0; //counter 0-3
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
|
|
||||||
// Common definitions
|
// Common definitions
|
||||||
#define MAX_AMOUNT_CELLS 192
|
#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_10_MS 10
|
||||||
#define INTERVAL_20_MS 20
|
#define INTERVAL_20_MS 20
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue