* src/regression/configword.c: apply patch from #2488150
[fw/sdcc] / src / regression / configword.c
1 #include "gpsim_assert.h"
2 #include "picregs.h"
3
4 /* configword.c - illustrates how the configuration word can
5  * be assigned */
6
7 unsigned char failures=0;
8 unsigned char dummy;
9
10 #ifdef __pic14
11 typedef unsigned int word;
12 static word __at(0x2007) _config = _WDT_OFF & _PWRTE_ON;
13 #else /* !__pic14 */
14 static __code char __at(__CONFIG2L) _conf2l = _PUT_ON_2L;
15 static __code char __at(__CONFIG2H) _conf2h = _WDT_OFF_2H;
16 #endif /* !__pic14 */
17
18 /* TODO -- write a test that puts the PIC to sleep,
19  * and verify that the WDT wakes it up */
20
21 void
22 done()
23 {
24   ASSERT(MANGLE(failures) == 0);
25   PASSED();
26 }
27
28 void main(void)
29 {
30   dummy = 0;
31
32   done();
33 }