Skip to content

Commit c29f548

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 9879937 + ddfeae9 commit c29f548

File tree

7 files changed

+112
-18
lines changed

7 files changed

+112
-18
lines changed

boards.txt

+76
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,82 @@ esp32.menu.DebugLevel.verbose.build.code_debug=5
101101

102102
##############################################################
103103

104+
cw02.name=XinaBox CW02
105+
106+
cw02.upload.tool=esptool
107+
cw02.upload.maximum_size=1310720
108+
cw02.upload.maximum_data_size=294912
109+
cw02.upload.wait_for_upload_port=true
110+
111+
cw02.serial.disableDTR=true
112+
cw02.serial.disableRTS=true
113+
114+
cw02.build.mcu=esp32
115+
cw02.build.core=esp32
116+
cw02.build.variant=xinabox
117+
cw02.build.board=ESP32_DEV
118+
119+
cw02.build.f_cpu=240000000L
120+
cw02.build.flash_size=4MB
121+
cw02.build.flash_freq=40m
122+
cw02.build.flash_mode=dio
123+
cw02.build.boot=dio
124+
cw02.build.partitions=default
125+
126+
cw02.menu.FlashMode.qio=QIO
127+
cw02.menu.FlashMode.qio.build.flash_mode=dio
128+
cw02.menu.FlashMode.qio.build.boot=qio
129+
cw02.menu.FlashMode.dio=DIO
130+
cw02.menu.FlashMode.dio.build.flash_mode=dio
131+
cw02.menu.FlashMode.dio.build.boot=dio
132+
cw02.menu.FlashMode.qout=QOUT
133+
cw02.menu.FlashMode.qout.build.flash_mode=dout
134+
cw02.menu.FlashMode.qout.build.boot=qout
135+
cw02.menu.FlashMode.dout=DOUT
136+
cw02.menu.FlashMode.dout.build.flash_mode=dout
137+
cw02.menu.FlashMode.dout.build.boot=dout
138+
139+
cw02.menu.FlashFreq.80=80MHz
140+
cw02.menu.FlashFreq.80.build.flash_freq=80m
141+
cw02.menu.FlashFreq.40=40MHz
142+
cw02.menu.FlashFreq.40.build.flash_freq=40m
143+
144+
cw02.menu.FlashSize.4M=4MB (32Mb)
145+
cw02.menu.FlashSize.4M.build.flash_size=4MB
146+
cw02.menu.FlashSize.2M=2MB (16Mb)
147+
cw02.menu.FlashSize.2M.build.flash_size=2MB
148+
cw02.menu.FlashSize.2M.build.partitions=minimal
149+
150+
cw02.menu.UploadSpeed.921600=921600
151+
cw02.menu.UploadSpeed.921600.upload.speed=921600
152+
cw02.menu.UploadSpeed.115200=115200
153+
cw02.menu.UploadSpeed.115200.upload.speed=115200
154+
cw02.menu.UploadSpeed.256000.windows=256000
155+
cw02.menu.UploadSpeed.256000.upload.speed=256000
156+
cw02.menu.UploadSpeed.230400.windows.upload.speed=256000
157+
cw02.menu.UploadSpeed.230400=230400
158+
cw02.menu.UploadSpeed.230400.upload.speed=230400
159+
cw02.menu.UploadSpeed.460800.linux=460800
160+
cw02.menu.UploadSpeed.460800.macosx=460800
161+
cw02.menu.UploadSpeed.460800.upload.speed=460800
162+
cw02.menu.UploadSpeed.512000.windows=512000
163+
cw02.menu.UploadSpeed.512000.upload.speed=512000
164+
165+
cw02.menu.DebugLevel.none=None
166+
cw02.menu.DebugLevel.none.build.code_debug=0
167+
cw02.menu.DebugLevel.error=Error
168+
cw02.menu.DebugLevel.error.build.code_debug=1
169+
cw02.menu.DebugLevel.warn=Warn
170+
cw02.menu.DebugLevel.warn.build.code_debug=2
171+
cw02.menu.DebugLevel.info=Info
172+
cw02.menu.DebugLevel.info.build.code_debug=3
173+
cw02.menu.DebugLevel.debug=Debug
174+
cw02.menu.DebugLevel.debug.build.code_debug=4
175+
cw02.menu.DebugLevel.verbose=Verbose
176+
cw02.menu.DebugLevel.verbose.build.code_debug=5
177+
178+
##############################################################
179+
104180
esp32wrover.name=ESP32 Wrover Module
105181

106182
esp32wrover.upload.tool=esptool

libraries/AsyncUDP/src/AsyncUDP.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ AsyncUDPPacket::AsyncUDPPacket(AsyncUDP *udp, pbuf *pb, const ip_addr_t *raddr,
286286
_len = pb->len;
287287
_index = 0;
288288

289+
pbuf_ref(_pb);
290+
289291
//memcpy(&_remoteIp, raddr, sizeof(ip_addr_t));
290292
_remoteIp.type = raddr->type;
291293
_localIp.type = _remoteIp.type;

libraries/HTTPClient/src/HTTPClient.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void HTTPClient::end(void)
252252
bool HTTPClient::connected()
253253
{
254254
if(_tcp) {
255-
return (_tcp->connected() || (_tcp->available() > 0));
255+
return ((_tcp->available() > 0) || _tcp->connected());
256256
}
257257
return false;
258258
}

libraries/WiFi/src/WiFiClient.cpp

+3-16
Original file line numberDiff line numberDiff line change
@@ -438,22 +438,9 @@ uint8_t WiFiClient::connected()
438438
if (_connected) {
439439
uint8_t dummy;
440440
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
441-
if (res < 0) {
442-
switch (errno) {
443-
case ENOTCONN:
444-
case EPIPE:
445-
case ECONNRESET:
446-
case ECONNREFUSED:
447-
case ECONNABORTED:
448-
_connected = false;
449-
break;
450-
default:
451-
_connected = true;
452-
break;
453-
}
454-
}
455-
else {
456-
_connected = true;
441+
if (res <= 0 && errno != EWOULDBLOCK) {
442+
_connected = false;
443+
log_i("Disconnected: RES: %d, ERR: %d", res, errno);
457444
}
458445
}
459446
return _connected;

libraries/WiFi/src/WiFiGeneric.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ void WiFiGenericClass::removeEvent(wifi_event_id_t id)
334334
* @param arg
335335
*/
336336
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
337-
const char * system_event_names[] = { "WIFI_READY", "SCAN_DONE", "STA_START", "STA_STOP", "STA_CONNECTED", "STA_DISCONNECTED", "STA_AUTHMODE_CHANGE", "STA_GOT_IP", "STA_LOST_IP", "STA_WPS_ER_SUCCESS", "STA_WPS_ER_FAILED", "STA_WPS_ER_TIMEOUT", "STA_WPS_ER_PIN", "AP_START", "AP_STOP", "AP_STACONNECTED", "AP_STADISCONNECTED", "AP_PROBEREQRECVED", "AP_PROBEREQRECVED", "GOT_IP6", "ETH_START", "ETH_STOP", "ETH_CONNECTED", "ETH_DISCONNECTED", "ETH_GOT_IP", "MAX"};
337+
const char * system_event_names[] = { "WIFI_READY", "SCAN_DONE", "STA_START", "STA_STOP", "STA_CONNECTED", "STA_DISCONNECTED", "STA_AUTHMODE_CHANGE", "STA_GOT_IP", "STA_LOST_IP", "STA_WPS_ER_SUCCESS", "STA_WPS_ER_FAILED", "STA_WPS_ER_TIMEOUT", "STA_WPS_ER_PIN", "AP_START", "AP_STOP", "AP_STACONNECTED", "AP_STADISCONNECTED", "AP_STAIPASSIGNED", "AP_PROBEREQRECVED", "GOT_IP6", "ETH_START", "ETH_STOP", "ETH_CONNECTED", "ETH_DISCONNECTED", "ETH_GOT_IP", "MAX"};
338338
#endif
339339
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_WARN
340340
const char * system_event_reasons[] = { "UNSPECIFIED", "AUTH_EXPIRE", "AUTH_LEAVE", "ASSOC_EXPIRE", "ASSOC_TOOMANY", "NOT_AUTHED", "NOT_ASSOCED", "ASSOC_LEAVE", "ASSOC_NOT_AUTHED", "DISASSOC_PWRCAP_BAD", "DISASSOC_SUPCHAN_BAD", "UNSPECIFIED", "IE_INVALID", "MIC_FAILURE", "4WAY_HANDSHAKE_TIMEOUT", "GROUP_KEY_UPDATE_TIMEOUT", "IE_IN_4WAY_DIFFERS", "GROUP_CIPHER_INVALID", "PAIRWISE_CIPHER_INVALID", "AKMP_INVALID", "UNSUPP_RSN_IE_VERSION", "INVALID_RSN_IE_CAP", "802_1X_AUTH_FAILED", "CIPHER_SUITE_REJECTED", "BEACON_TIMEOUT", "NO_AP_FOUND", "AUTH_FAIL", "ASSOC_FAIL", "HANDSHAKE_TIMEOUT" };

tools/build-release.sh

+1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ find $outdir -name '*.DS_Store' -exec rm -f {} \;
229229
# handles tool paths differently when package is installed in hardware folder
230230
echo " - updating platform.txt..."
231231
cat $srcdir/platform.txt | \
232+
sed "s/version=.*/version=$ver$extent/g" | \
232233
sed 's/runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf//g' | \
233234
sed 's/tools.esptool.path={runtime.platform.path}\/tools\/esptool/tools.esptool.path=\{runtime.tools.esptool.path\}/g' \
234235
> $outdir/platform.txt

variants/xinabox/pins_arduino.h

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
6+
#define EXTERNAL_NUM_INTERRUPTS 16
7+
#define NUM_DIGITAL_PINS 40
8+
#define NUM_ANALOG_INPUTS 16
9+
10+
#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
11+
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
14+
static const uint8_t LED_BUILTIN = 27;
15+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
16+
17+
static const uint8_t TX = 1;
18+
static const uint8_t RX = 3;
19+
20+
static const uint8_t SDA = 21;
21+
static const uint8_t SCL = 22;
22+
23+
static const uint8_t SS = 5;
24+
static const uint8_t MOSI = 23;
25+
static const uint8_t MISO = 19;
26+
static const uint8_t SCK = 18;
27+
28+
#endif /* Pins_Arduino_h */

0 commit comments

Comments
 (0)