Skip to content

Commit 2c12bcd

Browse files
authored
Merge branch 'master' into args
2 parents 480e4fb + 205db02 commit 2c12bcd

File tree

1,107 files changed

+79640
-8880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,107 files changed

+79640
-8880
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

Lines changed: 1 addition & 0 deletions
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.4
4445
- v2.0.3
4546
- v2.0.2
4647
- v2.0.1

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ set(CORE_SRCS
3636
cores/esp32/esp32-hal-matrix.c
3737
cores/esp32/esp32-hal-misc.c
3838
cores/esp32/esp32-hal-psram.c
39+
cores/esp32/esp32-hal-rgb-led.c
3940
cores/esp32/esp32-hal-sigmadelta.c
4041
cores/esp32/esp32-hal-spi.c
4142
cores/esp32/esp32-hal-time.c

boards.txt

Lines changed: 915 additions & 184 deletions
Large diffs are not rendered by default.

cores/esp32/Tone.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ static void tone_task(void*){
3131
log_d("Task received from queue TONE_START: _pin=%d, frequency=%u Hz, duration=%lu ms", tone_msg.pin, tone_msg.frequency, tone_msg.duration);
3232

3333
log_d("Setup LED controll on channel %d", _channel);
34-
// ledcSetup(_channel, tone_msg.frequency, 11);
35-
// ledcAttachPin(tone_msg.pin, _channel);
36-
// ledcWrite(_channel, 1024);
37-
ledcWriteTone(_channel, tone_msg.frequency);
3834
ledcAttachPin(tone_msg.pin, _channel);
35+
ledcWriteTone(_channel, tone_msg.frequency);
3936

4037
if(tone_msg.duration){
4138
delay(tone_msg.duration);

cores/esp32/esp32-hal-gpio.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ static InterruptHandle_t __pinInterruptHandlers[SOC_GPIO_PIN_COUNT] = {0,};
9191

9292
extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode)
9393
{
94+
#ifdef BOARD_HAS_NEOPIXEL
95+
if (pin == LED_BUILTIN){
96+
__pinMode(LED_BUILTIN-SOC_GPIO_PIN_COUNT, mode);
97+
return;
98+
}
99+
#endif
100+
94101
if (!GPIO_IS_VALID_GPIO(pin)) {
95102
log_e("Invalid pin selected");
96103
return;
@@ -127,6 +134,14 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode)
127134

128135
extern void ARDUINO_ISR_ATTR __digitalWrite(uint8_t pin, uint8_t val)
129136
{
137+
#ifdef BOARD_HAS_NEOPIXEL
138+
if(pin == LED_BUILTIN){
139+
//use RMT to set all channels on/off
140+
const uint8_t comm_val = val != 0 ? LED_BRIGHTNESS : 0;
141+
neopixelWrite(LED_BUILTIN, comm_val, comm_val, comm_val);
142+
return;
143+
}
144+
#endif
130145
gpio_set_level((gpio_num_t)pin, val);
131146
}
132147

cores/esp32/esp32-hal-gpio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ extern "C" {
2626

2727
#include "esp32-hal.h"
2828
#include "soc/soc_caps.h"
29+
#include "pins_arduino.h"
2930

3031
#if (CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3)
3132
#define NUM_OUPUT_PINS 46
@@ -63,6 +64,7 @@ extern "C" {
6364
#define ONLOW_WE 0x0C
6465
#define ONHIGH_WE 0x0D
6566

67+
6668
#define digitalPinIsValid(pin) GPIO_IS_VALID_GPIO(pin)
6769
#define digitalPinCanOutput(pin) GPIO_IS_VALID_OUTPUT_GPIO(pin)
6870

cores/esp32/esp32-hal-rgb-led.c

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include "esp32-hal-rgb-led.h"
2+
3+
4+
void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val){
5+
rmt_data_t led_data[24];
6+
static rmt_obj_t* rmt_send = NULL;
7+
static bool initialized = false;
8+
9+
uint8_t _pin = pin;
10+
#ifdef BOARD_HAS_NEOPIXEL
11+
if(pin == LED_BUILTIN){
12+
_pin = LED_BUILTIN-SOC_GPIO_PIN_COUNT;
13+
}
14+
#endif
15+
16+
if(!initialized){
17+
if((rmt_send = rmtInit(_pin, RMT_TX_MODE, RMT_MEM_64)) == NULL){
18+
log_e("RGB LED driver initialization failed!");
19+
rmt_send = NULL;
20+
return;
21+
}
22+
rmtSetTick(rmt_send, 100);
23+
initialized = true;
24+
}
25+
26+
int color[] = {green_val, red_val, blue_val}; // Color coding is in order GREEN, RED, BLUE
27+
int i = 0;
28+
for(int col=0; col<3; col++ ){
29+
for(int bit=0; bit<8; bit++){
30+
if((color[col] & (1<<(7-bit)))){
31+
// HIGH bit
32+
led_data[i].level0 = 1; // T1H
33+
led_data[i].duration0 = 8; // 0.8us
34+
led_data[i].level1 = 0; // T1L
35+
led_data[i].duration1 = 4; // 0.4us
36+
}else{
37+
// LOW bit
38+
led_data[i].level0 = 1; // T0H
39+
led_data[i].duration0 = 4; // 0.4us
40+
led_data[i].level1 = 0; // T0L
41+
led_data[i].duration1 = 8; // 0.8us
42+
}
43+
i++;
44+
}
45+
}
46+
rmtWrite(rmt_send, led_data, 24);
47+
}

cores/esp32/esp32-hal-rgb-led.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#ifndef MAIN_ESP32_HAL_RGB_LED_H_
2+
#define MAIN_ESP32_HAL_RGB_LED_H_
3+
4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
7+
8+
#include "esp32-hal.h"
9+
10+
#ifndef LED_BRIGHTNESS
11+
#define LED_BRIGHTNESS 64
12+
#endif
13+
14+
void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val);
15+
16+
#ifdef __cplusplus
17+
}
18+
#endif
19+
20+
#endif /* MAIN_ESP32_HAL_RGB_LED_H_ */

cores/esp32/esp32-hal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ void yield(void);
8888
#include "esp32-hal-timer.h"
8989
#include "esp32-hal-bt.h"
9090
#include "esp32-hal-psram.h"
91+
#include "esp32-hal-rgb-led.h"
9192
#include "esp32-hal-cpu.h"
9293

9394
void analogWrite(uint8_t pin, int value);

docs/source/api/wifi.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Wi-Fi API provides support for the 802.11b/g/n protocol driver. This API inc
1111

1212
* AP mode (aka Soft-AP mode or Access Point mode). Devices connect to the ESP32
1313

14-
* Security modes (WPA, WPA2, WEP, etc.)
14+
* Security modes (WPA2, WPA3 etc.)
1515

1616
* Scanning for access points
1717

@@ -446,26 +446,12 @@ Return the connection state.
446446
setAutoConnect
447447
**************
448448

449-
Function used to set the automatic connection.
450-
451-
.. code-block:: arduino
452-
453-
bool setAutoConnect(bool autoConnect);
454-
455-
Where:
456-
457-
* ``bool autoConnect`` is set to ``true`` to enable this option.
449+
Function is deprecated.
458450

459451
getAutoConnect
460452
**************
461453

462-
Function used to get the automatic connection setting value.
463-
464-
.. code-block:: arduino
465-
466-
bool getAutoConnect();
467-
468-
The function will return ``true`` if the setting is enabled.
454+
Function is deprecated.
469455

470456
setAutoReconnect
471457
****************
@@ -484,11 +470,25 @@ getAutoReconnect
484470
****************
485471

486472
Function used to get the automatic reconnection if the connection is lost.
473+
487474
.. code-block:: arduino
488475
489476
bool getAutoReconnect();
490477
491-
The function will return ``true`` if this setting is enabled.
478+
The function will return ``true`` if this setting is enabled.
479+
480+
setMinSecurity
481+
**************
482+
483+
Function used to set the minimum security for AP to be considered connectable.
484+
485+
.. code-block:: arduino
486+
487+
bool setMinSecurity(wifi_auth_mode_t minSecurity);
488+
489+
Where:
490+
491+
* ``minSecurity`` is the minimum security for AP to be considered connectable. Default is ``WIFI_AUTH_WPA2_PSK``.
492492

493493
WiFiMulti
494494
---------

0 commit comments

Comments
 (0)