Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/start.asm @ 384:904863f96582 64kByte Logbook
Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
author | heinrichsweikamp |
---|---|
date | Sat, 18 Jun 2011 11:26:22 +0200 |
parents | 620c95e23e32 |
children | a847f416e67e |
comparison
equal
deleted
inserted
replaced
383:d7a70654d968 | 384:904863f96582 |
---|---|
93 call calc_deko_surfmode ; calculate desaturation every minute | 93 call calc_deko_surfmode ; calculate desaturation every minute |
94 call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode | 94 call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode |
95 movlb b'00000001' ; select ram bank 1 | 95 movlb b'00000001' ; select ram bank 1 |
96 | 96 |
97 ; check firmware and reset Custom Functions after an update | 97 ; check firmware and reset Custom Functions after an update |
98 movlw LOW 0x101 | 98 movlw d'1' |
99 movwf EEADR | 99 movwf EEADR |
100 movlw HIGH 0x101 | 100 movlw d'1' |
101 movwf EEADRH | 101 movwf EEADRH |
102 call read_eeprom ; read current version x | 102 call read_eeprom ; read current version x |
103 movff EEDATA,temp1 | 103 movff EEDATA,temp1 |
104 incf EEADR,F ; set to 0x102 | 104 incf EEADR,F ; set to 0x102 |
105 call read_eeprom ; read current version y | 105 call read_eeprom ; read current version y |
114 cpfseq temp2 ; compare version y | 114 cpfseq temp2 ; compare version y |
115 bra check_firmware_new ; is not equal -> reset CF and store new version in EEPROM | 115 bra check_firmware_new ; is not equal -> reset CF and store new version in EEPROM |
116 bra restart ; x and y are equal -> do not reset cf | 116 bra restart ; x and y are equal -> do not reset cf |
117 | 117 |
118 check_firmware_new: | 118 check_firmware_new: |
119 movlw LOW 0x101 ; store current version in EEPROM | 119 movlw d'1' ; store current version in EEPROM |
120 movwf EEADR | 120 movwf EEADR |
121 movlw HIGH 0x101 | 121 movlw d'1' |
122 movwf EEADRH | 122 movwf EEADRH |
123 movlw softwareversion_x | 123 movlw softwareversion_x |
124 movwf EEDATA | 124 movwf EEDATA |
125 call write_eeprom ; write version x | 125 call write_eeprom ; write version x |
126 incf EEADR,F ; set to 0x102 | 126 incf EEADR,F ; set to 0x102 |