From 66c4b7d986d0aac1d2b30d13770cc68327724934 Mon Sep 17 00:00:00 2001 From: Mark Whitehorn Date: Wed, 22 Nov 2017 10:38:34 -0700 Subject: [PATCH] AP_HAL: support SBusOut rename enable_sbus_out to enable_px4io_sbus_out --- libraries/AP_HAL/RCOutput.h | 5 +++-- libraries/AP_HAL/UARTDriver.cpp | 2 +- libraries/AP_HAL/UARTDriver.h | 8 ++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libraries/AP_HAL/RCOutput.h b/libraries/AP_HAL/RCOutput.h index 5a5b188fd2..eb3f2bd14b 100644 --- a/libraries/AP_HAL/RCOutput.h +++ b/libraries/AP_HAL/RCOutput.h @@ -1,6 +1,7 @@ #pragma once #include "AP_HAL_Namespace.h" +#include #define RC_OUTPUT_MIN_PULSEWIDTH 400 #define RC_OUTPUT_MAX_PULSEWIDTH 2100 @@ -114,9 +115,9 @@ public: virtual float scale_esc_to_unity(uint16_t pwm) { return 0; } /* - enable SBUS out at the given rate + enable PX4IO SBUS out at the given rate */ - virtual bool enable_sbus_out(uint16_t rate_hz) { return false; } + virtual bool enable_px4io_sbus_out(uint16_t rate_hz) { return false; } /* * Optional method to control the update of the motors. Derived classes diff --git a/libraries/AP_HAL/UARTDriver.cpp b/libraries/AP_HAL/UARTDriver.cpp index 0ad15746aa..8795efc60b 100644 --- a/libraries/AP_HAL/UARTDriver.cpp +++ b/libraries/AP_HAL/UARTDriver.cpp @@ -18,7 +18,7 @@ #include "utility/print_vprintf.h" #include "UARTDriver.h" -/* +/* BetterStream method implementations These are implemented in AP_HAL to ensure consistent behaviour on all boards, although they can be overridden by a port diff --git a/libraries/AP_HAL/UARTDriver.h b/libraries/AP_HAL/UARTDriver.h index 1005fbcda1..a25e77e8f0 100644 --- a/libraries/AP_HAL/UARTDriver.h +++ b/libraries/AP_HAL/UARTDriver.h @@ -45,6 +45,14 @@ public: virtual void set_flow_control(enum flow_control flow_control_setting) {}; virtual enum flow_control get_flow_control(void) { return FLOW_CONTROL_DISABLE; } + virtual void configure_parity(uint8_t v){}; + virtual void set_stop_bits(int n){}; + + /* unbuffered writes bypass the ringbuffer and go straight to the + * file descriptor + */ + virtual bool set_unbuffered_writes(bool on){ return false; }; + /* Implementations of BetterStream virtual methods. These are * provided by AP_HAL to ensure consistency between ports to * different boards