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:
Mark Charlebois
2015-08-11 12:07:06 -07:00
parent be58c6abd3
commit a589d15c52
47 changed files with 202 additions and 261 deletions
+5 -5
View File
@@ -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;
}