Mercurial > public > hwos_code
comparison src/surfmode.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 surfmode.asm next combined generation V3.03.2 | 3 ; File surfmode.asm next combined generation V3.04.3 |
4 ; | 4 ; |
5 ; Surface Mode | 5 ; Surface Mode |
6 ; | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. |
8 ;============================================================================= | 8 ;============================================================================= |
69 global surfloop | 69 global surfloop |
70 surfloop: | 70 surfloop: |
71 clrf STKPTR ; clear return addresses stack | 71 clrf STKPTR ; clear return addresses stack |
72 ; clrf CCP1CON ; stop PWM | 72 ; clrf CCP1CON ; stop PWM |
73 ; bcf PORTC,2 ; pull PWM output to GND | 73 ; bcf PORTC,2 ; pull PWM output to GND |
74 clrf CCPR1L ; backlight off | 74 ; clrf CCPR1L ; backlight off |
75 call TFT_boot ; initialize TFT (includes clear screen) | 75 call TFT_boot ; initialize TFT (includes clear screen) |
76 | 76 |
77 btfsc restart_fast ; shall make a fast restart? | 77 btfsc restart_fast ; shall make a fast restart? |
78 bra surfloop_1 ; YES | 78 bra surfloop_1 ; YES |
79 | 79 |
80 ; show heinrichsweikamp logo | 80 ; show heinrichsweikamp logo |
81 WIN_TOP .40 | 81 WIN_TOP .40 |
82 WIN_LEFT .10 | 82 WIN_LEFT .10 |
83 TFT_WRITE_PROM_IMAGE_BY_ADDR hw_logo_block | 83 TFT_WRITE_PROM_IMAGE_BY_ADDR hw_logo_block |
84 | 84 |
85 IFDEF _ostc_logo | |
86 ; show graphical OSTC logo | |
87 WIN_TOP .100 | |
88 WIN_LEFT .34 | |
89 TFT_WRITE_PROM_IMAGE_BY_LABEL ostc_logo_block | |
90 ELSE | |
91 ; show textual OSTC logo | 85 ; show textual OSTC logo |
92 WIN_COLOR color_white | 86 WIN_COLOR color_white |
93 WIN_STD .30,.90 ; column, row | 87 WIN_STD .30,.90 ; column, row |
94 STRCPY_PRINT "Open Source" ; show OSTC banner text, line 1 | 88 STRCPY_PRINT "Open Source" ; show OSTC banner text, line 1 |
95 WIN_STD .20,.130 ; column, row | 89 WIN_STD .20,.130 ; column, row |
96 STRCPY_PRINT "Tauch-Computer" ; show OSTC banner text, line 2 | 90 STRCPY_PRINT "Tauch-Computer" ; show OSTC banner text, line 2 |
97 ENDIF | |
98 | 91 |
99 WIN_COLOR color_white | 92 WIN_COLOR color_white |
100 WIN_SMALL .35,.180 | 93 WIN_SMALL .35,.180 |
101 PUTC "v" ; print v | 94 PUTC "v" ; print v |
102 call TFT_cat_firmware ; print x.y | 95 call TFT_cat_firmware ; print x.y |
115 | 108 |
116 bsf trigger_pres_cur_changed; set flag to have pressure written to display on first round of surface loop | 109 bsf trigger_pres_cur_changed; set flag to have pressure written to display on first round of surface loop |
117 bsf trigger_temp_changed ; set flag to have temperature written to display on first round of surface loop | 110 bsf trigger_temp_changed ; set flag to have temperature written to display on first round of surface loop |
118 | 111 |
119 call I2C_sleep_compass ; shut down compass | 112 call I2C_sleep_compass ; shut down compass |
120 call I2C_sleep_accelerometer ; shut down accelerometer | |
121 | 113 |
122 clrf ext_flash_address+0 | 114 clrf ext_flash_address+0 |
123 clrf ext_flash_address+1 | 115 clrf ext_flash_address+1 |
124 clrf ext_flash_address+2 | 116 clrf ext_flash_address+2 |
125 | 117 |
139 bcf switch_left ; clear intermediate button event since start/restart | 131 bcf switch_left ; clear intermediate button event since start/restart |
140 bcf switch_right ; clear intermediate button event since start/restart | 132 bcf switch_right ; clear intermediate button event since start/restart |
141 | 133 |
142 btfsc restart_fast ; shall make a fast restart? | 134 btfsc restart_fast ; shall make a fast restart? |
143 bra surfloop_2 ; YES | 135 bra surfloop_2 ; YES |
136 | |
137 call deco_calc_desaturation_time ; calculate desaturation and no-fly/no-altitude time (C-code) | |
138 banksel common ; back to bank common | |
144 | 139 |
145 call wait_1s ; wait <= 1 second | 140 call wait_1s ; wait <= 1 second |
146 call wait_1s ; wait 1 second | 141 call wait_1s ; wait 1 second |
147 call wait_1s ; wait 1 second | 142 call wait_1s ; wait 1 second |
148 | 143 |
165 STRCPY_TEXT_PRINT tView ; show "View>" | 160 STRCPY_TEXT_PRINT tView ; show "View>" |
166 call TFT_standard_color | 161 call TFT_standard_color |
167 | 162 |
168 | 163 |
169 ;---- Logo in upper right corner ----------------------------------------- | 164 ;---- Logo in upper right corner ----------------------------------------- |
170 IFDEF _ostc_logo | 165 |
171 ; show graphical OSTC logo | |
172 WIN_TOP .0 | |
173 WIN_LEFT .70 | |
174 TFT_WRITE_PROM_IMAGE_BY_LABEL ostc_logo_block | |
175 ELSE | |
176 ; show textual OSTC logo | 166 ; show textual OSTC logo |
177 WIN_COLOR color_white ; set text color to white | 167 WIN_COLOR color_white ; set text color to white |
178 WIN_STD .100,.2 ; set output position | 168 WIN_STD .100,.2 ; set output position |
179 STRCPY_PRINT "OSTC" ; show "OSTC" | 169 STRCPY_PRINT "OSTC" ; show "OSTC" |
180 WIN_COLOR color_cyan ; set text color to cyan | 170 WIN_COLOR color_cyan ; set text color to cyan |
186 ELSE | 176 ELSE |
187 STRCPY_PRINT "tech" ; show "tech" | 177 STRCPY_PRINT "tech" ; show "tech" |
188 ENDIF | 178 ENDIF |
189 WIN_TINY .100,.32 ; set output position | 179 WIN_TINY .100,.32 ; set output position |
190 call TFT_show_firmware ; show firmware version | 180 call TFT_show_firmware ; show firmware version |
191 ENDIF ; _ostc_logo | |
192 | 181 |
193 | 182 |
194 ;---- fill screen -------------------------------------------------------- | 183 ;---- fill screen -------------------------------------------------------- |
195 call get_battery_voltage ; get battery voltage | 184 call get_battery_voltage ; get battery voltage |
196 call TFT_batt_surfmode ; display battery voltage | 185 call TFT_batt_surfmode ; display battery voltage |
340 cpfseq active_customview ; in compass view? | 329 cpfseq active_customview ; in compass view? |
341 bra test_switches_surfmode3a ; NO | 330 bra test_switches_surfmode3a ; NO |
342 btfsc compass_menu ; YES - "set course" selection already shown? | 331 btfsc compass_menu ; YES - "set course" selection already shown? |
343 bra test_switches_surfmode3b ; YES - remove it | 332 bra test_switches_surfmode3b ; YES - remove it |
344 call TFT_surf_set_bearing ; NO - show it | 333 call TFT_surf_set_bearing ; NO - show it |
345 return | 334 return ; - done |
346 ENDIF | 335 ENDIF |
347 test_switches_surfmode3a: | 336 test_switches_surfmode3a: |
348 bcf compass_bearing_set ; clear course on entering menu | 337 bcf compass_bearing_set ; clear course on entering menu |
349 bsf surfmode_menu ; flag that the surface menu shall be entered | 338 bsf surfmode_menu ; flag that the surface menu shall be entered |
350 return | 339 return |
351 | 340 |
352 IFDEF _compass | 341 IFDEF _compass |
353 test_switches_surfmode3b: | 342 test_switches_surfmode3b: |
354 WIN_BOX_BLACK .158,.190, .15, .99 ; clear "Course" label (top, bottom, left, right) | 343 WIN_BOX_BLACK .158,.190, .15, .99 ; clear "Course" label (top, bottom, left, right) |
355 bcf compass_menu ; clear flag for "set course" selection | 344 bcf compass_menu ; clear flag for "set course" selection |
356 return | 345 return |
357 ENDIF | 346 ENDIF |
358 | 347 |
359 | 348 |