[][src]Function wpilib_sys::bindings::HAL_Initialize

pub unsafe extern "C" fn HAL_Initialize(timeout: i32, mode: i32) -> HAL_Bool

Call this to start up HAL. This is required for robot programs.

This must be called before any other HAL functions. Failure to do so will result in undefined behavior, and likely segmentation faults. This means that any statically initialized variables in a program MUST call this function in their constructors if they want to use other HAL calls.

The common parameters are 500 for timeout and 0 for mode.

This function is safe to call from any thread, and as many times as you wish. It internally guards from any reentrancy.

The applicable modes are: 0: Try to kill an existing HAL from another program, if not successful, error. 1: Force kill a HAL from another program. 2: Just warn if another hal exists and cannot be killed. Will likely result in undefined behavior.

@param timeout the initialization timeout (ms) @param mode the initialization mode (see remarks) @return true if initialization was successful, otherwise false.