2022-04-14 22:48:11 +02:00
|
|
|
#ifndef _GLOBALS_H_
|
|
|
|
#define _GLOBALS_H_
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
|
|
|
typedef enum eSystem_Status
|
|
|
|
{
|
|
|
|
sysStat_Startup,
|
|
|
|
sysStat_Normal,
|
|
|
|
sysStat_Error,
|
|
|
|
sysStat_Shutdown
|
|
|
|
} tSystem_Status;
|
|
|
|
|
|
|
|
typedef enum eEERequest
|
|
|
|
{
|
|
|
|
EE_IDLE,
|
|
|
|
EE_CFG_SAVE,
|
|
|
|
EE_CFG_LOAD,
|
2023-02-20 13:51:54 +01:00
|
|
|
EE_CFG_FORMAT,
|
2022-04-14 22:48:11 +02:00
|
|
|
EE_PDS_SAVE,
|
2023-02-20 13:51:54 +01:00
|
|
|
EE_PDS_LOAD,
|
|
|
|
EE_PDS_FORMAT,
|
|
|
|
EE_FORMAT_ALL,
|
|
|
|
EE_ALL_SAVE
|
|
|
|
|
2022-04-14 22:48:11 +02:00
|
|
|
} tEERequest;
|
|
|
|
|
|
|
|
typedef struct Globals_s
|
|
|
|
{
|
|
|
|
char DeviceName[33];
|
2022-04-16 17:36:05 +02:00
|
|
|
char DeviceName_ID[43];
|
2023-02-20 13:51:54 +01:00
|
|
|
char FlashVersion[10];
|
2022-04-14 22:48:11 +02:00
|
|
|
tSystem_Status systemStatus = sysStat_Startup;
|
|
|
|
tSystem_Status resumeStatus = sysStat_Startup;
|
2023-02-20 13:51:54 +01:00
|
|
|
char systemStatustxt[16] = "";
|
2022-04-14 22:48:11 +02:00
|
|
|
eEERequest requestEEAction = EE_IDLE;
|
2023-02-20 13:51:54 +01:00
|
|
|
uint16_t eePersistanceAdress;
|
|
|
|
bool hasDTC;
|
|
|
|
int loadvoltage_mV = 0;
|
2022-04-14 22:48:11 +02:00
|
|
|
int battery_level = 0;
|
|
|
|
} Globals_t;
|
|
|
|
|
|
|
|
extern Globals_t globals;
|
2023-04-13 00:35:24 +02:00
|
|
|
typedef struct Constants_s
|
|
|
|
{
|
|
|
|
uint8_t FW_Version_major;
|
|
|
|
uint8_t FW_Version_minor;
|
|
|
|
uint8_t Required_Flash_Version_major;
|
|
|
|
uint8_t Required_Flash_Version_minor;
|
|
|
|
char GitHash[11];
|
|
|
|
} Constants_t;
|
|
|
|
|
|
|
|
const Constants_t constants PROGMEM = {
|
|
|
|
1,1, // Firmware_Version
|
|
|
|
1,1, // Required Flash Version
|
|
|
|
GIT_REV // Git-Hash-String
|
|
|
|
};
|
|
|
|
|
|
|
|
void initGlobals();
|
2022-04-14 22:48:11 +02:00
|
|
|
|
|
|
|
#endif
|