1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

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)))
FEATURES_REQUIRED += arduino
FEATURES_REQUIRED += periph_adc
FEATURES_OPTIONAL += periph_adc
FEATURES_REQUIRED += periph_gpio
USEMODULE += xtimer
endif

View File

@ -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

View File

@ -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 */
/** @} */