Update ModuleSyncStatus::update signature with proper types

Also updates getRefreshString to use the signed types, and display
correctly scaled values.
This commit is contained in:
Bryan Mayland
2021-04-19 22:42:00 +02:00
committed by Raphael Coeffic
parent aa61e1ba19
commit 8a978b5b07
2 changed files with 8 additions and 9 deletions
+7 -8
View File
@@ -398,7 +398,7 @@ ModuleSyncStatus::ModuleSyncStatus()
memset(this, 0, sizeof(ModuleSyncStatus));
}
void ModuleSyncStatus::update(uint16_t newRefreshRate, uint16_t newInputLag)
void ModuleSyncStatus::update(uint16_t newRefreshRate, int16_t newInputLag)
{
if (!newRefreshRate)
return;
@@ -449,13 +449,12 @@ void ModuleSyncStatus::getRefreshString(char * statusText)
char * tmp = statusText;
#if defined(DEBUG)
*tmp++ = 'L';
tmp = strAppendUnsigned(tmp, inputLag, 5);
tmp = strAppend(tmp, "us R ");
tmp = strAppendUnsigned(tmp, (uint32_t) (refreshRate / 1000), 5);
tmp = strAppend(tmp, "us");
tmp = strAppendSigned(tmp, inputLag, 5);
tmp = strAppend(tmp, "R");
tmp = strAppendUnsigned(tmp, refreshRate, 5);
#else
tmp = strAppend(tmp, "Sync at ");
tmp = strAppendUnsigned(tmp, (uint32_t) (refreshRate / 1000000));
tmp = strAppend(tmp, " ms");
tmp = strAppend(tmp, "Sync ");
tmp = strAppendUnsigned(tmp, refreshRate);
#endif
tmp = strAppend(tmp, "us");
}
+1 -1
View File
@@ -306,7 +306,7 @@ struct ModuleSyncStatus
}
// Set feedback from RF module
void update(uint16_t newRefreshRate, uint16_t newInputLag);
void update(uint16_t newRefreshRate, int16_t newInputLag);
// Get computed settings for scheduler
uint16_t getAdjustedRefreshRate();