2022-02-10 22:32:40 +01:00
|
|
|
#ifndef _DTC_H_
|
|
|
|
#define _DTC_H_
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
2022-03-09 23:05:17 +01:00
|
|
|
#define MAX_DTC_STORAGE 6
|
2022-02-10 22:32:40 +01:00
|
|
|
|
2022-03-09 20:25:02 +01:00
|
|
|
typedef enum DTCNums_e
|
|
|
|
{
|
|
|
|
DTC_NO_GPS_SERIAL,
|
|
|
|
DTC_TANK_EMPTY,
|
2022-03-09 23:05:17 +01:00
|
|
|
DTC_NO_EEPROM_FOUND,
|
|
|
|
DTC_EEPROM_CFG_BAD,
|
|
|
|
DTC_EEPROM_PDS_BAD,
|
2022-03-10 19:44:43 +01:00
|
|
|
DTC_CAN_TRANSCEIVER_FAILED,
|
|
|
|
DTC_NO_CAN_SIGNAL,
|
2022-03-09 20:25:02 +01:00
|
|
|
DTC_LAST_DTC
|
|
|
|
} DTCNums_t;
|
2022-02-10 22:32:40 +01:00
|
|
|
|
|
|
|
typedef enum DTCActive_e
|
|
|
|
{
|
2022-03-09 20:25:02 +01:00
|
|
|
DTC_ACTIVE,
|
|
|
|
DTC_PREVIOUS,
|
|
|
|
DTC_NONE
|
|
|
|
} DTCActive_t;
|
2022-02-10 22:32:40 +01:00
|
|
|
|
|
|
|
typedef struct DTCEntry_s
|
|
|
|
{
|
2022-03-09 20:25:02 +01:00
|
|
|
DTCNums_t Number;
|
2022-02-10 22:32:40 +01:00
|
|
|
uint32_t timestamp;
|
2022-03-09 20:25:02 +01:00
|
|
|
DTCActive_t active;
|
2022-02-10 22:32:40 +01:00
|
|
|
} DTCEntry_t;
|
|
|
|
|
2022-03-09 20:25:02 +01:00
|
|
|
void MaintainDTC(DTCNums_t DTC_no, boolean active);
|
|
|
|
void ClearDTC(DTCNums_t DTC_no);
|
2022-02-10 22:32:40 +01:00
|
|
|
void ClearAllDTC();
|
2022-03-09 20:25:02 +01:00
|
|
|
DTCNums_t getlastDTC(boolean only_active);
|
2022-02-10 22:32:40 +01:00
|
|
|
|
2022-03-09 20:25:02 +01:00
|
|
|
extern DTCEntry_s DTCStorage[MAX_DTC_STORAGE];
|
2022-02-10 22:32:40 +01:00
|
|
|
#endif
|