STM32 example: cleaner node initialization

This commit is contained in:
Pavel Kirienko
2015-10-09 01:53:53 +03:00
parent 47da7f17df
commit 67ee9d567f
@@ -92,22 +92,12 @@ public:
configureNodeInfo();
/*
* Initializing the UAVCAN node - this may take a while
* Initializing the UAVCAN node
*/
while (true)
const int node_init_res = getNode().start();
if (node_init_res < 0)
{
// Calling start() multiple times is OK - only the first successfull call will be effective
int res = getNode().start();
if (res < 0)
{
lowsyslog("Node initialization failure: %i, will try agin soon\n", res);
}
else
{
break;
}
::sleep(3);
board::die(node_init_res);
}
/*