Skip to content

Commit 6bf48a8

Browse files
Merge branch 'master' into new_timer1_irq
2 parents d48b3ba + 7820fb7 commit 6bf48a8

37 files changed

+476
-103
lines changed

boards.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3811,7 +3811,7 @@ gen4iod.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
38113811
gen4iod.menu.VTable.iram=IRAM
38123812
gen4iod.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
38133813
gen4iod.upload.resetmethod=nodemcu
3814-
gen4iod.build.flash_mode=qio
3814+
gen4iod.build.flash_mode=dio
38153815
gen4iod.build.flash_freq=80
38163816
gen4iod.menu.FlashSize.512K0=512K (no SPIFFS)
38173817
gen4iod.menu.FlashSize.512K0.build.flash_size=512K

cores/esp8266/avr/pgmspace.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "../pgmspace.h"

cores/esp8266/pgmspace.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ extern "C" {
2929

3030
#define _SFR_BYTE(n) (n)
3131

32+
#ifdef __PROG_TYPES_COMPAT__
33+
3234
typedef void prog_void;
3335
typedef char prog_char;
3436
typedef unsigned char prog_uchar;
@@ -39,6 +41,8 @@ typedef uint16_t prog_uint16_t;
3941
typedef int32_t prog_int32_t;
4042
typedef uint32_t prog_uint32_t;
4143

44+
#endif // defined(__PROG_TYPES_COMPAT__)
45+
4246
#define SIZE_IRRELEVANT 0x7fffffff
4347

4448
// memchr_P and memrchr_P are not implemented due to danger in its use, and
@@ -112,8 +116,13 @@ static inline uint16_t pgm_read_word_inlined(const void* addr) {
112116
}
113117

114118
// Make sure, that libraries checking existence of this macro are not failing
119+
#ifdef __PROG_TYPES_COMPAT__
120+
#define pgm_read_byte(addr) pgm_read_byte_inlined((const void*)(addr))
121+
#define pgm_read_word(addr) pgm_read_word_inlined((const void*)(addr))
122+
#else
115123
#define pgm_read_byte(addr) pgm_read_byte_inlined(addr)
116124
#define pgm_read_word(addr) pgm_read_word_inlined(addr)
125+
#endif
117126

118127
#else //__ets__
119128
#define pgm_read_byte(addr) (*reinterpret_cast<const uint8_t*>(addr))

doc/esp8266wifi/udp-examples.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Once we have libraries in place we need to create a ``WiFiUDP`` object. Then we
3636
WiFiUDP Udp;
3737
unsigned int localUdpPort = 4210;
3838
char incomingPacket[255];
39-
char replyPacekt[] = "Hi there! Got the message :-)";
39+
char replyPacket[] = "Hi there! Got the message :-)";
4040
4141
Wi-Fi Connection
4242
~~~~~~~~~~~~~~~~
@@ -85,7 +85,7 @@ For each received packet we are sending back an acknowledge packet:
8585
.. code:: cpp
8686
8787
Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
88-
Udp.write(replyPacekt);
88+
Udp.write(replyPacket);
8989
Udp.endPacket();
9090
9191
Please note we are sending reply to the IP and port of the sender by using ``Udp.remoteIP()`` and ``Udp.remotePort()``.

doc/libraries.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ESP-specific APIs
7171

7272
Some ESP-specific APIs related to deep sleep, RTC and flash memories are available in the ``ESP`` object.
7373

74-
``ESP.deepSleep(microseconds, mode)`` will put the chip into deep sleep. ``mode`` is one of ``WAKE_RF_DEFAULT``, ``WAKE_RFCAL``, ``WAKE_NO_RFCAL``, ``WAKE_RF_DISABLED``. (GPIO16 needs to be tied to RST to wake from deepSleep.)
74+
``ESP.deepSleep(microseconds, mode)`` will put the chip into deep sleep. ``mode`` is one of ``WAKE_RF_DEFAULT``, ``WAKE_RFCAL``, ``WAKE_NO_RFCAL``, ``WAKE_RF_DISABLED``. (GPIO16 needs to be tied to RST to wake from deepSleep.) The chip can sleep for at most ``ESP.deepSleepMax()`` microseconds.
7575

7676
``ESP.rtcUserMemoryWrite(offset, &data, sizeof(data))`` and ``ESP.rtcUserMemoryRead(offset, &data, sizeof(data))`` allow data to be stored in and retrieved from the RTC user memory of the chip respectively. Total size of RTC user memory is 512 bytes, so ``offset + sizeof(data)`` shouldn't exceed 512. Data should be 4-byte aligned. The stored data can be retained between deep sleep cycles. However, the data might be lost after power cycling the chip.
7777

@@ -135,6 +135,14 @@ Servo
135135

136136
This library exposes the ability to control RC (hobby) servo motors. It will support up to 24 servos on any available output pin. By default the first 12 servos will use Timer0 and currently this will not interfere with any other support. Servo counts above 12 will use Timer1 and features that use it will be affected. While many RC servo motors will accept the 3.3V IO data pin from a ESP8266, most will not be able to run off 3.3v and will require another power source that matches their specifications. Make sure to connect the grounds between the ESP8266 and the servo motor power supply.
137137

138+
Improved EEPROM library for ESP (ESP_EEPROM)
139+
--------------------------------------------
140+
141+
An improved EEPROM library for ESPxxxx. Uses flash memory as per the standard ESP EEPROM library but reduces reflash - so reducing wear and improving commit() performance.
142+
143+
As actions on the flash need to stop the interrupts, an EEPROM reflash could noticably affect anything using PWM, etc.
144+
145+
138146
Other libraries (not included with the IDE)
139147
-------------------------------------------
140148

libraries/ESP8266WiFi/src/ESP8266WiFiScan.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ std::function<void(int)> ESP8266WiFiScanClass::_onComplete;
6464
* Start scan WiFi networks available
6565
* @param async run in async mode
6666
* @param show_hidden show hidden networks
67+
* @param channel scan only this channel (0 for all channels)
68+
* @param ssid* scan for only this ssid (NULL for all ssid's)
6769
* @return Number of discovered networks
6870
*/
69-
int8_t ESP8266WiFiScanClass::scanNetworks(bool async, bool show_hidden) {
71+
int8_t ESP8266WiFiScanClass::scanNetworks(bool async, bool show_hidden, uint8 channel, uint8* ssid) {
7072
if(ESP8266WiFiScanClass::_scanStarted) {
7173
return WIFI_SCAN_RUNNING;
7274
}
@@ -84,6 +86,8 @@ int8_t ESP8266WiFiScanClass::scanNetworks(bool async, bool show_hidden) {
8486

8587
struct scan_config config;
8688
memset(&config, 0, sizeof(config));
89+
config.ssid = ssid;
90+
config.channel = channel;
8791
config.show_hidden = show_hidden;
8892
if(wifi_station_scan(&config, reinterpret_cast<scan_done_cb_t>(&ESP8266WiFiScanClass::_scanDone))) {
8993
ESP8266WiFiScanClass::_scanComplete = false;

libraries/ESP8266WiFi/src/ESP8266WiFiScan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ESP8266WiFiScanClass {
3434

3535
public:
3636

37-
int8_t scanNetworks(bool async = false, bool show_hidden = false);
37+
int8_t scanNetworks(bool async = false, bool show_hidden = false, uint8 channel = 0, uint8* ssid = NULL);
3838
void scanNetworksAsync(std::function<void(int)> onComplete, bool show_hidden = false);
3939

4040
int8_t scanComplete();

libraries/ESP8266WiFi/src/WiFiClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void WiFiClient::stop()
280280

281281
uint8_t WiFiClient::connected()
282282
{
283-
if (!_client)
283+
if (!_client || _client->state() == CLOSED)
284284
return 0;
285285

286286
return _client->state() == ESTABLISHED || available();

libraries/ESP8266WiFi/src/include/ClientContext.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ClientContext
4040
tcp_setprio(pcb, TCP_PRIO_MIN);
4141
tcp_arg(pcb, this);
4242
tcp_recv(pcb, &_s_recv);
43-
tcp_sent(pcb, &_s_sent);
43+
tcp_sent(pcb, &_s_acked);
4444
tcp_err(pcb, &_s_error);
4545
tcp_poll(pcb, &_s_poll, 1);
4646

@@ -58,7 +58,7 @@ class ClientContext
5858
tcp_err(_pcb, NULL);
5959
tcp_poll(_pcb, NULL, 0);
6060
tcp_abort(_pcb);
61-
_pcb = 0;
61+
_pcb = nullptr;
6262
}
6363
return ERR_ABRT;
6464
}
@@ -79,7 +79,7 @@ class ClientContext
7979
tcp_abort(_pcb);
8080
err = ERR_ABRT;
8181
}
82-
_pcb = 0;
82+
_pcb = nullptr;
8383
}
8484
return err;
8585
}
@@ -471,11 +471,11 @@ class ClientContext
471471
}
472472
}
473473

474-
err_t _sent(tcp_pcb* pcb, uint16_t len)
474+
err_t _acked(tcp_pcb* pcb, uint16_t len)
475475
{
476476
(void) pcb;
477477
(void) len;
478-
DEBUGV(":sent %d\r\n", len);
478+
DEBUGV(":ack %d\r\n", len);
479479
_write_some_from_cb();
480480
return ERR_OK;
481481
}
@@ -536,7 +536,7 @@ class ClientContext
536536
tcp_sent(_pcb, NULL);
537537
tcp_recv(_pcb, NULL);
538538
tcp_err(_pcb, NULL);
539-
_pcb = NULL;
539+
_pcb = nullptr;
540540
_notify_error();
541541
}
542542

@@ -571,9 +571,9 @@ class ClientContext
571571
return reinterpret_cast<ClientContext*>(arg)->_poll(tpcb);
572572
}
573573

574-
static err_t _s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len)
574+
static err_t _s_acked(void *arg, struct tcp_pcb *tpcb, uint16_t len)
575575
{
576-
return reinterpret_cast<ClientContext*>(arg)->_sent(tpcb, len);
576+
return reinterpret_cast<ClientContext*>(arg)->_acked(tpcb, len);
577577
}
578578

579579
static err_t _s_connected(void* arg, struct tcp_pcb *pcb, err_t err)

package/build_boards_manager_package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ rm exclude.txt
6161
# Get additional libraries (TODO: add them as git submodule or subtree?)
6262

6363
# SoftwareSerial library
64-
curl -L -o SoftwareSerial.zip https://github.com/plerup/espsoftwareserial/archive/3.3.1.zip
64+
curl -L -o SoftwareSerial.zip https://github.com/plerup/espsoftwareserial/archive/3.4.1.zip
6565
unzip -q SoftwareSerial.zip
6666
rm -rf SoftwareSerial.zip
6767
mv espsoftwareserial-* SoftwareSerial

0 commit comments

Comments
 (0)