-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.c
117 lines (94 loc) · 4.22 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/****************************************************************************
* Copyright 2023 Gorgon Meducer (Email:[email protected]) *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
****************************************************************************/
/*============================ INCLUDES ======================================*/
#include <stdio.h>
#include "Virtual_TFT_Port.h"
#include "arm_2d_helper.h"
#include "arm_2d_scenes.h"
#include "arm_2d_disp_adapters.h"
#ifdef RTE_Acceleration_Arm_2D_Extra_Benchmark
# include "arm_2d_benchmark.h"
#endif
#include "genshin_clock/arm_2d_scene_genshin_clock.h"
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wunknown-warning-option"
# pragma clang diagnostic ignored "-Wreserved-identifier"
# pragma clang diagnostic ignored "-Wsign-conversion"
# pragma clang diagnostic ignored "-Wpadded"
# pragma clang diagnostic ignored "-Wcast-qual"
# pragma clang diagnostic ignored "-Wcast-align"
# pragma clang diagnostic ignored "-Wmissing-field-initializers"
# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
# pragma clang diagnostic ignored "-Wmissing-prototypes"
# pragma clang diagnostic ignored "-Wunused-variable"
# pragma clang diagnostic ignored "-Wunused-parameter"
# pragma clang diagnostic ignored "-Wgnu-statement-expression"
#elif __IS_COMPILER_ARM_COMPILER_5__
#elif __IS_COMPILER_GCC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wformat="
# pragma GCC diagnostic ignored "-Wpedantic"
#endif
/*============================ MACROS ========================================*/
/*============================ MACROFIED FUNCTIONS ===========================*/
/*============================ TYPES =========================================*/
/*============================ GLOBAL VARIABLES ==============================*/
/*============================ PROTOTYPES ====================================*/
/*============================ LOCAL VARIABLES ===============================*/
/*============================ IMPLEMENTATION ================================*/
/*----------------------------------------------------------------------------
Main function
*----------------------------------------------------------------------------*/
int app_2d_main_thread (void *argument)
{
#ifdef RTE_Acceleration_Arm_2D_Extra_Benchmark
arm_2d_run_benchmark();
#else
arm_2d_scene_genshin_clock_init(&DISP0_ADAPTER);
arm_2d_scene_player_set_switching_mode( &DISP0_ADAPTER,
ARM_2D_SCENE_SWITCH_MODE_FADE_WHITE);
arm_2d_scene_player_set_switching_period(&DISP0_ADAPTER, 3000);
arm_2d_scene_player_switch_to_next_scene(&DISP0_ADAPTER);
#endif
while (1) {
if (arm_fsm_rt_cpl == disp_adapter0_task()) {
VT_sdl_flush(1);
}
}
return 0;
}
int main(int argc, char* argv[])
{
VT_init();
arm_irq_safe {
arm_2d_init();
}
disp_adapter0_init();
SDL_CreateThread(app_2d_main_thread, "arm-2d thread", NULL);
while (1) {
VT_sdl_refresh_task();
if(VT_is_request_quit()){
break;
}
}
VT_deinit();
return 0;
}
#if defined(__clang__)
# pragma clang diagnostic pop
#endif