sys/arduino: make ADC feature optional

This commit is contained in:
Alexandre Abadie 2019-10-08 10:26:23 +02:00
parent dd736a42b9
commit c4bb2a2e17
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
3 changed files with 5 additions and 1 deletions

View File

@ -633,7 +633,7 @@ endif
ifneq (,$(filter arduino,$(USEMODULE))) ifneq (,$(filter arduino,$(USEMODULE)))
FEATURES_REQUIRED += arduino FEATURES_REQUIRED += arduino
FEATURES_REQUIRED += periph_adc FEATURES_OPTIONAL += periph_adc
FEATURES_REQUIRED += periph_gpio FEATURES_REQUIRED += periph_gpio
USEMODULE += xtimer USEMODULE += xtimer
endif endif

View File

@ -77,6 +77,7 @@ unsigned long millis()
return xtimer_now_usec64() / US_PER_MS; return xtimer_now_usec64() / US_PER_MS;
} }
#if MODULE_PERIPH_ADC
int analogRead(int arduino_pin) int analogRead(int arduino_pin)
{ {
/* /*
@ -104,3 +105,4 @@ int analogRead(int arduino_pin)
return adc_value; return adc_value;
} }
#endif

View File

@ -110,6 +110,7 @@ unsigned long micros();
*/ */
unsigned long millis(); unsigned long millis();
#if MODULE_PERIPH_ADC || DOXYGEN
/** /**
* @brief Read the current value of the given analog pin * @brief Read the current value of the given analog pin
* *
@ -119,6 +120,7 @@ unsigned long millis();
* to the voltage applied to the pin * to the voltage applied to the pin
*/ */
int analogRead(int pin); int analogRead(int pin);
#endif
#endif /* ARDUINO_H */ #endif /* ARDUINO_H */
/** @} */ /** @} */