From 86af578df95f738490f34dafd7833a1a3d88aa30 Mon Sep 17 00:00:00 2001 From: Ben Lipsey <117498748+pdxlocations@users.noreply.github.com> Date: Wed, 26 Jul 2023 16:06:31 -0700 Subject: [PATCH] Preferred units when distance unknown (#2652) * units when distance unknown * replace deleted comment --- src/graphics/Screen.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index d1cc5ad36..b8abec66e 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -835,7 +835,11 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_ } static char distStr[20]; - strncpy(distStr, "? km", sizeof(distStr)); // might not have location data + if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { + strncpy(distStr, "? mi", sizeof(distStr)); // might not have location data + } else { + strncpy(distStr, "? km", sizeof(distStr)); + } meshtastic_NodeInfoLite *ourNode = nodeDB.getMeshNode(nodeDB.getNodeNum()); const char *fields[] = {username, distStr, signalStr, lastStr, NULL}; int16_t compassX = 0, compassY = 0;