#if (INCLUDE__UBINOS__UBIK_TEST == 1)
#if !( UBINOS__UBIK_TEST__EXCLUDE_MISCTESTSET == 1)
#include <stdio.h>
int r;
unsigned int waitvalue;
unsigned int rtick;
unsigned int itick;
unsigned int rloopcount;
unsigned int iloopcount;
unsigned int errorrate;
printf("\n");
printf("<test>\n");
printf("<name>ubik_test_misctest02</name>\n");
printf("<description>Test for accuracy of UBINOS__BSP__BUSYWAITCOUNT_PER_MS</description>\n");
printf("<message>\n");
printf("it tasks %d ms\n", UBINOS__UBIK_TEST__BUSYWAITCOUNTTESTTIMEMS);
iloopcount = rloopcount * itick / rtick;
printf("current value is %d\n", rloopcount);
printf("recommended value is %d\n", iloopcount);
if (rtick >= itick) {
errorrate = (rtick - itick) * 100 / itick;
}
else {
errorrate = (itick - rtick) * 100 / itick;
}
printf("accuracy is %d percent\n", 100 - errorrate);
if (errorrate <= 2) {
r = 0;
}
else {
r = -1;
}
printf("</message>\n");
printf("<result>");
if (0 == r) {
printf("pass");
}
else {
printf("fail");
}
printf("</result>\n");
printf("</test>\n");
printf("\n");
return r;
}
#endif
#endif
void bsp_busywait(unsigned int count)
unsigned int bsp_getbusywaitcountperms(void)
stdlib (Standard Library) API
unsigned int low
Definition: ubik.h:58
unsigned int ubik_gettickpersec(void)
tickcount_t ubik_gettickcount(void)
tickcount_t ubik_gettickdiff(tickcount_t tick1, tickcount_t tick2)
int ubik_test_misctest02(void)
Test for accuracy of UBINOS__BSP__BUSYWAITCOUNT_PER_MS.