From 2880bb185f367d1aca18a2ae9c3897010f57499e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 3 Jan 2017 13:25:33 +0100 Subject: [PATCH] uavcan_main: replace std::array with a C array Sadly, we cannot use std::array on NuttX --- src/modules/uavcan/uavcan_main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/uavcan/uavcan_main.cpp b/src/modules/uavcan/uavcan_main.cpp index 84a5b25760..926e7e285f 100644 --- a/src/modules/uavcan/uavcan_main.cpp +++ b/src/modules/uavcan/uavcan_main.cpp @@ -45,7 +45,6 @@ #include #include -#include #include #include #include @@ -1258,13 +1257,13 @@ UavcanNode::print_info() // Printing all nodes that are online std::printf("Online nodes (Node ID, Health, Mode):\n"); _node_status_monitor.forEachNode([](uavcan::NodeID nid, uavcan::NodeStatusMonitor::NodeStatus ns) { - static constexpr std::array HEALTH = { + static constexpr const char* HEALTH[] = { "OK", "WARN", "ERR", "CRIT" }; - static constexpr std::array MODES = { + static constexpr const char* MODES[] = { "OPERAT", "INIT", "MAINT", "SW_UPD", "?", "?", "?", "OFFLN" }; - std::printf("\t% 3d %-10s %-10s\n", int(nid.get()), HEALTH.at(ns.health), MODES.at(ns.mode)); + std::printf("\t% 3d %-10s %-10s\n", int(nid.get()), HEALTH[ns.health], MODES[ns.mode]); }); (void)pthread_mutex_unlock(&_node_mutex);