Skip to content

Commit c587b44

Browse files
committed
Merge remote-tracking branch 'upstream/master' into wifiMultiExpand
2 parents 838b075 + d5fdd71 commit c587b44

Some content is hidden

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

45 files changed

+565
-280
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ tools/esptool.exe
55
tools/mkspiffs/mkspiffs
66
tools/mkspiffs/mkspiffs.exe
77
.DS_Store
8+
9+
#Ignore files built by Visual Studio/Visual Micro
10+
[Dd]ebug*/
11+
[Rr]elease*/
12+
.vs/
13+
__vm/
14+
*.vcxproj*

Kconfig.projbuild

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ config ARDUINO_SELECTIVE_ESPmDNS
232232
select ARDUINO_SELECTIVE_WiFi
233233
default y
234234

235+
config ARDUINO_SELECTIVE_FFat
236+
bool "Enable FFat"
237+
depends on ARDUINO_SELECTIVE_COMPILATION
238+
select ARDUINO_SELECTIVE_FS
239+
default y
240+
235241
config ARDUINO_SELECTIVE_FS
236242
bool "Enable FS"
237243
depends on ARDUINO_SELECTIVE_COMPILATION

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
[Latest development release ![Development Version](https://img.shields.io/github/release/espressif/arduino-esp32/all.svg?style=plastic) ![Development Date](https://img.shields.io/github/release-date-pre/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) ![Downloads](https://img.shields.io/github/downloads-pre/espressif/arduino-esp32/latest/total.svg?style=plastic)
1616

17-
Most of the framework is implemented. Most noticable is the missing analogWrite. While analogWrite is on it's way, there are a few other options that you can use:
17+
Most of the framework is implemented. Most noticeable is the missing analogWrite. While analogWrite is on it's way, there are a few other options that you can use:
1818
- 16 channels [LEDC](cores/esp32/esp32-hal-ledc.h) which is PWM
1919
- 8 channels [SigmaDelta](cores/esp32/esp32-hal-sigmadelta.h) which uses SigmaDelta modulation
2020
- 2 channels [DAC](cores/esp32/esp32-hal-dac.h) which gives real analog output

boards.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,64 @@ pico32.menu.DebugLevel.verbose.build.code_debug=5
279279

280280
##############################################################
281281

282+
tinypico.name=TinyPICO
283+
284+
tinypico.upload.tool=esptool_py
285+
tinypico.upload.maximum_size=1310720
286+
tinypico.upload.maximum_data_size=327680
287+
tinypico.upload.wait_for_upload_port=true
288+
289+
tinypico.serial.disableDTR=true
290+
tinypico.serial.disableRTS=true
291+
292+
tinypico.build.mcu=esp32
293+
tinypico.build.core=esp32
294+
tinypico.build.variant=pico32
295+
tinypico.build.board=ESP32_PICO
296+
297+
tinypico.build.f_cpu=240000000L
298+
tinypico.build.flash_size=4MB
299+
tinypico.build.flash_freq=80m
300+
tinypico.build.flash_mode=dio
301+
tinypico.build.boot=dio
302+
tinypico.build.partitions=default
303+
tinypico.build.defines=
304+
305+
tinypico.menu.UploadSpeed.921600=921600
306+
tinypico.menu.UploadSpeed.921600.upload.speed=921600
307+
tinypico.menu.UploadSpeed.115200=115200
308+
tinypico.menu.UploadSpeed.115200.upload.speed=115200
309+
tinypico.menu.UploadSpeed.256000.windows=256000
310+
tinypico.menu.UploadSpeed.256000.upload.speed=256000
311+
tinypico.menu.UploadSpeed.230400.windows.upload.speed=256000
312+
tinypico.menu.UploadSpeed.230400=230400
313+
tinypico.menu.UploadSpeed.230400.upload.speed=230400
314+
tinypico.menu.UploadSpeed.460800.linux=460800
315+
tinypico.menu.UploadSpeed.460800.macosx=460800
316+
tinypico.menu.UploadSpeed.460800.upload.speed=460800
317+
tinypico.menu.UploadSpeed.512000.windows=512000
318+
tinypico.menu.UploadSpeed.512000.upload.speed=512000
319+
320+
tinypico.menu.PSRAM.enabled=Enabled
321+
tinypico.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
322+
tinypico.menu.PSRAM.disabled=Disabled
323+
tinypico.menu.PSRAM.disabled.build.defines=
324+
325+
tinypico.menu.DebugLevel.none=None
326+
tinypico.menu.DebugLevel.none.build.code_debug=0
327+
tinypico.menu.DebugLevel.error=Error
328+
tinypico.menu.DebugLevel.error.build.code_debug=1
329+
tinypico.menu.DebugLevel.warn=Warn
330+
tinypico.menu.DebugLevel.warn.build.code_debug=2
331+
tinypico.menu.DebugLevel.info=Info
332+
tinypico.menu.DebugLevel.info.build.code_debug=3
333+
tinypico.menu.DebugLevel.debug=Debug
334+
tinypico.menu.DebugLevel.debug.build.code_debug=4
335+
tinypico.menu.DebugLevel.verbose=Verbose
336+
tinypico.menu.DebugLevel.verbose.build.code_debug=5
337+
338+
##############################################################
339+
282340
turta_iot_node.name=Turta IoT Node
283341

284342
turta_iot_node.upload.tool=esptool_py

cores/esp32/esp32-hal-i2c.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,15 +1270,15 @@ i2c_err_t i2cProcQueue(i2c_t * i2c, uint32_t *readCount, uint16_t timeOutMillis)
12701270

12711271
i2c->dev->ctr.trans_start=1; // go for it
12721272

1273-
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR
1273+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
12741274
portTickType tBefore=xTaskGetTickCount();
12751275
#endif
12761276

12771277
// wait for ISR to complete the transfer, or until timeOut in case of bus fault, hardware problem
12781278

12791279
uint32_t eBits = xEventGroupWaitBits(i2c->i2c_event,EVENT_DONE,pdFALSE,pdTRUE,ticksTimeOut);
12801280

1281-
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR
1281+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
12821282
portTickType tAfter=xTaskGetTickCount();
12831283
#endif
12841284

libraries/BLE/src/BLEAddress.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <iomanip>
1414
#include <string.h>
1515
#include <stdio.h>
16+
#include <malloc.h>
1617
#ifdef ARDUINO_ARCH_ESP32
1718
#include "esp32-hal-log.h"
1819
#endif
@@ -83,13 +84,11 @@ esp_bd_addr_t *BLEAddress::getNative() {
8384
* @return The string representation of the address.
8485
*/
8586
std::string BLEAddress::toString() {
86-
std::stringstream stream;
87-
stream << std::setfill('0') << std::setw(2) << std::hex << (int) ((uint8_t*) (m_address))[0] << ':';
88-
stream << std::setfill('0') << std::setw(2) << std::hex << (int) ((uint8_t*) (m_address))[1] << ':';
89-
stream << std::setfill('0') << std::setw(2) << std::hex << (int) ((uint8_t*) (m_address))[2] << ':';
90-
stream << std::setfill('0') << std::setw(2) << std::hex << (int) ((uint8_t*) (m_address))[3] << ':';
91-
stream << std::setfill('0') << std::setw(2) << std::hex << (int) ((uint8_t*) (m_address))[4] << ':';
92-
stream << std::setfill('0') << std::setw(2) << std::hex << (int) ((uint8_t*) (m_address))[5];
93-
return stream.str();
87+
auto size = 18;
88+
char *res = (char*)malloc(size);
89+
snprintf(res, size, "%02x:%02x:%02x:%02x:%02x:%02x", m_address[0], m_address[1], m_address[2], m_address[3], m_address[4], m_address[5]);
90+
std::string ret(res);
91+
free(res);
92+
return ret;
9493
} // toString
9594
#endif

libraries/BLE/src/BLEAdvertisedDevice.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -484,23 +484,29 @@ void BLEAdvertisedDevice::setTXPower(int8_t txPower) {
484484
* @return A string representation of this device.
485485
*/
486486
std::string BLEAdvertisedDevice::toString() {
487-
std::stringstream ss;
488-
ss << "Name: " << getName() << ", Address: " << getAddress().toString();
487+
std::string res = "Name: " + getName() + ", Address: " + getAddress().toString();
489488
if (haveAppearance()) {
490-
ss << ", appearance: " << getAppearance();
489+
char val[6];
490+
snprintf(val, sizeof(val), "%d", getAppearance());
491+
res += ", appearance: ";
492+
res += val;
491493
}
492494
if (haveManufacturerData()) {
493495
char *pHex = BLEUtils::buildHexData(nullptr, (uint8_t*)getManufacturerData().data(), getManufacturerData().length());
494-
ss << ", manufacturer data: " << pHex;
496+
res += ", manufacturer data: ";
497+
res += pHex;
495498
free(pHex);
496499
}
497500
if (haveServiceUUID()) {
498-
ss << ", serviceUUID: " << getServiceUUID().toString();
501+
res += ", serviceUUID: " + getServiceUUID().toString();
499502
}
500503
if (haveTXPower()) {
501-
ss << ", txPower: " << (int)getTXPower();
504+
char val[4];
505+
snprintf(val, sizeof(val), "%d", getTXPower());
506+
res += ", txPower: ";
507+
res += val;
502508
}
503-
return ss.str();
509+
return res;
504510
} // toString
505511

506512
uint8_t* BLEAdvertisedDevice::getPayload() {

libraries/BLE/src/BLEAdvertising.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void BLEAdvertising::stop() {
262262

263263
void BLEAdvertising::setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t type)
264264
{
265-
log_v(">> setPrivateAddress")
265+
log_v(">> setPrivateAddress");
266266

267267
m_advParams.own_addr_type = type;
268268
esp_err_t errRc = esp_ble_gap_set_rand_addr((uint8_t*)addr);
@@ -271,7 +271,7 @@ void BLEAdvertising::setDeviceAddress(esp_bd_addr_t addr, esp_ble_addr_type_t ty
271271
log_e("esp_ble_gap_set_rand_addr: rc=%d %s", errRc, GeneralUtils::errorToString(errRc));
272272
return;
273273
}
274-
log_v("<< setPrivateAddress")
274+
log_v("<< setPrivateAddress");
275275
} // setPrivateAddress
276276

277277
/**

libraries/BLE/src/BLECharacteristic.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ void BLECharacteristic::handleGATTServerEvent(
378378
}
379379
} else { // read.is_long == false
380380

381+
if (m_pCallbacks != nullptr) { // If is.long is false then this is the first (or only) request to read data, so invoke the callback
382+
m_pCallbacks->onRead(this); // Invoke the read callback.
383+
}
384+
381385
std::string value = m_value.getValue();
382386

383387
if (value.length() + 1 > maxOffset) {
@@ -392,10 +396,6 @@ void BLECharacteristic::handleGATTServerEvent(
392396
rsp.attr_value.offset = 0;
393397
memcpy(rsp.attr_value.value, value.data(), rsp.attr_value.len);
394398
}
395-
396-
if (m_pCallbacks != nullptr) { // If is.long is false then this is the first (or only) request to read data, so invoke the callback
397-
m_pCallbacks->onRead(this); // Invoke the read callback.
398-
}
399399
}
400400
rsp.attr_value.handle = param->read.handle;
401401
rsp.attr_value.auth_req = ESP_GATT_AUTH_REQ_NONE;
@@ -717,17 +717,18 @@ void BLECharacteristic::setWriteProperty(bool value) {
717717
* @return A string representation of the characteristic.
718718
*/
719719
std::string BLECharacteristic::toString() {
720-
std::stringstream stringstream;
721-
stringstream << std::hex << std::setfill('0');
722-
stringstream << "UUID: " << m_bleUUID.toString() + ", handle: 0x" << std::setw(2) << m_handle;
723-
stringstream << " " <<
724-
((m_properties & ESP_GATT_CHAR_PROP_BIT_READ) ? "Read " : "") <<
725-
((m_properties & ESP_GATT_CHAR_PROP_BIT_WRITE) ? "Write " : "") <<
726-
((m_properties & ESP_GATT_CHAR_PROP_BIT_WRITE_NR) ? "WriteNoResponse " : "") <<
727-
((m_properties & ESP_GATT_CHAR_PROP_BIT_BROADCAST) ? "Broadcast " : "") <<
728-
((m_properties & ESP_GATT_CHAR_PROP_BIT_NOTIFY) ? "Notify " : "") <<
729-
((m_properties & ESP_GATT_CHAR_PROP_BIT_INDICATE) ? "Indicate " : "");
730-
return stringstream.str();
720+
std::string res = "UUID: " + m_bleUUID.toString() + ", handle : 0x";
721+
char hex[5];
722+
snprintf(hex, sizeof(hex), "%04x", m_handle);
723+
res += hex;
724+
res += " ";
725+
if (m_properties & ESP_GATT_CHAR_PROP_BIT_READ) res += "Read ";
726+
if (m_properties & ESP_GATT_CHAR_PROP_BIT_WRITE) res += "Write ";
727+
if (m_properties & ESP_GATT_CHAR_PROP_BIT_WRITE_NR) res += "WriteNoResponse ";
728+
if (m_properties & ESP_GATT_CHAR_PROP_BIT_BROADCAST) res += "Broadcast ";
729+
if (m_properties & ESP_GATT_CHAR_PROP_BIT_NOTIFY) res += "Notify ";
730+
if (m_properties & ESP_GATT_CHAR_PROP_BIT_INDICATE) res += "Indicate ";
731+
return res;
731732
} // toString
732733

733734

libraries/BLE/src/BLECharacteristicMap.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,18 @@ void BLECharacteristicMap::setByUUID(BLECharacteristic* pCharacteristic, BLEUUID
116116
* @return A string representation of the characteristic map.
117117
*/
118118
std::string BLECharacteristicMap::toString() {
119-
std::stringstream stringStream;
120-
stringStream << std::hex << std::setfill('0');
119+
std::string res;
121120
int count = 0;
121+
char hex[5];
122122
for (auto &myPair: m_uuidMap) {
123-
if (count > 0) {
124-
stringStream << "\n";
125-
}
123+
if (count > 0) {res += "\n";}
124+
snprintf(hex, sizeof(hex), "%04x", myPair.first->getHandle());
126125
count++;
127-
stringStream << "handle: 0x" << std::setw(2) << myPair.first->getHandle() << ", uuid: " + myPair.first->getUUID().toString();
126+
res += "handle: 0x";
127+
res += hex;
128+
res += ", uuid: " + myPair.first->getUUID().toString();
128129
}
129-
return stringStream.str();
130+
return res;
130131
} // toString
131132

132133

0 commit comments

Comments
 (0)