/* JTAG/Code Protect/Write Protect/Clip-on Emulation mode
Watchdog Timer/ICD pins select */
_CONFIG1(JTAGEN_OFF & GCP_OFF & GWRP_OFF & FWDTEN_OFF & ICS_PGx2) 
_CONFIG2(FNOSC_PRI & IOL1WAY_OFF & POSCMOD_EC)
_CONFIG3(WPEND_WPSTARTMEM & WPCFG_WPCFGEN & WPDIS_WPEN & WPFP_WPFP2)


#define _CONFIG1(x) __attribute__((section("__CONFIG1.sec,code"))) int _CONFIG1 = (x);

/*
** Only one invocation of CONFIG1 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 CONFIG1.
** Multiple options may be combined, as shown:
**
** _CONFIG1( OPT1_ON & OPT2_OFF & OPT3_PLL )
**
**   JTAG:
**     JTAGEN_OFF           Disable JTAG interface
**
**   Code Protect:
**     GCP_OFF              Disable General Segment Code protection so that
**                          external reads and writes of memory can take place.
**
**   Write Protect:
**     GWRP_OFF             Disable so that internal write and erase operations
**                          can take place.
**
**   Background Debugger:   Use default which is reset to operational mode
**
**   Clip-on Emulation mode: Use default as this is reserved in data sheet.
**
**   ICD pins select:       Probably doesn't matter, but use RB6 and RB7.
**     ICS_PGx2             EMUC/EMUD share PGC2/PGD2
**
**   Watchdog Timer:
**     FWDTEN_OFF           Disable the watchdog timer
**
**   Windowed WDT:          Use default on the following as watchdog is disabled.
**
**   Watchdog prescaler:
**
**   Watchdog postscale:
**
*/

/* Enable CLK switch, Disable CLK monitor, OSCO or Fosc/2, 
Primary Oscillator Mode: Disabled, Internal Fast RC oscillator */
_CONFIG2(FNOSC_PRI & IOL1WAY_OFF & POSCMOD_EC)
/* Disable CLK switch and CLK monitor, OSCO or Fosc/2, HS oscillator,
Primary oscillator */


#define _CONFIG2(x) __attribute__((section("__CONFIG2.sec,code"))) int _CONFIG2 = (x);

/*
** Only one invocation of CONFIG2 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 CONFIG2.
** Multiple options may be combined, as shown:
**
** _CONFIG2( OPT1_ON & OPT2_OFF & OPT3_PLL )
**
**   Two Speed Start-up:    Use default
**
**   Oscillator Selection:  Use primamry OSC, no PLL.
**     FNOSC_PRI            Primary oscillator (XT, HS, EC)
**
**   Clock switching and clock monitor: Use default of disabled.
**
**   OSCO/RC15 function:  Use default of Fosc/2 out
**
**   RP Register Protection: Allow PPS pins to be set multiple times. 
**     IOL1WAY_OFF          Unlimited Writes To RP Registers
**
**   Oscillator Selection:  Set to External Clock for now, will change to XT
**     POSCMOD_EC           External clock
**     POSCMOD_XT           XT oscillator
**
*/



_CONFIG3(WPEND_WPSTARTMEM & WPCFG_WPCFGEN & WPDIS_WPEN & WPFP_WPFP2)


#define _CONFIG3(x) __attribute__((section("__CONFIG3.sec,code"))) int _CONFIG3 = (x);

/*
** Only one invocation of CONFIG3 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 CONFIG3.
** Multiple options may be combined, as shown:
**
** _CONFIG3( OPT1_ON & OPT2_OFF & OPT3_PLL )
**
**   Write Protection Location: Protect start of memory where the bootloader and vector tables  resides
**     WPEND_WPSTARTMEM     Write Protect from page 0 to WPFP
**
**   Write Protect Configuration Page: Protect config bits and last page of flash
**     WPCFG_WPCFGEN        Enabled
**
**   Write Protection Disable:  Enable segment code protection
**     WPDIS_WPEN           Enabled
**
**   Write Protection Flash Page:  Protect through page 2 (WPFP_WPFP2)
**     WPFP_WPFP0           0
**     WPFP_WPFP1           1
**     WPFP_WPFP2           2
**     WPFP_WPFP3           3
**     WPFP_WPFP4           4
**     WPFP_WPFP5           5
**     WPFP_WPFP6           6
**     WPFP_WPFP7           7
**     WPFP_WPFP8           8
**     WPFP_WPFP9           9
*/


