cyg_clock_sync_wallclock() — Force the wallclock to be updated from system time


#include <cyg/clock/api.h>

Cyg_ErrNo cyg_clock_sync_wallclock(cyg_bool wait_for_completion);


Calling this function instructs the clock management thread to update the time stored in the wallclock (RTC) device from the current system time.

Depending on the underlying wallclock hardware and driver implementation, this may block for an extended period, possibly over one second. If wait_for_completion is true, the function will not return until the wallclock has been updated. If wait_for_completion is false, it should not block, unless the eCos kernel is not in use. If there was a failure while updating the wallclock, this may only be reported if wait_for_completion is set.

Return value

This function returns a standard error code, as defined in <errno.h>, or ENOERR on success.