Skip to content

Commit 141e260

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 5abe062 + f05ed6e commit 141e260

File tree

7 files changed

+31
-18
lines changed

7 files changed

+31
-18
lines changed

cores/esp8266/Schedule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ static scheduled_fn_t* sLastUnused = 0;
1414

1515
static int sCount = 0;
1616

17+
static void init_lists() __attribute__((unused));
1718
static void init_lists()
1819
{
19-
(void) init_lists;
2020
if (sCount != 0) {
2121
return;
2222
}

cores/esp8266/pgmspace.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,23 @@ int vsnprintf_P(char *str, size_t strSize, PGM_P formatP, va_list ap) __attribut
9999
:"1"(addr) \
100100
:);
101101

102-
static inline uint8_t pgm_read_byte(const void* addr) {
102+
static inline uint8_t pgm_read_byte_inlined(const void* addr) {
103103
register uint32_t res;
104104
pgm_read_with_offset(addr, res);
105105
return (uint8_t) res; /* This masks the lower byte from the returned word */
106106
}
107107

108108
/* Although this says "word", it's actually 16 bit, i.e. half word on Xtensa */
109-
static inline uint16_t pgm_read_word(const void* addr) {
109+
static inline uint16_t pgm_read_word_inlined(const void* addr) {
110110
register uint32_t res;
111111
pgm_read_with_offset(addr, res);
112112
return (uint16_t) res; /* This masks the lower half-word from the returned word */
113113
}
114114

115+
// Make sure, that libraries checking existence of this macro are not failing
116+
#define pgm_read_byte(addr) pgm_read_byte_inlined(addr)
117+
#define pgm_read_word(addr) pgm_read_word_inlined(addr)
118+
115119
#else //__ets__
116120
#define pgm_read_byte(addr) (*reinterpret_cast<const uint8_t*>(addr))
117121
#define pgm_read_word(addr) (*reinterpret_cast<const uint16_t*>(addr))

doc/esp8266wifi/readme.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,13 @@ Some functions provide more than just a binary status information. A good exampl
233233
234234
Serial.printf("Connection status: %d\n", WiFi.status());
235235
236-
This function returns following codes to describe what is going on with Wi-Fi connection: \* 0 : ``WL_IDLE_STATUS`` when Wi-Fi is in process of changing between statuses \* 1 : ``WL_NO_SSID_AVAIL``\ in case configured SSID cannot be reached \* 3 : ``WL_CONNECTED`` after successful connection is established \* 4 : ``WL_CONNECT_FAILED`` if password is incorrect \* 6 : ``WL_DISCONNECTED`` if module is not configured in station mode
236+
This function returns following codes to describe what is going on with Wi-Fi connection:
237+
238+
* 0 : ``WL_IDLE_STATUS`` when Wi-Fi is in process of changing between statuses
239+
* 1 : ``WL_NO_SSID_AVAIL``\ in case configured SSID cannot be reached
240+
* 3 : ``WL_CONNECTED`` after successful connection is established
241+
* 4 : ``WL_CONNECT_FAILED`` if password is incorrect
242+
* 6 : ``WL_DISCONNECTED`` if module is not configured in station mode
237243

238244
It is a good practice to display and check information returned by functions. Application development and troubleshooting will be easier with that.
239245

doc/libraries.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ESP8266WiFi library has been developed basing on ESP8266 SDK, using naming conve
1111
Ticker
1212
------
1313

14-
Library for calling functions repeatedly with a certain period. Two examples included.
14+
Library for calling functions repeatedly with a certain period. `Two examples <https://github.com/esp8266/Arduino/tree/master/libraries/Ticker/examples>`__ included.
1515

1616
It is currently not recommended to do blocking IO operations (network, serial, file) from Ticker callback functions. Instead, set a flag inside the ticker callback and check for that flag inside the loop function.
1717

@@ -27,7 +27,7 @@ This is a bit different from standard EEPROM class. You need to call ``EEPROM.be
2727

2828
EEPROM library uses one sector of flash located just after the SPIFFS.
2929

30-
Three examples included.
30+
`Three examples <https://github.com/esp8266/Arduino/tree/master/libraries/EEPROM>`__ included.
3131

3232
I2C (Wire library)
3333
------------------

libraries/ESP8266WiFi/src/WiFiClientSecure.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,16 @@ class SSLContext
9393
SSL_EXTENSIONS* ext = ssl_ext_new();
9494
ssl_ext_set_host_name(ext, hostName);
9595
ssl_ext_set_max_fragment_size(ext, 4096);
96-
s_io_ctx = ctx;
9796
if (_ssl) {
97+
/* Creating a new TLS session on top of a new TCP connection.
98+
ssl_free will want to send a close notify alert, but the old TCP connection
99+
is already gone at this point, so reset s_io_ctx. */
100+
s_io_ctx = nullptr;
98101
ssl_free(_ssl);
102+
_available = 0;
103+
_read_ptr = nullptr;
99104
}
105+
s_io_ctx = ctx;
100106
_ssl = ssl_client_new(_ssl_ctx, 0, nullptr, 0, ext);
101107
uint32_t t = millis();
102108

libraries/SPI/SPI.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,11 @@ void SPIClass::write16(uint16_t data, bool msb) {
343343
if(msb) {
344344
// MSBFIRST Byte first
345345
SPI1W0 = (data >> 8) | (data << 8);
346-
SPI1CMD |= SPIBUSY;
347346
} else {
348347
// LSBFIRST Byte first
349348
SPI1W0 = data;
350-
SPI1CMD |= SPIBUSY;
351349
}
350+
SPI1CMD |= SPIBUSY;
352351
while(SPI1CMD & SPIBUSY) {}
353352
}
354353

@@ -367,14 +366,11 @@ void SPIClass::write32(uint32_t data, bool msb) {
367366
} data_;
368367
data_.l = data;
369368
// MSBFIRST Byte first
370-
SPI1W0 = (data_.b[3] | (data_.b[2] << 8) | (data_.b[1] << 16) | (data_.b[0] << 24));
371-
SPI1CMD |= SPIBUSY;
372-
} else {
373-
// LSBFIRST Byte first
374-
SPI1W0 = data;
375-
SPI1CMD |= SPIBUSY;
369+
data = (data_.b[3] | (data_.b[2] << 8) | (data_.b[1] << 16) | (data_.b[0] << 24));
376370
}
377-
while(SPI1CMD & SPIBUSY) {}
371+
SPI1W0 = data;
372+
SPI1CMD |= SPIBUSY;
373+
while(SPI1CMD & SPIBUSY) {}
378374
}
379375

380376
/**
@@ -402,16 +398,17 @@ void SPIClass::writeBytes_(uint8_t * data, uint8_t size) {
402398
// Set Bits to transfer
403399
setDataBits(size * 8);
404400

405-
volatile uint32_t * fifoPtr = &SPI1W0;
401+
uint32_t * fifoPtr = (uint32_t*)&SPI1W0;
406402
uint32_t * dataPtr = (uint32_t*) data;
407-
uint8_t dataSize = ((size + 3) / 4);
403+
uint32_t dataSize = ((size + 3) / 4);
408404

409405
while(dataSize--) {
410406
*fifoPtr = *dataPtr;
411407
dataPtr++;
412408
fifoPtr++;
413409
}
414410

411+
__sync_synchronize();
415412
SPI1CMD |= SPIBUSY;
416413
while(SPI1CMD & SPIBUSY) {}
417414
}

tools/sdk/lib/libaxtls.a

228 KB
Binary file not shown.

0 commit comments

Comments
 (0)