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]

cyg_alarm_initialize() description is wrong in eCos reference.


I've been trying to use an alarm, and after a couple hours of
experimentation I've concluded that in the eCos reference the
description of cyg_alarm_initialize()'s second parameter is
wrong.  In the reference it says:

   The second argument indicates the number of events, for
   example clock ticks, that need to occur before the alarm
   triggers.

AFAICT, that's not correct.  Experimentation seems to indicate
that parameter is the counter value at which the alarm
triggers, _not_ the number of events that will occur before the
alarm triggers.

If you want the alarm to trigger after N events, the reference
would lead you to believe you pass N.  But, in reality you have
to pass the N+C where C is the current value of the counter.

The comments in clock.cxx appear to confirm this:

  //-------------------------------------------------------------------------
  // Initialize Alarm and enable

  void Cyg_Alarm::initialize(                
      cyg_tick_count    t,                // Absolute trigger time
      cyg_tick_count    i                 // Relative retrigger interval
      )

Here t is described as an absolute trigger value not a relative
trigger value as described in the reference.


-- 
Grant Edwards                   grante             Yow! It was a JOKE!!
                                  at               Get it??  I was receiving
                               visi.com            messages from DAVID
                                                   LETTERMAN!!  !


-- 
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]