Skip to content

Commit 4f863ba

Browse files
marcin-wierzbickimmahadevan108
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 <[email protected]>
1 parent 10fbd1d commit 4f863ba

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

mcux/mcux-sdk-ng/README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ Patch List:
4343
- drivers/caam/fsl_caam.c: Move used job descriptors in the CAAM driver from the stack to noncacheable section. At time of writing, there should
4444
be four being used for entropy in zephyr.
4545
- drivers/s3mu/fsl_s3mu.c: rename _BIT macro to avoid collision from util_macro.h in Zephyr
46+
- drivers/adc12/fsl_adc12.c: add guards to avoid compilation warnings when building
47+
with SDK clock control driver disabled.

mcux/mcux-sdk-ng/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)