From: Nathael Pajani Date: Mon, 21 Apr 2014 11:32:53 +0000 (+0200) Subject: Fix : call the ADC pin configuration ! Comments added, unused headers removed. X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=6e12beb9069d5896528fd8c67659d5e0da41db3c;p=soft%2Flpc122x%2Fcore Fix : call the ADC pin configuration ! Comments added, unused headers removed. --- diff --git a/drivers/adc.c b/drivers/adc.c index 3cffe61..7404320 100644 --- a/drivers/adc.c +++ b/drivers/adc.c @@ -44,6 +44,7 @@ void ADC_Handler(void) uint32_t status = adc->status; */ /* .... What to do ... is specific to your application */ + /* FIXME : Add an handler callback. */ } /* Start a conversion on the given channel (0 to 7) */ @@ -115,9 +116,11 @@ void adc_prepare_conversion_on_event(void) /* Unsupported Yet */ } -/* On LPC1224 there is no possibility to change the ADC resolution */ +/* Change the ADC resolution. */ void adc_set_resolution(int bits) { + /* On LPC1224 there is no possibility to change the ADC resolution */ + return; } @@ -126,7 +129,7 @@ void adc_set_resolution(int bits) /* ADC Setup : private part : Clocks, Pins, Power and Mode */ extern struct pio adc_pins[]; -void set_adc_pins(void) +static void set_adc_pins(void) { int i = 0; /* Configure ADC pins */ @@ -163,6 +166,9 @@ void adc_on(void) /* Prevent unconfigured conversion start */ adc->ctrl &= ~LPC_ADC_START_CONV_MASK; + /* Configure ADC pins */ + set_adc_pins(); + /* Enable ADC Interrupt */ NVIC_EnableIRQ(ADC_IRQ); } diff --git a/include/drivers/adc.h b/include/drivers/adc.h index 46f03dc..553f4b6 100644 --- a/include/drivers/adc.h +++ b/include/drivers/adc.h @@ -27,9 +27,6 @@ /***************************************************************************** */ #include -#include "core/lpc_regs_12xx.h" -#include "core/lpc_core_cm0.h" -#include "core/system.h" /* Start a conversion on the given channel (0 to 7) */ void adc_start_convertion_once(unsigned int channel, int use_int); @@ -54,13 +51,13 @@ void adc_start_burst_conversion(uint8_t channels); */ void adc_prepare_conversion_on_event(void); -/* On LPC1224 there is no possibility to change the ADC resolution */ +/* Change the ADC resolution. */ +/* Note : On LPC1224 there is no possibility to change the ADC resolution */ void adc_set_resolution(int bits); /***************************************************************************** */ /* ADC Setup : private part : Clocks, Pins, Power and Mode */ -void set_adc_pins(void); void adc_clk_update(void); void adc_on(void); void adc_off(void);