Skip to content

Commit 04ef486

Browse files
committed
Merge remote-tracking branch 'ESP32/master' into develop
2 parents 6e4b207 + 3b86e0c commit 04ef486

File tree

226 files changed

+14542
-607
lines changed

Some content is hidden

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

226 files changed

+14542
-607
lines changed

cores/esp32/esp32-hal-bt.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
#if CONFIG_BT_ENABLED
1514

1615
#include "esp32-hal-bt.h"
1716

17+
#if CONFIG_BT_ENABLED
18+
1819
#include "bt.h"
1920
#include "esp_bt_defs.h"
2021
#include "esp_bt_main.h"
@@ -63,5 +64,20 @@ bool btStop(){
6364
return false;
6465
}
6566

67+
#else
68+
bool btStarted()
69+
{
70+
return false;
71+
}
72+
73+
bool btStart()
74+
{
75+
return false;
76+
}
77+
78+
bool btStop()
79+
{
80+
return false;
81+
}
6682
#endif
6783

cores/esp32/esp32-hal-bt.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
#include "esp32-hal.h"
1919

20-
#if CONFIG_BT_ENABLED
21-
2220
#ifdef __cplusplus
2321
extern "C" {
2422
#endif
@@ -31,6 +29,4 @@ bool btStop();
3129
}
3230
#endif
3331

34-
#endif
35-
3632
#endif /* _ESP32_ESP32_HAL_BT_H_ */

cores/esp32/libb64/cdecode.c

Lines changed: 81 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -6,89 +6,94 @@ For details, see http://sourceforge.net/projects/libb64
66
*/
77

88
#include "cdecode.h"
9+
#include <stdint.h>
910

10-
int base64_decode_value(char value_in)
11-
{
12-
static const char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
13-
static const char decoding_size = sizeof(decoding);
14-
value_in -= 43;
15-
if (value_in < 0 || value_in > decoding_size) {
16-
return -1;
17-
}
18-
return decoding[(int)value_in];
11+
static int base64_decode_value_signed(int8_t value_in){
12+
static const int8_t decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
13+
static const int8_t decoding_size = sizeof(decoding);
14+
value_in -= 43;
15+
if (value_in < 0 || value_in > decoding_size) return -1;
16+
return decoding[(int)value_in];
17+
}
18+
19+
void base64_init_decodestate(base64_decodestate* state_in){
20+
state_in->step = step_a;
21+
state_in->plainchar = 0;
1922
}
2023

21-
void base64_init_decodestate(base64_decodestate* state_in)
22-
{
23-
state_in->step = step_a;
24-
state_in->plainchar = 0;
24+
static int base64_decode_block_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out, base64_decodestate* state_in){
25+
const int8_t* codechar = code_in;
26+
int8_t* plainchar = plaintext_out;
27+
int8_t fragment;
28+
29+
*plainchar = state_in->plainchar;
30+
31+
switch (state_in->step){
32+
while (1){
33+
case step_a:
34+
do {
35+
if (codechar == code_in+length_in){
36+
state_in->step = step_a;
37+
state_in->plainchar = *plainchar;
38+
return plainchar - plaintext_out;
39+
}
40+
fragment = (int8_t)base64_decode_value_signed(*codechar++);
41+
} while (fragment < 0);
42+
*plainchar = (fragment & 0x03f) << 2;
43+
case step_b:
44+
do {
45+
if (codechar == code_in+length_in){
46+
state_in->step = step_b;
47+
state_in->plainchar = *plainchar;
48+
return plainchar - plaintext_out;
49+
}
50+
fragment = (int8_t)base64_decode_value_signed(*codechar++);
51+
} while (fragment < 0);
52+
*plainchar++ |= (fragment & 0x030) >> 4;
53+
*plainchar = (fragment & 0x00f) << 4;
54+
case step_c:
55+
do {
56+
if (codechar == code_in+length_in){
57+
state_in->step = step_c;
58+
state_in->plainchar = *plainchar;
59+
return plainchar - plaintext_out;
60+
}
61+
fragment = (int8_t)base64_decode_value_signed(*codechar++);
62+
} while (fragment < 0);
63+
*plainchar++ |= (fragment & 0x03c) >> 2;
64+
*plainchar = (fragment & 0x003) << 6;
65+
case step_d:
66+
do {
67+
if (codechar == code_in+length_in){
68+
state_in->step = step_d;
69+
state_in->plainchar = *plainchar;
70+
return plainchar - plaintext_out;
71+
}
72+
fragment = (int8_t)base64_decode_value_signed(*codechar++);
73+
} while (fragment < 0);
74+
*plainchar++ |= (fragment & 0x03f);
75+
}
76+
}
77+
/* control should not reach here */
78+
return plainchar - plaintext_out;
2579
}
2680

27-
int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in)
28-
{
29-
const char* codechar = code_in;
30-
char* plainchar = plaintext_out;
31-
char fragment;
81+
static int base64_decode_chars_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out){
82+
base64_decodestate _state;
83+
base64_init_decodestate(&_state);
84+
int len = base64_decode_block_signed(code_in, length_in, plaintext_out, &_state);
85+
if(len > 0) plaintext_out[len] = 0;
86+
return len;
87+
}
3288

33-
*plainchar = state_in->plainchar;
89+
int base64_decode_value(char value_in){
90+
return base64_decode_value_signed(*((int8_t *) &value_in));
91+
}
3492

35-
switch (state_in->step) {
36-
while (1) {
37-
case step_a:
38-
do {
39-
if (codechar == code_in+length_in) {
40-
state_in->step = step_a;
41-
state_in->plainchar = *plainchar;
42-
return plainchar - plaintext_out;
43-
}
44-
fragment = (char)base64_decode_value(*codechar++);
45-
} while (fragment < 0);
46-
*plainchar = (fragment & 0x03f) << 2;
47-
case step_b:
48-
do {
49-
if (codechar == code_in+length_in) {
50-
state_in->step = step_b;
51-
state_in->plainchar = *plainchar;
52-
return plainchar - plaintext_out;
53-
}
54-
fragment = (char)base64_decode_value(*codechar++);
55-
} while (fragment < 0);
56-
*plainchar++ |= (fragment & 0x030) >> 4;
57-
*plainchar = (fragment & 0x00f) << 4;
58-
case step_c:
59-
do {
60-
if (codechar == code_in+length_in) {
61-
state_in->step = step_c;
62-
state_in->plainchar = *plainchar;
63-
return plainchar - plaintext_out;
64-
}
65-
fragment = (char)base64_decode_value(*codechar++);
66-
} while (fragment < 0);
67-
*plainchar++ |= (fragment & 0x03c) >> 2;
68-
*plainchar = (fragment & 0x003) << 6;
69-
case step_d:
70-
do {
71-
if (codechar == code_in+length_in) {
72-
state_in->step = step_d;
73-
state_in->plainchar = *plainchar;
74-
return plainchar - plaintext_out;
75-
}
76-
fragment = (char)base64_decode_value(*codechar++);
77-
} while (fragment < 0);
78-
*plainchar++ |= (fragment & 0x03f);
79-
}
80-
}
81-
/* control should not reach here */
82-
return plainchar - plaintext_out;
93+
int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in){
94+
return base64_decode_block_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out, state_in);
8395
}
8496

85-
int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out)
86-
{
87-
base64_decodestate _state;
88-
base64_init_decodestate(&_state);
89-
int len = base64_decode_block(code_in, length_in, plaintext_out, &_state);
90-
if(len > 0) {
91-
plaintext_out[len] = 0;
92-
}
93-
return len;
97+
int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out){
98+
return base64_decode_chars_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out);
9499
}

libraries/WiFi/src/WiFiClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class WiFiClient : public Client
4949
int read(uint8_t *buf, size_t size);
5050
int peek()
5151
{
52-
return 0;
52+
return -1;
5353
}
5454
void flush();
5555
void stop();

package/package_esp32_index.template.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
{
3939
"packager": "esp32",
4040
"name": "esptool",
41-
"version": "fe69994"
41+
"version": "96698a3"
4242
}
4343
]
4444
}
@@ -80,20 +80,20 @@
8080
},
8181
{
8282
"name": "esptool",
83-
"version": "9072736",
83+
"version": "96698a3",
8484
"systems": [
8585
{
8686
"host": "i686-mingw32",
87-
"url": "https://dl.espressif.com/dl/esptool-9072736-windows.zip",
88-
"archiveFileName": "esptool-9072736-windows.zip",
89-
"checksum": "SHA-256:eac14998df3fed9998943ace5c2f07114b678869f143c3316f4ff26cc851e268",
87+
"url": "https://dl.espressif.com/dl/esptool-96698a3-windows.zip",
88+
"archiveFileName": "esptool-96698a3-windows.zip",
89+
"checksum": "SHA-256:12f026c84869f0bd2f6a863191ec84d27b91f21d17e2e2e9e11c79be50f2d0fc",
9090
"size": "3390935"
9191
},
9292
{
9393
"host": "x86_64-apple-darwin",
94-
"url": "https://dl.espressif.com/dl/esptool-9072736-macos.tar.gz",
95-
"archiveFileName": "esptool-9072736-macos.tar.gz",
96-
"checksum": "SHA-256:2b88ce516719f8b54c22ae637109b1437f3ab5f81a1e6260ef14799e4dd3b355",
94+
"url": "https://dl.espressif.com/dl/esptool-96698a3-macos.tar.gz",
95+
"archiveFileName": "esptool-96698a3-macos.tar.gz",
96+
"checksum": "SHA-256:e3154dbf32c3ba5e5ebd45e913178b167cf761e5ce0152b2bb069a2453f6839b",
9797
"size": "3805789"
9898
}
9999
]

platform.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ compiler.warning_flags.all=-Wall -Werror=all -Wextra
2121

2222
compiler.path={runtime.tools.xtensa-esp32-elf-gcc.path}/bin/
2323
compiler.sdk.path={runtime.platform.path}/tools/sdk
24-
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/bluedroid" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mbedtls_port" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/lwip"
24+
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/bluedroid" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mbedtls_port" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/lwip"
2525

2626
compiler.c.cmd=xtensa-esp32-elf-gcc
2727
compiler.c.flags=-std=gnu99 -Os -g3 -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c
@@ -34,7 +34,7 @@ compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls
3434

3535
compiler.c.elf.cmd=xtensa-esp32-elf-gcc
3636
compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority
37-
compiler.c.elf.libs=-lgcc -lstdc++ -lapp_update -lbootloader_support -lbt -lbtdm_app -lc -lc_nano -lcoap -lcoexist -lcore -lcxx -ldriver -lesp32 -lethernet -lexpat -lfatfs -lfreertos -lhal -ljsmn -ljson -llog -llwip -lm -lmbedtls -lmdns -lmicro-ecc -lnet80211 -lnewlib -lnghttp -lnvs_flash -lopenssl -lphy -lpp -lrtc -lsdmmc -lsmartconfig -lsoc -lspi_flash -ltcpip_adapter -lulp -lvfs -lwpa -lwpa2 -lwpa_supplicant -lwps -lxtensa-debug-module
37+
compiler.c.elf.libs=-lgcc -lstdc++ -lapp_update -lbootloader_support -lbt -lbtdm_app -lc -lc_nano -lcoap -lcoexist -lcore -lcxx -ldriver -lesp32 -lethernet -lexpat -lfatfs -lfreertos -lhal -ljsmn -ljson -llog -llwip -lm -lmbedtls -lmdns -lmicro-ecc -lnet80211 -lnewlib -lnghttp -lnvs_flash -lopenssl -lphy -lpp -lrtc -lsdmmc -lsmartconfig -lsoc -lspi_flash -ltcpip_adapter -lulp -lvfs -lwear_levelling -lwpa -lwpa2 -lwpa_supplicant -lwps -lxtensa-debug-module
3838

3939
compiler.as.cmd=xtensa-esp32-elf-as
4040

0 commit comments

Comments
 (0)