Mercurial > public > hwos_code
comparison src/comm.asm @ 420:789230298511
fix handling for new flash memory chip
author | heinrichsweikamp |
---|---|
date | Fri, 29 Apr 2016 15:38:57 +0200 |
parents | db25f2028074 |
children | ccaaac45b61a |
comparison
equal
deleted
inserted
replaced
419:881399cf0f5b | 420:789230298511 |
---|---|
302 | 302 |
303 rcall comm_write_get_byte | 303 rcall comm_write_get_byte |
304 btfsc rs232_recieve_overflow ; Got byte? | 304 btfsc rs232_recieve_overflow ; Got byte? |
305 bra comm_download_mode0 ; No, Done. | 305 bra comm_download_mode0 ; No, Done. |
306 movff RCREG1,lo | 306 movff RCREG1,lo |
307 ; Got 4bytes: 3bytes address and 1 bytes (lo) amount of 4kB blocks | 307 |
308 ; Got 4bytes: 3bytes address and 1 bytes (lo) amount of 4kB blocks | |
308 | 309 |
309 comm_erase_range4kb1: | 310 comm_erase_range4kb1: |
310 call ext_flash_erase4kB ; Erase block! | 311 call ext_flash_erase4kB ; Erase block! |
311 | 312 |
312 movlw 0x10 | 313 movlw 0x10 |
344 bra comm_download_mode0 ; No, Done. | 345 bra comm_download_mode0 ; No, Done. |
345 | 346 |
346 comm_write_range_loop: | 347 comm_write_range_loop: |
347 rcall comm_write_get_byte | 348 rcall comm_write_get_byte |
348 btfsc rs232_recieve_overflow ; Got byte? | 349 btfsc rs232_recieve_overflow ; Got byte? |
349 bra comm_download_mode0 ; No, Done (and send OK byte too). | 350 bra comm_download_mode0 ; No, Done (and send OK byte too). |
350 movf RCREG1,W | 351 movf RCREG1,W |
351 call ext_flash_byte_write ; write one byte | 352 call ext_flash_byte_write ; write one byte |
352 call incf_ext_flash_address_p1 ; increase address+1 | 353 call incf_ext_flash_address_p1 ; increase address+1 |
353 bra comm_write_range_loop | 354 bra comm_write_range_loop |
354 | 355 |
355 ;----------------------------------------------------------------------------- | 356 ;----------------------------------------------------------------------------- |
356 | 357 |
357 comm_send_range: ; Get 3 bytes start address and 3 bytes amount | 358 comm_send_range: ; Get 3 bytes start address and 3 bytes amount |
358 movlw 0x20 ; send echo | 359 movlw 0x20 ; send echo |