#include <stdio.h>#include <string.h>#include <unistd.h>#include "ohos_init.h"#include "cmsis_os2.h"#include "wifiiot_gpio.h"#include "wifiiot_gpio_ex.h"uint32_t real ;osThreadId_t threadID ;void my_timer(void* arg){ (void)arg; printf("Timer runs\r\n"); GpioInit(); IoSetFunc(WIFI_IOT_IO_NAME_GPIO_2, WIFI_IOT_IO_FUNC_GPIO_2_GPIO); GpioSetDir(WIFI_IOT_IO_NAME_GPIO_2, WIFI_IOT_GPIO_DIR_OUT); GpioSetOutputVal(WIFI_IOT_IO_NAME_GPIO_2,1); usleep(10000000); GpioSetOutputVal(WIFI_IOT_IO_NAME_GPIO_2,0);}//创建任务static void my_thread(void){ osTimerId_t id1;//创建定时器的ID uint32_t timerDelay;//创建定时器的锁定时间的变量 osStatus_t status;//创建一个枚举变量,用来存储运行状况 real = 1U; id1 = osTimerNew(my_timer,osTimerPeriodic,&real,NULL); if (id1 != NULL) { timerDelay = 200U;//设延时时间为2秒 status = osTimerStart(id1,timerDelay);//用status记录osTimerStart运行结果 if (status != osOK) { printf("Timer Start failed"); } }}APP_FEATURE_INIT(my_thread);运行结果如下ready to OS startsdk ver:Hi3861V100R001C00SPC025 2020-09-03 18:10:00formatting spiffs...FileSystem mount ok.wifi init success!00 00:00:00 0 196 D 0/HIVIEW: hilog init success.00 00:00:00 0 196 D 0/HIVIEW: log limit init success.00 00:00:00 0 196 I 1/SAMGR: Bootstrap core services(count:3).00 00:00:00 0 196 I 1/SAMGR: Init service:0x4aeaec TaskPool:0xfa22400 00:00:00 0 196 I 1/SAMGR: Init service:0x4aeb10 TaskPool:0xfa89400 00:00:00 0 196 I 1/SAMGR: Init service:0x4aec20 TaskPool:0xfaa5400 00:00:00 0 228 I 1/SAMGR: Init service 0x4aeb10 <time: 0ms> success!00 00:00:00 0 128 I 1/SAMGR: Init service 0x4aeaec <time: 0ms> success!00 00:00:00 0 72 D 0/HIVIEW: hiview init success.00 00:00:00 0 72 I 1/SAMGR: Init service 0x4aec20 <time: 0ms> success!00 00:00:00 0 72 I 1/SAMGR: Initialized all core system services!00 00:00:00 0 128 I 1/SAMGR: Bootstrap system and application services(count:0).00 00:00:00 0 128 I 1/SAMGR: Initialized all system and application services!00 00:00:00 0 128 I 1/SAMGR: Bootstrap dynamic registered services(count:0).Timer runs**********watchdog isr********************syserr info start**********kernel_ver : Hi3861V100 R001C00SPC025,2020-09-03 18:10:00**********Exception Information**********PC Task Name : IdleCorePC Task ID = 1Cur Task ID = 1Task Stack Size = 0x400Exception Type = 0x80000021**********reg info**********mepc = 0xd99ecmstatus = 0x1880mtval = 0x0mcause = 0x80000021ccause = 0x0ra = 0xd99c8sp = 0xeab70gp = 0x11a9c0tp = 0xe4d80591t0 = 0x4231c4t1 = 0x3fa9a0t2 = 0x28282828s0 = 0xe8460s1 = 0x14141414a0 = 0x0a1 = 0x0a2 = 0x0a3 = 0x0a4 = 0x23232323a5 = 0x0a6 = 0x21212121a7 = 0x20202020s2 = 0x13131313s3 = 0x12121212s4 = 0x11111111s5 = 0x10101010s6 = 0x9090909s7 = 0x8080808s8 = 0x7070707s9 = 0x6060606s10 = 0x5050505s11 = 0x4040404t3 = 0x19191919t4 = 0x18181818t5 = 0x17171717t6 = 0x16161616**********memory info**********Pool Addr = 0xe8300Pool Size = 0x302c0Fail Count = 0x0Peek Size = 0x13fe0Used Size = 0x101c0**********task info**********Name : IdleCoreID = 1Status = 0x14Stack Index = 0x8Stack Peak = 0x124Stack Size = 0x400SP = 0x119880Stack : 0xea840 to 0xeac40Real SP = 0xeab70Stack Overflow = 0**********track_info**********current_item:0x4item_cnt:10Index TrackType TrackID CurTime Data1 Data20001 0065 0006 0x389 0xd99ec 0x3f5e780002 0065 0001 0x389 0x3f5e78 0xd99ec0003 0016 0007 0x389 0xd99ec 0x00004 0016 0007 0x38a 0xd99ec 0x00005 0016 0007 0x383 0xd99ec 0x00006 0016 0007 0x384 0xd99ec 0x00007 0016 0007 0x385 0xd99ec 0x00008 0016 0007 0x386 0xd99ec 0x00009 0016 0007 0x387 0xd99ec 0x00010 0016 0007 0x388 0xd99ec 0x0**********Call Stack**********Call Stack 0 -- 3f6cf8 addr:eac1cCall Stack 1 -- 3f78c0 addr:eac2cCall Stack 2 -- 3f5e24 addr:eac3c**********Call Stack end**********ready to OS startsdk ver:Hi3861V100R001C00SPC025 2020-09-03 18:10:00FileSystem mount ok.wifi init success!00 00:00:00 0 196 D 0/HIVIEW: hilog init success.00 00:00:00 0 196 D 0/HIVIEW: log limit init success.00 00:00:00 0 196 I 1/SAMGR: Bootstrap core services(count:3).00 00:00:00 0 196 I 1/SAMGR: Init service:0x4aeaec TaskPool:0xfa22400 00:00:00 0 196 I 1/SAMGR: Init service:0x4aeb10 TaskPool:0xfa89400 00:00:00 0 196 I 1/SAMGR: Init service:0x4aec20 TaskPool:0xfaa5400 00:00:00 0 228 I 1/SAMGR: Init service 0x4aeb10 <time: 0ms> success!00 00:00:00 0 128 I 1/SAMGR: Init service 0x4aeaec <time: 0ms> success!00 00:00:00 0 72 D 0/HIVIEW: hiview init success.00 00:00:00 0 72 I 1/SAMGR: Init service 0x4aec20 <time: 0ms> success!00 00:00:00 0 72 I 1/SAMGR: Initialized all core system services!00 00:00:00 0 128 I 1/SAMGR: Bootstrap system and application services(count:0).00 00:00:00 0 128 I 1/SAMGR: Initialized all system and application services!00 00:00:00 0 128 I 1/SAMGR: Bootstrap dynamic registered services(count:0).然后就是这部分内容一直重复我想知道是哪里的问题
坦然的橘子
发表于2023-11-02 19:25:12
2023-11-02 19:25:12
最后回复
138