rearragned some code

This commit is contained in:
2024-01-11 21:19:31 +01:00
parent 0aae5a742c
commit ed6f4e488a
5 changed files with 96 additions and 74 deletions

View File

@@ -18,7 +18,6 @@
#include <Arduino.h>
#include <Wire.h>
#include <I2C_eeprom.h>
#include "globals.h"
#include "dtc.h"
#include "common.h"
@@ -28,56 +27,19 @@
#define EEPROM_SIZE_BYTES I2C_DEVICESIZE_24LC256
#endif
// Enum for different sources of speed input
typedef enum SpeedSource_e
typedef enum EERequest_e
{
#ifdef FEATURE_ENABLE_TIMER
SOURCE_TIME,
#endif
SOURCE_IMPULSE,
SOURCE_GPS,
SOURCE_CAN
} SpeedSource_t;
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
// String representation of SpeedSource enum
const char SpeedSourceString[][8] = {
#ifdef FEATURE_ENABLE_TIMER
"Timer",
#endif
"Impuls",
"GPS",
"CAN-Bus"
};
const size_t SpeedSourceString_Elements = sizeof(SpeedSourceString) / sizeof(SpeedSourceString[0]);
// Enum for GPS baud rates
typedef enum GPSBaudRate_e
{
BAUD_9600,
BAUD_115200
} GPSBaudRate_t;
// String representation of GPSBaudRate enum
const char GPSBaudRateString[][7] = {
"9600",
"115200"};
const size_t GPSBaudRateString_Elements = sizeof(GPSBaudRateString) / sizeof(GPSBaudRateString[0]);
// Enum for CAN bus sources
typedef enum CANSource_e
{
KTM_890_ADV_R_2021,
KTM_1290_SD_R_2023
} CANSource_t;
// String representation of CANSource enum
const char CANSourceString[][30] = {
"KTM 890 Adventure R (2021)",
"KTM 1290 Superduke R (2023)"};
const size_t CANSourceString_Elements = sizeof(CANSourceString) / sizeof(CANSourceString[0]);
} EERequest_t;
// Structure for persistence data stored in EEPROM
typedef struct