Skip to content

Commit c24219d

Browse files
committed
Add support for multithreaded painter
1 parent a8c15ee commit c24219d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

users/drashna/display/painter/painter.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,18 @@ void painter_render_user(void) {
15211521
#endif
15221522
}
15231523

1524+
#ifdef MULTITHREADED_PAINTER_ENABLE
1525+
bool qp_thread_init_user(void) {
1526+
painter_init_user();
1527+
return true;
1528+
}
1529+
1530+
bool qp_thread_task_user(void) {
1531+
painter_render_user();
1532+
return true;
1533+
}
1534+
#endif // MULTITHREADED_PAINTER_ENABLE
1535+
15241536
void housekeeping_task_display_menu_user(void) {
15251537
#ifdef SPLIT_KEYBOARD
15261538
if (!is_keyboard_master()) {
@@ -1544,12 +1556,14 @@ void housekeeping_task_display_menu_user(void) {
15441556
rgb_redraw = true;
15451557
}
15461558
#endif
1559+
#ifndef MULTITHREADED_PAINTER_ENABLE
15471560
static uint32_t last_tick = 0;
15481561
uint32_t now = timer_read32();
15491562
if (TIMER_DIFF_32(now, last_tick) >= (QUANTUM_PAINTER_TASK_THROTTLE)) {
15501563
painter_render_user();
15511564
last_tick = now;
15521565
}
1566+
#endif // !MULTITHREADED_PAINTER_ENABLE
15531567
#if (QUANTUM_PAINTER_DISPLAY_TIMEOUT) > 0
15541568
if (is_keyboard_master() && (last_input_activity_elapsed() > QUANTUM_PAINTER_DISPLAY_TIMEOUT)) {
15551569
qp_backlight_disable();
@@ -1576,7 +1590,9 @@ void keyboard_post_init_quantum_painter(void) {
15761590
gpio_set_pin_output_push_pull(BACKLIGHT_PIN);
15771591
gpio_write_pin_high(BACKLIGHT_PIN);
15781592
#endif
1593+
#ifndef MULTITHREADED_PAINTER_ENABLE
15791594
painter_init_user();
1595+
#endif // !MULTITHREADED_PAINTER_ENABLE
15801596
if (userspace_config.display.painter.left.display_logo >= screensaver_image_size) {
15811597
userspace_config.display.painter.left.display_logo = 0;
15821598
eeconfig_update_user_datablock(&userspace_config, 0, EECONFIG_USER_DATA_SIZE);

0 commit comments

Comments
 (0)