Skip to content

Backmerge #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 70 commits into from
Oct 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
9fc3f1e
Fix wrong SPI peripheral enabled
me-no-dev Sep 13, 2017
27d54b3
Very slight difference between LoRa kit and WiFi kit. (#629)
pnewb Sep 13, 2017
658acfe
Add missing headers
me-no-dev Sep 14, 2017
79ee46e
beautify partition
me-no-dev Sep 14, 2017
ab0ea2f
Fix missing method from SPI HAL
me-no-dev Sep 18, 2017
db79c2e
Add api to get CPU temperature
me-no-dev Sep 18, 2017
f648ad7
Allow WiFi Event Callback to read the event info
me-no-dev Sep 18, 2017
4cf0e98
Fix desync with IDF in dhcpserver
me-no-dev Sep 20, 2017
17add63
Add Example Code for WPS Functionality (#648)
Raienryu97 Sep 21, 2017
4092fc4
Add baudRate function (#651)
Sep 21, 2017
c66a020
Add guards to not compile BT code if not enabled
me-no-dev Sep 21, 2017
1407654
Must include sdkconfig.h before testing defines
me-no-dev Sep 21, 2017
eb28213
Allow DHCP to be started again by giving a zero IP address to STA config
me-no-dev Sep 22, 2017
e2bd93c
Fix UART0 not able to read/available
me-no-dev Sep 22, 2017
d27d297
Update IDF to c4e65d6
me-no-dev Sep 22, 2017
4c36e03
Added ESPNow basic example (#667)
arvindr21 Sep 26, 2017
dbf7b10
Update README.md with install instructions for openSUSE (#585)
joba1 Sep 26, 2017
cc00af3
Update opensuse.md
me-no-dev Sep 26, 2017
db77195
Fix Serial
me-no-dev Sep 27, 2017
2b6d47a
Fix race in SPI endTransaction
me-no-dev Sep 27, 2017
a66b544
Added ESPNow Multi-Slave example (#669)
arvindr21 Sep 27, 2017
3ba46c7
Add totalBytes / usedBytes to SD/SDMMC (#673)
Sep 28, 2017
28b7b4e
Move network events to their own task
me-no-dev Sep 28, 2017
7991161
Change Pin Interrupt Allocator
me-no-dev Sep 28, 2017
f9b2d42
Change Touch interrupt allocator
me-no-dev Sep 28, 2017
6d98555
Change timer interrupt allocator
me-no-dev Sep 28, 2017
17ece1b
Revert Timer Interrupt setup
me-no-dev Sep 28, 2017
af35773
OK Really change timer allocator
me-no-dev Sep 28, 2017
4230aec
Allow HTTPClient to access HTTPS without providing a certificate
me-no-dev Sep 28, 2017
7aa1913
Allow HTTPS without certificate to use begin(url)
me-no-dev Sep 29, 2017
e72895b
Quiet SSL and HTTPClient debug
me-no-dev Sep 29, 2017
10ff1de
Add example to update ESP32 via SD card (#628)
Curclamas Sep 29, 2017
0cd6285
I2c reset functionality (#678)
lonerzzz Sep 29, 2017
28be506
uncomment I2C debug so it can be used
me-no-dev Sep 29, 2017
c240674
Add mkspiffs
me-no-dev Sep 30, 2017
a20f94c
Revert "Add mkspiffs"
me-no-dev Sep 30, 2017
d208a36
Use correct sign of offset for TZ variable (#685)
Oct 1, 2017
17a1a24
fix SPIFFS example
me-no-dev Oct 1, 2017
171032b
Print an error when serial number is invalid (#691)
copercini Oct 4, 2017
3b972e8
Link cxx_guards from IDF libcxx not from libstdc++ (#695)
projectgus Oct 4, 2017
8dc0c86
Chip revision fix (#704)
Testato Oct 8, 2017
2f0cfa9
Update pgmspace.h (#707)
stickbreaker Oct 9, 2017
22d92e7
Change size of fatfs ioctl returns
me-no-dev Oct 9, 2017
de408d0
Bump arduino version for IDF builds
me-no-dev Oct 9, 2017
3fea101
Changed update example to use different controlflow structure (#711)
Kevintjeb Oct 10, 2017
f1e87d9
Create ledcWrite_RGB.ino (#688)
Oct 10, 2017
0fa25c0
Fix possible leak in String
me-no-dev Oct 12, 2017
cabc4c5
ESP32 default port in comment (#721)
rafacouto Oct 13, 2017
e6a5b68
Added argument to HardwareSerial.begin to specify whether the logic l…
ewasscher Oct 13, 2017
60b8b47
Update IDF to de750e9 and add BLE (#723)
me-no-dev Oct 13, 2017
c8ffcac
Add mkspiffs
me-no-dev Oct 13, 2017
409c75d
Implement ESP_LOGx override option
me-no-dev Oct 13, 2017
9fe3230
Update esp-idf_component.md
me-no-dev Oct 13, 2017
7216977
Update IDF to 3a271a4 (#735)
me-no-dev Oct 16, 2017
2f73dd7
add alternate location of this directory (#732)
tedder Oct 16, 2017
3261348
remove instead of delete (#730)
Testato Oct 16, 2017
c8ad79e
Second occurace of parameter^Cfno-rtti removed (#736)
Oct 17, 2017
81f225a
Fix ioctl undefined in latest IDF
me-no-dev Oct 18, 2017
7eff707
Fix Early return when Address NAK is received (#750)
stickbreaker Oct 21, 2017
43544d8
Run WiFi thread on the Arduino core
me-no-dev Oct 21, 2017
0c038b4
Update WiFiGeneric.cpp
me-no-dev Oct 21, 2017
1270f40
Add initial handling for long I2C reads.
lonerzzz Oct 21, 2017
a695187
Correct 10bit Device address handling.
stickbreaker Oct 21, 2017
4470e28
WiFiClientSecure fail if gethostbyname returns null
me-no-dev Oct 23, 2017
2a1a62a
Merge pull request #751 from espressif/longReads
lonerzzz Oct 23, 2017
1156534
Merge branch 'master' into master
lonerzzz Oct 23, 2017
9512368
Merge pull request #754 from stickbreaker/master
lonerzzz Oct 23, 2017
55289a4
Update IDF to 9274814 (#767)
me-no-dev Oct 23, 2017
4f55293
change esptool path logic
me-no-dev Oct 23, 2017
84b8582
Optimize esptool path for packaging and fix possible build errors in …
me-no-dev Oct 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

tools/xtensa-esp32-elf
tools/dist
tools/esptool
tools/esptool.exe
tools/mkspiffs/mkspiffs
tools/mkspiffs/mkspiffs.exe
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "libraries/BLE"]
path = libraries/BLE
url = https://github.com/nkolban/ESP32_BLE_Arduino.git
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ script:
- mkdir espressif
- cd espressif
- ln -s $TRAVIS_BUILD_DIR esp32
- cd esp32/tools
- cd esp32
- git submodule update --init --recursive
- cd tools
- python get.py
- export PATH="$HOME/arduino_ide:$TRAVIS_BUILD_DIR/tools/xtensa-esp32-elf/bin:$PATH"
- which arduino
Expand Down
10 changes: 10 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ config ARDUHAL_LOG_COLORS
Enable ANSI terminal color codes in bootloader output.
In order to view these, your terminal program must support ANSI color codes.

config ARDUHAL_ESP_LOG
bool "Forward ESP_LOGx to Arduino log output"
default "n"
help
This option will redefine the ESP_LOGx macros to Arduino's log_x macros.
To enable for your application, add the follwing after your includes:
#ifdef ARDUINO_ARCH_ESP32
#include "esp32-hal-log.h"
#endif

endmenu

config AUTOCONNECT_WIFI
Expand Down
2 changes: 1 addition & 1 deletion Makefile.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif
BOOT_APP_BIN_FLASH_CMD = $(ESPTOOLPY_SERIAL) write_flash $(BOOT_APP_BIN_OFFSET) $(BOOT_APP_BIN_PATH)
ESPTOOL_ALL_FLASH_ARGS += $(BOOT_APP_BIN_OFFSET) $(BOOT_APP_BIN_PATH)

CPPFLAGS += -DARDUINO=180 -DESP32=1 -DARDUINO_ARCH_ESP32=1
CPPFLAGS += -DARDUINO=10800 -DESP32=1 -DARDUINO_ARCH_ESP32=1

boot-app0:
@echo "Rebooting to APP0"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Most of the framework is implemented. Most noticable is the missing analogWrite.
+ [Instructions for Mac](docs/arduino-ide/mac.md)
+ [Instructions for Debian/Ubuntu Linux](docs/arduino-ide/debian_ubuntu.md)
+ [Instructions for Fedora](docs/arduino-ide/fedora.md)
+ [Instructions for openSUSE](docs/arduino-ide/opensuse.md)
- [Using PlatformIO](docs/platformio.md)
- [Building with make](docs/make.md)
- [Using as ESP-IDF component](docs/esp-idf_component.md)
Expand Down
4 changes: 3 additions & 1 deletion cores/esp32/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ uint32_t EspClass::getFreeHeap(void)

uint8_t EspClass::getChipRevision(void)
{
return (REG_READ(EFUSE_BLK0_RDATA3_REG) >> EFUSE_RD_CHIP_VER_RESERVE_S) && EFUSE_RD_CHIP_VER_RESERVE_V;
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
return chip_info.revision;
}

const char * EspClass::getSdkVersion(void)
Expand Down
12 changes: 10 additions & 2 deletions cores/esp32/HardwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ HardwareSerial Serial(0);

HardwareSerial::HardwareSerial(int uart_nr) : _uart_nr(uart_nr), _uart(NULL) {}

void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin)
void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
{
if(0 > _uart_nr || _uart_nr > 2) {
log_e("Serial number is invalid, please use 0, 1 or 2");
return;
}
if(_uart) {
end();
}
Expand All @@ -26,7 +30,7 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in
rxPin = 16;
txPin = 17;
}
_uart = uartBegin(_uart_nr, baud, config, rxPin, txPin, 256, false);
_uart = uartBegin(_uart_nr, baud, config, rxPin, txPin, 256, invert);
}

void HardwareSerial::end()
Expand Down Expand Up @@ -89,7 +93,11 @@ size_t HardwareSerial::write(const uint8_t *buffer, size_t size)
uartWriteBuf(_uart, buffer, size);
return size;
}
uint32_t HardwareSerial::baudRate()

{
return uartGetBaudRate(_uart);
}
HardwareSerial::operator bool() const
{
return true;
Expand Down
3 changes: 2 additions & 1 deletion cores/esp32/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class HardwareSerial: public Stream
public:
HardwareSerial(int uart_nr);

void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1);
void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false);
void end();
int available(void);
int peek(void);
Expand Down Expand Up @@ -66,6 +66,7 @@ class HardwareSerial: public Stream
{
return write((uint8_t) n);
}
uint32_t baudRate();
operator bool() const;

void setDebugOutput(bool);
Expand Down
21 changes: 13 additions & 8 deletions cores/esp32/WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "WString.h"
#include "stdlib_noniso.h"
#include "esp32-hal-log.h"
//extern "C" {
//#include "esp_common.h"
//}
Expand Down Expand Up @@ -165,19 +166,23 @@ unsigned char String::reserve(unsigned int size)

unsigned char String::changeBuffer(unsigned int maxStrLen)
{
size_t newSize = (maxStrLen + 16) & (~0xf);
char *newbuffer = (char *) malloc(newSize);
size_t newSize = ((maxStrLen + 16) & (~0xf)) - 1;
char *newbuffer = (char *) realloc(buffer, newSize+1);
if(newbuffer) {
memset(newbuffer, 0, newSize);
memcpy(newbuffer, buffer, len);
if (buffer) {
free(buffer);
if(newSize > len){
if(newSize > capacity){
memset(newbuffer+capacity, 0, newSize-capacity);
}
} else {
//new buffer can not fit the old len
newbuffer[newSize] = 0;
len = newSize;
}
capacity = newSize - 1;
capacity = newSize;
buffer = newbuffer;
return 1;
}
buffer = newbuffer;
log_e("realloc failed! Buffer unchanged");
return 0;
}

Expand Down
5 changes: 3 additions & 2 deletions cores/esp32/esp32-hal-bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

#include "esp32-hal-bt.h"

#if CONFIG_BT_ENABLED
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)


#include "bt.h"
#include "esp_bt_defs.h"
Expand Down Expand Up @@ -51,7 +52,7 @@ bool btStop(){
return true;
}
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){
if (esp_bt_controller_disable(ESP_BT_MODE_BTDM)) {
if (esp_bt_controller_disable()) {
log_e("BT Disable failed");
return false;
}
Expand Down
24 changes: 7 additions & 17 deletions cores/esp32/esp32-hal-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include "soc/gpio_struct.h"
#include "soc/rtc_io_reg.h"

#define ETS_GPIO_INUM 12

const int8_t esp32_adc2gpio[20] = {36, -1, -1, 39, 32, 33, 34, 35, -1, -1, 4, 0, 2, 15, 13, 12, 14, 27, 25, 26};

const DRAM_ATTR esp32_gpioMux_t esp32_gpioMux[GPIO_PIN_COUNT]={
Expand Down Expand Up @@ -193,6 +191,7 @@ extern int IRAM_ATTR __digitalRead(uint8_t pin)
return 0;
}

static intr_handle_t gpio_intr_handle = NULL;

static void IRAM_ATTR __onPinInterrupt(void *arg)
{
Expand Down Expand Up @@ -229,38 +228,29 @@ static void IRAM_ATTR __onPinInterrupt(void *arg)
extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int intr_type)
{
static bool interrupt_initialized = false;
static int core_id = 0;

if(!interrupt_initialized) {
interrupt_initialized = true;
core_id = xPortGetCoreID();
ESP_INTR_DISABLE(ETS_GPIO_INUM);
intr_matrix_set(core_id, ETS_GPIO_INTR_SOURCE, ETS_GPIO_INUM);
xt_set_interrupt_handler(ETS_GPIO_INUM, &__onPinInterrupt, NULL);
ESP_INTR_ENABLE(ETS_GPIO_INUM);
esp_intr_alloc(ETS_GPIO_INTR_SOURCE, (int)ESP_INTR_FLAG_IRAM, __onPinInterrupt, NULL, &gpio_intr_handle);
}
__pinInterruptHandlers[pin] = userFunc;
//lock gpio
ESP_INTR_DISABLE(ETS_GPIO_INUM);
if(core_id) { //APP_CPU
esp_intr_disable(gpio_intr_handle);
if(esp_intr_get_cpu(gpio_intr_handle)) { //APP_CPU
GPIO.pin[pin].int_ena = 1;
} else { //PRO_CPU
GPIO.pin[pin].int_ena = 4;
}
GPIO.pin[pin].int_type = intr_type;
ESP_INTR_ENABLE(ETS_GPIO_INUM);
//unlock gpio
esp_intr_enable(gpio_intr_handle);
}

extern void __detachInterrupt(uint8_t pin)
{
//lock gpio
ESP_INTR_DISABLE(ETS_GPIO_INUM);
esp_intr_disable(gpio_intr_handle);
__pinInterruptHandlers[pin] = NULL;
GPIO.pin[pin].int_ena = 0;
GPIO.pin[pin].int_type = 0;
ESP_INTR_ENABLE(ETS_GPIO_INUM);
//unlock gpio
esp_intr_enable(gpio_intr_handle);
}


Expand Down
Loading