extern __attribute__((space(prog))) int _FOSC;
#define _FOSC(x) __attribute__((section("__FOSC.sec"),space(prog))) int _FOSC = (x);
/*
** Only one invocation of FOSC should appear in a project,
** at the top of a C source file (outside of any function).
**
** The following constants can be used to set FOSC.
** Multiple options may be combined, as shown:
**
** _FOSC( OPT1_ON & OPT2_OFF & OPT3_PLL )
**
** Primary Oscillator Mode:
** XTL XTL
** HS HS
** XT XT
** XT_PLL4 XT w/PLL 4x
** XT_PLL8 XT w/PLL 8x
** XT_PLL16 XT w/PLL 16x
** ERCIO ERCIO
** ERC ERC
** EC EC
** ECIO ECIO
** ECIO_PLL4 ECIO w/ PLL 4x
** EC_PLL4 ECIO w/ PLL 4x
** ECIO_PLL8 ECIO w/ PLL 8x
** EC_PLL8 ECIO w/ PLL 8x
** ECIO_PLL16 ECIO w/ PLL 16x
** EC_PLL16 ECIO w/ PLL 16x
**
** Oscillator Source:
** LPOSC Low-Power 32KHz Osc <TMR1 Osc>
** LP Low-Power 32KHz Osc <TMR1 Osc>
** FRC Internal Fast RC
** LPRC Internal Low-Power RC
** PRI Primary Oscillator
**
** Clock Switching and Monitor:
** CSW_FSCM_ON Sw Enabled, Mon Enabled
** CSW_ON_FSCM_OFF Sw Enabled, Mon Disabled
** CSW_FSCM_OFF Sw Disabled, Mon Disabled
**
*/
#define XTL 0xFFF0
#define HS 0xFFF2
#define XT 0xFFF4
#define XT_PLL4 0xFFF5
#define XT_PLL8 0xFFF6
#define XT_PLL16 0xFFF7
#define ERCIO 0xFFF8
#define ERC 0xFFF9
#define EC 0xFFFB
#define ECIO 0xFFFC
#define ECIO_PLL4 0xFFFD
#define EC_PLL4 0xFFFD
#define ECIO_PLL8 0xFFFE
#define EC_PLL8 0xFFFE
#define ECIO_PLL16 0xFFFF
#define EC_PLL16 0xFFFF
#define LPOSC 0xFCFF
#define LP 0xFCFF
#define FRC 0xFDFF
#define LPRC 0xFEFF
#define PRI 0xFFFF
#define CSW_FSCM_ON 0x3FFF
#define CSW_ON_FSCM_OFF 0x7FFF
#define CSW_FSCM_OFF 0xBFFF