i want use a hardware delay instead of vtaskdelay()

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

i want use a hardware delay instead of vtaskdelay()

830件の閲覧回数
nsnmaniram
Contributor III

hi,

there is any way to implement a hardware delay on imxrt1050 instead of vtaskdelay().

Thanks,

Maniram

ラベル(1)
0 件の賞賛
1 返信

728件の閲覧回数
davidrozenski
Contributor I

Somethings like that :

static void delay(uint32_t val)
{
uint32_t coreClock = SystemCoreClock; /* in Hz */
uint32_t ticksPerMicroSec = coreClock / 1000000; /* Target runs at 600 MHz => 600 */
volatile uint32_t ticksToWait = 1000 * val * ticksPerMicroSec / 8; /* Divide by 8 to get proper timing */

while(ticksToWait--)
{
__asm("NOP"); /* delay */
}
}

However I do not recommend since you will lock all tasks by doing this.

0 件の賞賛