added Wifi-Config to EEPROM Layout

This commit is contained in:
Marcel Peterkau 2024-01-25 14:33:40 +01:00
parent 88b572f408
commit 8ef469b9f1
4 changed files with 21 additions and 7 deletions

View File

@ -21,6 +21,8 @@
#include "dtc.h"
#include "common.h"
#define EEPROM_STRUCTURE_REVISION 3 // Increment this version when changing EEPROM structures
#if PCB_REV == 1 || PCB_REV == 2 || PCB_REV == 3
#define EEPROM_SIZE_BYTES I2C_DEVICESIZE_24LC64
#elif PCB_REV == 4
@ -73,6 +75,10 @@ typedef struct
bool LED_Mode_Flash;
uint8_t LED_Max_Brightness;
uint8_t LED_Min_Brightness;
char wifi_ap_ssid[33];
char wifi_ap_password[64];
char wifi_client_ssid[33];
char wifi_client_password[64];
uint32_t checksum;
} LubeConfig_t;
@ -84,6 +90,10 @@ const LubeConfig_t LubeConfig_defaults = {
false,
255,
5,
"ChainLube",
QUOTE(WIFI_AP_PASSWORD),
QUOTE(WIFI_SSID_CLIENT),
QUOTE(WIFI_PASSWORD_CLIENT),
0};
void InitEEPROM();

View File

@ -3,10 +3,10 @@
*
* @brief Header file for converting structs to JSON objects.
*
* @note This file is auto-generated by a script on 2024-01-10 18:01:52.
* @note This file is auto-generated by a script on 2024-01-25 14:30:32.
*
* @author Marcel Peterkau
* @date 10.01.2024
* @date 25.01.2024
*/
#ifndef _STRUCT2JSON_H_
@ -23,4 +23,4 @@ void generateJsonObject_PersistenceData(JsonObject& data);
#endif /* _STRUCT2JSON_H_ */
// CODEGENERATOR_CHECKSUM: 9e8dd21170fd6ef8fbf8c4b156d9af751836a76081f811bf0e3ab2b1eb8ee48c
// CODEGENERATOR_CHECKSUM: 4bb0dc037057aafd9688aacedfaae5c97c9de79dbbd0e139d982208053f74fa8

View File

@ -18,7 +18,7 @@ LubeConfig_t LubeConfig;
persistenceData_t PersistenceData;
// EEPROM version identifier
const uint16_t eeVersion = 2; // Increment this version when changing EEPROM structures
const uint16_t eeVersion = EEPROM_STRUCTURE_REVISION;
// Flag indicating whether EEPROM is available
boolean eeAvailable = false;

View File

@ -3,10 +3,10 @@
*
* @brief Implementation file for converting structs to JSON objects.
*
* @note This file is auto-generated by a script on 2024-01-10 18:01:52.
* @note This file is auto-generated by a script on 2024-01-25 14:30:32.
*
* @author Marcel Peterkau
* @date 10.01.2024
* @date 25.01.2024
*/
@ -32,6 +32,10 @@ void generateJsonObject_LubeConfig(JsonObject& data)
data["LED_Mode_Flash"] = LubeConfig.LED_Mode_Flash;
data["LED_Max_Brightness"] = LubeConfig.LED_Max_Brightness;
data["LED_Min_Brightness"] = LubeConfig.LED_Min_Brightness;
data["wifi_ap_ssid"] = LubeConfig.wifi_ap_ssid;
data["wifi_ap_password"] = LubeConfig.wifi_ap_password;
data["wifi_client_ssid"] = LubeConfig.wifi_client_ssid;
data["wifi_client_password"] = LubeConfig.wifi_client_password;
data["checksum"] = LubeConfig.checksum;
}
@ -47,4 +51,4 @@ void generateJsonObject_PersistenceData(JsonObject& data)
// CODEGENERATOR_CHECKSUM: 9e8dd21170fd6ef8fbf8c4b156d9af751836a76081f811bf0e3ab2b1eb8ee48c
// CODEGENERATOR_CHECKSUM: 4bb0dc037057aafd9688aacedfaae5c97c9de79dbbd0e139d982208053f74fa8