diff --git a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c index a7b24a6ac2b..57ea6cfed60 100644 --- a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c +++ b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c @@ -446,7 +446,7 @@ void RadioControlEventImp(void (*frame_handler)(void)) { case(0) : /* 10 bit */ ChannelNum = (ChannelData >> 10) & 0x0f; /* don't bother decoding unused channels */ - if (ChannelNum < RADIO_CONTROL_NB_CHANNEL) { + if (ChannelNum < SPEKTRUM_NB_CHANNEL) { SpektrumBuf[ChannelNum] = ChannelData & 0x3ff; SpektrumBuf[ChannelNum] -= 0x200; SpektrumBuf[ChannelNum] *= MAX_PPRZ/0x156; @@ -457,7 +457,7 @@ void RadioControlEventImp(void (*frame_handler)(void)) { case(1) : /* 11 bit */ ChannelNum = (ChannelData >> 11) & 0x0f; /* don't bother decoding unused channels */ - if (ChannelNum < RADIO_CONTROL_NB_CHANNEL) { + if (ChannelNum < SPEKTRUM_NB_CHANNEL) { SpektrumBuf[ChannelNum] = ChannelData & 0x7ff; SpektrumBuf[ChannelNum] -= 0x400; SpektrumBuf[ChannelNum] *= MAX_PPRZ/0x2AC; diff --git a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.h b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.h index 12280869224..a8e72e5c696 100644 --- a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.h +++ b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.h @@ -29,6 +29,7 @@ * have the same channel assignments. */ +#define SPEKTRUM_NB_CHANNEL 12 #ifndef RADIO_CONTROL_NB_CHANNEL #define RADIO_CONTROL_NB_CHANNEL 12