• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 GOODIX.
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 "driver_test.h"
17 #include "cmsis_os2.h"
18 #include "ohos_init.h"
19 
20 #define  STACK_SIZE 4096
21 #define  MS_1000    1000
22 
driver_test_task(void)23 static void driver_test_task(void)
24 {
25     LOG_I(">>>xts driver test task start.");
26 
27     while (1) {
28         gpio_test();
29         uart_test();
30         osDelay(MS_1000);
31     }
32 }
33 
driver_test(void)34 static void driver_test(void)
35 {
36     osThreadAttr_t attr = {0};
37     attr.stack_size = STACK_SIZE;
38     attr.priority = osPriorityNormal;
39     attr.name = "driver_test";
40     if (osThreadNew((osThreadFunc_t)driver_test_task, NULL, &attr) == NULL) {
41         HILOG_ERROR(HILOG_MODULE_APP, "Failed to create driver_test_task\r\n");
42     }
43 }
44 
45 SYS_RUN(driver_test);
46