mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-26 18:48:30 -04:00
AP_SerialManager: added set_protocol_and_baud()
used by AP_Periph for rangefinders
This commit is contained in:
parent
529f7a4416
commit
2708c99bfb
@ -614,6 +614,15 @@ void AP_SerialManager::disable_passthru(void)
|
||||
passthru_port2.set_and_notify(-1);
|
||||
}
|
||||
|
||||
// accessor for AP_Periph to set baudrate and type
|
||||
void AP_SerialManager::set_protocol_and_baud(uint8_t sernum, enum SerialProtocol protocol, uint32_t baudrate)
|
||||
{
|
||||
if (sernum <= ARRAY_SIZE(state)) {
|
||||
state[sernum].protocol.set(protocol);
|
||||
state[sernum].baud.set(baudrate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace AP {
|
||||
|
||||
|
@ -157,6 +157,9 @@ public:
|
||||
// get Serial Port
|
||||
AP_HAL::UARTDriver *get_serial_by_id(uint8_t id);
|
||||
|
||||
// accessors for AP_Periph to set baudrate and type
|
||||
void set_protocol_and_baud(uint8_t sernum, enum SerialProtocol protocol, uint32_t baudrate);
|
||||
|
||||
// parameter var table
|
||||
static const struct AP_Param::GroupInfo var_info[];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user