Skip to content

Commit 466000a

Browse files
marcin-wierzbickimanuargue
authored andcommitted
mcux: drivers: adc12: fix compiler warning
Add missing guards to avoid compilation warnings when building with SDK clock control driver disabled. Signed-off-by: Marcin Wierzbicki <marcin.wierzbicki@accenture.com>
1 parent da71f33 commit 466000a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

mcux/README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,5 @@ Patch List:
9797
- MCXA15x family
9898
- MCXN23x family
9999
- add kUSB_DeviceNotifySOF to usb_device_mcux_drv_port.h SDK USB stack already supports it in SDK 2.16.0
100+
- mcux-sdk/drivers/adc12/fsl_adc12.c: add guards to avoid compilation warnings when building
101+
with SDK clock control driver disabled.

mcux/mcux-sdk/drivers/adc12/fsl_adc12.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
*
3131
* @param base ADC12 peripheral base address
3232
*/
33+
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
3334
static uint32_t ADC12_GetInstance(ADC_Type *base);
35+
#endif
3436

3537
/*!
3638
* @brief Check calibration failed status.
@@ -62,15 +64,16 @@ static status_t ADC12_GetCalibrationStatus(ADC_Type *base);
6264
* Variables
6365
******************************************************************************/
6466
/*! @brief Pointers to ADC12 bases for each instance. */
65-
static ADC_Type *const s_adc12Bases[] = ADC_BASE_PTRS;
6667
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
68+
static ADC_Type *const s_adc12Bases[] = ADC_BASE_PTRS;
6769
/*! @brief Pointers to ADC12 clocks for each instance. */
6870
static const clock_ip_name_t s_adc12Clocks[] = ADC12_CLOCKS;
6971
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
7072

7173
/*******************************************************************************
7274
* Code
7375
******************************************************************************/
76+
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
7477
static uint32_t ADC12_GetInstance(ADC_Type *base)
7578
{
7679
uint32_t instance;
@@ -88,6 +91,7 @@ static uint32_t ADC12_GetInstance(ADC_Type *base)
8891

8992
return instance;
9093
}
94+
#endif
9195

9296
static status_t ADC12_GetCalibrationStatus(ADC_Type *base)
9397
{

0 commit comments

Comments
 (0)