pru: Don't reset the ADC reset complete flag if a shutdown occurs

Only set the have_done_reset flag if the reset completes successfully.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-10-18 13:05:36 -04:00
parent cbd06f1433
commit 75ba375b8a
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,6 @@ adc_full_reset(void)
static uint8_t have_done_reset; static uint8_t have_done_reset;
if (have_done_reset) if (have_done_reset)
return; return;
have_done_reset = 1;
// Disable ADC // Disable ADC
ADC->ctrl = (1<<2); ADC->ctrl = (1<<2);
@ -49,6 +48,7 @@ adc_full_reset(void)
if (!readl(&ADC->ctrl)) if (!readl(&ADC->ctrl))
shutdown("ADC module not enabled"); shutdown("ADC module not enabled");
have_done_reset = 1;
} }
struct gpio_adc struct gpio_adc