Nios® II Software Developer Handbook

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

8.10.1. Provide Reduced Footprint Drivers

The HAL defines a C preprocessor macro named ALT_USE_SMALL_DRIVERS that you can use in driver source code to provide alternate behavior for systems that require a minimal code footprint. If ALT_USE_SMALL_DRIVERS is not defined, driver source code implements a fully featured version of the driver. If the macro is defined, the source code might provide a driver with restricted functionality. For example a driver might implement interrupt-driven operation by default, but polled (and presumable smaller) operation if ALT_USE_SMALL_DRIVERS is defined.

When writing a device driver, if you choose to ignore the value of ALT_USE_SMALL_DRIVERS, the same version of the driver is used regardless of the definition of this macro.

You can enable ALT_USE_SMALL_DRIVERS in a BSP with the hal.enable_reduced_device_drivers BSP setting.

For more information, refer to the " Nios® II Software Build Tools Reference" chapter.