examples/uavcan: Call up_cxxinitialize
This commit is contained in:
parent
75f745ba74
commit
79023fe026
@ -42,14 +42,16 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include <nuttx/arch.h>
|
||||||
|
|
||||||
#include <uavcan/uavcan.hpp>
|
#include <uavcan/uavcan.hpp>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
uavcan::ICanDriver& getCanDriver();
|
extern uavcan::ICanDriver &getCanDriver(void);
|
||||||
uavcan::ISystemClock& getSystemClock();
|
extern uavcan::ISystemClock &getSystemClock(void);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@ -65,14 +67,15 @@ int main(int argc, FAR char *argv[])
|
|||||||
extern "C" int uavcan_main(int argc, FAR char *argv[])
|
extern "C" int uavcan_main(int argc, FAR char *argv[])
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
uavcan::Node<CONFIG_EXAMPLES_UAVCAN_NODE_MEM_POOL_SIZE>
|
up_cxxinitialize();
|
||||||
|
|
||||||
|
static uavcan::Node<CONFIG_EXAMPLES_UAVCAN_NODE_MEM_POOL_SIZE>
|
||||||
node(getCanDriver(), getSystemClock());
|
node(getCanDriver(), getSystemClock());
|
||||||
int ret;
|
|
||||||
|
|
||||||
node.setNodeID(CONFIG_EXAMPLES_UAVCAN_NODE_ID);
|
node.setNodeID(CONFIG_EXAMPLES_UAVCAN_NODE_ID);
|
||||||
node.setName(CONFIG_EXAMPLES_UAVCAN_NODE_NAME);
|
node.setName(CONFIG_EXAMPLES_UAVCAN_NODE_NAME);
|
||||||
|
|
||||||
ret = node.start();
|
int ret = node.start();
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
std::fprintf(stderr, "ERROR: node.start failed: %d\n", ret);
|
std::fprintf(stderr, "ERROR: node.start failed: %d\n", ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user