Commit Graph

621 Commits

Author SHA1 Message Date
me-no-dev
1058e89dc3 Fix wrong bitmask returned for pins above 31 2017-03-03 14:42:14 +02:00
me-no-dev
946e52da98 Break on any error when flushing a client 2017-03-02 12:32:32 +02:00
me-no-dev
6fc96b977f Add WiFiClient flush to clear all non-read data in RX
fixes: https://github.com/espressif/arduino-esp32/issues/119
2017-03-02 02:49:53 +02:00
me-no-dev
72ce040785 Use wildcard for core includes in IDF
thanks @Curclamas for pointing it out :)
2017-03-02 01:26:41 +02:00
David Schroeder
f0fc28f0e3 Rework WiFiClient (#238)
* Rework WiFiClient

Rework WiFiClient to correct error where making a copy of a WiFiClient object resulted in the socket being closed prematurely.

Added loop and select to write to handle/prevent EAGAIN errors.

* Rework WiFiClient to use shared_ptr

Rework changes to utilize shared_ptr rather than manually maintaining reference count. 

Revert changes to write

* Incorporate comments from review

Move WiFiClientSocketHandle and fd() into WiFiClient.cpp
2017-03-02 00:47:16 +02:00
David Schroeder
770830aa01 Revise WiFiClient::Write to handle EAGAIN (#240)
The send call may return EAGAIN. This indicates a recoverable error and a retry should be attempted. The current implementation treats this as a fatal error. Further, the current implementation strips the error code, setting it to 0, which prevents the caller from handling it directly. 
This change utilizes select to verify the socket is available prior to calling send and will retry on an EAGAIN condition.
2017-03-01 00:37:00 +02:00
me-no-dev
5f2b00228c IDF add some defaults and allow Arduino to run in single-core mode 2017-02-28 23:36:05 +02:00
me-no-dev
bcd6dcf5f6 Fix compile error with IDF and mbedtls debug off 2017-02-28 23:18:06 +02:00
Martin Sloup
00c1a65612 Improvements in EspClass (#222)
* Improvements in EspClass

- fixed not working functions for flash chip size, speed and mode
- added function to retrieve chip revision from eFuse
- flashRead / flashWrite supports encrypted flash

* Rename getCpuRevision function to getChipRevision

* Revert: flashRead / flashWrite supports encrypted flash

Reading and writing to encrypted flash has to be aligned to 16-bytes. Also NAND way of writing (i.e. flipping 1s to 0s) will not work with spi_flash_write_encrypted. Note: spi_flash_read_encrypted will always try to decrypt data, even if it wasn't encrypted in the first place.
2017-02-23 02:23:27 +02:00
me-no-dev
1d759380a6 Major IDF and Arduino Update
WiFi and BlueTooth can now be started and stopped at will.
basic functions added to esp32-hal to start and stop the BT radio
SimpleBLE class added to show the most basic functionality
Example to show how to switch between BT, WiFi or Both
2017-02-23 01:11:57 +02:00
me-no-dev
b5ac95b274 Update RepeatTimer example
Implement semaphore and mutex to safeguard the ISR.
This is the proper way to handle hardware Interrupts with FreeRTOS. The
more regular approach may/will lead to exceptions
2017-02-20 15:08:11 +02:00
me-no-dev
e873d577f7 Restructure Arduino.h a bit to help eclipse code indexer 2017-02-20 15:06:22 +02:00
me-no-dev
422d24b43f Update IDF libs 2017-02-20 00:00:12 +02:00
Martin Sloup
a83dd5f2b5 Add RepeatTimer example (#216) 2017-02-17 15:55:07 +02:00
wami
95cb54cede [fix] return add --- error: no return statement in function returning non-void (#205) 2017-02-17 00:43:59 +02:00
me-no-dev
90ebfdbbcc Add some Arduino defines to IDF 2017-02-16 00:18:03 +02:00
me-no-dev
3cbc405edf Add helper for sending 16bit color buffers 2017-02-14 11:58:04 +02:00
me-no-dev
d0232d126a SPI implement transaction locking
Use transactions to skip mutex locks for reads and writes
2017-02-14 04:15:38 +02:00
me-no-dev
9bd5de11a7 add hook for bluetooth to Arduino INIT 2017-02-14 04:15:38 +02:00
Martin Sloup
43cc3dc815 Fix for implicit declaration of function nvs_flash_init error (#204) 2017-02-13 01:56:47 +02:00
Martin Sloup
a36ef2aea8 Added LEDC Software Fade example (#202)
* Added LEDC Fade exmaple

* Renamed LEDCFade example to LEDCSoftwareFade

Added valueMax parameter for ledcAnalogWrite

* Remove usage of LED_BUILTIN constant to solve CI errors
2017-02-12 17:30:12 +02:00
me-no-dev
8c1e7018c9 Change library name for IDF 2017-02-12 00:28:09 +02:00
Martin Sloup
f9ba8e9ccf Refactoring EPS32NVS library to Preferences library (#199)
* Refactoring EPS32NVS library to Preferences library

* Renaming all set* functions to put
* Added functions for float, double and bool

* Small redesign of Preferences API

* added type to put* function names
* for (u)int64_t used functions name with *(U)Long64
* added functions for long and unsigned long (same like int a unsigned int)
2017-02-12 00:08:22 +02:00
me-no-dev
4a90aeebc9 fix ESP:: getCpuFreqMHz 2017-02-11 23:36:16 +02:00
me-no-dev
450ea0d211 Update ESP class 2017-02-11 23:34:43 +02:00
me-no-dev
a28a7f12d5 Add default partition table and app selector bin to IDF 2017-02-11 23:27:18 +02:00
me-no-dev
09f5f7266b move yield to function
fixes: https://github.com/espressif/arduino-esp32/issues/193
2017-02-11 00:25:15 +02:00
copercini
8ab3231e31 Add WiFiClient secure lib (#184)
* Provide SSL/TLS functions to ESP32 with Arduino IDE

* Generate a new random number in case of reconnection
2017-02-11 00:20:24 +02:00
Martin Sloup
0fb5e5ca11 Improves in ESP32NVS library (#196)
* Improved ESP32NVS default value support for read* functions

Fixed uninitialized NVS flash storage. Added example code.

* Add methods for String and remove unnecessary nvs_flash_init() in ESP32NVS class

+ other minor declaration fixes

* ESP32NVS function name renaming

* read* -> get*
* write* -> set*
* erase -> clear / remove
2017-02-11 00:18:57 +02:00
Ivan Kravets
5de2429bf8 Wrap "gen_esp32part" command with verbose action and own label (#198) 2017-02-11 00:14:09 +02:00
Ivan Kravets
d92c7686b0 Add support for custom partition table; use built-in esptool.py (#195) 2017-02-10 19:33:55 +02:00
Me No Dev
fb8fe671d6 New partitions (#192)
* Add new partition scheme

* Init NVS early, so it can be used without BT or WiFi
2017-02-10 14:11:24 +02:00
me-no-dev
1f0df1ef97 Fix wrong return values for WiFi::softAPConfig
fixes: https://github.com/espressif/arduino-esp32/issues/191
2017-02-10 13:49:43 +02:00
me-no-dev
0101564219 fix compilation error if debug level is above debug and less or equal to warn 2017-02-10 04:27:48 +02:00
me-no-dev
8df22cac80 Store WiFi settings in flash
Fixes: https://github.com/espressif/arduino-esp32/issues/173
2017-02-10 02:01:16 +02:00
me-no-dev
6a058275e7 Remove unimplemented methods from SPI 2017-02-09 20:40:56 +02:00
Martin Sloup
3e87dcf748 beginPacket can be used without listening on socket (#185)
Currently there is bug in WiFiUDP library when you want to use beginPacket(...) without listening on socket (without calling begin(...) first). You can't send any data because socket is not open and also tx_buffer is not allocated which cause crash while writing data to tx_buffer.
2017-02-08 23:10:16 +02:00
me-no-dev
bfa979a900 Add initial NVS Arduino implementation 2017-02-08 23:09:42 +02:00
me-no-dev
7a7b697ff9 Add ESP::deepSleep(us)
fixes: https://github.com/espressif/arduino-esp32/issues/51
2017-02-08 20:32:49 +02:00
me-no-dev
fdc4f53eb6 fix WiFi disconnect reason index 2017-02-08 20:20:00 +02:00
Martin Sloup
67128fcb2c Fixes implementation of __FlashStringHelper (#183)
Previous __FlashStringHelper implementation was defines as a char which brought problem in case the method with char* parameter used overloading with __FlashStringHelper* parameter (they was identical). Now __FlashStringHelper is defined as a class and all casts between char* and __FlashStringHelper* are made with reinterpret_cast sugar.
2017-02-08 19:57:26 +02:00
Ion
cea41d965a Add Touchread example (#175)
* Add Touchread example

* Rename libraries/ESP32/examples/Touch/TouchRead.ino to libraries/ESP32/examples/Touch/TouchRead/TouchRead.ino

* Update TouchRead.ino
2017-02-07 03:42:43 +02:00
Martin Sloup
e62ecb3ef4 Added boards constants for LED_BUILTIN and KEY_BUILTIN (#177)
* Added boards constants for LED_BUILTIN and KEY_BUILTIN

Sources:
* esp320: http://wiki.sweetpeas.se/index.php?title=ESP320#Developing_using_the_Arduino_IDE
* esp32thing: https://cdn.sparkfun.com/assets/learn_tutorials/5/0/7/esp32-thing-schematic.pdf
* espea32: https://github.com/AprilBrother/ESPea32/blob/master/hardware/ESPea32-schematic.pdf
* hornbill32dev: https://github.com/ExploreEmbedded/Hornbill-ESP32-DEV/blob/master/Design%20Files/Schematic/Hornbill%20Devboard.pdf
* lolin32: values from existing header
* nano32: http://iot-bits.com/closer-look-esp32-nano32/
* node32s: https://github.com/lamloei/node32s-book/blob/master/ch01/node32s-schematic.pdf

* Replace BUILTIN_LED constant with #define
2017-02-07 03:39:08 +02:00
Me No Dev
d02c1c786e Update IDF, fix SS definition, add custom partitions and debug level selection (#174)
* Add build time partitions compilation

* Fix wrong definition of SS pin

* Add support for core debug level selection

* update idf libs
2017-02-06 15:17:11 +02:00
me-no-dev
ee8149e207 add better debug messages for WiFi status 2017-02-05 23:59:44 +02:00
me-no-dev
f4ad2624c9 update travis and build script to not fail 2017-02-05 19:58:27 +02:00
Ion
c66b54a9eb Add touch example 2017-02-05 18:03:04 +02:00
Jan Hendrik Berlin
bbf48a5d54 Add (ported) SimpleWiFiServer (#158) 2017-02-05 17:21:51 +02:00
Ivan Kravets
9101e1366e Test nested examples with @PlatformIO (#172) 2017-02-05 16:59:10 +02:00
me-no-dev
a80b2b24a4 Add ESP32 examples folder and sigma-delta example 2017-02-05 16:14:43 +02:00