comparison src/surfmode.asm @ 158:683321c09cfa

nicer boot into surfacemode
author heinrichsweikamp
date Thu, 04 Sep 2014 17:40:24 +0200
parents e3ac5b2021bc
children 669b5d00706d
comparison
equal deleted inserted replaced
157:5ee76921e359 158:683321c09cfa
77 call TFT_Display_FadeIn ; Show splash 77 call TFT_Display_FadeIn ; Show splash
78 call TFT_serial ; Show serial and firmware version 78 call TFT_serial ; Show serial and firmware version
79 79
80 ;---- Do any usefull initializes that takes time ------------------------- 80 ;---- Do any usefull initializes that takes time -------------------------
81 call restart_set_modes_and_flags ; Sets decomode flags 81 call restart_set_modes_and_flags ; Sets decomode flags
82 ; call speed_fastest
83 bcf pressure_refresh 82 bcf pressure_refresh
84 call I2C_init_compass 83 call I2C_init_compass
85 call I2C_init_accelerometer 84 call I2C_init_accelerometer
86 clrf ext_flash_address+0 85 clrf ext_flash_address+0
87 clrf ext_flash_address+1 86 clrf ext_flash_address+1
124 WIN_SMALL menu_pos_column,menu_pos_row 123 WIN_SMALL menu_pos_column,menu_pos_row
125 STRCPY_TEXT_PRINT tMenu ;"<Menu" 124 STRCPY_TEXT_PRINT tMenu ;"<Menu"
126 WIN_SMALL view_column,view_row 125 WIN_SMALL view_column,view_row
127 STRCPY_TEXT_PRINT tView ;"View>" 126 STRCPY_TEXT_PRINT tView ;"View>"
128 call TFT_standard_color 127 call TFT_standard_color
129
130 call TFT_clock ; display time
131 call update_surfloop60
132 call get_battery_voltage ; get battery voltage
133 call TFT_update_batt_voltage ; display battery voltage
134 call TFT_update_surf_press ; display surface pressure
135 call TFT_temp_surfmode ; Displays temperature
136 call TFT_display_decotype_surface
137 movff customview_surfmode,menupos3 ; Reload last customview
138 call surf_customview_mask ; Update #menupos3 view
139 128
140 ; Logo 129 ; Logo
141 WIN_TOP .0 130 WIN_TOP .0
142 WIN_LEFT .70 131 WIN_LEFT .70
143 movlw LOW(ostc3_logo_block) 132 movlw LOW(ostc3_logo_block)
146 movwf TBLPTRH 135 movwf TBLPTRH
147 movlw UPPER(ostc3_logo_block) 136 movlw UPPER(ostc3_logo_block)
148 movwf TBLPTRU 137 movwf TBLPTRU
149 call color_image 138 call color_image
150 139
151 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode 140 call TFT_clock ; display time
152 bra surfloop1 141 call update_surfloop60
153 btfsc FLAG_gauge_mode ; Ignore in Gauge mode 142 call get_battery_voltage ; get battery voltage
154 bra surfloop1 143 call TFT_update_batt_voltage ; display battery voltage
155 144 call TFT_update_surf_press ; display surface pressure
156 surfloop1: 145 call TFT_temp_surfmode ; Displays temperature
146 call TFT_display_decotype_surface
147 movff customview_surfmode,menupos3 ; Reload last customview
148 call surf_customview_mask ; Update #menupos3 view
149
157 call TFT_Display_FadeIn ; Display resulting surface screen. 150 call TFT_Display_FadeIn ; Display resulting surface screen.
158 151
159 ;---- Late initialisations ----------------------------------------------- 152 ;---- Late initialisations -----------------------------------------------
160 movff last_surfpressure_30min+0,int_I_pres_respiration+0 ; copy surface air pressure to deco routine 153 movff last_surfpressure_30min+0,int_I_pres_respiration+0 ; copy surface air pressure to deco routine
161 movff last_surfpressure_30min+1,int_I_pres_respiration+1 ; 30min old values 154 movff last_surfpressure_30min+1,int_I_pres_respiration+1 ; 30min old values
162 movff last_surfpressure_30min+0,int_I_pres_surface+0 ; copy surface air pressure to deco routine 155 movff last_surfpressure_30min+0,int_I_pres_surface+0 ; copy surface air pressure to deco routine
163 movff last_surfpressure_30min+1,int_I_pres_surface+1 ; 30min old values 156 movff last_surfpressure_30min+1,int_I_pres_surface+1 ; 30min old values
164 movff last_surfpressure_30min+0,last_surfpressure+0 ; Use 30min old airpressure 157 movff last_surfpressure_30min+0,last_surfpressure+0 ; Use 30min old airpressure
165 movff last_surfpressure_30min+1,last_surfpressure+1 ; Use 30min old airpressure 158 movff last_surfpressure_30min+1,last_surfpressure+1 ; Use 30min old airpressure
166 159
167 extern do_demo_divemode 160 ; Startup tasks for all modes
168 ; goto do_demo_divemode
169
170 ; Startup tasks for all modes
171 ; Desaturation time needs: 161 ; Desaturation time needs:
172 ; int_I_pres_surface 162 ; int_I_pres_surface
173 ; char_I_desaturation_multiplier 163 ; char_I_desaturation_multiplier
174 call deco_calc_desaturation_time ; calculate desaturation time 164 call deco_calc_desaturation_time ; calculate desaturation time
175 movlb b'00000001' ; select ram bank 1 165 movlb b'00000001' ; select ram bank 1
176 166
177 btfsc enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (Screen dump) 167 btfsc enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (Screen dump)
178 call enable_rs232 ; Also sets to speed_normal ... 168 call enable_rs232 ; Also sets to speed_normal ...
179
180 ; call disable_ir
181 ; bsf mcp_power
182 ; btfss mcp_power
183 ; bra $-4
184 169
185 surfloop_loop: 170 surfloop_loop:
186 btfss onesecupdate ; do every second tasks? 171 btfss onesecupdate ; do every second tasks?
187 bra surfloop_loop2 ; no, loop 172 bra surfloop_loop2 ; no, loop
188 173