mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 09:13:33 +08:00
distance_sensors: Fix assignment of serial bus ID
This commit is contained in:
committed by
Daniel Agar
parent
01462ce627
commit
a09e13631c
@@ -50,7 +50,7 @@ TFMINI::TFMINI(const char *port, uint8_t rotation) :
|
||||
device_id.devid_s.devtype = DRV_DIST_DEVTYPE_TFMINI;
|
||||
device_id.devid_s.bus_type = device::Device::DeviceBusType_SERIAL;
|
||||
|
||||
uint8_t bus_num = atoi(&_port[sizeof(_port) - 2]);
|
||||
uint8_t bus_num = atoi(&_port[strlen(_port) - 1]); // Assuming '/dev/ttySx'
|
||||
|
||||
if (bus_num < 10) {
|
||||
device_id.devid_s.bus = bus_num;
|
||||
|
||||
Reference in New Issue
Block a user