MATH_DATA & .tmp_data save/restore for FreeRTOS

by Isaac Marino Bavaresco

The port of FreeRTOS for PIC18 with Microchip MPLAB-C18 has some problems when saving and restoring the compiler-generated memory sections "MATH_DATA" and ".tmpdata".

It appears that the FreeRTOS author have only an old version of the MPLAB-C18, and the new versions manage these sections diferently.

The older versions (I don't know what) appear to keep the "MATH_DATA" and ".tmpdata" sections at the very beginning of the RAM. The versions I am using with FreeRTOS (3.xx onwards) let the linker put them at will. Their size appears to change also.

I found a solution that appears to be version-independent (until now at least).