Re: [chrony-dev] [PATCH 1/2] New refclock for RTCs

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Wed, Jun 30, 2021 at 04:47:21PM +0200, Uwe Kleine-König wrote:
> This refclock uses an RTC as reference source. If the RTC doesn't
> support reporting an update event this source is quite coarse as it
> usually needs a slow bus access to be read and has a precision of only
> one second. If reporting an update event is available, the time is read
> just after such an event which improves precision.

Have you considered reusing the existing rtc_linux.c code? I'd prefer
avoid duplicating the code unless there is a good reason for it. If it
needs some refactoring, I think that would be fine.

>  if [ $feat_refclock = "1" ]; then
>    add_def FEAT_REFCLOCK
> -  EXTRA_OBJECTS="$EXTRA_OBJECTS refclock.o refclock_phc.o refclock_pps.o refclock_shm.o refclock_sock.o"
> +  EXTRA_OBJECTS="$EXTRA_OBJECTS refclock.o refclock_phc.o refclock_pps.o refclock_shm.o refclock_sock.o refclock_rtc.o"
>  fi

I think this needs to be conditioned on Linux and also the RTC support
if its code will be reused.

> +
> +static int refrtc_initialise(RCL_Instance instance) {

Just a nit. Please follow the coding style of the existing code.

-- 
Miroslav Lichvar


-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/