comparison src/isr.asm @ 178:39f6c07ce2f6

BUGFIX: Average depth computation
author heinrichsweikamp
date Tue, 07 Oct 2014 13:45:21 +0200
parents 3fdafedc24af
children 669b5d00706d
comparison
equal deleted inserted replaced
177:67db1f6d3787 178:39f6c07ce2f6
359 rrcf amb_pressure_avg+1 ; amb_pressure sum / 2 359 rrcf amb_pressure_avg+1 ; amb_pressure sum / 2
360 rrcf amb_pressure_avg+0 360 rrcf amb_pressure_avg+0
361 bcf STATUS,C ; clear carry bit, twice. 361 bcf STATUS,C ; clear carry bit, twice.
362 rrcf amb_pressure_avg+1 ; amb_pressure sum / 4 362 rrcf amb_pressure_avg+1 ; amb_pressure sum / 4
363 rrcf amb_pressure_avg+0 363 rrcf amb_pressure_avg+0
364
365 ; ; Even more averaging
366 ; movf amb_pressure_avg+0,W
367 ; addwf amb_pressure+0
368 ; movf amb_pressure_avg+1,W
369 ; addwfc amb_pressure+1
370 ; bcf STATUS,C ; clear carry bit
371 ; rrcf amb_pressure+1 ; amb_pressure sum / 2
372 ; rrcf amb_pressure+0
373 364
374 movff amb_pressure_avg+1,amb_pressure+1 ; copy into actual register 365 movff amb_pressure_avg+1,amb_pressure+1 ; copy into actual register
375 movff amb_pressure_avg+0,amb_pressure+0 366 movff amb_pressure_avg+0,amb_pressure+0
376 367
377 bcf STATUS,C 368 bcf STATUS,C