I need to use a timer on my C program on SDK. I'm using Atlys Spartan-6 LX45 and I try to use this code:
cookie.setPath("/")
When I debug the program it hangs and I don't get any result. How to use a timer?
答案 0 :(得分:0)
您需要在使用之前初始化计时器。
XTmrCtr TmrCtrInstance; /* It's not a pointer, so no ptr suffix... */
if (XTmrCtr_Initialize(&TmrCtrInstance, XPAR_AXI_TIMER_0_DEVICE_ID) != XST_SUCCESS) { /* Your ID may be different */
/* Stop execution */
return;
}
time1 = XTmrCtr_GetValue(&TmrCtrInstance, 0);
...