Skip to content
Snippets Groups Projects
Commit da9e632a authored by Martin Ling's avatar Martin Ling
Browse files

Fix broken ADC init in SDK.

This reverts part of ffce77e1.
parent 4707b441
No related branches found
No related tags found
No related merge requests found
Pipeline #2501 passed
......@@ -122,6 +122,9 @@ typedef struct {
#define MXC_F_ADC_CTRL_REFBUF_PWR_POS 3 /**< CTRL_REFBUF_PWR Position */
#define MXC_F_ADC_CTRL_REFBUF_PWR ((uint32_t)(0x1UL << MXC_F_ADC_CTRL_REFBUF_PWR_POS)) /**< CTRL_REFBUF_PWR Mask */
#define MXC_F_ADC_CTRL_CHGPUMP_PWR_POS 4 /**< CTRL_CHGPUMP_PWR Position */
#define MXC_F_ADC_CTRL_CHGPUMP_PWR ((uint32_t)(0x1UL << MXC_F_ADC_CTRL_CHGPUMP_PWR_POS)) /**< CTRL_CHGPUMP_PWR Mask */
#define MXC_F_ADC_CTRL_REF_SEL_POS 4 /**< CTRL_REF_SEL Position */
#define MXC_F_ADC_CTRL_REF_SEL ((uint32_t)(0x1UL << MXC_F_ADC_CTRL_REF_SEL_POS)) /**< CTRL_REF_SEL Mask */
......
......@@ -118,6 +118,7 @@ int ADC_Init(unsigned divisor, const sys_cfg_adc_t* sys_cfg)
// Power up the ADC
MXC_ADC->ctrl |= MXC_F_ADC_CTRL_PWR;
MXC_ADC->ctrl |= MXC_F_ADC_CTRL_REFBUF_PWR;
MXC_ADC->ctrl |= MXC_F_ADC_CTRL_CHGPUMP_PWR;
while ((MXC_ADC->intr & MXC_F_ADC_INTR_REF_READY_IF)>>MXC_F_ADC_INTR_REF_READY_IF_POS);
ADC_ClearFlags(MXC_F_ADC_INTR_REF_READY_IF);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment