mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-05 07:28:29 -04:00
AP_SerialManager: ensure users can't break SERIAL0_PROTOCOL
this prevents users from setting SERIAL0_PROTOCOL to something that prevents them accessing the board. This can happen when users are trying to setup SLCAN
This commit is contained in:
parent
eb452478ac
commit
da2f60ae95
@ -355,6 +355,18 @@ void AP_SerialManager::init()
|
|||||||
state[7].uart = hal.uartH; // serial7
|
state[7].uart = hal.uartH; // serial7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAL_OTG1_CONFIG
|
||||||
|
/*
|
||||||
|
prevent users from changing USB protocol to other than
|
||||||
|
MAVLink. This fixes an issue where users trying to get SLCAN
|
||||||
|
change SERIAL0_PROTOCOL to 22 and find they can no longer connect
|
||||||
|
*/
|
||||||
|
if (state[0].protocol != SerialProtocol_MAVLink &&
|
||||||
|
state[0].protocol != SerialProtocol_MAVLink2) {
|
||||||
|
state[0].protocol.set(SerialProtocol_MAVLink2);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SERIALMANAGER_NUM_PORTS > 0
|
#if SERIALMANAGER_NUM_PORTS > 0
|
||||||
if (state[0].uart == nullptr) {
|
if (state[0].uart == nullptr) {
|
||||||
init_console();
|
init_console();
|
||||||
|
Loading…
Reference in New Issue
Block a user