Compare commits
2 Commits
75ed8e6308
...
8ef469b9f1
Author | SHA1 | Date | |
---|---|---|---|
8ef469b9f1 | |||
88b572f408 |
@ -45,9 +45,14 @@ def extract_struct_fields(file_content, variable_types):
|
||||
|
||||
if match:
|
||||
# Extrahiere die Felder aus dem Treffer
|
||||
fields_match = re.findall(r'\b(\w+)\s+(\w+)\s*;', match.group(1))
|
||||
fields_match = re.findall(r'\b(\w+)\s+(\w+)(?:\[(\d+)\])?\s*;', match.group(1))
|
||||
if fields_match:
|
||||
result[var_name] = {'type': var_type, 'fields': {field_name: field_type for field_type, field_name in fields_match}}
|
||||
result[var_name] = {'type': var_type, 'fields': {}}
|
||||
for field_type, field_name, array_size in fields_match:
|
||||
if array_size:
|
||||
result[var_name]['fields'][field_name] = {'type': field_type, 'size': int(array_size)}
|
||||
else:
|
||||
result[var_name]['fields'][field_name] = {'type': field_type}
|
||||
|
||||
return result
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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
|
@ -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;
|
||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user