Mercurial > public > hwos_code
comparison src/surfmode.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 |
|---|---|
| 26 | 26 |
| 27 IFDEF _rx_functions | 27 IFDEF _rx_functions |
| 28 #include "rx_ops.inc" | 28 #include "rx_ops.inc" |
| 29 ENDIF | 29 ENDIF |
| 30 | 30 |
| 31 IFDEF _external_sensor | 31 IFDEF _external_sensor_eccr |
| 32 #include "calibrate.inc" | 32 #include "calibrate.inc" |
| 33 ENDIF | 33 ENDIF |
| 34 | 34 |
| 35 | 35 |
| 36 extern main_menu | 36 extern main_menu |
| 77 | 77 |
| 78 btfsc restart_fast ; shall make a fast restart? | 78 btfsc restart_fast ; shall make a fast restart? |
| 79 bra surfloop_1 ; YES | 79 bra surfloop_1 ; YES |
| 80 | 80 |
| 81 ; show heinrichs weikamp gmbh logo | 81 ; show heinrichs weikamp gmbh logo |
| 82 WIN_TOP .40 | 82 movlw .40 |
| 83 btfsc dn_flag | |
| 84 movlw .100 | |
| 85 movwf win_top | |
| 83 WIN_LEFT .10 | 86 WIN_LEFT .10 |
| 84 TFT_WRITE_PROM_IMAGE_BY_ADDR hw_logo_block | 87 TFT_WRITE_PROM_IMAGE_BY_ADDR hw_logo_block |
| 85 | 88 |
| 89 btfsc dn_flag | |
| 90 bra surfloop_0 | |
| 86 ; set font color | 91 ; set font color |
| 87 FONT_COLOR color_white | 92 FONT_COLOR color_white |
| 88 | 93 |
| 89 ; show textual OSTC logo | 94 ; show textual OSTC logo |
| 90 WIN_STD .30,.90 ; column, row | 95 WIN_STD .30,.90 ; column, row |
| 94 | 99 |
| 95 ; show firmware version | 100 ; show firmware version |
| 96 WIN_SMALL .35,.180 | 101 WIN_SMALL .35,.180 |
| 97 PUTC "v" ; print "v" | 102 PUTC "v" ; print "v" |
| 98 call TFT_print_firmware ; print full firmware version (may change the font color) | 103 call TFT_print_firmware ; print full firmware version (may change the font color) |
| 104 surfloop_0: | |
| 99 call TFT_Display_FadeIn ; dim up the display | 105 call TFT_Display_FadeIn ; dim up the display |
| 100 | 106 |
| 101 surfloop_1: | 107 surfloop_1: |
| 102 | 108 |
| 103 ;---- do all useful initializations that take time ----------------------- | 109 ;---- do all useful initializations that take time ----------------------- |
| 113 IFDEF _ccr_pscr | 119 IFDEF _ccr_pscr |
| 114 movlw surface_sp ; load default surface setpoint (in cbar) | 120 movlw surface_sp ; load default surface setpoint (in cbar) |
| 115 movff WREG,char_I_const_ppO2 ; store it as current setpoint | 121 movff WREG,char_I_const_ppO2 ; store it as current setpoint |
| 116 ENDIF | 122 ENDIF |
| 117 | 123 |
| 118 IFDEF _external_sensor | 124 IFDEF _external_sensor_eccr |
| 119 call transmit_setpoint ; transmit current setpoint (in cbar) via S8 digital interface (currently disabled) | 125 call transmit_setpoint ; transmit current setpoint (in cbar) via S8 digital interface (currently disabled) |
| 120 ENDIF | 126 ENDIF |
| 121 | 127 |
| 122 bcf surfmode_menu ; not in surface menu (any more) | 128 bcf surfmode_menu ; not in surface menu (any more) |
| 123 bcf compass_menu ; not in "set bearing" selection (any more) | 129 bcf compass_menu ; not in "set bearing" selection (any more) |
| 129 bra surfloop_2 ; YES | 135 bra surfloop_2 ; YES |
| 130 | 136 |
| 131 call deco_calc_desaturation_time ; calculate desaturation and no-fly/no-altitude time (C-code) | 137 call deco_calc_desaturation_time ; calculate desaturation and no-fly/no-altitude time (C-code) |
| 132 banksel common ; back to bank common | 138 banksel common ; back to bank common |
| 133 | 139 |
| 134 WAITS .2 ; wait 2 seconds | 140 WAITS .1 ; wait 1 second |
| 135 | 141 |
| 136 ;---- fade to standard surface view -------------------------------------- | 142 ;---- fade to standard surface view -------------------------------------- |
| 137 | 143 |
| 138 call TFT_Display_FadeOut ; dim down display to black screen | 144 call TFT_Display_FadeOut ; dim down display to black screen |
| 139 call TFT_ClearScreen ; clear screen | 145 call TFT_ClearScreen ; clear screen |
| 142 | 148 |
| 143 call TFT_load_std_color_pallet ; load standard color pallet | 149 call TFT_load_std_color_pallet ; load standard color pallet |
| 144 | 150 |
| 145 ;---- button functionalities --------------------------------------------- | 151 ;---- button functionalities --------------------------------------------- |
| 146 | 152 |
| 147 FONT_COLOR color_lightblue ; set font color | 153 FONT_COLOR color_green ; set font color |
| 148 WIN_SMALL menu_pos_column,menu_pos_row ; set font size and output position | 154 WIN_SMALL menu_pos_column,menu_pos_row ; set font size and output position |
| 149 STRCPY_TEXT_PRINT tMenu ; print "<Menu" | 155 STRCPY_TEXT_PRINT tMenu ; print "<Menu" |
| 150 WIN_SMALL view_column,view_row ; set font size and output position | 156 WIN_SMALL view_column,view_row ; set font size and output position |
| 151 STRCPY_TEXT_PRINT tView ; print "View>" | 157 STRCPY_TEXT_PRINT tView ; print "View>" |
| 152 | 158 |
| 153 | 159 |
| 154 ;---- logo in upper right corner ----------------------------------------- | 160 ;---- logo in upper right corner ----------------------------------------- |
| 155 | 161 btfsc dn_flag |
| 162 bra surfloop_3 | |
| 156 ; show textual OSTC logo | 163 ; show textual OSTC logo |
| 157 WIN_STD .100,.2 ; set output position | 164 WIN_STD .100,.2 ; set output position |
| 158 FONT_COLOR color_white ; set text color to white | 165 FONT_COLOR color_white ; set text color to white |
| 159 STRCPY_PRINT "OSTC" ; show "OSTC" | 166 STRCPY_PRINT "OSTC" ; show "OSTC" |
| 160 | 167 |
| 165 IFDEF _hwos_sport | 172 IFDEF _hwos_sport |
| 166 STRCPY_PRINT "sport" ; show "sport" | 173 STRCPY_PRINT "sport" ; show "sport" |
| 167 ELSE | 174 ELSE |
| 168 STRCPY_PRINT "tech" ; show "tech" | 175 STRCPY_PRINT "tech" ; show "tech" |
| 169 ENDIF | 176 ENDIF |
| 170 | 177 bra surfloop_4 |
| 178 surfloop_3: | |
| 179 WIN_TINY .105,.5 ; set output position | |
| 180 FONT_COLOR color_grey ; set text color to white | |
| 181 STRCPY_PRINT "DYNAMICNORD" ; show "OSTC" | |
| 182 | |
| 183 surfloop_4: | |
| 171 ; firmware version | 184 ; firmware version |
| 172 WIN_TINY .100,.32 ; set output position | 185 WIN_TINY .100,.32 ; set output position |
| 173 FONT_COLOR color_white ; set text color to white | 186 FONT_COLOR color_white ; set text color to white |
| 174 call TFT_print_firmware ; show firmware version (long format) | 187 call TFT_print_firmware ; show firmware version (long format) |
| 175 | 188 |
| 489 call I2C_get_temp_val_MS5837 ; (Will set ms5837_state) | 502 call I2C_get_temp_val_MS5837 ; (Will set ms5837_state) |
| 490 bra housekeeping_1aa ; Done. | 503 bra housekeeping_1aa ; Done. |
| 491 housekeeping_1ab: | 504 housekeeping_1ab: |
| 492 call I2C_get_press_val_MS5837 ; (Will clear ms5837_state) | 505 call I2C_get_press_val_MS5837 ; (Will clear ms5837_state) |
| 493 housekeeping_1aa: | 506 housekeeping_1aa: |
| 494 IFDEF _external_sensor | 507 IFDEF _external_sensor_eccr |
| 495 btfsc imprint_sensor_mv ; - shall imprint sensor mV data? | 508 btfsc imprint_sensor_mv ; - shall imprint sensor mV data? |
| 496 call TFT_imprint_menu_mV ; YES - imprint sensor mV data | 509 call TFT_imprint_menu_mV ; YES - imprint sensor mV data |
| 497 ENDIF ; _external_sensor | 510 ENDIF ; _external_sensor_eccr |
| 498 btfss imprint_surfmode_data ; - shall imprint all surface mode data? | 511 btfss imprint_surfmode_data ; - shall imprint all surface mode data? |
| 499 bra housekeeping_2 ; NO | 512 bra housekeeping_2 ; NO |
| 500 | 513 |
| 501 IFDEF _compass | 514 IFDEF _compass |
| 502 movf active_customview,W ; - get current custom view | 515 movf active_customview,W ; - get current custom view |
| 503 xorlw .6 ; - coding of compass custom view | 516 xorlw .6 ; - coding of compass custom view |
| 504 btfsc STATUS,Z ; - equal? | 517 btfsc STATUS,Z ; - equal? |
| 505 call TFT_surface_compass_heading ; YES - update compass view | 518 call TFT_surface_compass_heading ; YES - update compass view |
| 506 ENDIF ; _compass | 519 ENDIF ; _compass |
| 507 IFDEF _external_sensor | 520 IFDEF _external_sensor_eccr |
| 508 btfsc FLAG_ccr_mode ; - in CCR mode? | 521 btfsc FLAG_ccr_mode ; - in CCR mode? |
| 509 bra housekeeping_1a ; - YES - handle sensors | 522 bra housekeeping_1a ; - YES - handle sensors |
| 510 btfsc FLAG_pscr_mode ; - in pSCR mode? | 523 btfsc FLAG_pscr_mode ; - in pSCR mode? |
| 511 bra housekeeping_1a ; YES - handle sensors | 524 bra housekeeping_1a ; YES - handle sensors |
| 512 bra housekeeping_2 ; NO to both | 525 bra housekeeping_2 ; NO to both |
| 520 call TFT_imprint_surf_sensor_eol ; - show a down-arrow behind sensor readings when sensor is at end-of-life | 533 call TFT_imprint_surf_sensor_eol ; - show a down-arrow behind sensor readings when sensor is at end-of-life |
| 521 movf active_customview,W ; - get current custom view | 534 movf active_customview,W ; - get current custom view |
| 522 xorlw .9 ; - coding of sensor mV readings custom view | 535 xorlw .9 ; - coding of sensor mV readings custom view |
| 523 btfsc STATUS,Z ; - equal? | 536 btfsc STATUS,Z ; - equal? |
| 524 call TFT_imprint_surf_mV ; YES - update mV readings | 537 call TFT_imprint_surf_mV ; YES - update mV readings |
| 525 ENDIF ; _external_sensor | 538 ENDIF ; _external_sensor_eccr |
| 526 | 539 |
| 527 housekeeping_2: | 540 housekeeping_2: |
| 528 btfss trigger_full_minute ; new 1/1 minute begun? | 541 btfss trigger_full_minute ; new 1/1 minute begun? |
| 529 bra housekeeping_3 ; NO | 542 bra housekeeping_3 ; NO |
| 530 | 543 |
