mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2026-03-26 15:16:12 +01:00
reduce display update rate
This commit is contained in:
parent
52d41dd9f6
commit
c96a0310ae
|
|
@ -24,6 +24,8 @@ void Display::setup(std::shared_ptr<BoardConfig> boardConfig) {
|
|||
_disp->display(&bitmap);
|
||||
_displayTimeout.setTimeout(10);
|
||||
_frameTimeout.setTimeout(15);
|
||||
_displayUpdateRate.setTimeout(1);
|
||||
_displayUpdateRate.start();
|
||||
}
|
||||
|
||||
void Display::turn180() {
|
||||
|
|
@ -39,41 +41,44 @@ void Display::setDisplayTimeout(time_t timeout) {
|
|||
}
|
||||
|
||||
void Display::update() {
|
||||
if (_frameTimeout.check()) {
|
||||
if (_statusFrame->isPrio()) {
|
||||
Bitmap bitmap(_disp.get());
|
||||
_statusFrame->drawStatusPage(bitmap);
|
||||
activateDisplay();
|
||||
_disp->display(&bitmap);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_frames.size() > 0) {
|
||||
std::shared_ptr<DisplayFrame> frame = *_frames.begin();
|
||||
Bitmap bitmap(_disp.get());
|
||||
frame->drawStatusPage(bitmap);
|
||||
activateDisplay();
|
||||
_disp->display(&bitmap);
|
||||
_frames.pop_front();
|
||||
_frameTimeout.start();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_displayOff && !_displayTimeout.isActive()) {
|
||||
Bitmap bitmap(_disp.get());
|
||||
_statusFrame->drawStatusPage(bitmap);
|
||||
activateDisplay();
|
||||
_disp->display(&bitmap);
|
||||
if (_displaySaveMode) {
|
||||
_displayTimeout.start();
|
||||
if (_displayUpdateRate.check()) {
|
||||
if (_frameTimeout.check()) {
|
||||
if (_statusFrame->isPrio()) {
|
||||
Bitmap bitmap(_disp.get());
|
||||
_statusFrame->drawStatusPage(bitmap);
|
||||
activateDisplay();
|
||||
_disp->display(&bitmap);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_frames.size() > 0) {
|
||||
std::shared_ptr<DisplayFrame> frame = *_frames.begin();
|
||||
Bitmap bitmap(_disp.get());
|
||||
frame->drawStatusPage(bitmap);
|
||||
activateDisplay();
|
||||
_disp->display(&bitmap);
|
||||
_frames.pop_front();
|
||||
_frameTimeout.start();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_displayOff && !_displayTimeout.isActive()) {
|
||||
Bitmap bitmap(_disp.get());
|
||||
_statusFrame->drawStatusPage(bitmap);
|
||||
activateDisplay();
|
||||
_disp->display(&bitmap);
|
||||
if (_displaySaveMode) {
|
||||
_displayTimeout.start();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (_displayTimeout.check()) {
|
||||
deactivateDisplay();
|
||||
_displayTimeout.reset();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (_displayTimeout.check()) {
|
||||
deactivateDisplay();
|
||||
_displayTimeout.reset();
|
||||
}
|
||||
}
|
||||
_displayUpdateRate.start();
|
||||
};
|
||||
}
|
||||
|
||||
void Display::addFrame(std::shared_ptr<DisplayFrame> frame) {
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ private:
|
|||
bool _displayOff;
|
||||
bool _displaySaveMode;
|
||||
|
||||
Timer _displayUpdateRate;
|
||||
|
||||
void activateDisplay();
|
||||
void deactivateDisplay();
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue