自己编写了一个LEDTEST程序用的是sysbios,但是板子上LED的闪烁频率与我程序中设定的频率不一样,求大神解答,附上自己写的工程
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
(void) platform_led(0, PLATFORM_LED_ON, PLATFORM_USER_LED_CLASS);
(void) platform_delay(10000000);
(void) platform_led(0, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
(void) platform_delay(10000000);
我用的是上面两个LED状态延迟delay函数来控制灯的
PDK中platform_delay函数的实现如下,你可以看到delay的原理非常简单,你仔细检查一下全局变量platform_mcb.frequency和你当前芯片的主频是否一致。
Platform_STATUS platform_delay(uint32_t usecs)
{
int32_t delayCount = (int32_t) usecs * platform_mcb.frequency;
int32_t start_val = (int32_t) CSL_chipReadTSCL();
while (((int32_t)CSL_chipReadTSCL() - start_val) < delayCount);
return Platform_EOK;
}
p_info->frequency = platform_get_frequency();
platform_mcb.frequency = p_info->frequency;这个platform_mcb.frequency 不应该就是芯片主频么?