From: ian Date: Tue, 18 Oct 2005 22:46:26 +0000 (+0000) Subject: new detpic directory X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=992c80c5e4d7c8633b7c9f231d1011f727732aec;p=trains.git new detpic directory --- diff --git a/Makefile b/Makefile index 12ff9c8..8b1db90 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ all: picprogs hostprogs -PICPROGS_DIRS= iwjpictest cebpic +PICPROGS_DIRS= iwjpictest cebpic detpic HOSTPROGS_DIRS= layout hostside picprogs: diff --git a/cebpic/Makefile b/cebpic/Makefile index 26c69b2..5e7888e 100644 --- a/cebpic/Makefile +++ b/cebpic/Makefile @@ -3,48 +3,25 @@ PROGRAMS= led-flash send-serial panic reply-serial \ i2c-test i2c-test,slow morsepanic i2c-test-reply # booster-output-low -disabled because you forgot to cvs add it -ROUTINES= routines-led - INCLUDES= common.inc morse-auto.inc ../iwjpictest/insn-aliases.inc - +LIBS= routines.lib PICNOS= 0 1 3 -TARGETS= $(foreach i, $(PICNOS), perpic$i.hex) +include manypics.make -LIBS= routines.lib - -include ../common.make -include ../pic.make +ROUTINES= routines-led -clean: pic-clean - rm -f idlocs*.asm routines.lib +clean: manypic-clean + rm -f routines.lib routines.lib: $(addsuffix .o, $(ROUTINES)) rm -f $@.new gplib -c $@.new $^ mv -f $@.new $@ -ours-pindata.asm: ../layout/ours-pindata.asm - cp $< $@ - -morse-auto.inc morse-auto.asm: \ - morse-auto.%: morse-auto.asm-gen morse-auto.messages - ./$^ $* $o - morsepanic.hex morsepanic-withcfg.hex: morsepanic.o morse-auto.o i2c-test-reply.hex: i2c-test-reply.o morse-auto.o i2c-test-reply,slow.hex: i2c-test-reply,slow.o morse-auto.o %,slow.o: %.asm $(ASSEMBLE) -D SLOW_VERSION -c -o $@ $< - -idlocs%.asm: make-idlocs - ./$< $* >$@.new && mv -f $@.new $@ - -perpic%.hex: config.o idlocs%.o $(LIBS) - $(LINK) - -%-entire0.hex: %.o config.o idlocs0.o routines.lib - $(LINK) - -.PRECIOUS: idlocs%.asm diff --git a/cebpic/manypics.make b/cebpic/manypics.make new file mode 100644 index 0000000..a44c1e8 --- /dev/null +++ b/cebpic/manypics.make @@ -0,0 +1,26 @@ + +TARGETS= $(foreach i, $(PICNOS), perpic$i.hex) + +include ../common.make +include ../pic.make + +perpic%.hex: config.o idlocs%.o $(LIBS) + $(LINK) + +morse-auto.inc morse-auto.asm: \ + morse-auto.%: $(CEBPIC)morse-auto.asm-gen morse-auto.messages + ./$^ $* $o + +%-entire0.hex: %.o config.o idlocs0.o $(LIBS) + $(LINK) + +idlocs%.asm: $(CEBPIC)make-idlocs + ./$< $* >$@.new && mv -f $@.new $@ + +ours-pindata.asm: ../layout/ours-pindata.asm + cp $< $@ + +manypic-clean: pic-clean + rm -f idlocs*.asm + +.PRECIOUS: idlocs%.asm diff --git a/detpic/.cvsignore b/detpic/.cvsignore new file mode 100644 index 0000000..51de301 --- /dev/null +++ b/detpic/.cvsignore @@ -0,0 +1,8 @@ +*.hex +*.cod +*.lst +idlocs*.asm +gpsim.log +morse-auto.asm +morse-auto.inc +ours-pindata.asm diff --git a/detpic/Makefile b/detpic/Makefile new file mode 100644 index 0000000..e9981fe --- /dev/null +++ b/detpic/Makefile @@ -0,0 +1,13 @@ +PROGRAMS= detect +INCLUDES= common.inc morse-auto.inc ../iwjpictest/insn-aliases.inc +LIBS= panic.o routines-led.o variables.o +PICNOS= 0 1 3 +CEBPIC= ../cebpic/ + +include $(CEBPIC)manypics.make + +PICNOS= 0 1 3 + +TARGETS= $(foreach i, $(PICNOS), perpic$i.hex) + +clean: manypic-clean diff --git a/detpic/config.asm b/detpic/config.asm new file mode 100644 index 0000000..088b9d0 --- /dev/null +++ b/detpic/config.asm @@ -0,0 +1,20 @@ +; -*- fundamental -*- + + include /usr/share/gputils/header/p18f458.inc + +; __config _CONFIG1L, 0xff + __config _CONFIG1H, _OSCS_OFF_1H & _ECIO_OSC_1H + __config _CONFIG2L, _BOR_ON_2L & _PWRT_ON_2L & _BORV_45_2L + __config _CONFIG2H, _WDT_OFF_2H +; __config _CONFIG3L, 0xff +; __config _CONFIG3H, 0xff + __config _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVR_ON_4L +; __config _CONFIG4H, 0xff + __config _CONFIG5L, 0xff + __config _CONFIG5H, 0xff + __config _CONFIG6L, 0xff + __config _CONFIG6H, 0xff + __config _CONFIG7L, 0xff + __config _CONFIG7H, 0xff + + end diff --git a/detpic/morse-auto.messages b/detpic/morse-auto.messages new file mode 100644 index 0000000..0dd18ef --- /dev/null +++ b/detpic/morse-auto.messages @@ -0,0 +1,34 @@ +# This is the list of morse panic messages. Each line consists of: +# [
,
...] [; ] +# This file is converted to morse.asm by the Perl script morse.asm-gen. +# See morse.asm-gen for information about the format of the data stored +# in flash. Only addresses in the Access Bank are supported. + +# Suggested output by on the per-pic-led is: +# morse (red/black) contents of one address +# morse (red/black) contents of next address +# ... +# morse (red/black) contents of last address +# long pause +# go back to start +# Contents of addresses should preferably be read into a temporary +# buffer space somewhere so that each one is read once and that value +# remembered. + +# Main message listing. Kept sorted by morse for easy reference. +IH INTCON,INTCON3,PIR1,PIR2,PIR3 ; Interrupt source not found (high pri.) +IL INTCON,INTCON3,PIR1,PIR2,PIR3 ; Interrupt source not found (low pri.) +IP INTCON ; Interrupt of priority supposedly disabled +SA SSPCON2 ; Slave didn't I2C ack address +SD SSPCON2 ; Slave didn't I2C ack data + +# Messages starting with T are temporary entries for testing and development +TM PIE1,SSPSTAT,SSPCON1,SSPCON2 ; Master got I2C interrupt +TS PIE1,SSPSTAT,SSPCON1,SSPCON2 ; Slave got I2C interrupt +TF TESTFLASH ; test flash message +TG TESTFLASH,WREG4 ; test flash message +TI1 ; for iwj +TI2 ; for iwj +TI3 ; for iwj +TI4 ; for iwj +TI5 ; for iwj