mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-08 13:41:28 +00:00
Added "Hops away" on display (#3934)
* Added "Hops away" on display Added in logic that displays "hops away" instead of signal strength when the node is more than 0 hops away. * Added comment * Update extensions.json to same as master * attempt 2 at reverting extensions JSON * Attempt 3 at getting extensions right * Take 4. should be reverting to before my edits --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
parent
9a38a4b024
commit
2233507667
@ -1459,7 +1459,18 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
|
||||
const char *username = node->has_user ? node->user.long_name : "Unknown Name";
|
||||
|
||||
static char signalStr[20];
|
||||
snprintf(signalStr, sizeof(signalStr), "Signal: %d%%", clamp((int)((node->snr + 10) * 5), 0, 100));
|
||||
|
||||
//section here to choose whether to display hops away rather than signal strength if more than 0 hops away.
|
||||
if(node->hops_away>0)
|
||||
{
|
||||
snprintf(signalStr, sizeof(signalStr), "Hops Away: %d", node->hops_away);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(signalStr, sizeof(signalStr), "Signal: %d%%", clamp((int)((node->snr + 10) * 5), 0, 100));
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint32_t agoSecs = sinceLastSeen(node);
|
||||
static char lastStr[20];
|
||||
|
Loading…
Reference in New Issue
Block a user