首页 > 其他分享 >赛灵斯zynq standalone 延时函数

赛灵斯zynq standalone 延时函数

时间:2023-02-01 22:34:36浏览次数:44  
标签:赛灵斯 standalone GetTime XTime tEnd int PER zynq tCur


void delay_ms(unsigned int mseconds)
{
XTime tEnd, tCur;

XTime_GetTime(&tCur);
tEnd = tCur + (((XTime) mseconds) * (COUNTS_PER_SECOND / 1000));
do
{
XTime_GetTime(&tCur);
} while (tCur < tEnd);
}

void delay_us(unsigned int useconds)
{
XTime tEnd, tCur;

XTime_GetTime(&tCur);
tEnd = tCur + (((XTime) useconds) * (COUNTS_PER_SECOND / 1000000));
do
{
XTime_GetTime(&tCur);
} while (tCur < tEnd);
}


标签:赛灵斯,standalone,GetTime,XTime,tEnd,int,PER,zynq,tCur
From: https://blog.51cto.com/u_15950551/6031942

相关文章