# HG changeset patch # User heinrichsweikamp # Date 1312489584 -7200 # Node ID b0f3ab8058792d2e65f54fc8272143aa86b34a09 # Parent 1da600c4e13975886f6f79ee4710a24bbfd5ac6a apply salinity and 0.98bar/10m in internal logbook, show gf_lo/gf_hi on page three (Instead of gf_hi/gf_lo) diff -r 1da600c4e139 -r b0f3ab805879 code_part1/OSTC_code_asm_part1/menu_logbook.asm --- a/code_part1/OSTC_code_asm_part1/menu_logbook.asm Thu Aug 04 07:44:03 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/menu_logbook.asm Thu Aug 04 22:26:24 2011 +0200 @@ -374,6 +374,24 @@ incf last_temperature+1,F ; Yes, make last_temperature+1>1 to make "display_profile2e" working display_profile_offset4: +; Offset to Salinity + incf_eeprom_address d'33' ; Macro, that adds 8Bit to eeprom_address:2 + call I2CREAD ; Read Salinity + movff SSPBUF,wait_temp ; Copy Salinity + decf_eeprom_address d'33' ; Macro, that subtracts 8Bit from eeprom_address:2 + + movff lo,xA+0 + movff hi,xA+1 + movlw d'102' ; 0,98bar/10m + movwf xB+0 + clrf xB+1 + call mult16x16 ;xA*xB=xC (lo:hi * 100) + movff wait_temp,xB+0 ; Salinity + clrf xB+1 + call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder + movff xC+0,lo + movff xC+1,hi ; restore lo and hi with updated value + bsf leftbind output_16dp d'3' ; max. depth STRCAT "m " @@ -996,19 +1014,19 @@ movff SSPBUF,lo movlw d'3' - cpfsgt lo - bra logbook_show_sat + cpfsgt lo ; GF model used for this dive? + bra logbook_show_sat ; No ; Show GF settings call I2CREAD2 ; Read GF_lo - movff SSPBUF,hi + movff SSPBUF,lo call I2CREAD2 ; Read GF_hi - movff SSPBUF,lo + movff SSPBUF,hi STRCPY "GF:" - output_8 ; GF_hi + output_8 ; GF_lo PUTC '/' - movff hi,lo ; copy GF_lo - output_8 ; GF_lo + movff hi,lo ; copy GF_hi + output_8 ; GF_hi call word_processor bra logbook_deco_model ; Skip Sat @@ -1360,11 +1378,30 @@ movff SSPBUF,lo call I2CREAD4 ; Block read movff SSPBUF,hi + +; Offset to Salinity + incf_eeprom_address d'33' ; Macro, that adds 8Bit to eeprom_address:2 + call I2CREAD ; Read Salinity + movff SSPBUF,wait_temp ; Copy Salinity + decf_eeprom_address d'33' ; Macro, that subtracts 8Bit from eeprom_address:2 + movff lo,xA+0 + movff hi,xA+1 + movlw d'102' ; 0,98bar/10m + movwf xB+0 + clrf xB+1 + call mult16x16 ;xA*xB=xC (lo:hi * 100) + movff wait_temp,xB+0 ; Salinity + clrf xB+1 + call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder + movff xC+0,lo + movff xC+1,hi ; restore lo and hi with updated value + bsf leftbind bsf ignore_digit5 ; Do not display 1cm figure output_16dp d'3' ; max. depth STRCAT "m " - call I2CREAD4 ; Block read + call I2CREAD3 ; Block read start +; call I2CREAD4 ; Block read movff SSPBUF,lo ; read divetime in minutes call I2CREAD4 ; Block read movff SSPBUF,hi ; read divetime in minutes