久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 5920|回復: 6
收起左側

工控行業STM32單片機程序框架模板源碼下載

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

STM32單片機源程序如下:
  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
復制代碼

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


評分

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

查看全部評分

回復

使用道具 舉報

ID:108573 發表于 2019-12-24 12:55 | 顯示全部樓層
標記一下
回復

使用道具 舉報

ID:332724 發表于 2020-5-27 16:39 | 顯示全部樓層
標記一下
回復

使用道具 舉報

ID:697069 發表于 2020-5-30 18:28 | 顯示全部樓層

標記一下
回復

使用道具 舉報

ID:298215 發表于 2020-8-17 09:49 | 顯示全部樓層
標記一下
回復

使用道具 舉報

ID:949844 發表于 2022-1-29 23:06 | 顯示全部樓層
標記一下
回復

使用道具 舉報

ID:914666 發表于 2022-2-9 09:57 | 顯示全部樓層
51hei有你更精彩
回復

使用道具 舉報

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

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 精品国产一区二区国模嫣然 | 伊人伊人 | 亚洲一区二区精品 | 欧美成人专区 | 免费一区二区 | 国产精品我不卡 | 韩日一区二区 | 在线日韩精品视频 | 日韩色综合 | 91一区二区| 成人精品国产免费网站 | 一区二区三区成人 | 亚洲一二三区不卡 | 国产在线观看一区二区 | 日韩有码一区二区三区 | 麻豆久久久9性大片 | 欧美一区二区视频 | 97精品超碰一区二区三区 | 国产一区二区三区视频在线观看 | 久久精品国产免费看久久精品 | www.日本在线观看 | 午夜三级视频 | 99精品网站| 日韩视频一区二区 | 中文字幕一区二区三区在线观看 | 欧美二区乱c黑人 | 国产不卡一区在线观看 | 欧美极品在线观看 | 国产精品福利一区二区三区 | 亚洲成人网在线观看 | 大香在线伊779 | 国产在线中文字幕 | 亚洲精品久久久久久宅男 | 久久噜噜噜精品国产亚洲综合 | 免费成人高清在线视频 | 国产精品v | 国产 日韩 欧美 在线 | 国产a级毛毛片 | 亚洲国产精品久久久 | 黄a免费看 | 91精品国产欧美一区二区 |