X-Git-Url: http://git.smho.de/gw/?p=owSlave2.git;a=blobdiff_plain;f=common%2FOWRomFunctionsDual.s;h=d4d13d56a8a28a06baf83831410334c2146edc4b;hp=cb4ac7fcb556fa1e4e24324dc17a5f5af24d190e;hb=HEAD;hpb=3f2aceaf525eeceff3baece206b2048bbf286c40 diff --git a/common/OWRomFunctionsDual.s b/common/OWRomFunctionsDual.s index cb4ac7f..d4d13d5 100644 --- a/common/OWRomFunctionsDual.s +++ b/common/OWRomFunctionsDual.s @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -105,7 +105,7 @@ cljmp 0x85,hrc_fw_configinfo2 .endm -#ifdef _CHANGEABLE_ID_ +//#ifdef _CHANGEABLE_ID_ //--> ID vom EEPROM lesen auch wenn sie sich nicht ändern laesst ; lesen der ID aus dem EEPROM beim Start read_EEPROM_ID1: ldi r_temp2,lo8(E2END) @@ -139,7 +139,7 @@ read_EEPROM_ID_loop: brne read_EEPROM_ID_loop read_EEPROM_ID_end: ret -#endif +//#endif @@ -187,11 +187,7 @@ hrc_jmp_flasher: lds r_temp,flashmarker cpi r_temp,2 brne hrc_jmp_flasher_inc - ldi r_temp,0xC0 - push r_temp - ldi r_temp,0x0E - push r_temp - ret ; Direkter Sprung zum Bootloader + JMP_FLASHER hrc_jmp_flasher_inc: inc r_temp sts flashmarker,r_temp @@ -213,13 +209,13 @@ hrc_set_searchrom: rjmp h_searchrom_next_bit hrc_start_read_command: ;Skip rom und Matchrom ok... + CRCInit1 lds r_temp,srbyte cpi r_temp,1 breq hrc_start_read_command1 cpi r_temp,2 breq hrc_start_read_command2 rjmp handle_end_sleep - CRCInit1 hrc_start_read_command1: ldi r_mode,OW_READ_COMMAND1 rjmp handle_end @@ -241,17 +237,24 @@ hrc_set_alarm_search: rjmp handle_end_sleep hrc_fw_configinfo1: +#ifdef _NO_CONFIGBYTES_ + rjmp handle_end_sleep +#else ldi r_mode,OW_FWCONFIGINFO1 ldi r_sendflag,1 CRCInit2 rjmp h_fwconfiginfo1 +#endif hrc_fw_configinfo2: +#ifdef _NO_CONFIGBYTES_ + rjmp handle_end_sleep +#else ldi r_mode,OW_FWCONFIGINFO2 ldi r_sendflag,1 CRCInit2 rjmp h_fwconfiginfo2 - +#endif ;--------------------------------------------------- ; MATCH ROM @@ -395,38 +398,67 @@ h_searchromr: ; stelle um auf empfangen ;--------------------------------------------------- h_fwconfiginfo1: +#ifdef _NO_CONFIGBYTES_ +h_fwconfiginfo2: + rjmp handle_end_sleep +#else configZ config_info1,r_bytep rjmp h_fwconfiginfo_go h_fwconfiginfo2: configZ config_info2,r_bytep +/*#ifdef _CRC16_ + cpi r_bytep,24 + breq h_fwconfiginfo_crc + cpi r_bytep,26 + breq h_fwconfiginfo_all +//h_fwconfiginfo_end: + //configZ config_info1,r_bytep //crc16 wird in config_info1 gespeichert, auch bei config_info2 + configZ config_info2,r_bytep + ld r_rwbyte,Z + rjmp handle_end_inc +#endif +*/ h_fwconfiginfo_go: - cpi r_bytep,16 + cpi r_bytep,24 breq h_fwconfiginfo_crc -#ifdef _CRC8_ - cpi r_bytep,17 +#if defined(_CRC8_) || defined( _CRC8_16_) + cpi r_bytep,25 breq h_fwconfiginfo_all #elif defined _CRC16_ - cpi r_bytep,17 - breq h_fwconfiginfo_crc2 - cpi r_bytep,18 + cpi r_bytep,26 breq h_fwconfiginfo_all #else - cpi r_bytep,16 + cpi r_bytep,25 breq h_fwconfiginfo_all #warning No CRC known code implemented #endif + +h_fwconfiginfo_end: + //configZ config_info1,r_bytep //crc16 wird in config_info1 gespeichert, auch bei config_info2 + //configZ config_info1,r_bytep ld r_rwbyte,Z rjmp handle_end_inc h_fwconfiginfo_crc: +#ifdef _CRC8_ lds r_rwbyte,crc rjmp handle_end_inc -h_fwconfiginfo_crc2: - lds r_rwbyte,crc+1 +#elif defined _CRC16_ + lds r_temp,crc + com r_temp + sts config_info1+24,r_temp + lds r_temp,crc+1 + com r_temp + sts config_info1+25,r_temp + ldi r_mode,OW_FWCONFIGINFO1 //auch CRC vom Dev 2 wird in Configinfo 1 geschrieben also da weiter machen + configZ config_info1,r_bytep + ld r_rwbyte,Z rjmp handle_end_inc + +#endif h_fwconfiginfo_all: rjmp handle_end_sleep - +#endif ;--------------------------------------------------- ; CHANGE ROM FUNCTIONS @@ -547,32 +579,11 @@ spause: .global OWINIT OWINIT: -#ifndef _DIS_FLASH_ ; check for bootloader jumper ;vor allen anderen Registerconfigs push r_temp - - ldi r_temp,(1<