Skip to content

Commit 7133287

Browse files
authored
Set correct refresh times for lvgl (#488)
1 parent a07b638 commit 7133287

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/displayapp/DisplayApp.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
#include "displayapp/screens/settings/SettingDisplay.h"
4444
#include "displayapp/screens/settings/SettingSteps.h"
4545

46+
#include "libs/lv_conf.h"
47+
4648
using namespace Pinetime::Applications;
4749
using namespace Pinetime::Applications::Display;
4850

@@ -123,10 +125,10 @@ void DisplayApp::Refresh() {
123125
case States::Running:
124126
RunningState();
125127
delta = xTaskGetTickCount() - lastWakeTime;
126-
if (delta > 20) {
127-
delta = 20;
128+
if (delta > LV_DISP_DEF_REFR_PERIOD) {
129+
delta = LV_DISP_DEF_REFR_PERIOD;
128130
}
129-
queueTimeout = 20 - delta;
131+
queueTimeout = LV_DISP_DEF_REFR_PERIOD - delta;
130132
break;
131133
default:
132134
queueTimeout = portMAX_DELAY;

src/libs/lv_conf.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
/* Default display refresh period.
4444
* Can be changed in the display driver (`lv_disp_drv_t`).*/
45-
#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/
45+
#define LV_DISP_DEF_REFR_PERIOD 20 /*[ms]*/
4646

4747
/* Dot Per Inch: used to initialize default sizes.
4848
* E.g. a button with width = LV_DPI / 2 -> half inch wide
@@ -112,7 +112,7 @@ typedef int16_t lv_coord_t;
112112
* Can be changed in the Input device driver (`lv_indev_drv_t`)*/
113113

114114
/* Input device read period in milliseconds */
115-
#define LV_INDEV_DEF_READ_PERIOD 30
115+
#define LV_INDEV_DEF_READ_PERIOD 20
116116

117117
/* Drag threshold in pixels */
118118
#define LV_INDEV_DEF_DRAG_LIMIT 10
@@ -128,7 +128,6 @@ typedef int16_t lv_coord_t;
128128
* Time between `LV_EVENT_LONG_PRESSED_REPEAT */
129129
#define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100
130130

131-
132131
/* Gesture threshold in pixels */
133132
#define LV_INDEV_DEF_GESTURE_LIMIT 50
134133

0 commit comments

Comments
 (0)