AP_CANManager: constant slcan via serial manager protocol param
This commit is contained in:
parent
119462aeb1
commit
8373862f39
@ -465,6 +465,17 @@ inline void SLCAN::CANIface::addByte(const uint8_t byte)
|
||||
|
||||
void SLCAN::CANIface::update_slcan_port()
|
||||
{
|
||||
if (_set_by_sermgr) {
|
||||
// Once we pick SerialManager path we hold on
|
||||
// to that until reboot
|
||||
return;
|
||||
}
|
||||
_port = AP::serialmanager().find_serial(AP_SerialManager::SerialProtocol_SLCAN, 0);
|
||||
if (_port != nullptr) {
|
||||
_port->lock_port(_serial_lock_key, _serial_lock_key);
|
||||
_set_by_sermgr = true;
|
||||
return;
|
||||
}
|
||||
if (_prev_ser_port != _slcan_ser_port) {
|
||||
if (!_slcan_start_req) {
|
||||
_slcan_start_req_time = AP_HAL::native_millis();
|
||||
|
@ -81,7 +81,7 @@ class CANIface: public AP_HAL::CANIface
|
||||
uint32_t _last_had_activity;
|
||||
AP_HAL::CANIface* _can_iface; // Can interface to be used for interaction by SLCAN interface
|
||||
HAL_Semaphore port_sem;
|
||||
|
||||
bool _set_by_sermgr;
|
||||
public:
|
||||
CANIface():
|
||||
rx_queue_(HAL_CAN_RX_QUEUE_SIZE)
|
||||
|
Loading…
Reference in New Issue
Block a user