changeset 6:13cda523891f

bugfix: dive length in normal header
author heinrichsweikamp
date Fri, 10 May 2013 15:56:17 +0200
parents ed1dec74d5fd
children 1ab317814dd7
files src/external_flash.asm src/external_flash.inc src/ghostwriter.asm
diffstat 3 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/external_flash.asm	Fri May 10 15:35:23 2013 +0200
+++ b/src/external_flash.asm	Fri May 10 15:56:17 2013 +0200
@@ -144,6 +144,11 @@
 	rcall		ext_flash_byte_write	; Write the byte
 	bra			incf_ext_flash_address_p1	; +1 and return
 
+    global  write_byte_ext_flash_plus_nocnt
+write_byte_ext_flash_plus_nocnt:       ; Write from WREG and increase address after write with banking at 0x200000
+    movwf		temp1					; store data
+    bra         write_byte_ext_flash_plus2
+
 	global	write_byte_ext_flash_plus	; Write from WREG and increase address after write with banking at 0x200000
 write_byte_ext_flash_plus:
 	movwf		temp1					; store data
@@ -154,6 +159,7 @@
     addwfc      ext_flash_dive_counter+1,F
     addwfc      ext_flash_dive_counter+2,F  ; 24bit++
 
+write_byte_ext_flash_plus2:
 	; Now test if write is done at first byte of 4kB block
 	; if yes -> delete 4kB block first
 	tstfsz		ext_flash_address+0			; at 0x00?
--- a/src/external_flash.inc	Fri May 10 15:35:23 2013 +0200
+++ b/src/external_flash.inc	Fri May 10 15:56:17 2013 +0200
@@ -16,6 +16,7 @@
 
 ; Writes
  extern	write_byte_ext_flash_plus	; Write from WREG and increase address after write with banking at 0x200000
+ extern write_byte_ext_flash_plus_nocnt
  extern write_byte_ext_flash_plus_header ; Write from WREG and increase address after write
  extern ext_flash_byte_write		; Writes one byte from WREG @ext_flash_address:3
  extern	write_spi1					; Just (dummy)write to read a byte
--- a/src/ghostwriter.asm	Fri May 10 15:35:23 2013 +0200
+++ b/src/ghostwriter.asm	Fri May 10 15:56:17 2013 +0200
@@ -336,11 +336,11 @@
     incf_ext_flash_address_0x20	d'6'        ; Skip internal "0xFA 0xFA #Divenumber:2 0xFA 0xFA" Header
     ; Store dive length
     movf   ext_flash_dive_counter+0,W
-	rcall	ghostwrite_byte_profile 	; WREG -> Profile in ext. flash
+	call    write_byte_ext_flash_plus_nocnt ; WREG -> Profile in ext. flash (No ext_flash_dive_counter:3 increase)
     movf   ext_flash_dive_counter+1,W
-	rcall	ghostwrite_byte_profile 	; WREG -> Profile in ext. flash
+	call    write_byte_ext_flash_plus_nocnt ; WREG -> Profile in ext. flash (No ext_flash_dive_counter:3 increase)
     movf   ext_flash_dive_counter+2,W
-	rcall	ghostwrite_byte_profile 	; WREG -> Profile in ext. flash
+	call    write_byte_ext_flash_plus_nocnt ; WREG -> Profile in ext. flash (No ext_flash_dive_counter:3 increase)
 
 ; profile recording done.