changeset 283:4ec488f046f4

Battery sign color coded, work on new uart-started 115200Baud bootloader (Do NOT use yet!)
author heinrichsweikamp
date Tue, 19 Apr 2011 19:31:16 +0200
parents aa4b62840c69
children 908d0013727e
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/eeprom_rs232.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/isr.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/surfmode.asm
diffstat 9 files changed, 63 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Tue Apr 19 13:03:01 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Tue Apr 19 19:31:16 2011 +0200
@@ -489,7 +489,7 @@
 #DEFINE	charge_started			flag11,7	;=1: Charger started in CC mode
 
 #DEFINE	setpoint_changed		flag12,0	;=1: Setpoint was changed in divemode, store in profile
-; #DEFINE	free		flag12,1	;=1: 
+#DEFINE	uart_115200_bootloader	flag12,1	;=1: Look for 115200 Baud bootloader
 #DEFINE	debug_mode				flag12,2	;=1: Debugmode active
 #DEFINE	neg_flag_isr			flag12,3	;=1: ISR Negative flag (Math)
 #DEFINE	select_bailoutgas		flag12,4	;=1: Select Bailout instead of Setpoint in Gaslist
--- a/code_part1/OSTC_code_asm_part1/eeprom_rs232.asm	Tue Apr 19 13:03:01 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/eeprom_rs232.asm	Tue Apr 19 19:31:16 2011 +0200
@@ -197,4 +197,39 @@
 	bcf		RCSTA,CREN		; Clear receiver status
 	bsf		RCSTA,CREN
 	bsf		rs232_recieve_overflow		; set flag
-	return				; and return anyway
\ No newline at end of file
+	return				; and return anyway
+
+uart_115k_bootloader:
+	bcf		PIE1,RCIE				; disable interrupt for RS232
+	bcf		RCSTA,CREN				; Clear receiver status
+	bsf		RCSTA,CREN
+	bcf		PIR1,RCIF				; clear flag
+	call	PLED_ClearScreen		; Clear screen
+	movlw	color_red
+    call	PLED_set_color			; Set to Red
+	DISPLAYTEXTH	d'302'			; Bootloader
+	WAITMS	d'250'
+	WAITMS	d'250'
+	WAITMS	d'50'
+	btfss	PIR1,RCIF				; New byte in UART?
+	bra		uart_115k_bootloader2	; No, Abort	
+	movlw	0xC1
+	cpfseq	RCREG					; 115200Baud Bootloader request?
+	bra		uart_115k_bootloader2	; No, Abort	
+	DISPLAYTEXTH	d'303'			; Yes, "Please wait!"
+	clrf	INTCON					; Interrupts disabled
+	bcf		PIR1,RCIF				; clear flag
+	goto	0x17F56					; Enter straight into bootloader. Good luck!
+uart_115k_bootloader2:
+	DISPLAYTEXTH	d'304'			; Aborted!
+	WAITMS	d'250'
+	WAITMS	d'250'
+	WAITMS	d'250'
+	WAITMS	d'250'
+	WAITMS	d'250'
+	WAITMS	d'250'
+	WAITMS	d'250'
+	WAITMS	d'250'
+	goto	restart
+	
+	
\ No newline at end of file
--- a/code_part1/OSTC_code_asm_part1/english_text.asm	Tue Apr 19 13:03:01 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/english_text.asm	Tue Apr 19 19:31:16 2011 +0200
@@ -385,4 +385,7 @@
     TCODE    .0,    .0,      "EAD:"                      ;299 EAD:                  (equivalent air depth of a gas).
 	TCODE	 .100,	.125,	 "Active?"					 ;300 Active?               (Enable/Disable Gas underwater)
 	TCODE    .0,    .2,      "OCR Gas Usage:"            ;301 OCR Gas Usage:        (Planned gas consumtion by tank).
+	TCODE	 .45,	.100,	 "Bootloader"				 ;302 Bootloader
+	TCODE	 .40,	.130,	 "Please wait!"				 ;303 Please wait!
+	TCODE	 .50,	.130,	 "Aborted!"					 ;304 Aborted
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/french_text.asm	Tue Apr 19 13:03:01 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/french_text.asm	Tue Apr 19 19:31:16 2011 +0200
@@ -386,4 +386,7 @@
     TCODE    .0,    .0,      "PEA:"                      ;299 EAD:                  (equivalent air depth of a gas).
 	TCODE	 .100,	.125,	 "Active?"					 ;300 Active?               (Enable/Disable Gas underwater)
 	TCODE    .0,    .2,      "OCR Gas Usage:"            ;301 OCR Gas Usage:        (Planned gas consumtion by tank).
+	TCODE	 .45,	.100,	 "Bootloader"				 ;302 Bootloader
+	TCODE	 .40,	.130,	 "Please wait!"				 ;303 Please wait!
+	TCODE	 .50,	.130,	 "Aborted!"					 ;304 Aborted
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/german_text.asm	Tue Apr 19 13:03:01 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/german_text.asm	Tue Apr 19 19:31:16 2011 +0200
@@ -386,4 +386,7 @@
     TCODE    .0,    .0,      "EAD:"                      ;299 EAD:                  (equivalent air depth of a gas).
     TCODE  .100,  .125,	     "Aktiv?"			 ;300 Active?               (Enable/Disable Gas underwater)
     TCODE    .0,    .2,      "OCR Gasverbrauch:"         ;301 OCR Gas Usage:        (Planned gas consumtion by tank).
+	TCODE	 .45,	.100,	 "Bootloader"				 ;302 Bootloader
+	TCODE	 .40,	.130,	 "Please wait!"				 ;303 Please wait!
+	TCODE	 .50,	.130,	 "Aborted!"					 ;304 Aborted
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/isr.asm	Tue Apr 19 13:03:01 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/isr.asm	Tue Apr 19 19:31:16 2011 +0200
@@ -56,6 +56,11 @@
 		bsf		uart_send_int_eeprom2		; set flag
 		dcfsnz	uart1_temp,F				; "k"
 		bsf		uart_store_tissue_data		; set flag
+	
+		movlw	0xC1
+		cpfseq	RCREG						; 115200Baud Bootloader request?
+		bra		uartint1					; No
+		bsf		uart_115200_bootloader		; Yes, set Flag
 
 
 uartint1:
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Tue Apr 19 13:03:01 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Tue Apr 19 19:31:16 2011 +0200
@@ -1854,17 +1854,20 @@
 
 update_batt_voltage3:
 	GETCUSTOM8	d'34'			; Color battery
+	btfsc	cc_active
+	movlw	color_yellow		; CC active
+	btfsc	cv_active
+	movlw	color_green			; CV active
     call	PLED_set_color
 
-	movlw	.176
+	movlw	.175
 	movff	WREG,win_top		; row top (0-239)
-	movlw	.192-.176
+	movlw	.192-.175
 	movff	WREG,win_height		; row bottom (0-239)
 	movlw	.2
 	movff	WREG,win_leftx2		; column left (0-159)
     movff   wait_temp,win_width	; column right (0-159)
 	call	PLED_box
-
 	call		PLED_standard_color
 	return
 		
--- a/code_part1/OSTC_code_asm_part1/spanish_text.asm	Tue Apr 19 13:03:01 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/spanish_text.asm	Tue Apr 19 19:31:16 2011 +0200
@@ -385,4 +385,7 @@
     TCODE    .0,    .0,      "EAD:"                      ;299 EAD:                  (equivalent air depth of a gas).
 	TCODE	 .100,	.125,	 "żActivar?"				 ;300 Active?               (Enable/Disable Gas underwater)
 	TCODE    .0,    .2,      "Uso Gas OCR:"              ;301 OCR Gas Usage:        (Planned gas consumtion by tank).
+	TCODE	 .45,	.100,	 "Bootloader"				 ;302 Bootloader
+	TCODE	 .40,	.130,	 "Please wait!"				 ;303 Please wait!
+	TCODE	 .50,	.130,	 "Aborted!"					 ;304 Aborted
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/surfmode.asm	Tue Apr 19 13:03:01 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/surfmode.asm	Tue Apr 19 19:31:16 2011 +0200
@@ -193,8 +193,10 @@
 	goto	reset_decodata				; Yes!
 	btfsc	uart_send_int_eeprom2		; Send internal EEPROM BANK 1
 	goto	send_int_eeprom_b1			; Yes!
-	btfsc	uart_store_tissue_data		; Store tissue data?`
+	btfsc	uart_store_tissue_data		; Store tissue data?
 	goto	uart_store_tissues			; Yes!
+	btfsc	uart_115200_bootloader		; Look for 115200Baud bootloader?
+	goto	uart_115k_bootloader		; Yes!
 
 	bra		surfloop_loop				; loop surfacemode