Skip to content

Commit d00f658

Browse files
committed
run lvgl single threaded
1 parent 81020d6 commit d00f658

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

simulator/simulator.c

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <jni.h>
99
#include <stdlib.h>
1010

11-
static pthread_t t, t2;
11+
static pthread_t t;
1212
static bool s_simulator_running;
1313
uint8_t s_simulator_keymask;
1414
static JavaVM* s_simulator_jvm;
@@ -41,11 +41,11 @@ __attribute__((unused)) JNIEXPORT void simulator_start(JNIEnv* env, jobject thiz
4141
s_simulator_h = (lv_coord_t)h;
4242
s_simulator_w = (lv_coord_t)w;
4343
droidboot_init();
44+
droidboot_show_boot_logo();
4445
droidboot_show_dualboot_menu();
4546
simulator_stop(env);
4647
s_simulator_running = false;
4748
pthread_join(t, NULL);
48-
pthread_join(t2, NULL);
4949
(*env)->DeleteGlobalRef(env, s_simulator_bitmap);
5050
s_simulator_bitmap = NULL;
5151
__android_log_print(ANDROID_LOG_INFO, "droidboot", "goodbye");
@@ -212,28 +212,9 @@ static void* droidboot_lv_tick_inc_thread(void * arg) {
212212
return 0;
213213
}
214214

215-
//lvgl thread
216-
static void* droidboot_lv_timer_handler_thread(void * arg) {
217-
/*Handle LitlevGL tick*/
218-
JavaVMAttachArgs args;
219-
args.version = JNI_VERSION_1_6;
220-
args.name = "lv_timer_handler_thread";
221-
args.group = NULL;
222-
JNIEnv* env;
223-
(*s_simulator_jvm)->AttachCurrentThread(s_simulator_jvm, &env, &args);
224-
while (s_simulator_running) {
225-
droidboot_internal_delay(1);
226-
lv_timer_handler();
227-
}
228-
if (s_simulator_jvm != NULL)
229-
(*s_simulator_jvm)->DetachCurrentThread(s_simulator_jvm);
230-
return 0;
231-
}
232-
233215
void droidboot_internal_lvgl_threads_init()
234216
{
235217
pthread_create(&t, NULL, droidboot_lv_tick_inc_thread, NULL);
236-
pthread_create(&t2, NULL, droidboot_lv_timer_handler_thread, NULL);
237218
}
238219

239220
void droidboot_internal_platform_on_screen_log(const char *buf)
@@ -296,8 +277,7 @@ bool droidboot_internal_append_ramdisk_to_kernel()
296277
return false;
297278
}
298279

299-
// Nothing to do here, we have threads
300280
void droidboot_internal_platform_tasks()
301281
{
302-
droidboot_internal_delay(200);
282+
droidboot_internal_delay(lv_timer_handler());
303283
}

0 commit comments

Comments
 (0)