lwIP sys_now() function bug

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

lwIP sys_now() function bug

ソリューションへジャンプ
3,767件の閲覧回数
biafra
Senior Contributor I

Hi everyone,

It seems I've found in the sys_now() function of the lwIP library:

u32_t sys_now(void)
{
   return xTaskGetTickCount();
}

It returns the number of ticks from startup, not the number of milliseconds!

It should be:

    return xTaskGetTickCount() * portTICK_PERIOD_MS;

Many thanks

Biafra

1 解決策
2,859件の閲覧回数
biafra
Senior Contributor I

Hi Daniel,

Thanks for yor answer.

That's why I write my post: at the moment by simply calling the xTaskGetTickCount() function the sys_now() function returns the current time in ticks, not in milliseconds. With the correction I suggested it returns milliseconds.

Many thanks

Biafra

元の投稿で解決策を見る

3 返答(返信)
2,859件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi Biafra:

Thanks for your attention.

But it seems the LWIP function documentation says, it returns the current time in milliseconds.

Please refer to the below link

lwIP: Time 

Regards

Daniel

2,860件の閲覧回数
biafra
Senior Contributor I

Hi Daniel,

Thanks for yor answer.

That's why I write my post: at the moment by simply calling the xTaskGetTickCount() function the sys_now() function returns the current time in ticks, not in milliseconds. With the correction I suggested it returns milliseconds.

Many thanks

Biafra

2,859件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Thanks, Biafra, I will report it to the developers.

Regards

Daniel