Skip to content

Commit a4889ba

Browse files
authored
Merge branch 'espressif:release/v2.x' into release/v2.x
2 parents fb94d7d + 3670e2b commit a4889ba

File tree

17 files changed

+212
-32
lines changed

17 files changed

+212
-32
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.8
4445
- v2.0.7
4546
- v2.0.6
4647
- v2.0.5

.github/scripts/find_all_boards.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# Get all boards
4+
boards_array=()
5+
6+
for line in `grep '.tarch=' boards.txt`; do
7+
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
8+
boards_array+=("espressif:esp32:$board_name")
9+
echo "Added 'espressif:esp32:$board_name' to array"
10+
done
11+
12+
# Create JSON like string with all boards found and pass it to env variable
13+
board_count=${#boards_array[@]}
14+
echo "Boards found: $board_count"
15+
echo "BOARD-COUNT=$board_count" >> $GITHUB_ENV
16+
17+
if [ $board_count -gt 0 ]
18+
then
19+
json_matrix='['
20+
for board in ${boards_array[@]}
21+
do
22+
json_matrix+='"'$board'"'
23+
if [ $board_count -gt 1 ]
24+
then
25+
json_matrix+=","
26+
fi
27+
board_count=$(($board_count - 1))
28+
done
29+
json_matrix+=']'
30+
31+
echo $json_matrix
32+
echo "FQBNS=${json_matrix}" >> $GITHUB_ENV
33+
else
34+
echo "FQBNS=" >> $GITHUB_ENV
35+
fi

.github/workflows/allboards.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Boards Test - Remote trigger
2+
3+
# The workflow will run on remote dispath with event-type set to "test-boards"
4+
on:
5+
repository_dispatch:
6+
types: [test-boards]
7+
8+
jobs:
9+
find-boards:
10+
runs-on: ubuntu-latest
11+
12+
outputs:
13+
fqbns: ${{ env.FQBNS }}
14+
board-count: ${{ env.BOARD-COUNT }}
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
with:
20+
ref: ${{ github.event.client_payload.branch }}
21+
22+
- name: Get boards fqbns
23+
run:
24+
bash .github/scripts/find_all_boards.sh
25+
26+
setup-chunks:
27+
needs: find-boards
28+
runs-on: ubuntu-latest
29+
if: needs.find-boards.outputs.fqbns != ''
30+
31+
outputs:
32+
test-chunks: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
33+
34+
steps:
35+
- uses: actions/checkout@v3
36+
- run: npm install
37+
- name: Setup jq
38+
uses: dcarbone/install-jq-action@v1.0.1
39+
40+
- id: set-test-chunks
41+
name: Set Chunks
42+
run:
43+
echo "test-chunks<<EOF" >> $GITHUB_OUTPUT
44+
45+
echo "$( jq -nc '${{ needs.find-boards.outputs.fqbns }} | [_nwise( ${{ needs.find-boards.outputs.board-count }}/15 | ceil)]')" >> $GITHUB_OUTPUT
46+
47+
echo "EOF" >> $GITHUB_OUTPUT
48+
49+
test-boards:
50+
needs: setup-chunks
51+
runs-on: ubuntu-latest
52+
53+
env:
54+
REPOSITORY: |
55+
- source-path: '.'
56+
name: "espressif:esp32"
57+
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
chunk: ${{ fromJSON(needs.setup-chunks.outputs['test-chunks']) }}
62+
63+
steps:
64+
- name: Checkout repository
65+
uses: actions/checkout@v3
66+
67+
- name: Echo FQBNS to file
68+
run:
69+
echo "$FQBN" > fqbns.json
70+
env:
71+
FQBN: ${{ toJSON(matrix.chunk) }}
72+
73+
- name: Compile sketch
74+
uses: P-R-O-C-H-Y/compile-sketches@main
75+
with:
76+
platforms: |
77+
${{ env.REPOSITORY }}
78+
multiple-fqbn: true
79+
multiple-fqbn-path: "fqbns.json"
80+
use-json-file: false
81+
enable-deltas-report: false
82+
enable-warnings-report: false
83+
cli-compile-flags: |
84+
- --warnings="all"
85+
sketch-paths:
86+
"- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"

.github/workflows/lib.json

Lines changed: 14 additions & 3 deletions
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
]

boards.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7314,6 +7314,7 @@ dfrobot_beetle_esp32c3.menu.EraseFlash.all.upload.erase_cmd=-e
73147314
dfrobot_firebeetle2_esp32e.name=FireBeetle 2 ESP32-E
73157315

73167316
dfrobot_firebeetle2_esp32e.upload.tool=esptool_py
7317+
dfrobot_firebeetle2_esp32e.upload.tool.default=esptool_py
73177318
dfrobot_firebeetle2_esp32e.upload.maximum_size=1310720
73187319
dfrobot_firebeetle2_esp32e.upload.maximum_data_size=327680
73197320
dfrobot_firebeetle2_esp32e.upload.flags=
@@ -22259,6 +22260,7 @@ esp32c3m1IKit.menu.EraseFlash.all.upload.erase_cmd=-e
2225922260
roboheart_hercules.name=RoboHeart Hercules
2226022261

2226122262
roboheart_hercules.upload.tool=esptool_py
22263+
roboheart_hercules.upload.tool.default=esptool_py
2226222264
roboheart_hercules.upload.maximum_size=1310720
2226322265
roboheart_hercules.upload.maximum_data_size=327680
2226422266
roboheart_hercules.upload.wait_for_upload_port=true

cores/esp32/WString.h

Lines changed: 2 additions & 2 deletions
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(str_pointer) (reinterpret_cast<const __FlashStringHelper *>(str_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.

cores/esp32/esp32-hal-ledc.c

Lines changed: 22 additions & 16 deletions
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) {

cores/esp32/esp_arduino_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323
/** Minor version number (x.X.x) */
2424
#define ESP_ARDUINO_VERSION_MINOR 0
2525
/** Patch version number (x.x.X) */
26-
#define ESP_ARDUINO_VERSION_PATCH 8
26+
#define ESP_ARDUINO_VERSION_PATCH 9
2727

2828
/**
2929
* Macro to convert ARDUINO version number into an integer

docs/source/api/timer.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ This function is used to end timer.
4848
4949
* ``timer`` timer struct.
5050

51-
timerSetConfig
51+
timerGetConfig
5252
**************
5353

54-
This function is used to configure initialized timer (timerBegin() called).
54+
This function is used to get configuration of initialized timer (timerBegin() called).
5555

5656
.. code-block:: arduino
5757
@@ -62,6 +62,18 @@ This function is used to configure initialized timer (timerBegin() called).
6262
This function will return ``configuration`` as uint32_t number.
6363
This can be translated by inserting it to struct ``timer_cfg_t.val``.
6464

65+
timerSetConfig
66+
**************
67+
68+
This function is used to configure initialized timer (timerBegin() called).
69+
70+
.. code-block:: arduino
71+
72+
void timerSetConfig(hw_timer_t *timer, uint32_t config);
73+
74+
* ``timer`` timer struct.
75+
* ``config`` configuration as uint32_t number. Use configuration struct ``timer_cfg_t`` and pass ``timer_cfg_t.val`` as ``config`` paramater.
76+
6577
timerAttachInterrupt
6678
********************
6779

@@ -372,4 +384,4 @@ Repeat timer example:
372384
Watchdog timer example:
373385

374386
.. literalinclude:: ../../../libraries/ESP32/examples/Timer/WatchdogTimer/WatchdogTimer.ino
375-
:language: arduino
387+
:language: arduino

docs/source/getting_started.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ in the examples menu or inside each library folder.
133133

134134
https://github.com/espressif/arduino-esp32/tree/master/libraries
135135

136+
There is also a `list of examples <https://techtutorialsx.com/category/esp32/>`_ managed outside of Espressif, so check them out.
136137

137138
.. include:: common/datasheet.inc
138139

0 commit comments

Comments
 (0)