mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-03 19:32:39 +02:00
Fixed a few bugs (backport)
This commit is contained in:
@@ -151,10 +151,13 @@ namespace Pins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the pin is ActiveLow, we should take that into account here:
|
// If the pin is ActiveLow, we should take that into account here:
|
||||||
if (value.has(PinAttributes::InitialOn)) {
|
if (value.has(PinAttributes::Output)) {
|
||||||
__digitalWrite(_index, HIGH ^ _readWriteMask);
|
if (value.has(PinAttributes::InitialOn)) {
|
||||||
} else {
|
__digitalWrite(_index, HIGH ^ _readWriteMask);
|
||||||
__digitalWrite(_index, LOW ^ _readWriteMask);
|
}
|
||||||
|
else {
|
||||||
|
__digitalWrite(_index, LOW ^ _readWriteMask);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__pinMode(_index, pinModeValue);
|
__pinMode(_index, pinModeValue);
|
||||||
|
@@ -55,16 +55,16 @@ void IRAM_ATTR digitalWrite(uint8_t pin, uint8_t val) {
|
|||||||
|
|
||||||
void IRAM_ATTR pinMode(uint8_t pin, uint8_t mode) {
|
void IRAM_ATTR pinMode(uint8_t pin, uint8_t mode) {
|
||||||
Pins::PinAttributes attr = Pins::PinAttributes::None;
|
Pins::PinAttributes attr = Pins::PinAttributes::None;
|
||||||
if (mode & OUTPUT) {
|
if ((mode & INPUT) == INPUT) {
|
||||||
attr = attr | Pins::PinAttributes::Output;
|
|
||||||
}
|
|
||||||
if (mode & INPUT) {
|
|
||||||
attr = attr | Pins::PinAttributes::Input;
|
attr = attr | Pins::PinAttributes::Input;
|
||||||
}
|
}
|
||||||
if (mode & INPUT_PULLUP) {
|
if ((mode & OUTPUT) == OUTPUT) {
|
||||||
|
attr = attr | Pins::PinAttributes::Output;
|
||||||
|
}
|
||||||
|
if ((mode & PULLUP) == PULLUP) {
|
||||||
attr = attr | Pins::PinAttributes::PullUp;
|
attr = attr | Pins::PinAttributes::PullUp;
|
||||||
}
|
}
|
||||||
if (mode & INPUT_PULLDOWN) {
|
if ((mode & PULLDOWN) == PULLDOWN) {
|
||||||
attr = attr | Pins::PinAttributes::PullDown;
|
attr = attr | Pins::PinAttributes::PullDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
// Define status reporting boolean enable bit flags in status_report_mask
|
// Define status reporting boolean enable bit flags in status_report_mask
|
||||||
enum RtStatus {
|
enum RtStatus {
|
||||||
Position = 0,
|
Position = bit(0),
|
||||||
Buffer = 1,
|
Buffer = bit(1),
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* errorString(Error errorNumber);
|
const char* errorString(Error errorNumber);
|
||||||
|
Reference in New Issue
Block a user