changeset 835:30136fc61392

Change power-off sequence
author heinrichsweikamp
date Sun, 30 Dec 2018 18:13:42 +0100
parents f8afe90796d6
children b317df6bc367
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/display_lowlevel.asm code_part1/OSTC_code_asm_part1/menu_settime.asm
diffstat 3 files changed, 40 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Sun May 01 16:09:39 2016 +0200
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Sun Dec 30 18:13:42 2018 +0100
@@ -22,9 +22,9 @@
 ; ToDo:
 
 #DEFINE	softwareversion_x		d'3'		; Software version  XX.YY
-#DEFINE	softwareversion_y		d'14'		; Software version  XX.YY
+#DEFINE	softwareversion_y		d'15'		; 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'73'		; Number of last used custom function
 
--- a/code_part1/OSTC_code_asm_part1/display_lowlevel.asm	Sun May 01 16:09:39 2016 +0200
+++ b/code_part1/OSTC_code_asm_part1/display_lowlevel.asm	Sun Dec 30 18:13:42 2018 +0100
@@ -249,16 +249,50 @@
 ; DISP Display Off
 ; -----------------------------
 DISP_DisplayOff:
-    rcall   DISP_ClearScreen
+	rcall   DISP_ClearScreen
+	
+	movff   win_flags,WREG          ; Display0? win_flags is in bank0...
+        btfss   WREG,1                  ; Display0?
+        bra     DISP_DisplayOff_display0		; Yes
+
+	; Display 1
 	clrf	PORTD
 	bcf		DISPLAY_hv
-	bcf		DISPLAY_vdd
 	bcf		DISPLAY_cs
 	bcf		DISPLAY_e_nwr	
 	bcf		DISPLAY_rw
-    bcf		DISPLAY_rs
+	bcf		DISPLAY_rs
 	bcf		DISPLAY_nreset
+	bcf		DISPLAY_vdd
 	return
+	
+DISP_DisplayOff_display0:
+	movlw	0x05
+	rcall	DISP_CmdWrite
+	movlw	0x00
+	rcall	DISP_DataWrite
+	movlw	0x00
+	rcall	DISP_DataWrite
+	WAITMS	d'32'
+	bcf	DISPLAY_hv
+	WAITMS	d'32'
+	movlw	0x10
+	rcall	DISP_CmdWrite
+	movlw	0x00
+	rcall	DISP_DataWrite
+	movlw	0x01
+	rcall	DISP_DataWrite
+	WAITMS	d'100'
+	clrf	PORTD
+	bcf	DISPLAY_cs
+	bcf	DISPLAY_e_nwr	
+	bcf	DISPLAY_rw
+	bcf	DISPLAY_rs
+	bcf	DISPLAY_nreset
+	WAITMS	d'10'
+	bcf	DISPLAY_vdd
+	return
+
 
 ;=============================================================================
 ; Fast macros to write to DISPLAY display.
--- a/code_part1/OSTC_code_asm_part1/menu_settime.asm	Sun May 01 16:09:39 2016 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_settime.asm	Sun Dec 30 18:13:42 2018 +0100
@@ -262,7 +262,7 @@
 	bra	set_time_refresh_x
 add_year:
 	incf	year,F
-	movlw	d'20'					; calendar until 2020
+	movlw	d'22'					; calendar until 2022
 	cpfsgt	year
 	bra	set_time_refresh_x
 	movlw	d'10'