1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-30 15:52:12 +01:00

LP-548 Adds OPLInkRcvr to several more FCs, uncrustify, and fixes a few comments.

This commit is contained in:
Brian Webb 2017-09-04 09:44:36 -07:00
parent 9356ac91da
commit 1627eb3882
9 changed files with 13 additions and 16 deletions

View File

@ -611,11 +611,8 @@ static void ProcessRadioStream(UAVTalkConnection inConnectionHandle, UAVTalkConn
case OPLINKRECEIVER_OBJID: case OPLINKRECEIVER_OBJID:
case MetaObjectId(OPLINKRECEIVER_OBJID): case MetaObjectId(OPLINKRECEIVER_OBJID):
// Receive object locally // Receive object locally
// These objects are received by the modem and are not transmitted to the telemetry port
// - OPLINKRECEIVER_OBJID : not sure why
// some objects will send back a response to the remote modem
UAVTalkReceiveObject(inConnectionHandle, true); UAVTalkReceiveObject(inConnectionHandle, true);
// all other packets are relayed to the telemetry port // Also send the packet to the telemetry point.
UAVTalkRelayPacket(inConnectionHandle, outConnectionHandle); UAVTalkRelayPacket(inConnectionHandle, outConnectionHandle);
break; break;
default: default:

View File

@ -81,7 +81,7 @@ static void PIOS_oplinkrcvr_ppm_callback(uint32_t oplinkrcvr_id, const int16_t *
for (uint8_t i = 0; i < OPLINKRECEIVER_CHANNEL_NUMELEM; ++i) { for (uint8_t i = 0; i < OPLINKRECEIVER_CHANNEL_NUMELEM; ++i) {
oplinkrcvr_dev->oplinkreceiverdata.Channel[i] = (i < RFM22B_PPM_NUM_CHANNELS) ? channels[i] : PIOS_RCVR_TIMEOUT; oplinkrcvr_dev->oplinkreceiverdata.Channel[i] = (i < RFM22B_PPM_NUM_CHANNELS) ? channels[i] : PIOS_RCVR_TIMEOUT;
} }
// Update the RSSI and quality fields. // Update the RSSI and quality fields.
int8_t rssi; int8_t rssi;
OPLinkReceiverRSSIGet(&rssi); OPLinkReceiverRSSIGet(&rssi);
@ -91,7 +91,7 @@ static void PIOS_oplinkrcvr_ppm_callback(uint32_t oplinkrcvr_id, const int16_t *
// Link quality is 0-128, so scale it down to 0-100 // Link quality is 0-128, so scale it down to 0-100
oplinkrcvr_dev->oplinkreceiverdata.LinkQuality = quality * 100 / 128; oplinkrcvr_dev->oplinkreceiverdata.LinkQuality = quality * 100 / 128;
//OPLinkReceiverSet(&oplinkrcvr_dev->oplinkreceiverdata); OPLinkReceiverSet(&oplinkrcvr_dev->oplinkreceiverdata);
oplinkrcvr_dev->Fresh = true; oplinkrcvr_dev->Fresh = true;
} }
@ -110,7 +110,7 @@ static struct pios_oplinkrcvr_dev *PIOS_oplinkrcvr_alloc(void)
oplinkrcvr_dev->magic = PIOS_OPLINKRCVR_DEV_MAGIC; oplinkrcvr_dev->magic = PIOS_OPLINKRCVR_DEV_MAGIC;
oplinkrcvr_dev->Fresh = false; oplinkrcvr_dev->Fresh = false;
oplinkrcvr_dev->supv_timer = 0; oplinkrcvr_dev->supv_timer = 0;
/* The update callback cannot receive the device pointer, so set it in a global */ /* The update callback cannot receive the device pointer, so set it in a global */
global_oplinkrcvr_dev = oplinkrcvr_dev; global_oplinkrcvr_dev = oplinkrcvr_dev;

View File

@ -1869,7 +1869,7 @@ static enum pios_radio_event radio_txStart(struct pios_rfm22b_dev *radio_dev)
} }
if (newlen) { if (newlen) {
packet_data = true; packet_data = true;
*(p + len) = radio_dev->last_stream_sent; *(p + len) = radio_dev->last_stream_sent;
len += newlen + 1; len += newlen + 1;
} }
} }

View File

@ -107,8 +107,8 @@
#define PIOS_INCLUDE_SRXL #define PIOS_INCLUDE_SRXL
#define PIOS_INCLUDE_HOTT #define PIOS_INCLUDE_HOTT
#define PIOS_INCLUDE_IBUS #define PIOS_INCLUDE_IBUS
/* #define PIOS_INCLUDE_GCSRCVR */ #define PIOS_INCLUDE_GCSRCVR
/* #define PIOS_INCLUDE_OPLINKRCVR */ #define PIOS_INCLUDE_OPLINKRCVR
/* PIOS abstract receiver interface */ /* PIOS abstract receiver interface */
#define PIOS_INCLUDE_RCVR #define PIOS_INCLUDE_RCVR

View File

@ -105,7 +105,7 @@
#define PIOS_INCLUDE_DSM #define PIOS_INCLUDE_DSM
#define PIOS_INCLUDE_SBUS #define PIOS_INCLUDE_SBUS
#define PIOS_INCLUDE_GCSRCVR #define PIOS_INCLUDE_GCSRCVR
// #define PIOS_INCLUDE_OPLINKRCVR #define PIOS_INCLUDE_OPLINKRCVR
/* PIOS abstract receiver interface */ /* PIOS abstract receiver interface */
#define PIOS_INCLUDE_RCVR #define PIOS_INCLUDE_RCVR

View File

@ -109,8 +109,8 @@
#define PIOS_INCLUDE_SRXL #define PIOS_INCLUDE_SRXL
#define PIOS_INCLUDE_HOTT #define PIOS_INCLUDE_HOTT
#define PIOS_INCLUDE_IBUS #define PIOS_INCLUDE_IBUS
/* #define PIOS_INCLUDE_GCSRCVR */ #define PIOS_INCLUDE_GCSRCVR
/* #define PIOS_INCLUDE_OPLINKRCVR */ #define PIOS_INCLUDE_OPLINKRCVR
/* PIOS abstract receiver interface */ /* PIOS abstract receiver interface */
#define PIOS_INCLUDE_RCVR #define PIOS_INCLUDE_RCVR

View File

@ -113,7 +113,7 @@
#define PIOS_INCLUDE_EXBUS #define PIOS_INCLUDE_EXBUS
#define PIOS_INCLUDE_IBUS #define PIOS_INCLUDE_IBUS
#define PIOS_INCLUDE_GCSRCVR #define PIOS_INCLUDE_GCSRCVR
// #define PIOS_INCLUDE_OPLINKRCVR #define PIOS_INCLUDE_OPLINKRCVR
/* PIOS abstract receiver interface */ /* PIOS abstract receiver interface */
#define PIOS_INCLUDE_RCVR #define PIOS_INCLUDE_RCVR

View File

@ -100,7 +100,7 @@
#define PIOS_INCLUDE_DSM #define PIOS_INCLUDE_DSM
#define PIOS_INCLUDE_SBUS #define PIOS_INCLUDE_SBUS
#define PIOS_INCLUDE_GCSRCVR #define PIOS_INCLUDE_GCSRCVR
/* #define PIOS_INCLUDE_OPLINKRCVR */ #define PIOS_INCLUDE_OPLINKRCVR
/* PIOS abstract receiver interface */ /* PIOS abstract receiver interface */
#define PIOS_INCLUDE_RCVR #define PIOS_INCLUDE_RCVR

View File

@ -56,7 +56,7 @@ class UavtalkDemo():
_port = int(port[3:]) - 1 _port = int(port[3:]) - 1
else: else:
_port = port _port = port
serPort = serial.Serial(port, 115200, timeout=.5) serPort = serial.Serial(port, 57600, timeout=.5)
if not serPort.isOpen(): if not serPort.isOpen():
raise IOError("Failed to open serial port") raise IOError("Failed to open serial port")