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)); 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) if (!newRefreshRate)
return; return;
@@ -449,13 +449,12 @@ void ModuleSyncStatus::getRefreshString(char * statusText)
char * tmp = statusText; char * tmp = statusText;
#if defined(DEBUG) #if defined(DEBUG)
*tmp++ = 'L'; *tmp++ = 'L';
tmp = strAppendUnsigned(tmp, inputLag, 5); tmp = strAppendSigned(tmp, inputLag, 5);
tmp = strAppend(tmp, "us R "); tmp = strAppend(tmp, "R");
tmp = strAppendUnsigned(tmp, (uint32_t) (refreshRate / 1000), 5); tmp = strAppendUnsigned(tmp, refreshRate, 5);
tmp = strAppend(tmp, "us");
#else #else
tmp = strAppend(tmp, "Sync at "); tmp = strAppend(tmp, "Sync ");
tmp = strAppendUnsigned(tmp, (uint32_t) (refreshRate / 1000000)); tmp = strAppendUnsigned(tmp, refreshRate);
tmp = strAppend(tmp, " ms");
#endif #endif
tmp = strAppend(tmp, "us");
} }
+1 -1
View File
@@ -306,7 +306,7 @@ struct ModuleSyncStatus
} }
// Set feedback from RF module // 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 // Get computed settings for scheduler
uint16_t getAdjustedRefreshRate(); uint16_t getAdjustedRefreshRate();