欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 6030|回復(fù): 6
收起左側(cè)

工控行業(yè)STM32單片機(jī)程序框架模板源碼下載

  [復(fù)制鏈接]
ID:378458 發(fā)表于 2018-7-24 14:20 | 顯示全部樓層 |閱讀模式
IO按鍵掃描 串口  E2PROM Flash AD DA LCD 觸摸屏 fatfs文件系統(tǒng)  外設(shè)操作一應(yīng)俱全,基于時間片輪轉(zhuǎn)的狀態(tài)機(jī)框架
0.png 0.png

STM32單片機(jī)源程序如下:
  1. /* Includes ------------------------------------------------------------------*/
  2. #ifndef _ONPCSIMU_
  3.         #include "app.h"
  4. #endif
  5. #include "res.h"
  6. #include "icon.h"
  7. #include "ctrlcfg.h"
  8. #include "ctrl.h"
  9. #include "event.h"
  10. #include "log.h"
  11. #include "string.h"
  12. #include "delay.h"
  13. #include "gui.h"
  14. #include "touch.h"
  15. #include "can_protomod.h"
  16. #include "buzzer.h"
  17. #ifndef _ONPCSIMU_
  18. #include "recipe.h"
  19. #endif

  20. _UINT16 g_mainflag = 0;

  21. extern void idle_modbus(void);
  22. extern void Error_Process (void);
  23. extern _BYTE SetAlarm( _UINT16 id, _UINT16 reference, _UINT16 uls, _UINT16 lls , _UINT16 strid, _UINT16 mode);
  24. extern void welcomTimerout(void);
  25. extern void Comm_Timerout_Check (void);

  26. _UINT32 ad_timer=0 ;
  27. _BYTE tim_100ms =0,time_500ms=0;
  28. extern _UINT16 g_appSta;

  29. int main(void)
  30. {

  31.         if( g_mainflag == 0 )
  32.         {
  33.                 // for test
  34.                 App_Init ();

  35.                 Var_Init ();

  36.                 LCM_SPI_Flash_Init ();

  37.                 gClearScreen (WHITE);

  38.                 Display_ON();
  39.                 BackLight (90);

  40.                 g_mainflag = 1;
  41.         }

  42. #ifndef _ONPCSIMU_
  43.         while (1)
  44. #endif
  45.         {

  46. #ifndef _ONPCSIMU_
  47.                 if((get_milliseconds()-ad_timer)>=(_UINT32)10)
  48.                 {
  49.                         ad_timer = get_milliseconds();
  50.                 //        Get_AD1 ();
  51.                         Touch_Panel_Getxy ();

  52.                         switch (tim_100ms)
  53.                         {
  54.                                 case 0:

  55.                                 break;

  56.                                 case 1:
  57.                                 BeepTimerCb();
  58.                                 break;

  59.                                 case 2:

  60.                                 break;

  61.                                 case 3:

  62.                                 break;

  63.                                 case 4:

  64.                                 break;

  65.                                 case 5:
  66.                                 Backlight_Powersave ();
  67.                                 break;

  68.                                 case 6:

  69.                                 break;

  70.                                 case 7:
  71.                                 Comm_Timerout_Check ();
  72.                                 break;

  73.                                 case 8:


  74.                                 break;

  75.                                 case 9:
  76.                                 time_500ms++ ;
  77.                                 if (time_500ms >= 5)
  78.                                 {
  79.                                         time_500ms = 0;
  80.                                         Error_Process ();
  81.                                 }
  82.                                 break;

  83.                         }

  84.                         tim_100ms ++;

  85.                         if (tim_100ms >= 10)
  86.                                 tim_100ms = 0;
  87.                 }


  88. #else
  89.                 if((get_milliseconds()-ad_timer)>=(_UINT32)10)
  90.                 {
  91.                         ad_timer = get_milliseconds();
  92.                         {
  93.                                 switch (tim_100ms)
  94.                                 {       
  95.                                         case 9:
  96.                                         time_500ms++ ;
  97.                                         if (time_500ms >= 5)
  98.                                         {
  99.                                                 time_500ms = 0;
  100.                                         }

  101.                                         break;
  102.                                         default:
  103.                                         break;
  104.        
  105.                                 }
  106.        
  107.                                 tim_100ms ++;
  108.        
  109.                                 if (tim_100ms >= 10)
  110.                                         tim_100ms = 0;
  111.                         }

  112.                 }

  113. #endif
  114.         }
  115. }


  116. #ifdef _ONPCSIMU_
  117. void idleProcess( void )
  118. {
  119.         main();
  120. }
  121. #endif
復(fù)制代碼

所有資料51hei提供下載:
demo.rar (1.03 MB, 下載次數(shù): 91)


評分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎勵!

查看全部評分

回復(fù)

使用道具 舉報

ID:108573 發(fā)表于 2019-12-24 12:55 | 顯示全部樓層
標(biāo)記一下
回復(fù)

使用道具 舉報

無效樓層,該帖已經(jīng)被刪除
無效樓層,該帖已經(jīng)被刪除
ID:332724 發(fā)表于 2020-5-27 16:39 | 顯示全部樓層
標(biāo)記一下
回復(fù)

使用道具 舉報

6#
無效樓層,該帖已經(jīng)被刪除
ID:697069 發(fā)表于 2020-5-30 18:28 | 顯示全部樓層

標(biāo)記一下
回復(fù)

使用道具 舉報

ID:298215 發(fā)表于 2020-8-17 09:49 | 顯示全部樓層
標(biāo)記一下
回復(fù)

使用道具 舉報

ID:949844 發(fā)表于 2022-1-29 23:06 | 顯示全部樓層
標(biāo)記一下
回復(fù)

使用道具 舉報

10#
無效樓層,該帖已經(jīng)被刪除
11#
無效樓層,該帖已經(jīng)被刪除
12#
無效樓層,該帖已經(jīng)被刪除
ID:914666 發(fā)表于 2022-2-9 09:57 | 顯示全部樓層
51hei有你更精彩
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表