Author Topic: Rom Address with Microchip MPLABX and XC8  (Read 118 times)

0 Members and 1 Guest are viewing this topic.

Offline Picuino

  • Regular Contributor
  • *
  • Posts: 120
  • Country: es
Rom Address with Microchip MPLABX and XC8
« on: April 14, 2020, 10:27:50 am »
I have updated MPLABX from version 4 to version 5 maintaining the compiler XC8 with version 2.1

Before update, this code worked:

Code: (c) [Select]
#define SAF_ADDRESS              0x3F80   // Storage Area Flash address
const unsigned long PPB_CALIBRATION @ SAF_ADDRESS = 248444;

And now the compiler raise an error:
Code: [Select]
./calibration.h:11:36: error: expected ';' after top level declarator
const unsigned long PPB_CALIBRATION @ SAF_ADDRESS = 248444;
                                   ^
                                   ;

how can i make it work now?

Regards.
 

Offline oPossum

  • Super Contributor
  • ***
  • Posts: 1041
  • Country: us
  • Save the possum. Save the world.
Re: Rom Address with Microchip MPLABX and XC8
« Reply #1 on: April 14, 2020, 12:24:39 pm »
Use __at(address)

Section 2.5.2.3 of MPLAB_XC8_C_Compiler_Legacy_User_Guide.pdf
 

Offline Picuino

  • Regular Contributor
  • *
  • Posts: 120
  • Country: es
Re: Rom Address with Microchip MPLABX and XC8
« Reply #2 on: April 14, 2020, 01:11:04 pm »
Thanks a lot.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf