comparison src/ostc3.inc @ 16:7b06f20881be

calm compass reading for minor heading changes
author heinrichsweikamp
date Sun, 16 Jun 2013 19:14:16 +0200
parents 8185edeeedb2
children 1f096c3d4b27
comparison
equal deleted inserted replaced
15:8185edeeedb2 16:7b06f20881be
17 17
18 #include <p18f87k22.inc> 18 #include <p18f87k22.inc>
19 #include <ports.inc> ; Portmap 19 #include <ports.inc> ; Portmap
20 20
21 #DEFINE softwareversion_x d'0' ; Software version XX.YY 21 #DEFINE softwareversion_x d'0' ; Software version XX.YY
22 #DEFINE softwareversion_y d'95' ; Software version XX.YY 22 #DEFINE softwareversion_y d'96' ; Software version XX.YY
23 #DEFINE softwareversion_beta 0 ; (and 0 for release) 23 #DEFINE softwareversion_beta 0 ; (and 0 for release)
24 24
25 #DEFINE comm_service_key 0xABCDEF 25 #DEFINE comm_service_key 0xABCDEF
26 26
27 ;----------------------------------------------------------------------------- 27 ;-----------------------------------------------------------------------------
173 #DEFINE gaslist_min_o2 .7 ; Minimum O2 [%] 173 #DEFINE gaslist_min_o2 .7 ; Minimum O2 [%]
174 #DEFINE gaslist_max_change_depth .100 ; Max. change depth [m] 174 #DEFINE gaslist_max_change_depth .100 ; Max. change depth [m]
175 #DEFINE gaslist_sp_stepsize .10 ; Steps for Setpoint Setup [cbar] 175 #DEFINE gaslist_sp_stepsize .10 ; Steps for Setpoint Setup [cbar]
176 #DEFINE gaslist_sp_max .160 ; Max. Setpoint [cbar] 176 #DEFINE gaslist_sp_max .160 ; Max. Setpoint [cbar]
177 #DEFINE gaslist_sp_min .50 ; Min. Setpoint [cbar] 177 #DEFINE gaslist_sp_min .50 ; Min. Setpoint [cbar]
178
179 ; Compass display
180 #DEFINE compass_fast_treshold .12 ; Faster update if new and old > compass_fast_treshold
178 181
179 ;---------------------------- Macros ------------------------------------ 182 ;---------------------------- Macros ------------------------------------
180 183
181 TSTOSS macro opt_reg ; TeST Option Skip if not Zero 184 TSTOSS macro opt_reg ; TeST Option Skip if not Zero
182 movff opt_reg,WREG 185 movff opt_reg,WREG
272 compass_CY_f res 2 275 compass_CY_f res 2
273 compass_CZ_f res 2 276 compass_CZ_f res 2
274 277
275 ; Compass more data 278 ; Compass more data
276 compass_heading res 2 ; Corrected heading (in 1°) : -180 .. 180 279 compass_heading res 2 ; Corrected heading (in 1°) : -180 .. 180
280 compass_heading_old res 2 ; Old heading (For smoother display)
277 compass_roll res 2 ; Rotation around the X axis 281 compass_roll res 2 ; Rotation around the X axis
278 compass_pitch res 2 ; Rotation arounf the Y axis 282 compass_pitch res 2 ; Rotation arounf the Y axis
279 283
280 compass_a res 2 ; Tmp data for Q15 arithmetics 284 compass_a res 2 ; Tmp data for Q15 arithmetics
281 compass_b res 2 285 compass_b res 2
304 flag4 res 1 308 flag4 res 1
305 flag5 res 1 309 flag5 res 1
306 flag6 res 1 310 flag6 res 1
307 flag7 res 1 311 flag7 res 1
308 flag8 res 1 312 flag8 res 1
313 flag9 res 1
309 314
310 temp1 res 1 315 temp1 res 1
311 temp2 res 1 316 temp2 res 1
312 317
313 ;---- Interface to wait macros 318 ;---- Interface to wait macros
574 #DEFINE battery_removed_in_usb flag8,4 ; =1: The battery has been removed in USB 579 #DEFINE battery_removed_in_usb flag8,4 ; =1: The battery has been removed in USB
575 #DEFINE adc_running flag8,5 ; =1: The ADC is in use 580 #DEFINE adc_running flag8,5 ; =1: The ADC is in use
576 #DEFINE comm_service_enabled flag8,6 ; =1: COMM Service mode unlocked 581 #DEFINE comm_service_enabled flag8,6 ; =1: COMM Service mode unlocked
577 #DEFINE compass_enabled flag8,7 ; =1: The compass and accelerometer chip is active 582 #DEFINE compass_enabled flag8,7 ; =1: The compass and accelerometer chip is active
578 583
584 #DEFINE compass_fast_mode flag9,0 ; =1: The compass is in fast mode
585
579 ;============================================================================= 586 ;=============================================================================
580 ; C-code Routines 587 ; C-code Routines
581 ; PART 2 588 ; PART 2
582 extern deco_calc_CNS_decrease_15min 589 extern deco_calc_CNS_decrease_15min
583 extern deco_calc_CNS_fraction 590 extern deco_calc_CNS_fraction