comparison src/tft_outputs.asm @ 656:8af5aefbcdaf default tip

Update to 3.31 beta
author heinrichsweikamp
date Thu, 27 Nov 2025 18:32:58 +0100
parents 75e90cd0c2c3
children
comparison
equal deleted inserted replaced
655:c7b7b8a358cd 656:8af5aefbcdaf
675 ; Surface Mode Screen - show Pressure (unconditional) 675 ; Surface Mode Screen - show Pressure (unconditional)
676 ; 676 ;
677 global TFT_surfmode_pres 677 global TFT_surfmode_pres
678 TFT_surfmode_pres: 678 TFT_surfmode_pres:
679 ; value 679 ; value
680 WIN_SMALL surf_press_column+.8,surf_press_row 680 WIN_SMALL surf_press_column+.6,surf_press_row
681 FONT_COLOR_MEMO ; set color 681 FONT_COLOR_MEMO ; set color
682 SMOVII pressure_abs,mpr ; get current pressure 682 SMOVII pressure_abs,mpr ; get current pressure
683 FONT_COLOR_MEMO ; print in standard color 683 FONT_COLOR_MEMO ; print in standard color
684 output_9999 ; print (0-9999) 684 output_9999 ; print (0-9999)
685 PRINT ; dump buffer to screen 685 PUTC " "
686 ; unit 686 STRCAT_TEXT_PRINT tMBAR ; print unit (hPa)
687 WIN_SMALL surf_press_column+(4+1)*8,surf_press_row
688 FONT_COLOR_MASK ; switch to mask color
689 STRCPY_TEXT_PRINT tMBAR ; print unit (hPa)
690 return ; done 687 return ; done
691 688
692 689
693 ;----------------------------------------------------------------------------- 690 ;-----------------------------------------------------------------------------
694 ; Surface Mode Screen - Temperature 691 ; Surface Mode Screen - Temperature
695 ; 692 ;
696 global TFT_surfmode_temp 693 global TFT_surfmode_temp
697 TFT_surfmode_temp: 694 TFT_surfmode_temp:
698 ; unit 695 ; unit
699 WIN_SMALL surf_temp_column+3*8,surf_temp_row 696 WIN_SMALL surf_temp_column+3*8,surf_temp_row
700 FONT_COLOR_MASK ; select mask color 697 FONT_COLOR_MEMO ; print in standard color
701 TSTOSS opt_units ; 0=°C, 1=°F 698 TSTOSS opt_units ; 0=°C, 1=°F
702 bra TFT_temp_surfmode_metric ; 0: metric 699 bra TFT_temp_surfmode_metric ; 0: metric
703 ;bra TFT_temp_surfmode_imperial ; 1: imperial 700 ;bra TFT_temp_surfmode_imperial ; 1: imperial
704 701
705 TFT_temp_surfmode_imperial: 702 TFT_temp_surfmode_imperial:
780 WIN_SMALL batt_percent_column+.2,batt_percent_row 777 WIN_SMALL batt_percent_column+.2,batt_percent_row
781 movff batt_percent,lo ; get battery % 778 movff batt_percent,lo ; get battery %
782 output_256 ; print battery % (0-255) 779 output_256 ; print battery % (0-255)
783 STRCAT_PRINT "% " ; append unit with trailing space and dump to screen 780 STRCAT_PRINT "% " ; append unit with trailing space and dump to screen
784 781
782 WIN_TINY batt_voltage_column+.15,batt_voltage_row
783 btfss dn_flag
784 bra TFT_surfmode_batt2
785 WIN_TINY batt_voltage_column+.15,.5
786 FONT_COLOR color_green ; set menu title font color
787 STRCPY_TEXT_PRINT tBattery
788 return
789 TFT_surfmode_batt2:
790 FONT_COLOR_MEMO ; set color
791 movff battery_type,lo ; get battery type
792 PUTC "T" ; print "T"
793 output_9 ; print battery type code (0-9)
794 PUTC ":" ; print ":"
795 MOVII batt_voltage,mpr ; get battery voltage
796 bsf omit_digit_2 ; do not print 2nd and 1st digit
797 bsf decimal_digit3 ; place a decimal point in front of digit 3
798 output_9999 ; print x.x--
799 PUTC_PRINT 'V' ; append unit and dump to screen
800 return ; done
801
802
785 WIN_TINY batt_voltage_column+.15,batt_voltage_row 803 WIN_TINY batt_voltage_column+.15,batt_voltage_row
786 FONT_COLOR_MEMO ; set color 804 FONT_COLOR_MEMO ; set color
787 movff battery_type,lo ; get battery type 805 movff battery_type,lo ; get battery type
788 PUTC "T" ; print "T" 806 PUTC "T" ; print "T"
789 output_9 ; print battery type code (0-9) 807 output_9 ; print battery type code (0-9)
819 ; Surface Mode Screen - Deco Mode (0=OC, 1=CCR, 2=Gauge, 3=Apnoe, 4=pSCR) 837 ; Surface Mode Screen - Deco Mode (0=OC, 1=CCR, 2=Gauge, 3=Apnoe, 4=pSCR)
820 ; 838 ;
821 global TFT_surfmode_decotype 839 global TFT_surfmode_decotype
822 TFT_surfmode_decotype: 840 TFT_surfmode_decotype:
823 WIN_STD surf_decotype_column,surf_decotype_row 841 WIN_STD surf_decotype_column,surf_decotype_row
824 FONT_COLOR color_lightblue ; set font color 842 FONT_COLOR color_green ; set font color
825 movff opt_dive_mode,lo ; get deco mode 843 movff opt_dive_mode,lo ; get deco mode
826 tstfsz lo ; in OC mode? 844 tstfsz lo ; in OC mode?
827 bra TFT_decotype_surface_2 ; NO 845 bra TFT_decotype_surface_2 ; NO
828 STRCAT_TEXT_PRINT tDvOC ; YES - print OC 846 STRCAT_TEXT_PRINT tDvOC ; YES - print OC
829 return ; - done 847 return ; - done
847 865
848 TFT_surfmode_decotype_cc_var: 866 TFT_surfmode_decotype_cc_var:
849 ; Sensor or Auto SP mode 867 ; Sensor or Auto SP mode
850 sublw .2 ; ccr_mode = 2 (Auto SP) ? 868 sublw .2 ; ccr_mode = 2 (Auto SP) ?
851 bz TFT_decotype_surface_cc_auto; YES - AutoSP 869 bz TFT_decotype_surface_cc_auto; YES - AutoSP
852 IFDEF _external_sensor 870 IFDEF _external_sensor_eccr
853 STRCPY_TEXT tCCRModeSensor ; NO - print "Sensor" 871 STRCPY_TEXT tCCRModeSensor ; NO - print "Sensor"
854 bra TFT_decotype_surface_cc_com ; - continue 872 bra TFT_decotype_surface_cc_com ; - continue
855 ENDIF ; _external_sensor 873 ENDIF ; _external_sensor_eccr
856 874
857 TFT_decotype_surface_cc_auto: 875 TFT_decotype_surface_cc_auto:
858 STRCPY_TEXT tCCRModeAutoSP ; print "Auto SP" 876 STRCPY_TEXT tCCRModeAutoSP ; print "Auto SP"
859 ;bra TFT_decotype_surface_cc_com ; continue 877 ;bra TFT_decotype_surface_cc_com ; continue
860 878
1158 movlw .12 1176 movlw .12
1159 subwf lo,F 1177 subwf lo,F
1160 bsf aux_flag ; PM/AM Bit 1178 bsf aux_flag ; PM/AM Bit
1161 return 1179 return
1162 1180
1163 IFDEF _external_sensor 1181 IFDEF _external_sensor_eccr
1164 1182
1165 ;----------------------------------------------------------------------------- 1183 ;-----------------------------------------------------------------------------
1166 ; Surface Mode - Imprint ppO2 from Sensors 1184 ; Surface Mode - Imprint ppO2 from Sensors
1167 ; 1185 ;
1168 global TFT_imprint_surf_ppO2 1186 global TFT_imprint_surf_ppO2
1244 1262
1245 ; print sensor connection type 1263 ; print sensor connection type
1246 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row+.24 1264 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row+.24
1247 btfsc ext_input_optical ; optical input? 1265 btfsc ext_input_optical ; optical input?
1248 bra TFT_sensor_mV_optical ; YES 1266 bra TFT_sensor_mV_optical ; YES
1267 btfsc ext_s8_full_digital ; are we in external S8 full digital mode?
1268 bra TFT_sensor_mV_optical ; YES
1249 TSTOSS opt_s8_mode ; NO - S8 input selected? 1269 TSTOSS opt_s8_mode ; NO - S8 input selected?
1250 bra TFT_sensor_mV_analog ; NO - analog input 1270 bra TFT_sensor_mV_analog ; NO - analog input
1251 ;bra TFT_sensor_mV_s8 ; YES - S8 1271 ;bra TFT_sensor_mV_s8 ; YES - S8
1252 1272
1253 TFT_sensor_mV_s8: 1273 TFT_sensor_mV_s8:
1374 bsf decimal_digit1 ; place a decimal point in front of digit 1 (no 0.1 mV) 1394 bsf decimal_digit1 ; place a decimal point in front of digit 1 (no 0.1 mV)
1375 output_9999 ; print (0.0-999.9) 1395 output_9999 ; print (0.0-999.9)
1376 STRCAT_PRINT "mV" ; append unit and dump buffer to screen 1396 STRCAT_PRINT "mV" ; append unit and dump buffer to screen
1377 return ; done 1397 return ; done
1378 1398
1379 ENDIF ; _external_sensor 1399 ENDIF ; _external_sensor_eccr
1380 1400
1381 1401
1382 IFDEF _rx_functions 1402 IFDEF _rx_functions
1383 ;----------------------------------------------------------------------------- 1403 ;-----------------------------------------------------------------------------
1384 ; Imprint Function for the Tank Setup Menu 1404 ; Imprint Function for the Tank Setup Menu
1694 bra TFT_depth_exit_2 ; YES - do not restore "Depth" as it collides with depth number 1714 bra TFT_depth_exit_2 ; YES - do not restore "Depth" as it collides with depth number
1695 btfsc cur_depth_greater_100m ; NO - current depth >= 100 m? 1715 btfsc cur_depth_greater_100m ; NO - current depth >= 100 m?
1696 bra TFT_depth_exit_2 ; YES 1716 bra TFT_depth_exit_2 ; YES
1697 ;bra TFT_depth_exit_1 ; NO 1717 ;bra TFT_depth_exit_1 ; NO
1698 1718
1699 TFT_depth_exit_1 1719 TFT_depth_exit_1:
1700 WIN_TINY dm_mask_depth_column_alt,dm_mask_depth_row 1720 WIN_TINY dm_mask_depth_column_alt,dm_mask_depth_row
1701 FONT_COLOR_MASK ; set color 1721 FONT_COLOR_MASK ; set color
1702 STRCAT_TEXT_PRINT tDepth ; restore "Depth" title 1722 STRCAT_TEXT_PRINT tDepth ; restore "Depth" title
1703 1723
1704 TFT_depth_exit_2: 1724 TFT_depth_exit_2:
2033 btfsc better_dil_blinking ; blinking better diluent? 2053 btfsc better_dil_blinking ; blinking better diluent?
2034 return ; YES - abort, no update of temperature now 2054 return ; YES - abort, no update of temperature now
2035 2055
2036 WIN_SMALL dm_temp_column,dm_temp_row; set position 2056 WIN_SMALL dm_temp_column,dm_temp_row; set position
2037 FONT_COLOR_MEMO ; set color 2057 FONT_COLOR_MEMO ; set color
2038 movlw index_compass_dm ; index of compass custom view 2058 goto TFT_temp_common ; continue with common part for temperature
2039 cpfseq active_customview ; compass shown in custom view? 2059
2040 goto TFT_temp_common ; NO - continue with common part for temperature 2060 global TFT_dive_compass_extras
2041 goto TFT_update_stopwatch ; YES - show resettable dive time instead of temperature 2061 TFT_dive_compass_extras: ; Update Stopwatch display in compass mode
2042 2062 WIN_SMALL dm_compass_stopwatch_column,dm_compass_stopwatch_row ; set position
2063 FONT_COLOR_MEMO ; set color
2064 MOVII divesecs_compass_trip,mpr ; get the compass stopwatch
2065 goto update_stopwatch_common ; YES - show resettable dive time instead of temperature (And return)
2066
2043 2067
2044 ;----------------------------------------------------------------------------- 2068 ;-----------------------------------------------------------------------------
2045 ; Dive Mode - active Gas and Setpoint 2069 ; Dive Mode - active Gas and Setpoint
2046 ; 2070 ;
2047 global TFT_show_active_gas_divemode 2071 global TFT_show_active_gas_divemode
2097 TFT_active_sp_label_1: 2121 TFT_active_sp_label_1:
2098 WIN_STD dm_active_sp_label_col, dm_active_sp_label_row 2122 WIN_STD dm_active_sp_label_col, dm_active_sp_label_row
2099 FONT_COLOR_MEMO ; select memo color 2123 FONT_COLOR_MEMO ; select memo color
2100 STRCAT "bar" ; print "bar" 2124 STRCAT "bar" ; print "bar"
2101 2125
2102 IFDEF _external_sensor 2126 IFDEF _external_sensor_eccr
2103 2127
2104 movf dive_ccr_mode,W ; get setpoint mode =0: Fixed SP, =1: Sensor, =2: Auto SP 2128 movf dive_ccr_mode,W ; get setpoint mode =0: Fixed SP, =1: Sensor, =2: Auto SP
2105 sublw .1 ; dive_ccr_mode = 1 (Sensor) ? 2129 sublw .1 ; dive_ccr_mode = 1 (Sensor) ?
2106 bnz TFT_active_sp_label_2 ; NO - skip 2130 bnz TFT_active_sp_label_2 ; NO - skip
2107 btfsc alt_layout_active ; YES - in alternative layout? 2131 btfsc alt_layout_active ; YES - in alternative layout?
2940 global TFT_message_i2c_error 2964 global TFT_message_i2c_error
2941 TFT_message_i2c_error: 2965 TFT_message_i2c_error:
2942 rcall TFT_message_open ; set row and column for the message 2966 rcall TFT_message_open ; set row and column for the message
2943 tstfsz WREG ; is there room for the message? 2967 tstfsz WREG ; is there room for the message?
2944 return ; NO - skip message in this cycle 2968 return ; NO - skip message in this cycle
2945 STRCPY "I2C " ; print "I2C Error:" 2969 STRCPY "I: " ; print "I2C Error:"
2946 movff i2c_error_vault+0,WREG ; last device adress 2970 movff i2c_error_vault+0,WREG ; last device adress
2947 output_hex 2971 output_hex
2948 PUTC " " 2972 PUTC " "
2949 movff i2c_error_vault+1,WREG ; last data byte 2973 movff i2c_error_vault+1,WREG ; last data byte
2974 output_hex
2975 PUTC " "
2976 movff i2c_error_vault+2,WREG ; copy of SSP1CON2
2950 output_hex 2977 output_hex
2951 bra TFT_message_close ; finalize message output 2978 bra TFT_message_close ; finalize message output
2952 2979
2953 ;----------------------------------------------------------------------------- 2980 ;-----------------------------------------------------------------------------
2954 ; Surface Mode - Message - Desaturation 2981 ; Surface Mode - Message - Desaturation
3479 STRCPY_TEXT tGasDensity ; print "G.Density" 3506 STRCPY_TEXT tGasDensity ; print "G.Density"
3480 bra TFT_message_close ; finalize message output 3507 bra TFT_message_close ; finalize message output
3481 3508
3482 ENDIF ; _ccr_pscr 3509 ENDIF ; _ccr_pscr
3483 3510
3484 IFDEF _external_sensor 3511 IFDEF _external_sensor_eccr
3485 3512
3486 ;----------------------------------------------------------------------------- 3513 ;-----------------------------------------------------------------------------
3487 ; Dive Mode - Message - Sensor ppO2 Divergence 3514 ; Dive Mode - Message - Sensor ppO2 Divergence
3488 ; 3515 ;
3489 global TFT_message_divergence 3516 global TFT_message_divergence
3508 3535
3509 FONT_COLOR_WARNING ; set warning color 3536 FONT_COLOR_WARNING ; set warning color
3510 STRCPY_TEXT tDiveFallback ; print "Fallback!" 3537 STRCPY_TEXT tDiveFallback ; print "Fallback!"
3511 bra TFT_message_close ; finalize message output 3538 bra TFT_message_close ; finalize message output
3512 3539
3513 ENDIF ; _external_sensor 3540 ENDIF ; _external_sensor_eccr
3514 3541
3515 IFDEF _rx_functions 3542 IFDEF _rx_functions
3516 3543
3517 ;----------------------------------------------------------------------------- 3544 ;-----------------------------------------------------------------------------
3518 ; Dive Mode - Message - TR - Transmitter 3545 ; Dive Mode - Message - TR - Transmitter
3625 ; Surface Custom View - DESAT, NoFly, CNS 3652 ; Surface Custom View - DESAT, NoFly, CNS
3626 ; 3653 ;
3627 3654
3628 global TFT_surf_desat_nofly_cns 3655 global TFT_surf_desat_nofly_cns
3629 TFT_surf_desat_nofly_cns: 3656 TFT_surf_desat_nofly_cns:
3630 WIN_SMALL surf_gaslist_column+.10,surf_gaslist_row+.5 3657 FONT_COLOR color_green ; set menu title font color
3631 call TFT_surf_mesg_desat2 3658 WIN_TINY surf_gaslist_column,surf_gaslist_row+.5
3632 WIN_SMALL surf_gaslist_column+.10,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5 3659 STRCPY_PRINT "Desat:" ; print label
3633 call TFT_nofly_time_fly 3660 FONT_COLOR_MEMO ; select color
3634 WIN_SMALL surf_gaslist_column+.10,surf_gaslist_row+(surf_gaslist_spacing*.2)+.5 3661 WIN_SMALL surf_gaslist_column+.56,surf_gaslist_row
3635 bra TFT_surface_tissues_5 ; continue 3662 MOVII int_O_desaturation_time,mpr ; get desaturation time in minutes
3636 3663 rcall TFT_surf_desat_nofly_cns_helper
3664
3665 FONT_COLOR color_green ; set menu title font color
3666 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5
3667 movff char_I_altitude_wait,WREG ; get mode
3668 tstfsz WREG ; mode = altitude?
3669 bra TFT_surf_desat_nofly_cns_noalt ; YES
3670 ;bra TFT_nofly_time_fly ; NO
3671
3672 TFT_surf_desat_nofly_cns_nofly:
3673 STRCPY_PRINT "NoFly:" ; print no-fly label
3674 FONT_COLOR_MEMO ; select color
3675 WIN_SMALL surf_gaslist_column+.56,surf_gaslist_row+(surf_gaslist_spacing*.1)
3676 MOVII int_O_nofly_time,mpr ; get no-fly time in minutes
3677 rcall TFT_surf_desat_nofly_cns_helper
3678 bra TFT_surf_desat_nofly_cns2 ; continue
3679
3680 TFT_surf_desat_nofly_cns_noalt:
3681 STRCPY_PRINT "NoAlt:" ; print no-altitude label
3682 FONT_COLOR_MEMO ; select color
3683 WIN_SMALL surf_gaslist_column+.56,surf_gaslist_row+(surf_gaslist_spacing*.1)
3684 rcall TFT_surf_desat_nofly_cns_helper
3685 ;bra TFT_surf_desat_nofly_cns2 ; continue
3686
3687 TFT_surf_desat_nofly_cns2:
3688 FONT_COLOR color_green ; set menu title font color
3689 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)+.5
3690 STRCPY_PRINT "CNS:" ; print label
3691 FONT_COLOR_MEMO ; select color
3692 WIN_SMALL surf_gaslist_column+.62,surf_gaslist_row+(surf_gaslist_spacing*.2)
3693 MOVII int_O_CNS_current,mpr ; get current CNS
3694 call TFT_color_code_cns ; color-code CNS value
3695 output_999 ; print (0-999)
3696 PUTC_PRINT "%" ; append unit and dump to screen
3697 return
3698
3699 TFT_surf_desat_nofly_cns_helper:
3700 call convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo)
3701 movff lo,up ; backup lo
3702 movff hi,lo ; get hours into lo
3703 output_99 ; print hours (0-99)
3704 PUTC ':' ; print ":"
3705 movff up,lo ; get minutes into lo
3706 output_99x ; print minutes (00-99)
3707 PRINT
3708 return
3637 3709
3638 ;----------------------------------------------------------------------------- 3710 ;-----------------------------------------------------------------------------
3639 ; Surface Custom View - Last Dive Summery 3711 ; Surface Custom View - Last Dive Summery
3640 ; 3712 ;
3641 global TFT_surf_cv_lastdive 3713 global TFT_surf_cv_lastdive
3642 TFT_surf_cv_lastdive: 3714 TFT_surf_cv_lastdive:
3643 FONT_COLOR_MEMO ; set color 3715 FONT_COLOR color_green ; set menu title font color
3644 3716
3645 WIN_TINY surf_gaslist_column,surf_gaslist_row+.5 3717 WIN_TINY surf_gaslist_column,surf_gaslist_row+.5
3646 STRCAT_TEXT_PRINT tLastDive ; "Last Dive:" 3718 STRCAT_TEXT_PRINT tLastDive ; "Last Dive:"
3647 3719
3648 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5 3720 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5
3649 STRCAT_TEXT_PRINT tDivetime ; "Divetime:" 3721 STRCAT_TEXT_PRINT tDivetime ; "Divetime:"
3652 STRCAT_TEXT_PRINT tMaxDepth ; "Max.Depth" 3724 STRCAT_TEXT_PRINT tMaxDepth ; "Max.Depth"
3653 3725
3654 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)+.5 3726 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)+.5
3655 STRCAT_TEXT_PRINT tAvgDepth ; "Average" 3727 STRCAT_TEXT_PRINT tAvgDepth ; "Average"
3656 3728
3729 FONT_COLOR_MEMO ; set color
3657 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row 3730 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row
3658 SMOVII int_O_desaturation_time,mpr ; ISR-safe copy of the desaturation time 3731 SMOVII int_O_desaturation_time,mpr ; ISR-safe copy of the desaturation time
3659 movf mpr+0,W ; get low byte into WREG 3732 movf mpr+0,W ; get low byte into WREG
3660 iorwf mpr+1,W ; inclusive-or with high byte, check if desaturation time is zero 3733 iorwf mpr+1,W ; inclusive-or with high byte, check if desaturation time is zero
3661 bz TFT_surface_lastdive_2 ; YES - show last dive time 3734 bz TFT_surface_lastdive_2 ; YES - show last dive time
4008 ;----------------------------------------------------------------------------- 4081 ;-----------------------------------------------------------------------------
4009 ; Surface Custom View - Tissue Graphics 4082 ; Surface Custom View - Tissue Graphics
4010 ; 4083 ;
4011 global TFT_surf_cv_settings 4084 global TFT_surf_cv_settings
4012 TFT_surf_cv_settings: 4085 TFT_surf_cv_settings:
4086 FONT_COLOR color_green ; set menu title font color
4087
4088 WIN_TINY surf_gaslist_column,surf_gaslist_row+.5
4089 STRCAT_TEXT tGasDeco ; "Deco"
4090 PUTC ":"
4091 PRINT
4092
4013 ; Deco Mode 4093 ; Deco Mode
4014 FONT_COLOR_MEMO ; select color 4094 FONT_COLOR_MEMO ; select color
4015 WIN_SMALL surf_gaslist_column,surf_gaslist_row 4095 WIN_SMALL surf_gaslist_column+.27,surf_gaslist_row
4016 STRCAT_PRINT "ZH-L16" ; print fix part of model 4096 STRCAT_PRINT "ZH-L16" ; print fix part of model
4017 movff char_I_model,WREG ; get model 4097 movff char_I_model,WREG ; get model
4018 iorwf WREG ; GF enabled? 4098 iorwf WREG ; GF enabled?
4019 bnz TFT_surface_decosettings1 ; YES 4099 bnz TFT_surface_decosettings1 ; YES
4020 ;bra TFT_surface_decosettings0 ; NO 4100 ;bra TFT_surface_decosettings0 ; NO
4021 4101
4022 TFT_surface_decosettings0: 4102 TFT_surface_decosettings0:
4023 ; Display ZH-L16 sat/desat model 4103 ; Display ZH-L16 sat/desat model
4024 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1) 4104 FONT_COLOR color_green ; set menu title font color
4025 STRCPY_TEXT tSD ; print label (S/D) 4105 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5
4106 STRCPY_TEXT_PRINT tSD ; print label (S/D)
4107 FONT_COLOR_MEMO ; select color
4108 WIN_SMALL surf_gaslist_column+.27,surf_gaslist_row+(surf_gaslist_spacing*.1)
4026 movff char_I_saturation_multiplier, lo ; get sat mult. 4109 movff char_I_saturation_multiplier, lo ; get sat mult.
4027 movff char_I_desaturation_multiplier,hi ; get desat mult. 4110 movff char_I_desaturation_multiplier,hi ; get desat mult.
4028 bra TFT_surface_decosettings_com ; continue with common part 4111 bra TFT_surface_decosettings_com ; continue with common part
4029 4112
4030 TFT_surface_decosettings1: 4113 TFT_surface_decosettings1:
4031 ; Display ZH-L16-GF low/high model 4114 ; Display ZH-L16-GF low/high model
4032 WIN_SMALL surf_gaslist_column+.43,surf_gaslist_row 4115 WIN_SMALL surf_gaslist_column+.43+.27,surf_gaslist_row
4033 STRCPY_TEXT_PRINT tZHL16GF ; print GF label behind deco model label 4116 STRCPY_TEXT_PRINT tZHL16GF ; print "+GF" label behind deco model label
4034 4117
4035 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1) 4118 FONT_COLOR color_green ; set menu title font color
4036 STRCPY_TEXT tGF ; print label (GF:) 4119 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5
4037 PUTC ' ' ; print a space 4120 STRCPY_TEXT_PRINT tGF ; print label (GF:)
4121 FONT_COLOR_MEMO ; select color
4122 WIN_SMALL surf_gaslist_column+.27,surf_gaslist_row+(surf_gaslist_spacing*.1)
4038 movff opt_GF_low, lo ; get GF low 4123 movff opt_GF_low, lo ; get GF low
4039 movff opt_GF_high,hi ; get GF high 4124 movff opt_GF_high,hi ; get GF high
4040 ;bra TFT_surface_decosettings_com ; continue with common part 4125 ;bra TFT_surface_decosettings_com ; continue with common part
4041 4126
4042 TFT_surface_decosettings_com: 4127 TFT_surface_decosettings_com:
4046 movff hi,lo ; get 2nd value 4131 movff hi,lo ; get 2nd value
4047 output_256 ; print (0-255) 4132 output_256 ; print (0-255)
4048 PUTC_PRINT "%" ; append unit and dump to screen 4133 PUTC_PRINT "%" ; append unit and dump to screen
4049 4134
4050 ; fTTS 4135 ; fTTS
4051 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2) 4136 FONT_COLOR color_green ; set menu title font color
4052 STRCPY_TEXT tFTTSSurf ; print label 4137 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)+.5
4138 STRCPY_TEXT_PRINT tFTTSSurf ; print label
4139 FONT_COLOR_MEMO ; select color
4140 WIN_SMALL surf_gaslist_column+.76,surf_gaslist_row+(surf_gaslist_spacing*.2)
4053 movff char_I_extra_time,lo ; get time 4141 movff char_I_extra_time,lo ; get time
4054 output_9 ; print time (0-9) 4142 output_9 ; print time (0-9)
4055 STRCAT_TEXT_PRINT tMinutes ; append unit and dump to screen 4143 STRCAT_TEXT_PRINT tMinutes ; append unit and dump to screen
4056 4144
4057 ; Last Stop 4145 ; Last Stop
4058 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3) 4146 FONT_COLOR color_green ; set menu title font color
4059 STRCPY_TEXT tLastDecostopSurf ; print label 4147 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)+.5
4148 STRCPY_TEXT_PRINT tLastDecostopSurf ; print label
4149 FONT_COLOR_MEMO ; select color
4150 WIN_SMALL surf_gaslist_column+.76,surf_gaslist_row+(surf_gaslist_spacing*.3)
4060 movff opt_last_stop,lo ; get depth 4151 movff opt_last_stop,lo ; get depth
4061 output_9 ; print depth (0-9) 4152 output_9 ; print depth (0-9)
4062 STRCAT_TEXT_PRINT tMeters ; append unit and dump to screen 4153 STRCAT_TEXT_PRINT tMeters ; append unit and dump to screen
4063 4154
4064 ; Salinity 4155 ; Salinity
4065 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4) 4156 FONT_COLOR color_green ; set menu title font color
4066 STRCPY_TEXT tDvSalinitySurf ; print label 4157 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)+.5
4158 STRCPY_TEXT_PRINT tDvSalinitySurf ; print label
4159 FONT_COLOR_MEMO ; select color
4160 WIN_SMALL surf_gaslist_column+.76,surf_gaslist_row+(surf_gaslist_spacing*.4)
4067 movff opt_salinity,lo ; get salinity 4161 movff opt_salinity,lo ; get salinity
4068 output_9 ; print salinity (0-9) 4162 output_9 ; print salinity (0-9)
4069 STRCAT_TEXT_PRINT tPercent ; append unit and dump to screen 4163 STRCAT_TEXT_PRINT tPercent ; append unit and dump to screen
4070
4071 return ; done 4164 return ; done
4072 4165
4073 4166
4074 IFDEF _rx_functions 4167 IFDEF _rx_functions
4075 4168
4434 TFT_update_avr_stopwatch3: 4527 TFT_update_avr_stopwatch3:
4435 WIN_MEDIUM dm_custom_avr_stop_column2,dm_custom_avr_stop_row 4528 WIN_MEDIUM dm_custom_avr_stop_column2,dm_custom_avr_stop_row
4436 ;bra TFT_update_stopwatch ; continue 4529 ;bra TFT_update_stopwatch ; continue
4437 4530
4438 TFT_update_stopwatch: 4531 TFT_update_stopwatch:
4439 ; jump-in point for stopped dive time in compass custom view 4532 MOVII divesecs_avg_trip,mpr ; get the resettable dive time (stopwatch)
4440 MOVII divesecs_avg_trip,mpr ; get the resettable dive time (stopwatch) 4533 update_stopwatch_common: ; jump-in point for stopped dive time in compass custom view
4441 call convert_time ; convert hi:lo in seconds to minutes (up:hi) and seconds (lo) 4534 call convert_time ; convert hi:lo in seconds to minutes (up:hi) and seconds (lo)
4442 movlw .100 ; display layout will change if minutes become >= 100 4535 movlw .100 ; display layout will change if minutes become >= 100
4443 cpfslt hi ; minutes < 100 ? 4536 cpfslt hi ; minutes < 100 ?
4444 bra TFT_update_stopwatch_1 ; NO - display hours:minutes 4537 bra TFT_update_stopwatch_1 ; NO - display hours:minutes
4445 bcf aux_flag ; YES - will print minutes : seconds 4538 bcf aux_flag ; YES - will print minutes : seconds
4703 ; 4796 ;
4704 global TFT_ceiling_GF_tissue_mask 4797 global TFT_ceiling_GF_tissue_mask
4705 TFT_ceiling_GF_tissue_mask: 4798 TFT_ceiling_GF_tissue_mask:
4706 FONT_COLOR_MASK ; select color 4799 FONT_COLOR_MASK ; select color
4707 4800
4801 WIN_TINY dm_custom_gf_column1+.5, dm_custom_gf_title_row
4802 STRCPY_TEXT_PRINT tGFInfo ; print label
4803
4708 WIN_TINY dm_custom_ceiling_column+.2,dm_custom_ceiling_title_row 4804 WIN_TINY dm_custom_ceiling_column+.2,dm_custom_ceiling_title_row
4709 STRCPY_TEXT_PRINT tCeiling ; print label 4805 STRCPY_TEXT_PRINT tCeiling ; print label
4710 4806
4711 WIN_TINY dm_custom_tissue_title_column, dm_custom_tissue_title_row 4807 WIN_TINY dm_custom_tissue_title_column, dm_custom_tissue_title_row
4712 STRCPY_TEXT_PRINT tDiveTissues ; print label 4808 STRCPY_TEXT_PRINT tDiveTissues ; print labelGF
4809 return ; done
4810
4811 ;-----------------------------------------------------------------------------
4812 ; Dive Custom View - Ceiling, Supersaturation & GF Surface - Mask
4813 ;
4814 global TFT_ceiling_GF_surfGF_mask
4815 TFT_ceiling_GF_surfGF_mask:
4816 FONT_COLOR_MASK ; select color
4713 4817
4714 WIN_TINY dm_custom_gf_column1+.5, dm_custom_gf_title_row 4818 WIN_TINY dm_custom_gf_column1+.5, dm_custom_gf_title_row
4715 STRCPY_TEXT_PRINT tGFInfo ; print label 4819 STRCPY_TEXT_PRINT tGFInfo ; print label
4716 4820
4717 return ; done 4821 WIN_TINY dm_custom_ceiling_column+.2,dm_custom_ceiling_title_row
4718 4822 STRCPY_TEXT_PRINT tCeiling ; print label
4823
4824 WIN_TINY dm_custom_surfGF_title_column, dm_custom_surfGF_title_row
4825 STRCPY_TEXT_PRINT tDiveSurfGF ; print label
4826 return ; done
4719 4827
4720 ;----------------------------------------------------------------------------- 4828 ;-----------------------------------------------------------------------------
4721 ; Dive Custom View - Ceiling, Supersaturation & Tissues - Data 4829 ; Dive Custom View - Ceiling, Supersaturation & Tissues - Data
4722 ; 4830 ;
4723 global TFT_ceiling_GF_tissue 4831 global TFT_ceiling_GF_tissue
4724 TFT_ceiling_GF_tissue: 4832 TFT_ceiling_GF_tissue:
4725 WIN_MEDIUM dm_custom_ceiling_column,dm_custom_ceiling_row 4833 ; Show ceiling
4726 MOVII int_O_ceiling,mpr ; get ceiling in [mbar] relative pressure 4834 rcall TFT_ceiling
4727 call TFT_color_code_ceiling ; color-code the output (also strips off flags)
4728 call convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm]
4729
4730 TSTOSS opt_units ; 0=m, 1=ft
4731 bra TFT_ceiling_GF_tissue_metric ; 0 - meter
4732 ;bra TFT_ceiling_GF_tissue_imperial ; 1 - feet
4733
4734 TFT_ceiling_GF_tissue_imperial:
4735 call convert_cm_to_feet ; convert value in hi:lo from [cm] to [feet]
4736 output_999 ; print (0-999)
4737 bra TFT_ceiling_GF_tissue0 ; continue
4738
4739 TFT_ceiling_GF_tissue_metric:
4740 bsf omit_digit_1 ; do not print 1st digit
4741 bsf decimal_digit2 ; place a decimal point in front of digit 2
4742 bsf leftbind ; print left-aligned
4743 output_65535 ; print (xxx.x-)
4744 bra TFT_ceiling_GF_tissue0 ; continue
4745
4746 TFT_ceiling_GF_tissue0:
4747 PUTC_PRINT " " ; append a space and dump to screen
4748 ; show tissue diagram 4835 ; show tissue diagram
4749 rcall TFT_dive_tissues ; show tissue pressure diagram 4836 rcall TFT_dive_tissues ; show tissue pressure diagram
4750 ; show current supersaturation 4837 ; show current supersaturation
4751 WIN_MEDIUM dm_custom_clock_column+.3, dm_custom_gf_row 4838 WIN_MEDIUM dm_custom_clock_column+.3, dm_custom_gf_row
4752 MOVII int_O_lead_supersat,mpr ; bank-safe copy of leading tissue's supersaturation 4839 MOVII int_O_lead_supersat,mpr ; bank-safe copy of leading tissue's supersaturation
4754 output_256 ; need to print lo only, int_O_lead_supersat value is limited to 255 4841 output_256 ; need to print lo only, int_O_lead_supersat value is limited to 255
4755 PRINT ; dump to screen 4842 PRINT ; dump to screen
4756 WIN_STD dm_custom_clock_column+.40, dm_custom_gf_row+.5 4843 WIN_STD dm_custom_clock_column+.40, dm_custom_gf_row+.5
4757 PUTC_PRINT "%" ; print "%" and dump to screen 4844 PUTC_PRINT "%" ; print "%" and dump to screen
4758 return ; done 4845 return ; done
4759
4760 4846
4761 ;------------------------------------------------------------------------- 4847 ;-------------------------------------------------------------------------
4762 ; Draw saturation graph in dive mode custom view 4848 ; Draw saturation graph in dive mode custom view
4763 ; 4849 ;
4764 TFT_dive_tissues: 4850 TFT_dive_tissues:
4905 bsf leftbind ; print left-aligned 4991 bsf leftbind ; print left-aligned
4906 output_99 ; print tissue number (0-99) 4992 output_99 ; print tissue number (0-99)
4907 PRINT ; dump buffer to screen 4993 PRINT ; dump buffer to screen
4908 return ; done 4994 return ; done
4909 4995
4996 TFT_ceiling:
4997 WIN_MEDIUM dm_custom_ceiling_column,dm_custom_ceiling_row
4998 MOVII int_O_ceiling,mpr ; get ceiling in [mbar] relative pressure
4999 call TFT_color_code_ceiling ; color-code the output (also strips off flags)
5000 call convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm]
5001
5002 TSTOSS opt_units ; 0=m, 1=ft
5003 bra TFT_ceiling_GF_tissue_metric ; 0 - meter
5004 ;bra TFT_ceiling_GF_tissue_imperial ; 1 - feet
5005
5006 TFT_ceiling_GF_tissue_imperial:
5007 call convert_cm_to_feet ; convert value in hi:lo from [cm] to [feet]
5008 output_999 ; print (0-999)
5009 bra TFT_ceiling_GF_tissue0 ; continue
5010
5011 TFT_ceiling_GF_tissue_metric:
5012 bsf omit_digit_1 ; do not print 1st digit
5013 bsf decimal_digit2 ; place a decimal point in front of digit 2
5014 bsf leftbind ; print left-aligned
5015 output_65535 ; print (xxx.x-)
5016 bra TFT_ceiling_GF_tissue0 ; continue
5017
5018 TFT_ceiling_GF_tissue0:
5019 PUTC_PRINT " " ; append a space and dump to screen
5020 return
4910 5021
4911 ; Helper Function - draw a bargraph 5022 ; Helper Function - draw a bargraph
4912 TFT_dive_tissues_bargraph: 5023 TFT_dive_tissues_bargraph:
4913 addwf hi,W ; add row number to start position 5024 addwf hi,W ; add row number to start position
4914 movwf win_top ; set as row top (0-239) 5025 movwf win_top ; set as row top (0-239)
4922 movff up,win_bargraph ; set bargraph length 5033 movff up,win_bargraph ; set bargraph length
4923 incf win_bargraph,F ; add a bit for a minimum visible bar 5034 incf win_bargraph,F ; add a bit for a minimum visible bar
4924 BOX_COLOR ; draw bargraph 5035 BOX_COLOR ; draw bargraph
4925 return ; done 5036 return ; done
4926 5037
5038 ;-----------------------------------------------------------------------------
5039 ; Dive Custom View - Ceiling, Supersaturation & Surf GF - Data
5040 ;
5041
5042 global TFT_ceiling_GF_surfGF
5043 TFT_ceiling_GF_surfGF: ; data for ceiling, current GF and Surf GF
5044 ; Show ceiling
5045 rcall TFT_ceiling
5046 ; show current supersaturation
5047 WIN_MEDIUM dm_custom_clock_column+.3, dm_custom_gf_row
5048 MOVII int_O_lead_supersat,mpr ; bank-safe copy of leading tissue's supersaturation
5049 call TFT_color_code_supersat ; color-code output
5050 output_256 ; need to print lo only, int_O_lead_supersat value is limited to 255
5051 PRINT ; dump to screen
5052 WIN_STD dm_custom_clock_column+.40, dm_custom_gf_row+.5
5053 PUTC_PRINT "%" ; print "%" and dump to screen
5054 ; show Surface GF
5055 WIN_MEDIUM dm_custom_gf_column3+.13, dm_custom_gf_row
5056 MOVII int_O_GF_surface,mpr ; bank-safe copy of leading tissue's supersaturation
5057 FONT_COLOR_MEMO ; set color
5058 output_999
5059 PRINT ; dump to screen
5060 WIN_STD dm_custom_gf_column3+.50, dm_custom_gf_row+.5
5061 PUTC_PRINT "%" ; print "%" and dump to screen
5062
5063 return
4927 5064
4928 ;----------------------------------------------------------------------------- 5065 ;-----------------------------------------------------------------------------
4929 ; Dive Custom View - CNS - Mask 5066 ; Dive Custom View - CNS - Mask
4930 ; 5067 ;
4931 global TFT_CNS_mask 5068 global TFT_CNS_mask
5369 PRINT ; dump to screen 5506 PRINT ; dump to screen
5370 return ; done 5507 return ; done
5371 5508
5372 ENDIF ; _ccr_psrc 5509 ENDIF ; _ccr_psrc
5373 5510
5374 IFDEF _external_sensor 5511 IFDEF _external_sensor_eccr
5375 5512
5376 ;----------------------------------------------------------------------------- 5513 ;-----------------------------------------------------------------------------
5377 ; Dive Custom View - Sensor ppO2 - Mask 5514 ; Dive Custom View - Sensor ppO2 - Mask
5378 ; 5515 ;
5379 global TFT_ppo2_sensors_mask 5516 global TFT_ppo2_sensors_mask
5545 PRINT ; dump to screen 5682 PRINT ; dump to screen
5546 5683
5547 TFT_ppo2_sensors_4: 5684 TFT_ppo2_sensors_4:
5548 return ; done 5685 return ; done
5549 5686
5550 ENDIF ; _external_sensor 5687 ENDIF ; _external_sensor_eccr
5551 5688
5552 IFDEF _rx_functions 5689 IFDEF _rx_functions
5553 5690
5554 ;----------------------------------------------------------------------------- 5691 ;-----------------------------------------------------------------------------
5555 ; Dive Custom View - Pressures & SAC - Mask 5692 ; Dive Custom View - Pressures & SAC - Mask
6159 ; 6296 ;
6160 global TFT_print_decotype 6297 global TFT_print_decotype
6161 TFT_print_decotype: 6298 TFT_print_decotype:
6162 bsf aux_flag ; default to dive with deco calculation (used by logbook) 6299 bsf aux_flag ; default to dive with deco calculation (used by logbook)
6163 incf lo,W ; WREG = lo + 1 6300 incf lo,W ; WREG = lo + 1
6164 TFT_print_decotype_1 6301 TFT_print_decotype_1:
6165 decfsz WREG,W ; in OC mode? 6302 decfsz WREG,W ; in OC mode?
6166 bra TFT_print_decotype_2 ; NO - try next 6303 bra TFT_print_decotype_2 ; NO - try next
6167 STRCAT_TEXT_PRINT tDvOC ; YES - print "OC" 6304 STRCAT_TEXT_PRINT tDvOC ; YES - print "OC"
6168 return ; - done 6305 return ; - done
6169 TFT_print_decotype_2: 6306 TFT_print_decotype_2:
6207 WIN_TINY .100,.30 ; surface mode: fits under the textual logo in the upper right corner 6344 WIN_TINY .100,.30 ; surface mode: fits under the textual logo in the upper right corner
6208 ; WIN_TINY .35, .0 ; dive mode: fits to the right side of the depth label 6345 ; WIN_TINY .35, .0 ; dive mode: fits to the right side of the depth label
6209 ; WIN_TINY .0, . 0 ; dive mode: overwrites depth label 6346 ; WIN_TINY .0, . 0 ; dive mode: overwrites depth label
6210 FONT_COLOR_MEMO ; set color 6347 FONT_COLOR_MEMO ; set color
6211 6348
6349 ;movff ambient_light+0,lo
6212 movff gp_debug+0,lo 6350 movff gp_debug+0,lo
6213 output_256 6351 movff gp_debug+1,hi
6352 output_65535
6214 PUTC "," 6353 PUTC ","
6215 movff gp_debug+1,lo 6354 movff ambient_light+0,lo
6355 ; movff gp_debug+1,lo
6216 output_256 6356 output_256
6217 6357
6218 ; ; deco engine scheduling performance 6358 ; ; deco engine scheduling performance
6219 ; MOVII int_O_profiling_overrun,mpr ; runtime +/- versus target 6359 ; MOVII int_O_profiling_overrun,mpr ; runtime +/- versus target
6220 ; btfss mpr+1,7 ; overrun? 6360 ; btfss mpr+1,7 ; overrun?