本帖最后由 panghongfei 于 2022-11-12 17:14 编辑
uint CountAvg_Advalue(uint *ADV,uchar Times)
{
uchar i;
uint Avg=0;
uint CountAll=0;
for(i=0; i<Times; i++) CountAll=CountAll+ADV; //统计总数
//Avg = CountAll/(Times);
Avg=HDIV_Div(CountAll, Times); //使用硬件除法器,求平均值
return Avg;
}
|