- Notifications
You must be signed in to change notification settings - Fork1k
Closed
Description
Goal of this issue is to be able to disable HAL module if not used in the sketch in order to reduce binary size.
- I2C: done thanks07dcdc4
- SPI: done thanksc41d8af
- ADC: done thankse4b1121
- DAC: done thanks68d3450
- TIM: done thanksb10696d
- UART: done thanks83d872f
- ETH: done thanks680e01b
- SD: done thankse0e90cc
- QSPI: done thanks4e25050
- RTC: done thanks0753358
- USB: done thanks Arduino menu.
- EXTI: done thanks0e1f5a7. Interrupt API does not used HAL EXTI module anyway API is cleaned with
HAL_EXTI_MODULE_DISABLED - RCC: mandatory. User can use LL to override
SystemClock_Config()
Mainly useful for MCU with smallflash size (See#165)
Proposition:
handle a default HAL conf file which could be override by end user at sketch level or variant.PeripheralPins arrays could also use new switch to force an array to be disable even if the HAL module is enabled.
Implementation done thanks#518
Extra HAL module can be enabled/disabled in
variant.hif required or in a file named (at sketch level):hal_conf_extra.h- To enable a HAL modules use the standard HAL definition:
HAL_PPP_MODULE_ENABLEDwithPPPthe peripheral to enable. - To disable a HAL modules use one or more following values:
HAL_ADC_MODULE_DISABLEDHAL_I2C_MODULE_DISABLEDHAL_RTC_MODULE_DISABLEDHAL_SPI_MODULE_DISABLEDHAL_DAC_MODULE_DISABLEDHAL_ETH_MODULE_DISABLEDHAL_SD_MODULE_DISABLEDHAL_QSPI_MODULE_DISABLEDHAL_EXTI_MODULE_DISABLEDHAL_TIM_MODULE_DISABLED
Note:HAL_UART_MODULE_ENABLEDandHAL_PCD_MODULE_ENABLEDare handled thanks Arduino menu.
- To enable a HAL modules use the standard HAL definition:
Custom HAL configuration file can replace the default one by adding a file named (at sketch level):
hal_conf_custom.h.