Xduoo X3 no ADC after ROLO

Speachy suggested we don't shut down the adc on ROLO
this fixes the random adc drop out on ROLO

Change-Id: Ife7d679ce51a6f767963210ee650815f1de12223
This commit is contained in:
William Wilgus 2020-09-13 13:29:00 -04:00
parent c62493e98a
commit 3c2b6809d9
2 changed files with 8 additions and 0 deletions

View file

@ -286,7 +286,9 @@ int rolo_load(const char* filename)
lcd_remote_puts(0, 1, "Executing"); lcd_remote_puts(0, 1, "Executing");
lcd_remote_update(); lcd_remote_update();
#endif #endif
#if (CONFIG_KEYPAD != XDUOO_X3_PAD) /* X3 adc hangs on ROLO */
adc_close(); adc_close();
#endif
#if CONFIG_CPU == AS3525v2 #if CONFIG_CPU == AS3525v2
/* Set CVDD1 power supply to default*/ /* Set CVDD1 power supply to default*/
ascodec_write_pmu(0x17, 1, 0); ascodec_write_pmu(0x17, 1, 0);

View file

@ -260,6 +260,12 @@ int _battery_voltage(void)
void adc_init(void) void adc_init(void)
{ {
bat_val = ADC_MASK; bat_val = ADC_MASK;
/* don't re-init*/
if (!(REG_CPM_CLKGR0 & CLKGR0_SADC) && !(REG_SADC_ADENA & ADENA_POWER))
{
system_enable_irq(IRQ_SADC);
return;
}
__cpm_start_sadc(); __cpm_start_sadc();
mdelay(20); mdelay(20);