comparison src/compass_ops.asm @ 382:6f3530eb48f9

allow compass bearing on surface
author heinrichsweikamp
date Wed, 23 Sep 2015 17:35:19 +0200
parents fec5eec4c8b7
children 3c55627d5f8f
comparison
equal deleted inserted replaced
381:e32f424223fb 382:6f3530eb48f9
390 output_8 390 output_8
391 bcf leftbind 391 bcf leftbind
392 STRCAT_PRINT "!" 392 STRCAT_PRINT "!"
393 return 393 return
394 394
395 TFT_surface_compass_bearing:
396 WIN_SMALL surf_compass_bear_column,surf_compass_bear_row
397 movff compass_bearing+0,lo
398 movff compass_bearing+1,hi
399 PUTC "("
400 bsf leftbind
401 output_16dp .2 ; Result is "0.000"
402 bcf leftbind
403 ; rearrange figures to "000"
404 movff buffer+3,buffer+1
405 movff buffer+4,buffer+2
406 movff buffer+5,buffer+3
407 lfsr FSR2,buffer+4
408 STRCAT "° "
409 rcall tft_compass_cardinal ; Add cardinal and ordinal to POSTINC2
410 STRCAT_PRINT ")"
411 return
412
395 global TFT_surface_compass_mask 413 global TFT_surface_compass_mask
396 TFT_surface_compass_mask: 414 TFT_surface_compass_mask:
397 WIN_SMALL surf_compass_mask_column,surf_compass_mask_row 415 WIN_SMALL surf_compass_mask_column,surf_compass_mask_row
398 call TFT_standard_color 416 call TFT_standard_color
399 STRCPY_TEXT_PRINT tHeading ; Heading: 417 STRCPY_TEXT_PRINT tHeading ; Heading:
459 STRCAT "° " 477 STRCAT "° "
460 rcall tft_compass_cardinal ; Add cardinal and ordinal to POSTINC2 478 rcall tft_compass_cardinal ; Add cardinal and ordinal to POSTINC2
461 clrf WREG 479 clrf WREG
462 movff WREG,buffer+.7 ; limit to 7 chars 480 movff WREG,buffer+.7 ; limit to 7 chars
463 STRCAT_PRINT "" 481 STRCAT_PRINT ""
464 return 482
483 btfsc divemode
484 return ; Done for divemode.
485 ; Show bearing on the surface?
486 btfss compass_bearing_set
487 return ; No, return
488 btfsc premenu ; "Bearing?" shown?
489 return ; Yes, return
490 bra TFT_surface_compass_bearing
465 491
466 global TFT_dive_compass_heading 492 global TFT_dive_compass_heading
467 TFT_dive_compass_heading: 493 TFT_dive_compass_heading:
468 rcall compass_heading_common 494 rcall compass_heading_common
469 ; ; ToDo - these are for development only, hardcoding the bearing position 495 ; ; ToDo - these are for development only, hardcoding the bearing position
1459 call I2C_RX_accelerometer ; Test Accelerometer 1485 call I2C_RX_accelerometer ; Test Accelerometer
1460 call compass_filter ; Filter Raw compass + accel readings. 1486 call compass_filter ; Filter Raw compass + accel readings.
1461 banksel common 1487 banksel common
1462 return 1488 return
1463 1489
1490 global TFT_surf_set_bearing
1491 TFT_surf_set_bearing:
1492 btfsc premenu
1493 return ; Already shown, return
1494 bsf premenu ; set flag
1495 WIN_BOX_BLACK surf_compass_bear_row,surf_warning1_row-1, surf_compass_bear_column, surf_decotype_column-.1 ; top, bottom, left, right
1496 WIN_SMALL surf_compass_bear_column,surf_compass_bear_row
1497 WIN_COLOR color_yellow
1498 bsf win_invert
1499 STRCPY_TEXT_PRINT tSetHeading ; 7 chars
1500 bcf win_invert
1501 return
1464 1502
1465 END 1503 END