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:
parent
dd736a42b9
commit
c4bb2a2e17
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
/** @} */
|
||||
|
Loading…
Reference in New Issue
Block a user