From 5c239ffb0b26b8b632a4ed751d641d9d6d616964 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 24 Jan 2017 18:23:43 -1000 Subject: [PATCH] logger uses board_get_uuid_formated32 instead of mcu_unique_id Replace the creation of uuid string with the board common api board_get_uuid_formated32 as opposed to using mcu_unique_id and printf. --- src/modules/logger/logger.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/logger/logger.cpp b/src/modules/logger/logger.cpp index 31b1b6f32f..f55096c7a8 100644 --- a/src/modules/logger/logger.cpp +++ b/src/modules/logger/logger.cpp @@ -31,6 +31,7 @@ * ****************************************************************************/ +#include #include "logger.h" #include "messages.h" @@ -1439,10 +1440,8 @@ void Logger::write_version() param_get(write_uuid_param, &write_uuid); if (write_uuid == 1) { - uint32_t uuid[3]; - mcu_unique_id(uuid); - char uuid_string[sizeof(uint32_t) * 3 * 2 + 1]; - snprintf(uuid_string, sizeof(uuid_string), "%08x%08x%08x", uuid[0], uuid[1], uuid[2]); + char uuid_string[PX4_CPU_UUID_WORD32_LEGACY_FORMAT_SIZE]; + board_get_uuid_formated32(uuid_string, sizeof(uuid_string), "%08X", NULL, &px4_legacy_word32_order); write_info("sys_uuid", uuid_string); } }