comparison src/surfmode.asm @ 382:6f3530eb48f9

allow compass bearing on surface
author heinrichsweikamp
date Wed, 23 Sep 2015 17:35:19 +0200
parents a9e35c1327aa
children 7c10557c248e
comparison
equal deleted inserted replaced
381:e32f424223fb 382:6f3530eb48f9
91 call transmit_setpoint ; Transmit current setpoint from WREG (in cbar) to external electronics 91 call transmit_setpoint ; Transmit current setpoint from WREG (in cbar) to external electronics
92 92
93 clrf timeout_counter2 93 clrf timeout_counter2
94 clrf timeout_counter3 94 clrf timeout_counter3
95 bcf menubit ; clear menu flag 95 bcf menubit ; clear menu flag
96 bcf premenu
96 clrf last_pressure+0 97 clrf last_pressure+0
97 clrf last_pressure+1 98 clrf last_pressure+1
98 bcf is_bailout ; =1: Bailout 99 bcf is_bailout ; =1: Bailout
99 bcf ccr_diluent_setup ; Use OC gases for gaslist routine 100 bcf ccr_diluent_setup ; Use OC gases for gaslist routine
100 101
349 350
350 ; No button press 351 ; No button press
351 return 352 return
352 353
353 test_switches_surfmode3: 354 test_switches_surfmode3:
355 movlw .6
356 cpfseq menupos3 ; in compass view?
357 bra test_switches_surfmode3a ; No
358
359 btfsc premenu ; already shown "Bearing"
360 bra test_switches_surfmode3b ; Yes, remove it
361
362 extern TFT_surf_set_bearing
363 call TFT_surf_set_bearing ; Yes.
364 bcf switch_left
365 return
366
367 test_switches_surfmode3a:
354 bcf switch_left 368 bcf switch_left
355 bsf menubit ; Enter Menu! 369 bsf menubit ; Enter Menu!
356 return 370 return
357 371
372 test_switches_surfmode3b:
373 ; Clear "Heading?"
374 WIN_BOX_BLACK .158,.190, .15, .99 ; top, bottom, left, right
375 bcf premenu
376 bcf switch_left
377 return
378
358 test_switches_surfmode2: 379 test_switches_surfmode2:
380 movlw .6
381 cpfseq menupos3 ; in compass view?
382 bra test_switches_surfmode2a ; No
383 btfss premenu ; "Heading?" shown?
384 bra test_switches_surfmode2a ; No
385 ; Set new heading
386 bcf premenu
387 bsf compass_bearing_set
388 movff compass_heading_shown+0,compass_bearing+0
389 movff compass_heading_shown+1,compass_bearing+1
390 bcf switch_right
391 return
392
393 test_switches_surfmode2a:
359 bcf switch_right 394 bcf switch_right
360 bsf toggle_customview 395 bsf toggle_customview
396 bcf premenu
361 clrf timeout_counter2 ; and reset timeout 397 clrf timeout_counter2 ; and reset timeout
362 return 398 return
363 399
364 global timeout_surfmode 400 global timeout_surfmode
365 timeout_surfmode: 401 timeout_surfmode: