arduino-esp32/libraries
chuck todd b05430cfd9 Wire ReSTART fix, with others (#1717)
* ReSTART fix, Sequencing fix

pr #1665 introduce a problem with ReSTART, when solving this problem I found an interaction between the TxFifo refill, RxFifo empty and CMD[] fill.  during certain sequences a dataqueue command would be skipped, this skipping resulted in a mismatch between the contents of the TxFifo and the i2c command sequence.  The problem manifested as an ACK error. 
In addition to this required bug fix I propose:
* `Wire.begin()` be changed from a `void` to a `bool` this will allow the reset functionality of `Wire.begin()` to be reported.  Currently `Wire.begin()` attempts to reset the i2c Peripheral, but cannot report success/failure.
* `Wire.busy()` be added. this `bool` function returns the hardware status of the bus. This status can be use in multi-master environments for application level interleaving of commands, also in single master environment, it can be used to detect a 'hung' bus.  With the functional change to `Wire.begin()` this allows app level recover of a hung bus.
* `Wire.lastError()` value updated for all errors, previously when interleaving `Wire.endTransmission(false)` and `Wire.readTransmission(false)`, the 128 byte `Wire.write()` buffer was exhausted without generating and error(very exotic). I discovered this error when I created a sequence of directed reads to a EEPROM. Each directed read used 2 bytes of the 128 byte `write()` buffer, so after 64 consecutive ReSTART writes with ReSTART reads, `Wire()`  had no room to record the directed address bytes.  It generated just a NAK check without setting the EEPROMs internal register address.  The succeeding ReSTART read succeeded at incorrect address.
* Changes to the HAL layer:
** added `i2cGetStatus()` which returns the i2c peripheral status word, used to detect bus_busy currently
** added `i2cDebug()` programmatic control of debug buffer output
** changed `i2cAddQueue()` to allow data_only queue element this will allow a i2c transaction to use multiple data pointers.
** removed direct access to DumpInts(), DumpI2c() from app, use i2cDebug() to set trigger points 
 
*

* Update esp32-hal-i2c.c

* Update Wire.cpp

* ReSTART, Sequencing

pr #1665 introduce a problem with ReSTART, when solving this problem I found an interaction between the TxFifo refill, RxFifo empty and CMD[] fill.  during certain sequences a dataqueue command would be skipped, this skipping resulted in a mismatch between the contents of the TxFifo and the i2c command sequence.  The problem manifested as an ACK error. 
In addition to this required bug fix I propose:
* `Wire.begin()` be changed from a `void` to a `bool` this will allow the reset functionality of `Wire.begin()` to be reported.  Currently `Wire.begin()` attempts to reset the i2c Peripheral, but cannot report success/failure.
* `Wire.busy()` be added. this `bool` function returns the hardware status of the bus. This status can be use in multi-master environments for application level interleaving of commands, also in single master environment, it can be used to detect a 'hung' bus.  With the functional change to `Wire.begin()` this allows app level recover of a hung bus.
* `Wire.lastError()` value updated for all errors, previously when interleaving `Wire.endTransmission(false)` and `Wire.readTransmission(false)`, the 128 byte `Wire.write()` buffer was exhausted without generating and error(very exotic). I discovered this error when I created a sequence of directed reads to a EEPROM. Each directed read used 2 bytes of the 128 byte `write()` buffer, so after 64 consecutive ReSTART writes with ReSTART reads, `Wire()`  had no room to record the directed address bytes.  It generated just a NAK check without setting the EEPROMs internal register address.  The succeeding ReSTART read succeeded at incorrect address.
* Changes to the HAL layer:
** added `i2cGetStatus()` which returns the i2c peripheral status word, used to detect bus_busy currently
** added `i2cDebug()` programmatic control of debug buffer output
** changed `i2cAddQueue()` to allow data_only queue element this will allow a i2c transaction to use multiple data pointers.
** removed direct access to DumpInts(), DumpI2c() from app, use i2cDebug() to set trigger points 
 
*

* Forgot DebugFlags Return

@andriyadi found this, total brain fade on my part.
2018-08-14 11:51:15 +02:00
..
ArduinoOTA [OTA Timeout] Added ability set OTA timeout in the OTA client (#1669) 2018-07-24 19:40:18 +02:00
AsyncUDP Fix AsyncUDP server exception 2018-07-11 20:46:54 +02:00
AzureIoT@67dfa4f31e Add submodule of Azure IoT library (#1448) 2018-05-31 14:52:02 +02:00
BLE@7951347ed6 Update IDF to aaf1239 (#1539) 2018-06-27 09:01:06 +02:00
BluetoothSerial BluetoothSerial: set COD to be compatible with macOS (#1304) (#1556) 2018-07-07 11:25:10 +02:00
DNSServer DNS Server : bug fix and prettifying (#1011) 2018-03-04 20:17:40 +01:00
EEPROM EEPROM library: Move #include of Arduino.h to header file (#1641) 2018-07-16 20:44:36 +02:00
ESP32 Allow using argument with attachInterrupt (#1535) 2018-07-07 11:26:58 +02:00
ESPmDNS add support for TXT records in mDNS query responses (#1480) 2018-06-18 18:18:50 +03:00
FS Make Stream functions if File to not wait for timeout 2018-07-05 11:51:58 +02:00
HTTPClient Fix HTTP client returning disconnected when there is still data avalable 2018-07-10 21:06:20 +02:00
NetBIOS Update IDF to aaf1239 (#1539) 2018-06-27 09:01:06 +02:00
Preferences Small grammar fixes and clarifications (#1003) 2018-01-18 00:59:35 +02:00
SD Unify time modification on SD and SPIFFS (#738) 2018-03-04 21:20:34 +01:00
SD_MMC Update IDF to aaf1239 (#1539) 2018-06-27 09:01:06 +02:00
SimpleBLE Update IDF to aaf1239 (#1539) 2018-06-27 09:01:06 +02:00
SPI "fix" SPI 2018-07-03 21:23:04 +02:00
SPIFFS Added a define to format the spiffs in SPIFFS_Test.ino (#1662) 2018-07-25 18:44:37 +02:00
Ticker Use correct separator in keywords.txt (#1175) 2018-03-05 07:38:39 +01:00
Update Use correct separator in keywords.txt (#1175) 2018-03-05 07:38:39 +01:00
WebServer roll back the while loop in _parseForm 2018-07-25 20:59:56 +02:00
WiFi Fix WiFiMulti Logs 2018-07-30 09:42:44 -03:00
WiFiClientSecure Fix peek, read and available logic in WiFiClientSecure 2018-06-27 22:09:21 +02:00
Wire Wire ReSTART fix, with others (#1717) 2018-08-14 11:51:15 +02:00