Gilles Chanteperdrix wrote: > Jan Kiszka wrote: > > +/* Timer operation modes */ > > +typedef enum xntimer_mode { > > + XNTM_MONOREL = 0, > > + XNTM_MONOABS = XNTIMER_ABSOLUTE, > > + XNTM_REALABS = XNTIMER_REALTIME | XNTIMER_ABSOLUTE > > +} xntimer_mode_t; > > Is not it a bit weird to use enums ? I meanç we use #defines everywhere > else.
I'm starting to like these kind of types, because they express what values are expected and allowed here. Anyway, if this is not desired, I can use plain defines again as well. > > > + default: /* XNTM_MONOABS || XNTM_REALABS */ > > date = xnarch_ns_to_tsc(value); > > if (date <= now) > > return -ETIMEDOUT; > > + __setbits(timer->status, XNTIMER_REALTIME); > > + break; > > Having the same treatment for absolute monotonic and realtime clocks > looks suspicious. Nope, please have a look at the two line above this excerpt, they should explain the difference. > > > > + default: /* XNTM_MONOABS || XNTM_REALABS */ > > if (value <= timer->base->jiffies) > > return -ETIMEDOUT; > > + __setbits(timer->status, XNTIMER_REALTIME); > > + break; > > Same here > > Thanks for a having a view, Jan
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core