mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-02 10:53:01 +02:00
Fixed PU/PD support.
This commit is contained in:
@@ -137,16 +137,19 @@ namespace Pins {
|
||||
// Handle attributes:
|
||||
uint8_t pinModeValue = 0;
|
||||
|
||||
if (value.has(PinAttributes::PullUp)) {
|
||||
pinModeValue |= INPUT_PULLUP;
|
||||
} else if (value.has(PinAttributes::PullDown)) {
|
||||
pinModeValue |= INPUT_PULLDOWN;
|
||||
} else if (value.has(PinAttributes::Input)) {
|
||||
if (value.has(PinAttributes::Input)) {
|
||||
pinModeValue |= INPUT;
|
||||
} else if (value.has(PinAttributes::Output)) {
|
||||
pinModeValue |= OUTPUT;
|
||||
}
|
||||
|
||||
// PU/PD should be specified by the user. Code has nothing to do with them:
|
||||
if (_attributes.has(PinAttributes::PullUp)) {
|
||||
pinModeValue |= PULLUP;
|
||||
} else if (_attributes.has(PinAttributes::PullDown)) {
|
||||
pinModeValue |= PULLDOWN;
|
||||
}
|
||||
|
||||
// If the pin is ActiveLow, we should take that into account here:
|
||||
if (value.has(PinAttributes::InitialOn)) {
|
||||
__digitalWrite(_index, HIGH ^ _readWriteMask);
|
||||
|
Reference in New Issue
Block a user