On Tue, Sep 11, 2012 at 4:19 PM, Kelvin Lawson <i...@atomthreads.com> wrote:
> Hi Ashwin, > > >> I would confirm that the timer interrupt is occurring. The timer ISR > >> is in atomport.c (TIMER1_COMPA_vect). > > > > Thanks for the reply. Yes timer interrupts are occurring but by default > > scheduler is not called. It works by calling scheduler in timer > interrupt. > > If you replaced the standard Atomthreads timer ISR with an alternative > one that didn't call the scheduler then that makes sense. > Actually I havn't replaced timer. Here is diff for working case. diff --git a/atomthreads/kernel/atomtimer.c b/atomthreads/kernel/atomtimer.c index 3693295..91eb053 100755 --- a/atomthreads/kernel/atomtimer.c +++ b/atomthreads/kernel/atomtimer.c @@ -68,7 +68,7 @@ #include "atom.h" /* Data types */ @@ -299,7 +299,7 @@ void atomTimerTick (void) { /* Increment the system tick count */ system_ticks++; - + atomSched(TRUE); /* Check for any callbacks that are due */ atomTimerCallbacks (); } > > Thanks, > Kelvin. > > > >> > I am new to embedded and have very little experience but I'm > very > >> > enthu abt it. Few days back I bought Arduino Uno with 32KB memory and > >> > 16Mhz. > >> > Later I found atomthread multi threading RTOS kernel on Internet. By > >> > changing some configuration port file for avr in the kernel I am able > >> > to run main thread (Thanks for excellent documentation). > >> > Even I have ported some cpp files from arduino to kernel and did some > >> > changes in Makefile to run LED blinking > >> > code in thread context that that too worked :-). I am using default > uart > >> > port provided by atomthread and its working. > >> > Even I am using printf for printing on serial port but I dont knw > >> > whether > >> > should I use printf or prinf_P but it working. > >> > > >> > Even I am able to create multiple threads and I can see all the prints > >> > in > >> > those thread. But I am not able to use atomTimerDelay > >> > in threadContex. Thread is going in hang state when I call this > >> > function. > >> > Here do I need to do some time call to so ?? > >> > Even when thread contex is over then this thread is recreated or board > >> > is > >> > re-booted. Is something wrong with scheduler or timer ?? > >> > > >> > -- > >> > With Regards, > >> > Ashwin Vasani > >> > +91 8446611430 > -- With Regards, Ashwin Vasani +91 8446611430