comparison src/start.asm @ 248:afe73e1a0181

support hardware_flag for all possible hardware combinations
author heinrichsweikamp
date Mon, 16 Mar 2015 15:58:51 +0100
parents ee81f46714cb
children 94bf757690cf
comparison
equal deleted inserted replaced
247:5968af2839a4 248:afe73e1a0181
264 call lt2942_get_status ; Check for gauge IC 264 call lt2942_get_status ; Check for gauge IC
265 btfss rechargeable ; cR hardware? 265 btfss rechargeable ; cR hardware?
266 bra restart2 ; No 266 bra restart2 ; No
267 267
268 call lt2942_init ; Yes, init battery gauge IC 268 call lt2942_init ; Yes, init battery gauge IC
269 bsf analog_o2_input ; Set flag
270 bcf ambient_sensor ; Clear flag 269 bcf ambient_sensor ; Clear flag
271 bcf optical_input ; Clear flag 270 bcf optical_input ; Clear flag
271
272 restart2: 272 restart2:
273 btfsc vusb_in 273 btfsc vusb_in
274 bra restart3 ; USB (and powered on) 274 bra restart3 ; USB (and powered on)
275 bcf PORTE,0 ; Start comms 275 bcf PORTE,0 ; Start comms
276 WAITMS d'1' 276 WAITMS d'1'
277 btfss vusb_in 277 btfss vusb_in
278 bra restart3 ; USB (and powered off) 278 bra restart3 ; USB (and powered off)
279 bsf ble_available ; ble available 279 bsf ble_available ; ble available
280 restart3: 280 restart3:
281 bsf PORTE,0 ; Stop comms 281 bsf PORTE,0 ; Stop comms
282 282 btfsc ble_available ; ble available?
283 bra restart4 ; Yes, can't be a cR
284 btfss rechargeable ; Rechargeable
285 bra restart4 ; No, can't be a cR
286 bsf analog_o2_input ; Set flag for analog
287
288 restart4:
283 ; Select high altitude (Fly) mode? 289 ; Select high altitude (Fly) mode?
284 movff last_surfpressure_30min+0,sub_b+0 290 movff last_surfpressure_30min+0,sub_b+0
285 movff last_surfpressure_30min+1,sub_b+1 291 movff last_surfpressure_30min+1,sub_b+1
286 movlw HIGH high_altitude_threshold 292 movlw HIGH high_altitude_threshold
287 movwf sub_a+1 293 movwf sub_a+1