From f24828337f49fa282dc3272659decb69fec16961 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Tue, 6 Oct 2015 23:58:19 -0400 Subject: [PATCH] apps/examples/uavcan: Call boardctl to configure CAN GPIOs --- examples/uavcan/uavcan_main.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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);