From d09234b688b95ad78a60c736ff24e82c5234b81a Mon Sep 17 00:00:00 2001 From: Rodrigo Brito Date: Thu, 9 Apr 2015 18:51:22 -0300 Subject: [PATCH] Turn of interrupts for local copies --- RC_Rx_header_example/rc_rx.cpp | 3 ++- RC_Rx_header_example_ver_0_2/rc_rx.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RC_Rx_header_example/rc_rx.cpp b/RC_Rx_header_example/rc_rx.cpp index 1f2d935..4168674 100644 --- a/RC_Rx_header_example/rc_rx.cpp +++ b/RC_Rx_header_example/rc_rx.cpp @@ -91,11 +91,12 @@ void init_rc_rx(){ } void read_rc_rx(){ + noInterrupts(); CH1 = ((float)CH1_delta-(float)min_high_time)*100/(max_high_time-min_high_time); CH2 = ((float)CH2_delta-(float)min_high_time)*100/(max_high_time-min_high_time); CH3 = ((float)CH3_delta-(float)min_high_time)*100/(max_high_time-min_high_time); CH4 = ((float)CH4_delta-(float)min_high_time)*100/(max_high_time-min_high_time); - + interrupts(); } diff --git a/RC_Rx_header_example_ver_0_2/rc_rx.cpp b/RC_Rx_header_example_ver_0_2/rc_rx.cpp index 0a335b1..c0a599c 100644 --- a/RC_Rx_header_example_ver_0_2/rc_rx.cpp +++ b/RC_Rx_header_example_ver_0_2/rc_rx.cpp @@ -168,6 +168,7 @@ void init_rc_rx(){ } void read_rc_rx(){ + noInterrupts(); CH1 = ((float)CH1_delta-(float)min_high_time)*100/(max_high_time-min_high_time); CH2 = ((float)CH2_delta-(float)min_high_time)*100/(max_high_time-min_high_time); CH3 = ((float)CH3_delta-(float)min_high_time)*100/(max_high_time-min_high_time); @@ -175,7 +176,7 @@ void read_rc_rx(){ CH5 = ((float)CH5_delta-(float)min_high_time)*100/(max_high_time-min_high_time); CH6 = ((float)CH6_delta-(float)min_high_time)*100/(max_high_time-min_high_time); CH7 = ((float)CH7_delta-(float)min_high_time)*100/(max_high_time-min_high_time); - + interrupts(); }