Skip to content

Commit f3e07b5

Browse files
authored
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
1 parent 17f20e2 commit f3e07b5

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/new_cfg.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ int g_cfg_pendingChanges = 0;
2626
#define MAIN_CFG_VERSION_V3 3
2727
// version 4 - bumped size by 1024,
2828
// added alternate ssid fields
29-
#if PLATFORM_W600
30-
#define MAIN_CFG_VERSION 3
31-
#else
3229
#define MAIN_CFG_VERSION 5
33-
#endif
3430

3531
static byte CFG_CalcChecksum(mainConfig_t *inf) {
3632
int header_size;
@@ -871,7 +867,16 @@ void CFG_InitAndLoad() {
871867
#if ALLOW_WEB_PASSWORD
872868
// add web admin password configuration
873869
if (g_cfg.version<5) {
870+
#if defined(PLATFORM_W600)
871+
// W600 changed from V3 to V5, so at this point
872+
// we read a valid V3 config but need a V5 config.
873+
// Memory might contain old data (from flash_vars)
874+
// so let's zero complete additional memory (including g_cfg.webPassword, making it empty).
875+
memset((char*)(&g_cfg) + MAGIC_CONFIG_SIZE_V3, 0, sizeof(mainConfig_t) - MAGIC_CONFIG_SIZE_V3);
876+
g_cfg_pendingChanges ++;
877+
#else
874878
strcpy_safe(g_cfg.webPassword, "", sizeof(g_cfg.webPassword));
879+
#endif
875880
}
876881
#endif
877882
g_cfg.version = MAIN_CFG_VERSION;

src/new_pins.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,11 +1553,6 @@ typedef struct mainConfig_s {
15531553
char ping_host[64];
15541554
// ofs 0x000005E0 (dec 1504)
15551555
//char initCommandLine[512];
1556-
#if PLATFORM_W600 || PLATFORM_W800
1557-
#define ALLOW_SSID2 0
1558-
#define ALLOW_WEB_PASSWORD 0
1559-
char initCommandLine[512];
1560-
#else
15611556
#define ALLOW_SSID2 1
15621557
#define ALLOW_WEB_PASSWORD 1
15631558
char initCommandLine[1568];
@@ -1577,7 +1572,6 @@ typedef struct mainConfig_s {
15771572
byte disable_web_server;
15781573
// offset 0x00000CBC (3260 decimal)
15791574
char unused[324];
1580-
#endif
15811575
} mainConfig_t;
15821576

15831577
// one sector is 4096 so it we still have some expand possibility

0 commit comments

Comments
 (0)