changeset 832:63cce2e2ae20

NEW: Logbook shows markers with small orange boxes in the profile
author heinrichsweikamp
date Sun, 10 Jan 2016 11:38:35 +0100
parents 0cf00ecf3532
children ee245b9f3712
files code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/menu_logbook.asm
diffstat 3 files changed, 34 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Tue Dec 08 13:44:39 2015 +0100
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Sun Jan 10 11:38:35 2016 +0100
@@ -1,3 +1,6 @@
+New in 3.13:
+NEW: Logbook shows markers with small orange boxes in the profile
+
 New in 3.12:
 BUGFIX: Minor layout fix (Battery warning in divemode)
 CHANGE: Color-code battery % display in surface mode (Charge, Full, Normal)
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Tue Dec 08 13:44:39 2015 +0100
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Sun Jan 10 11:38:35 2016 +0100
@@ -22,7 +22,7 @@
 ; ToDo:
 
 #DEFINE	softwareversion_x		d'3'		; Software version  XX.YY
-#DEFINE	softwareversion_y		d'12'		; Software version  XX.YY
+#DEFINE	softwareversion_y		d'13'		; Software version  XX.YY
 
 #DEFINE softwareversion_beta 	0 			; (and 0 for release)
 
@@ -587,4 +587,5 @@
 #DEFINE sp1_switched            flag16,2    ;=1: This setpoint has been autoselected already
 #DEFINE sp2_switched            flag16,3    ;=1: This setpoint has been autoselected already
 #DEFINE sp3_switched            flag16,4    ;=1: This setpoint has been autoselected already
+#DEFINE log_marker_found        flag16,5    ;=1: A logbook marker has been found
 
--- a/code_part1/OSTC_code_asm_part1/menu_logbook.asm	Tue Dec 08 13:44:39 2015 +0100
+++ b/code_part1/OSTC_code_asm_part1/menu_logbook.asm	Sun Jan 10 11:38:35 2016 +0100
@@ -811,8 +811,27 @@
 	movff		xC+0,apnoe_mins				; Store last row for fill routine
     PIXEL_WRITE timeout_counter3,xC+0       ; Set col(0..159) x row (0..239), put a std color pixel.
 
-	incf		timeout_counter3,F
+	incf		timeout_counter3,F          ; Next column
+    ;---- Draw Marker square , if any ----------------------------------------
+    btfss       log_marker_found            ; Any marker to draw?
+    bra         profile_display_skip_marker ; No
 
+    ; 2x2 square
+    incf        apnoe_mins,W
+    movff       WREG,win_top
+    movlw       .4
+    movff       WREG,win_height
+    movlw       .2
+    movff       WREG,win_width
+    decf        timeout_counter3,W
+    movff       WREG,win_leftx2
+
+    movlw       color_orange
+    call        DISP_set_color
+    call        DISP_box                    ; Draw 2x2 Box
+    bcf         log_marker_found            ; Clear flag
+
+profile_display_skip_marker:
     ;---- Draw CNS curve, if any ---------------------------------------------
     movf        divisor_cns,W
     bz          profile_display_skip_cns
@@ -1253,7 +1272,7 @@
 	call		I2CREAD2					; read first depth
 	movff		SSPBUF,logbook_cur_depth+1  ; high value
 	call		I2CREAD2					; read Profile Flag Byte
-	movff		SSPBUF,timeout_counter2		; Read Profile Flag Byte
+	movff		SSPBUF,timeout_counter2		; store Profile Flag Byte
 
 	bcf			event_occured				; clear flag
 	btfsc		timeout_counter2,7
@@ -1356,6 +1375,14 @@
     decf		timeout_counter2,F			; reduce counter
 	call		I2CREAD2					; Read He
     decf		timeout_counter2,F			; reduce counter
+    ; Any Alarm?
+    bcf         EventByte,4                 ; Clear bits already tested
+    bcf         EventByte,5
+    bcf         EventByte,6
+    movlw       .6                          ; manual marker?
+    cpfseq      EventByte
+    return	   ; No, return
+    bsf         log_marker_found            ; Manual marker! Draw small orange rectancle here
 	return
 
 logbook_event2: ; Bailout