AnsweredAssumed Answered

MQX Idle task and Low power question

Question asked by tybos on Dec 4, 2013
Latest reply on Dec 5, 2013 by tybos

Hi Freescale Community,

 

I recently managed to run MQX (4.0.2) on a custom board based on K10 (50 MHz silicon) device.

This board is dedicated to measuring chip consumption so I wanted to activate Low Power mode for MQX.

 

Looking at Idle task code and mqx.h, I found something that doesn't seem to make sense.

 

In src/include/mqx.h (line 162):

#define MQX_IDLE_TASK_PARAMETER 0

#if (MQX_USE_IDLE_TASK) && (MQX_ENABLE_LOW_POWER) && (MQX_IDLE_TASK_PARAMETER != 0)

   #error MQX_IDLE_TASK_PARAMETER must be 0 when Low Power feature is enabled!

#endif

And in src/kernel/idletask.c:

void _mqx_idle_task

    (

        uint_32 parameter

    )

{ /* Body */

    [...]

 

    while (1) {

          [...]
     #if MQX_ENABLE_LOW_POWER

        if (parameter)

        {

            _ASM_SLEEP();

        }

     #endif

 

    } /* Endwhile */

 

} /* Endbody */

 

If I understand this well, mqx.h forces me to let MQX_IDLE_TASK_PARAMETER to 0 while idle task will test this parameter to be not 0 to enter wait mode.

So basically, I can not enter wait mode in idle task unless I modify idletask.c.

 

Do I miss something here ?

 

Thank you in advance for those who will read and discuss this point.

 

Tybos

Outcomes