mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
hwsettings: allow disabling of USB telemetry entirely
The GCS hwsettings config widget now disallows any configuration that disables both HID and VCP telemetry over the USB port. The firmware will allow it if the UAVObj is set manually. This allows a mechanism to reduce RAM usage by another 500 more bytes if USB telemetry can be sacrificed in certain configurations.
This commit is contained in:
parent
45615b5812
commit
1543a6dbd3
@ -1124,11 +1124,6 @@ void PIOS_Board_Init(void) {
|
||||
uint8_t hwsettings_usb_hidport;
|
||||
HwSettingsUSB_HIDPortGet(&hwsettings_usb_hidport);
|
||||
|
||||
/* Make sure we have at least one telemetry link over USB */
|
||||
if (hwsettings_usb_vcpport != HWSETTINGS_USB_VCPPORT_USBTELEMETRY) {
|
||||
hwsettings_usb_hidport = HWSETTINGS_USB_HIDPORT_USBTELEMETRY;
|
||||
}
|
||||
|
||||
switch (hwsettings_usb_hidport) {
|
||||
case HWSETTINGS_USB_HIDPORT_DISABLED:
|
||||
break;
|
||||
|
@ -310,7 +310,7 @@ static void telemetryRxTask(void *parameters)
|
||||
while (1) {
|
||||
#if defined(PIOS_INCLUDE_USB_HID)
|
||||
// Determine input port (USB takes priority over telemetry port)
|
||||
if (PIOS_USB_HID_CheckAvailable(0)) {
|
||||
if (PIOS_USB_HID_CheckAvailable(0) && PIOS_COM_TELEM_USB) {
|
||||
inputPort = PIOS_COM_TELEM_USB;
|
||||
} else
|
||||
#endif /* PIOS_INCLUDE_USB_HID */
|
||||
@ -348,7 +348,7 @@ static int32_t transmitData(uint8_t * data, int32_t length)
|
||||
|
||||
// Determine input port (USB takes priority over telemetry port)
|
||||
#if defined(PIOS_INCLUDE_USB_HID)
|
||||
if (PIOS_USB_HID_CheckAvailable(0)) {
|
||||
if (PIOS_USB_HID_CheckAvailable(0) && PIOS_COM_TELEM_USB) {
|
||||
outputPort = PIOS_COM_TELEM_USB;
|
||||
} else
|
||||
#endif /* PIOS_INCLUDE_USB_HID */
|
||||
|
@ -81,6 +81,11 @@ void ConfigCCHWWidget::widgetsContentsChanged()
|
||||
enableControls(false);
|
||||
m_telemetry->problems->setText(tr("Warning: you have configured both USB HID Port and USB VCP Port for the same function, this currently is not supported"));
|
||||
}
|
||||
else if ((m_telemetry->cbUsbHid->currentIndex() != HwSettings::USB_HIDPORT_USBTELEMETRY) && (m_telemetry->cbUsbVcp->currentIndex() != HwSettings::USB_VCPPORT_USBTELEMETRY))
|
||||
{
|
||||
enableControls(false);
|
||||
m_telemetry->problems->setText(tr("Warning: you have disabled USB Telemetry on both USB HID Port and USB VCP Port, this currently is not supported"));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_telemetry->problems->setText("");
|
||||
|
Loading…
Reference in New Issue
Block a user