mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 17:03:33 +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:
@@ -150,7 +150,7 @@ ADCSIM::~ADCSIM()
|
||||
int
|
||||
ADCSIM::init()
|
||||
{
|
||||
debug("init done");
|
||||
DEVICE_DEBUG("init done");
|
||||
|
||||
/* create the device node */
|
||||
return VDev::init();
|
||||
|
||||
@@ -250,11 +250,11 @@ int
|
||||
BAROSIM::init()
|
||||
{
|
||||
int ret;
|
||||
debug("BAROSIM::init");
|
||||
DEVICE_DEBUG("BAROSIM::init");
|
||||
|
||||
ret = VDev::init();
|
||||
if (ret != OK) {
|
||||
debug("VDev init failed");
|
||||
DEVICE_DEBUG("VDev init failed");
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ BAROSIM::init()
|
||||
_reports = new ringbuffer::RingBuffer(2, sizeof(baro_report));
|
||||
|
||||
if (_reports == nullptr) {
|
||||
debug("can't get memory for reports");
|
||||
DEVICE_DEBUG("can't get memory for reports");
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
@@ -576,7 +576,7 @@ BAROSIM::cycle()
|
||||
/* measurement phase */
|
||||
ret = measure();
|
||||
if (ret != OK) {
|
||||
//log("measure error %d", ret);
|
||||
//DEVICE_LOG("measure error %d", ret);
|
||||
/* issue a reset command to the sensor */
|
||||
_interface->dev_ioctl(IOCTL_RESET, dummy);
|
||||
/* reset the collection state machine and try again */
|
||||
|
||||
@@ -457,7 +457,7 @@ GYROSIM::init()
|
||||
ret = _gyro->init();
|
||||
/* if probe/setup failed, bail now */
|
||||
if (ret != OK) {
|
||||
debug("gyro init failed");
|
||||
DEVICE_DEBUG("gyro init failed");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1175,7 +1175,7 @@ GYROSIM_gyro::init()
|
||||
|
||||
/* if probe/setup failed, bail now */
|
||||
if (ret != OK) {
|
||||
debug("gyro init failed");
|
||||
DEVICE_DEBUG("gyro init failed");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ ToneAlarm::init()
|
||||
if (ret != OK)
|
||||
return ret;
|
||||
|
||||
debug("ready");
|
||||
DEVICE_DEBUG("ready");
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -599,7 +599,7 @@ ToneAlarm::ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
{
|
||||
int result = OK;
|
||||
|
||||
debug("ioctl %i %u", cmd, arg);
|
||||
DEVICE_DEBUG("ioctl %i %lu", cmd, arg);
|
||||
|
||||
// irqstate_t flags = irqsave();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user