#pragma STRING_SEG __GPAGE_SEG myStrConstconst char * far const classes[MAX_CLASS] = { "OLP", "ASC", "Analog inputs", "Remote Control", "Levers", "Pressures", "Digital inputs", "Geometry", "Stability", "Digital outputs", "Service", "PLC", "Various", "HiCap" };
v4.5 did not give any warnings (and it does also work fine on 4.6.2 regardless of the warnings).
NEW FEATURES:
1) Compiler issues message "WARNING C1805: Non standard conversion used." when it does not perform address conversion at initialization of constant pointers. (MTWX21086).
/* paged FLASH: 0x8000 TO 0xBFFF; addressed through PPAGE */ PAGE_E0_0 = READ_ONLY 0xE08000 TO 0xE087FF; /* cannot be mapped to XGATE; XGATE sees registers here */ PAGE_E0 = READ_ONLY 0xE08800 TO 0xE0BFFF ALIGN 2[1:1]; /* is also mapped to XGATE: 0x0800..0x3FFF */ PAGE_E1 = READ_ONLY 0xE18000 TO 0xE1BFFF ALIGN 2[1:1]; /* is also mapped to XGATE: 0x4000..0x7FFF */ PAGE_E2 = READ_ONLY 0xE28000 TO 0xE2BFFF; /* cannot be mapped to XGATE; this module should NOT be */ PAGE_E3 = READ_ONLY 0xE38000 TO 0xE3BFFF; /* used for HC12 code when also used for XGATE code */ PAGE_E4 = READ_ONLY 0xE48000 TO 0xE4BFFF; /* since the HC12 will have priority over the XGATE */ PAGE_E5 = READ_ONLY 0xE58000 TO 0xE5BFFF; /* accessing the FLASH modules resulting very poor */ PAGE_E6 = READ_ONLY 0xE68000 TO 0xE6BFFF; /* performance of the XGATE: */ PAGE_E7 = READ_ONLY 0xE78000 TO 0xE7BFFF; /* Check allocation of this ranges in PLACEMENT below! */ PAGE_F8 = READ_ONLY 0xF88000 TO 0xF8BFFF; PAGE_F9 = READ_ONLY 0xF98000 TO 0xF9BFFF; PAGE_FA = READ_ONLY 0xFA8000 TO 0xFABFFF; PAGE_FB = READ_ONLY 0xFB8000 TO 0xFBBFFF; PAGE_FC = READ_ONLY 0xFC8000 TO 0xFCBFFF;/* PAGE_FD = READ_ONLY 0xFD8000 TO 0xFDBFFF; intentionally not defined: equivalent to ROM_4000 */ PAGE_FE = READ_ONLY 0xFE8000 TO 0xFEBFFF;/* PAGE_FF = READ_ONLY 0xFF8000 TO 0xFFBFFF; intentionally not defined: equivalent to ROM_C000 */ENDPLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */ _PRESTART, /* Used in HIWARE format: jump to _Startup at the code start */ STARTUP, /* startup data structures */ ROM_VAR, /* constant variables */ STRINGS, /* string literals */ VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */ //.ostext, /* eventually OSEK code */ NON_BANKED, /* runtime routines which must not be banked */ //COPY /* copy down information: moved to banked flash */ /* in case you want to use ROM_4000 here as well, make sure that all files (incl. library files) are compiled with the option: -OnB=b */ INTO ROM_C000, ROM_4000; DEFAULT_ROM, myStrConst, COPY /* copy down information: how to initialize variables */ INTO PAGE_FE, PAGE_FC, PAGE_FB, PAGE_FA, PAGE_F9, PAGE_F8, /* use the following ranges only when same module is NOT used for XGATE code */ /* PAGE_E0, PAGE_E1, intentionally not listed: assigned to XGATE */ PAGE_E7, PAGE_E6, PAGE_E5, PAGE_E4, PAGE_E3, PAGE_E2, PAGE_E0_0;
Code:/* paged FLASH: 0x8000 TO 0xBFFF; addressed through PPAGE */ PAGE_E0_0 = READ_ONLY 0xE08000 TO 0xE087FF; /* cannot be mapped to XGATE; XGATE sees registers here */ PAGE_E0 = READ_ONLY 0xE08800 TO 0xE0BFFF ALIGN 2[1:1]; /* is also mapped to XGATE: 0x0800..0x3FFF */ PAGE_E1 = READ_ONLY 0xE18000 TO 0xE1BFFF ALIGN 2[1:1]; /* is also mapped to XGATE: 0x4000..0x7FFF */ PAGE_E2 = READ_ONLY 0xE28000 TO 0xE2BFFF; /* cannot be mapped to XGATE; this module should NOT be */ PAGE_E3 = READ_ONLY 0xE38000 TO 0xE3BFFF; /* used for HC12 code when also used for XGATE code */ PAGE_E4 = READ_ONLY 0xE48000 TO 0xE4BFFF; /* since the HC12 will have priority over the XGATE */ PAGE_E5 = READ_ONLY 0xE58000 TO 0xE5BFFF; /* accessing the FLASH modules resulting very poor */ PAGE_E6 = READ_ONLY 0xE68000 TO 0xE6BFFF; /* performance of the XGATE: */ PAGE_E7 = READ_ONLY 0xE78000 TO 0xE7BFFF; /* Check allocation of this ranges in PLACEMENT below! */ GPAGE_7E = READ_ONLY 0x7E0000'G TO 0x7EFFFF'G; /* PAGE_F8 = READ_ONLY 0xF88000 TO 0xF8BFFF; PAGE_F9 = READ_ONLY 0xF98000 TO 0xF9BFFF; PAGE_FA = READ_ONLY 0xFA8000 TO 0xFABFFF; PAGE_FB = READ_ONLY 0xFB8000 TO 0xFBBFFF;*/
PAGE_FC = READ_ONLY 0xFC8000 TO 0xFCBFFF;/* PAGE_FD = READ_ONLY 0xFD8000 TO 0xFDBFFF; intentionally not defined: equivalent to ROM_4000 */ PAGE_FE = READ_ONLY 0xFE8000 TO 0xFEBFFF;/* PAGE_FF = READ_ONLY 0xFF8000 TO 0xFFBFFF; intentionally not defined: equivalent to ROM_C000 */ENDPLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */ _PRESTART, /* Used in HIWARE format: jump to _Startup at the code start */ STARTUP, /* startup data structures */ ROM_VAR, /* constant variables */ STRINGS, /* string literals */ VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */ //.ostext, /* eventually OSEK code */ NON_BANKED, /* runtime routines which must not be banked */ //COPY /* copy down information: moved to banked flash */ /* in case you want to use ROM_4000 here as well, make sure that all files (incl. library files) are compiled with the option: -OnB=b */ INTO ROM_C000, ROM_4000; myStrConst INTO GPAGE_7E; DEFAULT_ROM, COPY /* copy down information: how to initialize variables */ INTO PAGE_FE, PAGE_FC, /* PAGE_FB, PAGE_FA, PAGE_F9, PAGE_F8,*/ /* use the following ranges only when same module is NOT used for XGATE code */ /* PAGE_E0, PAGE_E1, intentionally not listed: assigned to XGATE */ PAGE_E7, PAGE_E6, PAGE_E5, PAGE_E4, PAGE_E3, PAGE_E2, PAGE_E0_0;