Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

15.1.73. alt_sysclk_init()

Prototype

int alt_sysclk_init (alt_u32 nticks)

Commonly Called By

Device drivers

Thread-safe

No.

Available from ISR

No.

Include

<sys/alt_alarm.h>

Description

The alt_sysclk_init() function registers the presence of a system clock driver. The input argument is the number of ticks per second at which the system clock is run.

The expectation is that this function is only called from within alt_sys_init(), that is, while the system is running in single-threaded mode. Concurrent calls to this function might lead to unpredictable results.

Return

This function returns zero on success; otherwise it returns a negative value. The call can fail if a system clock driver is already registered, or if no system clock device is available.