diff --git a/examples/uavcan/uavcan_main.cxx b/examples/uavcan/uavcan_main.cxx index 7181356a0..fb8206416 100644 --- a/examples/uavcan/uavcan_main.cxx +++ b/examples/uavcan/uavcan_main.cxx @@ -39,6 +39,8 @@ #include +#include + #include #include @@ -65,9 +67,17 @@ int main(int argc, FAR char *argv[]) extern "C" int uavcan_main(int argc, FAR char *argv[]) #endif { + int ret; + + ret = boardctl(BOARDIOC_INIT, 0); + if (ret < 0) + { + std::fprintf(stderr, "ERROR: boardctl failed: %d\n", ret); + return EXIT_FAILURE; + } + uavcan::Node node(getCanDriver(), getSystemClock()); - int ret; node.setNodeID(CONFIG_EXAMPLES_UAVCAN_NODE_ID); node.setName(CONFIG_EXAMPLES_UAVCAN_NODE_NAME);