2023-03-23 17:00:05 +08:00

83 lines
3.3 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

C51 COMPILER V9.60.0.0 DELAY 03/23/2023 13:25:30 PAGE 1
C51 COMPILER V9.60.0.0, COMPILATION OF MODULE DELAY
OBJECT MODULE PLACED IN .\Objects\delay.obj
COMPILER INVOKED BY: d:\Keil_v5\C51\BIN\C51.EXE mycode\delay.c OPTIMIZE(8,SPEED) BROWSE INCDIR(.\myinc) DEBUG OBJECTEXTE
-ND PRINT(.\Listings\delay.lst) TABS(2) OBJECT(.\Objects\delay.obj)
line level source
1 /*---------------------------------------------------------------------*/
2 /* --- STC MCU Limited ------------------------------------------------*/
3 /* --- STC 1T Series MCU Demo Programme -------------------------------*/
4 /* --- Mobile: (86)13922805190 ----------------------------------------*/
5 /* --- Fax: 86-0513-55012956,55012947,55012969 ------------------------*/
6 /* --- Tel: 86-0513-55012928,55012929,55012966 ------------------------*/
7 /* --- Web: www.STCMCU.com --------------------------------------------*/
8 /* --- Web: www.STCMCUDATA.com ---------------------------------------*/
9 /* --- QQ: 800003751 -------------------------------------------------*/
10 /* 如果要在程序中使用此代码,请在程序中注明使用了STC的资料及程序 */
11 /*---------------------------------------------------------------------*/
12
13 /*************** 功能说明 ****************
14
15 本文件为STC8系列的延时程序,用户几乎可以不修改这个程序.
16
17 ******************************************/
18
19 #include "delay.h"
20
21 //========================================================================
22 // 函数: void delay_ms(unsigned char ms)
23 // 描述: 延时函数。
24 // 参数: ms,要延时的ms数, 这里只支持1~255ms. 自动适应主时钟.
25 // 返回: none.
26 // 版本: VER1.0
27 // 日期: 2021-3-9
28 // 备注:
29 //========================================================================
30 void delay_ms(unsigned char ms)
31 {
32 1 unsigned int i;
33 1 do{
34 2 i = MAIN_Fosc / 10000;
35 2 while(--i);
36 2 }while(--ms);
37 1 }
38 void Delay4us() //@11.0592MHz
39 {
40 1 unsigned char i;
41 1
42 1 _nop_();
43 1 _nop_();
44 1 i = 12;
45 1 while (--i)
46 1 ;
47 1 }
48 void Delay2us() //@11.0592MHz
49 {
50 1 unsigned char i;
51 1
52 1 _nop_();
53 1 i = 5;
54 1 while (--i)
C51 COMPILER V9.60.0.0 DELAY 03/23/2023 13:25:30 PAGE 2
55 1 ;
56 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 29 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)