1/*
2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#include "hals/gfx_engines.h"
17#include "gfx_utils/common_macros.h"
18#include "gfx_utils/graphic_log.h"
19#include "graphic_performance.h"
20#include "hals/hi_fbdev.h"
21#include "input_manager_service.h"
22#include "samgr_lite.h"
23
24#include "lite_wm.h"
25
26extern "C" void UI_WEAK_SYMBOL HOS_SystemInit(void)
27{
28    SAMGR_Bootstrap();
29}
30
31namespace {
32constexpr uint16_t US_PER_MILLISECOND = 1000;
33constexpr uint16_t WMS_MAIN_TASK_PERIOD_IN_US = OHOS::WMS_MAIN_TASK_PERIOD * US_PER_MILLISECOND;
34}
35
36int main()
37{
38    DEBUG_PERFORMANCE_REGISTER_SIG();
39    OHOS::HiFbdevInit();
40    OHOS::GfxEngines::GetInstance()->InitDriver();
41    HOS_SystemInit();
42    OHOS::InputManagerService::GetInstance()->Run();
43    while (1) {
44        DEBUG_PERFORMANCE_PRINT_RESULT();
45        OHOS::LiteWM::GetInstance()->MainTaskHandler();
46        usleep(WMS_MAIN_TASK_PERIOD_IN_US);
47    }
48}