sys/arduino: make ADC feature optional
This commit is contained in:
parent
dd736a42b9
commit
c4bb2a2e17
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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 */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user