rtapi_clock_set_period - set the basic time interval for realtime tasks
rtapi_clock_set_period(long int nsec)
The desired basic time interval for realtime tasks.
rtapi_clock_set_period sets the basic time interval for realtime tasks. All periodic tasks will run at an integer multiple of this period. The first call to rtapi_clock_set_period with nsec greater than zero will start the clock, using nsec as the clock period in nano-seconds. Due to hardware and RTOS limitations, the actual period may not be exactly what was requested. On success, the function will return the actual clock period if it is available, otherwise it returns the requested period. If the requested period is outside the limits imposed by the hardware or RTOS, it returns -EINVAL and does not start the clock. Once the clock is started, subsequent calls with non-zero nsec return -EINVAL and have no effect. Calling rtapi_clock_set_period with nsec set to zero queries the clock, returning the current clock period, or zero if the clock has not yet been started.
Call only from within init/cleanup code, not from realtime tasks. This function is not available from user (non-realtime) code.
The actual period provided by the RTOS, which may be different than the requested period, or a RTAPI status code.