get elaped time problem

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

get elaped time problem

跳至解决方案
1,236 次查看
BenG
Contributor III

I'm trying to experiment with _time_get_elapsed_ticks() and _time_get_elapsed().

In the following code the the values in the pointers aren't getting adjusted.

I.e. The value(s) are garbage and are unchanged.

 

I presume I'm doing something wrong or haven't set something correctly in the bsp/psp. But the Reference Manual doesn't state that I need to enable anything specific in the user_config.h file.

 

void nill_task (uint_32 initial_data){  MQX_TICK_STRUCT_PTR tick_time_ptr;  TIME_STRUCT_PTR     ms_time_ptr;    while (1)  {    _time_get_elapsed_ticks(tick_time_ptr);    _time_get_elapsed(ms_time_ptr);    __no_operation();    _time_delay(1023);  }}

 Any suggestions?

0 项奖励
回复
1 解答
810 次查看
BenG
Contributor III

Worked it out.

 

The code should read.

 

void nill_task (uint_32 initial_data){  MQX_TICK_STRUCT tick_time;  TIME_STRUCT     ms_time;    while (1)  {    _time_get_elapsed_ticks(&tick_time);    _time_get_elapsed(&ms_time);    __no_operation();    _time_delay(1023);  }}

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
811 次查看
BenG
Contributor III

Worked it out.

 

The code should read.

 

void nill_task (uint_32 initial_data){  MQX_TICK_STRUCT tick_time;  TIME_STRUCT     ms_time;    while (1)  {    _time_get_elapsed_ticks(&tick_time);    _time_get_elapsed(&ms_time);    __no_operation();    _time_delay(1023);  }}

 

0 项奖励
回复