From 4780353cd80408f3307de0e801b42d021bc93e43 Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Wed, 1 Apr 2015 18:16:38 -0700 Subject: [PATCH] ms5611_i2c: don't create with nullptr for devname I have not been able to unravel why nullptr is passed as the device path to the constructor of ms5611_i2c. This crashes the VDev code as it expects to create a virtual driver with the device path passed as devname. It causes VDev to do a strncmp with null. Using /vdev/ms5611_i2c as the name for the now. Signed-off-by: Mark Charlebois --- src/drivers/ms5611/ms5611_i2c.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/drivers/ms5611/ms5611_i2c.cpp b/src/drivers/ms5611/ms5611_i2c.cpp index dd67bc5d13..257e42a2de 100644 --- a/src/drivers/ms5611/ms5611_i2c.cpp +++ b/src/drivers/ms5611/ms5611_i2c.cpp @@ -116,9 +116,11 @@ MS5611_i2c_interface(ms5611::prom_u &prom_buf, uint8_t busnum) } MS5611_I2C::MS5611_I2C(uint8_t bus, ms5611::prom_u &prom) : - I2C("MS5611_I2C", nullptr, bus, 0 + I2C("MS5611_I2C", #ifdef __PX4_NUTTX -, 400000 +nullptr, bus, 0, 400000 +#else +"/vdev/MS5611_I2C", bus, 0 #endif ), _prom(prom)