Skip to content

Commit 27fb23a

Browse files
committed
Warnings fixes
1 parent aa2cf45 commit 27fb23a

File tree

27 files changed

+91
-36
lines changed

27 files changed

+91
-36
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ _build/
4040
debug.cfg
4141
debug.svd
4242
debug_custom.json
43+
libraries/Insights/examples/*/*.ino.zip

Diff for: cores/esp32/HWCDC.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
#include "freertos/ringbuf.h"
2323
#include "esp_intr_alloc.h"
2424
#include "soc/periph_defs.h"
25+
#pragma GCC diagnostic ignored "-Wvolatile"
2526
#include "hal/usb_serial_jtag_ll.h"
27+
#pragma GCC diagnostic warning "-Wvolatile"
2628
#include "rom/ets_sys.h"
2729

2830
ESP_EVENT_DEFINE_BASE(ARDUINO_HW_CDC_EVENTS);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode)
9898
}
9999
#endif
100100

101-
if (!GPIO_IS_VALID_GPIO(pin)) {
101+
if (pin >= SOC_GPIO_PIN_COUNT) {
102102
log_e("Invalid pin selected");
103103
return;
104104
}

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1515,11 +1515,11 @@ uint32_t spiFrequencyToClockDiv(uint32_t freq)
15151515

15161516
uint8_t calN = 1;
15171517
spiClk_t bestReg = { 0 };
1518-
int32_t bestFreq = 0;
1518+
uint32_t bestFreq = 0;
15191519

15201520
while(calN <= 0x3F) {
15211521
spiClk_t reg = { 0 };
1522-
int32_t calFreq;
1522+
uint32_t calFreq;
15231523
int32_t calPre;
15241524
int8_t calPreVari = -2;
15251525

@@ -1541,11 +1541,11 @@ uint32_t spiFrequencyToClockDiv(uint32_t freq)
15411541
}
15421542
reg.clkcnt_l = ((reg.clkcnt_n + 1) / 2);
15431543
calFreq = ClkRegToFreq(&reg);
1544-
if(calFreq == (int32_t) freq) {
1544+
if(calFreq == freq) {
15451545
memcpy(&bestReg, &reg, sizeof(bestReg));
15461546
break;
1547-
} else if(calFreq < (int32_t) freq) {
1548-
if(abs(freq - calFreq) < abs(freq - bestFreq)) {
1547+
} else if(calFreq < freq) {
1548+
if((freq - calFreq) < (freq - bestFreq)) {
15491549
bestFreq = calFreq;
15501550
memcpy(&bestReg, &reg, sizeof(bestReg));
15511551
}

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

+10-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ static void __touchSetCycles(uint16_t measure, uint16_t sleep)
9191
{
9292
__touchSleepCycles = sleep;
9393
__touchMeasureCycles = measure;
94-
touch_pad_set_meas_time(sleep, measure);
94+
#if SOC_TOUCH_VERSION_1 // ESP32
95+
touch_pad_set_measurement_clock_cycles(measure);
96+
#elif SOC_TOUCH_VERSION_2 // ESP32S2, ESP32S3
97+
touch_pad_set_charge_discharge_times(measure);
98+
#endif
99+
touch_pad_set_measurement_interval(sleep);
95100
}
96101

97102

@@ -112,7 +117,8 @@ static void __touchInit()
112117
}
113118
// the next two lines will drive the touch reading values -- both will return ESP_OK
114119
touch_pad_set_voltage(TOUCH_HVOLT_2V7, TOUCH_LVOLT_0V5, TOUCH_HVOLT_ATTEN_0V);
115-
touch_pad_set_meas_time(__touchMeasureCycles, __touchSleepCycles);
120+
touch_pad_set_measurement_clock_cycles(__touchMeasureCycles);
121+
touch_pad_set_measurement_interval(__touchSleepCycles);
116122
// Touch Sensor Timer initiated
117123
touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); // returns ESP_OK
118124
err = touch_pad_filter_start(10);
@@ -131,7 +137,8 @@ static void __touchInit()
131137
goto err;
132138
}
133139
// the next lines will drive the touch reading values -- all os them return ESP_OK
134-
touch_pad_set_meas_time(__touchSleepCycles, __touchMeasureCycles);
140+
touch_pad_set_charge_discharge_times(__touchMeasureCycles);
141+
touch_pad_set_measurement_interval(__touchSleepCycles);
135142
touch_pad_set_voltage(TOUCH_PAD_HIGH_VOLTAGE_THRESHOLD, TOUCH_PAD_LOW_VOLTAGE_THRESHOLD, TOUCH_PAD_ATTEN_VOLTAGE_THRESHOLD);
136143
touch_pad_set_idle_channel_connect(TOUCH_PAD_IDLE_CH_CONNECT_DEFAULT);
137144
touch_pad_denoise_t denoise = {

Diff for: cores/esp32/wiring_pulse.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
//#include <limits.h>
1818
#include "wiring_private.h"
1919
#include "pins_arduino.h"
20-
#include <hal/cpu_hal.h>
20+
#include "esp_cpu.h"
2121

2222
#define WAIT_FOR_PIN_STATE(state) \
2323
while (digitalRead(pin) != (state)) { \
24-
if (cpu_hal_get_cycle_count() - start_cycle_count > timeout_cycles) { \
24+
if (esp_cpu_get_cycle_count() - start_cycle_count > timeout_cycles) { \
2525
return 0; \
2626
} \
2727
}
@@ -34,12 +34,12 @@ unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout)
3434
timeout = max_timeout_us;
3535
}
3636
const uint32_t timeout_cycles = microsecondsToClockCycles(timeout);
37-
const uint32_t start_cycle_count = cpu_hal_get_cycle_count();
37+
const uint32_t start_cycle_count = esp_cpu_get_cycle_count();
3838
WAIT_FOR_PIN_STATE(!state);
3939
WAIT_FOR_PIN_STATE(state);
40-
const uint32_t pulse_start_cycle_count = cpu_hal_get_cycle_count();
40+
const uint32_t pulse_start_cycle_count = esp_cpu_get_cycle_count();
4141
WAIT_FOR_PIN_STATE(!state);
42-
return clockCyclesToMicroseconds(cpu_hal_get_cycle_count() - pulse_start_cycle_count);
42+
return clockCyclesToMicroseconds(esp_cpu_get_cycle_count() - pulse_start_cycle_count);
4343
}
4444

4545
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout)

Diff for: libraries/BLE/examples/BLE5_multi_advertising/BLE5_multi_advertising.ino

+12
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_1M = {
1515
.interval_max = 0x30,
1616
.channel_map = ADV_CHNL_ALL,
1717
.own_addr_type = BLE_ADDR_TYPE_RANDOM,
18+
.peer_addr_type = BLE_ADDR_TYPE_RANDOM,
19+
.peer_addr = {0,0,0,0,0,0},
1820
.filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY,
21+
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
1922
.primary_phy = ESP_BLE_GAP_PHY_CODED,
2023
.max_skip = 0,
2124
.secondary_phy = ESP_BLE_GAP_PHY_1M,
@@ -29,7 +32,10 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_2M = {
2932
.interval_max = 0x40,
3033
.channel_map = ADV_CHNL_ALL,
3134
.own_addr_type = BLE_ADDR_TYPE_RANDOM,
35+
.peer_addr_type = BLE_ADDR_TYPE_RANDOM,
36+
.peer_addr = {0,0,0,0,0,0},
3237
.filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY,
38+
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
3339
.primary_phy = ESP_BLE_GAP_PHY_1M,
3440
.max_skip = 0,
3541
.secondary_phy = ESP_BLE_GAP_PHY_2M,
@@ -43,7 +49,10 @@ esp_ble_gap_ext_adv_params_t legacy_adv_params = {
4349
.interval_max = 0x45,
4450
.channel_map = ADV_CHNL_ALL,
4551
.own_addr_type = BLE_ADDR_TYPE_RANDOM,
52+
.peer_addr_type = BLE_ADDR_TYPE_RANDOM,
53+
.peer_addr = {0,0,0,0,0,0},
4654
.filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY,
55+
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
4756
.primary_phy = ESP_BLE_GAP_PHY_1M,
4857
.max_skip = 0,
4958
.secondary_phy = ESP_BLE_GAP_PHY_1M,
@@ -57,7 +66,10 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_coded = {
5766
.interval_max = 0x50,
5867
.channel_map = ADV_CHNL_ALL,
5968
.own_addr_type = BLE_ADDR_TYPE_RANDOM,
69+
.peer_addr_type = BLE_ADDR_TYPE_RANDOM,
70+
.peer_addr = {0,0,0,0,0,0},
6071
.filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY,
72+
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
6173
.primary_phy = ESP_BLE_GAP_PHY_1M,
6274
.max_skip = 0,
6375
.secondary_phy = ESP_BLE_GAP_PHY_CODED,

Diff for: libraries/BLE/examples/BLE5_periodic_advertising/BLE5_periodic_advertising.ino

+3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_2M = {
1515
.interval_max = 0x40,
1616
.channel_map = ADV_CHNL_ALL,
1717
.own_addr_type = BLE_ADDR_TYPE_RANDOM,
18+
.peer_addr_type = BLE_ADDR_TYPE_RANDOM,
19+
.peer_addr = {0,0,0,0,0,0},
1820
.filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY,
21+
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
1922
.primary_phy = ESP_BLE_GAP_PHY_1M,
2023
.max_skip = 0,
2124
.secondary_phy = ESP_BLE_GAP_PHY_2M,

Diff for: libraries/BLE/examples/BLE5_periodic_sync/BLE5_periodic_sync.ino

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static esp_ble_gap_periodic_adv_sync_params_t periodic_adv_sync_params = {
2121
.filter_policy = 0,
2222
.sid = 0,
2323
.addr_type = BLE_ADDR_TYPE_RANDOM,
24+
.addr = {0,0,0,0,0,0},
2425
.skip = 10,
2526
.sync_timeout = 1000, // timeout: 1000 * 10ms
2627
};

Diff for: libraries/BluetoothSerial/src/BluetoothSerial.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,9 @@ static bool _init_bt(const char *deviceName)
673673
return false;
674674
}
675675

676-
if (esp_spp_init(ESP_SPP_MODE_CB) != ESP_OK){
676+
esp_spp_cfg_t cfg = BT_SPP_DEFAULT_CONFIG();
677+
cfg.mode = ESP_SPP_MODE_CB;
678+
if (esp_spp_enhanced_init(&cfg) != ESP_OK){
677679
log_e("spp init failed");
678680
return false;
679681
}

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

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

Diff for: libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@
5050

5151
#if CONFIG_ESP_FACE_RECOGNITION_ENABLED
5252
#pragma GCC diagnostic ignored "-Wformat"
53+
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
5354
#include "face_recognition_tool.hpp"
5455
#include "face_recognition_112_v1_s16.hpp"
5556
#include "face_recognition_112_v1_s8.hpp"
5657
#pragma GCC diagnostic error "-Wformat"
58+
#pragma GCC diagnostic warning "-Wstrict-aliasing"
5759

5860
#define QUANT_TYPE 0 //if set to 1 => very large firmware, very slow, reboots when streaming...
5961

Diff for: libraries/ESP32/examples/FreeRTOS/FreeRTOS.ino

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifdef ARDUINO_RUNNING_CORE
2+
#undef ARDUINO_RUNNING_CORE
3+
#endif
14
#if CONFIG_FREERTOS_UNICORE
25
#define ARDUINO_RUNNING_CORE 0
36
#else

Diff for: libraries/ESP32/examples/GPIO/FunctionalInterrupt/FunctionalInterrupt.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public:
1616
}
1717

1818
void ARDUINO_ISR_ATTR isr() {
19-
numberKeyPresses += 1;
19+
numberKeyPresses = numberKeyPresses + 1;
2020
pressed = true;
2121
}
2222

Diff for: libraries/ESP32/examples/I2S/HiFreq_ADC/HiFreq_ADC.ino

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ void i2sInit(){
5151
.dma_buf_len = I2S_DMA_BUF_LEN,
5252
.use_apll = false,
5353
.tx_desc_auto_clear = false,
54-
.fixed_mclk = 0
54+
.fixed_mclk = 0,
55+
.mclk_multiple = esp_i2s::I2S_MCLK_MULTIPLE_128,
56+
.bits_per_chan = esp_i2s::I2S_BITS_PER_CHAN_DEFAULT
5557
};
5658
Serial.printf("Attempting to setup I2S ADC with sampling frequency %d Hz\n", I2S_SAMPLE_RATE);
5759
if(ESP_OK != i2s_driver_install(I2S_NUM_0, &i2s_config, 0, NULL)){

Diff for: libraries/ESP32/examples/Serial/OnReceiveError_BREAK_Demo/OnReceiveError_BREAK_Demo.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void onReceiveErrorFunction(hardwareSerial_error_t err) {
8484
void onReceiveFunction() {
8585
// This is a callback function that will be activated on UART RX events
8686
size_t available = Serial1.available();
87-
received_bytes += available;
87+
received_bytes = received_bytes + available;
8888
Serial.printf("onReceive Callback:: There are %d bytes available: {", available);
8989
while (available --) {
9090
Serial.print((char)Serial1.read());

Diff for: libraries/ESP32/examples/Serial/OnReceive_Demo/OnReceive_Demo.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ volatile size_t sent_bytes = 0, received_bytes = 0;
6060
void onReceiveFunction(void) {
6161
// This is a callback function that will be activated on UART RX events
6262
size_t available = Serial1.available();
63-
received_bytes += available;
63+
received_bytes = received_bytes + available;
6464
Serial.printf("onReceive Callback:: There are %d bytes available: ", available);
6565
while (available --) {
6666
Serial.print((char)Serial1.read());

Diff for: libraries/ESP32/examples/TWAI/TWAIreceive/TWAIreceive.ino

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
created 05-11-2022 by Stephan Martin (designer2k2)
2525
*/
2626

27+
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
2728
#include "driver/twai.h"
2829

2930
// Pins used to connect to CAN bus transceiver:

Diff for: libraries/ESP32/examples/Timer/RepeatTimer/RepeatTimer.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ volatile uint32_t lastIsrAt = 0;
2121
void ARDUINO_ISR_ATTR onTimer(){
2222
// Increment the counter and set the time of ISR
2323
portENTER_CRITICAL_ISR(&timerMux);
24-
isrCounter++;
24+
isrCounter = isrCounter + 1;
2525
lastIsrAt = millis();
2626
portEXIT_CRITICAL_ISR(&timerMux);
2727
// Give a semaphore that we can check in the loop

Diff for: libraries/FFat/src/FFat.cpp

+10-8
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ bool F_Fat::begin(bool formatOnFail, const char * basePath, uint8_t maxOpenFiles
5353
esp_vfs_fat_mount_config_t conf = {
5454
.format_if_mount_failed = formatOnFail,
5555
.max_files = maxOpenFiles,
56-
.allocation_unit_size = CONFIG_WL_SECTOR_SIZE
56+
.allocation_unit_size = CONFIG_WL_SECTOR_SIZE,
57+
.disk_status_check_enable = false
5758
};
58-
esp_err_t err = esp_vfs_fat_spiflash_mount(basePath, partitionLabel, &conf, &_wl_handle);
59+
esp_err_t err = esp_vfs_fat_spiflash_mount_rw_wl(basePath, partitionLabel, &conf, &_wl_handle);
5960
if(err){
6061
log_e("Mounting FFat partition failed! Error: %d", err);
61-
esp_vfs_fat_spiflash_unmount(basePath, _wl_handle);
62+
esp_vfs_fat_spiflash_unmount_rw_wl(basePath, _wl_handle);
6263
_wl_handle = WL_INVALID_HANDLE;
6364
return false;
6465
}
@@ -69,7 +70,7 @@ bool F_Fat::begin(bool formatOnFail, const char * basePath, uint8_t maxOpenFiles
6970
void F_Fat::end()
7071
{
7172
if(_wl_handle != WL_INVALID_HANDLE){
72-
esp_err_t err = esp_vfs_fat_spiflash_unmount(_impl->mountpoint(), _wl_handle);
73+
esp_err_t err = esp_vfs_fat_spiflash_unmount_rw_wl(_impl->mountpoint(), _wl_handle);
7374
if(err){
7475
log_e("Unmounting FFat partition failed! Error: %d", err);
7576
return;
@@ -109,13 +110,14 @@ bool F_Fat::format(bool full_wipe, char* partitionLabel)
109110
esp_vfs_fat_mount_config_t conf = {
110111
.format_if_mount_failed = true,
111112
.max_files = 1,
112-
.allocation_unit_size = CONFIG_WL_SECTOR_SIZE
113+
.allocation_unit_size = CONFIG_WL_SECTOR_SIZE,
114+
.disk_status_check_enable = false
113115
};
114-
result = esp_vfs_fat_spiflash_mount("/format_ffat", partitionLabel, &conf, &temp_handle);
115-
esp_vfs_fat_spiflash_unmount("/format_ffat", temp_handle);
116+
result = esp_vfs_fat_spiflash_mount_rw_wl("/format_ffat", partitionLabel, &conf, &temp_handle);
117+
esp_vfs_fat_spiflash_unmount_rw_wl("/format_ffat", temp_handle);
116118
if (result != ESP_OK){
117119
res = false;
118-
log_w("esp_vfs_fat_spiflash_mount failed!");
120+
log_w("esp_vfs_fat_spiflash_mount_rw_wl failed!");
119121
}
120122
return res;
121123
}

Diff for: libraries/I2S/src/I2S.cpp

+15-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,20 @@ int I2SClass::_installDriver(){
144144
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL2,
145145
.dma_buf_count = _I2S_DMA_BUFFER_COUNT,
146146
.dma_buf_len = _i2s_dma_buffer_size,
147-
.use_apll = false
147+
.use_apll = false,
148+
#warning The following values are new and need to be checked
149+
.tx_desc_auto_clear = true,
150+
.fixed_mclk = 0,
151+
.mclk_multiple = esp_i2s::I2S_MCLK_MULTIPLE_128,
152+
.bits_per_chan = esp_i2s::I2S_BITS_PER_CHAN_DEFAULT
153+
#if SOC_I2S_SUPPORTS_TDM
154+
,.chan_mask = esp_i2s::I2S_CHANNEL_STEREO,
155+
.total_chan = 2,
156+
.left_align = false,
157+
.big_edin = false,
158+
.bit_order_msb = false,
159+
.skip_msk = false
160+
#endif // SOC_I2S_SUPPORTS_TDM
148161
};
149162

150163
if(_driveClock == false){
@@ -317,6 +330,7 @@ int I2SClass::begin(int mode, int sampleRate, int bitsPerSample, bool driveClock
317330
int I2SClass::_applyPinSetting(){
318331
if(_driverInstalled){
319332
esp_i2s::i2s_pin_config_t pin_config = {
333+
.mck_io_num = I2S_PIN_NO_CHANGE,
320334
.bck_io_num = _sckPin,
321335
.ws_io_num = _fsPin,
322336
.data_out_num = I2S_PIN_NO_CHANGE,

Diff for: libraries/RainMaker/src/RMaker.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ esp_err_t RMakerClass::enableOTA(ota_type_t type, const char *cert)
139139
.ota_cb = NULL,
140140
.ota_diag = NULL,
141141
.server_cert = cert,
142+
.priv = NULL
142143
};
143144
err = esp_rmaker_ota_enable(&ota_config, type);
144145
if(err != ESP_OK) {

Diff for: libraries/SD_MMC/src/SD_MMC.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount
123123
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
124124
.format_if_mount_failed = format_if_mount_failed,
125125
.max_files = maxOpenFiles,
126-
.allocation_unit_size = 0
126+
.allocation_unit_size = 0,
127+
.disk_status_check_enable = false
127128
};
128129

129130
esp_err_t ret = esp_vfs_fat_sdmmc_mount(mountpoint, &host, &slot_config, &mount_config, &_card);

Diff for: libraries/WebServer/examples/SDWebServer/SDWebServer.ino

-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ void printDirectory() {
214214
dir.rewindDirectory();
215215
server.setContentLength(CONTENT_LENGTH_UNKNOWN);
216216
server.send(200, "text/json", "");
217-
WiFiClient client = server.client();
218217

219218
server.sendContent("[");
220219
for (int cnt = 0; true; ++cnt) {

Diff for: libraries/WebServer/src/WebServer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class WebServer
9595

9696
String uri() { return _currentUri; }
9797
HTTPMethod method() { return _currentMethod; }
98-
virtual WiFiClient client() { return _currentClient; }
98+
virtual WiFiClient & client() { return _currentClient; }
9999
HTTPUpload& upload() { return *_currentUpload; }
100100

101101
String pathArg(unsigned int i); // get request path argument by number

Diff for: libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino

+2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
#include <WiFiClient.h>
1616
#include <WiFiAP.h>
1717

18+
#ifndef LED_BUILTIN
1819
#define LED_BUILTIN 2 // Set the GPIO pin where you connected your test LED or comment this line out if your dev board has a built-in LED
20+
#endif
1921

2022
// Set these to your desired credentials.
2123
const char *ssid = "yourAP";

0 commit comments

Comments
 (0)