Skip to content

Commit f42cba9

Browse files
authored
Merge branch 'master' into release/v2.x
2 parents d3254f7 + 758b4eb commit f42cba9

File tree

7 files changed

+58
-23
lines changed

7 files changed

+58
-23
lines changed

Diff for: .github/ISSUE_TEMPLATE/Issue-report.yml

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v2.0.8
4445
- v2.0.7
4546
- v2.0.6
4647
- v2.0.5

Diff for: .github/workflows/lib.json

+14-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
"name": "ESP32Servo",
2020
"exclude_targets": [],
2121
"sketch_path": [
22-
"~/Arduino/libraries/ESP32Servo/examples/Knob/Knob.ino",
23-
"~/Arduino/libraries/ESP32Servo/examples/Sweep/Sweep.ino",
24-
"~/Arduino/libraries/ESP32Servo/examples/PWMExample/PWMExample.ino",
2522
"~/Arduino/libraries/ESP32Servo/examples/Multiple-Servo-Example-Arduino/Multiple-Servo-Example-Arduino.ino"
2623
]
2724
},
@@ -51,5 +48,19 @@
5148
"sketch_path": [
5249
"~/Arduino/libraries/IRremote/examples/SendDemo/SendDemo.ino"
5350
]
51+
},
52+
{
53+
"name": "MFRC522",
54+
"exclude_targets": [],
55+
"sketch_path": [
56+
"~/Arduino/libraries/MFRC522/examples/ReadUidMultiReader/ReadUidMultiReader.ino"
57+
]
58+
},
59+
{
60+
"name": "WS2812FX",
61+
"exclude_targets": [],
62+
"sketch_path": [
63+
"~/Arduino/libraries/WS2812FX/examples/ws2812fx_spi/ws2812fx_spi.ino"
64+
]
5465
}
5566
]

Diff for: cores/esp32/WString.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
// A pure abstract class forward used as a means to proide a unique pointer type
3535
// but really is never defined.
3636
class __FlashStringHelper;
37-
#define FPSTR(pstr_pointer) (pstr_pointer)
38-
#define F(string_literal) (string_literal)
37+
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
38+
#define F(string_literal) (FPSTR(PSTR(string_literal)))
3939

4040
// An inherited class for holding the result of a concatenation. These
4141
// result objects are assumed to be writable by subsequent concatenations.

Diff for: cores/esp32/esp32-hal-ledc.c

+22-16
Original file line numberDiff line numberDiff line change
@@ -215,26 +215,32 @@ static int cnt_channel = LEDC_CHANNELS;
215215
static uint8_t analog_resolution = 8;
216216
static int analog_frequency = 1000;
217217
void analogWrite(uint8_t pin, int value) {
218-
// Use ledc hardware for internal pins
219-
if (pin < SOC_GPIO_PIN_COUNT) {
220-
if (pin_to_channel[pin] == 0) {
221-
if (!cnt_channel) {
222-
log_e("No more analogWrite channels available! You can have maximum %u", LEDC_CHANNELS);
223-
return;
224-
}
225-
if(ledcSetup(cnt_channel - 1, analog_frequency, analog_resolution) == 0){
226-
log_e("analogWrite setup failed (freq = %u, resolution = %u). Try setting different resolution or frequency");
227-
return;
228-
}
229-
ledcAttachPin(pin, cnt_channel - 1);
230-
pin_to_channel[pin] = cnt_channel--;
218+
// Use ledc hardware for internal pins
219+
if (pin < SOC_GPIO_PIN_COUNT) {
220+
int8_t channel = -1;
221+
if (pin_to_channel[pin] == 0) {
222+
if (!cnt_channel) {
223+
log_e("No more analogWrite channels available! You can have maximum %u", LEDC_CHANNELS);
224+
return;
225+
}
226+
cnt_channel--;
227+
channel = cnt_channel;
228+
} else {
229+
channel = analogGetChannel(pin);
230+
}
231+
log_v("GPIO %d - Using Channel %d, Value = %d", pin, channel, value);
232+
if(ledcSetup(channel, analog_frequency, analog_resolution) == 0){
233+
log_e("analogWrite setup failed (freq = %u, resolution = %u). Try setting different resolution or frequency");
234+
return;
235+
}
236+
ledcAttachPin(pin, channel);
237+
pin_to_channel[pin] = channel;
238+
ledcWrite(channel, value);
231239
}
232-
ledcWrite(pin_to_channel[pin] - 1, value);
233-
}
234240
}
235241

236242
int8_t analogGetChannel(uint8_t pin) {
237-
return pin_to_channel[pin] - 1;
243+
return pin_to_channel[pin];
238244
}
239245

240246
void analogWriteFrequency(uint32_t freq) {

Diff for: libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ void setup() {
6060
config.pin_pclk = PCLK_GPIO_NUM;
6161
config.pin_vsync = VSYNC_GPIO_NUM;
6262
config.pin_href = HREF_GPIO_NUM;
63-
config.pin_sscb_sda = SIOD_GPIO_NUM;
64-
config.pin_sscb_scl = SIOC_GPIO_NUM;
63+
config.pin_sccb_sda = SIOD_GPIO_NUM;
64+
config.pin_sccb_scl = SIOC_GPIO_NUM;
6565
config.pin_pwdn = PWDN_GPIO_NUM;
6666
config.pin_reset = RESET_GPIO_NUM;
6767
config.xclk_freq_hz = 20000000;

Diff for: libraries/WiFi/src/WiFiSTA.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,22 @@ bool WiFiSTAClass::disconnect(bool wifioff, bool eraseap)
366366
return false;
367367
}
368368

369+
/**
370+
* @brief Reset WiFi settings in NVS to default values.
371+
* @return true if erase succeeded
372+
* @note: Resets SSID, password, protocol, mode, etc.
373+
* These settings are maintained by WiFi driver in IDF.
374+
* WiFi driver must be initialized.
375+
*/
376+
bool WiFiSTAClass::eraseAP(void) {
377+
if(WiFi.getMode()==WIFI_MODE_NULL) {
378+
if(!WiFi.enableSTA(true))
379+
return false;
380+
}
381+
382+
return esp_wifi_restore()==ESP_OK;
383+
}
384+
369385
/**
370386
* Change IP configuration settings disabling the dhcp client
371387
* @param local_ip Static ip configuration

Diff for: libraries/WiFi/src/WiFiSTA.h

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class WiFiSTAClass
5353

5454
bool reconnect();
5555
bool disconnect(bool wifioff = false, bool eraseap = false);
56+
bool eraseAP(void);
5657

5758
bool isConnected();
5859

0 commit comments

Comments
 (0)