From 986b304a3bde5c2634431327c27ad474e6edefee Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Wed, 28 Sep 2016 00:10:53 +0200 Subject: [PATCH] Changes to ADC API --- adc/main.c | 8 ++++---- ledstrip/main.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/adc/main.c b/adc/main.c index cbafb64..1a04719 100644 --- a/adc/main.c +++ b/adc/main.c @@ -60,7 +60,7 @@ const struct pio_config common_pins[] = { * ADC must be initialised prior to calls to adc_display() (it means that adc_on() * must be called before using this function. * adc_num is an ADC channel number (integer between 0 and 7) - * use LPC_ADC_NUM(x) for channel selection. + * use LPC_ADC(x) for channel selection. * returns ADC convertion value or negative value on error. */ int adc_display(int adc_num, int uart_num) @@ -107,15 +107,15 @@ int main(void) /* ADC Setup */ adc_on(NULL); - adc_prepare_conversion_on_event((LPC_ADC_CHANNEL(9) | LPC_ADC_CHANNEL(10)), + adc_prepare_conversion_on_event((ADC_MCH(9) | ADC_MCH(10)), LPC_ADC_START_CONV_SOFT, LPC_ADC_SEQA, 0, 0); while (1) { /* ADC Test */ adc_trigger_sequence_conversion(LPC_ADC_SEQA); msleep(10); - adc_display(LPC_ADC_NUM(9), UART0); - adc_display(LPC_ADC_NUM(10), UART0); + adc_display(LPC_ADC(9), UART0); + adc_display(LPC_ADC(10), UART0); } return 0; } diff --git a/ledstrip/main.c b/ledstrip/main.c index c88dc1b..6aeb812 100644 --- a/ledstrip/main.c +++ b/ledstrip/main.c @@ -100,9 +100,9 @@ void mode_adc_colors(void) uint16_t red = 0, green = 0, blue = 0; /* Get ADC values */ - adc_get_value(&red, LPC_ADC_NUM(2)); - adc_get_value(&green, LPC_ADC_NUM(9)); - adc_get_value(&blue, LPC_ADC_NUM(10)); + adc_get_value(&red, LPC_ADC(2)); + adc_get_value(&green, LPC_ADC(9)); + adc_get_value(&blue, LPC_ADC(10)); /* Set one pixel */ ws2812_set_pixel(pixel++, ((red >> 4) & 0xFF), ((green >> 4) & 0xFF), ((blue >> 4) & 0xFF)); msleep(5); @@ -125,7 +125,7 @@ int main(void) /* ADC for potentiometer color settings */ adc_on(NULL); - adc_start_burst_conversion(LPC_ADC_CHANNEL(2) | LPC_ADC_CHANNEL(9) | LPC_ADC_CHANNEL(10), LPC_ADC_SEQB); + adc_start_burst_conversion(ADC_MCH(2) | ADC_MCH(9) | ADC_MCH(10), LPC_ADC_SEQB); /* Led strip configuration */ ws2812_config(&ws2812_data_out_pin); -- 2.43.0