Skip to content

Commit 097673f

Browse files
authored
Merge pull request #23 from espressif/master
catch up with main branch 09MAR2018 1923GMT
2 parents 119afb1 + 3a4ec66 commit 097673f

File tree

213 files changed

+9970
-4019
lines changed

Some content is hidden

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

213 files changed

+9970
-4019
lines changed

boards.txt

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,58 @@ esp32.menu.DebugLevel.verbose.build.code_debug=5
8282

8383
##############################################################
8484

85+
pico32.name=ESP32 Pico Kit
86+
87+
pico32.upload.tool=esptool
88+
pico32.upload.maximum_size=1310720
89+
pico32.upload.maximum_data_size=294912
90+
pico32.upload.wait_for_upload_port=true
91+
92+
pico32.serial.disableDTR=true
93+
pico32.serial.disableRTS=true
94+
95+
pico32.build.mcu=esp32
96+
pico32.build.core=esp32
97+
pico32.build.variant=pico32
98+
pico32.build.board=ESP32_PICO
99+
100+
pico32.build.f_cpu=240000000L
101+
pico32.build.flash_size=4MB
102+
pico32.build.flash_freq=80m
103+
pico32.build.flash_mode=qio
104+
pico32.build.boot=qio
105+
pico32.build.partitions=default
106+
107+
pico32.menu.UploadSpeed.921600=921600
108+
pico32.menu.UploadSpeed.921600.upload.speed=921600
109+
pico32.menu.UploadSpeed.115200=115200
110+
pico32.menu.UploadSpeed.115200.upload.speed=115200
111+
pico32.menu.UploadSpeed.256000.windows=256000
112+
pico32.menu.UploadSpeed.256000.upload.speed=256000
113+
pico32.menu.UploadSpeed.230400.windows.upload.speed=256000
114+
pico32.menu.UploadSpeed.230400=230400
115+
pico32.menu.UploadSpeed.230400.upload.speed=230400
116+
pico32.menu.UploadSpeed.460800.linux=460800
117+
pico32.menu.UploadSpeed.460800.macosx=460800
118+
pico32.menu.UploadSpeed.460800.upload.speed=460800
119+
pico32.menu.UploadSpeed.512000.windows=512000
120+
pico32.menu.UploadSpeed.512000.upload.speed=512000
121+
122+
pico32.menu.DebugLevel.none=None
123+
pico32.menu.DebugLevel.none.build.code_debug=0
124+
pico32.menu.DebugLevel.error=Error
125+
pico32.menu.DebugLevel.error.build.code_debug=1
126+
pico32.menu.DebugLevel.warn=Warn
127+
pico32.menu.DebugLevel.warn.build.code_debug=2
128+
pico32.menu.DebugLevel.info=Info
129+
pico32.menu.DebugLevel.info.build.code_debug=3
130+
pico32.menu.DebugLevel.debug=Debug
131+
pico32.menu.DebugLevel.debug.build.code_debug=4
132+
pico32.menu.DebugLevel.verbose=Verbose
133+
pico32.menu.DebugLevel.verbose.build.code_debug=5
134+
135+
##############################################################
136+
85137
esp32thing.name=SparkFun ESP32 Thing
86138

87139
esp32thing.upload.tool=esptool
@@ -952,7 +1004,7 @@ mhetesp32minikit.menu.UploadSpeed.512000.upload.speed=512000
9521004
esp32vn-iot-uno.name=ESP32vn IoT Uno
9531005

9541006
esp32vn-iot-uno.upload.tool=esptool
955-
esp32vn-iot-uno.upload.maximum_size=1044464
1007+
esp32vn-iot-uno.upload.maximum_size=1310720
9561008
esp32vn-iot-uno.upload.maximum_data_size=294912
9571009
esp32vn-iot-uno.upload.wait_for_upload_port=true
9581010

@@ -1166,7 +1218,7 @@ m5stack-core-esp32.serial.disableRTS=true
11661218
m5stack-core-esp32.build.mcu=esp32
11671219
m5stack-core-esp32.build.core=esp32
11681220
m5stack-core-esp32.build.variant=esp32
1169-
m5stack-core-esp32.build.board=M5Stack-Core-ESP32
1221+
m5stack-core-esp32.build.board=M5Stack_Core_ESP32
11701222

11711223
m5stack-core-esp32.build.f_cpu=240000000L
11721224
m5stack-core-esp32.build.flash_size=4MB
@@ -1225,7 +1277,7 @@ m5stack-core-esp32.menu.DebugLevel.verbose.build.code_debug=5
12251277
heltec_wifi_kit_32.name=Heltec_WIFI_Kit_32
12261278

12271279
heltec_wifi_kit_32.upload.tool=esptool
1228-
heltec_wifi_kit_32.upload.maximum_size=1044464
1280+
heltec_wifi_kit_32.upload.maximum_size=1310720
12291281
heltec_wifi_kit_32.upload.maximum_data_size=294912
12301282
heltec_wifi_kit_32.upload.wait_for_upload_port=true
12311283

@@ -1268,7 +1320,7 @@ heltec_wifi_kit_32.menu.UploadSpeed.512000.upload.speed=512000
12681320
heltec_wifi_lora_32.name=Heltec_WIFI_LoRa_32
12691321

12701322
heltec_wifi_lora_32.upload.tool=esptool
1271-
heltec_wifi_lora_32.upload.maximum_size=1044464
1323+
heltec_wifi_lora_32.upload.maximum_size=1310720
12721324
heltec_wifi_lora_32.upload.maximum_data_size=294912
12731325
heltec_wifi_lora_32.upload.wait_for_upload_port=true
12741326

cores/esp32/Esp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
218218

219219
uint64_t EspClass::getEfuseMac(void)
220220
{
221-
uint64_t _chipmacid;
221+
uint64_t _chipmacid = 0LL;
222222
esp_efuse_mac_get_default((uint8_t*) (&_chipmacid));
223223
return _chipmacid;
224224
}

cores/esp32/esp32-hal-bt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
1818

1919

20-
#include "bt.h"
20+
#include "esp_bt.h"
2121
#include "esp_bt_defs.h"
2222
#include "esp_bt_main.h"
2323

cores/esp32/esp32-hal-ledc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ static void _ledcSetupTimer(uint8_t chan, uint32_t div_num, uint8_t bit_num, boo
6868
#endif
6969
}
7070
LEDC_MUTEX_LOCK();
71-
LEDC_TIMER(group, timer).conf.div_num = div_num;//18 bit (10.8) This register is used to configure parameter for divider in timer the least significant eight bits represent the decimal part.
72-
LEDC_TIMER(group, timer).conf.bit_num = bit_num;//5 bit This register controls the range of the counter in timer. the counter range is [0 2**bit_num] the max bit width for counter is 20.
71+
LEDC_TIMER(group, timer).conf.clock_divider = div_num;//18 bit (10.8) This register is used to configure parameter for divider in timer the least significant eight bits represent the decimal part.
72+
LEDC_TIMER(group, timer).conf.duty_resolution = bit_num;//5 bit This register controls the range of the counter in timer. the counter range is [0 2**bit_num] the max bit width for counter is 20.
7373
LEDC_TIMER(group, timer).conf.tick_sel = apb_clk;//apb clock
7474
if(group) {
7575
LEDC_TIMER(group, timer).conf.low_speed_update = 1;//This bit is only useful for low speed timer channels, reserved for high speed timers
@@ -111,8 +111,8 @@ static double _ledcTimerRead(uint8_t chan)
111111
bool apb_clk;
112112
uint8_t group=(chan/8), timer=((chan/2)%4);
113113
LEDC_MUTEX_LOCK();
114-
div_num = LEDC_TIMER(group, timer).conf.div_num;//18 bit (10.8) This register is used to configure parameter for divider in timer the least significant eight bits represent the decimal part.
115-
bit_num = LEDC_TIMER(group, timer).conf.bit_num;//5 bit This register controls the range of the counter in timer. the counter range is [0 2**bit_num] the max bit width for counter is 20.
114+
div_num = LEDC_TIMER(group, timer).conf.clock_divider;//18 bit (10.8) This register is used to configure parameter for divider in timer the least significant eight bits represent the decimal part.
115+
bit_num = LEDC_TIMER(group, timer).conf.duty_resolution;//5 bit This register controls the range of the counter in timer. the counter range is [0 2**bit_num] the max bit width for counter is 20.
116116
apb_clk = LEDC_TIMER(group, timer).conf.tick_sel;//apb clock
117117
LEDC_MUTEX_UNLOCK();
118118
uint64_t clk_freq = 1000000;

cores/esp32/esp32-hal-spi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ uint8_t spiGetDataMode(spi_t * spi)
309309
bool outEdge = spi->dev->user.ck_out_edge;
310310
if(idleEdge) {
311311
if(outEdge) {
312-
return SPI_MODE3;
312+
return SPI_MODE2;
313313
}
314-
return SPI_MODE2;
314+
return SPI_MODE3;
315315
}
316316
if(outEdge) {
317317
return SPI_MODE1;
@@ -713,11 +713,11 @@ void spiTransaction(spi_t * spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bi
713713
break;
714714
case SPI_MODE2:
715715
spi->dev->pin.ck_idle_edge = 1;
716-
spi->dev->user.ck_out_edge = 0;
716+
spi->dev->user.ck_out_edge = 1;
717717
break;
718718
case SPI_MODE3:
719719
spi->dev->pin.ck_idle_edge = 1;
720-
spi->dev->user.ck_out_edge = 1;
720+
spi->dev->user.ck_out_edge = 0;
721721
break;
722722
case SPI_MODE0:
723723
default:

cores/esp32/pgmspace.h

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,33 @@ typedef unsigned long prog_uint32_t;
3737
#define _SFR_BYTE(n) (n)
3838

3939
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
40-
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
41-
#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
42-
#define pgm_read_float(addr) (*(const float *)(addr))
40+
#define pgm_read_word(addr) ({ \
41+
typeof(addr) _addr = (addr); \
42+
*(const unsigned short *)(_addr); \
43+
})
44+
#define pgm_read_dword(addr) ({ \
45+
typeof(addr) _addr = (addr); \
46+
*(const unsigned long *)(_addr); \
47+
})
48+
#define pgm_read_float(addr) ({ \
49+
typeof(addr) _addr = (addr); \
50+
*(const float *)(_addr); \
51+
})
52+
#define pgm_read_ptr(addr) ({ \
53+
typeof(addr) _addr = (addr); \
54+
*(void * const *)(_addr); \
55+
})
4356

4457
#define pgm_read_byte_near(addr) pgm_read_byte(addr)
4558
#define pgm_read_word_near(addr) pgm_read_word(addr)
4659
#define pgm_read_dword_near(addr) pgm_read_dword(addr)
4760
#define pgm_read_float_near(addr) pgm_read_float(addr)
61+
#define pgm_read_ptr_near(addr) pgm_read_ptr(addr)
4862
#define pgm_read_byte_far(addr) pgm_read_byte(addr)
4963
#define pgm_read_word_far(addr) pgm_read_word(addr)
5064
#define pgm_read_dword_far(addr) pgm_read_dword(addr)
5165
#define pgm_read_float_far(addr) pgm_read_float(addr)
66+
#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
5267

5368
#define memcmp_P memcmp
5469
#define memccpy_P memccpy

docs/arduino-ide/debian_ubuntu.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Installation instructions for Debian / Ubuntu OS
1616
cd esp32 && \
1717
git submodule update --init --recursive && \
1818
cd tools && \
19-
python get.py
19+
python2 get.py
2020
```
2121
- Restart Arduino IDE
2222

@@ -32,4 +32,4 @@ Installation instructions for Debian / Ubuntu OS
3232
cd esp32 && \
3333
git submodule update --init --recursive && \
3434
cd tools && \
35-
python get.py```
35+
python2 get.py```

docs/arduino-ide/windows.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
## Steps to install Arduino ESP32 support on Windows
2-
### Tested on 32 and 64 bit Windows 10 machines
3-
4-
1. Download and install the latest Arduino IDE ```Windows Installer``` from [arduino.cc](https://www.arduino.cc/en/Main/Software)
5-
2. Download and install Git from [git-scm.com](https://git-scm.com/download/win)
6-
3. Start ```Git GUI``` and run through the following steps:
7-
- Select ```Clone Existing Repository```
8-
9-
![Step 1](win-screenshots/win-gui-1.png)
10-
11-
- Select source and destination
12-
- Source Location: ```https://github.com/espressif/arduino-esp32.git```
13-
- Target Directory: ```C:/Users/[YOUR_USER_NAME]/Documents/Arduino/hardware/espressif/esp32```
14-
- Change this to your Sketchbook Location if you have a different directory listed underneath the "Sketchbook location" in Arduino preferences.
15-
- Click ```Clone``` to start cloning the repository
16-
17-
![Step 2](win-screenshots/win-gui-2.png)
18-
![Step 3](win-screenshots/win-gui-3.png)
19-
20-
- Open ```C:/Users/[YOUR_USER_NAME]/Documents/Arduino/hardware/espressif/esp32/tools``` and double-click ```get.exe```
21-
22-
![Step 4](win-screenshots/win-gui-4.png)
23-
24-
- When ```get.exe``` finishes, you should see the following files in the directory
25-
26-
![Step 5](win-screenshots/win-gui-5.png)
27-
28-
4. Plug your ESP32 board and wait for the drivers to install (or install manually any that might be required)
29-
5. Start Arduino IDE
30-
6. Select your board in ```Tools > Board``` menu
31-
7. Select the COM port that the board is attached to
32-
8. Compile and upload (You might need to hold the boot button while uploading)
33-
34-
![Arduino IDE Example](win-screenshots/arduino-ide.png)
35-
36-
### How to update to the latest code
37-
38-
1. Start ```Git GUI``` and you should see the repository under ```Open Recent Repository```. Click on it!
39-
40-
![Update Step 1](win-screenshots/win-gui-update-1.png)
41-
42-
2. From menu ```Remote``` select ```Fetch from``` > ```origin```
43-
44-
![Update Step 2](win-screenshots/win-gui-update-2.png)
45-
46-
3. Wait for git to pull any changes and close ```Git GUI```
47-
4. Open ```C:/Users/[YOUR_USER_NAME]/Documents/Arduino/hardware/espressif/esp32/tools``` and double-click ```get.exe```
48-
49-
![Step 4](win-screenshots/win-gui-4.png)
1+
## Steps to install Arduino ESP32 support on Windows
2+
### Tested on 32 and 64 bit Windows 10 machines
3+
4+
1. Download and install the latest Arduino IDE ```Windows Installer``` from [arduino.cc](https://www.arduino.cc/en/Main/Software)
5+
2. Download and install Git from [git-scm.com](https://git-scm.com/download/win)
6+
3. Start ```Git GUI``` and run through the following steps:
7+
- Select ```Clone Existing Repository```
8+
9+
![Step 1](win-screenshots/win-gui-1.png)
10+
11+
- Select source and destination
12+
- Sketchbook Directory: Usually ```C:/Users/[YOUR_USER_NAME]/Documents/Arduino``` and is listed underneath the "Sketchbook location" in Arduino preferences.
13+
- Source Location: ```https://github.com/espressif/arduino-esp32.git```
14+
- Target Directory: ```[ARDUINO_SKETCHBOOK_DIR]/hardware/espressif/esp32```
15+
- Click ```Clone``` to start cloning the repository
16+
17+
![Step 2](win-screenshots/win-gui-2.png)
18+
![Step 3](win-screenshots/win-gui-3.png)
19+
- open a `Git Bash` session pointing to ```ARDUINO_SKETCHBOOK_DIR``` and execute ```git submodule update --init --recursive```
20+
- Open ```[ARDUINO_SKETCHBOOK_DIR]/hardware/espressif/esp32/tools``` and double-click ```get.exe```
21+
22+
![Step 4](win-screenshots/win-gui-4.png)
23+
24+
- When ```get.exe``` finishes, you should see the following files in the directory
25+
26+
![Step 5](win-screenshots/win-gui-5.png)
27+
28+
4. Plug your ESP32 board and wait for the drivers to install (or install manually any that might be required)
29+
5. Start Arduino IDE
30+
6. Select your board in ```Tools > Board``` menu
31+
7. Select the COM port that the board is attached to
32+
8. Compile and upload (You might need to hold the boot button while uploading)
33+
34+
![Arduino IDE Example](win-screenshots/arduino-ide.png)
35+
36+
### How to update to the latest code
37+
38+
1. Start ```Git GUI``` and you should see the repository under ```Open Recent Repository```. Click on it!
39+
40+
![Update Step 1](win-screenshots/win-gui-update-1.png)
41+
42+
2. From menu ```Remote``` select ```Fetch from``` > ```origin```
43+
44+
![Update Step 2](win-screenshots/win-gui-update-2.png)
45+
46+
3. Wait for git to pull any changes and close ```Git GUI```
47+
4. Open ```[ARDUINO_SKETCHBOOK_DIR]/hardware/espressif/esp32/tools``` and double-click ```get.exe```
48+
49+
![Step 4](win-screenshots/win-gui-4.png)

docs/platformio.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
Installation instructions for using PlatformIO
22
=================================================
33

4-
[PlatformIO](http://platformio.org) is an open source ecosystem for IoT development with cross platform build system, library manager and full support for Espressif ESP32 development. It works on the popular host OS: Mac OS X, Windows,Linux 32/64, Linux ARM (like Raspberry Pi, BeagleBone, CubieBoard).
5-
6-
- [What is PlatformIO?](http://docs.platformio.org/page/what-is-platformio.html)
7-
- [PlatformIO IDE](http://platformio.org/platformio-ide)
8-
- Quick Start with [PlatformIO IDE](http://docs.platformio.org/page/ide/atom.html#quick-start) or [PlatformIO Core](http://docs.platformio.org/page/core.html)
9-
- [Integration with Cloud and Standalone IDEs](http://docs.platformio.org/page/ide.html) -
10-
Cloud9, Codeanywehre, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM and Visual Studio
11-
- [Project Examples](https://github.com/platformio/platform-espressif32/tree/develop/examples)
12-
- [Using "Stage" (Git) version of Arduino Core](http://docs.platformio.org/page/platforms/espressif32.html#using-arduino-framework-with-staging-version)
4+
- [What is PlatformIO?](http://docs.platformio.org/en/latest/what-is-platformio.html?utm_source=github&utm_medium=arduino-esp32)
5+
- [PlatformIO IDE](http://platformio.org/platformio-ide?utm_source=github&utm_medium=arduino-esp32)
6+
- [PlatformIO Core](http://docs.platformio.org/en/latest/core.html?utm_source=github&utm_medium=arduino-esp32) (command line tool)
7+
- [Advanced usage](http://docs.platformio.org/en/latest/platforms/espressif32.html?utm_source=github&utm_medium=arduino-esp32) -
8+
custom settings, uploading to SPIFFS, Over-the-Air (OTA), staging version
9+
- [Integration with Cloud and Standalone IDEs](http://docs.platformio.org/en/latest/ide.html?utm_source=github&utm_medium=arduino-esp32) -
10+
Cloud9, Codeanywhere, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM, Visual Studio, and VSCode
11+
- [Project Examples](http://docs.platformio.org/en/latest/platforms/espressif32.html?utm_source=github&utm_medium=arduino-esp32#examples)

libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ void setup() {
6565

6666
void loop() {
6767
ArduinoOTA.handle();
68-
}
68+
}

libraries/ArduinoOTA/keywords.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ ArduinoOTA KEYWORD1
1515
begin KEYWORD2
1616
setup KEYWORD2
1717
handle KEYWORD2
18-
onStart KEYWORD2
19-
onEnd KEYWORD2
20-
onError KEYWORD2
21-
onProgress KEYWORD2
18+
onStart KEYWORD2
19+
onEnd KEYWORD2
20+
onError KEYWORD2
21+
onProgress KEYWORD2
2222

2323
#######################################
2424
# Constants (LITERAL1)

libraries/BluetoothSerial/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### Bluetooth Serial Library
2+
3+
A simple Serial compatible library using ESP32 classical bluetooth (SPP)
4+
5+
6+
7+
#### How to use it?
8+
9+
- Download one bluetooth terminal app in your smartphone<br>
10+
For Android: https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal <br>
11+
For iOS: https://itunes.apple.com/us/app/hm10-bluetooth-serial-lite/id1030454675
12+
13+
- Flash an example sketch to your ESP32
14+
15+
- Scan and pair the device in your smartphone
16+
17+
- Open the bluetooth terminal app
18+
19+
- Enjoy

0 commit comments

Comments
 (0)