Skip to content

Commit 4034dff

Browse files
committed
Merge remote-tracking branch 'origin/master' into ralio_update_mercury_board
2 parents b2d1977 + 9592c2b commit 4034dff

Some content is hidden

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

53 files changed

+1333
-816
lines changed

.github/workflows/build-ide.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
- name: Build Sketches
5353
env:
5454
ESP8266_ARDUINO_BUILDER: "arduino"
55-
ESP8266_ARDUINO_IDE: "${{ runner.temp }}/arduino_ide"
5655
ESP8266_ARDUINO_LWIP: ${{ matrix.lwip }}
5756
run: |
5857
bash ./tests/build.sh 8 ${{ matrix.chunk }}
@@ -75,8 +74,6 @@ jobs:
7574
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh', 'tests/build.sh') }}
7675
- name: Build Sketch
7776
env:
78-
ESP8266_ARDUINO_HARDWARE: "${{ runner.temp }}/hardware"
79-
ESP8266_ARDUINO_IDE: "${{ runner.temp }}/arduino_ide"
8077
ESP8266_ARDUINO_SKETCHES: "libraries/esp8266/examples/Blink/Blink.ino"
8178
run: |
8279
bash ./tests/build.sh
@@ -100,8 +97,6 @@ jobs:
10097
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh', 'tests/build.sh') }}
10198
- name: Build Sketch
10299
env:
103-
ESP8266_ARDUINO_HARDWARE: "${{ runner.temp }}/hardware"
104-
ESP8266_ARDUINO_IDE: "${{ runner.temp }}/arduino_ide"
105100
ESP8266_ARDUINO_SKETCHES: "libraries/esp8266/examples/Blink/Blink.ino"
106101
run: |
107102
bash ./tests/build.sh

cores/esp8266/Esp-version.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020

2121
#include <Arduino.h>
2222
#include <user_interface.h>
23-
#include <core_version.h>
2423
#include <lwipopts.h> // LWIP_HASH_STR (lwip2)
2524
#include <bearssl/bearssl_git.h> // BEARSSL_GIT short hash
2625

26+
#include <core_version.h>
27+
2728
#define STRHELPER(x) #x
2829
#define STR(x) STRHELPER(x) // stringifier
2930

cores/esp8266/Esp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ String EspClass::getCoreVersion()
254254
return String(core_release);
255255
}
256256
char buf[12];
257-
snprintf(buf, sizeof(buf), "%08x", core_version);
257+
snprintf(buf, sizeof(buf), PSTR("%08x"), core_version);
258258
return String(buf);
259259
}
260260

cores/esp8266/StackThunk.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ void stack_thunk_add_ref()
7373
}
7474
stack_thunk_top = stack_thunk_ptr + _stackSize - 1;
7575
stack_thunk_save = NULL;
76+
stack_thunk_yield_save = NULL;
7677
stack_thunk_repaint();
7778
}
7879
}
@@ -90,6 +91,7 @@ void stack_thunk_del_ref()
9091
stack_thunk_ptr = NULL;
9192
stack_thunk_top = NULL;
9293
stack_thunk_save = NULL;
94+
stack_thunk_yield_save = NULL;
9395
}
9496
}
9597

@@ -175,15 +177,18 @@ asm(
175177
"movi a2, stack_thunk_yield_save\n\t"
176178
"s32i.n a1, a2, 0\n\t"
177179
"movi a2, stack_thunk_save\n\t"
180+
/* But, only when inside of bssl stack (saved a1 != 0) */
181+
"l32i.n a3, a2, 0\n\t"
182+
"beqz a3, stack_thunk_yield_do_yield\n\t"
178183
"l32i.n a1, a2, 0\n\t"
179184
/* optimistic_yield(10000) without extra l32r */
185+
"stack_thunk_yield_do_yield:\n\t"
180186
"movi a2, 0x10\n\t"
181187
"addmi a2, a2, 0x2700\n\t"
182188
"call0 optimistic_yield\n\t"
183189
/* Swap bearssl <-> cont stacks, again */
184190
"movi a2, stack_thunk_yield_save\n\t"
185191
"l32i.n a1, a2, 0\n\t"
186-
"\n"
187192
/* Restore caller */
188193
"l32i.n a0, a1, 12\n\t"
189194
"addi a1, a1, 16\n\t"

cores/esp8266/StackThunk.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#ifndef _STACKTHUNK_H
2828
#define _STACKTHUNK_H
2929

30+
#include <stdint.h>
31+
3032
#ifdef __cplusplus
3133
extern "C" {
3234
#endif
@@ -80,9 +82,11 @@ thunk_"#fcnToThunk":\n\
8082
call0 stack_thunk_fatal_smashing\n\
8183
.L1"#fcnToThunk":\n\
8284
movi a15, stack_thunk_save /* Restore A1(SP) */\n\
83-
l32i.n a1, a15, 0\n\
84-
l32i.n a15, a1, 8 /* Restore the saved registers */\n\
85-
l32i.n a0, a1, 12\n\
85+
l32i.n a1, a15, 0/* Restore A1(SP) */\n\
86+
movi a0, 0 /* Purge temporary storage */\n\
87+
s32i.n a0, a15, 0\n\
88+
l32i.n a15, a1, 8/* Restore A15 */\n\
89+
l32i.n a0, a1, 12/* Restore A0 */\n\
8690
addi a1, a1, 16 /* Free up stack and return to caller */\n\
8791
ret\n\
8892
.size thunk_"#fcnToThunk", . - thunk_"#fcnToThunk"\n");

doc/conf.py

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
extensions = [
3535
'nbsphinx',
3636
'sphinx.ext.mathjax',
37+
'sphinx_rtd_theme',
3738
]
39+
3840
# Add any paths that contain templates here, relative to this directory.
3941
templates_path = ['_templates']
4042

@@ -49,8 +51,9 @@
4951

5052
# General information about the project.
5153
project = u'ESP8266 Arduino Core'
52-
copyright = u'2017, Ivan Grokhotkov'
54+
slug = re.sub(r'\W+', '-', project.lower())
5355
author = u'Ivan Grokhotkov'
56+
copyright = author
5457

5558
# The version info for the project you're documenting, acts as replacement for
5659
# |version| and |release|, also used in various other places throughout the
@@ -71,7 +74,13 @@
7174
# List of patterns, relative to source directory, that match files and
7275
# directories to ignore when looking for source files.
7376
# This patterns also effect to html_static_path and html_extra_path
74-
exclude_patterns = ['_venv', '_build', 'Thumbs.db', '.DS_Store']
77+
exclude_patterns = [
78+
'_readthedocs',
79+
'_venv',
80+
'_build',
81+
'Thumbs.db',
82+
'.DS_Store',
83+
]
7584

7685
# The name of the Pygments (syntax highlighting) style to use.
7786
pygments_style = 'sphinx'
@@ -85,7 +94,7 @@
8594
# The theme to use for HTML and HTML Help pages. See the documentation for
8695
# a list of builtin themes.
8796
#
88-
html_theme = 'default'
97+
html_theme = 'sphinx_rtd_theme'
8998

9099
# Theme options are theme-specific and customize the look and feel of a theme
91100
# further. For a list of options available for each theme, see the
@@ -98,12 +107,12 @@
98107
# so a file named "default.css" will overwrite the builtin "default.css".
99108
html_static_path = ['_static']
100109

101-
102110
# -- Options for HTMLHelp output ------------------------------------------
103111

104-
# Output file base name for HTML help builder.
105-
htmlhelp_basename = 'ESP8266ArduinoCoredoc'
112+
html_show_sourcelink = True
106113

114+
# Output file base name for HTML help builder.
115+
htmlhelp_basename = slug
107116

108117
# -- Options for LaTeX output ---------------------------------------------
109118

@@ -129,8 +138,7 @@
129138
# (source start file, target name, title,
130139
# author, documentclass [howto, manual, or own class]).
131140
latex_documents = [
132-
(master_doc, 'ESP8266ArduinoCore.tex', u'ESP8266 Arduino Core Documentation',
133-
u'Ivan Grokhotkov', 'manual'),
141+
(master_doc, f'{slug}.tex', f'{project} Documentation', author, 'manual'),
134142
]
135143

136144

@@ -139,8 +147,7 @@
139147
# One entry per manual page. List of tuples
140148
# (source start file, name, description, authors, manual section).
141149
man_pages = [
142-
(master_doc, 'esp8266arduinocore', u'ESP8266 Arduino Core Documentation',
143-
[author], 1)
150+
(master_doc, slug, f'{project} Documentation', [author], 1)
144151
]
145152

146153

@@ -150,19 +157,7 @@
150157
# (source start file, target name, title, author,
151158
# dir menu entry, description, category)
152159
texinfo_documents = [
153-
(master_doc, 'ESP8266ArduinoCore', u'ESP8266 Arduino Core Documentation',
154-
author, 'ESP8266ArduinoCore', 'One line description of project.',
155-
'Miscellaneous'),
160+
(master_doc, slug, f'{project} Documentation', author, slug, project, 'Miscellaneous'),
156161
]
157162

158163
linkcheck_anchors_ignore = ["/#!"]
159-
160-
# -- Use sphinx_rtd_theme for local builds --------------------------------
161-
# ref. https://github.com/snide/sphinx_rtd_theme#using-this-theme-locally-then-building-on-read-the-docs
162-
#
163-
# on_rtd is whether we are on readthedocs.org
164-
env_readthedocs = os.environ.get('READTHEDOCS', None)
165-
166-
if not env_readthedocs: # only import and set the theme if we're building docs locally
167-
import sphinx_rtd_theme
168-
html_theme = 'sphinx_rtd_theme'

doc/faq/readme.rst renamed to doc/faq.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Please feel free to contribute if you believe that some frequent issues
1313
are not covered below.
1414

1515

16-
I am getting "espcomm\_sync failed" error when trying to upload my ESP. How to resolve this issue?
17-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
I am getting "espcomm\_sync failed", "esptool.FatalError", etc. How to resolve this issue?
17+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1818

1919
This message indicates issue with uploading ESP module over a serial
2020
connection. There are couple of possible causes, that depend on the type
2121
of your module, if you use separate USB to serial converter.
2222

23-
`Read more <a01-espcomm_sync-failed.rst>`__.
23+
`Read more <faq/a01-upload-failed.rst>`__.
2424

2525
Why esptool is not listed in "Programmer" menu? How do I upload ESP without it?
2626
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -38,7 +38,7 @@ My ESP crashes running some code. How to troubleshoot it?
3838
The code may crash because of s/w bug or issue with your h/w. Before
3939
entering an issue report, please perform initial troubleshooting.
4040

41-
`Read more <a02-my-esp-crashes.rst>`__.
41+
`Read more <faq/a02-my-esp-crashes.rst>`__.
4242

4343
How can I get some extra KBs in flash ?
4444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -50,7 +50,7 @@ How can I get some extra KBs in flash ?
5050

5151
* Use the debug level option ``NoAssert-NDEBUG`` (in the Tools menu)
5252

53-
`Read more <a05-board-generator.rst>`__.
53+
`Read more <faq/a05-board-generator.rst>`__.
5454

5555
About WPS
5656
~~~~~~~~~
@@ -63,7 +63,7 @@ required to enable it:
6363

6464
``./tools/boards.txt.py --allowWPS --boardsgen``
6565

66-
`Read more <a05-board-generator.rst>`__.
66+
`Read more <faq/a05-board-generator.rst>`__.
6767

6868
For platformIO (and maybe other build environments), you will also need to add the build flag: -D NO_EXTRA_4K_HEAP
6969

@@ -77,7 +77,7 @@ This Arduino library doesn't work on ESP. How do I make it work?
7777
You would like to use this Arduino library with ESP8266 and it does not
7878
perform. It is not listed among libraries verified to work with ESP8266.
7979

80-
`Read more <a03-library-does-not-work.rst>`__.
80+
`Read more <faq/a03-library-does-not-work.rst>`__.
8181

8282
In the IDE, for ESP-12E that has 4M flash, I can choose 4M (1M FS) or 4M (3M FS). No matter what I select, the IDE tells me the maximum code space is about 1M. Where does my flash go?
8383
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -118,7 +118,7 @@ This error may pop up after switching between
118118
`staging <https://github.com/esp8266/Arduino#staging-version->`__ and
119119
`stable <https://github.com/esp8266/Arduino#stable-version->`__ esp8266
120120
/ Arduino package installations, or after upgrading the package version
121-
`Read more <a04-board-generic-is-unknown.rst>`__.
121+
`Read more <faq/a04-board-generic-is-unknown.rst>`__.
122122

123123

124124
How to clear TCP PCBs in time-wait state ?
@@ -199,4 +199,4 @@ By using a uniquely named `.h` file, macro definitions can be created and
199199
globally used. Additionally, compiler command-line options can be embedded in
200200
this file as a unique block comment.
201201

202-
`Read more <a06-global-build-options.rst>`__.
202+
`Read more <faq/a06-global-build-options.rst>`__.

0 commit comments

Comments
 (0)