diff --git a/Makefile.dep b/Makefile.dep index 1339dbca5c..d609942a46 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -633,7 +633,7 @@ endif ifneq (,$(filter arduino,$(USEMODULE))) FEATURES_REQUIRED += arduino - FEATURES_REQUIRED += periph_adc + FEATURES_OPTIONAL += periph_adc FEATURES_REQUIRED += periph_gpio USEMODULE += xtimer endif diff --git a/sys/arduino/base.cpp b/sys/arduino/base.cpp index 8ead5b88cd..5faa6463df 100644 --- a/sys/arduino/base.cpp +++ b/sys/arduino/base.cpp @@ -77,6 +77,7 @@ unsigned long millis() return xtimer_now_usec64() / US_PER_MS; } +#if MODULE_PERIPH_ADC int analogRead(int arduino_pin) { /* @@ -104,3 +105,4 @@ int analogRead(int arduino_pin) return adc_value; } +#endif diff --git a/sys/arduino/include/arduino.hpp b/sys/arduino/include/arduino.hpp index 109c43497f..536f7fbbf8 100644 --- a/sys/arduino/include/arduino.hpp +++ b/sys/arduino/include/arduino.hpp @@ -110,6 +110,7 @@ unsigned long micros(); */ unsigned long millis(); +#if MODULE_PERIPH_ADC || DOXYGEN /** * @brief Read the current value of the given analog pin * @@ -119,6 +120,7 @@ unsigned long millis(); * to the voltage applied to the pin */ int analogRead(int pin); +#endif #endif /* ARDUINO_H */ /** @} */