comparison code_part1/OSTC_code_asm_part1/menu_logbook.asm @ 253:3a4096f32526

show CNS in logbook for all dives made with V1.84beta and later
author heinrichsweikamp
date Sun, 03 Apr 2011 11:46:06 +0200
parents 544cc5d47755
children ba109a7948df
comparison
equal deleted inserted replaced
252:8b252ff2eded 253:3a4096f32526
765 call I2CREAD2 ; Start Gas 765 call I2CREAD2 ; Start Gas
766 movff SSPBUF,lo 766 movff SSPBUF,lo
767 output_8 767 output_8
768 call word_processor ; Display Gas information 768 call word_processor ; Display Gas information
769 769
770
771 bcf show_cns_in_logbook ; clear flag
770 WIN_TOP .25 772 WIN_TOP .25
771 STRCPY "V" 773 STRCPY "V"
772 call I2CREAD2 ; Firmware x 774 call I2CREAD2 ; Firmware x
773 movff SSPBUF,lo 775 movff SSPBUF,lo
776 movff SSPBUF,hi
774 output_8 777 output_8
775 PUTC '.' 778 PUTC '.'
776 call I2CREAD2 ; Firmware y 779 call I2CREAD2 ; Firmware y
777 movff SSPBUF,lo 780 movff SSPBUF,lo
781 movlw .83 ; Check firmware y > 83
782 cpfslt lo ; <83?
783 bsf show_cns_in_logbook ; No, set flag
784 movlw .2 ; Check firmware x > 1
785 cpfslt hi ; <2?
786 bsf show_cns_in_logbook ; No, set flag
778 output_8 787 output_8
779 call word_processor ; Display Gas information 788 call word_processor ; Display Gas information
780 bcf leftbind ; Clear flag 789 bcf leftbind ; Clear flag
790
791
781 792
782 WIN_TOP .50 793 WIN_TOP .50
783 lfsr FSR2,letter 794 lfsr FSR2,letter
784 call I2CREAD2 ; Battery lo 795 call I2CREAD2 ; Battery lo
785 movff SSPBUF,lo 796 movff SSPBUF,lo
836 movff SSPBUF,lo 847 movff SSPBUF,lo
837 clrf hi 848 clrf hi
838 output_16dp d'3' 849 output_16dp d'3'
839 STRCAT_PRINT "kg/l" 850 STRCAT_PRINT "kg/l"
840 851
841 call I2CREAD2 ; Skip GF_HI (Upper nibble), GF_LO (Lower nibble) 852 call I2CREAD2 ; Read CNS%
842 movff SSPBUF,lo 853
843 movlw b'11110000' ; mask GF hi 854 btfss show_cns_in_logbook ; Show CNS?
844 andwf lo,F 855 bra logbook_skip_cns ; No
856
857 movff SSPBUF,lo
845 WIN_TOP .25 858 WIN_TOP .25
846 STRCPY "GF_hi:" 859 STRCPY "CNS:"
847 output_8 860 output_8
848 call word_processor ; Display Gas information 861 STRCAT_PRINT "%" ; Display CNS %
849 862
850 movff SSPBUF,lo 863 logbook_skip_cns:
851 movlw b'00001111' ; mask GF lo
852 andwf lo,F
853 WIN_TOP .50 864 WIN_TOP .50
854 STRCPY "GF_lo:"
855 output_8
856 call word_processor ; Display Gas information
857
858 WIN_TOP .0
859 WIN_LEFT .65
860 movff average_divesecs+0,xB+0 865 movff average_divesecs+0,xB+0
861 clrf xB+1 ; Number of x-pixels displayed 866 clrf xB+1 ; Number of x-pixels displayed
862 movff average_depth_hold_total+0,xC+0 867 movff average_depth_hold_total+0,xC+0
863 movff average_depth_hold_total+1,xC+1 868 movff average_depth_hold_total+1,xC+1
864 movff average_depth_hold_total+2,xC+2 869 movff average_depth_hold_total+2,xC+2
868 movff xC+0,lo 873 movff xC+0,lo
869 movff xC+1,hi 874 movff xC+1,hi
870 output_16dp d'3' ; Average depth (Re-calculated from the drawn profile - not 100% exact!) 875 output_16dp d'3' ; Average depth (Re-calculated from the drawn profile - not 100% exact!)
871 STRCAT_PRINT "m" 876 STRCAT_PRINT "m"
872 877
873 ; WIN_TOP .25 878 ; WIN_TOP .0
874 ; WIN_LEFT .65 879 ; WIN_LEFT .65
875 ; lfsr FSR2,letter 880 ; lfsr FSR2,letter
876 ; movff average_divesecs+0,lo 881 ; movff average_divesecs+0,lo
877 ; output_8 882 ; output_8
878 ; call word_processor 883 ; call word_processor