Add RawDev::interruptMode (#2042)

This commit is contained in:
Juraj Andrássy 2024-03-06 20:58:37 +01:00 committed by GitHub
parent ea8874037c
commit 9c94bab290
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 25 additions and 1 deletions

View file

@ -48,6 +48,10 @@ public:
return true;
}
PinStatus interruptMode() {
return LOW;
}
constexpr bool needsSPI() const {
return false;
}

View file

@ -91,6 +91,10 @@ public:
return true;
}
PinStatus interruptMode() {
return LOW;
}
void setSSID(const char *p) {
_ssid = p;
}

View file

@ -47,6 +47,10 @@ public:
return false;
}
PinStatus interruptMode() {
return HIGH;
}
constexpr bool needsSPI() const {
return false;
}

View file

@ -399,7 +399,7 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
if (RawDev::interruptIsPossible()) {
noInterrupts(); // Ensure this is atomically set up
pinMode(_intrPin, INPUT);
attachInterruptParam(_intrPin, _irq, LOW, (void*)this);
attachInterruptParam(_intrPin, _irq, RawDev::interruptMode(), (void*)this);
__addEthernetGPIO(_intrPin);
interrupts();
} else {

View file

@ -102,6 +102,10 @@ protected:
return true;
}
static constexpr PinStatus interruptMode() {
return LOW;
}
/**
Read an Ethernet frame size
@return the length of data do receive

View file

@ -104,6 +104,10 @@ protected:
return true;
}
static constexpr PinStatus interruptMode() {
return LOW;
}
/**
Read an Ethernet frame size
@return the length of data do receive

View file

@ -107,6 +107,10 @@ protected:
return true;
}
static constexpr PinStatus interruptMode() {
return LOW;
}
/**
Read an Ethernet frame size
@return the length of data do receive