This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: C API for timer and watchdog
- From: "Trenton D. Adams" <tadams at theone dot dnsalias dot com>
- To: "'Jonathan Larmour'" <jlarmour at redhat dot com>,"'Sam Sortais'" <sams at myself dot com>
- Cc: <ecos-discuss at sources dot redhat dot com>
- Date: Fri, 7 Dec 2001 11:51:33 -0700
- Subject: RE: [ECOS] C API for timer and watchdog
How hard would it be to add this functionality in to redboot? I imagine
it wouldn't be that difficult right? This would be a nice feature for
testing purposes.
> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [mailto:ecos-discuss-owner@sources.redhat.com] On Behalf Of
> Jonathan Larmour
> Sent: December 7, 2001 11:45 AM
> To: Sam Sortais
> Cc: ecos-discuss@sources.redhat.com
> Subject: Re: [ECOS] C API for timer and watchdog
>
>
> Sam Sortais wrote:
> >
> > Hi all,
> >
> > I am using eCos on PC and was hopping to use C API but
> found different issues:
> >
> > 1) I noticed a watchdog component in the code, (not found
> in PC latest doc, maybe under development ?) so I was
> wondering if it was supported by PC platform.
> > Looking at the code it seems support is there and use an
> emulation mode with RTC.
> > However the only interface seems to be in C++ and if I want
> to do call in C I will have to write a wrapper.
>
> Sorry yes.
>
> > On the same topic I did not found a wrapper for Timer API in C.
> > Is the only way to use POSIX interface ?
>
> Actually you can use the C library time() function.
>
> > 2)Still about API, is there anyway (in C) to know what is
> the current state of a thread ?
>
> There isn't a well defined way, but you can access the
> "state" member of a
> cyg_thread structure. The values are:
>
> RUNNING = 0, // Thread is runnable or running
> SLEEPING = 1, // Thread is waiting for something to
> happen
> COUNTSLEEP = 2, // Sleep in counted manner
> SUSPENDED = 4, // Suspend count is non-zero
> CREATING = 8, // Thread is being created
> EXITED = 16, // Thread has exited
>
>
> > 3) After loading and starting an application with RedBoot,
> I was hopping to go back to RedBoot when the application
> terminate, so I can load a new one. Is it the way it is
> supposed to work ?
>
> If you load using GDB this happens (when you quit GDB, which
> sends a "kill"
> packet). If you load directly it doesn't.
>
> Jifl
> --
> Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44
> (1223) 271062
> Maybe this world is another planet's Hell -Aldous Huxley ||
> Opinions==mine
>