remove nwdelay
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user