nxp-mcuxpresso / mcux-sdk

MCUXpresso SDK
BSD 3-Clause "New" or "Revised" License
301 stars 136 forks source link

drivers: pit: fix compiler warning when clocks disabled #142

Closed manuargue closed 9 months ago

manuargue commented 9 months ago

Prerequisites

Describe the pull request Add missing guards to avoid compilation warnings when building PIT driver with clock control driver disabled. Example of warning without this patch:

[136/182] Building C object modules/hal_nxp/hal_nxp/CM...__hal__nxp.dir/mcux/mcux-sdk/drivers/pit/fsl_pit.c.ob 
C:/Users/user/zephyr/modules/hal/nxp/mcux/mcux-sdk/drivers/pit/fsl_pit.c:42:17: warning: 'PIT_GetInstance' defined but not used [-Wunused-function]
   42 | static uint32_t PIT_GetInstance(PIT_Type *base)
      |

Type of change

Tests

manuargue commented 9 months ago

Hi @mcuxsusan, FYI, I found this issue when integrating PIT driver for a Zephyr board. Not a blocking issue but an annoyance. We can patch it in Zephyr's HAL NXP side in the meantime.