mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 20:28:37 +08:00
sdp3x: remove reset during init
It is not playing nice with other devices on the same bus. In particular with the FreeFly RTK GPS: once the reset is sent, the whole bus is blocked and becomes unusable. Current understanding is that this device contains another chip on the bus (apart from the mag+baro+led). I don't see much use for it either, as we configure everything there is to configure (just the mode).
This commit is contained in:
@@ -66,23 +66,6 @@ int SDP3X::write_command(uint16_t command)
|
|||||||
bool
|
bool
|
||||||
SDP3X::init_sdp3x()
|
SDP3X::init_sdp3x()
|
||||||
{
|
{
|
||||||
if (get_device_address() == I2C_ADDRESS_1_SDP3X) { // since we are broadcasting, only do it for the first device address
|
|
||||||
// reset on broadcast
|
|
||||||
uint16_t prev_addr = get_device_address();
|
|
||||||
set_device_address(SDP3X_RESET_ADDR);
|
|
||||||
uint8_t reset_cmd = SDP3X_RESET_CMD;
|
|
||||||
int ret = transfer(&reset_cmd, 1, nullptr, 0);
|
|
||||||
set_device_address(prev_addr);
|
|
||||||
|
|
||||||
if (ret != PX4_OK) {
|
|
||||||
perf_count(_comms_errors);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// wait until sensor is ready
|
|
||||||
px4_usleep(20000);
|
|
||||||
}
|
|
||||||
|
|
||||||
return configure() == 0;
|
return configure() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user