It is written in the docs
The value of portSUPPRESSTICKSAND_SLEEP()'s single parameter equals the total number of tick periods before a task is due to be moved into the Ready state. The parameter value is therefore the time the microcontroller can safely remain in a deep sleep state, with the tick interrupt stopped (suppressed).
So, how is user able to control this parameter?
I'm working in IAR IDE with stm32l151 chip and using default implementation of portSUPPRESSTICKSANDSLEEP. I set blinking of a led in Idle task (at every entrance turn on/off) and led blinking was pretty recognizable for a human eye. I've tried to always pass to portSUPPRESSTICKSANDSLEEP 2000, 200, 20, 2 ticks (in my project 1 tick = 1 ms) from prvGetExpectedIdleTime but after that led stays active all the way.
Sorry for the noob question but in the docs it's just far from obvious.
Sorry, I don't follow what it is you are trying to do.
portSUPPRESSTICKSAND_SLEEP() is called by the kernel, and the time
passed into the function is calculated internally - it is not something
you set manually.
Thanks for the answer.
But how can i control the time for microcontroller sleep mode using default IAR portSUPPRESSTICKSAND_SLEEP implementation?
The time the system will sleep is set to be the next time the scheduler
knows a task needs to execute. If this is too short then sleep is not
entered at all (you can set the low limit time).
For example (assuming you have configUSETICKLESSIDLE set to 1), if all
tasks are in the Blocked state, two are blocked indefinitely, one will
time out in 50 ticks, and one will time out in 20 ticks, then
portSUPPRESSTICKSAND_SLEEP() will be called (internally, by the RTOS)
with the expected idle time set to 20 as that is the time the scheduler
knows a task next needs to execute.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.