Skip to content

Commit 8afbb9c

Browse files
authored
Merge branch 'master' into docdocgoose
2 parents fccb3a5 + 6e0c0e3 commit 8afbb9c

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

Diff for: cores/esp8266/core_esp8266_si2c.c

+9-10
Original file line numberDiff line numberDiff line change
@@ -293,24 +293,23 @@ unsigned char twi_readFrom(unsigned char address, unsigned char* buf, unsigned i
293293
}
294294

295295
uint8_t twi_status() {
296-
if (SCL_READ()==0) {
296+
if (SCL_READ() == 0)
297297
return I2C_SCL_HELD_LOW; // SCL held low by another device, no procedure available to recover
298-
}
298+
299299
int clockCount = 20;
300-
while (SDA_READ()==0 && clockCount>0) { // if SDA low, read the bits slaves have to sent to a max
300+
while (SDA_READ() == 0 && clockCount-- > 0) { // if SDA low, read the bits slaves have to sent to a max
301301
twi_read_bit();
302-
if (SCL_READ()==0) {
302+
if (SCL_READ() == 0) {
303303
return I2C_SCL_HELD_LOW_AFTER_READ; // I2C bus error. SCL held low beyond slave clock stretch time
304304
}
305305
}
306-
if (SDA_READ()==0) {
306+
if (SDA_READ() == 0)
307307
return I2C_SDA_HELD_LOW; // I2C bus error. SDA line held low by slave/another_master after n bits.
308-
}
309-
if (!twi_write_start()) {
308+
309+
if (!twi_write_start())
310310
return I2C_SDA_HELD_LOW_AFTER_INIT; // line busy. SDA again held low by another device. 2nd master?
311-
} else {
312-
return I2C_OK;
313-
}
311+
312+
return I2C_OK;
314313
}
315314

316315
uint8_t twi_transmit(const uint8_t* data, uint8_t length)

Diff for: cores/esp8266/core_esp8266_waveform.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
282282
// Check for timed-out waveforms out of the high-frequency toggle loop
283283
for (size_t i = 0; i < countof(waveform); i++) {
284284
Waveform *wave = &waveform[i];
285-
if (wave->timeLeftCycles) {
285+
if (wave->enabled && wave->timeLeftCycles) {
286286
// Check for unsigned underflow with new > old
287287
if (deltaCycles >= wave->timeLeftCycles) {
288288
// Done, remove!

Diff for: tools/platformio-build.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,10 @@ def scons_patched_match_splitext(path, suffixes=None):
135135
#
136136
# lwIP
137137
#
138-
if "PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY" in flatten_cppdefines:
138+
if "PIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH" in flatten_cppdefines:
139139
env.Append(
140-
CPPDEFINES=[("TCP_MSS", 536), ("LWIP_FEATURES", 1)],
141-
CPPPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lwip2", "include")],
142-
LIBS=["lwip2-536-feat"]
140+
CPPPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lwip", "include")],
141+
LIBS=["lwip_gcc"]
143142
)
144143
elif "PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH" in flatten_cppdefines:
145144
env.Append(
@@ -159,10 +158,12 @@ def scons_patched_match_splitext(path, suffixes=None):
159158
CPPPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lwip2", "include")],
160159
LIBS=["lwip2-1460"]
161160
)
161+
# PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY (default)
162162
else:
163163
env.Append(
164-
CPPPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lwip", "include")],
165-
LIBS=["lwip_gcc"]
164+
CPPDEFINES=[("TCP_MSS", 536), ("LWIP_FEATURES", 1)],
165+
CPPPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lwip2", "include")],
166+
LIBS=["lwip2-536-feat"]
166167
)
167168

168169
#

0 commit comments

Comments
 (0)