Browse Source

AP_Radio: allow build of AP_Radio under PX4

mission-4.1.18
Andrew Tridgell 7 years ago
parent
commit
64384fa8c9
  1. 2
      libraries/AP_Radio/AP_Radio.cpp
  2. 6
      libraries/AP_Radio/AP_Radio_cc2500.cpp
  3. 9
      libraries/AP_Radio/AP_Radio_cc2500.h

2
libraries/AP_Radio/AP_Radio.cpp

@ -152,9 +152,11 @@ bool AP_Radio::init(void)
case RADIO_TYPE_CYRF6936: case RADIO_TYPE_CYRF6936:
driver = new AP_Radio_cypress(*this); driver = new AP_Radio_cypress(*this);
break; break;
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
case RADIO_TYPE_CC2500: case RADIO_TYPE_CC2500:
driver = new AP_Radio_cc2500(*this); driver = new AP_Radio_cc2500(*this);
break; break;
#endif
default: default:
break; break;
} }

6
libraries/AP_Radio/AP_Radio_cc2500.cpp

@ -7,12 +7,10 @@
#pragma GCC optimize("O0") #pragma GCC optimize("O0")
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
#ifdef HAL_RCINPUT_WITH_AP_RADIO #ifdef HAL_RCINPUT_WITH_AP_RADIO
#include <AP_Math/AP_Math.h> #include <AP_Math/AP_Math.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
#include <board_config.h>
#endif
#include "AP_Radio_cc2500.h" #include "AP_Radio_cc2500.h"
#include <utility> #include <utility>
#include <stdio.h> #include <stdio.h>
@ -1085,4 +1083,4 @@ void AP_Radio_cc2500::check_fw_ack(void)
} }
#endif // HAL_RCINPUT_WITH_AP_RADIO #endif // HAL_RCINPUT_WITH_AP_RADIO
#endif // CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS

9
libraries/AP_Radio/AP_Radio_cc2500.h

@ -21,13 +21,8 @@
*/ */
#include "AP_Radio_backend.h" #include "AP_Radio_backend.h"
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 #if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
#include <nuttx/arch.h>
#include <systemlib/systemlib.h>
#include <drivers/drv_hrt.h>
#elif CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
#include "hal.h" #include "hal.h"
#endif
#include "telem_structure.h" #include "telem_structure.h"
#include "driver_cc2500.h" #include "driver_cc2500.h"
@ -210,3 +205,5 @@ private:
}; };
#endif // CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS

Loading…
Cancel
Save