Skip to content

Commit

Permalink
Don't waste time displaying an empty OSD string (betaflight#14152)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveCEvans authored Jan 14, 2025
1 parent 889aa9f commit 2163e44
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/drivers/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ int displayWrite(displayPort_t *instance, uint8_t x, uint8_t y, uint8_t attr, co
{
instance->posX = x + strlen(text);
instance->posY = y;

if (strlen(text) == 0) {
// No point sending a message to do nothing
return 0;
}

return instance->vTable->writeString(instance, x, y, attr, text);
}

Expand Down

0 comments on commit 2163e44

Please sign in to comment.