fixed screen (first line) issue when in the interactive mode (#116)

This commit is contained in:
VasiliyTurchenko 2021-03-08 11:34:56 +03:00 committed by GitHub
parent db53a09dbf
commit 9c2531a98d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -137,6 +137,7 @@ void interactiveNoConnection(void) {
void interactiveShowData(void) { void interactiveShowData(void) {
struct aircraft *a = Modes.aircrafts; struct aircraft *a = Modes.aircrafts;
static uint64_t next_update; static uint64_t next_update;
static bool need_clear = true;
uint64_t now = mstime(); uint64_t now = mstime();
char progress; char progress;
char spinner[4] = "|/-\\"; char spinner[4] = "|/-\\";
@ -149,6 +150,10 @@ void interactiveShowData(void) {
if (!Modes.interactive) if (!Modes.interactive)
return; return;
if (need_clear) {
clear();
need_clear = false;
}
// Refresh screen every (MODES_INTERACTIVE_REFRESH_TIME) miliseconde // Refresh screen every (MODES_INTERACTIVE_REFRESH_TIME) miliseconde
if (now < next_update) if (now < next_update)
return; return;