diff --git a/ArduCopter/heli.pde b/ArduCopter/heli.pde index 2f39533114..5b1a707b94 100644 --- a/ArduCopter/heli.pde +++ b/ArduCopter/heli.pde @@ -234,7 +234,7 @@ static void heli_move_swash(int roll_out, int pitch_out, int coll_out, int yaw_o static void init_motors_out() { #if INSTANT_PWM == 0 - APM_RC.SetFastOutputChannels( MSK_CH_1 | MSK_CH_2 | MSK_CH_3 | MSK_CH_4 ); + APM_RC.SetFastOutputChannels( _BV(CH_1) | _BV(CH_2) | _BV(CH_3) | _BV(CH_4) ); #endif } diff --git a/ArduCopter/motors_hexa.pde b/ArduCopter/motors_hexa.pde index aed18d958d..fc80a31c2c 100644 --- a/ArduCopter/motors_hexa.pde +++ b/ArduCopter/motors_hexa.pde @@ -5,8 +5,8 @@ static void init_motors_out() { #if INSTANT_PWM == 0 - APM_RC.SetFastOutputChannels( MSK_CH_1 | MSK_CH_2 | MSK_CH_3 | MSK_CH_4 - | MSK_CH_7 | MSK_CH_8 ); + APM_RC.SetFastOutputChannels( _BV(CH_1) | _BV(CH_2) | _BV(CH_3) | _BV(CH_4) + | _BV(CH_7) | _BV(CH_8) ); #endif } diff --git a/ArduCopter/motors_octa.pde b/ArduCopter/motors_octa.pde index c7705b43a5..929d08be64 100644 --- a/ArduCopter/motors_octa.pde +++ b/ArduCopter/motors_octa.pde @@ -5,8 +5,8 @@ static void init_motors_out() { #if INSTANT_PWM == 0 - APM_RC.SetFastOutputChannels( MSK_CH_1 | MSK_CH_2 | MSK_CH_3 | MSK_CH_4 - | MSK_CH_7 | MSK_CH_8 | MSK_CH_10 | MSK_CH_11 ); + APM_RC.SetFastOutputChannels( _BV(CH_1) | _BV(CH_2) | _BV(CH_3) | _BV(CH_4) + | _BV(CH_7) | _BV(CH_8) | _BV(CH_10) | _BV(CH_11) ); #endif } diff --git a/ArduCopter/motors_octa_quad.pde b/ArduCopter/motors_octa_quad.pde index 732dcdf64d..519d09e4b5 100644 --- a/ArduCopter/motors_octa_quad.pde +++ b/ArduCopter/motors_octa_quad.pde @@ -5,8 +5,8 @@ static void init_motors_out() { #if INSTANT_PWM == 0 - APM_RC.SetFastOutputChannels( MSK_CH_1 | MSK_CH_2 | MSK_CH_3 | MSK_CH_4 - | MSK_CH_7 | MSK_CH_8 | MSK_CH_10 | MSK_CH_11 ); + APM_RC.SetFastOutputChannels( _BV(CH_1) | _BV(CH_2) | _BV(CH_3) | _BV(CH_4) + | _BV(CH_7) | _BV(CH_8) | _BV(CH_10) | _BV(CH_11) ); #endif } diff --git a/ArduCopter/motors_quad.pde b/ArduCopter/motors_quad.pde index 5bcf2b740b..849ecec2c2 100644 --- a/ArduCopter/motors_quad.pde +++ b/ArduCopter/motors_quad.pde @@ -5,7 +5,7 @@ static void init_motors_out() { #if INSTANT_PWM == 0 - APM_RC.SetFastOutputChannels( MSK_CH_1 | MSK_CH_2 | MSK_CH_3 | MSK_CH_4 ); + APM_RC.SetFastOutputChannels( _BV(CH_1) | _BV(CH_2) | _BV(CH_3) | _BV(CH_4) ); #endif } diff --git a/ArduCopter/motors_tri.pde b/ArduCopter/motors_tri.pde index 849eb1ab12..ec752816b1 100644 --- a/ArduCopter/motors_tri.pde +++ b/ArduCopter/motors_tri.pde @@ -4,7 +4,7 @@ static void init_motors_out() { #if INSTANT_PWM == 0 - APM_RC.SetFastOutputChannels( MSK_CH_1 | MSK_CH_2 | MSK_CH_4 ); + APM_RC.SetFastOutputChannels( _BV(CH_1) | _BV(CH_2) | _BV(CH_4) ); #endif } diff --git a/ArduCopter/motors_y6.pde b/ArduCopter/motors_y6.pde index fdd0f74417..6cbf7bbc06 100644 --- a/ArduCopter/motors_y6.pde +++ b/ArduCopter/motors_y6.pde @@ -7,8 +7,8 @@ static void init_motors_out() { #if INSTANT_PWM == 0 - APM_RC.SetFastOutputChannels( MSK_CH_1 | MSK_CH_2 | MSK_CH_3 | MSK_CH_4 - | MSK_CH_7 | MSK_CH_8 ); + APM_RC.SetFastOutputChannels( _BV(CH_1) | _BV(CH_2) | _BV(CH_3) | _BV(CH_4) + | _BV(CH_7) | _BV(CH_8) ); #endif } diff --git a/libraries/APM_RC/APM_RC.h b/libraries/APM_RC/APM_RC.h index e9a00e2c85..7f72b1b183 100644 --- a/libraries/APM_RC/APM_RC.h +++ b/libraries/APM_RC/APM_RC.h @@ -21,20 +21,6 @@ #define CH_10 9 #define CH_11 10 -#define MSK_CH_1 (1 << CH_1) -#define MSK_CH_2 (1 << CH_2) -#define MSK_CH_3 (1 << CH_3) -#define MSK_CH_4 (1 << CH_4) -#define MSK_CH_5 (1 << CH_5) -#define MSK_CH_6 (1 << CH_6) -#define MSK_CH_7 (1 << CH_7) -#define MSK_CH_8 (1 << CH_8) -#define MSK_CH_9 (1 << CH_9) -#define MSK_CH_10 (1 << CH_10) -#define MSK_CH_11 (1 << CH_11) - - - #define NUM_CHANNELS 8 diff --git a/libraries/APM_RC/APM_RC_APM1.cpp b/libraries/APM_RC/APM_RC_APM1.cpp index b2aa1464f1..1a480832f4 100644 --- a/libraries/APM_RC/APM_RC_APM1.cpp +++ b/libraries/APM_RC/APM_RC_APM1.cpp @@ -216,16 +216,16 @@ void APM_RC_APM1::Force_Out6_Out7(void) void APM_RC_APM1::SetFastOutputChannels(uint32_t chmask) { - if ((chmask & ( MSK_CH_1 | MSK_CH_2 | MSK_CH_9)) != 0) + if ((chmask & ( _BV(CH_1) | _BV(CH_2) | _BV(CH_9))) != 0) _set_speed_ch1_ch2_ch9(OUTPUT_SPEED_400HZ); - if ((chmask & ( MSK_CH_3 | MSK_CH_4 | MSK_CH_10 )) != 0) + if ((chmask & ( _BV(CH_3) | _BV(CH_4) | _BV(CH_10))) != 0) _set_speed_ch3_ch4_ch10(OUTPUT_SPEED_400HZ); - if ((chmask & ( MSK_CH_5 | MSK_CH_6 )) != 0) + if ((chmask & ( _BV(CH_5) | _BV(CH_6))) != 0) _set_speed_ch5_ch6(OUTPUT_SPEED_400HZ); - if ((chmask & ( MSK_CH_7 | MSK_CH_8 | MSK_CH_11 )) != 0) + if ((chmask & ( _BV(CH_7) | _BV(CH_8) | _BV(CH_11))) != 0) _set_speed_ch7_ch8_ch11(OUTPUT_SPEED_400HZ); } diff --git a/libraries/APM_RC/APM_RC_APM2.cpp b/libraries/APM_RC/APM_RC_APM2.cpp index 191febb1f3..ee7b55f50f 100644 --- a/libraries/APM_RC/APM_RC_APM2.cpp +++ b/libraries/APM_RC/APM_RC_APM2.cpp @@ -197,13 +197,13 @@ void APM_RC_APM2::Force_Out6_Out7(void) { } void APM_RC_APM2::SetFastOutputChannels(uint32_t chmask) { - if ((chmask & ( MSK_CH_1 | MSK_CH_2 )) != 0) + if ((chmask & ( _BV(CH_1) | _BV(CH_2))) != 0) _set_speed_ch1_ch2(OUTPUT_SPEED_400HZ); - if ((chmask & ( MSK_CH_3 | MSK_CH_4 | MSK_CH_5 )) != 0) + if ((chmask & ( _BV(CH_3) | _BV(CH_4) | _BV(CH_5))) != 0) _set_speed_ch3_ch4_ch5(OUTPUT_SPEED_400HZ); - if ((chmask & ( MSK_CH_6 | MSK_CH_7 | MSK_CH_8 )) != 0) + if ((chmask & ( _BV(CH_6) | _BV(CH_7) | _BV(CH_8))) != 0) _set_speed_ch6_ch7_ch8(OUTPUT_SPEED_400HZ); }