Power Switch

From Stu2
Jump to navigation Jump to search
export pic=~/MPLABXProjects/PowerSwitch.X/dist/XC8_PIC12F675/production
pk2cmd -M -PPIC12F675 -F$pic/PowerSwitch.X.production.hex

Had to modify #ifdef to so the XC8 compiler would allow the delay routines.

#ifdef __PICC__
/****************************************************************/
/* Built-in delay routine					*/
/****************************************************************/
#pragma intrinsic(_delay)
extern void _delay(unsigned long);
// NOTE: To use the macros below, YOU must have previously defined _XTAL_FREQ
#define __delay_us(x) _delay((unsigned long)((x)*(_XTAL_FREQ/4000000.0)))
#define __delay_ms(x) _delay((unsigned long)((x)*(_XTAL_FREQ/4000.0)))
#endif