X-Git-Url: http://git.smho.de/gw/?a=blobdiff_plain;f=common%2FOWRomFunctions.s;h=6abeffc79fce86efc3e89be7ccb2b9d32e49bcd3;hb=HEAD;hp=e5c007b134b715e8bbe0829343a7b72f7f22876f;hpb=a6a04f58e4afd20f206fdf4a8a7b3ce4062f1b67;p=owSlave2.git diff --git a/common/OWRomFunctions.s b/common/OWRomFunctions.s index e5c007b..6abeffc 100644 --- a/common/OWRomFunctions.s +++ b/common/OWRomFunctions.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 @@ -169,11 +169,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 @@ -185,6 +181,8 @@ hrc_set_searchrom: lds r_rwbyte,owid ;erstes Byte lesen rjmp h_searchrom_next_bit + + hrc_start_read_command: ;Skip rom und Matchrom ok... ldi r_mode,OW_READ_COMMAND CRCInit1 @@ -274,7 +272,7 @@ h_searchroms_next: ; Setup next bit configZ owid,r_bcount ld r_rwbyte,Z - sts srbyte,r_rwbyte + sts srbyte,r_rwbyte ;#################### Doppelung ist schon in h_searchrom_next_bit rjmp h_searchrom_next_bit h_searchroms_next_bit: ;next Bit lesen @@ -312,30 +310,36 @@ h_readrom_all: ;--------------------------------------------------- h_fwconfiginfo: - 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_info,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 - rjmp handle_end_inc +#elif defined _CRC16_ + lds r_temp,crc + com r_temp + sts config_info+24,r_temp + lds r_temp,crc+1 + com r_temp + sts config_info+25,r_temp + rjmp h_fwconfiginfo_end +#endif h_fwconfiginfo_all: rjmp handle_end_sleep @@ -438,31 +442,9 @@ spause: .global OWINIT OWINIT: -#ifndef _DIS_FLASH_ -; check for bootloader jumper - ;vor allen anderen Registerconfigs push r_temp - ldi r_temp,(1<