get elaped time problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

get elaped time problem

Jump to solution
741 Views
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 Kudos
1 Solution
315 Views
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);  }}

 

View solution in original post

0 Kudos
1 Reply
316 Views
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 Kudos