|
文件1:
#include
sbit PWON=P1^2;
typedef unsigned char Byte;//
typedef unsigned int Word;//
void DelayX1ms(Byte count)
{
Byte i,j;
for(i=0;i
for(j=0;j<120;j++)
;
}
main()
{
PWON=1;
DelayX1ms(1);
PWON=0;
DelayX1ms(1);
}
文件2:
#include
sbit PWON=P1^2;
typedef unsigned char Byte;//
typedef unsigned int Word;//
void DelayX1ms(Word count)
{
Word i,j;
for(i=0;i
for(j=0;j<120;j++)
;
}
main()
{
PWON=1;
DelayX1ms(1);
PWON=0;
DelayX1ms(1);
}
文件1的结果DelayX1ms(1);延时了0.4ms
文件2的结果DelayX1ms(1);延时了1ms
这问题就出来了。有人能合理解释下么?
|
|