X-Git-Url: http://git.smho.de/?a=blobdiff_plain;f=common%2FOWRomFunctionsDual.s;h=59b3d40757c10d338bb375afda00108c7879c41f;hb=28c2911a7459ae2977c0cb0228c0ca2af1c345bf;hp=c28d855e35666f036f29d2e88dc31d9a657aabae;hpb=22f8e0389304cc3f78fec16d8ecc30069afe8584;p=owSlave2.git diff --git a/common/OWRomFunctionsDual.s b/common/OWRomFunctionsDual.s index c28d855..59b3d40 100644 --- a/common/OWRomFunctionsDual.s +++ b/common/OWRomFunctionsDual.s @@ -61,13 +61,15 @@ #define OW_SEARCHROMR 4 ; next resive master answer #define OW_READ_COMMAND1 5 #define OW_READ_COMMAND2 6 +#define OW_FWCONFIGINFO1 7 +#define OW_FWCONFIGINFO2 8 #ifdef _CHANGEABLE_ID_ -#define OW_WRITE_NEWID 7 -#define OW_READ_NEWID 8 -#define OW_SET_NEWID 9 -#define OW_FIRST_COMMAND 10 +#define OW_WRITE_NEWID 9 +#define OW_READ_NEWID 10 +#define OW_SET_NEWID 11 +#define OW_FIRST_COMMAND 12 .comm newid,8 .comm idtable,64 @@ -79,7 +81,7 @@ #else -#define OW_FIRST_COMMAND 7 +#define OW_FIRST_COMMAND 9 #endif #ifndef _DIS_FLASH_ @@ -94,6 +96,12 @@ #endif +.macro FW_CONFIG_INFO1 + cljmp 0x85,hrc_fw_configinfo1 +.endm +.macro FW_CONFIG_INFO2 + cljmp 0x85,hrc_fw_configinfo2 +.endm #ifdef _CHANGEABLE_ID_ ; lesen der ID aus dem EEPROM beim Start @@ -145,6 +153,8 @@ handle_stable: rjmp h_searchromr rjmp h_readcommand1 rjmp h_readcommand2 + rjmp h_fwconfiginfo1 + rjmp h_fwconfiginfo2 #ifdef _CHANGEABLE_ID_ rjmp h_writeid rjmp h_readid @@ -168,7 +178,7 @@ hrc_jmp_flasher: lds r_temp,flashmarker cpi r_temp,2 brne hrc_jmp_flasher_inc - ldi r_temp,0xE0 + ldi r_temp,0xC0 push r_temp ldi r_temp,0x0E push r_temp @@ -216,6 +226,19 @@ hrc_set_alarm_search: ; sonst tue nichts rjmp handle_end_sleep +hrc_fw_configinfo1: + ldi r_mode,OW_FWCONFIGINFO1 + ldi r_sendflag,1 + CRCInit2 + rjmp h_fwconfiginfo1 + +hrc_fw_configinfo2: + ldi r_mode,OW_FWCONFIGINFO2 + ldi r_sendflag,1 + CRCInit2 + rjmp h_fwconfiginfo2 + + ;--------------------------------------------------- ; MATCH ROM ;--------------------------------------------------- @@ -353,6 +376,43 @@ h_searchromr: ; stelle um auf empfangen rjmp handle_end_no_bcount +;--------------------------------------------------- +; FW_CONFIG_INFO +;--------------------------------------------------- + +h_fwconfiginfo1: + configZ config_info1,r_bytep + rjmp h_fwconfiginfo_go +h_fwconfiginfo2: + configZ config_info2,r_bytep + +h_fwconfiginfo_go: + cpi r_bytep,16 + breq h_fwconfiginfo_crc +#ifdef _CRC8_ + cpi r_bytep,17 + breq h_fwconfiginfo_all +#elif defined _CRC16_ + cpi r_bytep,17 + breq h_fwconfiginfo_crc2 + cpi r_bytep,18 + breq h_fwconfiginfo_all +#else + cpi r_bytep,16 + breq h_fwconfiginfo_all +#warning No CRC known code implemented +#endif + ld r_rwbyte,Z + rjmp handle_end_inc +h_fwconfiginfo_crc: + lds r_rwbyte,crc + rjmp handle_end +h_fwconfiginfo_crc2: + lds r_rwbyte,crc+1 + rjmp handle_end +h_fwconfiginfo_all: + rjmp handle_end_sleep + ;--------------------------------------------------- ; CHANGE ROM FUNCTIONS @@ -499,7 +559,7 @@ OWINIT: sbic _SFR_IO_ADDR(PINA),PINA5 rjmp owinit_botest_end ;PINA5 nicht 0.... nicht verbunden cbi _SFR_IO_ADDR(DDRA),PINA4 - ldi r_temp,0xE0 + ldi r_temp,0xC0 push r_temp ldi r_temp,0x0E push r_temp @@ -552,6 +612,27 @@ owinit_odgen2: brne owinit_odgen2 dec r_bytep brne owinit_odgen1 + ;copy ids in config bytes + ldi xl,lo8(owid1) + ldi xh,hi8(owid1) + ldi yl,lo8(config_info2+9) + ldi yh,hi8(config_info2+9) + ldi r_temp,7 +owinit_cpconfig1: + ld r_rwbyte,X+ + st Y+,r_rwbyte + dec r_temp + brne owinit_cpconfig1 + ldi xl,lo8(owid2) + ldi xh,hi8(owid2) + ldi yl,lo8(config_info1+9) + ldi yh,hi8(config_info1+9) + ldi r_temp,7 +owinit_cpconfig2: + ld r_rwbyte,X+ + st Y+,r_rwbyte + dec r_temp + brne owinit_cpconfig2 ldi r_temp,0