Commit ae2a004d authored by Martin Ling's avatar Martin Ling Committed by schneider

Fix broken ADC init in SDK.

This reverts part of ffce77e1.
parent 6bf7c2d6
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment