This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Idle thread exit ???hook???


On Wed, May 13, 2009 at 05:40:56AM -0700, panduroDk wrote:
> 
> Hi 
> 
> I???m trying to measure my CPU load by using a GPIO pin and a voltmeter, and
> now I???m looking for some kind of Idle thread exit ???hook??? but I can???t seem to
> find it, dose eCos provide such a functionality. The plan Is to set the GPIO
> high in the idle thread, and set low when exited the idle thread.

Sorry, it does not work this way. The idle thread is a normal thread,
but with very, very low priority. Its low priority means it gets
preempted when there is a higher priority thread which is runable. It
is not entered and exited. 

Probably the best you can do is replace the idle thread with your own
thread which modulates a GPIO. That is it toggles it endlessly
high/low/high/low. When it is toggling you know the CPU is idle. When
it is steady state, it is busy.

What you might also find interesting is packages/services/cpuload

     Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]