#ifndef _DTC_H_ #define _DTC_H_ #include #define MAX_DTC_STORAGE 6 typedef enum DTCNums_e { DTC_NO_GPS_SERIAL = 1, DTC_TANK_EMPTY, DTC_NO_EEPROM_FOUND, DTC_EEPROM_CFG_BAD, DTC_EEPROM_PDS_BAD, DTC_EEPROM_VERSION_BAD, DTC_CAN_TRANSCEIVER_FAILED, DTC_NO_CAN_SIGNAL, DTC_LAST_DTC } DTCNums_t; typedef enum DTCActive_e { DTC_NONE, DTC_ACTIVE, DTC_PREVIOUS } DTCActive_t; typedef struct DTCEntry_s { DTCNums_t Number; uint32_t timestamp; DTCActive_t active; } DTCEntry_t; void MaintainDTC(DTCNums_t DTC_no, boolean active); void ClearDTC(DTCNums_t DTC_no); void ClearAllDTC(); DTCNums_t getlastDTC(boolean only_active); extern DTCEntry_s DTCStorage[MAX_DTC_STORAGE]; #endif