Skip to content

Commit

Permalink
Update main.c
Browse files Browse the repository at this point in the history
  • Loading branch information
GorgonMeducer committed Dec 28, 2024
1 parent 2dd332f commit 3395311
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions examples/[template][pc][vscode]/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ static demo_scene_t const c_SceneLoaders[] = {
#else
{
.fnLoader =
//scene_ruler_loader,
//scene_filters_loader,
//scene_listview_loader,
//scene_mono_tracking_list_loader
Expand All @@ -443,7 +444,7 @@ static demo_scene_t const c_SceneLoaders[] = {
//scene_compass_loader,
//scene_basics_loader,
//scene_fitness_loader,
scene_user_defined_opcode_loader,
//scene_user_defined_opcode_loader,
//scene_knob_loader,
//scene_panel_loader,
},
Expand Down Expand Up @@ -571,9 +572,7 @@ int app_2d_main_thread (void *argument)
#endif

while(1) {
if (arm_fsm_rt_cpl == disp_adapter0_task()) {
VT_sdl_flush(1);
}
disp_adapter0_task();

if (!s_tDemoCTRL.bIsTimeout) {

Expand Down Expand Up @@ -623,6 +622,10 @@ int app_2d_main_thread (void *argument)
return 0;
}

static bool __lcd_sync_handler(void *pTarget)
{
return VT_sdl_flush(1);
}

int main(int argc, char* argv[])
{
Expand All @@ -636,6 +639,18 @@ int main(int argc, char* argv[])

disp_adapter0_init();

/* register a low level sync-up handler to wait LCD finish rendering the previous frame */
do {
arm_2d_helper_pfb_dependency_t tDependency = {
.evtOnLowLevelSyncUp = {
.fnHandler = &__lcd_sync_handler,
},
};
arm_2d_helper_pfb_update_dependency(&DISP0_ADAPTER.use_as__arm_2d_helper_pfb_t,
ARM_2D_PFB_DEPEND_ON_LOW_LEVEL_SYNC_UP,
&tDependency);
} while(0);

SDL_CreateThread(app_2d_main_thread, "arm-2d thread", NULL);

while (1) {
Expand Down

0 comments on commit 3395311

Please sign in to comment.