mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 13:31:35 +08:00
Refactored debug() and log() in CDev
These functions used vprintf which is not available on all platforms. They also do not enable line and file debug output. Changed to macros that preserve the output format. Uses new macro that can be used to implement per object, runtime selectable logging Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -606,7 +606,7 @@ MPU6000::init()
|
||||
|
||||
/* if probe/setup failed, bail now */
|
||||
if (ret != OK) {
|
||||
debug("SPI setup failed");
|
||||
DEVICE_DEBUG("SPI setup failed");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -642,7 +642,7 @@ MPU6000::init()
|
||||
ret = _gyro->init();
|
||||
/* if probe/setup failed, bail now */
|
||||
if (ret != OK) {
|
||||
debug("gyro init failed");
|
||||
DEVICE_DEBUG("gyro init failed");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -773,12 +773,12 @@ MPU6000::probe()
|
||||
case MPU6000_REV_D8:
|
||||
case MPU6000_REV_D9:
|
||||
case MPU6000_REV_D10:
|
||||
debug("ID 0x%02x", _product);
|
||||
DEVICE_DEBUG("ID 0x%02x", _product);
|
||||
_checked_values[0] = _product;
|
||||
return OK;
|
||||
}
|
||||
|
||||
debug("unexpected ID 0x%02x", _product);
|
||||
DEVICE_DEBUG("unexpected ID 0x%02x", _product);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@@ -1873,7 +1873,7 @@ MPU6000_gyro::init()
|
||||
|
||||
/* if probe/setup failed, bail now */
|
||||
if (ret != OK) {
|
||||
debug("gyro init failed");
|
||||
DEVICE_DEBUG("gyro init failed");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user