comparison src/external_flash.asm @ 6:13cda523891f

bugfix: dive length in normal header
author heinrichsweikamp
date Fri, 10 May 2013 15:56:17 +0200
parents 11d4fc797f74
children 05f2100d2eb8
comparison
equal deleted inserted replaced
5:ed1dec74d5fd 6:13cda523891f
142 write_byte_ext_flash_plus_h1: 142 write_byte_ext_flash_plus_h1:
143 movf temp1,W 143 movf temp1,W
144 rcall ext_flash_byte_write ; Write the byte 144 rcall ext_flash_byte_write ; Write the byte
145 bra incf_ext_flash_address_p1 ; +1 and return 145 bra incf_ext_flash_address_p1 ; +1 and return
146 146
147 global write_byte_ext_flash_plus_nocnt
148 write_byte_ext_flash_plus_nocnt: ; Write from WREG and increase address after write with banking at 0x200000
149 movwf temp1 ; store data
150 bra write_byte_ext_flash_plus2
151
147 global write_byte_ext_flash_plus ; Write from WREG and increase address after write with banking at 0x200000 152 global write_byte_ext_flash_plus ; Write from WREG and increase address after write with banking at 0x200000
148 write_byte_ext_flash_plus: 153 write_byte_ext_flash_plus:
149 movwf temp1 ; store data 154 movwf temp1 ; store data
150 155
151 ; First, increase dive length counter 156 ; First, increase dive length counter
152 incf ext_flash_dive_counter+0,F 157 incf ext_flash_dive_counter+0,F
153 movlw .0 158 movlw .0
154 addwfc ext_flash_dive_counter+1,F 159 addwfc ext_flash_dive_counter+1,F
155 addwfc ext_flash_dive_counter+2,F ; 24bit++ 160 addwfc ext_flash_dive_counter+2,F ; 24bit++
156 161
162 write_byte_ext_flash_plus2:
157 ; Now test if write is done at first byte of 4kB block 163 ; Now test if write is done at first byte of 4kB block
158 ; if yes -> delete 4kB block first 164 ; if yes -> delete 4kB block first
159 tstfsz ext_flash_address+0 ; at 0x00? 165 tstfsz ext_flash_address+0 ; at 0x00?
160 bra write_byte_ext_flash_plus1 ; No, normal Write 166 bra write_byte_ext_flash_plus1 ; No, normal Write
161 167