СИНТАКСИС
rtapi_clock_set_period(long int nsec);
АРГУМЕНТИ
- nsec
-
Бажаний базовий часовий інтервал для завдань реального часу.
ОПИС
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.
МІРКУВАННЯ В РЕАЛЬНОМУ ЧАСІ
Викликати лише з коду ініціалізації/очищення, а не з завдань реального часу. Ця функція недоступна з коду, що не працює в реальному часі.
ПОВЕРНЕНЕ ЗНАЧЕННЯ
Фактичний період, наданий RTOS, який може відрізнятися від запитуваного періоду, або код стану RTAPI.