MQX task tick

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,499件の閲覧回数
Mohsin455
Contributor IV

Hi,

 

      I am using MQX 3.8 and TWRK60N512. The tick rate is set to 5ms in the mQX. I want to know what happens when the I use _time_delay(1) as the task tick is 5ms.

 

So what is the minimum delay I can use with _time_delay() when the tick rate is 5ms ?

 

Thanks,

Mohsin

 

0 件の賞賛
返信
1 解決策
1,437件の閲覧回数
c0170
Senior Contributor III

Hi Mohsin455,

 

Minimum resolution is 5ms if it's set to 5ms (BSP ALARM FREQ = 200). When you pass number below 5 as an argument in this case, you'll get the minimum resolution.

 

Regards,

MartinK

元の投稿で解決策を見る

0 件の賞賛
返信
6 返答(返信)
1,438件の閲覧回数
c0170
Senior Contributor III

Hi Mohsin455,

 

Minimum resolution is 5ms if it's set to 5ms (BSP ALARM FREQ = 200). When you pass number below 5 as an argument in this case, you'll get the minimum resolution.

 

Regards,

MartinK

0 件の賞賛
返信
1,437件の閲覧回数
Mohsin455
Contributor IV

Hi MartinK,

 

                     Thnaks for your reply. So it might be that we get lower than 5ms depending on when we are calling _time_delay(1) i.e. if we call _time_delay(1) just before the next tick then it will occur when the next tick happens.

 

Also what if we give anything above 5 and below 10 ? Does it work in similar way (i.e. it only delays till the next tick).

 

PLease confirm ?

 

Thanks,

Mohsin

0 件の賞賛
返信
1,437件の閲覧回数
RichardR
Contributor IV

_time_delay will suspend for at least the amount of time you specify.

0 件の賞賛
返信
1,437件の閲覧回数
Mohsin455
Contributor IV

Yes,

          But only when the tick rate the >=  the amount you specify.

 

Regards,

Mohsin

0 件の賞賛
返信
1,437件の閲覧回数
RichardR
Contributor IV

It should always delay for AT LEAST as long as you specify in _time_delay, it may well be longer, depending on the system tick, other tasks running, etc.

0 件の賞賛
返信
1,437件の閲覧回数
c0170
Senior Contributor III

Hi Mohsin455,

 

I might have not clarified it well enough :smileyhappy:

 

What you have written is correct.

 

Regards,

MartinK

0 件の賞賛
返信