1 /*
2 * Copyright (c) 2021 Bestechnic (Shanghai) Co., Ltd. All rights reserved.
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 #include "cmsis_os2.h"
16 #include "ohos_init.h"
17 #include "log.h"
18 #ifdef FS_TEST
19 #include "fs_test.h"
20 #endif
21
DemoSdkTask(void * arg)22 static void DemoSdkTask(void *arg)
23 {
24 (void)arg;
25 #ifdef FS_TEST
26 fs_test();
27 #endif
28 }
29
DemoSdkMain(void)30 void DemoSdkMain(void)
31 {
32 HILOG_INFO(HILOG_MODULE_APP, "HILOG_INFO %s\r\n", __func__);
33 osThreadAttr_t attr = {0};
34 attr.stack_size = 4096;
35 attr.priority = osPriorityNormal;
36 attr.name = "DemoSdk";
37 if (osThreadNew((osThreadFunc_t)DemoSdkTask, NULL, &attr) == NULL) {
38 HILOG_ERROR(HILOG_MODULE_APP, "Failed to create DemoSdkTask\r\n");
39 }
40 }
41
42 APP_FEATURE_INIT(DemoSdkMain);
43