AP_Radio: allow build of AP_Radio under PX4

This commit is contained in:
Andrew Tridgell 2018-02-08 14:24:54 +11:00
parent 0ed75052f8
commit 64384fa8c9
3 changed files with 7 additions and 10 deletions

View File

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

View File

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

View File

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