next up previous contents index
Next: 13.6.3 fs_init: Provide a Up: 13.6 Initialization Functions Previous: 13.6.1 oskit_init_libc: Initialize the

13.6.2 set_system_clock: initialize clock support

 

SYNOPSIS

#include <oskit/c/sys/time.h>

void set_system_clock(struct oskit_clock *clock);

DESCRIPTION

This function provides the C library with a clock device. A typical call sequence in a standalone application might be as follows:
        #define LOCAL_TO_GMT(t) (t)->tv_sec += secondswest

        void start_clock()
        {
                oskit_timespec_t time;
                /* use fdev's default clock device */
                oskit_clock_t    *clock = oskit_clock_init();

                oskit_rtc_get(&time); 	/* read rtc */
                LOCAL_TO_GMT(&time);		/* adjust for local time */
                oskit_clock_settime(clock, &time); /* set time */

                set_system_clock(clock);
        }

PARAMETERS

clock
A pointer to an instance implementing the oskit_clock interface.



University of Utah Flux Research Group