diff code_part1/OSTC_code_asm_part1/start.asm @ 605:c3336f944e53

reset CFIII properly
author heinrichsweikamp
date Wed, 04 Jul 2012 22:21:07 +0200
parents 16f4eafc197e
children f87205426add
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/start.asm	Wed Jul 04 11:08:27 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Wed Jul 04 22:21:07 2012 +0200
@@ -241,18 +241,23 @@
 	read_int_eeprom	d'92'			; Read number of CF used in this firmware	
 	movlw	max_custom_number		; Defined in definitions.asm
 	cpfseq	EEDATA					; Compare with last version
-	bra		restart_01				; New CF, show warning and store new number
-	bra		restart_1				; No new CF, continue with boot
-restart_01:
+	bra		restart1				; New CF, show warning and store new number
+	bra		restart2				; No new CF, continue with boot
+
+restart1:
+; Reset Bank2 if required
+	movlw	max_custom_number
+	btfsc	WREG,6					; >63?
+	call	reset_all_cf_bank2
+; Show info screen
+	call	PLED_boot               ; PLED boot (Incl. Clear Screen!)
+	rcall	display_new_cf_installed; Show info screen
 ; Save new number of current CF count
-	call	PLED_boot               ; PLED boot (Incl. Clear Screen!)
-	rcall	display_new_cf_installed; Show warning
 	movlw	max_custom_number		; Defined in definitions.asm
 	movwf	EEDATA
 	write_int_eeprom	d'92'		; Store number of CF used in this firmware
 
-restart_1:
-
+restart2:
 ; Set Debug mode?
 	read_int_eeprom	d'39'
 	bsf		debug_mode