1 /* 2 * Copyright (c) 2022 ASR Microelectronics (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 19 #define DEMO_TASK_STACK_SIZE 1024 20 DemoSdkTask(void * arg)21static void DemoSdkTask(void *arg) 22 { 23 (void)arg; 24 } 25 DemoSdkMain(void)26void DemoSdkMain(void) 27 { 28 printf("example: %s\r\n", __func__); 29 osThreadAttr_t attr = {0}; 30 attr.stack_size = DEMO_TASK_STACK_SIZE; 31 attr.priority = osPriorityNormal; 32 attr.name = "DemoSdk"; 33 if (osThreadNew((osThreadFunc_t)DemoSdkTask, NULL, &attr) == NULL) { 34 printf("Failed to create DemoSdkTask\r\n"); 35 } 36 } 37 38 APP_FEATURE_INIT(DemoSdkMain); 39