Mercurial > public > hwos_code
comparison src/compass_ops.asm @ 645:070528a88715
3.16 release
author | heinrichsweikamp |
---|---|
date | Sun, 07 Nov 2021 12:39:23 +0100 |
parents | 7d8a4c60ec1a |
children | ef2ed7e3a895 |
comparison
equal
deleted
inserted
replaced
644:1e695355dfc4 | 645:070528a88715 |
---|---|
311 call compass_filter ; filter compass raw data | 311 call compass_filter ; filter compass raw data |
312 | 312 |
313 ; btfsc compass_type1 ; compass1? | 313 ; btfsc compass_type1 ; compass1? |
314 ; bra compass_calibration_loop3 ; YES - skip gain stuff | 314 ; bra compass_calibration_loop3 ; YES - skip gain stuff |
315 | 315 |
316 banksel opt_compass_gain ; select bank options table | |
317 tstfsz opt_compass_gain ; =0? | |
318 bra $+4 ; No | |
319 bra compass_calibration_loop3 ; YES - skip gain stuff | |
316 ; Test all axes for +4096 (Hi byte=16) | 320 ; Test all axes for +4096 (Hi byte=16) |
317 banksel compass_DX ; select bank common2 | 321 banksel compass_DX ; select bank common2 |
318 movlw .16 | 322 movlw .16 |
319 cpfseq compass_DX+1 | 323 cpfseq compass_DX+1 |
320 bra $+4 | 324 bra $+4 |
335 bra $+4 | 339 bra $+4 |
336 bra compass_calibration_gainset | 340 bra compass_calibration_gainset |
337 cpfseq compass_DZ+1 | 341 cpfseq compass_DZ+1 |
338 bra $+4 | 342 bra $+4 |
339 bra compass_calibration_gainset | 343 bra compass_calibration_gainset |
344 | |
345 compass_calibration_loop3: | |
340 banksel common ; back to bank common | 346 banksel common ; back to bank common |
341 | |
342 ; ; Three | |
343 ; call I2C_RX_compass ; read compass | |
344 ; call I2C_RX_accelerometer ; test accelerometer | |
345 ; call compass_filter ; filter compass raw data | |
346 ; | |
347 ; ; Four times to get cleaner values | |
348 ; call I2C_RX_compass ; read compass | |
349 ; call I2C_RX_accelerometer ; test accelerometer | |
350 ; call compass_filter ; filter compass raw data | |
351 | |
352 compass_calibration_loop3: | |
353 ; and register only one value out of four: | 347 ; and register only one value out of four: |
354 call compass_add_calibration ; check and store new max/min values (C-code) | 348 call compass_add_calibration ; check and store new max/min values (C-code) |
355 banksel common ; back to bank common | 349 banksel common ; back to bank common |
356 | 350 |
357 rcall TFT_compass_fast ; show values | 351 rcall TFT_compass_fast ; show values |