mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-28 02:50:04 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9bbe1aa419 | |||
| 7af5a33ff3 | |||
| ecb1264832 | |||
| c779946e05 | |||
| addb978364 |
Vendored
-1
@@ -31,7 +31,6 @@
|
||||
"esc"
|
||||
],
|
||||
"debug.toolBarLocation": "docked",
|
||||
"editor.acceptSuggestionOnEnter": "off",
|
||||
"editor.defaultFormatter": "chiehyu.vscode-astyle",
|
||||
"editor.dragAndDrop": false,
|
||||
"editor.insertSpaces": false,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
## Bash script to setup PX4 development environment on Ubuntu LTS (20.04, 18.04, 16.04).
|
||||
## Can also be used in docker.
|
||||
##
|
||||
@@ -193,7 +195,7 @@ if [[ $INSTALL_SIM == "true" ]]; then
|
||||
java_version=11
|
||||
gazebo_version=9
|
||||
elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
|
||||
java_version=14
|
||||
java_version=13
|
||||
gazebo_version=11
|
||||
else
|
||||
java_version=14
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
|
||||
#include "common_rc.h"
|
||||
|
||||
__EXPORT rc_decode_buf_t rc_decode_buf;
|
||||
|
||||
uint8_t crc8_dvb_s2(uint8_t crc, uint8_t a)
|
||||
{
|
||||
crc ^= a;
|
||||
|
||||
@@ -3,27 +3,5 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "crsf.h"
|
||||
#include "dsm.h"
|
||||
#include "ghst.hpp"
|
||||
#include "sbus.h"
|
||||
#include "st24.h"
|
||||
#include "sumd.h"
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef struct rc_decode_buf_ {
|
||||
union {
|
||||
crsf_frame_t crsf_frame;
|
||||
ghst_frame_t ghst_frame;
|
||||
dsm_decode_t dsm;
|
||||
sbus_frame_t sbus_frame;
|
||||
ReceiverFcPacket _strxpacket;
|
||||
ReceiverFcPacketHoTT _hottrxpacket;
|
||||
};
|
||||
} rc_decode_buf_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
extern rc_decode_buf_t rc_decode_buf;
|
||||
|
||||
uint8_t crc8_dvb_s2(uint8_t crc, uint8_t a);
|
||||
uint8_t crc8_dvb_s2_buf(uint8_t *buf, int len);
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ enum class crsf_parser_state_t : uint8_t {
|
||||
synced
|
||||
};
|
||||
|
||||
static crsf_frame_t &crsf_frame = rc_decode_buf.crsf_frame;
|
||||
static crsf_frame_t crsf_frame;
|
||||
static unsigned current_frame_position = 0;
|
||||
static crsf_parser_state_t parser_state = crsf_parser_state_t::unsynced;
|
||||
|
||||
|
||||
+2
-2
@@ -73,8 +73,8 @@ static enum DSM_DECODE_STATE {
|
||||
static int dsm_fd = -1; /**< File handle to the DSM UART */
|
||||
static hrt_abstime dsm_last_rx_time; /**< Timestamp when we last received data */
|
||||
static hrt_abstime dsm_last_frame_time; /**< Timestamp for start of last valid dsm frame */
|
||||
static dsm_frame_t &dsm_frame = rc_decode_buf.dsm.frame; /**< DSM_BUFFER_SIZE DSM dsm frame receive buffer */
|
||||
static dsm_buf_t &dsm_buf = rc_decode_buf.dsm.buf; /**< DSM_BUFFER_SIZE DSM dsm frame receive buffer */
|
||||
static dsm_frame_t dsm_frame; /**< DSM_BUFFER_SIZE DSM dsm frame receive buffer */
|
||||
static dsm_buf_t dsm_buf; /**< DSM_BUFFER_SIZE DSM dsm frame receive buffer */
|
||||
|
||||
static uint16_t dsm_chan_buf[DSM_MAX_CHANNEL_COUNT];
|
||||
static unsigned dsm_partial_frame_count; /**< Count of bytes received for current dsm frame */
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ enum class ghst_parser_state_t : uint8_t {
|
||||
// only RSSI frame contains value of RSSI, if it is not received, send last received RSSI
|
||||
static int8_t ghst_rssi = -1;
|
||||
|
||||
static ghst_frame_t &ghst_frame = rc_decode_buf.ghst_frame;
|
||||
static ghst_frame_t ghst_frame;
|
||||
static uint32_t current_frame_position = 0U;
|
||||
static ghst_parser_state_t parser_state = ghst_parser_state_t::unsynced;
|
||||
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ static enum SBUS2_DECODE_STATE {
|
||||
SBUS2_DECODE_STATE_SBUS2_DATA2 = 0x34
|
||||
} sbus_decode_state = SBUS2_DECODE_STATE_DESYNC;
|
||||
|
||||
static sbus_frame_t &sbus_frame = rc_decode_buf.sbus_frame;
|
||||
static sbus_frame_t sbus_frame;
|
||||
|
||||
static unsigned partial_frame_count;
|
||||
static unsigned sbus1_frame_delay = (1000U * 1000U) / SBUS1_DEFAULT_RATE_HZ;
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ const char *decode_states[] = {"UNSYNCED",
|
||||
static enum ST24_DECODE_STATE _decode_state = ST24_DECODE_STATE_UNSYNCED;
|
||||
static uint8_t _rxlen;
|
||||
|
||||
static ReceiverFcPacket &_rxpacket = rc_decode_buf._strxpacket;
|
||||
static ReceiverFcPacket _rxpacket;
|
||||
|
||||
uint8_t st24_common_crc8(uint8_t *ptr, uint8_t len)
|
||||
{
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ bool _debug = false;
|
||||
static enum SUMD_DECODE_STATE _decode_state = SUMD_DECODE_STATE_UNSYNCED;
|
||||
static uint8_t _rxlen;
|
||||
|
||||
static ReceiverFcPacketHoTT &_rxpacket = rc_decode_buf._hottrxpacket;
|
||||
static ReceiverFcPacketHoTT _rxpacket;
|
||||
|
||||
uint16_t sumd_crc16(uint16_t crc, uint8_t value)
|
||||
{
|
||||
|
||||
@@ -2842,7 +2842,7 @@ Commander::run()
|
||||
/* play tune on battery warning */
|
||||
set_tune(tune_control_s::TUNE_ID_BATTERY_WARNING_SLOW);
|
||||
|
||||
} else if (_status.failsafe) {
|
||||
} else if (_status.failsafe && _armed.armed) {
|
||||
tune_failsafe(true);
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user