This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Adjustable wallclock (get/settimeofday, adjtimex)?
- From: daniel dot neri at sigicom dot com (Daniel NÃri)
- To: ecos-discuss at sources dot redhat dot com
- Date: Mon, 27 Jun 2011 10:16:50 +0200
- Subject: [ECOS] Re: Adjustable wallclock (get/settimeofday, adjtimex)?
- References: <4E07AFED.6040405@meduna.org>
Hello,
Stanislav Meduna <stano@meduna.org> writes:
> I need to implement a NTP-like model soon, which means:
>
> - gettimeofday with best possible resolution and negligible
> call delay
> - settimeofday
> - the ability to speed up or slow the clock (adjtime/adjtimex
> or similar), both permanently or until the requested offset
> is compensated for; the clock must not go backward
I've described my approach in an older thread on this list:
http://thread.gmane.org/gmane.os.ecos.general/25842/
I never bothered with sub-second resolution for setting time
(settimeofday), so I just use cyg_libc_time_settime.
> - the ability to initialize from / store the current time to
> a battery-backed device
I've used a hybrid between the emulated wallclock and a "real" wallclock
device driver -- it only reads absolute time from the h/w via
Cyg_WallClock::init_hw_seconds and writes via
Cyg_WallClock::set_hw_seconds. Otherwise, it works like the emulated
wallclock driver.
Best regards,
Daniel
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss