36 lines
596 B
C
Raw Normal View History

#ifndef _DTC_H_
#define _DTC_H_
#include <Arduino.h>
#define MAX_DTC_STORAGE 6
typedef enum DTCNums_e
{
DTC_NO_EEPROM_FOUND,
DTC_EEPROM_CFG_BAD,
DTC_EEPROM_PDS_BAD,
DTC_LAST_DTC
} DTCNums_t;
typedef enum DTCActive_e
{
DTC_ACTIVE,
DTC_PREVIOUS,
DTC_NONE
} 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