diff --git a/cpu/atmega_common/periph/adc.c b/cpu/atmega_common/periph/adc.c index e0be23ada6..13c6b54ca6 100644 --- a/cpu/atmega_common/periph/adc.c +++ b/cpu/atmega_common/periph/adc.c @@ -99,7 +99,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int sample = 0; diff --git a/cpu/cc2538/periph/adc.c b/cpu/cc2538/periph/adc.c index 3b8a705389..07ab6fc3ad 100644 --- a/cpu/cc2538/periph/adc.c +++ b/cpu/cc2538/periph/adc.c @@ -51,7 +51,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { /* check if adc line valid */ if (line >= ADC_NUMOF) { diff --git a/cpu/efm32/periph/adc.c b/cpu/efm32/periph/adc.c index 01b2e52429..345d267292 100644 --- a/cpu/efm32/periph/adc.c +++ b/cpu/efm32/periph/adc.c @@ -59,7 +59,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { /* resolutions larger than 12 bits are not supported */ if (res >= ADC_MODE_UNDEF(0)) { diff --git a/cpu/esp32/periph/adc.c b/cpu/esp32/periph/adc.c index 8dd816de5d..b38476df63 100644 --- a/cpu/esp32/periph/adc.c +++ b/cpu/esp32/periph/adc.c @@ -149,7 +149,7 @@ int adc_init(adc_t line) } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { CHECK_PARAM_RET (line < ADC_NUMOF, -1) CHECK_PARAM_RET (res <= ADC_RES_12BIT, -1) diff --git a/cpu/esp8266/periph/adc.c b/cpu/esp8266/periph/adc.c index 6615cfed18..a5f4b498c4 100644 --- a/cpu/esp8266/periph/adc.c +++ b/cpu/esp8266/periph/adc.c @@ -42,7 +42,7 @@ int adc_init(adc_t line) } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { CHECK_PARAM_RET (line < ADC_NUMOF, -1) CHECK_PARAM_RET (res == ADC_RES_10BIT, -1) diff --git a/cpu/kinetis/periph/adc.c b/cpu/kinetis/periph/adc.c index 2648637578..3b9b78cbd0 100644 --- a/cpu/kinetis/periph/adc.c +++ b/cpu/kinetis/periph/adc.c @@ -207,7 +207,7 @@ int adc_init(adc_t line) return res; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int sample; diff --git a/cpu/lm4f120/periph/adc.c b/cpu/lm4f120/periph/adc.c index 756698d4e2..ca4077978a 100644 --- a/cpu/lm4f120/periph/adc.c +++ b/cpu/lm4f120/periph/adc.c @@ -100,7 +100,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int value[2]; diff --git a/cpu/nrf51/periph/adc.c b/cpu/nrf51/periph/adc.c index 4a95a169ba..996b3f943f 100644 --- a/cpu/nrf51/periph/adc.c +++ b/cpu/nrf51/periph/adc.c @@ -55,7 +55,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int val; diff --git a/cpu/nrf52/periph/adc.c b/cpu/nrf52/periph/adc.c index 7ecd219784..4559c351f6 100644 --- a/cpu/nrf52/periph/adc.c +++ b/cpu/nrf52/periph/adc.c @@ -103,7 +103,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { assert(line < ADC_NUMOF); diff --git a/cpu/sam0_common/periph/adc.c b/cpu/sam0_common/periph/adc.c index 7760a2b935..c1d11bf2a2 100644 --- a/cpu/sam0_common/periph/adc.c +++ b/cpu/sam0_common/periph/adc.c @@ -164,7 +164,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { if (line >= ADC_NUMOF) { DEBUG("adc: line arg not applicable\n"); diff --git a/cpu/sam3/periph/adc.c b/cpu/sam3/periph/adc.c index 1c2651e670..7cd58b652e 100644 --- a/cpu/sam3/periph/adc.c +++ b/cpu/sam3/periph/adc.c @@ -68,7 +68,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { assert(line < ADC_NUMOF); diff --git a/cpu/stm32f0/periph/adc.c b/cpu/stm32f0/periph/adc.c index fe97e5e46b..8ae960dfc8 100644 --- a/cpu/stm32f0/periph/adc.c +++ b/cpu/stm32f0/periph/adc.c @@ -75,7 +75,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int sample; diff --git a/cpu/stm32f1/periph/adc.c b/cpu/stm32f1/periph/adc.c index 83c215b448..2c68df9430 100644 --- a/cpu/stm32f1/periph/adc.c +++ b/cpu/stm32f1/periph/adc.c @@ -125,7 +125,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int sample; diff --git a/cpu/stm32f2/periph/adc.c b/cpu/stm32f2/periph/adc.c index 041979d681..ccaa90c438 100644 --- a/cpu/stm32f2/periph/adc.c +++ b/cpu/stm32f2/periph/adc.c @@ -111,7 +111,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int sample; diff --git a/cpu/stm32f4/periph/adc.c b/cpu/stm32f4/periph/adc.c index 4d07a93364..80cb2ead6d 100644 --- a/cpu/stm32f4/periph/adc.c +++ b/cpu/stm32f4/periph/adc.c @@ -94,7 +94,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int sample; diff --git a/cpu/stm32l0/periph/adc.c b/cpu/stm32l0/periph/adc.c index cbb9a3cd3b..0693dcea2d 100644 --- a/cpu/stm32l0/periph/adc.c +++ b/cpu/stm32l0/periph/adc.c @@ -123,7 +123,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int sample; diff --git a/cpu/stm32l1/periph/adc.c b/cpu/stm32l1/periph/adc.c index 497f020012..8cebee2fc9 100644 --- a/cpu/stm32l1/periph/adc.c +++ b/cpu/stm32l1/periph/adc.c @@ -152,7 +152,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int sample; diff --git a/cpu/stm32l4/periph/adc.c b/cpu/stm32l4/periph/adc.c index 7b9340ca9d..3a567fd484 100644 --- a/cpu/stm32l4/periph/adc.c +++ b/cpu/stm32l4/periph/adc.c @@ -179,7 +179,7 @@ int adc_init(adc_t line) return 0; } -int adc_sample(adc_t line, adc_res_t res) +int32_t adc_sample(adc_t line, adc_res_t res) { int sample; diff --git a/drivers/include/periph/adc.h b/drivers/include/periph/adc.h index d4e6458b3e..16105c355d 100644 --- a/drivers/include/periph/adc.h +++ b/drivers/include/periph/adc.h @@ -56,6 +56,7 @@ #define PERIPH_ADC_H #include +#include #include "periph_cpu.h" #include "periph_conf.h" @@ -125,7 +126,7 @@ int adc_init(adc_t line); * @return the sampled value on success * @return -1 if resolution is not applicable */ -int adc_sample(adc_t line, adc_res_t res); +int32_t adc_sample(adc_t line, adc_res_t res); #ifdef __cplusplus }