Compare commits

6 Commits

Author SHA1 Message Date
Johannes Marbach
c683350b9f Add changelog for !31 2024-10-05 20:37:34 +02:00
Johannes Marbach
2d9a96f646 Merge branch 'pr-os-sleep' into 'master'
use OS sleep instead of polling to reduce CPU usage

See merge request postmarketOS/buffybox!31
2024-10-05 18:34:02 +00:00
Johannes Marbach
026c1b6f3b Add changelog for sudo systemctl start mount-gdrive 2024-10-05 20:25:37 +02:00
Johannes Marbach
8a231905a4 Merge branch 'pr-scdoc-cross' into 'master'
specify scdoc as a native dependency instead of a runtime dependency

See merge request postmarketOS/buffybox!30
2024-10-05 18:23:39 +00:00
1551aabbc0 specify scdoc as a native dependency instead of a runtime dependency 2024-10-05 13:07:30 +00:00
a036d1e9a1 use OS sleep instead of polling to reduce CPU usage
without this lvgl never releases the CPU, and just pegs one of the cores
to 100%. see
<https://github.com/lvgl/lvgl/blob/master/docs/porting/timer_handler.rst>
2024-10-05 13:03:02 +00:00
4 changed files with 7 additions and 3 deletions

View File

@@ -15,6 +15,8 @@ If a change only affects particular applications, they are listed in parentheses
- misc: Unify build system (!23 & !29, thanks @Jarrah & @vladimir.stoyakin)
- misc: Ensure stable file order during builds (!24, thanks @devrtz)
- fix: Prevent logging internal LVGL errors to stdout
- misc: Make scdoc a native dependency to enable cross-compilation (!30, thanks @uninsane)
- fix: Use usleep to release CPU when possible (!31, thanks @uninsane)
## 3.2.0 (2024-06-03)

View File

@@ -284,7 +284,8 @@ int main(int argc, char *argv[]) {
/* Periodically run timer / task handler */
while(1) {
lv_timer_periodic_handler();
uint32_t time_till_next = lv_timer_handler();
usleep(time_till_next * 1000);
}
return 0;

View File

@@ -11,7 +11,7 @@ deplibinput = dependency('libinput')
deplibudev = dependency('libudev')
if get_option('man')
depscdoc = dependency('scdoc')
depscdoc = dependency('scdoc', native: true)
endif
common_include_dirs = include_directories('.')

View File

@@ -591,7 +591,8 @@ int main(int argc, char *argv[]) {
uint32_t timeout = conf_opts.general.timeout * 1000; /* ms */
while(1) {
if (!timeout || lv_disp_get_inactive_time(NULL) < timeout) {
lv_timer_periodic_handler();
uint32_t time_till_next = lv_timer_handler();
usleep(time_till_next * 1000);
} else if (timeout) {
shutdown();
}