comparison src/tft_outputs.asm @ 628:cd58f7fc86db

3.05 stable work
author heinrichsweikamp
date Thu, 19 Sep 2019 12:01:29 +0200
parents c40025d8e750
children 237931377539
comparison
equal deleted inserted replaced
627:bf5fee575701 628:cd58f7fc86db
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File tft_outputs.asm next combined generation V3.03.4 3 ; File tft_outputs.asm next combined generation V3.04.3
4 ; 4 ;
5 ; high-level Display Outputs 5 ; high-level Display Outputs
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
38 38
39 39
40 ;---- external Texts --------------------------------------------------------- 40 ;---- external Texts ---------------------------------------------------------
41 41
42 extern tFirmware 42 extern tFirmware
43 extern tHardware
43 extern tSerial 44 extern tSerial
44 extern tTotalDives 45 extern tTotalDives
45 extern tBatteryV 46 extern tBatteryV
46 extern tUptime 47 extern tUptime
47 extern tPPO2MIN 48 extern tPPO2MIN
223 bcf hi,int_attention_flag ; YES - clear attention flag 224 bcf hi,int_attention_flag ; YES - clear attention flag
224 bra TFT_attention_color ; - set to attention color and return 225 bra TFT_attention_color ; - set to attention color and return
225 226
226 227
227 global TFT_color_code_gaslist 228 global TFT_color_code_gaslist
228 TFT_color_code_gaslist: ; color-code current row in gaslist (%O2 in hi) according to current absolute pressure 229 TFT_color_code_gaslist: ; color-code a gas (%O2 in hi) according to current absolute pressure
229 ; Check very high ppO2 manually 230 ; Check very high ppO2 manually
230 MOVII pressure_abs_10,xA 231 MOVII pressure_abs_10,xA
231 movff hi,xB+0 232 movff hi,xB+0
232 clrf xB+1 233 clrf xB+1
233 call mult16x16 ; hi * absolute pressure / 10 234 call mult16x16 ; hi * absolute pressure / 10
245 call cmpU16 ; compare (sub_a - sub_b) 246 call cmpU16 ; compare (sub_a - sub_b)
246 btfsc neg_flag ; lower than ppO2 min? 247 btfsc neg_flag ; lower than ppO2 min?
247 bra TFT_warning_color ; YES - set warning color and return 248 bra TFT_warning_color ; YES - set warning color and return
248 ; Check for high ppO2 249 ; Check for high ppO2
249 movff char_O_deco_info,WREG ; bank-safe copy of deco info vector 250 movff char_O_deco_info,WREG ; bank-safe copy of deco info vector
250 btfsc WREG,deco_flag ; are we in deco? 251 btfsc WREG,deco_mode ; are we in deco?
251 bra TFT_color_code_gaslist_deco ; YES - check against ppO2 max deco only 252 bra TFT_color_code_gaslist_deco ; YES - check against ppO2 max deco only
252 ; NO - check against ppO2 max travel/normal and deco 253 ; NO - check against ppO2 max travel/normal and deco
253 ; Check for ppO2 max travel/normal 254 ; Check for ppO2 max travel/normal
254 movff char_I_ppO2_max_work,WREG ; ppo2 max during working phase 255 movff char_I_ppO2_max_work,WREG ; ppo2 max during working phase
255 mullw d'100' ; char_I_ppO2_max_work*100 256 mullw d'100' ; char_I_ppO2_max_work*100
256 MOVII PRODL,sub_b 257 ADDLI ppO2_margin_on_max,PROD ; add ppO2 margin on max value to compensate for surface pressures > 1000 hPa
257 INCI sub_b ; add 1 mbar to avoid warning on equal 258 MOVII PRODL,sub_b ; copy result to sub_b
258 call cmpU16 ; compare (sub_a - sub_b) 259 call cmpU16 ; compare (sub_a - sub_b)
259 btfss neg_flag ; higher than ppO2 max travel/deco? 260 btfss neg_flag ; higher than ppO2 max travel/deco?
260 rcall TFT_attention_color ; YES - set attention color 261 rcall TFT_attention_color ; YES - set attention color
261 ; Check for ppO2 max deco 262 ; Check for ppO2 max deco
262 TFT_color_code_gaslist_deco: 263 TFT_color_code_gaslist_deco:
263 movff char_I_ppO2_max_deco,WREG ; ppo2 max for deco 264 movff char_I_ppO2_max_deco,WREG ; ppo2 max for deco
264 mullw d'100' ; char_I_ppO2_max_deco * 100 265 mullw d'100' ; char_I_ppO2_max_deco * 100
265 MOVII PRODL,sub_b ; copy product to sub_b 266 ADDLI ppO2_margin_on_max,PROD ; add ppO2 margin on max value to compensate for surface pressures > 1000 hPa
266 INCI sub_b ; add 1 mbar to avoid warning on equal 267 MOVII PRODL,sub_b ; copy result to sub_b
267 call cmpU16 ; compare (sub_a - sub_b) 268 call cmpU16 ; compare (sub_a - sub_b)
268 btfss neg_flag ; higher than ppO2 max deco? 269 btfss neg_flag ; higher than ppO2 max deco?
269 bra TFT_warning_color ; YES - set warning color and return 270 bra TFT_warning_color ; YES - set warning color and return
270 return ; NO - keep current color 271 return ; NO - keep current color
271 272
292 ; warning color if above stop and ceiling 293 ; warning color if above stop and ceiling
293 ; (ceiling depth is calculated using current GF) 294 ; (ceiling depth is calculated using current GF)
294 movff char_O_deco_gas+0,WREG ; get flag for invalid deco data 295 movff char_O_deco_gas+0,WREG ; get flag for invalid deco data
295 btfsc WREG,char_invalid_flag ; is the invalid flag set? 296 btfsc WREG,char_invalid_flag ; is the invalid flag set?
296 bra TFT_disabled_color ; YES - set to disabled color and return 297 bra TFT_disabled_color ; YES - set to disabled color and return
297 movff char_O_deco_depth,WREG ; NO - get depth of first stop in meters into WREG 298 movff char_O_deco_depth+0,WREG ; NO - get depth of first stop in meters into WREG
298 subwf depth_meter,W ; - compute current depth - stop depth 299 subwf depth_meter,W ; - compute current depth - stop depth
299 btfsc STATUS,C ; - result negative? 300 btfsc STATUS,C ; - result negative?
300 bra TFT_color_code_stop_1 ; NO - not shallower than stop depth, check for ascent advice 301 bra TFT_color_code_stop_1 ; NO - not shallower than stop depth, check for ascent advice
301 MOVII int_O_ceiling,sub_b ; YES - get ceiling depth in mbar 302 MOVII int_O_ceiling,sub_b ; YES - get ceiling depth in mbar
302 btfsc sub_b+1,char_invalid_flag ; - is the invalid flag set? (bit 7 here) 303 btfsc sub_b+1,char_invalid_flag ; - is the invalid flag set? (bit 7 here)
305 call cmpU16 ; - sub_a - sub_b = relative pressure - int_O_ceiling 306 call cmpU16 ; - sub_a - sub_b = relative pressure - int_O_ceiling
306 btfsc neg_flag ; - is ceiling > current depth? 307 btfsc neg_flag ; - is ceiling > current depth?
307 bra TFT_warning_color ; YES - set to warning color and return 308 bra TFT_warning_color ; YES - set to warning color and return
308 bra TFT_attention_color ; NO - set to attention color and return 309 bra TFT_attention_color ; NO - set to attention color and return
309 TFT_color_code_stop_1: 310 TFT_color_code_stop_1:
310 movff char_O_deco_info,WREG ; get deco info vector 311 movff char_O_deco_depth+0,WREG ; get depth of first stop in meters into WREG
311 btfss WREG,deco_flag ; in deco mode? 312 incf WREG,W ; compute stop depth + 1 meter
312 bra TFT_memo_color ; NO - set to memo color and return 313 subwf depth_meter,W ; compute current depth - (first stop depth + 1 meter)
313 movff char_O_deco_depth,WREG ; YES - get depth of first stop in meters into WREG 314 btfss STATUS,C ; result negative?
314 incf WREG,W ; - compute stop depth + 1 meter 315 bra TFT_memo_color ; YES - within 1 meter of stop depth, use memo color
315 subwf depth_meter,W ; - compute current depth - (stop depth + 1 meter) 316 btfss deco_region ; NO - within deco stops region?
316 btfss STATUS,C ; - result negative? 317 bra TFT_memo_color ; NO - use memo color
317 bra TFT_memo_color ; YES - within 1 meter of stop depth 318 bsf win_invert ; YES - give ascent advice, ...
318 bsf win_invert ; NO - deeper that 1 meter below stop depth, give ascent advice
319 bra TFT_advice_color ; - ... and return 319 bra TFT_advice_color ; - ... and return
320 320
321 321
322 TFT_color_code_depth: 322 TFT_color_code_depth:
323 TSTOSS opt_modwarning ; MOD warning switched on? 323 TSTOSS opt_modwarning ; MOD warning switched on?
364 bra TFT_color_code_cns_1 ; NO 364 bra TFT_color_code_cns_1 ; NO
365 bcf hi,int_invalid_flag ; YES - clear invalid flag 365 bcf hi,int_invalid_flag ; YES - clear invalid flag
366 bcf hi,int_warning_flag ; clear warning flag (it may be set) 366 bcf hi,int_warning_flag ; clear warning flag (it may be set)
367 bcf hi,int_attention_flag ; clear attention flag (it may be set) 367 bcf hi,int_attention_flag ; clear attention flag (it may be set)
368 bra TFT_disabled_color ; set to disabled color and return 368 bra TFT_disabled_color ; set to disabled color and return
369 TFT_color_code_cns_1 369 TFT_color_code_cns_1:
370 btfss hi,int_warning_flag ; is the warning flag set? 370 btfss hi,int_warning_flag ; is the warning flag set?
371 bra TFT_color_code_cns_2 ; NO 371 bra TFT_color_code_cns_2 ; NO
372 bcf hi,int_warning_flag ; YES - clear warning flag 372 bcf hi,int_warning_flag ; YES - clear warning flag
373 bcf hi,int_attention_flag ; - clear attention flag (it may be set) 373 bcf hi,int_attention_flag ; - clear attention flag (it may be set)
374 bra TFT_warning_color ; - set to warning color and return 374 bra TFT_warning_color ; - set to warning color and return
415 415
416 IFDEF _ccr_pscr 416 IFDEF _ccr_pscr
417 417
418 TFT_color_code_ppo2_hud: ; color-code ppO2 values (ppO2 in --:lo [cbar]) by its value 418 TFT_color_code_ppo2_hud: ; color-code ppO2 values (ppO2 in --:lo [cbar]) by its value
419 movff char_O_deco_info,WREG ; get the deco info vector 419 movff char_O_deco_info,WREG ; get the deco info vector
420 btfss WREG,deco_flag ; are we in deco? 420 btfss WREG,deco_mode ; are we in deco?
421 bra TFT_color_code_ppo2_hud_a ; NO - load normal max value as threshold 421 bra TFT_color_code_ppo2_hud_a ; NO - load normal max value as threshold
422 movff char_I_ppO2_max_deco,WREG ; YES - load deco value as threshold 422 movff char_I_ppO2_max_deco,WREG ; YES - load deco value as threshold
423 bra TFT_color_code_ppo2_hud_b 423 bra TFT_color_code_ppo2_hud_b
424 TFT_color_code_ppo2_hud_a: 424 TFT_color_code_ppo2_hud_a:
425 movff char_I_ppO2_max_work,WREG ; ppO2 max while in working phase 425 movff char_I_ppO2_max_work,WREG ; ppO2 max while in working phase
445 ENDIF ; _ccr_pscr 445 ENDIF ; _ccr_pscr
446 446
447 ;============================================================================= 447 ;=============================================================================
448 448
449 TFT_color_code_battery: ; color-code the battery display, with battery percent in lo 449 TFT_color_code_battery: ; color-code the battery display, with battery percent in lo
450 movlw color_code_battery_low ; get warning threshold 450 movlw battery_warn_level_36+1 ; get threshold for 3.6 Volt battery warning, incremented by 1
451 cpfsgt lo ; is battery percent < threshold? 451 btfss battery_is_36v ; actually a 3.6 Volt battery detected?
452 movlw battery_warn_level_15+1 ; NO - replace with 1.5 Volt battery warning, incremented by 1
453 cpfsgt batt_percent ; is battery percent < threshold?
452 bra TFT_warning_color ; YES - set to warning color and return 454 bra TFT_warning_color ; YES - set to warning color and return
453 bra TFT_memo_color ; NO - set to memo color and return 455 bra TFT_memo_color ; NO - set to memo color and return
454 456
455 457
456 global TFT_color_code_gas 458 global TFT_color_code_gas
965 return ; YES - abort 967 return ; YES - abort
966 call TFT_divemask_color ; NO - set text color 968 call TFT_divemask_color ; NO - set text color
967 ; - set position 969 ; - set position
968 WIN_STD dm_ndl_text_column, dm_ndl_text_row 970 WIN_STD dm_ndl_text_column, dm_ndl_text_row
969 STRCPY_TEXT_PRINT tNDL ; - print "NDL" 971 STRCPY_TEXT_PRINT tNDL ; - print "NDL"
970 bra TFT_standard_color ; - done 972 btfss deco_region ; - was the dive within deco stops region?
973 bra TFT_standard_color ; NO - done
974 btfsc safety_stop_active ; YES - safety stop shown?
975 bra TFT_standard_color ; YES - done
976 TFT_show_slow_reminder:
977 call TFT_attention_color ; NO - set color
978 ; - set position
979 WIN_STD dm_safetystop_text_column+.5,dm_safetystop_text_row+.5
980 STRCPY_TEXT tSlow ; - print "SLOW" reminder
981 STRCAT_PRINT 0x94 ; - append an up-arrow
982 bra TFT_standard_color ; - done
971 983
972 984
973 global TFT_show_tts 985 global TFT_show_tts
974 TFT_show_tts: 986 TFT_show_tts:
975 btfsc dive_main_menu ; is the dive mode menu shown? 987 btfsc dive_main_menu ; is the dive mode menu shown?
1023 global TFT_show_ndl 1035 global TFT_show_ndl
1024 TFT_show_ndl: 1036 TFT_show_ndl:
1025 btfsc dive_main_menu ; is the dive mode menu shown? 1037 btfsc dive_main_menu ; is the dive mode menu shown?
1026 return ; YES - abort 1038 return ; YES - abort
1027 movff char_O_NDL_norm,lo ; NO - get NDL time in normal plan 1039 movff char_O_NDL_norm,lo ; NO - get NDL time in normal plan
1028 btfsc alt_layout_active ; - alternative layout active? 1040 btfsc deco_locked ; - was the dive in deco?
1029 bra TFT_show_ndl_alt ; YES - use alternative layout 1041 bra TFT_show_ndl_norm ; YES - use normal layout
1030 ;bra TFT_show_ndl_norm ; NO - use normal layout 1042 btfsc alt_layout_active ; NO - alternative layout active?
1043 bra TFT_show_ndl_alt ; YES - use alternative layout
1044 ;bra TFT_show_ndl_norm ; NO - use normal layout
1031 1045
1032 TFT_show_ndl_norm: ; set position 1046 TFT_show_ndl_norm: ; set position
1033 WIN_MEDIUM dm_ndl_value_col_norm,dm_ndl_value_row_norm 1047 WIN_MEDIUM dm_ndl_value_col_norm,dm_ndl_value_row_norm
1034 call TFT_memo_color ; set color 1048 call TFT_memo_color ; set color
1035 output_8 ; display 0...240 1049 output_8 ; display 0...240
1050 TFT_show_ndl_exit_1:
1036 STRCAT_PRINT "'" ; print minutes symbol 1051 STRCAT_PRINT "'" ; print minutes symbol
1037 bra TFT_standard_color ; done 1052 TFT_show_ndl_exit_2:
1053 goto TFT_standard_color ; done
1038 1054
1039 TFT_show_ndl_alt: 1055 TFT_show_ndl_alt:
1040 btfsc safety_stop_active ; is the safety stop active? 1056 btfsc safety_stop_active ; is the safety stop active?
1041 bra TFT_show_ndl_alt_safety ; YES 1057 bra TFT_show_ndl_alt_safety ; YES
1042 ; clear potential remains from NDL normal and set position 1058 ; clear potential remains from NDL normal and set position
1043 WIN_BOX_BLACK dm_ndl_value_row_norm, dm_3rdrow_bot, dm_ndl_value_col_norm, dm_ndl_value_col_alt ; top, bottom, left, right 1059 WIN_BOX_BLACK dm_ndl_value_row_norm, dm_3rdrow_bot, dm_ndl_value_col_norm, dm_ndl_value_col_alt ; top, bottom, left, right
1044 WIN_LARGE dm_ndl_value_col_alt, dm_ndl_value_row_alt 1060 WIN_LARGE dm_ndl_value_col_alt, dm_ndl_value_row_alt
1045 call TFT_memo_color ; set color 1061 call TFT_memo_color ; set color
1046 output_99 ; display 0...99 1062 output_99 ; display 0...99
1047 STRCAT_PRINT "" ; finalize output 1063 STRCAT_PRINT "" ; finalize output
1048 bra TFT_standard_color ; done 1064 bra TFT_show_ndl_exit_2 ; done
1049 1065
1050 TFT_show_ndl_alt_safety: 1066 TFT_show_ndl_alt_safety:
1051 WIN_MEDIUM dm_ndl_value_col_norm,dm_ndl_value_row_norm 1067 WIN_MEDIUM dm_ndl_value_col_norm,dm_ndl_value_row_norm
1052 call TFT_memo_color ; set color 1068 call TFT_memo_color ; set color
1053 PUTC " " ; fill first digit position 1069 PUTC " " ; fill first digit position
1054 output_99 ; display 0...99 1070 output_99 ; display 0...99
1055 STRCAT_PRINT "'" ; print minutes symbol 1071 bra TFT_show_ndl_exit_1 ; print minutes symbol and done
1056 goto TFT_standard_color ; done
1057 1072
1058 1073
1059 global TFT_divemode_sign_show 1074 global TFT_divemode_sign_show
1060 TFT_divemode_sign_show: 1075 TFT_divemode_sign_show:
1061 btfsc alt_layout_active ; alternative layout active? 1076 btfsc alt_layout_active ; alternative layout active?
1210 bcf win_invert ; back to non-inverted output 1225 bcf win_invert ; back to non-inverted output
1211 ;bra TFT_display_deco_common ; continue with common part 1226 ;bra TFT_display_deco_common ; continue with common part
1212 1227
1213 TFT_display_deco_common: 1228 TFT_display_deco_common:
1214 movff char_O_deco_time,lo ; get stop time of the first stop in minutes 1229 movff char_O_deco_time,lo ; get stop time of the first stop in minutes
1215 tstfsz lo ; stop time = 0 ? 1230 output_99DD ; print minutes or double dots if null
1216 bra TFT_display_deco_1 ; NO - print minutes
1217 STRCAT_PRINT " .." ; YES - special treatment
1218 bra TFT_display_deco_2 ; - continue with common part
1219 TFT_display_deco_1:
1220 output_99 ; print minutes
1221 TFT_display_deco_2:
1222 STRCAT_PRINT "'" ; add minutes sign 1231 STRCAT_PRINT "'" ; add minutes sign
1223 bcf win_invert ; back to non-inverted output 1232 bcf win_invert ; back to non-inverted output
1224 TFT_display_exit_1: 1233 TFT_display_exit_1:
1225 goto TFT_standard_color ; and return... 1234 goto TFT_standard_color ; and return...
1226 1235
1283 TFT_decoplan_helper_3: 1292 TFT_decoplan_helper_3:
1284 rcall TFT_display_deco_depth ; output depth (stored in lo) to POSTINC2 1293 rcall TFT_display_deco_depth ; output depth (stored in lo) to POSTINC2
1285 PUTC " " ; put a space char between depth and time 1294 PUTC " " ; put a space char between depth and time
1286 movlw NUM_STOPS ; offset between arrays holding depths and durations 1295 movlw NUM_STOPS ; offset between arrays holding depths and durations
1287 movff PLUSW0,lo ; get duration of the current stop 1296 movff PLUSW0,lo ; get duration of the current stop
1288 output_99 ; output duration to POSTINC2 1297 output_99dd ; print duration, prints double dots if duration is zero
1289 STRCAT_PRINT "'" ; append symbol for minutes and print to screen 1298 STRCAT_PRINT "'" ; append symbol for minutes and print to screen
1290 bsf ex,1 ; flag that a stop was shown 1299 bsf ex,1 ; flag that a stop was shown
1291 return 1300 return
1292 1301
1293 1302
1298 btfss safety_stop_active ; NO - is the safety stop shown? 1307 btfss safety_stop_active ; NO - is the safety stop shown?
1299 return ; NO - done, nothing to do 1308 return ; NO - done, nothing to do
1300 ; YES - clear safety stop area 1309 ; YES - clear safety stop area
1301 WIN_BOX_BLACK dm_safetystop_row, dm_safetystop_bot, dm_safetystop_text_column, dm_safetystop_rgt ; top, bottom, left, right 1310 WIN_BOX_BLACK dm_safetystop_row, dm_safetystop_bot, dm_safetystop_text_column, dm_safetystop_rgt ; top, bottom, left, right
1302 bcf safety_stop_active ; - safety stop not shown any more 1311 bcf safety_stop_active ; - safety stop not shown any more
1303 return ; - done 1312 btfsc deco_region ; - was the dive within deco stops region?
1313 bra TFT_show_slow_reminder ; YES - show "SLOW" reminder
1314 return ; NO - done
1304 1315
1305 1316
1306 global TFT_safety_stop_show 1317 global TFT_safety_stop_show
1307 TFT_safety_stop_show: 1318 TFT_safety_stop_show:
1308 btfsc dive_main_menu ; is the dive mode menu shown? 1319 btfsc dive_main_menu ; is the dive mode menu shown?
1310 btfsc safety_stop_active ; NO - is the safety stop shown already? 1321 btfsc safety_stop_active ; NO - is the safety stop shown already?
1311 bra TFT_safety_stop_show_time ; YES - just update the time 1322 bra TFT_safety_stop_show_time ; YES - just update the time
1312 ; NO - clear area that may be polluted by alternative NDL 1323 ; NO - clear area that may be polluted by alternative NDL
1313 WIN_BOX_BLACK dm_safetystop_row, dm_tts_value_row, dm_ndl_value_col_alt, dm_safetystop_rgt ; top, bottom, left, right 1324 WIN_BOX_BLACK dm_safetystop_row, dm_tts_value_row, dm_ndl_value_col_alt, dm_safetystop_rgt ; top, bottom, left, right
1314 call TFT_divemask_color ; - set color for text 1325 call TFT_divemask_color ; - set color for text
1326 bsf safety_stop_active ; - flag safety stop is shown now
1315 ; - set position for text 1327 ; - set position for text
1316 bsf safety_stop_active ; - flag safety stop is shown now
1317 WIN_STD dm_safetystop_text_column, dm_safetystop_text_row 1328 WIN_STD dm_safetystop_text_column, dm_safetystop_text_row
1318 STRCPY_TEXT_PRINT tDiveSafetyStop ; - print "Stop" 1329 STRCPY_PRINT "Stop " ; - print "Stop" with a trailing space to wipe away potential other remains
1319 TFT_safety_stop_show_time: 1330 TFT_safety_stop_show_time:
1320 call TFT_attention_color ; set color for time 1331 call TFT_attention_color ; set color for time
1321 ; set position for time 1332 ; set position for time
1322 WIN_MEDIUM dm_safetystop_column, dm_safetystop_row 1333 WIN_MEDIUM dm_safetystop_column, dm_safetystop_row
1323 movff safety_stop_countdown,lo ; get remaining time in seconds, low byte, from safety stop timer 1334 movff safety_stop_countdown,lo ; get remaining time in seconds, low byte, from safety stop timer
1340 call TFT_divemask_color 1351 call TFT_divemask_color
1341 1352
1342 IFNDEF _min_depth_option 1353 IFNDEF _min_depth_option
1343 1354
1344 WIN_TINY dm_custom_avr_stop_column1+.2,dm_custom_avr_stop_title_row 1355 WIN_TINY dm_custom_avr_stop_column1+.2,dm_custom_avr_stop_title_row
1345 TSTOSS opt_2ndDepthDisp ; draw avg depth instead of max depth in main screen? 1356 TSTOSS opt_2ndDepthDisp ; show avg depth instead of max depth in main screen?
1346 bra TFT_avr_stopwatch_mask_1 ; NO - draw avg depth in custom view then 1357 bra TFT_avr_stopwatch_mask_1 ; NO - draw avg depth in custom view then
1347 STRCPY_TEXT_PRINT tMaxDepth ; YES - draw max depth in custom view then 1358 btfss alt_layout_active ; YES - in alternative layout?
1348 bra TFT_avr_stopwatch_mask_2 1359 bra TFT_avr_stopwatch_mask_max ; NO - show max depth
1360 ;bra TFT_avr_stopwatch_mask_avg ; YES - show avg depth
1361 TFT_avr_stopwatch_mask_avg:
1362 STRCPY_TEXT_PRINT tDiveTotalAvg ; mask for average depth
1363 bra TFT_avr_stopwatch_mask_2 ; continue
1349 TFT_avr_stopwatch_mask_1: 1364 TFT_avr_stopwatch_mask_1:
1350 STRCPY_TEXT_PRINT tDiveTotalAvg 1365 btfss alt_layout_active ; YES - in alternative layout?
1366 bra TFT_avr_stopwatch_mask_avg ; NO - show avg depth
1367 ;bra TFT_avr_stopwatch_mask_max ; YES - show max depth
1368 TFT_avr_stopwatch_mask_max:
1369 STRCPY_TEXT_PRINT tMaxDepth ; mask for maximum depth
1370 ;bra TFT_avr_stopwatch_mask_2 ; continue
1351 TFT_avr_stopwatch_mask_2: 1371 TFT_avr_stopwatch_mask_2:
1352 WIN_TINY dm_custom_avr_stop_column2+.3,dm_custom_avr_stop_title_row 1372 WIN_TINY dm_custom_avr_stop_column2+.3,dm_custom_avr_stop_title_row
1353 STRCPY_TEXT_PRINT tDiveStopwatch 1373 STRCPY_TEXT_PRINT tDiveStopwatch
1354 WIN_TINY dm_custom_avr_stop_column3-.8,dm_custom_avr_stop_title_row 1374 WIN_TINY dm_custom_avr_stop_column3-.8,dm_custom_avr_stop_title_row
1355 STRCPY_TEXT_PRINT tDiveStopAvg 1375 STRCPY_TEXT_PRINT tDiveStopAvg
1375 1395
1376 IFNDEF _min_depth_option 1396 IFNDEF _min_depth_option
1377 1397
1378 ; total average depth or max depth 1398 ; total average depth or max depth
1379 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row 1399 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row
1380 TSTOSS opt_2ndDepthDisp ; draw average depth instead of maximum depth in main screen? 1400 TSTOSS opt_2ndDepthDisp ; show average depth instead of maximum depth in main screen?
1381 bra TFT_avr_stopwatch_01 ; NO - draw average depth in custom view then 1401
1382 MOVII pressure_rel_max_cached,mpr ; YES - draw maximum depth in custom view then 1402 bra TFT_avr_stopwatch_1 ; NO - draw avg depth in custom view then
1383 bra TFT_avr_stopwatch_02 1403 btfss alt_layout_active ; YES - in alternative layout?
1384 TFT_avr_stopwatch_01: 1404 bra TFT_avr_stopwatch_max ; NO - show max depth
1405 ;bra TFT_avr_stopwatch_avg ; YES - show avg depth
1406 TFT_avr_stopwatch_avg:
1385 MOVII pressure_rel_avg_total,mpr ; get total dive average depth into hi:lo 1407 MOVII pressure_rel_avg_total,mpr ; get total dive average depth into hi:lo
1386 TFT_avr_stopwatch_02: 1408 bra TFT_avr_stopwatch_2 ; continue
1409 TFT_avr_stopwatch_1:
1410 btfss alt_layout_active ; YES - in alternative layout?
1411 bra TFT_avr_stopwatch_avg ; NO - show avg depth
1412 ;bra TFT_avr_stopwatch_max ; YES - show max depth
1413 TFT_avr_stopwatch_max:
1414 MOVII pressure_rel_max_cached,mpr ; get maximum depth into hi:lo
1415 ;bra TFT_avr_stopwatch_2 ; continue
1416 TFT_avr_stopwatch_2:
1387 call adjust_depth_with_salinity ; compute salinity setting into hi:lo [mbar] 1417 call adjust_depth_with_salinity ; compute salinity setting into hi:lo [mbar]
1388 TSTOSS opt_units ; 0=m, 1=ft 1418 TSTOSS opt_units ; 0=m, 1=ft
1389 bra TFT_update_avr_stopwatch1_metric ; 0 - metric 1419 bra TFT_update_avr_stopwatch1_metric ; 0 - metric
1390 TFT_update_avr_stopwatch1_imp: ; 1 - imperial 1420 TFT_update_avr_stopwatch1_imp: ; 1 - imperial
1391 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet 1421 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
1460 ENDIF 1490 ENDIF
1461 1491
1462 ; stopped dive time (will also be used by compass custom view) 1492 ; stopped dive time (will also be used by compass custom view)
1463 WIN_MEDIUM dm_custom_avr_stop_column2,dm_custom_avr_stop_row 1493 WIN_MEDIUM dm_custom_avr_stop_column2,dm_custom_avr_stop_row
1464 TFT_update_stopwatch: ; jump-in point for stopped dive time in compass custom view 1494 TFT_update_stopwatch: ; jump-in point for stopped dive time in compass custom view
1465 bsf leftbind ; print numbers without leading spaces
1466 MOVII divesecs_avg_trip,mpr ; get the resettable dive time (stopwatch) 1495 MOVII divesecs_avg_trip,mpr ; get the resettable dive time (stopwatch)
1467 call convert_time ; convert hi:lo in seconds to minutes (up:hi) and seconds (lo) 1496 call convert_time ; convert hi:lo in seconds to minutes (up:hi) and seconds (lo)
1468 movlw .100 ; display layout will change if minutes become >= 100 1497 movlw .100 ; display layout will change if minutes become >= 100
1469 cpfslt hi ; minutes < 100 ? 1498 cpfslt hi ; minutes < 100 ?
1470 bra TFT_update_stopwatch_2 ; NO - display hours:minutes 1499 bra TFT_update_stopwatch_2 ; NO - display hours:minutes
1471 ;bra TFT_update_stopwatch_1 ; YES - display minutes:seconds 1500 bcf aux_flag ; will print minutes : seconds
1472 TFT_update_stopwatch_1: 1501 TFT_update_stopwatch_1:
1473 movf hi,W ; exchange lo and hi 1502 movf hi,W ; exchange lo and hi
1474 movff lo,hi ; ... 1503 movff lo,hi ; ...
1475 movwf lo ; ... 1504 movwf lo ; ...
1476 output_8 ; output minutes or hours 1505 bcf leftbind ; include leading spaces
1477 PUTC ':' 1506 output_99 ; output minutes or hours ( 0 - 99)
1507 movlw ":" ; load standard separator
1508 btfsc aux_flag ; will print hours : minutes ?
1509 movlw "'" ; YES - swap to alternative separator
1510 movwf POSTINC2 ; print separator
1478 movff hi,lo ; restore lo 1511 movff hi,lo ; restore lo
1479 output_99x ; output seconds or minutes 1512 output_99x ; output seconds or minutes
1480 movlw .5 1513 movlw .5
1481 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG) 1514 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
1482 clrf WREG 1515 clrf WREG
1485 bra TFT_display_exit_2 1518 bra TFT_display_exit_2
1486 TFT_update_stopwatch_2: 1519 TFT_update_stopwatch_2:
1487 movff hi,lo ; transfer minutes (low byte) to lo 1520 movff hi,lo ; transfer minutes (low byte) to lo
1488 movff up,hi ; transfer minutes (high byte) to hi 1521 movff up,hi ; transfer minutes (high byte) to hi
1489 call convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo) 1522 call convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo)
1523 bsf aux_flag ; will print hours : minutes
1490 bra TFT_update_stopwatch_1 1524 bra TFT_update_stopwatch_1
1491 1525
1492 1526
1493 global TFT_CNS_mask 1527 global TFT_CNS_mask
1494 TFT_CNS_mask: 1528 TFT_CNS_mask:
1785 1819
1786 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row 1820 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row
1787 SMOVII sensor3_mv,mpr ; in 0.1mV steps 1821 SMOVII sensor3_mv,mpr ; in 0.1mV steps
1788 STRCAT "3: " 1822 STRCAT "3: "
1789 rcall TFT_sensor_mV_helper 1823 rcall TFT_sensor_mV_helper
1790
1791 bcf leftbind 1824 bcf leftbind
1825
1826 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row+.24 ; 4th row
1827 btfss s8_digital_avail ; do we have a digital S8 interface?
1828 bra TFT_sensor_mV_optical_analog
1829 STRCAT_PRINT "Digital"
1830 bra TFT_display_exit_3
1831 TFT_sensor_mV_optical_analog:
1832 btfss ir_power ; do we have a optical digital interface?
1833 bra TFT_sensor_mV_analog
1834 STRCAT_PRINT "Optical"
1835 bra TFT_display_exit_3
1836 TFT_sensor_mV_analog: ; -> optical
1837 STRCAT_PRINT "Analog"
1792 bra TFT_display_exit_3 1838 bra TFT_display_exit_3
1793 1839
1794 TFT_sensor_mV_helper: 1840 TFT_sensor_mV_helper:
1795 output_16dp .4 ; xxx.y mV 1841 output_16dp .4 ; xxx.y mV
1796 STRCAT_PRINT "mV " 1842 STRCAT_PRINT "mV "
1859 1905
1860 ;============================================================================= 1906 ;=============================================================================
1861 1907
1862 global TFT_time_surfmode 1908 global TFT_time_surfmode
1863 TFT_time_surfmode: 1909 TFT_time_surfmode:
1864 IFDEF _ostc_logo
1865 WIN_SMALL surf_clock_column,surf_clock_row
1866 ELSE
1867 WIN_SMALL surf_clock_column+.7,surf_clock_row 1910 WIN_SMALL surf_clock_column+.7,surf_clock_row
1868 ENDIF 1911 TFT_clock2: ; called from dive mode clock
1869 TFT_clock2: ; called from divemode clock
1870 call TFT_standard_color 1912 call TFT_standard_color
1871 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time 1913 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
1872 movff rtc_latched_hour,lo 1914 movff rtc_latched_hour,lo
1873 output_99 1915 output_99
1874 movlw ':' 1916 movlw ':'
2211 STRCAT "bar" ; print "bar" 2253 STRCAT "bar" ; print "bar"
2212 IFDEF _external_sensor 2254 IFDEF _external_sensor
2213 movff opt_ccr_mode,WREG ; get setpoint mode =0: Fixed SP, =1: Sensor, =2: Auto SP 2255 movff opt_ccr_mode,WREG ; get setpoint mode =0: Fixed SP, =1: Sensor, =2: Auto SP
2214 sublw .1 ; opt_ccr_mode = 1 (Sensor) ? 2256 sublw .1 ; opt_ccr_mode = 1 (Sensor) ?
2215 bnz TFT_active_sp_label_1 ; NO - skip 2257 bnz TFT_active_sp_label_1 ; NO - skip
2216 PUTC "*" ; YES - add "*" 2258 btfsc alt_layout_active ; YES - in alternative layout?
2259 bra TFT_active_sp_label_1 ; YES - no space available for the "*"
2260 PUTC "*" ; NO - add "*"
2217 TFT_active_sp_label_1: 2261 TFT_active_sp_label_1:
2218 ENDIF 2262 ENDIF
2219 STRCAT_PRINT "" ; finalize output 2263 STRCAT_PRINT "" ; finalize output
2220 2264
2221 TFT_active_loop_mode: 2265 TFT_active_loop_mode:
2800 tstfsz WREG ; any indicator or warning active? 2844 tstfsz WREG ; any indicator or warning active?
2801 bsf win_invert ; YES - set output to inverse 2845 bsf win_invert ; YES - set output to inverse
2802 tstfsz WREG ; any indicator or warning active (asked again)? 2846 tstfsz WREG ; any indicator or warning active (asked again)?
2803 call TFT_set_color ; YES - set color 2847 call TFT_set_color ; YES - set color
2804 2848
2805 IFDEF _ostc_logo
2806 WIN_TINY batt_percent_column,batt_percent_row
2807 ELSE
2808 WIN_SMALL batt_percent_column+.2,batt_percent_row 2849 WIN_SMALL batt_percent_column+.2,batt_percent_row
2809 ENDIF
2810
2811 output_16_3 ; display only last three digits from a 16 bit value (0-999) 2850 output_16_3 ; display only last three digits from a 16 bit value (0-999)
2812 STRCAT_PRINT "% " 2851 STRCAT_PRINT "% "
2813 bcf win_invert 2852 bcf win_invert
2814 call TFT_standard_color 2853 call TFT_standard_color
2815
2816 IFDEF _ostc_logo
2817 WIN_TINY batt_voltage_column,batt_voltage_row
2818 ELSE
2819 WIN_TINY batt_voltage_column+.15,batt_voltage_row 2854 WIN_TINY batt_voltage_column+.15,batt_voltage_row
2820 ENDIF
2821
2822 movff battery_type,lo ; =0: 1.5V, =1: 3.6V Saft, =2: LiIon 3.7V/0.8Ah, =3: LiIon 3.7V/3.1Ah, =4: LiIon 3.7V/2.3Ah 2855 movff battery_type,lo ; =0: 1.5V, =1: 3.6V Saft, =2: LiIon 3.7V/0.8Ah, =3: LiIon 3.7V/3.1Ah, =4: LiIon 3.7V/2.3Ah
2823 PUTC "T" 2856 PUTC "T"
2824 bsf leftbind 2857 bsf leftbind
2825 output_8 2858 output_8
2826 PUTC ":" 2859 PUTC ":"
3336 STRCAT "B." ; short version for "Beta" 3369 STRCAT "B." ; short version for "Beta"
3337 bra TFT_cat_beta_1a ; append beta version number 3370 bra TFT_cat_beta_1a ; append beta version number
3338 TFT_cat_beta_4 3371 TFT_cat_beta_4
3339 STRCAT "update!" ; print update cue 3372 STRCAT "update!" ; print update cue
3340 goto TFT_attention_color ; and return 3373 goto TFT_attention_color ; and return
3341 ENDIF ; _DEBUG 3374 ENDIF ; ELSE / _DEBUG
3342 3375
3343 ;----------------------------------------------------------------------------- 3376 ;-----------------------------------------------------------------------------
3344 ; show firmware update message 3377 ; show firmware update message
3345 ; 3378 ;
3346 ; all text outputs are hard-coded since language switching 3379 ; all text outputs are hard-coded since language switching
3383 global TFT_show_firmware 3416 global TFT_show_firmware
3384 TFT_show_serial_and_firmware: 3417 TFT_show_serial_and_firmware:
3385 STRCPY "#" 3418 STRCPY "#"
3386 call TFT_cat_serial 3419 call TFT_cat_serial
3387 STRCAT " " 3420 STRCAT " "
3421 STRCAT "v"
3388 TFT_show_firmware: 3422 TFT_show_firmware:
3389 STRCAT "v"
3390 call TFT_cat_firmware ; will set win_invert if outdated 3423 call TFT_cat_firmware ; will set win_invert if outdated
3391 STRCAT " " 3424 STRCAT " "
3392 call TFT_cat_beta_release 3425 call TFT_cat_beta_release
3393 STRCAT_PRINT "" 3426 STRCAT_PRINT ""
3394 bcf win_invert ; clear win_invert 3427 bcf win_invert ; clear win_invert
3395 goto TFT_standard_color ; ...and return 3428 goto TFT_standard_color ; ...and return
3396 3429
3430 ;-----------------------------------------------------------------------------
3431 ; For the Information menu: append total dives
3432
3433 global info_menu_total_dives
3434 info_menu_total_dives:
3435 lfsr FSR1,tTotalDives
3436 call strcat_text
3437 TFT_cat_total_dives:
3438 read_int_eeprom .2
3439 movff EEDATA,lo
3440 read_int_eeprom .3
3441 movff EEDATA,hi
3442 bsf leftbind
3443 output_16
3444 bcf leftbind
3445 return
3446
3397 ;----------------------------------------------------------------------------- 3447 ;-----------------------------------------------------------------------------
3398 ; append firmware version to current string, including color-coding 3448 ; append firmware version to current string, including color-coding
3399 3449
3400 global TFT_cat_firmware 3450 global TFT_cat_firmware
3401 TFT_cat_firmware: 3451 TFT_cat_firmware:
3402 movlw softwareversion_x 3452 movlw softwareversion_x
3403 movwf lo 3453 movwf lo
3404 bsf leftbind 3454 bsf leftbind
3405 output_8 ; print major in 1 digit format 3455 output_8 ; print major in 1 or 2 digit format
3406 PUTC '.' 3456 PUTC '.'
3407 movlw softwareversion_y 3457 movlw softwareversion_y
3408 movwf lo 3458 movwf lo
3409 output_99x ; print minor in two digit format 3459 output_99x ; print minor in two digit format
3410 bcf leftbind 3460 bcf leftbind
3448 return 3498 return
3449 3499
3450 ENDIF 3500 ENDIF
3451 3501
3452 ;----------------------------------------------------------------------------- 3502 ;-----------------------------------------------------------------------------
3453 ; For the Information menu: append serial number 3503 ; For the Information menu: serial number
3454 3504
3455 global info_menu_serial 3505 global info_menu_serial
3456 global TFT_cat_serial 3506 global TFT_cat_serial
3457 info_menu_serial: 3507 info_menu_serial:
3458 lfsr FSR1,tSerial 3508 lfsr FSR1,tSerial
3470 output_16 3520 output_16
3471 bcf leftbind 3521 bcf leftbind
3472 return 3522 return
3473 3523
3474 ;----------------------------------------------------------------------------- 3524 ;-----------------------------------------------------------------------------
3475 ; For the Information menu: append total dives 3525 ; For the Information menu: hardware / software configuration
3476 3526
3477 global info_menu_total_dives 3527 global info_menu_config
3478 info_menu_total_dives: 3528 info_menu_config:
3479 lfsr FSR1,tTotalDives 3529 lfsr FSR1,tHardware
3480 call strcat_text 3530 call strcat_text
3481 TFT_cat_total_dives: 3531 call I2C_init_compass ; start compass
3482 read_int_eeprom .2 3532 movf HW_descriptor,W ; copy hardware descriptor to WREG
3483 movff EEDATA,lo 3533 output_hex ; print as hex
3484 read_int_eeprom .3 3534 PUTC "-" ; print a separator
3485 movff EEDATA,hi 3535 movf HW_variants,W ; copy hardware variants to WREG
3486 bsf leftbind 3536 output_hex ; print as hex
3487 output_16 3537 PUTC "-" ; print a separator
3488 bcf leftbind 3538 movlw SW_CONF ; get software configuration
3539 output_hex ; print as hex
3489 return 3540 return
3490 3541
3542
3491 ;----------------------------------------------------------------------------- 3543 ;-----------------------------------------------------------------------------
3492 ; For the Information menu: append battery voltage 3544 ; For the Information menu: battery voltage
3493 3545
3494 global info_menu_battery_volts 3546 global info_menu_battery_volts
3495 info_menu_battery_volts: 3547 info_menu_battery_volts:
3496 lfsr FSR1,tBatteryV 3548 lfsr FSR1,tBatteryV
3497 call strcat_text 3549 call strcat_text
3504 bcf leftbind 3556 bcf leftbind
3505 PUTC ")" 3557 PUTC ")"
3506 return 3558 return
3507 3559
3508 ;----------------------------------------------------------------------------- 3560 ;-----------------------------------------------------------------------------
3509 ; For the Information menu: append uptime 3561 ; For the Information menu: uptime
3510 3562
3511 global info_menu_uptime 3563 global info_menu_uptime
3512 info_menu_uptime: 3564 info_menu_uptime:
3513 lfsr FSR1,tUptime 3565 lfsr FSR1,tUptime
3514 call strcat_text 3566 call strcat_text
3528 output_8 3580 output_8
3529 PUTC "h" 3581 PUTC "h"
3530 bcf leftbind 3582 bcf leftbind
3531 return ; done 3583 return ; done
3532 3584
3585 ;-----------------------------------------------------------------------------
3533 3586
3534 IFDEF _compass 3587 IFDEF _compass
3535 3588
3536 global menu_cal_x 3589 global menu_cal_x
3537 menu_cal_x: 3590 menu_cal_x:
4421 WIN_TINY dm_custom_ppo2_column-.2, dm_custom_ppo2_title_row ; normal position 4474 WIN_TINY dm_custom_ppo2_column-.2, dm_custom_ppo2_title_row ; normal position
4422 STRCPY_TEXT_PRINT tppO2 ; in all other modes 4475 STRCPY_TEXT_PRINT tppO2 ; in all other modes
4423 bra TFT_custview_exit2 ; and return... 4476 bra TFT_custview_exit2 ; and return...
4424 4477
4425 4478
4426 global TFT_ppo2_ead_end_cns_mask ; mask for ppO2, END/EAD and CNS 4479 global TFT_ppo2_ead_end_cns_mask ; mask for ppO2, END/EAD and CNS / gas density
4427 TFT_ppo2_ead_end_cns_mask: 4480 TFT_ppo2_ead_end_cns_mask:
4428 rcall TFT_show_ppo2_mask
4429 call TFT_divemask_color 4481 call TFT_divemask_color
4430 WIN_TINY dm_custom_ead_column, dm_custom_eadend_title_row 4482 WIN_TINY dm_custom_ppo2_column-.2, dm_custom_ppo2_title_row
4483 STRCPY_TEXT_PRINT tppO2
4484 WIN_TINY dm_custom_ead_column, dm_custom_eadend_title_row
4431 STRCPY_TEXT_PRINT tDiveEAD_END 4485 STRCPY_TEXT_PRINT tDiveEAD_END
4432 WIN_TINY dm_custom_cns_column, dm_custom_cns_title_row 4486 IFDEF _helium
4487 WIN_TINY dm_custom_cns_column-.5, dm_custom_eadend_title_row
4488 STRCPY_TEXT_PRINT tGasDensity
4489 ELSE
4490 WIN_TINY dm_custom_cns_column, dm_custom_cns_title_row
4433 STRCPY_TEXT_PRINT tCNS2 4491 STRCPY_TEXT_PRINT tCNS2
4492 ENDIF
4434 bra TFT_custview_exit2 ; and return... 4493 bra TFT_custview_exit2 ; and return...
4435 4494
4436 4495
4437 global TFT_ppo2_ead_end_cns ; data for ppO2, END/EAD and CNS 4496 global TFT_ppo2_ead_end_cns ; data for ppO2, END/EAD and CNS / gas density
4438 TFT_ppo2_ead_end_cns: 4497 TFT_ppo2_ead_end_cns:
4439 ; Show ppO2 4498 ; Show ppO2
4440 WIN_MEDIUM dm_custom_ppo2_column, dm_custom_ppo2_row 4499 WIN_MEDIUM dm_custom_ppo2_column, dm_custom_ppo2_row
4441 MOVII int_O_breathed_ppO2,mpr ; copy ppO2 of the currently breathed gas to hi:lo 4500 MOVII int_O_breathed_ppO2,mpr ; copy ppO2 of the currently breathed gas to hi:lo
4442 call TFT_color_code_ppo2 ; color-code output 4501 call TFT_color_code_ppo2 ; color-code output
4452 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars 4511 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars
4453 WIN_SMALL dm_custom_end_column, dm_custom_end_row 4512 WIN_SMALL dm_custom_end_column, dm_custom_end_row
4454 STRCPY_TEXT tEND ; END: 4513 STRCPY_TEXT tEND ; END:
4455 movff char_O_END,lo 4514 movff char_O_END,lo
4456 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars 4515 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars
4516 IFDEF _helium
4517 ; Show Gas Density
4518 WIN_MEDIUM dm_custom_cns_column-.5, dm_custom_cns_row
4519 MOVII int_O_gas_density,mpr ; get current gas density
4520 call TFT_color_code_cns_1 ; color-code output
4521 bsf leftbind ; print left-aligned
4522 movlw .2 ; suppress first and second digit
4523 movwf ignore_digits ; ...
4524 output_16dp .2 ; print as --x.yy
4525 bcf leftbind ; back to normal alignment
4526 STRCAT_PRINT "" ; finalize output
4527 ELSE
4457 ; Show CNS 4528 ; Show CNS
4458 WIN_STD dm_custom_cns_column+.3, dm_custom_cns_row 4529 WIN_STD dm_custom_cns_column+.3, dm_custom_cns_row
4459 MOVII int_O_CNS_current,mpr ; get current CNS 4530 MOVII int_O_CNS_current,mpr ; get current CNS
4460 call TFT_color_code_cns ; color-code CNS output 4531 call TFT_color_code_cns ; color-code CNS output
4461 bsf leftbind 4532 bsf leftbind
4462 output_16_3 ; displays only 0...999 4533 output_16_3 ; displays only 0...999
4463 bcf leftbind 4534 bcf leftbind
4464 STRCAT_PRINT "%" 4535 STRCAT_PRINT "%"
4536 ENDIF
4465 TFT_custview_exit2: 4537 TFT_custview_exit2:
4466 goto TFT_standard_color ; and return... 4538 goto TFT_standard_color ; and return...
4467 4539
4468 TFT_end_ead_common: ; print "lo m" (or ft) and limit to 8 chars 4540 TFT_end_ead_common: ; print "lo m" (or ft) and limit to 8 chars
4469 bsf leftbind 4541 bsf leftbind
5162 5234
5163 TFT_pressures_SAC_helper_1: 5235 TFT_pressures_SAC_helper_1:
5164 btfss hi,int_not_avail_flag ; pressure available? 5236 btfss hi,int_not_avail_flag ; pressure available?
5165 bra TFT_pressures_SAC_helper_1a ; YES - print pressure 5237 bra TFT_pressures_SAC_helper_1a ; YES - print pressure
5166 call TFT_disabled_color ; NO - use disabled color as default 5238 call TFT_disabled_color ; NO - use disabled color as default
5167 btfsc ex,char_transmitter_lost ; - transmitter lost? 5239 ; btfsc ex,char_transmitter_lost ; - transmitter lost?
5168 call TFT_attention_color ; YES - use attention color 5240 ; call TFT_attention_color ; YES - use attention color
5169 STRCAT_PRINT " ---" ; - print " ---" 5241 STRCAT_PRINT " ---" ; - print " ---"
5170 return 5242 return
5171 TFT_pressures_SAC_helper_1a: 5243 TFT_pressures_SAC_helper_1a:
5172 btfsc hi,int_warning_flag ; out of range (signaled by warning flag)? 5244 btfsc hi,int_warning_flag ; out of range (signaled by warning flag)?
5173 bra TFT_pressures_SAC_helper_1c ; YES - special treatment 5245 bra TFT_pressures_SAC_helper_1c ; YES - special treatment