Page 1 of 1

Energy Efficient Design

PostPosted: Sun Dec 16, 2012 4:04 pm
by whywhy
I am coding for battery powered device.
How to make system sleep most of the time?

One idea would be:
put a sleep instruction in a lowest priority task.
is it feasible with cocoOS?

Re: Energy Efficient Design

PostPosted: Tue Dec 18, 2012 7:54 am
by peter
cocoOS can manage this for you.
When idle, the scheduler checks for any task waiting for execution. If no task wants to run, a call is made to os_cbkSleep() where you could put your sleep instruction.
For time keeping the MCU must wake up every tick to adjust task timers.