亚洲春色中文字幕久久久-三上亚,一吻二脱三床四吻胸,国产真实伦对白视频全集,在线毛片观看,精品成品入口黄网,国产毛aⅴ片久久久,亚洲AV色香蕉一区二区三区老师,萧皇后A级艳片,色情日本视频更新,99久久亚洲精品日本无码

標(biāo)題: stm32f10x 移植contiki源程序 [打印本頁]

作者: kaihua.yang    時(shí)間: 2019-7-8 22:07
標(biāo)題: stm32f10x 移植contiki源程序
1.使用std庫
2.移植了contiki
3.運(yùn)行兩個(gè)thread正常

單片機(jī)源程序如下:
  1. #include "contiki.h"
  2. unsigned int idle_count = 0;

  3. static struct etimer et_on;
  4. PROCESS(led_on, "led_on");
  5. PROCESS_THREAD(led_on, ev, data)  
  6. {
  7.     static int on = 0;
  8.         PROCESS_BEGIN();

  9.         while(1)
  10.         {
  11.            on++;
  12.            etimer_set(&et_on, CLOCK_SECOND);              // etimer溢出時(shí)間為5s
  13.        PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et_on));  // 等待定時(shí)器溢出
  14.         }

  15.         PROCESS_END();
  16. }


  17. static struct etimer et_off;
  18. PROCESS(led_off, "led_off");
  19. PROCESS_THREAD(led_off, ev, data)  
  20. {
  21.     static int off = 0;
  22.         PROCESS_BEGIN();

  23.         while(1)
  24.         {
  25.            off++;
  26.            etimer_set(&et_off, CLOCK_SECOND);              // etimer溢出時(shí)間為5s
  27.        PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et_off));  // 等待定時(shí)器溢出
  28.         }

  29.         PROCESS_END();
  30. }

  31. AUTOSTART_PROCESSES(&led_on,&led_off);  

  32. int main(void*arg)
  33. {
  34.         clock_init();  
  35.         process_init();  
  36.         process_start(&etimer_process,NULL);  
  37.         autostart_start(autostart_processes);
  38.         while(1){
  39.                 while(process_run()> 0);  
  40.                 idle_count++;  
  41.         }
  42. }
復(fù)制代碼

所有資料51hei提供下載:
stm32-contiki-master.zip (350.96 KB, 下載次數(shù): 11)







歡迎光臨 (http://www.denmoz.com/bbs/) Powered by Discuz! X3.1