lpc176x: Move enable_peripheral_clock to main.c

Move and rename function to enable_pclock() - in keeping with other
ARM ports.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2019-01-04 10:58:50 -05:00
parent 8f7fc4e6a9
commit a40df4b6f7
9 changed files with 32 additions and 23 deletions

View File

@@ -38,9 +38,9 @@ gpio_adc_setup(uint8_t pin)
uint32_t prescal = DIV_ROUND_UP(CONFIG_CLOCK_FREQ*4, ADC_FREQ_MAX) - 1;
uint32_t adcr = (1<<21) | ((prescal & 0xff) << 8);
if (!(LPC_SC->PCONP & (1<<PCLK_ADC))) {
if (!is_enabled_pclock(PCLK_ADC)) {
// Power up ADC
enable_peripheral_clock(PCLK_ADC);
enable_pclock(PCLK_ADC);
LPC_ADC->ADCR = adcr;
}