From 36b4b021c4b450a81577e60e03aa56d2a15d5653 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sun, 18 Nov 2018 15:36:21 -0500 Subject: [PATCH] change colorchord config address --- embedded8266/ccconfig.h | 2 ++ embedded8266/user/custom_commands.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/embedded8266/ccconfig.h b/embedded8266/ccconfig.h index b8ac91d..49a4c40 100644 --- a/embedded8266/ccconfig.h +++ b/embedded8266/ccconfig.h @@ -58,6 +58,8 @@ struct CCSettings uint16_t gINITIAL_AMP; }; +#define CCCONFIG_ADDRESS 0x81C00 + extern struct CCSettings CCS; diff --git a/embedded8266/user/custom_commands.c b/embedded8266/user/custom_commands.c index 8108fb0..8fb9a7b 100644 --- a/embedded8266/user/custom_commands.c +++ b/embedded8266/user/custom_commands.c @@ -37,7 +37,7 @@ char * gConfigurableNames[CONFIGURABLES] = { "gROOT_NOTE_OFFSET", "gDFTIIR", "gF void ICACHE_FLASH_ATTR CustomStart( ) { int i; - spi_flash_read( 0x3D000, (uint32*)&settings, sizeof( settings ) ); + spi_flash_read( CCCONFIG_ADDRESS, (uint32*)&settings, sizeof( settings ) ); if( settings.SaveLoadKey == 0xaa ) { for( i = 0; i < CONFIGURABLES; i++ ) @@ -202,8 +202,8 @@ int ICACHE_FLASH_ATTR CustomCommand(char * buffer, int retsize, char *pusrdata, EnterCritical(); ets_intr_lock(); - spi_flash_erase_sector( 0x3D000/4096 ); - spi_flash_write( 0x3D000, (uint32*)&settings, ((sizeof( settings )-1)&(~0xf))+0x10 ); + spi_flash_erase_sector( CCCONFIG_ADDRESS/4096 ); + spi_flash_write( CCCONFIG_ADDRESS, (uint32*)&settings, ((sizeof( settings )-1)&(~0xf))+0x10 ); ets_intr_unlock(); ExitCritical();