diff options
author | mazzoo <mazzoo@8d8ab74c-27aa-4a3d-9bde-523a2bc1f624> | 2009-01-13 08:32:08 +0000 |
---|---|---|
committer | mazzoo <mazzoo@8d8ab74c-27aa-4a3d-9bde-523a2bc1f624> | 2009-01-13 08:32:08 +0000 |
commit | 443039647890ef369ea165372e23daaeb43cc3da (patch) | |
tree | 414d7759cbc5505ee3923d1e41cfb4b95109c293 | |
parent | 856467b1a5f702fbd130f520e6624bb4fb113b16 (diff) |
firmware: automagically define FW-labels in driver
git-svn-id: https://dedected.org/svn/trunk@38 8d8ab74c-27aa-4a3d-9bde-523a2bc1f624
-rw-r--r-- | com-on-air_cs-linux/firmware/Makefile | 20 | ||||
-rw-r--r-- | com-on-air_cs-linux/firmware/sc14421_II_sniff_sync.asm | 8 | ||||
-rw-r--r-- | com-on-air_cs-linux/sc14421_firmware.h | 31 | ||||
-rw-r--r-- | com-on-air_cs-linux/sc14421_sniffer.c | 28 |
4 files changed, 48 insertions, 39 deletions
diff --git a/com-on-air_cs-linux/firmware/Makefile b/com-on-air_cs-linux/firmware/Makefile index cd8a096..239cf9b 100644 --- a/com-on-air_cs-linux/firmware/Makefile +++ b/com-on-air_cs-linux/firmware/Makefile @@ -11,27 +11,33 @@ BIN2C=./bin2c all: ../$(FW).h ../$(FW).c -../$(FW).h: $(FW1).h $(FW2).h +../$(FW).h: $(foreach f,$(ALL_FW),$f.decl $f.label) cat sc14421_header.h $^ sc14421_footer.h > $@ -../$(FW).c: $(FW1).c $(FW2).c +../$(FW).c: $(foreach f,$(ALL_FW),$f.c) cat $^ > $@ -$(FW1).c $(FW2).c: $(FW1).bin $(FW2).bin $(BIN2C) +$(foreach f,$(ALL_FW),$f.c): $(foreach f,$(ALL_FW),$f.bin) $(BIN2C) $(BIN2C) $(@:.c=.bin) $(@:.c=)_fw > $@ %.bin: %.p p2bin $^ $@ -r 0-507 %.p: %.asm - asl $^ + asl -c $^ + mv $(@:.p=.h) $(@:.p=).label -$(FW1).h $(FW2).h: - echo "extern unsigned char $(@:.h=)_fw[509];" > $@ +%.label:%.p + @echo "labels in $@" + +$(foreach f,$(ALL_FW),$f.decl): + @echo "extern unsigned char $(@:.decl=)_fw[509];" > $@ clean: rm -f ../$(FW).h ../$(FW).c $(BIN2C) rm -f $(foreach f,$(ALL_FW),$f.c) - rm -f $(foreach f,$(ALL_FW),$f.h) + rm -f $(foreach f,$(ALL_FW),$f.p) + rm -f $(foreach f,$(ALL_FW),$f.decl) + rm -f $(foreach f,$(ALL_FW),$f.label) rm -f $(foreach f,$(ALL_FW),$f.bin) diff --git a/com-on-air_cs-linux/firmware/sc14421_II_sniff_sync.asm b/com-on-air_cs-linux/firmware/sc14421_II_sniff_sync.asm index 49c23fa..9d9e9de 100644 --- a/com-on-air_cs-linux/firmware/sc14421_II_sniff_sync.asm +++ b/com-on-air_cs-linux/firmware/sc14421_II_sniff_sync.asm @@ -47,7 +47,7 @@ PP22: WNT 2 BR SlotTable ;------------------------------------------------------------- -label_28: JMP RFInit +sync_label_28: JMP RFInit JMP label_B1 BR label_2D ;------------------------------------------------------------- @@ -264,10 +264,10 @@ label_C0: JMP RFInit SFieldFound: WNT 23 P_SC 0x00 -label_D1: JMP label_28 +sync_label_D1: JMP sync_label_28 U_INT0 WNT 22 -label_D4: BR label_C0 +sync_label_D4: BR label_C0 ;------------------------------------------------------------- InitDIP: B_RST @@ -295,4 +295,4 @@ InitDIP: B_RST SHARED PP0,PP2,PP4,PP6,PP8,PP10,PP12,PP14,PP16,PP18,PP20,PP22 SHARED JP0,JP2,JP4,JP6,JP8,JP10,JP12,JP14,JP16,JP18,JP20,JP22 - SHARED label_D1,label_D4,label_28 + SHARED sync_label_D1,sync_label_D4,sync_label_28 diff --git a/com-on-air_cs-linux/sc14421_firmware.h b/com-on-air_cs-linux/sc14421_firmware.h index 5533217..b9939e2 100644 --- a/com-on-air_cs-linux/sc14421_firmware.h +++ b/com-on-air_cs-linux/sc14421_firmware.h @@ -2,6 +2,37 @@ #define SC14421_FIRMWARE_H extern unsigned char sc14421_II_sniff_scan_fw[509]; +/* sc14421_II_sniff_scan.asm-Includefile für C-Programm */ +/* Ende Includefile für C-Programm */ extern unsigned char sc14421_II_sniff_sync_fw[509]; +/* sc14421_II_sniff_sync.asm-Includefile für C-Programm */ +#define PP0 0x4 +#define PP2 0x6 +#define PP4 0x8 +#define PP6 0xA +#define PP8 0xC +#define PP10 0xE +#define PP12 0x11 +#define PP14 0x13 +#define PP16 0x15 +#define PP18 0x17 +#define PP20 0x19 +#define PP22 0x1B +#define JP0 0x3 +#define JP2 0x5 +#define JP4 0x7 +#define JP6 0x9 +#define JP8 0xB +#define JP10 0xD +#define JP12 0x10 +#define JP14 0x12 +#define JP16 0x14 +#define JP18 0x16 +#define JP20 0x18 +#define JP22 0x1A +#define sync_label_D1 0xC8 +#define sync_label_D4 0xCB +#define sync_label_28 0x1F +/* Ende Includefile für C-Programm */ #endif diff --git a/com-on-air_cs-linux/sc14421_sniffer.c b/com-on-air_cs-linux/sc14421_sniffer.c index dc48289..1dda6d2 100644 --- a/com-on-air_cs-linux/sc14421_sniffer.c +++ b/com-on-air_cs-linux/sc14421_sniffer.c @@ -57,34 +57,6 @@ unsigned char pppacket[53] = {0x55,0x55,0x55,0x16,0x75}; /* FIXME:auto-generate all this stuff */ -#define PP0 0x4 -#define PP2 0x6 -#define PP4 0x8 -#define PP6 0xA -#define PP8 0xC -#define PP10 0xE -#define PP12 0x11 -#define PP14 0x13 -#define PP16 0x15 -#define PP18 0x17 -#define PP20 0x19 -#define PP22 0x1B -#define JP0 0x3 -#define JP2 0x5 -#define JP4 0x7 -#define JP6 0x9 -#define JP8 0xB -#define JP10 0xD -#define JP12 0x10 -#define JP14 0x12 -#define JP16 0x14 -#define JP18 0x16 -#define JP20 0x18 -#define JP22 0x1A -#define sync_label_D1 0xC8 -#define sync_label_D4 0xCB -#define sync_label_28 0x1F - int sync_jumptable[] = { JP0, 0, |