comparison src/start.asm @ 235:23311219dacc

under construction: new hardware_flag to configure different hardware versions
author heinrichsweikamp
date Wed, 25 Feb 2015 16:49:59 +0100
parents 5a4801918be9
children e2ea74646127
comparison
equal deleted inserted replaced
234:57155164faad 235:23311219dacc
137 137
138 btfsc RCON,POR ; Was this a power-on reset? 138 btfsc RCON,POR ; Was this a power-on reset?
139 goto use_old_batteries ; No, load last stored battery values 139 goto use_old_batteries ; No, load last stored battery values
140 140
141 call lt2942_get_status ; Check for gauge IC 141 call lt2942_get_status ; Check for gauge IC
142 btfsc cr_hardware ; cR hardware? 142 btfsc rechargeable ; cR hardware?
143 goto use_old_batteries ; Yes, load last stored battery values 143 goto use_old_batteries ; Yes, load last stored battery values
144 144
145 ; No, cR and we have a power-on reset 145 ; No, cR and we have a power-on reset
146 goto new_battery_menu ; show "New battery dialog" 146 goto new_battery_menu ; show "New battery dialog"
147 147
251 clrf flag6 251 clrf flag6
252 clrf flag7 252 clrf flag7
253 clrf flag8 253 clrf flag8
254 clrf flag9 254 clrf flag9
255 clrf flag10 255 clrf flag10
256 bsf tft_is_dimming ; TFT is dimming up (soon), ignore ambient sensor! 256 clrf hardware_flag ; hardware descriptor flag
257 bsf tft_is_dimming ; TFT is dimming up (soon), ignore ambient sensor!
257 258
258 call lt2942_get_status ; Check for gauge IC 259 call lt2942_get_status ; Check for gauge IC
259 btfsc cr_hardware ; cR hardware? 260 btfsc rechargeable ; cR hardware?
260 call lt2942_init ; Yes, init battery gauge IC 261 call lt2942_init ; Yes, init battery gauge IC
261 262
262 ; Select high altitude (Fly) mode? 263 ; Select high altitude (Fly) mode?
263 movff last_surfpressure_30min+0,sub_b+0 264 movff last_surfpressure_30min+0,sub_b+0
264 movff last_surfpressure_30min+1,sub_b+1 265 movff last_surfpressure_30min+1,sub_b+1
268 movwf sub_a+0 269 movwf sub_a+0
269 call subU16 ; sub_c = sub_a - sub_b 270 call subU16 ; sub_c = sub_a - sub_b
270 btfss neg_flag ; Result negative (Ambient>880mbar)? 271 btfss neg_flag ; Result negative (Ambient>880mbar)?
271 bsf high_altitude_mode ; No, Set Flag! 272 bsf high_altitude_mode ; No, Set Flag!
272 273
273 btfss cr_hardware 274 btfss rechargeable
274 bsf TRISB,3 275 bsf TRISB,3
275 btfss cr_hardware 276 btfss rechargeable
276 bsf TRISG,0 277 bsf TRISG,0
277 call ext_flash_disable_protection ; Disable write protection for external flash 278 call ext_flash_disable_protection ; Disable write protection for external flash
278 279
279 bsf flip_screen ; Flip 180° 280 bsf flip_screen ; Flip 180°
280 TSTOSS opt_flip_screen ; =1: Flip the screen 281 TSTOSS opt_flip_screen ; =1: Flip the screen