Browse Source

sdp3x: stop continuous measurement while reconfig

master
Igor Mišić 4 years ago committed by Beat Küng
parent
commit
92696b589f
  1. 7
      src/drivers/differential_pressure/sdp3x/SDP3X.cpp
  2. 1
      src/drivers/differential_pressure/sdp3x/SDP3X.hpp

7
src/drivers/differential_pressure/sdp3x/SDP3X.cpp

@ -72,7 +72,12 @@ SDP3X::init_sdp3x()
int int
SDP3X::configure() SDP3X::configure()
{ {
int ret = write_command(SDP3X_CONT_MEAS_AVG_MODE); int ret = write_command(SDP3X_CONT_MODE_STOP);
if (ret == PX4_OK) {
px4_udelay(500); // SDP3X is unresponsive for 500us after stop continuous measurement command
ret = write_command(SDP3X_CONT_MEAS_AVG_MODE);
}
if (ret != PX4_OK) { if (ret != PX4_OK) {
perf_count(_comms_errors); perf_count(_comms_errors);

1
src/drivers/differential_pressure/sdp3x/SDP3X.hpp

@ -56,6 +56,7 @@
#define SDP3X_RESET_ADDR 0x00 #define SDP3X_RESET_ADDR 0x00
#define SDP3X_RESET_CMD 0x06 #define SDP3X_RESET_CMD 0x06
#define SDP3X_CONT_MEAS_AVG_MODE 0x3615 #define SDP3X_CONT_MEAS_AVG_MODE 0x3615
#define SDP3X_CONT_MODE_STOP 0x3FF9
#define SDP3X_SCALE_PRESSURE_SDP31 60 #define SDP3X_SCALE_PRESSURE_SDP31 60
#define SDP3X_SCALE_PRESSURE_SDP32 240 #define SDP3X_SCALE_PRESSURE_SDP32 240

Loading…
Cancel
Save