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(); }