changeset 499:2ac77db9c150

Added OLED brightness setting, texts 280, 312 and 313 need update
author heinrichsweikamp
date Tue, 15 Nov 2011 20:36:41 +0100
parents 4c7f7807b250
children 014b2b1e82dc
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/english_text.asm code_part1/OSTC_code_asm_part1/french_text.asm code_part1/OSTC_code_asm_part1/german_text.asm code_part1/OSTC_code_asm_part1/menu.asm code_part1/OSTC_code_asm_part1/oled_samsung.asm code_part1/OSTC_code_asm_part1/pled_outputs.asm code_part1/OSTC_code_asm_part1/spanish_text.asm code_part1/OSTC_code_asm_part1/start.asm code_part1/OSTC_code_asm_part1/surfmode.asm code_part1/OSTC_code_asm_part1/turkish_text.asm docu/ostc_interface_description.odt
diffstat 12 files changed, 98 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -453,7 +453,7 @@
 
 #DEfINE	timeout_display		flag5,0	; =1: The divemode timeout is displayed
 #DEFINE	eeprom_blockwrite	flag5,1	; EEPROM blockwrite active
-#DEFINE Flag_4      		flag5,2	; unused
+#DEFINE oled_brightness_high flag5,2	; =1: High brightness, =0: Eco mode
 #DEFINE	low_battery_state	flag5,3	;=1 if battery low
 #DEFINE	DP_done				flag5,4	; valconv
 #DEFINE	DP_done2			flag5,5	; valconv
--- a/code_part1/OSTC_code_asm_part1/english_text.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/english_text.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -423,7 +423,7 @@
     TCODE    .20,   .95,     "Bottom Time:"              ;277 Bottom Time:
     TCODE    .20,   .125,    "Max. Depth:"               ;278 Max. Depth:
     TCODE    .20,   .155,    "Calculate Deco"            ;279 Calculate Deco
-    TCODE    .0,    .0,      ""                          ;280 UNUSED
+    TCODE    .20,   .155,    "Brightness:"          	 ;280 Brightness:
 ;
     TCODE    .93,   .170,    "Avr.Depth"                 ;281 Avr.Depth
     TCODE    .90,   .170,    "Lead Tiss."                ;282 Lead Tiss.
@@ -465,4 +465,7 @@
 	TCODE	 .94,	.54,	 "Stopwatch"		 		 ;310 Stopwatch             (BIG Stopwatch in Gauge mode)
 ; Cave consomation
     TCODE    .0,    .0,      "Cave Bail."                ;311 Cave Bail.            (=10 chars.)
+; OLED Brightness settings
+    TCODE    .103,  .155,    "Eco "	    	             ;312 Eco 					(Same length as #313!)
+    TCODE    .103,  .155,    "High" 	                 ;313 High					(Same length as #312!)
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/french_text.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/french_text.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -423,7 +423,7 @@
     TCODE    .20,   .95,     "Temps fond:"               ;277 Bottom Time:
     TCODE    .20,   .125,    "Prof. Max.:"               ;278 Max. Depth:
     TCODE    .20,   .155,    "Calculer la Déco"          ;279 Calculate Deco
-    TCODE    .0,    .0,      ""                          ;280 UNUSED
+    TCODE    .20,   .155,    "Brightness:"          	 ;280 Brightness:
 ;
     TCODE    .97,   .170,    "Prof.Moyn"                 ;281 Avr.Depth
     TCODE    .90,   .170,    "TissuDirec"                ;282 Lead Tiss.
@@ -464,4 +464,7 @@
 	TCODE	 .116,	.54,	 "Chrono"		 		 	 ;310 Stopwatch             (BIG Stopwatch in Gauge mode)
 ; Cave consomation
     TCODE    .0,    .0,      "Bail. Sout"                ;311 Cave Bail.            (=10 chars.)
+; OLED Brightness settings
+    TCODE    .103,  .155,    "Eco "	    	             ;312 Eco 					(Same length as #313!)
+    TCODE    .103,  .155,    "High" 	                 ;313 High					(Same length as #312!)
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/german_text.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/german_text.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -423,7 +423,7 @@
     TCODE    .20,   .95,     "Grundzeit:"                ;277 Bottom Time:
     TCODE    .20,   .125,    "Max. Tiefe:"               ;278 Max. Depth:
     TCODE    .20,   .155,    "Dekoplan berechn."         ;279 Calculate Deco
-    TCODE    .0,    .0,      ""                          ;280 UNUSED
+    TCODE    .20,   .155,    "Helligkeit:"          	 ;280 Brightness:
 ;
     TCODE    .107,   .170,   "D-Tiefe"                   ;281 Avr.Depth
     TCODE    .90,   .170,    "Leitgewebe"                ;282 Lead Tiss.
@@ -464,4 +464,7 @@
 	TCODE	 .109,	.54,	 "Stoppuhr"		 		 	 ;310 Stopwatch             (BIG Stopwatch in Gauge mode)
 ; Cave consomation
     TCODE    .0,    .0,      "Cave Bail."                ;311 Cave Bail.            (=10 chars.)
+; OLED Brightness settings
+    TCODE    .103,  .155,    "Eco "	    	             ;312 Eco 					(Same length as #313!)
+    TCODE    .103,  .155,    "Hoch" 	                 ;313 High					(Same length as #312!)
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/menu.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/menu.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -356,20 +356,21 @@
 	call	show_debugstate
 	call	show_dateformat
 	call	PLED_menu_cursor
+	call	toggle_brightness_show
 	bcf		switch_left
 	bcf		switch_right
 
 more_setup_menu_loop:
 	call	check_switches_menu
 
-	movlw	d'5'				; x-1 menu entries
-	cpfseq	menupos
-	bra		more_setup_menu_loop2
-	movlw	d'6'
-	movwf	menupos
-	call	PLED_menu_cursor
-more_setup_menu_loop2:
-
+;	movlw	d'5'				; x-1 menu entries
+;	cpfseq	menupos
+;	bra		more_setup_menu_loop2
+;	movlw	d'6'
+;	movwf	menupos
+;	call	PLED_menu_cursor
+;more_setup_menu_loop2:
+;
 	btfsc	menubit2
 	bra		do_more_setup_menu						; call submenu
 
@@ -405,7 +406,7 @@
 	dcfsnz	menupos,F
 	bra		show_rawdata
 	dcfsnz	menupos,F
-	bra		setup_menu						; spare
+	bra		toggle_brightness		; toggle between ECO and HIGH
 	movlw	d'5'					; set cursor to "More again"
 	movwf	menupos
 	bra		setup_menu2						; exit...
@@ -602,6 +603,51 @@
 	DISPLAYTEXTH	.261			; YY/MM/DD = 2 
 	return
 
+toggle_brightness:
+	movlw	LOW		0x104
+	movwf	EEADR
+	movlw	HIGH 	0x104
+	movwf	EEADRH					; OLED brightness (=0: Eco, =1: High)
+	call	read_eeprom				; read byte
+	bcf		oled_brightness_high	; Eco mode
+	movlw	.0
+	cpfseq	EEDATA					; High?
+	bsf		oled_brightness_high	; Yes!
+
+	; Value loaded, now toggle it...
+	btg		oled_brightness_high
+
+	; ...Display it...
+	rcall	toggle_brightness_show
+	call	PLED_brightness_full	; Set OLED
+
+	; ...and write it again to EEPROM
+	movlw	LOW		0x104
+	movwf	EEADR
+	movlw	HIGH 	0x104
+	movwf	EEADRH					; OLED brightness (=0: Eco, =1: High)
+	movlw	.0
+	btfsc	oled_brightness_high
+	movlw	.1
+	movwf	EEDATA
+	call	write_eeprom			; write byte
+	clrf	EEADRH					; Reset EEADRH	
+
+	movlw	d'5'
+	movwf	menupos
+	bcf		switch_right
+	bra		more_setup_menu3a			; return to menu loop
+
+toggle_brightness_show:
+	btfsc	oled_brightness_high
+	bra		toggle_brightness_show2
+	DISPLAYTEXTH	.312			; Eco
+	return
+toggle_brightness_show2:
+	DISPLAYTEXTH	.313			; High
+	return
+
+	
 toggle_debugmode:
 	read_int_eeprom	d'39'				; Read status
 	incf	EEDATA,F
@@ -618,7 +664,7 @@
 	movlw	d'2'
 	movwf	menupos
 	bcf		switch_right
-	bra		more_setup_menu3a			; return to manu loop
+	bra		more_setup_menu3a			; return to menu loop
 
 show_debugstate:
 	read_int_eeprom	d'39'
--- a/code_part1/OSTC_code_asm_part1/oled_samsung.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/oled_samsung.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -661,7 +661,9 @@
 	return
 
 
-PLED_brightness_full: ;mH
+PLED_brightness_full: ; Choose between Eco and High...
+	btfsc	oled_brightness_high		; OLED brightness (=0: Eco, =1: High)
+	bra		PLED_brightness_full_high
 ; Mid
 	movlw	0x70
 	rcall	PLED_CmdWrite
@@ -722,7 +724,7 @@
 	rcall	PLED_DataWrite
 	return
 
-;PLED_brightness_full:
+PLED_brightness_full_high:
 ; Full
 	movlw	0x70
 	rcall	PLED_CmdWrite
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -1053,7 +1053,7 @@
 	DISPLAYTEXT		.129	; Debug: 
 	DISPLAYTEXT		.187	; Show License
 	DISPLAYTEXTH	.295	; Show raw data	
-	
+	DISPLAYTEXTH	.280 	; Brightness:
 	DISPLAYTEXT .11			; Exit
 	return	
 
--- a/code_part1/OSTC_code_asm_part1/spanish_text.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/spanish_text.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -422,7 +422,7 @@
     TCODE    .20,   .95,     "Tiempo Fondo:"             ;277 Bottom Time:
     TCODE    .20,   .125,    "Prof. Max.:"               ;278 Max. Depth:
     TCODE    .20,   .155,    "Calcular Deco"             ;279 Calculate Deco
-    TCODE    .0,    .0,      ""                          ;280 UNUSED
+    TCODE    .20,   .155,    "Brightness:"          	 ;280 Brightness:
 ;
     TCODE    .93,   .170,    "ProfMedia"                 ;281 Avr.Depth
     TCODE    .90,   .170,    "TejControl"                ;282 Lead Tiss.
@@ -463,4 +463,7 @@
 	TCODE	 .116,	.54,	 "Crono."		 		 	 ;310 Stopwatch             (BIG Stopwatch in Gauge mode)
 ; Cave consomation
     TCODE    .0,    .0,      "Cave Bail."                ;311 Cave Bail.           (=10 chars.)
+; OLED Brightness settings
+    TCODE    .103,  .155,    "Eco "	    	             ;312 Eco 					(Same length as #313!)
+    TCODE    .103,  .155,    "High" 	                 ;313 High					(Same length as #312!)
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/start.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -251,6 +251,18 @@
 	cpfseq	EEDATA					; is 0xAA already?
 	call	logbook_convert_64k		; No, convert now (And write 0xAA to internal EEPROM 0x100)
 
+; Set OLED brightness flag
+	movlw	LOW		0x104
+	movwf	EEADR
+	movlw	HIGH 	0x104
+	movwf	EEADRH					; OLED brightness (=0: Eco, =1: High)
+	call	read_eeprom				; read byte
+	bcf		oled_brightness_high	; Eco mode
+	movlw	.0
+	cpfseq	EEDATA					; High?
+	bsf		oled_brightness_high	; Yes!
+
+	clrf	EEADRH					; Reset EEADRH
 	goto	surfloop				; Jump to Surfaceloop!
 	
 
--- a/code_part1/OSTC_code_asm_part1/surfmode.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/surfmode.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -29,7 +29,7 @@
 	clrf	lo
 	movff	lo,char_I_const_ppO2			; reset to standard mode, OSTC assumes Air breathing at the surface!
 
-	call	PLED_brightness_full			;max. brightness
+	call	PLED_brightness_full			; max. brightness
 	
 	call 	I2CReset
 	call	PLED_boot
--- a/code_part1/OSTC_code_asm_part1/turkish_text.asm	Mon Nov 14 08:12:13 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/turkish_text.asm	Tue Nov 15 20:36:41 2011 +0100
@@ -424,7 +424,7 @@
     TCODE    .20,   .95,     "Dip Zaman:"                ;277 Bottom Time:
     TCODE    .20,   .125,    "Derinlik :"                ;278 Max. Depth:
     TCODE    .20,   .155,    "Deko Hesapla     "         ;279 Calculate Deco
-    TCODE    .0,    .0,      ""                          ;280 UNUSED
+   	TCODE    .20,   .155,    "Brightness:"          	 ;280 Brightness:
 ;
     TCODE    .107,   .170,   "Ort.Der"                   ;281 Avr.Depth
     TCODE    .90,   .170,    "Kompartman"                ;282 Lead Tiss.
@@ -463,4 +463,10 @@
     TCODE    .0,    .0,      "simdi  "                   ;308 Now (7 chars min)
     TCODE   .10,   .113,     "Ortalama" 	 		 	 ;309 Average
     TCODE   .109,  .54,	     "Krono. "		 		 	 ;310 Stopwatch (BIG Stopwatch in Gauge mode)
+; Cave consomation
+    TCODE    .0,    .0,      "Cave Bail."                ;311 Cave Bail.            (=10 chars.)
+; OLED Brightness settings
+    TCODE    .103,  .155,    "Eco "	    	             ;312 Eco 					(Same length as #313!)
+    TCODE    .103,  .155,    "High" 	                 ;313 High					(Same length as #312!)
+
 ;=============================================================================
Binary file docu/ostc_interface_description.odt has changed