diff --git a/flight/CopterControl/System/pios_board.c b/flight/CopterControl/System/pios_board.c index 92f64a36d..8e2d67e77 100644 --- a/flight/CopterControl/System/pios_board.c +++ b/flight/CopterControl/System/pios_board.c @@ -1040,7 +1040,7 @@ void PIOS_Board_Init(void) { case MANUALCONTROLSETTINGS_INPUTMODE_PWM: #if defined(PIOS_INCLUDE_PWM) PIOS_PWM_Init(); - for (uint8_t i = 0; i < PIOS_PWM_NUM_INPUTS && i < pios_rcvr_max_channel; i++) { + for (uint8_t i = 0; i < PIOS_PWM_NUM_INPUTS && i < PIOS_RCVR_MAX_DEVS; i++) { if (!PIOS_RCVR_Init(&pios_rcvr_channel_to_id_map[pios_rcvr_max_channel], &pios_pwm_rcvr_driver, i)) { @@ -1054,7 +1054,7 @@ void PIOS_Board_Init(void) { case MANUALCONTROLSETTINGS_INPUTMODE_PPM: #if defined(PIOS_INCLUDE_PPM) PIOS_PPM_Init(); - for (uint8_t i = 0; i < PIOS_PPM_NUM_INPUTS && i < pios_rcvr_max_channel; i++) { + for (uint8_t i = 0; i < PIOS_PPM_NUM_INPUTS && i < PIOS_RCVR_MAX_DEVS; i++) { if (!PIOS_RCVR_Init(&pios_rcvr_channel_to_id_map[pios_rcvr_max_channel], &pios_ppm_rcvr_driver, i)) { @@ -1069,7 +1069,7 @@ void PIOS_Board_Init(void) { #if defined(PIOS_INCLUDE_SPEKTRUM) if (hwsettings_cc_mainport == HWSETTINGS_CC_MAINPORT_SPEKTRUM || hwsettings_cc_flexiport == HWSETTINGS_CC_FLEXIPORT_SPEKTRUM) { - for (uint8_t i = 0; i < PIOS_SPEKTRUM_NUM_INPUTS && i < pios_rcvr_max_channel; i++) { + for (uint8_t i = 0; i < PIOS_SPEKTRUM_NUM_INPUTS && i < PIOS_RCVR_MAX_DEVS; i++) { if (!PIOS_RCVR_Init(&pios_rcvr_channel_to_id_map[pios_rcvr_max_channel], &pios_spektrum_rcvr_driver, i)) { @@ -1084,7 +1084,7 @@ void PIOS_Board_Init(void) { case MANUALCONTROLSETTINGS_INPUTMODE_SBUS: #if defined(PIOS_INCLUDE_SBUS) if (hwsettings_cc_mainport == HWSETTINGS_CC_MAINPORT_SBUS) { - for (uint8_t i = 0; i < SBUS_NUMBER_OF_CHANNELS && i < pios_rcvr_max_channel; i++) { + for (uint8_t i = 0; i < SBUS_NUMBER_OF_CHANNELS && i < PIOS_RCVR_MAX_DEVS; i++) { if (!PIOS_RCVR_Init(&pios_rcvr_channel_to_id_map[pios_rcvr_max_channel], &pios_sbus_rcvr_driver, i)) { diff --git a/flight/OpenPilot/System/pios_board.c b/flight/OpenPilot/System/pios_board.c index 516797e5b..5c8ba05d0 100644 --- a/flight/OpenPilot/System/pios_board.c +++ b/flight/OpenPilot/System/pios_board.c @@ -1080,7 +1080,7 @@ void PIOS_Board_Init(void) { if (PIOS_USART_Init(&pios_usart_spektrum_id, &pios_usart_spektrum_cfg)) { PIOS_Assert(0); } - for (uint8_t i = 0; i < PIOS_SPEKTRUM_NUM_INPUTS && i < pios_rcvr_max_channel; i++) { + for (uint8_t i = 0; i < PIOS_SPEKTRUM_NUM_INPUTS && i < PIOS_RCVR_MAX_DEVS; i++) { if (!PIOS_RCVR_Init(&pios_rcvr_channel_to_id_map[pios_rcvr_max_channel], &pios_spektrum_rcvr_driver, i)) { @@ -1096,7 +1096,7 @@ void PIOS_Board_Init(void) { #error More receiver inputs than available devices #endif PIOS_PWM_Init(); - for (uint8_t i = 0; i < PIOS_PWM_NUM_INPUTS && i < pios_rcvr_max_channel; i++) { + for (uint8_t i = 0; i < PIOS_PWM_NUM_INPUTS && i < PIOS_RCVR_MAX_DEVS; i++) { if (!PIOS_RCVR_Init(&pios_rcvr_channel_to_id_map[pios_rcvr_max_channel], &pios_pwm_rcvr_driver, i)) { @@ -1111,7 +1111,7 @@ void PIOS_Board_Init(void) { #error More receiver inputs than available devices #endif PIOS_PPM_Init(); - for (uint8_t i = 0; i < PIOS_PPM_NUM_INPUTS && i < pios_rcvr_max_channel; i++) { + for (uint8_t i = 0; i < PIOS_PPM_NUM_INPUTS && i < PIOS_RCVR_MAX_DEVS; i++) { if (!PIOS_RCVR_Init(&pios_rcvr_channel_to_id_map[pios_rcvr_max_channel], &pios_ppm_rcvr_driver, i)) {