Skip to content

Commit 2576a09

Browse files
authored
Merge branch 'master' into wifi_mesh_update_2.2
2 parents 5834c54 + 5d609fd commit 2576a09

File tree

113 files changed

+2876
-815
lines changed

Some content is hidden

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

113 files changed

+2876
-815
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ tools/xtensa-lx106-elf/
44
tools/mkspiffs/
55
tools/mklittlefs/
66
tools/python/
7+
tools/python3/
78
package/versions/
89
exclude.txt
910
tools/sdk/lib/liblwip_src.a

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ jobs:
107107
script: $TRAVIS_BUILD_DIR/tests/buildm.sh
108108
env: CC=gcc-7 CXX=g++-7
109109

110+
- name: "Mac OSX can build sketches"
111+
os: osx
112+
stage: build
113+
script: $TRAVIS_BUILD_DIR/tests/build.sh
114+
env: MACOSX=1 BUILD_PARITY=custom mod=500 rem=1
115+
116+
- name: "Windows can build sketches"
117+
os: windows
118+
stage: build
119+
script: $TRAVIS_BUILD_DIR/tests/build.sh
120+
env: WINDOWS=1 BUILD_PARITY=custom mod=500 rem=1
121+
110122
- name: "Boards"
111123
stage: build
112124
script: $TRAVIS_BUILD_DIR/tests/ci/build_boards.sh

boards.txt

Lines changed: 347 additions & 197 deletions
Large diffs are not rendered by default.

cores/esp8266/AddrList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ struct netifWrapper
128128
const char* ifmac () const { return (const char*)_netif->hwaddr; }
129129
int ifnumber () const { return _netif->num; }
130130
bool ifUp () const { return !!(_netif->flags & NETIF_FLAG_UP); }
131+
CONST netif* interface () const { return _netif; }
131132

132133
const ip_addr_t* ipFromNetifNum () const
133134
{

cores/esp8266/Arduino.h

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -142,30 +142,9 @@ void timer0_detachInterrupt(void);
142142
void ets_intr_lock();
143143
void ets_intr_unlock();
144144

145-
#ifndef __STRINGIFY
146-
#define __STRINGIFY(a) #a
147-
#endif
148-
149-
// these low level routines provide a replacement for SREG interrupt save that AVR uses
150-
// but are esp8266 specific. A normal use pattern is like
151-
//
152-
//{
153-
// uint32_t savedPS = xt_rsil(1); // this routine will allow level 2 and above
154-
// // do work here
155-
// xt_wsr_ps(savedPS); // restore the state
156-
//}
157-
//
158-
// level (0-15), interrupts of the given level and above will be active
159-
// level 15 will disable ALL interrupts,
160-
// level 0 will enable ALL interrupts,
161-
//
162-
#define xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state) :: "memory"); state;}))
163-
#define xt_wsr_ps(state) __asm__ __volatile__("wsr %0,ps; isync" :: "a" (state) : "memory")
164-
165145
#define interrupts() xt_rsil(0)
166146
#define noInterrupts() xt_rsil(15)
167147

168-
169148
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
170149
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
171150
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
@@ -272,8 +251,8 @@ using std::max;
272251
using std::isinf;
273252
using std::isnan;
274253

275-
#define _min(a,b) ((a)<(b)?(a):(b))
276-
#define _max(a,b) ((a)>(b)?(a):(b))
254+
#define _min(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a < _b? _a : _b; })
255+
#define _max(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a > _b? _a : _b; })
277256

278257
uint16_t makeWord(uint16_t w);
279258
uint16_t makeWord(byte h, byte l);

cores/esp8266/Esp.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,16 @@ class EspClass {
201201
bool eraseConfig();
202202

203203
#ifndef CORE_MOCK
204-
inline
205-
#endif
204+
inline uint32_t getCycleCount() __attribute__((always_inline));
205+
#else
206206
uint32_t getCycleCount();
207+
#endif
207208
};
208209

209210
#ifndef CORE_MOCK
210211
uint32_t EspClass::getCycleCount()
211212
{
212-
uint32_t ccount;
213-
__asm__ __volatile__("esync; rsr %0,ccount":"=a" (ccount));
214-
return ccount;
213+
return esp_get_cycle_count();
215214
}
216215

217216
#endif // !defined(CORE_MOCK)

cores/esp8266/HardwareSerial.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ void HardwareSerial::end()
6060
_uart = NULL;
6161
}
6262

63+
void HardwareSerial::updateBaudRate(unsigned long baud)
64+
{
65+
if(!_uart) {
66+
return;
67+
}
68+
69+
uart_set_baudrate(_uart, baud);
70+
}
71+
6372
size_t HardwareSerial::setRxBufferSize(size_t size){
6473
if(_uart) {
6574
_rx_size = uart_resize_rx_buffer(_uart, size);
@@ -121,9 +130,9 @@ unsigned long HardwareSerial::testBaudrate()
121130

122131
unsigned long HardwareSerial::detectBaudrate(time_t timeoutMillis)
123132
{
124-
time_t startMillis = millis();
133+
esp8266::polledTimeout::oneShotFastMs timeOut(timeoutMillis);
125134
unsigned long detectedBaudrate;
126-
while ((time_t) millis() - startMillis < timeoutMillis) {
135+
while (!timeOut) {
127136
if ((detectedBaudrate = testBaudrate())) {
128137
break;
129138
}
@@ -133,8 +142,8 @@ unsigned long HardwareSerial::detectBaudrate(time_t timeoutMillis)
133142
return detectedBaudrate;
134143
}
135144

136-
size_t HardwareSerial::readBytes(char* buffer, size_t size)
137-
{
145+
size_t HardwareSerial::readBytes(char* buffer, size_t size)
146+
{
138147
size_t got = 0;
139148

140149
while (got < size)
@@ -147,7 +156,7 @@ size_t HardwareSerial::readBytes(char* buffer, size_t size)
147156
got += read(buffer + got, std::min(size - got, avail));
148157
}
149158
return got;
150-
}
159+
}
151160

152161
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
153162
HardwareSerial Serial(UART0);

cores/esp8266/HardwareSerial.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ class HardwareSerial: public Stream
8888

8989
void end();
9090

91+
void updateBaudRate(unsigned long baud);
92+
9193
size_t setRxBufferSize(size_t size);
9294
size_t getRxBufferSize()
9395
{

cores/esp8266/Print.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ size_t Print::write(const uint8_t *buffer, size_t size) {
4545

4646
size_t n = 0;
4747
while (size--) {
48-
size_t ret = write(*buffer++);
48+
size_t ret = write(pgm_read_byte(buffer++));
4949
if (ret == 0) {
5050
// Write of last byte didn't complete, abort additional processing
5151
break;

cores/esp8266/Print.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Print {
5656
size_t write(const char *str) {
5757
if(str == NULL)
5858
return 0;
59-
return write((const uint8_t *) str, strlen(str));
59+
return write((const uint8_t *) str, strlen_P(str));
6060
}
6161
virtual size_t write(const uint8_t *buffer, size_t size);
6262
size_t write(const char *buffer, size_t size) {

0 commit comments

Comments
 (0)