[ECOS] changing the length of a tick

Jonathan Larmour jlarmour@redhat.com
Fri Mar 1 11:39:00 GMT 2002


Tom Coremans wrote:
> 
> Jonathan Larmour wrote:
> 
> > Tom Coremans wrote:
> > >
> > > Hi,
> > >
> > > I`m trying to change the length of tick  to 50 milli seconds with the
> > > following code:
> > >
> > > ________________________
> > > cyg_handle_t rclock;
> > > cyg_resolution_t res;
> > > cyg_uint32 nsec_per_tick = 50000000;
> > > res.dividend = nsec_per_tick;
> > > res.divisor = 1;
> > > rclock = cyg_real_time_clock();
> > > cyg_clock_set_resolution(rclock,res);
> > > _____________________
> > >
> > > but when I run a test this doesn`t seem to work.
> > > It seems there are still 100 ticks in a second, the default
> > > configuration.
> > >
> > > Does anybody know whats wrong with this?
> >
> > The configured resolution has to reflect what the clock actually does. In
> > this case there is nothing that actually tells the clock hardware to do
> > anything other than 100 ticks per second (10000000 ns/tick). It's just that
> > now eCos will *think* when it got a tick that is 20 ticks per second.
> >
> > Look at how the kernel uses the HAL to configure the real hardware and do
> > the same thing.
> >
> 
> I have changed the resolution of the real time clock in the configtool under
> an option concerning the hal and now it works fine and the tests run correct.
> 
> Is there a way to do this in the code of your application program?

What I was referring to when I wrote the above was
HAL_CLOCK_INITIALIZE( period ) as per kernel/current/src/common/clock.cxx
 
> And what do you accomplish by the fact that ecos *thinks* it got 20 ticks a
> second?

The point is that eCos has to know what the ticks convert to in real
seconds!

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

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



More information about the Ecos-discuss mailing list