diff --git a/libraries/AP_HAL_PX4/RCInput.cpp b/libraries/AP_HAL_PX4/RCInput.cpp index ba2741421c..5c29821319 100644 --- a/libraries/AP_HAL_PX4/RCInput.cpp +++ b/libraries/AP_HAL_PX4/RCInput.cpp @@ -24,7 +24,7 @@ void PX4RCInput::init() clear_overrides(); pthread_mutex_init(&rcin_mutex, nullptr); -#ifdef HAL_RCINPUT_WITH_AP_RADIO +#if HAL_RCINPUT_WITH_AP_RADIO radio = AP_Radio::instance(); if (radio) { radio->init(); @@ -80,7 +80,7 @@ uint16_t PX4RCInput::read(uint8_t ch) uint16_t v = _rcin.values[ch]; pthread_mutex_unlock(&rcin_mutex); -#ifdef HAL_RCINPUT_WITH_AP_RADIO +#if HAL_RCINPUT_WITH_AP_RADIO if (radio && ch == 0) { // hook to allow for update of radio on main thread, for mavlink sends radio->update(); @@ -161,7 +161,7 @@ void PX4RCInput::_timer_tick(void) pthread_mutex_unlock(&rcin_mutex); } -#ifdef HAL_RCINPUT_WITH_AP_RADIO +#if HAL_RCINPUT_WITH_AP_RADIO if (radio && radio->last_recv_us() != last_radio_us) { last_radio_us = radio->last_recv_us(); pthread_mutex_lock(&rcin_mutex); @@ -190,7 +190,7 @@ bool PX4RCInput::rc_bind(int dsmMode) return false; } -#ifdef HAL_RCINPUT_WITH_AP_RADIO +#if HAL_RCINPUT_WITH_AP_RADIO if (radio) { radio->start_recv_bind(); } diff --git a/libraries/AP_HAL_PX4/RCInput.h b/libraries/AP_HAL_PX4/RCInput.h index e77d178b6f..9bf3fe002f 100644 --- a/libraries/AP_HAL_PX4/RCInput.h +++ b/libraries/AP_HAL_PX4/RCInput.h @@ -45,7 +45,7 @@ private: uint8_t last_input_source = input_rc_s::RC_INPUT_SOURCE_UNKNOWN; const char *input_source_name(uint8_t id) const; -#ifdef HAL_RCINPUT_WITH_AP_RADIO +#if HAL_RCINPUT_WITH_AP_RADIO AP_Radio *radio; uint32_t last_radio_us; #endif