changeset 425:a76c5a3e9e96

Minor cleanups
author JeanDo
date Sun, 31 Jul 2011 13:27:20 +0200
parents 8147c35da3ca
children 07f5b0baaa57
files code_part1/OSTC_code_asm_part1/i2c_eeprom.asm code_part1/OSTC_code_asm_part1/menu_logbook.asm code_part1/OSTC_code_asm_part1/menu_reset.asm code_part1/OSTC_code_asm_part1/p2_environment.asm
diffstat 4 files changed, 10 insertions(+), 107 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/i2c_eeprom.asm	Tue Aug 02 20:39:06 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/i2c_eeprom.asm	Sun Jul 31 13:27:20 2011 +0200
@@ -28,14 +28,7 @@
     	movlw		d'0'
     	addwfc		eeprom_address+1,F
 		return
-;    	btfss		eeprom_address+1,7		; at address 8000?
-;    	return                              ; No, continue
-;    
-;    	; Yes, clear eeprom_address:2
-;    	clrf		eeprom_address+0		; Clear eeprom address
-;    	clrf		eeprom_address+1
-;    	return								; Done.
-;
+
 ;=============================================================================
 ; Will decrease eeprom_address:2 with the 8Bit value "ext_ee_temp1"
 
@@ -50,13 +43,6 @@
         movlw		d'0'
         subwfb		eeprom_address+1,F
 		return
-;
-;        btfss		eeprom_address+1,7		; at address 8000?
-;        return                              ; No, done.
-;
-;        movlw		b'01111111'             ; yes, reset highbyte
-;        movwf		eeprom_address+1
-;    	return								; Done.
 
 ;=============================================================================
 
--- a/code_part1/OSTC_code_asm_part1/menu_logbook.asm	Tue Aug 02 20:39:06 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_logbook.asm	Sun Jul 31 13:27:20 2011 +0200
@@ -75,20 +75,16 @@
 	movlw		d'0'
 	addwfc		divemins+1,F			; increase 16Bit value, twice
 
-	movlw		0xFF
-	cpfseq		divemins+1				; =0xFFFF ?
-	bra			menu_logbook2a			; No
-	cpfseq		divemins+0				; =0xFFFF ?
-	bra			menu_logbook2a			; No
-	bra			menu_logbook_reset      ; yes, restart (if not empty)
+    incf        divemins+1,W            ; = 0xFF.. ?
+    bnz         menu_logbook2a          ; No.
+    incf        divemins+0,W            ; = 0x..FF ?
+    bz          menu_logbook_reset      ; Yes: FFFF --> loop.
 
 menu_logbook2a:
-	movlw		0x00
-	cpfseq		divemins+1				; =0x0000 ?
-	bra			menu_logbook2b			; No
-	cpfseq		divemins+0				; =0x0000 ?
-	bra			menu_logbook2b			; No
-	bra			menu_logbook_reset      ; yes, restart (if not empty)
+    movf        divemins+1,W            ; = 0x00.. ?
+    bnz         menu_logbook2b          ; No.
+    movf        divemins+0,W            ; = 0x..00 ?
+    bz          menu_logbook_reset      ; yes, restart (if not empty)
 
 menu_logbook2b:
 	decf_eeprom_address	d'2'			; -2 to eeprom address.
--- a/code_part1/OSTC_code_asm_part1/menu_reset.asm	Tue Aug 02 20:39:06 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm	Sun Jul 31 13:27:20 2011 +0200
@@ -289,7 +289,7 @@
 do_menu_reset_decodata2:
 ; reset deco data
 	call	PLED_ClearScreen
-	DISPLAYTEXT	.25					; "Reset..."
+	DISPLAYTEXT	.25					    ; "Reset..."
 
     SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration	; copy surface air pressure to deco routine
 	call		deco_clear_tissue			; Reset Decodata
--- a/code_part1/OSTC_code_asm_part1/p2_environment.asm	Tue Aug 02 20:39:06 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-; ********************************************************************
-; ** ASM code for simulation / tests without full simulation code  **
-; ** This is NOT a part of the OSTC                                 **
-; ********************************************************************
-
-;/////////////////////////////////////////////////////////////////////////////
-; OSTC - diving computer code
-; Copyright (C) 2008 HeinrichsWeikamp GbR
-;
-;    This program is free software: you can redistribute it and/or modify
-;    it under the terms of the GNU General Public License as published by
-;    the Free Software Foundation, either version 3 of the License, or
-;    (at your option) any later version.
-;
-;    This program is distributed in the hope that it will be useful,
-;    but WITHOUT ANY WARRANTY; without even the implied warranty of
-;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;    GNU General Public License for more details.
-;
-;    You should have received a copy of the GNU General Public License
-;    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-;
-;/////////////////////////////////////////////////////////////////////////////
-; History:
-; 01/24/11     : [jDG] make p2_main.c link with oled+wordprocessor display functions
-
-	LIST P=18F4685                      ;directive to define processor
-#include <P18F4685.INC>                 ;processor specific variable definitions
-
-;=============================================================================
-; Reset and interupt vectors.
-;
-reset_v     code    0x0000
-            extern  main
-restart     goto    main
-            
-            ORG     0x0008              ; Interupt vector
-            bra     HighInt
-            ORG     0x0018              ; Other interupt vector
-HighInt:    retfie                      ; Return from everything.
-
-#include    definitions.asm
-#include    strings.inc
-
-;=============================================================================
-; Minimal routines to include
-;
-p2_env      code    0x400
-#include    wait.asm                    ; Delay routines.
-#include    oled_samsung.asm            ; Screen display routines.
-#include    aa_wordprocessor.asm        ; Text printing routines.
-#include    strings.asm                 ; String concatenations.
-
-;=============================================================================
-;
-; Fake a few calls, to avoid linking the whole OSTC simulation code.
-; Note: Needing to do so is a clear indication that cleanups are necessary...
-;
-            global  PLED_warnings_color
-PLED_warnings_color:
-            movlw   b'11100000'         ; Red
-            goto    PLED_set_color
-
-            global  PLED_standard_color
-PLED_standard_color:
-            setf    WREG                ; White
-            goto    PLED_set_color
-
-            global  getcustom15
-getcustom15:
-            clrf    hi
-            clrf    lo
-            return
-
-;=============================================================================
-; Needed fonts definition.
-#include    aa_fonts.asm
-            end
-