/* Register FOSCSEL (0x57f8) */
extern __attribute__((space(prog))) int _FOSCSEL;
#define _FOSCSEL(x) __attribute__((section("__FOSCSEL.sec"),space(prog))) int _FOSCSEL = (x);
/*
** Only one invocation of FOSCSEL 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 FOSCSEL.
** Multiple options may be combined, as shown:
**
** _FOSCSEL( OPT1_ON & OPT2_OFF & OPT3_PLL )
**
** Oscillator Source Selection:
** FNOSC_FRC Internal Fast RC (FRC)
** FNOSC_FRCPLL Fast RC Oscillator with divide-by-N with PLL module (FRCPLL)
** FNOSC_PRI Primary Oscillator (XT, HS, EC)
** FNOSC_PRIPLL Primary Oscillator with PLL module (XT + PLL, HS + PLL, EC + PLL)
** FNOSC_LPRC Low-Power RC Oscillator (LPRC)
** FNOSC_FRCDIVN Internal Fast RC (FRC) Oscillator with postscaler
**
** Two-speed Oscillator Start-up Enable bit:
** IESO_OFF Start up with user-selected oscillator source
** IESO_ON Start up device with FRC, then switch to user-selected oscillator source
**
*/
#define FNOSC_FRC 0xFFF8
#define FNOSC_FRCPLL 0xFFF9
#define FNOSC_PRI 0xFFFA
#define FNOSC_PRIPLL 0xFFFB
#define FNOSC_LPRC 0xFFFD
#define FNOSC_FRCDIVN 0xFFFF
#define IESO_OFF 0xFF7F
#define IESO_ON 0xFFFF
2:_FOSCSEL(FNOSC_PRI&IESO_OFF); 我们在程序开头由此句来声明我们的配置位是0XFFFA&0XFF7F=0XFF7A