diff code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 340:ecbbbd423e86

BUGFIX save negativ temperatures in logbook (bbbug #6) BUGFIX temperature & amb_pressure averaging done in private variable. BUGFIX Signed averaging of temperature.
author JeanDo
date Fri, 20 May 2011 00:39:05 +0200
parents cb77d1fa4535
children 2144f19fa1eb
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Wed May 18 02:01:52 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Fri May 20 00:39:05 2011 +0200
@@ -953,15 +953,24 @@
 	WIN_TOP		.100
 	WIN_LEFT	.1
 	WIN_FONT 	FT_SMALL
-	WIN_INVERT	.0					; Init new Wordprocessor
+	WIN_INVERT	.0                      ; Init new Wordprocessor
 	call	PLED_standard_color
 
+	movff	temperature+1,hi
+	movff	temperature+0,lo
 	lfsr	FSR2,letter
-	movlw	'-'
-	btfsc	neg_temp			; Show "-"?
-	movwf	POSTINC2			; Yes
-	movff	temperature+0,lo
-	movff	temperature+1,hi
+
+    btfss   hi,7                        ; Negative temperature ?
+    bra     PLED_temp_surfmode_1        ; No: continue
+
+	PUTC	'-'                         ; Display "-"
+
+    comf    hi                          ; Then, 16bit sign changes.
+    negf    lo
+    btfsc   STATUS,C
+    incf    hi
+
+PLED_temp_surfmode_1:
 	movlw	d'3'
 	movwf	ignore_digits
 	bsf		leftbind			; left orientated output
@@ -983,12 +992,21 @@
 	WIN_INVERT	.0					; Init new Wordprocessor
 	call	PLED_standard_color
 
+	movff	temperature+1,hi
+	movff	temperature+0,lo
 	lfsr	FSR2,letter
-	movlw	'-'
-	btfsc	neg_temp			; Show "-"?
-	movwf	POSTINC2			; Yes
-	movff	temperature+0,lo
-	movff	temperature+1,hi
+
+    btfss   hi,7                        ; Negative temperature ?
+    bra     PLED_temp_divemode_1        ; No: continue
+
+	PUTC	'-'                         ; Display "-"
+
+    comf    hi                          ; Then, 16bit sign changes.
+    negf    lo
+    btfsc   STATUS,C
+    incf    hi
+
+PLED_temp_divemode_1:
 	movlw	d'3'
 	movwf	ignore_digits
 	bsf		leftbind			; left orientated output