mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
Merge branch 'esp8266' into SPIFFS-OTA
This commit is contained in:
commit
2d07f259b7
@ -31,6 +31,7 @@ title: Reference
|
|||||||
* [EEPROM](#eeprom)
|
* [EEPROM](#eeprom)
|
||||||
* [I2C (Wire library)](#i2c-wire-library)
|
* [I2C (Wire library)](#i2c-wire-library)
|
||||||
* [SPI](#spi)
|
* [SPI](#spi)
|
||||||
|
* [SoftwareSerial](#softwareserial)
|
||||||
* [ESP-specific APIs](#esp-specific-apis)
|
* [ESP-specific APIs](#esp-specific-apis)
|
||||||
* [OneWire (from <a href="https://www.pjrc.com/teensy/td_libs_OneWire.html">https://www.pjrc.com/teensy/td_libs_OneWire.html</a>)](#onewire-from-httpswwwpjrccomteensytd_libs_onewirehtml)
|
* [OneWire (from <a href="https://www.pjrc.com/teensy/td_libs_OneWire.html">https://www.pjrc.com/teensy/td_libs_OneWire.html</a>)](#onewire-from-httpswwwpjrccomteensytd_libs_onewirehtml)
|
||||||
* [mDNS and DNS-SD responder (ESP8266mDNS library)](#mdns-and-dns-sd-responder-esp8266mdns-library)
|
* [mDNS and DNS-SD responder (ESP8266mDNS library)](#mdns-and-dns-sd-responder-esp8266mdns-library)
|
||||||
@ -398,6 +399,10 @@ else they default to pins 4(SDA) and 5(SCL).
|
|||||||
SPI library supports the entire Arduino SPI API including transactions, including setting phase (CPHA).
|
SPI library supports the entire Arduino SPI API including transactions, including setting phase (CPHA).
|
||||||
Setting the Clock polarity (CPOL) is not supported, yet (SPI_MODE2 and SPI_MODE3 not working).
|
Setting the Clock polarity (CPOL) is not supported, yet (SPI_MODE2 and SPI_MODE3 not working).
|
||||||
|
|
||||||
|
## SoftwareSerial
|
||||||
|
|
||||||
|
An ESP8266 port of SoftwareSerial library done by Peter Lerup (@plerup) supports baud rate up to 115200 and multiples SoftwareSerial instances. See the https://github.com/plerup/espsoftwareserial if you want to suggest an improvement or open an issue related to SoftwareSerial.
|
||||||
|
|
||||||
## ESP-specific APIs
|
## ESP-specific APIs
|
||||||
|
|
||||||
APIs related to deep sleep and watchdog timer are available in the `ESP` object, only available in Alpha version.
|
APIs related to deep sleep and watchdog timer are available in the `ESP` object, only available in Alpha version.
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
ClientContext.h - TCP connection handling on top of lwIP
|
ClientContext.h - TCP connection handling on top of lwIP
|
||||||
|
|
||||||
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
|
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
|
||||||
This file is part of the esp8266 core for Arduino environment.
|
This file is part of the esp8266 core for Arduino environment.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
@ -39,7 +39,7 @@ class ClientContext {
|
|||||||
tcp_sent(pcb, &_s_sent);
|
tcp_sent(pcb, &_s_sent);
|
||||||
tcp_err(pcb, &_s_error);
|
tcp_err(pcb, &_s_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
err_t abort(){
|
err_t abort(){
|
||||||
if(_pcb) {
|
if(_pcb) {
|
||||||
DEBUGV(":abort\r\n");
|
DEBUGV(":abort\r\n");
|
||||||
@ -52,7 +52,7 @@ class ClientContext {
|
|||||||
}
|
}
|
||||||
return ERR_ABRT;
|
return ERR_ABRT;
|
||||||
}
|
}
|
||||||
|
|
||||||
err_t close(){
|
err_t close(){
|
||||||
err_t err = ERR_OK;
|
err_t err = ERR_OK;
|
||||||
if(_pcb) {
|
if(_pcb) {
|
||||||
@ -71,7 +71,7 @@ class ClientContext {
|
|||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
~ClientContext() {
|
~ClientContext() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,18 +101,18 @@ class ClientContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setNoDelay(bool nodelay){
|
void setNoDelay(bool nodelay){
|
||||||
if(!_pcb) return;
|
if(!_pcb) return;
|
||||||
if(nodelay) tcp_nagle_disable(_pcb);
|
if(nodelay) tcp_nagle_disable(_pcb);
|
||||||
else tcp_nagle_enable(_pcb);
|
else tcp_nagle_enable(_pcb);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool getNoDelay(){
|
bool getNoDelay(){
|
||||||
if(!_pcb) return false;
|
if(!_pcb) return false;
|
||||||
return tcp_nagle_disabled(_pcb);
|
return tcp_nagle_disabled(_pcb);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getRemoteAddress() {
|
uint32_t getRemoteAddress() {
|
||||||
if(!_pcb) return 0;
|
if(!_pcb) return 0;
|
||||||
|
|
||||||
@ -277,16 +277,11 @@ class ClientContext {
|
|||||||
|
|
||||||
void _error(err_t err) {
|
void _error(err_t err) {
|
||||||
DEBUGV(":er %d %d %d\r\n", err, _size_sent, _send_waiting);
|
DEBUGV(":er %d %d %d\r\n", err, _size_sent, _send_waiting);
|
||||||
if (err != ERR_ABRT) {
|
tcp_arg(_pcb, NULL);
|
||||||
abort();
|
tcp_sent(_pcb, NULL);
|
||||||
}
|
tcp_recv(_pcb, NULL);
|
||||||
else {
|
tcp_err(_pcb, NULL);
|
||||||
tcp_arg(_pcb, NULL);
|
_pcb = NULL;
|
||||||
tcp_sent(_pcb, NULL);
|
|
||||||
tcp_recv(_pcb, NULL);
|
|
||||||
tcp_err(_pcb, NULL);
|
|
||||||
_pcb = NULL;
|
|
||||||
}
|
|
||||||
if(_size_sent && _send_waiting) {
|
if(_size_sent && _send_waiting) {
|
||||||
esp_schedule();
|
esp_schedule();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user