Skip to content

Commit 5d2b9d3

Browse files
committed
Merge remote-tracking branch 'upstream/master' into dnsserverdebug
2 parents 83bfebc + 146b2f6 commit 5d2b9d3

File tree

47 files changed

+2271
-213
lines changed

Some content is hidden

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

47 files changed

+2271
-213
lines changed

boards.txt

+55-3
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

@@ -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

+1-1
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-misc.c

+33-7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "nvs.h"
2222
#include "esp_partition.h"
2323
#include "esp_log.h"
24+
#include "pthread.h"
2425
#include <sys/time.h>
2526

2627
//Undocumented!!! Get chip temperature in Farenheit
@@ -38,20 +39,45 @@ void yield()
3839
}
3940

4041
portMUX_TYPE microsMux = portMUX_INITIALIZER_UNLOCKED;
42+
static pthread_key_t microsStore=NULL; // Thread Local Storage Handle
43+
44+
void microsStoreDelete(void * storage) { // release thread local data when task is delete.
45+
if(storage) free(storage);
46+
}
4147

4248
unsigned long IRAM_ATTR micros()
4349
{
44-
static unsigned long lccount = 0;
45-
static unsigned long overflow = 0;
50+
if (!microsStore) { // first Time Ever thread local not init'd
51+
portENTER_CRITICAL_ISR(&microsMux);
52+
pthread_key_create(&microsStore,microsStoreDelete); // create initial holder
53+
portEXIT_CRITICAL_ISR(&microsMux);
54+
}
55+
56+
uint32_t *ptr;// [0] is lastCount, [1] is overFlow
57+
58+
ptr = pthread_getspecific(microsStore); // get address of storage
59+
60+
if(ptr == NULL) { // first time in this thread, allocate mem, init it.
61+
portENTER_CRITICAL_ISR(&microsMux);
62+
ptr = (uint32_t*)malloc(sizeof(uint32_t)*2);
63+
pthread_setspecific(microsStore,ptr); // store the pointer to this thread's values
64+
ptr[0] = 0; // lastCount value
65+
ptr[1] = 0; // overFlow
66+
portEXIT_CRITICAL_ISR(&microsMux);
67+
}
68+
4669
unsigned long ccount;
70+
4771
portENTER_CRITICAL_ISR(&microsMux);
48-
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
49-
if(ccount < lccount){
50-
overflow += UINT32_MAX / CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ;
72+
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) ); //get cycle count
73+
if(ccount < ptr[0]) { // overflow occurred
74+
ptr[1] += UINT32_MAX / CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ;
5175
}
52-
lccount = ccount;
76+
77+
ptr[0] = ccount;
5378
portEXIT_CRITICAL_ISR(&microsMux);
54-
return overflow + (ccount / CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ);
79+
80+
return ptr[1] + (ccount / CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ);
5581
}
5682

5783
unsigned long IRAM_ATTR millis()

cores/esp32/esp32-hal-spi.c

+4-4
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:

docs/arduino-ide/debian_ubuntu.md

+2-2
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/platformio.md

+8-9
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-
- [PlatformIO Core (CLI)](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

+1-1
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

+4-4
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

+19
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//This example code is in the Public Domain (or CC0 licensed, at your option.)
2+
//By Evandro Copercini - 2018
3+
//
4+
//This example creates a bridge between Serial and Classical Bluetooth (SPP)
5+
//and also demonstrate that SerialBT have the same functionalities of a normal Serial
6+
7+
#include "BluetoothSerial.h"
8+
9+
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
10+
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
11+
#endif
12+
13+
BluetoothSerial SerialBT;
14+
15+
void setup() {
16+
Serial.begin(115200);
17+
SerialBT.begin("ESP32test"); //Bluetooth device name
18+
Serial.println("The device started, now you can pair it with bluetooth!");
19+
}
20+
21+
void loop() {
22+
if (Serial.available()) {
23+
SerialBT.write(Serial.read());
24+
}
25+
if (SerialBT.available()) {
26+
Serial.write(SerialBT.read());
27+
}
28+
delay(20);
29+
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#######################################
2+
# Syntax Coloring Map For BluetoothSerial
3+
#######################################
4+
5+
#######################################
6+
# Library (KEYWORD3)
7+
#######################################
8+
9+
BluetoothSerial KEYWORD3
10+
11+
#######################################
12+
# Datatypes (KEYWORD1)
13+
#######################################
14+
15+
BluetoothSerial KEYWORD1
16+
17+
#######################################
18+
# Methods and Functions (KEYWORD2)
19+
#######################################
20+
21+
SerialBT KEYWORD2
22+
23+
24+
#######################################
25+
# Constants (LITERAL1)
26+
#######################################
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=BluetoothSerial
2+
version=1.0
3+
author=Evandro Copercini
4+
maintainer=Evandro Copercini
5+
sentence=Simple UART to Classical Bluetooth bridge for ESP32
6+
paragraph=
7+
category=Communication
8+
url=
9+
architectures=esp32

0 commit comments

Comments
 (0)