Compare commits

...

5 Commits

Author SHA1 Message Date
Daniel Agar 9bbe1aa419 lib/rc: don't share decode buffer between protocols 2021-09-16 14:40:26 -04:00
Daniel Agar 7af5a33ff3 commander: don't play failsafe tune if disarmed 2021-09-16 09:17:00 -04:00
Matthias Grob ecb1264832 vscode: do not disable autocomplete on enter 2021-09-16 09:11:52 -04:00
Julian Oes c779946e05 setup: Use available Java version for Ubuntu 20.04
14 was not available for me, 16 would have been.
2021-09-16 13:59:27 +02:00
Julian Oes addb978364 setup: Let's not ignore errors
Otherwise the script finishes and you don't know if it worked.
2021-09-16 13:59:27 +02:00
11 changed files with 11 additions and 34 deletions
-1
View File
@@ -31,7 +31,6 @@
"esc"
],
"debug.toolBarLocation": "docked",
"editor.acceptSuggestionOnEnter": "off",
"editor.defaultFormatter": "chiehyu.vscode-astyle",
"editor.dragAndDrop": false,
"editor.insertSpaces": false,
+3 -1
View File
@@ -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
-2
View File
@@ -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;
-22
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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)
{
+1 -1
View File
@@ -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 {