10000 Sync with upstream · judge2005/arduino-esp32@747ab2e · GitHub
[go: up one dir, main page]

Skip to content

Commit 747ab2e

Browse files
committed
Sync with upstream
2 parents 88e13a0 + aff2e42 commit 747ab2e

File tree

9 files changed

+348
-15
lines changed

9 files changed

+348
-15
lines changed

boards.txt

Lines changed: 178 additions & 0 deletions
+
ttgo-t1.menu.CPUFreq.26=26MHz (26MHz XTAL)
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,128 @@ ttgo-lora32-v1.menu.DebugLevel.verbose.build.code_debug=5
378378

379379
##############################################################
380380

381+
ttgo-t1.name=TTGO T1
382+
383+
ttgo-t1.upload.tool=esptool_py
384+
ttgo-t1.upload.maximum_size=1310720
385+
ttgo-t1.upload.maximum_data_size=327680
386+
ttgo-t1.upload.wait_for_upload_port=true
387+
388+
ttgo-t1.serial.disableDTR=true
389+
ttgo-t1.serial.disableRTS=true
390+
391+
ttgo-t1.build.mcu=esp32
392+
ttgo-t1.build.core=esp32
393+
ttgo-t1.build.variant=ttgo-t1
394+
ttgo-t1.build.board=TTGO_T1
395+
396+
ttgo-t1.build.f_cpu=240000000L
397+
ttgo-t1.build.flash_size=4MB
398+
ttgo-t1.build.flash_freq=40m
399+
ttgo-t1.build.flash_mode=dio
400+
ttgo-t1.build.boot=dio
401+
ttgo-t1.build.partitions=default
402+
ttgo-t1.build.defines=
403+
404+
ttgo-t1.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
405+
ttgo-t1.menu.PartitionScheme.default.build.partitions=default
406+
ttgo-t1.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
407+
ttgo-t1.menu.PartitionScheme.defaultffat.build.partitions=default_ffat
408+
ttgo-t1.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
409+
ttgo-t1.menu.PartitionScheme.minimal.build.partitions=minimal
410+
ttgo-t1.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
411+
ttgo-t1.menu.PartitionScheme.no_ota.build.partitions=no_ota
412+
ttgo-t1.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
413+
ttgo-t1.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
414+
ttgo-t1.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
415+
ttgo-t1.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
416+
ttgo-t1.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS)
417+
ttgo-t1.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat
418+
ttgo-t1.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152
419+
ttgo-t1.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS)
420+
ttgo-t1.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat
421+
ttgo-t1.menu.PartitionScheme. 57A6 noota_3gffat.upload.maximum_size=1048576
422+
ttgo-t1.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
423+
ttgo-t1.menu.PartitionScheme.huge_app.build.partitions=huge_app
424+
ttgo-t1.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
425+
ttgo-t1.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
426+
ttgo-t1.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
427+
ttgo-t1.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
428+
429+
ttgo-t1.menu.CPUFreq.240=240MHz (WiFi/BT)
430+
ttgo-t1.menu.CPUFreq.240.build.f_cpu=240000000L
431+
ttgo-t1.menu.CPUFreq.160=160MHz (WiFi/BT)
432+
ttgo-t1.menu.CPUFreq.160.build.f_cpu=160000000L
433+
ttgo-t1.menu.CPUFreq.80=80MHz (WiFi/BT)
434+
ttgo-t1.menu.CPUFreq.80.build.f_cpu=80000000L
435+
ttgo-t1.menu.CPUFreq.40=40MHz (40MHz XTAL)
436+
ttgo-t1.menu.CPUFreq.40.build.f_cpu=40000000L
437
438+
ttgo-t1.menu.CPUFreq.26.build.f_cpu=26000000L
439+
ttgo-t1.menu.CPUFreq.20=20MHz (40MHz XTAL)
440+
ttgo-t1.menu.CPUFreq.20.build.f_cpu=20000000L
441+
ttgo-t1.menu.CPUFreq.13=13MHz (26MHz XTAL)
442+
ttgo-t1.menu.CPUFreq.13.build.f_cpu=13000000L
443+
ttgo-t1.menu.CPUFreq.10=10MHz (40MHz XTAL)
444+
ttgo-t1.menu.CPUFreq.10.build.f_cpu=10000000L
445+
446+
ttgo-t1.menu.FlashMode.qio=QIO
447+
ttgo-t1.menu.FlashMode.qio.build.flash_mode=dio
448+
ttgo-t1.menu.FlashMode.qio.build.boot=qio
449+
ttgo-t1.menu.FlashMode.dio=DIO
450+
ttgo-t1.menu.FlashMode.dio.build.flash_mode=dio
451+
ttgo-t1.menu.FlashMode.dio.build.boot=dio
452+
ttgo-t1.menu.FlashMode.qout=QOUT
453+
ttgo-t1.menu.FlashMode.qout.build.flash_mode=dout
454+
ttgo-t1.menu.FlashMode.qout.build.boot=qout
455+
ttgo-t1.menu.FlashMode.dout=DOUT
456+
ttgo-t1.menu.FlashMode.dout.build.flash_mode=dout
457+
ttgo-t1.menu.FlashMode.dout.build.boot=dout
458+
459+
ttgo-t1.menu.FlashFreq.80=80MHz
460+
ttgo-t1.menu.FlashFreq.80.build.flash_freq=80m
461+
ttgo-t1.menu.FlashFreq.40=40MHz
462+
ttgo-t1.menu.FlashFreq.40.build.flash_freq=40m
463+
464+
ttgo-t1.menu.FlashSize.4M=4MB (32Mb)
465+
ttgo-t1.menu.FlashSize.4M.build.flash_size=4MB
466+
ttgo-t1.menu.FlashSize.2M=2MB (16Mb)
467+
ttgo-t1.menu.FlashSize.2M.build.flash_size=2MB
468+
ttgo-t1.menu.FlashSize.2M.build.partitions=minimal
469+
ttgo-t1.menu.FlashSize.16M=16MB (128Mb)
470+
ttgo-t1.menu.FlashSize.16M.build.flash_size=16MB
471+
ttgo-t1.menu.FlashSize.16M.build.partitions=ffat
472+
473+
ttgo-t1.menu.UploadSpeed.921600=921600
474+
ttgo-t1.menu.UploadSpeed.921600.upload.speed=921600
475+
ttgo-t1.menu.UploadSpeed.115200=115200
476+
ttgo-t1.menu.UploadSpeed.115200.upload.speed=115200
477+
ttgo-t1.menu.UploadSpeed.256000.windows=256000
478+
ttgo-t1.menu.UploadSpeed.256000.upload.speed=256000
479+
ttgo-t1.menu.UploadSpeed.230400.windows.upload.speed=256000
480+
ttgo-t1.menu.UploadSpeed.230400=230400
481+
ttgo-t1.menu.UploadSpeed.230400.upload.speed=230400
482+
ttgo-t1.menu.UploadSpeed.460800.linux=460800
483+
ttgo-t1.menu.UploadSpeed.460800.macosx=460800
484+
ttgo-t1.menu.UploadSpeed.460800.upload.speed=460800
485+
ttgo-t1.menu.UploadSpeed.512000.windows=512000
486+
ttgo-t1.menu.UploadSpeed.512000.upload.speed=512000
487+
488+
ttgo-t1.menu.DebugLevel.none=None
489+
ttgo-t1.menu.DebugLevel.none.build.code_debug=0
490+
ttgo-t1.menu.DebugLevel.error=Error
491+
ttgo-t1.menu.DebugLevel.error.build.code_debug=1
492+
ttgo-t1.menu.DebugLevel.warn=Warn
493+
ttgo-t1.menu.DebugLevel.warn.build.code_debug=2
494+
ttgo-t1.menu.DebugLevel.info=Info
495+
ttgo-t1.menu.DebugLevel.info.build.code_debug=3
496+
ttgo-t1.menu.DebugLevel.debug=Debug
497+
ttgo-t1.menu.DebugLevel.debug.build.code_debug=4
498+
ttgo-t1.menu.DebugLevel.verbose=Verbose
499+
ttgo-t1.menu.DebugLevel.verbose.build.code_debug=5
500+
501+
##############################################################
502+
381503
cw02.name=XinaBox CW02
382504

383505
cw02.upload.tool=esptool_py
@@ -3718,3 +3840,59 @@ d1_mini32.menu.UploadSpeed.512000.upload.speed=512000
37183840

37193841
##############################################################
37203842

3843+
gpy.name=Pycom GPy
3844+
3845+
gpy.upload.tool=esptool_py
3846+
gpy.upload.maximum_size=1310720
3847+
gpy.upload.maximum_data_size=327680
3848+
gpy.upload.wait_for_upload_port=true
3849+
3850+
gpy.serial.disableDTR=true
3851+
gpy.serial.disableRTS=true
3852+
3853+
gpy.build.mcu=esp32
3854+
gpy.build.core=esp32
3855+
gpy.build.variant=gpy
3856+
gpy.build.board=PYCOM_GPY
3857+
3858+
gpy.build.f_cpu=240000000L
3859+
gpy.build.flash_mode=dio
3860+
gpy.build.flash_size=8MB
3861+
gpy.build.boot=dio
3862+
gpy.build.partitions=default
3863+
3864+
gpy.menu.FlashFreq.80=80MHz
3865+
gpy.menu.FlashFreq.80.build.flash_freq=80m
3866+
gpy.menu.FlashFreq.40=40MHz
3867+
gpy.menu.FlashFreq.40.build.flash_freq=40m
3868+
3869+
gpy.menu.UploadSpeed.921600=921600
3870+
gpy.menu.UploadSpeed.921600.upload.speed=921600
3871+
gpy.menu.UploadSpeed.115200=115200
3872+
gpy.menu.UploadSpeed.115200.upload.speed=115200
3873+
gpy.menu.UploadSpeed.256000.windows=256000
3874+
gpy.menu.UploadSpeed.256000.upload.speed=256000
3875+
gpy.menu.UploadSpeed.230400.windows.upload.speed=256000
3876+
gpy.menu.UploadSpeed.230400=230400
3877+
gpy.menu.UploadSpeed.230400.upload.speed=230400
3878+
gpy.menu.UploadSpeed.460800.linux=460800
3879+
gpy.menu.UploadSpeed.460800.macosx=460800
3880+
gpy.menu.UploadSpeed.460800.upload.speed=460800
3881+
gpy.menu.UploadSpeed.512000.windows=512000
3882+
gpy.menu.UploadSpeed.512000.upload.speed=512000
3883+
3884+
gpy.menu.DebugLevel.none=None
3885+
gpy.menu.DebugLevel.none.build.code_debug=0
3886+
gpy.menu.DebugLevel.error=Error
3887+
gpy.menu.DebugLevel.error.build.code_debug=1
3888+
gpy.menu.DebugLevel.warn=Warn
3889+
gpy.menu.DebugLevel.warn.build.code_debug=2
3890+
gpy.menu.DebugLevel.info=Info
3891+
gpy.menu.DebugLevel.info.build.code_debug=3
3892+
gpy.menu.DebugLevel.debug=Debug
3893+
gpy.menu.DebugLevel.debug.build.code_debug=4
3894+
gpy.menu.DebugLevel.verbose=Verbose
3895+
gpy.menu.DebugLevel.verbose.build.code_debug=5
3896+
3897+
##############################################################
3898+

cores/esp32/Arduino.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@
6868
#define __STRINGIFY(a) #a
6969
#endif
7070

71-
// undefine stdlib's abs if encountered
72-
#ifdef abs
73-
#undef abs
74-
#endif
75-
76-
#define abs(x) ((x)>0?(x):-(x))
7771
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
7872
#define radians(deg) ((deg)*DEG_TO_RAD)
7973
#define degrees(rad) ((rad)*RAD_TO_DEG)
@@ -160,6 +154,7 @@ void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
160154
#include "HardwareSerial.h"
161155
#include "Esp.h"
162156

157+
using std::abs;
163158
using std::isinf;
164159
using std::isnan;
165160
using std::max;

cores/esp32/StreamString.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525

2626
size_t StreamString::write(const uint8_t *data, size_t size) {
2727
if(size && data) {
28-
if(reserve(length() + size + 1)) {
28+
const unsigned int newlen = length() + size;
29+
if(reserve(newlen + 1)) {
2930
memcpy((void *) (wbuffer() + len()), (const void *) data, size);
30-
setLen(len() + size);
31-
*(wbuffer() + len()) = 0x00; // add null for string end
31+
setLen(newlen);
32+
*(wbuffer() + newlen) = 0x00; // add null for string end
3233
return size;
3334
}
3435
}

docs/arduino-ide/mac.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ Installation instructions for Mac OS
2323

2424
- Try `python3` instead of `python` if you get the error: `IOError: [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)` when running `python get.py`
2525

26+
- If you get the following error when running `python get.py` urllib.error.URLError: <urlopen error SSL: CERTIFICATE_VERIFY_FAILED, go to Macintosh HD > Applications > Python3.6 folder (or any other python version), and run the following scripts: Install Certificates.command and Update Shell Profile.command
27+
2628
- Restart Arduino IDE
2729

libraries/BLE/src/BLEAdvertising.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,27 @@ void BLEAdvertising::stop() {
253253
log_v("<< stop");
254254
} // stop
255255

256+
/**
257+
* @brief Set BLE address.
258+
* @param [in] Bluetooth address.
259+
* @param [in] Bluetooth address type.
260+
* Set BLE address.
261+
*/
262+
263+
void BLEAdvertising::setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t type)
264+
{
265+
log_v(">> setPrivateAddress")
266+
267+
m_advParams.own_addr_type = type;
268+
esp_err_t errRc = esp_ble_gap_set_rand_addr((uint8_t*)addr);
269+
if (errRc != ESP_OK)
270+
{
271+
log_e("esp_ble_gap_set_rand_addr: rc=%d %s", errRc, GeneralUtils::errorToString(errRc));
272+
return;
273+
}
274+
log_v("<< setPrivateAddress")
275+
} // setPrivateAddress
276+
256277
/**
257278
* @brief Add data to the payload to be advertised.
258279
* @param [in] data The data to be added to the payload.

libraries/BLE/src/BLEAdvertising.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class BLEAdvertising {
5858
void setScanFilter(bool scanRequertWhitelistOnly, bool connectWhitelistOnly);
5959
void setScanResponseData(BLEAdvertisementData& advertisementData);
6060
void setPrivateAddress(esp_ble_addr_type_t type = BLE_ADDR_TYPE_RANDOM);
61+
void setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t type = BLE_ADDR_TYPE_RANDOM);
6162

6263
void handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param);
6364
void setMinPreferred(uint16_t);

libraries/BLE/src/FreeRTOS.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,20 @@ uint32_t FreeRTOS::getTimeSinceStart() {
6161
*/
6262
uint32_t FreeRTOS::Semaphore::wait(std::string owner) {
6363
log_v(">> wait: Semaphore waiting: %s for %s", toString().c_str(), owner.c_str());
64-
64+
6565
if (m_usePthreads) {
6666
pthread_mutex_lock(&m_pthread_mutex);
6767
} else {
6868
xSemaphoreTake(m_semaphore, portMAX_DELAY);
6969
}
7070

71-
m_owner = owner;
72-
7371
if (m_usePthreads) {
7472
pthread_mutex_unlock(&m_pthread_mutex);
7573
} else {
7674
xSemaphoreGive(m_semaphore);
7775
}
7876

7977
log_v("<< wait: Semaphore released: %s", toString().c_str());
80-
m_owner = std::string("<N/A>");
8178
return m_value;
8279
} // wait
8380

@@ -87,7 +84,8 @@ FreeRTOS::Semaphore::Semaphore(std::string name) {
8784
if (m_usePthreads) {
8885
pthread_mutex_init(&m_pthread_mutex, nullptr);
8986
} else {
90-
m_semaphore = xSemaphoreCreateMutex();
87+
m_semaphore = xSemaphoreCreateBinary();
88+
xSemaphoreGive(m_semaphore);
9189
}
9290

9391
m_name = name;
@@ -111,6 +109,8 @@ FreeRTOS::Semaphore::~Semaphore() {
111109
*/
112110
void FreeRTOS::Semaphore::give() {
113111
log_v("Semaphore giving: %s", toString().c_str());
112+
m_owner = std::string("<N/A>");
113+
114114
if (m_usePthreads) {
115115
pthread_mutex_unlock(&m_pthread_mutex);
116116
} else {
@@ -120,7 +120,6 @@ void FreeRTOS::Semaphore::give() {
120120
// FreeRTOS::sleep(10);
121121
// #endif
122122

123-
m_owner = std::string("<N/A>");
124123
} // Semaphore::give
125124

126125

variants/gpy/pins_arduino.h

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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 18
9+
10+
#define analogInputToDigitalPin(p) (((p)<40)?(esp32_adc2gpio[(p)]):-1)
11+
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
14+
// Sequans Monarch LTE Cat M1/NB1 modem
15+
// NOTE: The Pycom pinout as well as spec sheet block diagram / pin details
16+
// incorrectly list the LTE pins. The correct pins are defined in the source and CSV
17+
// at https://github.com/pycom/pycom-micropython-sigfox/tree/master/esp32/boards/GPY.
18+
#define LTE_CTS 18 // GPIO18 - Sequans modem CTS
19+
#define LTE_RTS 19 // GPIO19 - Sequans modem RTS (pull low to communicate)
20+
#define LTE_RX 23 // GPIO23 - Sequans modem RX
21+
#define LTE_TX 5 // GPIO5 - Sequans modem TX
22+
#define LTE_WAKE 27 // GPIO27 - Sequans modem wake-up interrupt
23+
#define LTE_BAUD 921600
24+
25+
static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!!
26+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
27+
28+
#define ANT_SELECT 21 // GPIO21 - WiFi external / internal antenna switch
29+
30+
static const uint8_t TX = 1;
31+
static const uint8_t RX = 3;
32+
33+
static const uint8_t SDA = 12;
34+
static const uint8_t SCL = 13;
35+
36+
static const uint8_t SS = 17;
37+
static const uint8_t MOSI = 22;
38+
static const uint8_t MISO = 37;
39+
static const uint8_t SCK = 13;
40+
41+
static const uint8_t A0 = 36;
42+
static const uint8_t A1 = 37;
43+
static const uint8_t A2 = 38;
44+
static const uint8_t A3 = 39;
45+
static const uint8_t A4 = 32;
46+
static const uint8_t A5 = 33;
47+
static const uint8_t A6 = 34;
48+
static const uint8_t A7 = 35;
49+
static const uint8_t A10 = 4;
50+
static const uint8_t A11 = 0;
51+
static const uint8_t A12 = 2;
52+
static const uint8_t A13 = 15;
53+
static const uint8_t A14 = 13;
54+
static const uint8_t A15 = 12;
55+
static const uint8_t A16 = 14;
56+
static const uint8_t A17 = 27;
57+
static const uint8_t A18 = 25;
58+
static const uint8_t A19 = 26;
59+
60+
static const uint8_t T0 = 4;
61+
static const uint8_t T1 = 0;
62+
static const uint8_t T2 = 2;
63+
static const uint8_t T3 = 15;
64+
static const uint8_t T4 = 13;
65+
static const uint8_t T5 = 12;
66+
static const uint8_t T6 = 14;
67+
static const uint8_t T7 = 27;
68+
static const uint8_t T8 = 33;
69+
static const uint8_t T9 = 32;
70+
71+
static const uint8_t DAC1 = 25;
72+
static const uint8_t DAC2 = 26;
73+
74+
#endif /* Pins_Arduino_h */

0 commit comments

Comments
 (0)
0