comparison src/compass_ops.asm @ 544:64a45f203144

NEW: Show Compass calibration results in Compass menu
author heinrichsweikamp
date Wed, 06 Sep 2017 15:34:49 +0200
parents d36f9fca10ae
children b7eb98dbd800
comparison
equal deleted inserted replaced
543:a92cecf8cee4 544:64a45f203144
319 compass_calibration_loop3: 319 compass_calibration_loop3:
320 ; And register only one value out of four: 320 ; And register only one value out of four:
321 call compass_add_calibration ; check and store new max/min values 321 call compass_add_calibration ; check and store new max/min values
322 banksel common 322 banksel common
323 323
324 call TFT_compass_fast ; show values 324 rcall TFT_compass_fast ; show values
325 325
326 btfsc sleepmode ; Sleepmode active? 326 btfsc sleepmode ; Sleepmode active?
327 bra compass_calibration_exit ; Yes, exit 327 bra compass_calibration_exit ; Yes, exit
328 328
329 ; btfsc switch_left ; Button pressed? 329
330 ; bra compass_calibration_exit ; Yes, exit 330 btfss onesecupdate ; do every second tasks?
331
332 btfss onesecupdate ; do every second tasks?
333 bra compass_calibration_loop2 ; no, loop here 331 bra compass_calibration_loop2 ; no, loop here
334 332
335 movlw .60 333 movlw .60
336 call timeout_testmode ; check timeout 334 call timeout_testmode ; check timeout
337 movlw .60 335 movlw .60
338 rcall TFT_show_timeout_testmode ; Show the timeout 336 rcall TFT_show_timeout_testmode ; Show the timeout
339 337
340 bcf onesecupdate ; clear flag 338 bcf onesecupdate ; clear flag
341 339
342 bra compass_calibration_loop2 ; loop here 340 bra compass_calibration_loop2 ; loop here
343 341
344 compass_calibration_exit: 342 compass_calibration_exit:
345 call compass_solve_calibration 343 call compass_solve_calibration
346 banksel common 344 banksel common
345 ; Done.
347 extern option_save_all 346 extern option_save_all
348 call option_save_all ; save all settings into EEPROM 347 call option_save_all ; save all settings into EEPROM
349 bcf sleepmode ; Clear the flag before exiting to surfacemode 348 bcf sleepmode ; Clear the flag before exiting to surfacemode
350 movlw .6 349 movlw .6
351 movwf customview_surfmode ; Set to compass view... 350 movwf customview_surfmode ; Set to compass view...
352 goto surfloop ; ...and exit 351 goto surfloop ; ...and exit
353 352
383 bsf leftbind 382 bsf leftbind
384 output_8 ; Display timeout 383 output_8 ; Display timeout
385 bcf leftbind 384 bcf leftbind
386 STRCAT_PRINT "s " 385 STRCAT_PRINT "s "
387 return 386 return
388 387
389 388
390 TFT_compass_show_gain: ; Show the current compass gain 389 TFT_compass_show_gain: ; Show the current compass gain
391 movff opt_compass_gain,lo ; 0-7 (230LSB/Gauss to 1370LSB/Gaus) 390 movff opt_compass_gain,lo ; 0-7 (230LSB/Gauss to 1370LSB/Gaus)
392 tstfsz lo 391 tstfsz lo
393 return ; Do not show unless gain=0 392 return ; Do not show unless gain=0