mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 01:13: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:
@@ -233,13 +233,13 @@ ADC::init()
|
||||
|
||||
/* don't wait for more than 500us, since that means something broke - should reset here if we see this */
|
||||
if ((hrt_absolute_time() - now) > 500) {
|
||||
log("sample timeout");
|
||||
DEVICE_LOG("sample timeout");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
debug("init done");
|
||||
DEVICE_DEBUG("init done");
|
||||
|
||||
/* create the device node */
|
||||
return CDev::init();
|
||||
@@ -356,7 +356,7 @@ ADC::_sample(unsigned channel)
|
||||
|
||||
/* don't wait for more than 50us, since that means something broke - should reset here if we see this */
|
||||
if ((hrt_absolute_time() - now) > 50) {
|
||||
log("sample timeout");
|
||||
DEVICE_LOG("sample timeout");
|
||||
return 0xffff;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user