怎么样设置51单片机流水灯的循环次数,我该在这个程序里面改动哪里才能让他循环两次

#include<REGX52.H>
#include<INTRINS.H>
voidDelay500ms()

unsigned chari,j,k;
nop();
i=4;
j=129;
k=119;
do

do

while(--k);
}while(--j);
}while (- i);

voidmain ()

P1=0XFE;
Delay500ms();
P1=0XFD;
Delay500ms();
P1=0XFB;
Delay500ms();
P1=0XF7;
Delay500ms ();
P1=0XEF;
Delay500ms();
P1=OXDF;
Delay500ms();
P1=0XBE;
Delay500ms();
P1=0X7F;
Delay500ms();


#include<REGX52.H>
#include<INTRINS.H>
voidDelay500ms()
{
unsigned chari,j,k;
nop();
i=4;
j=129;
k=119;
dodowhile(--k);
}while(--j);
}while (- i);
}
void main ()
{
 char i= 2;
 while(i--){
P1=0XFE;
Delay500ms();
P1=0XFD;
Delay500ms();
P1=0XFB;
Delay500ms();
P1=0XF7;
Delay500ms ();
P1=0XEF;
Delay500ms();
P1=OXDF;
Delay500ms();
P1=0XBE;
Delay500ms();
P1=0X7F;
Delay500ms();
}
while(1){}
}