changeset 455:c512a868937c

last work for 2.0: Fixing 32kB boundary read for logbook
author heinrichsweikamp
date Tue, 30 Aug 2011 16:29:21 +0200
parents 69f1f3a1c645
children f4fbda6db91c
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/i2c_eeprom.asm code_part1/OSTC_code_asm_part1/interface.asm
diffstat 3 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Sun Aug 28 17:22:14 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Tue Aug 30 16:29:21 2011 +0200
@@ -21,10 +21,10 @@
 ; known bugs:
 ; ToDo:
 
-#DEFINE	softwareversion_x		d'1'		; Software version  XX.YY
-#DEFINE	softwareversion_y		d'98'		; Software version  XX.YY
+#DEFINE	softwareversion_x		d'2'		; Software version  XX.YY
+#DEFINE	softwareversion_y		d'0'		; Software version  XX.YY
 
-#DEFINE softwareversion_beta 	1 			; (and 0 for release) 
+#DEFINE softwareversion_beta 	0 			; (and 0 for release) 
 
 #DEFINE	max_custom_number		d'58'		; Number of last used custom function
 
@@ -455,7 +455,7 @@
 #DEFINE	switch_left			flag6,3	;=1: left switch pressed
 #DEFINE	switch_right		flag6,4	;=1: right switch pressed
 #DEFINE	uart_settime		flag6,5	;=1: enter time sync routine
-#DEFINE	FLAG_1              flag6,6	;=1: unused
+#DEFINE	eeprom_switched_b1  flag6,6	;=1: EEPROM read switched to bank1
 #DEFINE	twosecupdate		flag6,7	;=1: after any two seconds
 
 #DEFINE	dekostop_active			flag7,0	;=1: in deocompression mode
--- a/code_part1/OSTC_code_asm_part1/i2c_eeprom.asm	Sun Aug 28 17:22:14 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/i2c_eeprom.asm	Tue Aug 30 16:29:21 2011 +0200
@@ -127,6 +127,7 @@
 	clrf		ext_ee_temp2		; high address counter
 	bcf			second_FD			; clear flags
 	bcf			first_FD
+	bcf			eeprom_switched_b1
 get_free_EEPROM_location3:
 	bsf			SSPCON2, PEN		; Stop condition
 	rcall		WaitMSSP	
@@ -157,6 +158,15 @@
 	rcall		I2C_WaitforACK
 
 get_free_EEPROM_location2:
+	btfsc		eeprom_switched_b1			; Switched to Block1 already?
+	bra			get_free_EEPROM_location2_x	; Yes, skip this check!
+
+	btfsc		ext_ee_temp2,7				; Access Block1?
+	bsf			eeprom_switched_b1			; Yes, and set the flag so this check is skipped in the rest of this routine
+	btfsc		ext_ee_temp2,7				; Access Block1?
+	bra			get_free_EEPROM_location3	; Yes, initiate new read sequence in block1
+
+get_free_EEPROM_location2_x:
 	bsf			SSPCON2, RCEN		; Enable recieve mode
 	rcall		WaitMSSP	
 	btfsc		first_FD
--- a/code_part1/OSTC_code_asm_part1/interface.asm	Sun Aug 28 17:22:14 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/interface.asm	Tue Aug 30 16:29:21 2011 +0200
@@ -146,7 +146,7 @@
 	movlw		d'1'						; increase
 	addwf		eeprom_address+0,F
 	movlw		d'0'
-	addwfc	eeprom_address+1,F
+	addwfc		eeprom_address+1,F
 
 ;For debug only
 ;clrf	eeprom_address+0,F