remove nwdelay

This commit is contained in:
technyon
2022-06-17 22:22:54 +02:00
parent cccee489c3
commit 6fa2782ab7
2 changed files with 4 additions and 21 deletions

View File

@@ -41,8 +41,6 @@ void W5500Device::initialize()
_mqttClient->setBufferSize(_mqttMaxBufferSize);
reconnect();
_fromTask = true;
}
@@ -85,7 +83,7 @@ bool W5500Device::reconnect()
Ethernet.begin(_mac, ip);
Ethernet.setSubnetMask(subnet);
nwDelay(1000);
delay(1000);
}
else
{
@@ -110,11 +108,11 @@ void W5500Device::resetDevice()
Serial.println(F("Resetting network hardware."));
pinMode(ETHERNET_RESET_PIN, OUTPUT);
digitalWrite(ETHERNET_RESET_PIN, HIGH);
nwDelay(250);
delay(250);
digitalWrite(ETHERNET_RESET_PIN, LOW);
nwDelay(50);
delay(50);
digitalWrite(ETHERNET_RESET_PIN, HIGH);
nwDelay(1500);
delay(1500);
}
@@ -161,18 +159,6 @@ void W5500Device::initializeMacAddress(byte *mac)
}
}
void W5500Device::nwDelay(unsigned long ms)
{
if(_fromTask)
{
vTaskDelay( ms / portTICK_PERIOD_MS);
}
else
{
delay(ms);
}
}
void W5500Device::update()
{
_maintainResult = Ethernet.maintain();

View File

@@ -24,9 +24,6 @@ public:
private:
void resetDevice();
void initializeMacAddress(byte* mac);
void nwDelay(unsigned long ms);
bool _fromTask = false;
EthernetClient* _ethClient = nullptr;
PubSubClient* _mqttClient = nullptr;