Skip to content

Commit

Permalink
Merge pull request #4914 from gebart/pr/stm32f0-adc-default-error
Browse files Browse the repository at this point in the history
cpu/stm32f0: adc: Add default error cases
  • Loading branch information
Joakim Nohlgård committed Feb 28, 2016
2 parents b40b630 + ade9941 commit e1909d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpu/stm32f0/periph/adc.c
Expand Up @@ -53,6 +53,8 @@ int adc_init(adc_t dev, adc_precision_t precision)
(3 << ADC_0_CH4_PIN) | (3 << ADC_0_CH5_PIN));
break;
#endif
default:
return -1;
}

/* reset control registers */
Expand All @@ -79,7 +81,6 @@ int adc_init(adc_t dev, adc_precision_t precision)
case ADC_RES_16BIT:
adc_poweroff(dev);
return -1;
break;
}

/* configure sampling time to 41.5 cycles */
Expand Down Expand Up @@ -123,6 +124,8 @@ int adc_sample(adc_t dev, int channel)
}
break;
#endif
default:
return -1;
}

/* start single conversion */
Expand Down

0 comments on commit e1909d8

Please sign in to comment.