mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-21 11:54:15 +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) {
|
||||
|
@ -9,6 +9,7 @@
|
||||
<!-- 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"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user