mirror of https://github.com/ArduPilot/ardupilot
AP_HAL_Linux: combine ppm and sbus on ocpoc_zynq
Removes compile-time selection of RCInput driver for ocpoc_zynq. PPM and SBUS input are now colocated on the ocpoc board, and it only needs to run RCInput_ZYNQ. Pulse input is also inverted to accommodate SBUS input, which has no effect on PPM input.
This commit is contained in:
parent
065b00eb81
commit
8058fdf093
|
@ -141,14 +141,9 @@ static RCInput_AioPRU rcinDriver;
|
|||
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DARK || \
|
||||
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXFMINI
|
||||
static RCInput_RPI rcinDriver;
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_ZYNQ
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_ZYNQ || \
|
||||
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_OCPOC_ZYNQ
|
||||
static RCInput_ZYNQ rcinDriver;
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_OCPOC_ZYNQ
|
||||
#if OCPOC_DEFAULT_RCIN_SBUS
|
||||
static RCInput_SBUS rcinDriver;
|
||||
#else
|
||||
static RCInput_ZYNQ rcinDriver;
|
||||
#endif
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP
|
||||
static RCInput_UDP rcinDriver;
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_MINLURE
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "GPIO.h"
|
||||
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_OCPOC_ZYNQ
|
||||
#define RCIN_ZYNQ_PULSE_INPUT_BASE 0x43c70000
|
||||
#define RCIN_ZYNQ_PULSE_INPUT_BASE 0x43ca0000
|
||||
#else
|
||||
#define RCIN_ZYNQ_PULSE_INPUT_BASE 0x43c10000
|
||||
#endif
|
||||
|
@ -49,7 +49,7 @@ void RCInput_ZYNQ::_timer_tick()
|
|||
// all F's means no samples available
|
||||
while((v = *pulse_input) != 0xffffffff) {
|
||||
// Hi bit indicates pin state, low bits denote pulse length
|
||||
if(!(v & 0x80000000))
|
||||
if(v & 0x80000000)
|
||||
_s0_time = (v & 0x7fffffff)/TICK_PER_US;
|
||||
else
|
||||
_process_rc_pulse(_s0_time, (v & 0x7fffffff)/TICK_PER_US);
|
||||
|
|
Loading…
Reference in New Issue