public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] cyg_thread_delay doesn't seem to be working
@ 2010-06-01  0:10 Aziz Bodal
  2010-06-01  0:35 ` [ECOS] " Grant Edwards
  0 siblings, 1 reply; 2+ messages in thread
From: Aziz Bodal @ 2010-06-01  0:10 UTC (permalink / raw)
  To: ecos-discuss

I am trying to used the cyg_thread_delay function in my cyg_user_start
function however it does not seem applying the delay. I am running the
following snippet and I do not see the output of cyg_current_time()
incrementing or even pausing. The cyg_current_time() always seems to
be 0 when I try to output it using printf.  What am I doing wrong?

        for (i=0; i < 100000; i++)
	{	
		printf("- %d\r", (int) cyg_current_time());
		cyg_thread_delay(5*100);
		printf("| %d\r", (int) cyg_current_time());
	}

Thanks.

Aziz

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ECOS] Re: cyg_thread_delay doesn't seem to be working
  2010-06-01  0:10 [ECOS] cyg_thread_delay doesn't seem to be working Aziz Bodal
@ 2010-06-01  0:35 ` Grant Edwards
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Edwards @ 2010-06-01  0:35 UTC (permalink / raw)
  To: ecos-discuss

On 2010-06-01, Aziz Bodal <azizbodal@gmail.com> wrote:

> I am trying to used the cyg_thread_delay function in my cyg_user_start
> function however it does not seem applying the delay. I am running the
> following snippet and I do not see the output of cyg_current_time()
> incrementing or even pausing. The cyg_current_time() always seems to
> be 0 when I try to output it using printf.  What am I doing wrong?

You can't use those routines in cyg_user_start() where the scheduler
and timer interrupt system aren't running.  Those only start after
cyg_user_start() returns.

Many years ago, there was a "System Startup chapter in the manual that
explained that sort of thing:

http://ecos.sourceware.org/docs-1.1/ref/ecos-ref/system-startup-cyg-user-start.html

But, that seems to be gone now.

The info on what you can do from cyg_user_start is now found in the
reference manual's "Kernel Overview" Chapter in a section on "Calling
Contexts". Unfortunately, the docs don't have any section numbering
scheme, so it's rather hard to cite them.

-- 
Grant


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-01  0:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-01  0:10 [ECOS] cyg_thread_delay doesn't seem to be working Aziz Bodal
2010-06-01  0:35 ` [ECOS] " Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).