AP_MSP: Increase DisplayPort UART TX buffer to prevent OSD corruption

Note: UART RX buffer has been decreased by the same amount to keep the memory footprint constant
This commit is contained in:
yaapu 2022-12-06 22:50:45 +01:00 committed by Andrew Tridgell
parent 6fe732e8bd
commit f15d939823
2 changed files with 13 additions and 0 deletions

View File

@ -41,4 +41,16 @@ MSPCommandResult AP_MSP_Telem_DisplayPort::msp_process_out_fc_variant(sbuf_t *ds
return MSP_RESULT_ACK;
}
bool AP_MSP_Telem_DisplayPort::init_uart()
{
if (_msp_port.uart != nullptr) {
// re-init port here for use in this thread
// displayport needs a bigger tx buffer
// rx buffer can be small for we mostly write
_msp_port.uart->begin(0, 256, 768);
return true;
}
return false;
}
#endif //HAL_WITH_MSP_DISPLAYPORT

View File

@ -26,6 +26,7 @@ class AP_MSP_Telem_DisplayPort : public AP_MSP_Telem_Backend
public:
bool is_scheduler_enabled() const override { return false; }
bool use_msp_thread() const override { return false; }
bool init_uart() override;
AP_SerialManager::SerialProtocol get_serial_protocol() const override { return AP_SerialManager::SerialProtocol::SerialProtocol_MSP_DisplayPort; };
MSP::MSPCommandResult msp_process_out_fc_variant(MSP::sbuf_t *dst) override;