⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delay_loop.c

📁 CODE for embedded C ,hand coding version
💻 C
字号:
/*---------------------------------------------------------------*-
  Delay_Loop.C(v1.00)
  Author:06_Digital_Media 
  All Right Reserved
  ----------------------------------------------------------------
  Create a simple software delay using a loop
  -*--------------------------------------------------------------*/

  #include "Main.H"
  #include "Port.H"
  #include "Delay_Loop.H"

  /*---------------------------------------------------------------*-
   Delay_Loop_Wait()
   Delay duration varies with parameter
   Parameter is *ROUGHLY* ,the delay , in milliseconds
   on 12MHZ 8051(12 osc cycles)
   You need to adjust the timing for your application
   -*-------------------------------------------------------------*/

   void DELAY_LOOP_Wait(const tWord DELAY_MS){
     tWord x,y;
	 for(x=0;x<= DELAY_MS;x++)
	  for(y = 0;y<=120;y++);
   }

 /*------------------------------------------------------------*-
 ----------END OF FILE-------------------------------------------
 -*---------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -