|
|
|
@ -253,7 +253,7 @@ bool SLCAN::CANIface::init_passthrough(uint8_t i)
@@ -253,7 +253,7 @@ bool SLCAN::CANIface::init_passthrough(uint8_t i)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_can_iface = hal.can[i]; |
|
|
|
|
_drv_num = _slcan_can_port - 1; |
|
|
|
|
_iface_num = _slcan_can_port - 1; |
|
|
|
|
_prev_ser_port = -1; |
|
|
|
|
AP::can().log_text(AP_CANManager::LOG_INFO, LOG_TAG, "Setting SLCAN Passthrough for CAN%d\n", _slcan_can_port - 1); |
|
|
|
|
return true; |
|
|
|
@ -470,11 +470,13 @@ void SLCAN::CANIface::update_slcan_port()
@@ -470,11 +470,13 @@ void SLCAN::CANIface::update_slcan_port()
|
|
|
|
|
// 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 (_port == nullptr) { |
|
|
|
|
_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) { |
|
|
|
@ -491,7 +493,7 @@ void SLCAN::CANIface::update_slcan_port()
@@ -491,7 +493,7 @@ void SLCAN::CANIface::update_slcan_port()
|
|
|
|
|
} |
|
|
|
|
_port->lock_port(_serial_lock_key, _serial_lock_key); |
|
|
|
|
_prev_ser_port = _slcan_ser_port; |
|
|
|
|
gcs().send_text(MAV_SEVERITY_INFO, "CANManager: Starting SLCAN Passthrough on Serial %d with CAN%d", _slcan_ser_port.get(), _drv_num); |
|
|
|
|
gcs().send_text(MAV_SEVERITY_INFO, "CANManager: Starting SLCAN Passthrough on Serial %d with CAN%d", _slcan_ser_port.get(), _iface_num); |
|
|
|
|
_last_had_activity = AP_HAL::native_millis(); |
|
|
|
|
} |
|
|
|
|
if (_port == nullptr) { |
|
|
|
|