From f206fcb57ea4bc93a6d2590d878837857ce5e848 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Fri, 16 Jan 2015 19:12:17 +0100 Subject: [PATCH] [stm32] desig: high nibble to hex char first When converting the uniqute id to a hex string, it seems more sensible to put the higher nibble in the string before the lower nibble. --- lib/stm32/desig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/stm32/desig.c b/lib/stm32/desig.c index b610e665..b1511d16 100644 --- a/lib/stm32/desig.c +++ b/lib/stm32/desig.c @@ -45,8 +45,8 @@ void desig_get_unique_id_as_string(char *string, 2 * sizeof(device_id) : string_len - 1; for (i = 0; i < len; i += 2) { - string[i] = chars[(device_id[i / 2] >> 0) & 0x0F]; - string[i + 1] = chars[(device_id[i / 2] >> 4) & 0x0F]; + string[i] = chars[(device_id[i / 2] >> 4) & 0x0F]; + string[i + 1] = chars[(device_id[i / 2] >> 0) & 0x0F]; } string[len] = '\0';