Help:Delay Function for time delay(S32K144)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Help:Delay Function for time delay(S32K144)

9,217 次查看
victor_song_171
Contributor III

How could I edit a time delay function in S32K144_100Pin?

I want code a function for time delay ,just like delay_second() , delay_microsecond(), or just like that.

标记 (3)
0 项奖励
回复
3 回复数

7,844 次查看
Yunchuan
NXP Employee
NXP Employee

As ErichS‌ say, or you can use SDK  OSIF module , function void OSIF_TimeDelay(const uint32_t delay).

SysTick timer is used in this function,and SysTick interrupt will be enabled when you call this function, and will always run without another disable action.

0 项奖励
回复

7,844 次查看
BlackNight
NXP Employee
NXP Employee

Maybe you are looking for something like the McuWait module:

McuOnEclipseLibrary/McuWait.c at master · ErichStyger/McuOnEclipseLibrary · GitHub 

It offers functions to wait for a number of milli-seconds or microseconds:

McuWait_Waitms(1000);

McuWait_Waitus(50);

If using an ARM Cortex-M4, it uses the cycle counter (see Cycle Counting on ARM Cortex-M with DWT | MCU on Eclipse  and Measuring ARM Cortex-M CPU Cycles Spent with the MCUXpresso Eclipse Registers View | MCU on Eclipse ).

I hope this helps,

Erich

0 项奖励
回复

7,845 次查看
victor_song_171
Contributor III

Thank you.

but using the function mcuwait_waittime(delay_time),weawther all of the computing resource wait for the delay function done?

0 项奖励
回复