diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-08-21 20:27:15 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-08-22 09:58:58 -0400 |
commit | 1022729a2adbeeb985848e82bb07f7af4d079c06 (patch) | |
tree | 84665cfd82f576ef79c6ca6aace816dbbe4da570 /src/lpc176x/adc.c | |
parent | 6409eda0580810599422c2a8a2ddce171d9e47ad (diff) | |
download | kutter-1022729a2adbeeb985848e82bb07f7af4d079c06.tar.gz kutter-1022729a2adbeeb985848e82bb07f7af4d079c06.tar.xz kutter-1022729a2adbeeb985848e82bb07f7af4d079c06.zip |
lpc176x: Update code to use armcm_boot mechanism
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/lpc176x/adc.c')
-rw-r--r-- | src/lpc176x/adc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lpc176x/adc.c b/src/lpc176x/adc.c index e89d73a4..97e24c16 100644 --- a/src/lpc176x/adc.c +++ b/src/lpc176x/adc.c @@ -4,8 +4,8 @@ // // This file may be distributed under the terms of the GNU GPLv3 license. -#include "LPC17xx.h" // LPC_PINCON #include "autoconf.h" // CONFIG_CLOCK_FREQ +#include "board/armcm_boot.h" // armcm_enable_irq #include "board/irq.h" // irq_save #include "board/misc.h" // timer_from_us #include "command.h" // shutdown @@ -37,7 +37,7 @@ static struct { enum { ADC_DONE=0x0100 }; // ADC hardware irq handler -void __visible +void ADC_IRQHandler(void) { uint32_t pos = adc_status.pos, chan = adc_status.chan & 0xff; @@ -71,8 +71,7 @@ gpio_adc_setup(uint8_t pin) LPC_ADC->ADCR = adc_status.adcr = (1<<21) | ((prescal & 0xff) << 8); LPC_ADC->ADINTEN = 0xff; adc_status.chan = ADC_DONE; - NVIC_SetPriority(ADC_IRQn, 0); - NVIC_EnableIRQ(ADC_IRQn); + armcm_enable_irq(ADC_IRQHandler, ADC_IRQn, 0); } gpio_peripheral(pin, adc_pin_funcs[chan], 0); |