janni wrote: ↑17 Oct 2020 14:29
You need to use the array in code or linker may omit it. Something like this convinces linker that the array is needed without producing any code:
Lo(MyConst[0])
I know... (also very irritating...
)
But regardless, constants arrays with org directive are not counted with used rom or statistics.
It would be nice if the compiler didn't strip anything from the sourcecode if you choose Optimization level 0.
(just compile 'as is')
At least leave declared constants at fixed positions alone, because that's never done without a reason.
I find it also very annoying that you can't write a 'raw' 14 bit value to a flash location...
(the compiler always adds a useless RETLW/0x34 and splits it up in 2 words...)
I now have a lot of extra work editing the hexfile after compile.