Initialise ADC in main, not in sensor drivers

This commit is contained in:
George Oikonomou 2015-02-11 18:06:20 +01:00 committed by George Oikonomou
parent 3717522680
commit 12ac8e1fb5
2 changed files with 3 additions and 1 deletions

View file

@ -43,6 +43,7 @@
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#include "contiki.h" #include "contiki.h"
#include "dev/adc.h"
#include "dev/leds.h" #include "dev/leds.h"
#include "dev/sys-ctrl.h" #include "dev/sys-ctrl.h"
#include "dev/scb.h" #include "dev/scb.h"
@ -208,6 +209,8 @@ main(void)
process_start(&tcpip_process, NULL); process_start(&tcpip_process, NULL);
#endif /* NETSTACK_CONF_WITH_IPV6 */ #endif /* NETSTACK_CONF_WITH_IPV6 */
adc_init();
process_start(&sensors_process, NULL); process_start(&sensors_process, NULL);
energest_init(); energest_init();

View file

@ -79,7 +79,6 @@ configure(int type, int value)
GPIO_SET_INPUT(GPIO_A_BASE, ADC_ALS_OUT_PIN_MASK); GPIO_SET_INPUT(GPIO_A_BASE, ADC_ALS_OUT_PIN_MASK);
ioc_set_over(GPIO_A_NUM, ADC_ALS_OUT_PIN, IOC_OVERRIDE_ANA); ioc_set_over(GPIO_A_NUM, ADC_ALS_OUT_PIN, IOC_OVERRIDE_ANA);
adc_init();
break; break;
} }
return 0; return 0;