From 1627eb388229b2eda4ceb57fee77a3d8c7febed1 Mon Sep 17 00:00:00 2001 From: Brian Webb Date: Mon, 4 Sep 2017 09:44:36 -0700 Subject: [PATCH] LP-548 Adds OPLInkRcvr to several more FCs, uncrustify, and fixes a few comments. --- flight/modules/RadioComBridge/RadioComBridge.c | 5 +---- flight/pios/common/pios_oplinkrcvr.c | 6 +++--- flight/pios/common/pios_rfm22b.c | 2 +- .../targets/boards/coptercontrol/firmware/inc/pios_config.h | 4 ++-- .../boards/discoveryf4bare/firmware/inc/pios_config.h | 2 +- .../targets/boards/nucleof303re/firmware/inc/pios_config.h | 4 ++-- flight/targets/boards/revonano/firmware/inc/pios_config.h | 2 +- flight/targets/boards/revoproto/firmware/inc/pios_config.h | 2 +- python/examples/example.py | 2 +- 9 files changed, 13 insertions(+), 16 deletions(-) diff --git a/flight/modules/RadioComBridge/RadioComBridge.c b/flight/modules/RadioComBridge/RadioComBridge.c index 29fb53f16..f21060b56 100644 --- a/flight/modules/RadioComBridge/RadioComBridge.c +++ b/flight/modules/RadioComBridge/RadioComBridge.c @@ -611,11 +611,8 @@ static void ProcessRadioStream(UAVTalkConnection inConnectionHandle, UAVTalkConn case OPLINKRECEIVER_OBJID: case MetaObjectId(OPLINKRECEIVER_OBJID): // 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); - // all other packets are relayed to the telemetry port + // Also send the packet to the telemetry point. UAVTalkRelayPacket(inConnectionHandle, outConnectionHandle); break; default: diff --git a/flight/pios/common/pios_oplinkrcvr.c b/flight/pios/common/pios_oplinkrcvr.c index 678e330c3..bc5415fab 100644 --- a/flight/pios/common/pios_oplinkrcvr.c +++ b/flight/pios/common/pios_oplinkrcvr.c @@ -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) { oplinkrcvr_dev->oplinkreceiverdata.Channel[i] = (i < RFM22B_PPM_NUM_CHANNELS) ? channels[i] : PIOS_RCVR_TIMEOUT; } - + // Update the RSSI and quality fields. int8_t 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 oplinkrcvr_dev->oplinkreceiverdata.LinkQuality = quality * 100 / 128; - //OPLinkReceiverSet(&oplinkrcvr_dev->oplinkreceiverdata); + OPLinkReceiverSet(&oplinkrcvr_dev->oplinkreceiverdata); 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->Fresh = false; oplinkrcvr_dev->supv_timer = 0; - + /* The update callback cannot receive the device pointer, so set it in a global */ global_oplinkrcvr_dev = oplinkrcvr_dev; diff --git a/flight/pios/common/pios_rfm22b.c b/flight/pios/common/pios_rfm22b.c index 9b7f3f5e3..086f2bd5c 100644 --- a/flight/pios/common/pios_rfm22b.c +++ b/flight/pios/common/pios_rfm22b.c @@ -1869,7 +1869,7 @@ static enum pios_radio_event radio_txStart(struct pios_rfm22b_dev *radio_dev) } if (newlen) { packet_data = true; - *(p + len) = radio_dev->last_stream_sent; + *(p + len) = radio_dev->last_stream_sent; len += newlen + 1; } } diff --git a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h index 51ffcdc87..b5d3a4d32 100644 --- a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h +++ b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h @@ -107,8 +107,8 @@ #define PIOS_INCLUDE_SRXL #define PIOS_INCLUDE_HOTT #define PIOS_INCLUDE_IBUS -/* #define PIOS_INCLUDE_GCSRCVR */ -/* #define PIOS_INCLUDE_OPLINKRCVR */ +#define PIOS_INCLUDE_GCSRCVR +#define PIOS_INCLUDE_OPLINKRCVR /* PIOS abstract receiver interface */ #define PIOS_INCLUDE_RCVR diff --git a/flight/targets/boards/discoveryf4bare/firmware/inc/pios_config.h b/flight/targets/boards/discoveryf4bare/firmware/inc/pios_config.h index 2704b36e8..577c10ec6 100644 --- a/flight/targets/boards/discoveryf4bare/firmware/inc/pios_config.h +++ b/flight/targets/boards/discoveryf4bare/firmware/inc/pios_config.h @@ -105,7 +105,7 @@ #define PIOS_INCLUDE_DSM #define PIOS_INCLUDE_SBUS #define PIOS_INCLUDE_GCSRCVR -// #define PIOS_INCLUDE_OPLINKRCVR +#define PIOS_INCLUDE_OPLINKRCVR /* PIOS abstract receiver interface */ #define PIOS_INCLUDE_RCVR diff --git a/flight/targets/boards/nucleof303re/firmware/inc/pios_config.h b/flight/targets/boards/nucleof303re/firmware/inc/pios_config.h index 48016c8e0..abe4f0eaf 100644 --- a/flight/targets/boards/nucleof303re/firmware/inc/pios_config.h +++ b/flight/targets/boards/nucleof303re/firmware/inc/pios_config.h @@ -109,8 +109,8 @@ #define PIOS_INCLUDE_SRXL #define PIOS_INCLUDE_HOTT #define PIOS_INCLUDE_IBUS -/* #define PIOS_INCLUDE_GCSRCVR */ -/* #define PIOS_INCLUDE_OPLINKRCVR */ +#define PIOS_INCLUDE_GCSRCVR +#define PIOS_INCLUDE_OPLINKRCVR /* PIOS abstract receiver interface */ #define PIOS_INCLUDE_RCVR diff --git a/flight/targets/boards/revonano/firmware/inc/pios_config.h b/flight/targets/boards/revonano/firmware/inc/pios_config.h index d9eaea5c0..219648a16 100644 --- a/flight/targets/boards/revonano/firmware/inc/pios_config.h +++ b/flight/targets/boards/revonano/firmware/inc/pios_config.h @@ -113,7 +113,7 @@ #define PIOS_INCLUDE_EXBUS #define PIOS_INCLUDE_IBUS #define PIOS_INCLUDE_GCSRCVR -// #define PIOS_INCLUDE_OPLINKRCVR +#define PIOS_INCLUDE_OPLINKRCVR /* PIOS abstract receiver interface */ #define PIOS_INCLUDE_RCVR diff --git a/flight/targets/boards/revoproto/firmware/inc/pios_config.h b/flight/targets/boards/revoproto/firmware/inc/pios_config.h index a83c09629..7238d5885 100644 --- a/flight/targets/boards/revoproto/firmware/inc/pios_config.h +++ b/flight/targets/boards/revoproto/firmware/inc/pios_config.h @@ -100,7 +100,7 @@ #define PIOS_INCLUDE_DSM #define PIOS_INCLUDE_SBUS #define PIOS_INCLUDE_GCSRCVR -/* #define PIOS_INCLUDE_OPLINKRCVR */ +#define PIOS_INCLUDE_OPLINKRCVR /* PIOS abstract receiver interface */ #define PIOS_INCLUDE_RCVR diff --git a/python/examples/example.py b/python/examples/example.py index 4a3d84e39..7caf12cef 100644 --- a/python/examples/example.py +++ b/python/examples/example.py @@ -56,7 +56,7 @@ class UavtalkDemo(): _port = int(port[3:]) - 1 else: _port = port - serPort = serial.Serial(port, 115200, timeout=.5) + serPort = serial.Serial(port, 57600, timeout=.5) if not serPort.isOpen(): raise IOError("Failed to open serial port")