Try fix flash restrictions for W600 and W800 (#1936)

* Try fix flash restrictions for W600 and W800 by moving start of FLASH_VARS (changing FLASH_VARS_STRUCTURE_ADDR)
So restrictions in new_pins.h should be obsolete (allowing e.g. second SSID for W600 and W800)
For W800 restriction should be no longer present since some time, because it was moved to easyflash some time ago...

* Fix code in new_cfg.c, too

Removed special handling for W600 and updated config version.

* Tried an "update" mechanism: move flash_vars to new location if config is version 3

* Fix overwriting configSize in CFG_CalcChecksum() in case of V3 config

* I try fixing error for XR platforms for conflicting SSD1306_Init by excluding local "components" dir

* Try fixig build by removing "-lcomponent"

* Try fix for XR806, too

* try zeroing new space in config

* Try fixing zero memory
Add some more debug output

* Removed test code for fixing XRadio devices - nothing to do with this PR
Removed debug output

* Change to reflect moving flashvars from local structure to easyflash in latest commit
This commit is contained in:
MaxineMuster
2026-02-10 09:00:33 +01:00
committed by GitHub
parent 17f20e2878
commit f3e07b547d
2 changed files with 9 additions and 10 deletions

View File

@@ -26,11 +26,7 @@ int g_cfg_pendingChanges = 0;
#define MAIN_CFG_VERSION_V3 3
// version 4 - bumped size by 1024,
// added alternate ssid fields
#if PLATFORM_W600
#define MAIN_CFG_VERSION 3
#else
#define MAIN_CFG_VERSION 5
#endif
static byte CFG_CalcChecksum(mainConfig_t *inf) {
int header_size;
@@ -871,7 +867,16 @@ void CFG_InitAndLoad() {
#if ALLOW_WEB_PASSWORD
// add web admin password configuration
if (g_cfg.version<5) {
#if defined(PLATFORM_W600)
// W600 changed from V3 to V5, so at this point
// we read a valid V3 config but need a V5 config.
// Memory might contain old data (from flash_vars)
// so let's zero complete additional memory (including g_cfg.webPassword, making it empty).
memset((char*)(&g_cfg) + MAGIC_CONFIG_SIZE_V3, 0, sizeof(mainConfig_t) - MAGIC_CONFIG_SIZE_V3);
g_cfg_pendingChanges ++;
#else
strcpy_safe(g_cfg.webPassword, "", sizeof(g_cfg.webPassword));
#endif
}
#endif
g_cfg.version = MAIN_CFG_VERSION;

View File

@@ -1553,11 +1553,6 @@ typedef struct mainConfig_s {
char ping_host[64];
// ofs 0x000005E0 (dec 1504)
//char initCommandLine[512];
#if PLATFORM_W600 || PLATFORM_W800
#define ALLOW_SSID2 0
#define ALLOW_WEB_PASSWORD 0
char initCommandLine[512];
#else
#define ALLOW_SSID2 1
#define ALLOW_WEB_PASSWORD 1
char initCommandLine[1568];
@@ -1577,7 +1572,6 @@ typedef struct mainConfig_s {
byte disable_web_server;
// offset 0x00000CBC (3260 decimal)
char unused[324];
#endif
} mainConfig_t;
// one sector is 4096 so it we still have some expand possibility