|
/*********************************************
程序名稱 :延時函數(shù)
*********************************************/
//#define MAIN_Fosc 48000000L //定義主時鐘
//#define MAIN_Fosc 44236800L //定義主時鐘
//#define MAIN_Fosc 40000000L //定義主時鐘
//#define MAIN_Fosc 36864000L //定義主時鐘
//#define MAIN_Fosc 35000000L //定義主時鐘
//#define MAIN_Fosc 33177600L //定義主時鐘
//#define MAIN_Fosc 30000000L //定義主時鐘
//#define MAIN_Fosc 27000000L //定義主時鐘
//#define MAIN_Fosc 24000000L //定義主時鐘
//#define MAIN_Fosc 22118400L //定義主時鐘
//#define MAIN_Fosc 20000000L //定義主時鐘
//#define MAIN_Fosc 18432000L //定義主時鐘
#define MAIN_Fosc 12000000L //定義主時鐘
//#define MAIN_Fosc 11059200L //定義主時鐘
//#define MAIN_Fosc 6000000L //定義主時鐘
//#define MAIN_Fosc 5529600L //定義主時鐘
void Delay(unsigned int ms) //注:ms_max=65536
{
unsigned int i;
do
{
i=MAIN_Fosc/96000L; //STC89_12T
// i=MAIN_Fosc/48000L; //STC89_6T
// i=MAIN_Fosc/14000; //STC12
// i=MAIN_Fosc/13000; //STC15
// i=MAIN_Fosc/10000; //STC8
// i=MAIN_Fosc/6030; //STC32
while(--i) ;
}
while(--ms);
}
|
評分
-
查看全部評分
|