diff code_part1/OSTC_code_asm_part1/altimeter.asm @ 344:797e2ac42d24 ScreenDump

MERGE with 1.91 main trunk.
author JeanDo
date Sat, 21 May 2011 14:48:07 +0200
parents 6bdf80d7276c 2144f19fa1eb
children 904863f96582
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/altimeter.asm	Tue May 17 01:05:04 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/altimeter.asm	Sat May 21 14:48:07 2011 +0200
@@ -55,8 +55,7 @@
         clrf    pressureSum+1
         clrf    pressureCount
 
-        movff   amb_pressure+0,pressureAvg+0    ; And init first average.
-        movff   amb_pressure+1,pressureAvg+1
+        SAFE_2BYTE_COPY amb_pressure, pressureAvg   ; And init first average.
 
         movlw   4                       ; And multiply AVG by 16 to be coherent.
 altimeter_reset_1:
@@ -73,9 +72,11 @@
 
 altimeter_1:
         ;---- Do a bank-safe 16bit summing -----------------------------------
-        movff   amb_pressure+0,WREG
+        SAFE_2BYTE_COPY amb_pressure, lo   ; And init first average.
+
+        movff   lo,WREG
         addwf   pressureSum+0,F
-        movff   amb_pressure+1,WREG
+        movff   hi,WREG
         addwfc  pressureSum+1,F
 
         incf    pressureCount           ; Increment count too.