51单片机的无源蜂鸣器,独立运行程序时很响,然而综合程序却是滴答的声音

以下是综合程序,拜托大佬帮小白解决一下

#include "reg52.h"
#include "intrins.h"
unsigned char code table[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
static timer;
unsigned char second;
typedef unsigned char uint8;
typedef unsigned int uint16;

sbit beep = P1^5;

void delay(uint16 i)
{
while(i--);
}

 void be()

{

beep = ~beep;
delay(0.01);
}

void time0_init (void)
{TMOD|=0x01;
TH0=0XFC;
TL0=0x18;
ET0=1;
EA=1;
TR0=1;
}

void main()
{
time0_init();
second=0;
P2=0x01;
while(1)
{
P0=table[second];

}
}
void time0() interrupt 1
{

TH0=0xFC;
TL0=0x18;
timer++;
if(timer==1000)
{
timer=0;
second++;
}

if(second==10)
{
be();
second=0;
}
}


void time0() interrupt 1
{

TH0=0xFC;
TL0=0x18;
be();
timer++;
if(timer==1000)
{
timer=0;
second++;
}

if(second==10)
{
//be();
second=0;
}
}