Skip to content

Commit bd07a63

Browse files
author
Spacehuhn
committed
Updated ESP8266 core to 2.6.3
1 parent 8e794e1 commit bd07a63

File tree

212 files changed

+1545
-22361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+1545
-22361
lines changed

wifiduck/esp8266/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Arduino core for ESP8266 WiFi chip
33

44
# Quick links
55

6-
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.6.0/)
6+
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.6.2/)
77
- [Current "git version" documentation](https://arduino-esp8266.readthedocs.io/en/latest/)
88
- [Install git version](https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version) ([sources](doc/installing.rst#using-git-version))
99

@@ -36,7 +36,7 @@ Starting with 1.6.4, Arduino allows installation of third-party platform package
3636
#### Latest release [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/)
3737
Boards manager link: `https://arduino.esp8266.com/stable/package_esp8266com_index.json`
3838

39-
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.6.0/](https://arduino-esp8266.readthedocs.io/en/2.6.0/)
39+
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.6.2/](https://arduino-esp8266.readthedocs.io/en/2.6.2/)
4040

4141
### Using git version
4242
[![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino)

wifiduck/esp8266/boards.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ menu.ESPModule=Module
1010
menu.debug=Debug
1111
menu.protocol=Protocol
1212

13-
menu.led=Builtin Led
13+
#menu.led=Builtin Led
1414
menu.baud=Upload Speed
1515
menu.xtal=CPU Frequency
1616
menu.CrystalFreq=Crystal Frequency

wifiduck/esp8266/bootloaders/eboot/eboot.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,14 @@ int copy_raw(const uint32_t src_addr,
128128
void main()
129129
{
130130
int res = 9;
131+
bool clear_cmd = false;
131132
struct eboot_command cmd;
132133

133134
print_version(0);
134135

135136
if (eboot_command_read(&cmd) == 0) {
136137
// valid command was passed via RTC_MEM
137-
eboot_command_clear();
138+
clear_cmd = true;
138139
ets_putc('@');
139140
} else {
140141
// no valid command found
@@ -155,6 +156,10 @@ void main()
155156
}
156157
}
157158

159+
if (clear_cmd) {
160+
eboot_command_clear();
161+
}
162+
158163
if (cmd.action == ACTION_LOAD_APP) {
159164
ets_putc('l'); ets_putc('d'); ets_putc('\n');
160165
res = load_app_from_flash_raw(cmd.args[0]);
4.06 KB
Binary file not shown.

wifiduck/esp8266/cores/esp8266/HardwareSerial.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ HardwareSerial::HardwareSerial(int uart_nr)
3636
: _uart_nr(uart_nr), _rx_size(256)
3737
{}
3838

39-
void HardwareSerial::begin(unsigned long baud, SerialConfig config, SerialMode mode, uint8_t tx_pin)
39+
void HardwareSerial::begin(unsigned long baud, SerialConfig config, SerialMode mode, uint8_t tx_pin, bool invert)
4040
{
4141
end();
42-
_uart = uart_init(_uart_nr, baud, (int) config, (int) mode, tx_pin, _rx_size);
42+
_uart = uart_init(_uart_nr, baud, (int) config, (int) mode, tx_pin, _rx_size, invert);
4343
#if defined(DEBUG_ESP_PORT) && !defined(NDEBUG)
4444
if (static_cast<void*>(this) == static_cast<void*>(&DEBUG_ESP_PORT))
4545
{
@@ -133,7 +133,7 @@ unsigned long HardwareSerial::testBaudrate()
133133
unsigned long HardwareSerial::detectBaudrate(time_t timeoutMillis)
134134
{
135135
esp8266::polledTimeout::oneShotFastMs timeOut(timeoutMillis);
136-
unsigned long detectedBaudrate;
136+
unsigned long detectedBaudrate = 0;
137137
while (!timeOut) {
138138
if ((detectedBaudrate = testBaudrate())) {
139139
break;

wifiduck/esp8266/cores/esp8266/HardwareSerial.h

+9-4
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,23 @@ class HardwareSerial: public Stream
7373

7474
void begin(unsigned long baud)
7575
{
76-
begin(baud, SERIAL_8N1, SERIAL_FULL, 1);
76+
begin(baud, SERIAL_8N1, SERIAL_FULL, 1, false);
7777
}
7878
void begin(unsigned long baud, SerialConfig config)
7979
{
80-
begin(baud, config, SERIAL_FULL, 1);
80+
begin(baud, config, SERIAL_FULL, 1, false);
8181
}
8282
void begin(unsigned long baud, SerialConfig config, SerialMode mode)
8383
{
84-
begin(baud, config, mode, 1);
84+
begin(baud, config, mode, 1, false);
8585
}
8686

87-
void begin(unsigned long baud, SerialConfig config, SerialMode mode, uint8_t tx_pin);
87+
void begin(unsigned long baud, SerialConfig config, SerialMode mode, uint8_t tx_pin)
88+
{
89+
begin(baud, config, mode, tx_pin, false);
90+
}
91+
92+
void begin(unsigned long baud, SerialConfig config, SerialMode mode, uint8_t tx_pin, bool invert);
8893

8994
void end();
9095

wifiduck/esp8266/cores/esp8266/Print.cpp

+12-4
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,19 @@ size_t Print::printf_P(PGM_P format, ...) {
104104
size_t Print::print(const __FlashStringHelper *ifsh) {
105105
PGM_P p = reinterpret_cast<PGM_P>(ifsh);
106106

107+
char buff[128] __attribute__ ((aligned(4)));
108+
auto len = strlen_P(p);
107109
size_t n = 0;
108-
while (1) {
109-
uint8_t c = pgm_read_byte(p++);
110-
if (c == 0) break;
111-
n += write(c);
110+
while (n < len) {
111+
int to_write = std::min(sizeof(buff), len - n);
112+
memcpy_P(buff, p, to_write);
113+
auto written = write(buff, to_write);
114+
n += written;
115+
p += written;
116+
if (!written) {
117+
// Some error, write() should write at least 1 byte before returning
118+
break;
119+
}
112120
}
113121
return n;
114122
}

wifiduck/esp8266/cores/esp8266/Schedule.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void run_scheduled_functions();
4646

4747
// recurrent scheduled function:
4848
//
49-
// * Internal queue may not be a FIFO.
49+
// * Internal queue is a FIFO.
5050
// * Run the lambda periodically about every <repeat_us> microseconds until
5151
// it returns false.
5252
// * Note that it may be more than <repeat_us> microseconds between calls if
@@ -60,6 +60,7 @@ void run_scheduled_functions();
6060
// recurrent function.
6161
// * If alarm is used, anytime during scheduling when it returns true,
6262
// any remaining delay from repeat_us is disregarded, and fn is executed.
63+
6364
bool schedule_recurrent_function_us(const std::function<bool(void)>& fn,
6465
uint32_t repeat_us, const std::function<bool(void)>& alarm = nullptr);
6566

wifiduck/esp8266/cores/esp8266/StackThunk.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ uint32_t *stack_thunk_top = NULL;
3636
uint32_t *stack_thunk_save = NULL; /* Saved A1 while in BearSSL */
3737
uint32_t stack_thunk_refcnt = 0;
3838

39-
#define _stackSize (5748/4)
39+
/* Largest stack usage seen in the wild at scripts.google.com at 5828 */
40+
#define _stackSize (5900/4)
4041
#define _stackPaint 0xdeadbeef
4142

4243
/* Add a reference, and allocate the stack if necessary */

wifiduck/esp8266/cores/esp8266/TZ.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
// autogenerated from https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
33
// by script <esp8266 arduino core>/tools/TZupdate.sh
4-
// Thu Nov 14 08:41:55 UTC 2019
4+
// Mon Dec 16 13:08:18 UTC 2019
55
//
66
// This database is autogenerated from IANA timezone database
77
// https://www.iana.org/time-zones

wifiduck/esp8266/cores/esp8266/Updater.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ bool UpdaterClass::_writeBuffer(){
329329
bool modifyFlashMode = false;
330330
FlashMode_t flashMode = FM_QIO;
331331
FlashMode_t bufferFlashMode = FM_QIO;
332-
if (_currentAddress == _startAddress + FLASH_MODE_PAGE) {
332+
if ((_currentAddress == _startAddress + FLASH_MODE_PAGE) && (_command == U_FLASH)) {
333333
flashMode = ESP.getFlashChipMode();
334334
#ifdef DEBUG_UPDATER
335335
DEBUG_UPDATER.printf_P(PSTR("Header: 0x%1X %1X %1X %1X\n"), _buffer[0], _buffer[1], _buffer[2], _buffer[3]);

wifiduck/esp8266/cores/esp8266/core_esp8266_features.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232

3333
#define WIFI_HAS_EVENT_CALLBACK
3434

35-
#ifdef __cplusplus
36-
3735
#include <stdlib.h> // malloc()
3836
#include <stddef.h> // size_t
37+
#include <stdint.h>
38+
39+
#ifdef __cplusplus
3940

4041
namespace arduino
4142
{

wifiduck/esp8266/cores/esp8266/core_esp8266_main.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,15 @@ static void esp_yield_within_cont() {
100100
run_scheduled_recurrent_functions();
101101
}
102102

103-
extern "C" void esp_yield() {
103+
extern "C" void __esp_yield() {
104104
if (can_yield()) {
105105
esp_yield_within_cont();
106106
}
107107
}
108108

109-
extern "C" void esp_schedule() {
110-
// always on CONT stack here
109+
extern "C" void esp_yield() __attribute__ ((weak, alias("__esp_yield")));
110+
111+
extern "C" IRAM_ATTR void esp_schedule() {
111112
ets_post(LOOP_TASK_PRIORITY, 0, 0);
112113
}
113114

0 commit comments

Comments
 (0)