From 486a4c66c42a09c73586ffb50b67bfbe9cb1e502 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Fri, 6 Nov 2020 22:20:20 +0200 Subject: [PATCH 1/6] SDCARD: First sector always written twice if multiple sectors are updated --- libraries/SD/src/sd_diskio.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/SD/src/sd_diskio.cpp b/libraries/SD/src/sd_diskio.cpp index fea10fcb..b43b3a31 100644 --- a/libraries/SD/src/sd_diskio.cpp +++ b/libraries/SD/src/sd_diskio.cpp @@ -607,8 +607,9 @@ DRESULT ff_sd_write(uint8_t pdrv, const uint8_t* buffer, DWORD sector, UINT coun if (count > 1) { res = sdWriteSectors(pdrv, (const char*)buffer, sector, count) ? RES_OK : RES_ERROR; + } else { + res = sdWriteSector(pdrv, (const char*)buffer, sector) ? RES_OK : RES_ERROR; } - res = sdWriteSector(pdrv, (const char*)buffer, sector) ? RES_OK : RES_ERROR; return res; } From 28a807306915d68aa584300c91f431a6af22c037 Mon Sep 17 00:00:00 2001 From: M Hotchin <35244463+MHotchin@users.noreply.github.com> Date: Sat, 7 Nov 2020 18:55:59 -0800 Subject: [PATCH 2/6] Fix issue 4095 (#4503) pgmspace.h missing 'pgm_get_far_address' --- cores/esp32/pgmspace.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cores/esp32/pgmspace.h b/cores/esp32/pgmspace.h index aa58775f..75f7e801 100644 --- a/cores/esp32/pgmspace.h +++ b/cores/esp32/pgmspace.h @@ -53,6 +53,8 @@ typedef unsigned long prog_uint32_t; *(void * const *)(_addr); \ }) +#define pgm_get_far_address(x) ((uint32_t)(&(x))) + #define pgm_read_byte_near(addr) pgm_read_byte(addr) #define pgm_read_word_near(addr) pgm_read_word(addr) #define pgm_read_dword_near(addr) pgm_read_dword(addr) From 534f0810a6e267333fd219cb07015e957a859935 Mon Sep 17 00:00:00 2001 From: Pavel Melnikov Date: Mon, 9 Nov 2020 22:08:13 +0700 Subject: [PATCH 3/6] fix bitWrite macro (#4507) Fixes https://github.com/espressif/arduino-esp32/issues/4466 --- cores/esp32/Arduino.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index bc028e11..addcb206 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -88,7 +88,7 @@ #define bitRead(value, bit) (((value) >> (bit)) & 0x01) #define bitSet(value, bit) ((value) |= (1UL << (bit))) #define bitClear(value, bit) ((value) &= ~(1UL << (bit))) -#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) +#define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet(value, bit) : bitClear(value, bit)) // avr-libc defines _NOP() since 1.6.2 #ifndef _NOP From 3274602eb0cb3322859c8763c292018a2660a33b Mon Sep 17 00:00:00 2001 From: Robby Decosemaeker Date: Tue, 10 Nov 2020 12:02:00 +0100 Subject: [PATCH 4/6] Notify the batteryLevel change (#4517) --- libraries/BLE/src/BLEHIDDevice.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/BLE/src/BLEHIDDevice.cpp b/libraries/BLE/src/BLEHIDDevice.cpp index 69e18be7..5354c053 100644 --- a/libraries/BLE/src/BLEHIDDevice.cpp +++ b/libraries/BLE/src/BLEHIDDevice.cpp @@ -194,6 +194,7 @@ BLECharacteristic* BLEHIDDevice::protocolMode() { void BLEHIDDevice::setBatteryLevel(uint8_t level) { m_batteryLevelCharacteristic->setValue(&level, 1); + m_batteryLevelCharacteristic->notify(); } /* * @brief Returns battery level characteristic From 8816bb5505b19d91a9159a62e6e772610904c9ef Mon Sep 17 00:00:00 2001 From: lbernstone Date: Tue, 10 Nov 2020 11:50:35 -0700 Subject: [PATCH 5/6] Added #define LED_BUILTIN to all pins_arduino.h that need it. (#4520) --- variants/Microduino-esp32/pins_arduino.h | 1 + variants/S_ODI_Ultra_v1/pins_arduino.h | 1 + variants/alksesp32/pins_arduino.h | 1 + variants/d1_mini32/pins_arduino.h | 1 + variants/d32/pins_arduino.h | 1 + variants/d32_pro/pins_arduino.h | 1 + variants/doitESP32devkitV1/pins_arduino.h | 1 + variants/esp32-gateway/pins_arduino.h | 1 + variants/esp320/pins_arduino.h | 1 + variants/esp32thing/pins_arduino.h | 1 + variants/esp32thing_plus/pins_arduino.h | 1 + variants/espea32/pins_arduino.h | 1 + variants/espectro32/pins_arduino.h | 1 + variants/espino32/pins_arduino.h | 1 + variants/feather_esp32/pins_arduino.h | 1 + variants/firebeetle32/pins_arduino.h | 1 + variants/gpy/pins_arduino.h | 1 + variants/healthypi4/pins_arduino.h | 1 + variants/heltec_wifi_kit_32/pins_arduino.h | 1 + variants/heltec_wifi_lora_32/pins_arduino.h | 1 + variants/heltec_wifi_lora_32_V2/pins_arduino.h | 1 + variants/heltec_wireless_stick/pins_arduino.h | 1 + variants/honeylemon/pins_arduino.h | 1 + variants/hornbill32dev/pins_arduino.h | 1 + variants/imbrios-logsens-v1p1/pins_arduino.h | 1 + variants/intorobot-fig/pins_arduino.h | 1 + variants/lolin32/pins_arduino.h | 1 + variants/lopy/pins_arduino.h | 1 + variants/lopy4/pins_arduino.h | 1 + variants/metro_esp-32/pins_arduino.h | 1 + variants/mgbot-iotik32a/pins_arduino.h | 1 + variants/mgbot-iotik32b/pins_arduino.h | 1 + variants/mhetesp32devkit/pins_arduino.h | 1 + variants/mhetesp32minikit/pins_arduino.h | 1 + variants/nano32/pins_arduino.h | 1 + variants/node32s/pins_arduino.h | 1 + variants/nodemcu-32s/pins_arduino.h | 1 + variants/odroid_esp32/pins_arduino.h | 1 + variants/onehorse32dev/pins_arduino.h | 1 + variants/openkb/pins_arduino.h | 1 + variants/oroca_edubot/pins_arduino.h | 1 + variants/piranha_esp-32/pins_arduino.h | 1 + variants/pocket_32/pins_arduino.h | 1 + variants/tbeam/pins_arduino.h | 1 + variants/ttgo-lora32-v1/pins_arduino.h | 1 + variants/ttgo-lora32-v2/pins_arduino.h | 1 + variants/ttgo-lora32-v21new/pins_arduino.h | 1 + variants/ttgo-t1/pins_arduino.h | 1 + variants/turta_iot_node/pins_arduino.h | 1 + variants/vintlabsdevkitv1/pins_arduino.h | 1 + variants/widora-air/pins_arduino.h | 1 + variants/wifiduino32/pins_arduino.h | 1 + variants/wipy3/pins_arduino.h | 1 + variants/xinabox/pins_arduino.h | 1 + 54 files changed, 54 insertions(+) diff --git a/variants/Microduino-esp32/pins_arduino.h b/variants/Microduino-esp32/pins_arduino.h index 278525a9..35861423 100644 --- a/variants/Microduino-esp32/pins_arduino.h +++ b/variants/Microduino-esp32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = -1; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN #define MTDO 15 #define MTDI 12 diff --git a/variants/S_ODI_Ultra_v1/pins_arduino.h b/variants/S_ODI_Ultra_v1/pins_arduino.h index 8badbb01..a1a968ed 100644 --- a/variants/S_ODI_Ultra_v1/pins_arduino.h +++ b/variants/S_ODI_Ultra_v1/pins_arduino.h @@ -14,6 +14,7 @@ static const uint8_t LED_BUILTIN = 2; static const uint8_t LED_BUILTINB = 4; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN #define BUILTIN_LED2 LED_BUILTINB static const uint8_t TX = 1; diff --git a/variants/alksesp32/pins_arduino.h b/variants/alksesp32/pins_arduino.h index 31a23719..f170b852 100644 --- a/variants/alksesp32/pins_arduino.h +++ b/variants/alksesp32/pins_arduino.h @@ -15,6 +15,7 @@ static const uint8_t LED_BUILTIN = 23; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/d1_mini32/pins_arduino.h b/variants/d1_mini32/pins_arduino.h index 757adf14..69982798 100644 --- a/variants/d1_mini32/pins_arduino.h +++ b/variants/d1_mini32/pins_arduino.h @@ -6,6 +6,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t _VBAT = 35; // battery voltage #define PIN_WIRE_SDA SDA // backward compatibility diff --git a/variants/d32/pins_arduino.h b/variants/d32/pins_arduino.h index 065cef91..810eeae6 100644 --- a/variants/d32/pins_arduino.h +++ b/variants/d32/pins_arduino.h @@ -6,6 +6,7 @@ static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t _VBAT = 35; // battery voltage #endif /* Pins_Arduino_h */ diff --git a/variants/d32_pro/pins_arduino.h b/variants/d32_pro/pins_arduino.h index 3be2efca..f19efb97 100644 --- a/variants/d32_pro/pins_arduino.h +++ b/variants/d32_pro/pins_arduino.h @@ -6,6 +6,7 @@ static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t _VBAT = 35; // battery voltage diff --git a/variants/doitESP32devkitV1/pins_arduino.h b/variants/doitESP32devkitV1/pins_arduino.h index dd6c7e77..44aff01b 100644 --- a/variants/doitESP32devkitV1/pins_arduino.h +++ b/variants/doitESP32devkitV1/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/esp32-gateway/pins_arduino.h b/variants/esp32-gateway/pins_arduino.h index fda30927..8e4216cd 100644 --- a/variants/esp32-gateway/pins_arduino.h +++ b/variants/esp32-gateway/pins_arduino.h @@ -18,6 +18,7 @@ static const uint8_t LED_BUILTIN = 33; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 34; diff --git a/variants/esp320/pins_arduino.h b/variants/esp320/pins_arduino.h index 0c357f51..ebb18ad3 100644 --- a/variants/esp320/pins_arduino.h +++ b/variants/esp320/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/esp32thing/pins_arduino.h b/variants/esp32thing/pins_arduino.h index c035ee26..f0f8e69e 100644 --- a/variants/esp32thing/pins_arduino.h +++ b/variants/esp32thing/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/esp32thing_plus/pins_arduino.h b/variants/esp32thing_plus/pins_arduino.h index f0ea952d..6cdd2950 100644 --- a/variants/esp32thing_plus/pins_arduino.h +++ b/variants/esp32thing_plus/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 17; static const uint8_t RX = 16; diff --git a/variants/espea32/pins_arduino.h b/variants/espea32/pins_arduino.h index 5e729356..359defee 100644 --- a/variants/espea32/pins_arduino.h +++ b/variants/espea32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/espectro32/pins_arduino.h b/variants/espectro32/pins_arduino.h index 4163e3dd..43351c23 100644 --- a/variants/espectro32/pins_arduino.h +++ b/variants/espectro32/pins_arduino.h @@ -17,6 +17,7 @@ static const uint8_t LED_BUILTIN = 15; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/espino32/pins_arduino.h b/variants/espino32/pins_arduino.h index 4d65b6b4..24f9ac51 100644 --- a/variants/espino32/pins_arduino.h +++ b/variants/espino32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 16; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t BUILTIN_KEY = 0; diff --git a/variants/feather_esp32/pins_arduino.h b/variants/feather_esp32/pins_arduino.h index a94befc3..743d53c3 100644 --- a/variants/feather_esp32/pins_arduino.h +++ b/variants/feather_esp32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 17; static const uint8_t RX = 16; diff --git a/variants/firebeetle32/pins_arduino.h b/variants/firebeetle32/pins_arduino.h index ef829ad3..8783987f 100644 --- a/variants/firebeetle32/pins_arduino.h +++ b/variants/firebeetle32/pins_arduino.h @@ -15,6 +15,7 @@ typedef unsigned char uint8_t; static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN diff --git a/variants/gpy/pins_arduino.h b/variants/gpy/pins_arduino.h index affd7f55..71760e37 100644 --- a/variants/gpy/pins_arduino.h +++ b/variants/gpy/pins_arduino.h @@ -24,6 +24,7 @@ static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN #define ANT_SELECT 21 // GPIO21 - WiFi external / internal antenna switch diff --git a/variants/healthypi4/pins_arduino.h b/variants/healthypi4/pins_arduino.h index bc041213..15f5b189 100644 --- a/variants/healthypi4/pins_arduino.h +++ b/variants/healthypi4/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 15; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 17; diff --git a/variants/heltec_wifi_kit_32/pins_arduino.h b/variants/heltec_wifi_kit_32/pins_arduino.h index c17574a4..1409535e 100644 --- a/variants/heltec_wifi_kit_32/pins_arduino.h +++ b/variants/heltec_wifi_kit_32/pins_arduino.h @@ -17,6 +17,7 @@ static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/heltec_wifi_lora_32/pins_arduino.h b/variants/heltec_wifi_lora_32/pins_arduino.h index b8f466ec..b65e50be 100644 --- a/variants/heltec_wifi_lora_32/pins_arduino.h +++ b/variants/heltec_wifi_lora_32/pins_arduino.h @@ -17,6 +17,7 @@ static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/heltec_wifi_lora_32_V2/pins_arduino.h b/variants/heltec_wifi_lora_32_V2/pins_arduino.h index 1881f02f..4d091dab 100644 --- a/variants/heltec_wifi_lora_32_V2/pins_arduino.h +++ b/variants/heltec_wifi_lora_32_V2/pins_arduino.h @@ -17,6 +17,7 @@ static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/heltec_wireless_stick/pins_arduino.h b/variants/heltec_wireless_stick/pins_arduino.h index 5dd19978..11e028d9 100644 --- a/variants/heltec_wireless_stick/pins_arduino.h +++ b/variants/heltec_wireless_stick/pins_arduino.h @@ -17,6 +17,7 @@ static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/honeylemon/pins_arduino.h b/variants/honeylemon/pins_arduino.h index 0b11cabd..04f62911 100644 --- a/variants/honeylemon/pins_arduino.h +++ b/variants/honeylemon/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t BUILTIN_KEY = 0; diff --git a/variants/hornbill32dev/pins_arduino.h b/variants/hornbill32dev/pins_arduino.h index 3a991e3f..a01aa4e4 100644 --- a/variants/hornbill32dev/pins_arduino.h +++ b/variants/hornbill32dev/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/imbrios-logsens-v1p1/pins_arduino.h b/variants/imbrios-logsens-v1p1/pins_arduino.h index 3767d7d0..8e90770c 100644 --- a/variants/imbrios-logsens-v1p1/pins_arduino.h +++ b/variants/imbrios-logsens-v1p1/pins_arduino.h @@ -23,6 +23,7 @@ /* LED_BUILTIN is kept for compatibility reason; mapped to LED2 on the LogSens V1.1 Board */ static const uint8_t LED_BUILTIN = 33; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN /* UART0: Serial Port for Programming and Debugging on the LogSens V1.1 Board */ static const uint8_t TX = 1; diff --git a/variants/intorobot-fig/pins_arduino.h b/variants/intorobot-fig/pins_arduino.h index a9b39d79..a48f328d 100644 --- a/variants/intorobot-fig/pins_arduino.h +++ b/variants/intorobot-fig/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 4; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t RGB_R_BUILTIN = 27; static const uint8_t RGB_G_BUILTIN = 21; diff --git a/variants/lolin32/pins_arduino.h b/variants/lolin32/pins_arduino.h index 274f5d23..6be8fe24 100644 --- a/variants/lolin32/pins_arduino.h +++ b/variants/lolin32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN diff --git a/variants/lopy/pins_arduino.h b/variants/lopy/pins_arduino.h index 93365766..40db576c 100644 --- a/variants/lopy/pins_arduino.h +++ b/variants/lopy/pins_arduino.h @@ -24,6 +24,7 @@ static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN #define ANT_SELECT 16 // GPIO16 - External Antenna Switch diff --git a/variants/lopy4/pins_arduino.h b/variants/lopy4/pins_arduino.h index 70f933ce..3fb401a6 100644 --- a/variants/lopy4/pins_arduino.h +++ b/variants/lopy4/pins_arduino.h @@ -24,6 +24,7 @@ static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN #define ANT_SELECT 21 // GPIO21 - External Antenna Switch diff --git a/variants/metro_esp-32/pins_arduino.h b/variants/metro_esp-32/pins_arduino.h index a531d9d8..d2c737dc 100644 --- a/variants/metro_esp-32/pins_arduino.h +++ b/variants/metro_esp-32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/mgbot-iotik32a/pins_arduino.h b/variants/mgbot-iotik32a/pins_arduino.h index d023a85d..41345cae 100644 --- a/variants/mgbot-iotik32a/pins_arduino.h +++ b/variants/mgbot-iotik32a/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 4; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/mgbot-iotik32b/pins_arduino.h b/variants/mgbot-iotik32b/pins_arduino.h index 6b555ea7..e34f6271 100644 --- a/variants/mgbot-iotik32b/pins_arduino.h +++ b/variants/mgbot-iotik32b/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 18; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN // IR receiver static const uint8_t IR = 27; diff --git a/variants/mhetesp32devkit/pins_arduino.h b/variants/mhetesp32devkit/pins_arduino.h index 7095fcce..ee2112b9 100644 --- a/variants/mhetesp32devkit/pins_arduino.h +++ b/variants/mhetesp32devkit/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/mhetesp32minikit/pins_arduino.h b/variants/mhetesp32minikit/pins_arduino.h index 7095fcce..ee2112b9 100644 --- a/variants/mhetesp32minikit/pins_arduino.h +++ b/variants/mhetesp32minikit/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/nano32/pins_arduino.h b/variants/nano32/pins_arduino.h index 4d65b6b4..24f9ac51 100644 --- a/variants/nano32/pins_arduino.h +++ b/variants/nano32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 16; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t BUILTIN_KEY = 0; diff --git a/variants/node32s/pins_arduino.h b/variants/node32s/pins_arduino.h index 3bb26f1e..df2223aa 100644 --- a/variants/node32s/pins_arduino.h +++ b/variants/node32s/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/nodemcu-32s/pins_arduino.h b/variants/nodemcu-32s/pins_arduino.h index 3bb26f1e..df2223aa 100644 --- a/variants/nodemcu-32s/pins_arduino.h +++ b/variants/nodemcu-32s/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/odroid_esp32/pins_arduino.h b/variants/odroid_esp32/pins_arduino.h index 301a5c82..36af935e 100644 --- a/variants/odroid_esp32/pins_arduino.h +++ b/variants/odroid_esp32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/onehorse32dev/pins_arduino.h b/variants/onehorse32dev/pins_arduino.h index daa2d8cd..ab100c11 100644 --- a/variants/onehorse32dev/pins_arduino.h +++ b/variants/onehorse32dev/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 5; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/openkb/pins_arduino.h b/variants/openkb/pins_arduino.h index 7d8f271a..f187d251 100644 --- a/variants/openkb/pins_arduino.h +++ b/variants/openkb/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 16; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/oroca_edubot/pins_arduino.h b/variants/oroca_edubot/pins_arduino.h index 7ffe1776..331ccdbd 100644 --- a/variants/oroca_edubot/pins_arduino.h +++ b/variants/oroca_edubot/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 17; static const uint8_t RX = 16; diff --git a/variants/piranha_esp-32/pins_arduino.h b/variants/piranha_esp-32/pins_arduino.h index 93ed1641..3e74d0ad 100644 --- a/variants/piranha_esp-32/pins_arduino.h +++ b/variants/piranha_esp-32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/pocket_32/pins_arduino.h b/variants/pocket_32/pins_arduino.h index 2ac62af9..a36a6bb9 100644 --- a/variants/pocket_32/pins_arduino.h +++ b/variants/pocket_32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 16; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN diff --git a/variants/tbeam/pins_arduino.h b/variants/tbeam/pins_arduino.h index 977b6b26..ba4f9ade 100644 --- a/variants/tbeam/pins_arduino.h +++ b/variants/tbeam/pins_arduino.h @@ -26,6 +26,7 @@ static const uint8_t KEY_BUILTIN = 39; static const uint8_t LED_BUILTIN = 14; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/ttgo-lora32-v1/pins_arduino.h b/variants/ttgo-lora32-v1/pins_arduino.h index 11cd3d10..c365f240 100644 --- a/variants/ttgo-lora32-v1/pins_arduino.h +++ b/variants/ttgo-lora32-v1/pins_arduino.h @@ -26,6 +26,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/ttgo-lora32-v2/pins_arduino.h b/variants/ttgo-lora32-v2/pins_arduino.h index 09a879ec..416034e7 100644 --- a/variants/ttgo-lora32-v2/pins_arduino.h +++ b/variants/ttgo-lora32-v2/pins_arduino.h @@ -32,6 +32,7 @@ static const uint8_t LED_BUILTIN = 22; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/ttgo-lora32-v21new/pins_arduino.h b/variants/ttgo-lora32-v21new/pins_arduino.h index a338bfe1..931ff298 100644 --- a/variants/ttgo-lora32-v21new/pins_arduino.h +++ b/variants/ttgo-lora32-v21new/pins_arduino.h @@ -40,6 +40,7 @@ static const uint8_t LED_BUILTIN = 25 ; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/ttgo-t1/pins_arduino.h b/variants/ttgo-t1/pins_arduino.h index f68e5fd9..fa20c5f9 100644 --- a/variants/ttgo-t1/pins_arduino.h +++ b/variants/ttgo-t1/pins_arduino.h @@ -16,6 +16,7 @@ static const uint8_t RX = 3; static const uint8_t LED_BUILTIN = 22; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t SDA = 21; // Despite the many diagrams from TTGO showing SCL on pin 22, due to the on-board LED diff --git a/variants/turta_iot_node/pins_arduino.h b/variants/turta_iot_node/pins_arduino.h index 81292ffa..4e1ae60f 100644 --- a/variants/turta_iot_node/pins_arduino.h +++ b/variants/turta_iot_node/pins_arduino.h @@ -14,6 +14,7 @@ // LED static const uint8_t LED_BUILTIN = 13; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN // UART static const uint8_t TX = 10; diff --git a/variants/vintlabsdevkitv1/pins_arduino.h b/variants/vintlabsdevkitv1/pins_arduino.h index e9cdd317..feddfd95 100644 --- a/variants/vintlabsdevkitv1/pins_arduino.h +++ b/variants/vintlabsdevkitv1/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/widora-air/pins_arduino.h b/variants/widora-air/pins_arduino.h index ed5c79ff..52ecdd55 100644 --- a/variants/widora-air/pins_arduino.h +++ b/variants/widora-air/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 25; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/wifiduino32/pins_arduino.h b/variants/wifiduino32/pins_arduino.h index fd069075..63c04ff9 100644 --- a/variants/wifiduino32/pins_arduino.h +++ b/variants/wifiduino32/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 2; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t KEY_BUILTIN = 0; diff --git a/variants/wipy3/pins_arduino.h b/variants/wipy3/pins_arduino.h index cfee21dc..c8d9888e 100644 --- a/variants/wipy3/pins_arduino.h +++ b/variants/wipy3/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!! #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN #define ANT_SELECT 21 // GPIO21 - External Antenna Switch diff --git a/variants/xinabox/pins_arduino.h b/variants/xinabox/pins_arduino.h index 2cb41b91..3a1763f2 100644 --- a/variants/xinabox/pins_arduino.h +++ b/variants/xinabox/pins_arduino.h @@ -13,6 +13,7 @@ static const uint8_t LED_BUILTIN = 27; #define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN static const uint8_t TX = 1; static const uint8_t RX = 3; From b6cc108d49d56c972aba2c4488361783f59e8033 Mon Sep 17 00:00:00 2001 From: Clemens Kirchgatterer Date: Tue, 10 Nov 2020 19:51:10 +0100 Subject: [PATCH 6/6] Update WiFiProv.cpp (#4519) Do not pollute the global namespace with generic names like 'config' by declaring global variables 'static'. --- libraries/WiFi/src/WiFiProv.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/WiFi/src/WiFiProv.cpp b/libraries/WiFi/src/WiFiProv.cpp index 6c0eb277..59a5e7ff 100644 --- a/libraries/WiFi/src/WiFiProv.cpp +++ b/libraries/WiFi/src/WiFiProv.cpp @@ -33,9 +33,10 @@ #undef IPADDR_NONE #include "WiFi.h" -wifi_prov_mgr_config_t config; -scheme_t prov_scheme; extern esp_err_t postToSysQueue(system_prov_event_t *); + +static wifi_prov_mgr_config_t config; +static scheme_t prov_scheme; static const uint8_t custom_service_uuid[16] = { 0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf, 0xea, 0x4a, 0x82, 0x03, 0x04, 0x90, 0x1a, 0x02, };