only send RDS commands once every 10 seconds or so
This commit is contained in:
parent
4f3d96df82
commit
eaa81a3600
1 changed files with 15 additions and 5 deletions
|
@ -78,6 +78,11 @@ const int updateTimeConstant = 20;
|
||||||
*/
|
*/
|
||||||
const int asyncUpdateFrequency = 10;
|
const int asyncUpdateFrequency = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The delay between two RDS updates (in seconds).
|
||||||
|
*/
|
||||||
|
const int rdsUpdateFrequency = 10;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* =============================================== local function prototypes */
|
/* =============================================== local function prototypes */
|
||||||
|
@ -421,10 +426,6 @@ MasterPanelWindow :: onUpdateTime(int dummy) throw ()
|
||||||
|
|
||||||
// check on the progress of the async methods
|
// check on the progress of the async methods
|
||||||
static int backupCounter = 0;
|
static int backupCounter = 0;
|
||||||
if (backupCounter++ == updateTimeConstant * asyncUpdateFrequency) {
|
|
||||||
backupCounter = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (backupCounter == 0) {
|
if (backupCounter == 0) {
|
||||||
if (optionsWindow) {
|
if (optionsWindow) {
|
||||||
BackupList * backupList = optionsWindow->getBackupList();
|
BackupList * backupList = optionsWindow->getBackupList();
|
||||||
|
@ -437,12 +438,21 @@ MasterPanelWindow :: onUpdateTime(int dummy) throw ()
|
||||||
searchWindow->onTimer();
|
searchWindow->onTimer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (++backupCounter == updateTimeConstant * asyncUpdateFrequency) {
|
||||||
|
backupCounter = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// refresh all windows
|
// refresh all windows
|
||||||
gLiveSupport->runMainLoop();
|
gLiveSupport->runMainLoop();
|
||||||
|
|
||||||
// refresh the RDS display
|
// refresh the RDS display
|
||||||
gLiveSupport->updateRds();
|
static int rdsCounter = 0;
|
||||||
|
if (rdsCounter == 0) {
|
||||||
|
gLiveSupport->updateRds();
|
||||||
|
}
|
||||||
|
if (++rdsCounter == updateTimeConstant * rdsUpdateFrequency) {
|
||||||
|
rdsCounter = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue