From ca331520b55080689fa20138bd549207cdd34442 Mon Sep 17 00:00:00 2001 From: tecodev Date: Sat, 28 Feb 2009 19:23:47 +0000 Subject: [PATCH] * src/regression/configword.c: apply patch from #2488150 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5395 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 1 + src/regression/configword.c | 38 +++++++++---------------------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 97a730fd..95757f34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ src/regression/compare7.c, src/regression/compare8.c, src/regression/compare9.c: reset watchdog timer in time + * src/regression/configword.c: apply patch from #2488150 * src/pic/glue.c (pic14createInterruptVect): pin RESET vector handler to 0x0000 as the linker no longer knows STARTUP sections * src/pic/pcode.c (register_reassign, ReuseReg): applied modified diff --git a/src/regression/configword.c b/src/regression/configword.c index 39beb9e8..fb4728a8 100644 --- a/src/regression/configword.c +++ b/src/regression/configword.c @@ -1,41 +1,21 @@ #include "gpsim_assert.h" +#include "picregs.h" + /* configword.c - illustrates how the configuration word can * be assigned */ unsigned char failures=0; unsigned char dummy; -/* copied from 16f877.inc file supplied with gpasm */ - -#define _CP_ALL 0x0FCF -#define _CP_HALF 0x1FDF -#define _CP_UPPER_256 0x2FEF -#define _CP_OFF 0x3FFF -#define _DEBUG_ON 0x37FF -#define _DEBUG_OFF 0x3FFF -#define _WRT_ENABLE_ON 0x3FFF -#define _WRT_ENABLE_OFF 0x3DFF -#define _CPD_ON 0x3EFF -#define _CPD_OFF 0x3FFF -#define _LVP_ON 0x3FFF -#define _LVP_OFF 0x3F7F -#define _BODEN_ON 0x3FFF -#define _BODEN_OFF 0x3FBF -#define _PWRTE_OFF 0x3FFF -#define _PWRTE_ON 0x3FF7 -#define _WDT_ON 0x3FFF -#define _WDT_OFF 0x3FFB -#define _LP_OSC 0x3FFC -#define _XT_OSC 0x3FFD -#define _HS_OSC 0x3FFE -#define _RC_OSC 0x3FFF - +#ifdef __pic14 typedef unsigned int word; +static word __at(0x2007) _config = _WDT_OFF & _PWRTE_ON; +#else /* !__pic14 */ +static __code char __at(__CONFIG2L) _conf2l = _PUT_ON_2L; +static __code char __at(__CONFIG2H) _conf2h = _WDT_OFF_2H; +#endif /* !__pic14 */ -//word at 0x2007 CONFIG = _WDT_OFF & _PWRTE_ON; - - -/* to do -- write a test that puts the PIC to sleep, +/* TODO -- write a test that puts the PIC to sleep, * and verify that the WDT wakes it up */ void -- 2.30.2