mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
LP-520 Oplink : Send RSSI value as PPM output channel
This commit is contained in:
parent
ea41e40a4a
commit
20ac6ed1e3
@ -35,7 +35,7 @@
|
||||
#include "pios_ppm_out_priv.h"
|
||||
|
||||
#define PIOS_PPM_OUT_MAX_DEVS 1
|
||||
#define PIOS_PPM_OUT_MAX_CHANNELS 8
|
||||
#define PIOS_PPM_OUT_MAX_CHANNELS 8 + 1 // 8 RC channels + Rssi
|
||||
#define PIOS_PPM_OUT_FRAME_PERIOD_US 22500 // microseconds
|
||||
#define PIOS_PPM_OUT_HIGH_PULSE_US 400 // microseconds
|
||||
#define PIOS_PPM_OUT_MIN_CHANNEL_PULSE_US 1000 // microseconds
|
||||
|
@ -57,6 +57,7 @@ uint32_t pios_com_gcs_id = 0;
|
||||
uint32_t pios_com_gcs_out_id = 0;
|
||||
#if defined(PIOS_INCLUDE_PPM_OUT)
|
||||
uint32_t pios_ppm_out_id = 0;
|
||||
bool ppm_rssi = false;
|
||||
#endif
|
||||
#if defined(PIOS_INCLUDE_RFM22B)
|
||||
#include <pios_rfm22b_com.h>
|
||||
@ -142,6 +143,7 @@ void PIOS_Board_Init(void)
|
||||
bool ppm_only = (oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_CONTROL);
|
||||
bool ppm_mode = ((oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_CONTROL) ||
|
||||
(oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_DATAANDCONTROL));
|
||||
ppm_rssi = (oplinkSettings.PPMOutRSSI == OPLINKSETTINGS_PPMOUTRSSI_CH9);
|
||||
bool servo_main = false;
|
||||
bool servo_flexi = false;
|
||||
|
||||
@ -441,6 +443,15 @@ static void PIOS_Board_PPM_callback(__attribute__((unused)) uint32_t context, co
|
||||
PIOS_PPM_OUT_Set(PIOS_PPM_OUTPUT, i, channels[i]);
|
||||
}
|
||||
}
|
||||
// Rssi channel output is added after RC channels
|
||||
// Output Rssi from 1000µs to 2000µs (-127dBm to -16dBm range)
|
||||
if (ppm_rssi) {
|
||||
int8_t rssi;
|
||||
int16_t ppm_value;
|
||||
OPLinkStatusRSSIGet(&rssi);
|
||||
ppm_value = 1000 + ((rssi + 127) * 9);
|
||||
PIOS_PPM_OUT_Set(PIOS_PPM_OUTPUT, RFM22B_PPM_NUM_CHANNELS, ppm_value);
|
||||
}
|
||||
}
|
||||
#if defined(PIOS_INCLUDE_SERVO)
|
||||
for (uint8_t i = 0; i < servo_count; ++i) {
|
||||
|
@ -1,22 +1,23 @@
|
||||
<xml>
|
||||
<object name="OPLinkSettings" singleinstance="true" settings="true" category="System">
|
||||
<description>OPLink configurations options.</description>
|
||||
<field name="Protocol" units="" type="enum" elements="1" options="Disabled,OPLinkReceiver,OPLinkCoordinator,OpenLRS" defaultvalue="Disabled"/>
|
||||
<field name="LinkType" units="" type="enum" elements="1" options="Data,Control,DataAndControl" defaultvalue="Data"/>
|
||||
<field name="CoordID" units="hex" type="uint32" elements="1" defaultvalue="0"/>
|
||||
<field name="Protocol" units="" type="enum" elements="1" options="Disabled,OPLinkReceiver,OPLinkCoordinator,OpenLRS" defaultvalue="Disabled"/>
|
||||
<field name="LinkType" units="" type="enum" elements="1" options="Data,Control,DataAndControl" defaultvalue="Data"/>
|
||||
<field name="CoordID" units="hex" type="uint32" elements="1" defaultvalue="0"/>
|
||||
<field name="CustomDeviceID" units="hex" type="uint32" elements="1" defaultvalue="0"/>
|
||||
|
||||
<!-- port options -->
|
||||
<!-- port options -->
|
||||
<field name="MainPort" units="" type="enum" elements="1" options="Disabled,Telemetry,Serial,PPM,PWM" defaultvalue="Disabled"/>
|
||||
<field name="FlexiPort" units="" type="enum" elements="1" options="Disabled,Telemetry,Serial,PPM,PWM" defaultvalue="Disabled"/>
|
||||
<field name="PPMOutRSSI" units="" type="enum" elements="1" options="Disabled,Ch9" defaultvalue="Disabled"/>
|
||||
<field name="RadioPriStream" units="connection" type="enum" elements="1" options="Disabled,HID,Main,Flexi,VCP" defaultvalue="HID"/>
|
||||
<field name="RadioAuxStream" units="connection" type="enum" elements="1" options="Disabled,HID,Main,Flexi,VCP" defaultvalue="Disabled"/>
|
||||
<field name="VCPBridge" units="connection" type="enum" elements="1" options="Disabled,Main,Flexi" defaultvalue="Disabled"/>
|
||||
<field name="MainComSpeed" units="bps" type="enum" elements="1" options="Disabled,4800,9600,19200,38400,57600,115200" defaultvalue="38400"/>
|
||||
<field name="FlexiComSpeed" units="bps" type="enum" elements="1" options="Disabled,4800,9600,19200,38400,57600,115200" defaultvalue="38400"/>
|
||||
<field name="AirDataRate" units="bps" type="enum" elements="1" options="9600,19200,32000,57600,64000,100000,128000,192000,256000" defaultvalue="64000"/>
|
||||
<field name="RadioAuxStream" units="connection" type="enum" elements="1" options="Disabled,HID,Main,Flexi,VCP" defaultvalue="Disabled"/>
|
||||
<field name="VCPBridge" units="connection" type="enum" elements="1" options="Disabled,Main,Flexi" defaultvalue="Disabled"/>
|
||||
<field name="MainComSpeed" units="bps" type="enum" elements="1" options="Disabled,4800,9600,19200,38400,57600,115200" defaultvalue="38400"/>
|
||||
<field name="FlexiComSpeed" units="bps" type="enum" elements="1" options="Disabled,4800,9600,19200,38400,57600,115200" defaultvalue="38400"/>
|
||||
<field name="AirDataRate" units="bps" type="enum" elements="1" options="9600,19200,32000,57600,64000,100000,128000,192000,256000" defaultvalue="64000"/>
|
||||
|
||||
<!-- OpenLRS options -->
|
||||
<!-- OpenLRS options -->
|
||||
<field name="Version" units="" type="uint8" elements="1" defaultvalue="0"/>
|
||||
<field name="SerialBaudrate" units="bps" type="uint32" elements="1" defaultvalue="0"/>
|
||||
<field name="RFFrequency" units="Hz" type="uint32" elements="1" defaultvalue="0"/>
|
||||
@ -24,7 +25,7 @@
|
||||
<field name="RSSIType" units="function" type="enum" elements="1" options="Combined,RSSI,LinkQuality" defaultvalue="Combined"/>
|
||||
<field name="RFPower" units="" type="uint8" elements="1" defaultvalue="0"/>
|
||||
|
||||
<!-- RF options -->
|
||||
<!-- RF options -->
|
||||
<field name="RFXtalCap" units="" type="uint8" elements="1" defaultvalue="127" limits="%BE:0:171" description="0 to 171 range, default 127"/>
|
||||
<field name="MinChannel" units="" type="uint8" elements="1" defaultvalue="0"/>
|
||||
<field name="MaxChannel" units="" type="uint8" elements="1" defaultvalue="250"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user