changeset 713:8c293e76a517

no flicker when powering on
author heinrichsweikamp
date Thu, 16 May 2013 13:57:32 +0200
parents 6ff7f894c3af
children b7f7184d800d
files code_part1/OSTC_code_asm_part1/display_lowlevel.asm code_part1/OSTC_code_asm_part1/sleepmode.asm code_part1/OSTC_code_asm_part1/start.asm
diffstat 3 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/display_lowlevel.asm	Fri May 10 14:34:42 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/display_lowlevel.asm	Thu May 16 13:57:32 2013 +0200
@@ -970,6 +970,8 @@
     bcf     win_flags,1
     banksel flag1
 	bcf		DISPLAY_hv
+    btfsc   DISPLAY_hv
+    bra     $-4
 	WAITMS	d'32'
 	bsf		DISPLAY_vdd
 	nop
--- a/code_part1/OSTC_code_asm_part1/sleepmode.asm	Fri May 10 14:34:42 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/sleepmode.asm	Thu May 16 13:57:32 2013 +0200
@@ -194,13 +194,24 @@
 	return
 
 fatal_error_sleep:
-	WAITMS	d'250'
-	WAITMS	d'250'
+	bsf		no_sensor_int               ; Disable sensor interrupt
+	call	get_calibration_data    	; Get calibration data from pressure sensor
+	bcf		no_sensor_int               ; Enable sensor interrupt
 	WAITMS	d'250'
 	WAITMS	d'250'
 	call	get_battery_voltage			; get battery voltage
 	btfss	enter_error_sleep			; REALLY enter Fatal Error Routine?
 	return								; No!
+    SAFE_2BYTE_COPY amb_pressure, sub_b
+	movlw	LOW		d'15001'			; must be lower then 15001mbar
+	movwf	sub_a+0
+	movlw	HIGH	d'15001'
+	movwf	sub_a+1
+	call	subU16					;  sub_c = sub_a - sub_b
+	bcf		enter_error_sleep		; Clear flag
+	btfss	neg_flag				;
+	return                          ; No!
+    bsf		enter_error_sleep		; Set flag
 	clrf	INTCON
 	clrf	INTCON2
 	clrf	INTCON3
--- a/code_part1/OSTC_code_asm_part1/start.asm	Fri May 10 14:34:42 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Thu May 16 13:57:32 2013 +0200
@@ -43,8 +43,9 @@
 	call	RTCinit					; reset RTC
 
 ; Air pressure compensation	after reset
+	bsf		no_sensor_int           ; Disable sensor interrupt
 	call	get_calibration_data	; Get calibration data from pressure sensor
-
+	bcf		no_sensor_int           ; Enable sensor interrupt
 	bcf		pressure_refresh
 wait_start_pressure:
 	btfss	pressure_refresh 		; Air pressure compensation