From b9e8a6ef91caf381fbc81606a3c442b77974ed62 Mon Sep 17 00:00:00 2001 From: travisutk Date: Thu, 9 Dec 2010 19:33:51 +0000 Subject: [PATCH] Added the HALT preprocessor directive so that these files may be used directly. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@781 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- shellcode/chipcon/cc1110/Makefile | 2 ++ shellcode/chipcon/cc1110/cc1110-ext.h | 5 +++++ shellcode/chipcon/cc1110/crystal.c | 2 ++ 3 files changed, 9 insertions(+) diff --git a/shellcode/chipcon/cc1110/Makefile b/shellcode/chipcon/cc1110/Makefile index f29eab9..ccd08b8 100644 --- a/shellcode/chipcon/cc1110/Makefile +++ b/shellcode/chipcon/cc1110/Makefile @@ -1,3 +1,5 @@ +# These targets are compiled to execute at the beginning of RAM. +# Each should conclude with HALT (0xA5). CC=sdcc --code-loc 0xF000 objs=crystal.ihx diff --git a/shellcode/chipcon/cc1110/cc1110-ext.h b/shellcode/chipcon/cc1110/cc1110-ext.h index 7c84a0a..f3c73fc 100644 --- a/shellcode/chipcon/cc1110/cc1110-ext.h +++ b/shellcode/chipcon/cc1110/cc1110-ext.h @@ -9,6 +9,11 @@ #define _IOCCXX10_BITDEF_H +//Added by Travis Goodspeed +#define HALT __asm \ + .byte 0xA5 \ + __endasm; + /* SEE DATA SHEET FOR DETAILS ABOUT THE FOLLOWING BIT MASKS */ diff --git a/shellcode/chipcon/cc1110/crystal.c b/shellcode/chipcon/cc1110/crystal.c index 36f929b..226cbfd 100644 --- a/shellcode/chipcon/cc1110/crystal.c +++ b/shellcode/chipcon/cc1110/crystal.c @@ -8,4 +8,6 @@ void main(){ CLKCON = (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) | CLKSPD_DIV_1; // Select xtal osc, 26 MHz while (CLKCON & CLKCON_OSC); // Wait for change to take effect SLEEP |= SLEEP_OSC_PD; // Turn off the other high speed oscillator (the RC osc) + + HALT; } -- 2.20.1