#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,
  EE_CFG_FORMAT,
  EE_PDS_SAVE,
  EE_PDS_LOAD,
  EE_PDS_FORMAT,
  EE_FORMAT_ALL,
  EE_ALL_SAVE

} tEERequest;

typedef struct Globals_s
{
  char DeviceName[33];
  char DeviceName_ID[43];
  char FlashVersion[10];
  tSystem_Status systemStatus = sysStat_Startup;
  tSystem_Status resumeStatus = sysStat_Startup;
  char systemStatustxt[16] = "";
  eEERequest requestEEAction = EE_IDLE;
  uint16_t eePersistanceAdress;
  bool hasDTC;
  int loadvoltage_mV = 0;
  int battery_level = 0;
} Globals_t;

extern Globals_t globals;
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();

#endif