firmware: automagically define FW-labels in driver
git-svn-id: https://dedected.org/svn/trunk@38 8d8ab74c-27aa-4a3d-9bde-523a2bc1f624
This commit is contained in:
parent
856467b1a5
commit
4430396478
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue