|
1 | 1 | // MIT License |
2 | 2 | // |
3 | | -// Copyright 2016-2019 Electric Imp |
| 3 | +// Copyright 2016-2021 Electric Imp |
4 | 4 | // |
5 | 5 | // SPDX-License-Identifier: MIT |
6 | 6 | // |
@@ -270,7 +270,7 @@ const W5500_INTERRUPT_POLL_TIME_ACTIVE = 0.01; |
270 | 270 |
|
271 | 271 | class W5500 { |
272 | 272 |
|
273 | | - static VERSION = "2.2.0"; |
| 273 | + static VERSION = "2.2.1"; |
274 | 274 |
|
275 | 275 | _driver = null; |
276 | 276 | // Set to true once the driver is loaded and connection to chip made |
@@ -2151,6 +2151,7 @@ class W5500.Connection { |
2151 | 2151 | _driver.closeConnection(_socket, _getHandler("close")); |
2152 | 2152 | _handlers = {}; |
2153 | 2153 | if (_interrupt_timer) imp.cancelwakeup(_interrupt_timer); |
| 2154 | + _interrupt_timer = null; |
2154 | 2155 | } |
2155 | 2156 |
|
2156 | 2157 |
|
@@ -2266,6 +2267,8 @@ class W5500.Connection { |
2266 | 2267 | // Parameters: socket the interrupt occurred on |
2267 | 2268 | // ************************************************************************** |
2268 | 2269 | function handleInterrupt(skip_timer = false) { |
| 2270 | + if (_interrupt_timer) imp.cancelwakeup(_interrupt_timer); |
| 2271 | + _interrupt_timer = null; |
2269 | 2272 |
|
2270 | 2273 | local status = _driver.getSocketInterruptTypeStatus(_socket); |
2271 | 2274 |
|
@@ -2393,7 +2396,6 @@ class W5500.Connection { |
2393 | 2396 | } |
2394 | 2397 |
|
2395 | 2398 | // Scan the interrupt again very soon |
2396 | | - if (_interrupt_timer) imp.cancelwakeup(_interrupt_timer); |
2397 | 2399 | if (_socket in _driver._connections) { |
2398 | 2400 | local timer_time = ("receive" in _handlers) ? W5500_INTERRUPT_POLL_TIME_ACTIVE : W5500_INTERRUPT_POLL_TIME_IDLE; |
2399 | 2401 | _interrupt_timer = imp.wakeup(timer_time, handleInterrupt.bindenv(this)) |
|
0 commit comments