comparison code_part1/OSTC_code_asm_part1/menu_logbook.asm @ 434:1f1af9482d00

merge with 431
author heinrichsweikamp
date Thu, 04 Aug 2011 22:33:13 +0200
parents f36b93f2fbed
children 9597829f1e0c
comparison
equal deleted inserted replaced
430:f36b93f2fbed 434:1f1af9482d00
388 iorwf last_temperature+1,W ; last_temperature:2 = Null? 388 iorwf last_temperature+1,W ; last_temperature:2 = Null?
389 bnz display_profile_offset4 ; No, continue 389 bnz display_profile_offset4 ; No, continue
390 incf last_temperature+1,F ; Yes, make last_temperature+1>1 to make "display_profile2e" working 390 incf last_temperature+1,F ; Yes, make last_temperature+1>1 to make "display_profile2e" working
391 391
392 display_profile_offset4: 392 display_profile_offset4:
393 ; Offset to Salinity
394 incf_eeprom_address d'33' ; Macro, that adds 8Bit to eeprom_address:2
395 call I2CREAD ; Read Salinity
396 movff SSPBUF,wait_temp ; Copy Salinity
397 decf_eeprom_address d'33' ; Macro, that subtracts 8Bit from eeprom_address:2
398
399 movff lo,xA+0
400 movff hi,xA+1
401 movlw d'102' ; 0,98bar/10m
402 movwf xB+0
403 clrf xB+1
404 call mult16x16 ;xA*xB=xC (lo:hi * 100)
405 movff wait_temp,xB+0 ; Salinity
406 clrf xB+1
407 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
408 movff xC+0,lo
409 movff xC+1,hi ; restore lo and hi with updated value
410
393 bsf leftbind 411 bsf leftbind
394 output_16dp d'3' ; max. depth 412 output_16dp d'3' ; max. depth
395 STRCAT "m " 413 STRCAT "m "
396 call I2CREAD2 ; divetime in minutes 414 call I2CREAD2 ; divetime in minutes
397 movff SSPBUF,lo 415 movff SSPBUF,lo
1010 WIN_TOP .0 1028 WIN_TOP .0
1011 WIN_LEFT .75 1029 WIN_LEFT .75
1012 1030
1013 movff SSPBUF,lo 1031 movff SSPBUF,lo
1014 movlw d'3' 1032 movlw d'3'
1015 cpfsgt lo 1033 cpfsgt lo ; GF model used for this dive?
1016 bra logbook_show_sat 1034 bra logbook_show_sat ; No
1035
1017 1036
1018 ; Show GF settings 1037 ; Show GF settings
1019 call I2CREAD2 ; Read GF_lo 1038 call I2CREAD2 ; Read GF_lo
1039 movff SSPBUF,lo
1040 call I2CREAD2 ; Read GF_hi
1020 movff SSPBUF,hi 1041 movff SSPBUF,hi
1021 call I2CREAD2 ; Read GF_hi
1022 movff SSPBUF,lo
1023 STRCPY "GF:" 1042 STRCPY "GF:"
1043 output_8 ; GF_lo
1044 PUTC '/'
1045 movff hi,lo ; copy GF_hi
1024 output_8 ; GF_hi 1046 output_8 ; GF_hi
1025 PUTC '/'
1026 movff hi,lo ; copy GF_lo
1027 output_8 ; GF_lo
1028 call word_processor 1047 call word_processor
1029 bra logbook_deco_model ; Skip Sat 1048 bra logbook_deco_model ; Skip Sat
1030 1049
1031 logbook_show_sat: 1050 logbook_show_sat:
1032 call I2CREAD2 ; Read Saturation x 1051 call I2CREAD2 ; Read Saturation x
1374 PUTC ' ' 1393 PUTC ' '
1375 call I2CREAD3 ; Depth (Block read start) 1394 call I2CREAD3 ; Depth (Block read start)
1376 movff SSPBUF,lo 1395 movff SSPBUF,lo
1377 call I2CREAD4 ; Block read 1396 call I2CREAD4 ; Block read
1378 movff SSPBUF,hi 1397 movff SSPBUF,hi
1398
1399 ; Offset to Salinity
1400 incf_eeprom_address d'33' ; Macro, that adds 8Bit to eeprom_address:2
1401 call I2CREAD ; Read Salinity
1402 movff SSPBUF,wait_temp ; Copy Salinity
1403 decf_eeprom_address d'33' ; Macro, that subtracts 8Bit from eeprom_address:2
1404 movff lo,xA+0
1405 movff hi,xA+1
1406 movlw d'102' ; 0,98bar/10m
1407 movwf xB+0
1408 clrf xB+1
1409 call mult16x16 ;xA*xB=xC (lo:hi * 100)
1410 movff wait_temp,xB+0 ; Salinity
1411 clrf xB+1
1412 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
1413 movff xC+0,lo
1414 movff xC+1,hi ; restore lo and hi with updated value
1415
1379 bsf leftbind 1416 bsf leftbind
1380 bsf ignore_digit5 ; Do not display 1cm figure 1417 bsf ignore_digit5 ; Do not display 1cm figure
1381 output_16dp d'3' ; max. depth 1418 output_16dp d'3' ; max. depth
1382 STRCAT "m " 1419 STRCAT "m "
1383 call I2CREAD4 ; Block read 1420 call I2CREAD3 ; Block read start
1384 movff SSPBUF,lo ; read divetime in minutes 1421 movff SSPBUF,lo ; read divetime in minutes
1385 call I2CREAD4 ; Block read 1422 call I2CREAD4 ; Block read
1386 movff SSPBUF,hi ; read divetime in minutes 1423 movff SSPBUF,hi ; read divetime in minutes
1387 bsf leftbind 1424 bsf leftbind
1388 output_16 ; Divetime minutes 1425 output_16 ; Divetime minutes