apps/examples/uavcan: Call boardctl to configure CAN GPIOs

This commit is contained in:
Paul A. Patience 2015-10-06 23:58:19 -04:00
parent 98bca9d69c
commit f24828337f

View File

@ -39,6 +39,8 @@
#include <nuttx/config.h>
#include <sys/boardctl.h>
#include <cstdio>
#include <cstdlib>
@ -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<CONFIG_EXAMPLES_UAVCAN_NODE_MEM_POOL_SIZE>
node(getCanDriver(), getSystemClock());
int ret;
node.setNodeID(CONFIG_EXAMPLES_UAVCAN_NODE_ID);
node.setName(CONFIG_EXAMPLES_UAVCAN_NODE_NAME);