diff src/isr.asm @ 268:29acdb601548

BUGFIX: Increase timing tolerance for S8 HUD (cR only)
author heinrichsweikamp
date Sun, 19 Apr 2015 20:41:48 +0200
parents e2ea74646127
children d316d44530a3
line wrap: on
line diff
--- a/src/isr.asm	Thu Apr 16 11:30:00 2015 +0200
+++ b/src/isr.asm	Sun Apr 19 20:41:48 2015 +0200
@@ -249,11 +249,26 @@
         movff   ir_s8_buffer+.14,hud_battery_mv+1
 
         banksel common
-        bsf     new_s8_data_available       ; set flag
+        btfss   new_s8_data_available       ; =1: Old data already processed?
+        bra     isr_timer3_skip             ; No, skip copying new results
         banksel ir_S8_timeout
 
+        movff	ir_s8_buffer+.6,s8_rawdata_sensor1+2
+        movff	ir_s8_buffer+.5,s8_rawdata_sensor1+1
+        movff	ir_s8_buffer+.4,s8_rawdata_sensor1+0
+        movff	ir_s8_buffer+.9,s8_rawdata_sensor2+2
+        movff	ir_s8_buffer+.8,s8_rawdata_sensor2+1
+        movff	ir_s8_buffer+.7,s8_rawdata_sensor2+0
+        movff	ir_s8_buffer+.12,s8_rawdata_sensor3+2
+        movff	ir_s8_buffer+.11,s8_rawdata_sensor3+1
+        movff	ir_s8_buffer+.10,s8_rawdata_sensor3+0
+        banksel common
+        bsf     new_s8_data_available       ; set flag
+
+isr_timer3_skip:
+        banksel ir_S8_timeout
         movlw   ir_timeout_value        ; multiples of 62,5ms
-        movwf   ir_S8_timeout              ; Reload timeout
+        movwf   ir_S8_timeout           ; Reload timeout
         bra     isr_timer3_exit         ; Exit