AP_Periph: check for null uart in msp

This commit is contained in:
Andrew Tridgell 2021-01-01 13:26:51 +11:00
parent e260c7ad59
commit 19e597ec3f

View File

@ -9,9 +9,11 @@
void AP_Periph_FW::msp_init(AP_HAL::UARTDriver *_uart)
{
msp.port.uart = _uart;
msp.port.msp_version = MSP::MSP_V2_NATIVE;
_uart->begin(115200, 512, 512);
if (_uart) {
msp.port.uart = _uart;
msp.port.msp_version = MSP::MSP_V2_NATIVE;
_uart->begin(115200, 512, 512);
}
}