1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Merge pull request #9 from esp8266/esp8266

Esp8266
This commit is contained in:
Me No Dev
2015-06-23 10:59:21 +03:00
5 changed files with 258 additions and 18 deletions

View File

@ -124,9 +124,10 @@ int WiFiUDP::available() {
/* Release any resources being used by this WiFiUDP instance */
void WiFiUDP::stop()
{
if (_ctx)
if (_ctx) {
_ctx->disconnect();
_ctx->unref();
_ctx->unref();
}
_ctx = 0;
}
@ -271,6 +272,7 @@ uint16_t WiFiUDP::localPort()
void WiFiUDP::stopAll()
{
for (WiFiUDP* it = _s_first; it; it = it->_next) {
DEBUGV("%s %08x %08x\n", __func__, (uint32_t) it, (uint32_t) _s_first);
it->stop();
}
}

View File

@ -9,19 +9,21 @@ public:
protected:
static void _add(T* self) {
DEBUGV("%s %08x %08x\n", __func__, (uint32_t) self, (uint32_t) _s_first);
T* tmp = _s_first;
_s_first = self;
self->_next = tmp;
}
static void _remove(T* self) {
DEBUGV("%s %08x %08x\n", __func__, (uint32_t) self, (uint32_t) _s_first);
if (_s_first == self) {
_s_first = self->_next;
self->_next = 0;
return;
}
for (T* prev = _s_first; prev->_next; _s_first = _s_first->_next) {
for (T* prev = _s_first; prev->_next; prev = prev->_next) {
if (prev->_next == self) {
prev->_next = self->_next;
self->_next = 0;