diff --git a/apps/settings.h b/apps/settings.h index cc8c698bd2..50cb730579 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -215,18 +215,32 @@ enum { ALARM_START_WPS = 0, /** virtual pointer stuff.. move to another .h maybe? **/ /* These define "virtual pointers", which could either be a literal string, or a mean a string ID if the pointer is in a certain range. - This helps to save space for menus and options. */ + This helps to save space for menus and options. + + While using 0 as the base address is fastest/simplest, + it could result in a nullptr when ID==0 which C compilers try to + helpfully "optimize" away. + + NOTE: VIRT_PTR must point at an *invalid* address in the target + memory map! +*/ #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */ #if defined(CPU_S5L87XX) -/* the S5L87XX has IRAM at 0, so we use 0xffff bytes right after that */ +/* 256K IRAM at 0x0 */ #define VIRT_PTR ((unsigned char*)0x40000) -#elif CONFIG_CPU==DM320 -/* the DM320 has IRAM at 0, so we use 0xffff bytes right after that */ +#elif CONFIG_CPU==DM320 || CONFIG_CPU == RK27XX +/* 4K of IRAM at 0x0 */ #define VIRT_PTR ((unsigned char*)0x4000) +#elif defined(CPU_TCC780X) +/* 1K of IRAM at 0x0 */ +#define VIRT_PTR ((unsigned char*)0x1000) +#elif CONFIG_CPU == S3C2440 || defined(CPU_PP) || CONFIG_CPU==IMX31L +/* up to 64MB of DRAM at 0x0 */ +#define VIRT_PTR ((unsigned char*)0x40000000) #else -/* a location where we won't store strings, 0 is the fastest */ -#define VIRT_PTR ((unsigned char*)0) +/* offset from 0x0 slightly */ +#define VIRT_PTR ((unsigned char*)sizeof(char*)) #endif /* form a "virtual pointer" out of a language ID */