From 79023fe026bfc949823e3117f6b5353c5cfe38e1 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Thu, 12 Nov 2015 12:58:21 -0500 Subject: [PATCH] examples/uavcan: Call up_cxxinitialize --- examples/uavcan/uavcan_main.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/uavcan/uavcan_main.cxx b/examples/uavcan/uavcan_main.cxx index 7181356a0..ce559008a 100644 --- a/examples/uavcan/uavcan_main.cxx +++ b/examples/uavcan/uavcan_main.cxx @@ -42,14 +42,16 @@ #include #include +#include + #include /**************************************************************************** * Public Function Prototypes ****************************************************************************/ -uavcan::ICanDriver& getCanDriver(); -uavcan::ISystemClock& getSystemClock(); +extern uavcan::ICanDriver &getCanDriver(void); +extern uavcan::ISystemClock &getSystemClock(void); /**************************************************************************** * Public Functions @@ -65,14 +67,15 @@ int main(int argc, FAR char *argv[]) extern "C" int uavcan_main(int argc, FAR char *argv[]) #endif { - uavcan::Node + up_cxxinitialize(); + + static uavcan::Node node(getCanDriver(), getSystemClock()); - int ret; node.setNodeID(CONFIG_EXAMPLES_UAVCAN_NODE_ID); node.setName(CONFIG_EXAMPLES_UAVCAN_NODE_NAME); - ret = node.start(); + int ret = node.start(); if (ret < 0) { std::fprintf(stderr, "ERROR: node.start failed: %d\n", ret);