ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.19k stars 16.77k forks source link

Sub: Add support for TSYS01 on pixhawk 2 #9800

Closed patrickelectric closed 4 years ago

patrickelectric commented 5 years ago

Moved from: bluerobotics/ardusub#97 Original author: @jaxxzer

Feature request

The bus is hard coded, it needs to be determined at run time.

Platform [ ] All [ ] AntennaTracker [ ] Copter [ ] Plane [ ] Rover [x] Submarine

jaxxzer commented 4 years ago

The problem is the i2c bus to scan/probe is hardcoded to 1 here: https://github.com/ArduPilot/ardupilot/blob/cd5c59773bb5d4d4cdd4ba77437b3ede40ff8662/libraries/AP_TemperatureSensor/TSYS01.cpp#L18

We can update init() with a bus number parameter, and configure the bus according to the hardware, similar to how we select GND_EXT_BUS in system.cpp.

attention @Williangalvani

jaxxzer commented 4 years ago

https://github.com/ArduPilot/ardupilot/blob/master/ArduSub/system.cpp#L41