8000 Merge branch 'master' into me-no-dev · ksmith9109/arduino-esp32@4917f63 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4917f63

Browse files
committed
Merge branch 'master' into me-no-dev
2 parents 78fa606 + 93d2bc7 commit 4917f63

File tree

8 files changed

+42
-80
lines changed

8 files changed

+42
-80
lines changed

cores/esp32/main.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,40 +19,3 @@ extern "C" void app_main()
1919
}
2020

2121
#endif
22-
23-
/*
24-
** Block below to be removed with next toolchain
25-
*/
26-
void *operator new(size_t size)
27-
{
28-
return malloc(size);
29-
}
30-
31-
void *operator new[](size_t size)
32-
{
33-
return malloc(size);
34-
}
35-
36-
void operator delete(void * ptr)
37-
{
38-
free(ptr);
39-
}
40-
41-
void operator delete[](void * ptr)
42-
{
43-
free(ptr);
44-
}
45-
46-
extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__));
47-
extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__));
48-
49-
void __cxa_pure_virtual(void)
50-
{
51-
abort();
52-
}
53-
54-
void __cxa_deleted_virtual(void)
55-
{
56-
abort();
57-
}
58-

doc/windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
```bash
1313
python -m pip install --upgrade pip && \
14-
pip install pyserial
14+
pip install pyserial && \
15+
pip install requests
1516
```
1617
![Git Bash As Admin](gitbash-admin-start.png)
1718
![Git Bash Admin CMD](gitbash-admin.png)

libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "WiFi.h"
22

3-
#define STA_SSID "nbis-test"
4-
#define STA_PASS "1234567890"
5-
#define AP_SSID "esp32"
3+
#define STA_SSID "**********"
4+
#define STA_PASS "**********"
5+
#define AP_SSID "esp32-v6"
66

77
static volatile bool wifi_connected = false;
88

libraries/WiFi/src/WiFiUdp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ int WiFiUDP::endPacket(){
158158
int sent = sendto(udp_server, tx_buffer, tx_buffer_len, 0, (struct sockaddr*) &recipient, sizeof(recipient));
159159
if(sent < 0){
160160
log_e("could not send data: %d", errno);
161+
return 0;
161162
}
162-
return sent;
163+
return 1;
163164
}
164165

165166
size_t WiFiUDP::write(uint8_t data){

package/package_esp32_index.template.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
"systems": [
4646
{
4747
"host": "i686-mingw32",
48-
"url": "https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-59.zip",
49-
"archiveFileName": "xtensa-esp32-elf-win32-1.22.0-59.zip",
50-
"checksum": "SHA-256:10476b9c11a7a90f40883413ddfb409f505b20692e316c4e597c4c175b4be09c",
51-
"size": "153527527"
48+
"url": "https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-61-gab8375a-5.2.0-2.zip",
49+
"archiveFileName": "xtensa-esp32-elf-win32-1.22.0-61-gab8375a-5.2.0-2.zip",
50+
"checksum": "SHA-256:c00dbdab8e8acc273d4aa319a74f7bb1d9496c843159823201d685359174168f",
51+
"size": "76346909"
5252
},
5353
{
5454
"host": "x86_64-apple-darwin",

platform.txt

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
21
name=ESP32 Arduino
32
version=0.0.1
43

54
runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32-elf
6-
runtime.tools.esptool.path={runtime.platform.path}/tools/esptool.py
5+
6+
tools.esptool.cmd=python "{runtime.platform.path}/tools/esptool.py"
7+
tools.esptool.cmd.windows=python.exe "{runtime.platform.path}/tools/esptool.py"
78

89
compiler.warning_flags=-w
910
compiler.warning_flags.none=-w
@@ -33,14 +34,8 @@ compiler.as.cmd=xtensa-esp32-elf-as
3334
compiler.ar.cmd=xtensa-esp32-elf-ar
3435
compiler.ar.flags=cru
3536

36-
compiler.elf2hex.cmd=esptool.py
37-
compiler.elf2hex.flags=
38-
3937
compiler.size.cmd=xtensa-esp32-elf-size
4038

41-
compiler.python.cmd=python
42-
compiler.python.cmd.windows=python.exe
43-
4439
# This can be overriden in boards.txt
4540
build.extra_flags=-DESP32
4641

@@ -72,7 +67,7 @@ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.f
7267
recipe.objcopy.eep.pattern=
7368

7469
## Create hex
75-
recipe.objcopy.hex.pattern="{compiler.python.cmd}" "{runtime.platform.path}/tools/esptool.py" --chip esp32 elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf"
70+
recipe.objcopy.hex.pattern={tools.esptool.cmd} --chip esp32 elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf"
7671

7772
## Save hex
7873
recipe.output.tmp_file={build.project_name}.bin
@@ -85,13 +80,7 @@ recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss)\s+([0-9]+).*
8580

8681
# ------------------------------
8782

88-
tools.esptool.cmd=python
89-
tools.esptool.cmd.windows=python.exe
90-
tools.esptool.path={runtime.platform.path}/tools/esptool.py
91-
tools.esptool.network_cmd=python
92-
tools.esptool.network_cmd.windows=python.exe
93-
9483
tools.esptool.upload.protocol=esp32
9584
tools.esptool.upload.params.verbose=
9685
tools.esptool.upload.params.quiet=
97-
tools.esptool.upload.patt 10000 ern="{cmd}" "{path}" --chip esp32 --port "{serial.port}" --baud {upload.speed} write_flash -z --flash_freq {build.flash_freq} --flash_mode {build.flash_mode} --flash_size {build.flash_size} 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader.bin" 0x8000 "{runtime.platform.path}/tools/sdk/bin/partitions_singleapp.bin" 0x10000 "{build.path}/{build.project_name}.bin"
86+
tools.esptool.upload.pattern={cmd} --chip esp32 --port "{serial.port}" --baud {upload.speed} write_flash -z --flash_freq {build.flash_freq} --flash_mode {build.flash_mode} --flash_size {build.flash_size} 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader.bin" 0x8000 "{runtime.platform.path}/tools/sdk/bin/partitions_singleapp.bin" 0x10000 "{build.path}/{build.project_name}.bin"

tools/get.exe

4.97 MB
Binary file not shown.

tools/get.py

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515
import tarfile
1616
import zipfile
1717
import re
18-
import requests
1918
if sys.version_info[0] == 3:
2019
from urllib.request import urlretrieve
2120
else:
2221
# Not Python 3 - today, it is most likely to be Python 2
2322
from urllib import urlretrieve
2423

25-
dist_dir = 'dist/'
24+
if 'Windows' in platform.system():
25+
import requests
26+
27+
current_dir = os.path.dirname(os.path.realpath(__file__))
28+
dist_dir = current_dir + '/dist/'
2629

2730
def sha256sum(filename, blocksize=65536):
2831
hash = hashlib.sha256()
@@ -46,7 +49,8 @@ def report_progress(count, blockSize, totalSize):
4649

4750
def unpack(filename, destination):
4851
dirname = ''
49-
print('Extracting {0}'.format(filename))
52+
print('Extracting {0}'.format(os.path.basename(filename)))
53+
sys.stdout.flush()
5054
if filename.endswith('tar.gz'):
5155
tfile = tarfile.open(filename, 'r:gz')
5256
tfile.extractall(destination)
@@ -72,26 +76,26 @@ def get_tool(tool):
7276
local_path = dist_dir + archive_name
7377
url = tool['url']
7478
#real_hash = tool['checksum'].split(':')[1]
75-
if 'CYGWIN_NT' in sys_name:
76-
ctx = ssl.create_default_context()
77-
ctx.check_hostname = False
78-
ctx.verify_mode = ssl.CERT_NONE
7979
if not os.path.isfile(local_path):
8080
print('Downloading ' + archive_name);
81+
sys.stdout.flush()
8182
if 'CYGWIN_NT' in sys_name:
82-
urlretrieve(url, local_path, report_progress,context=ctx)
83+
ctx = ssl.create_default_context()
84+
ctx.check_hostname = False
85+
ctx.verify_mode = ssl.CERT_NONE
86+
urlretrieve(url, local_path, report_progress, context=ctx)
87+
elif 'Windows' in sys_name:
88+
r = requests.get(url)
89+
f = open(local_path, 'wb')
90+
f.write(r.content)
91+
f.close()
8392
else:
84-
try:
85-
urlretrieve(url, local_path, report_progress)
86-
except Exception,e:
87-
r = requests.get(url)
88-
f = open(local_path, 'wb')
89-
f.write(r.content)
90-
f.close()
93+
urlretrieve(url, local_path, report_progress)
9194
sys.stdout.write("\rDone\n")
9295
sys.stdout.flush()
9396
else:
9497
print('Tool {0} already downloaded'.format(archive_name))
98+
sys.stdout.flush()
9599
#local_hash = sha256sum(local_path)
96100
#if local_hash != real_hash:
97101
# print('Hash mismatch for {0}, delete the file and try again'.format(local_path))
@@ -117,15 +121,19 @@ def identify_platform():
117121
if sys.maxsize > 2**32:
118122
bits = 64
119123
sys_name = platform.system()
120-
if 'Linux' in sys_name and platform.platform().find('arm') > 0:
124+
sys_platform = platform.platform()
125+
print('System: %s, Info: %s' % (sys_name, sys_platform))
126+
if 'Linux' in sys_name and sys_platform.find('arm') > 0:
121127
sys_name = 'LinuxARM'
122128
if 'CYGWIN_NT' in sys_name:
123129
sys_name = 'Windows'
124130
return arduino_platform_names[sys_name][bits]
125131

126132
if __name__ == '__main__':
127-
print('Platform: {0}'.format(identify_platform()))
128-
tools_to_download = load_tools_list('../package/package_esp32_index.template.json', identify_platform())
133+
identified_platform = identify_platform()
134+
print('Platform: {0}'.format(identified_platform))
135+
tools_to_download = load_tools_list(current_dir + '/../package/package_esp32_index.template.json', identified_platform)
129136
mkdir_p(dist_dir)
130137
for tool in tools_to_download:
131138
get_tool(tool)
139+
print('Done')

0 commit comments

Comments
 (0)
0