Skip to content

Commit 7c5330d

Browse files
Jason2866me-no-devP-R-O-C-H-YOuss4VojtechBartoska
authored
Update 21042022 (#131)
* Delete stale.yml * IDF release/v4.4 b8050b365e (espressif#6594) * Update camera example to support face detection and recognition (espressif#6603) Fixes: espressif#6508 * Change pinMode OUTPUT to INPUT_OUTPUT (espressif#6602) * Change OUTPUT to INPUT_OUTPUT To match the official Arduino API. * Changed type of LEDC frequency from double to uint32_t (espressif#6570) * BUGFIX: FS read + speed improvements for SD (espressif#6569) * Revert "Edited VFSFileImpl::read to use both read/fread (espressif#6456)" This reverts commit 7b89b39. * Added default file buffer size + function to change it by user * workflows/publish.yml: Run the workflow on success and failure only. (espressif#6531) * workflows/publish.yml: Run the workflow on success and failure only. This prevents trying to run when the trigger was cancelled or skipped. In these cases there will be no event file to upload. Signed-off-by: Abdelatif Guettouche <[email protected]> * scripts/sketch_utils.sh: Move the logic that gets the build dir after the part that retrieves the arguments. Signed-off-by: Abdelatif Guettouche <[email protected]> * workflows/hil.yml: Update the HIL runners tags. Signed-off-by: Abdelatif Guettouche <[email protected]> * workflows/hil.yml: Remove the Check Artifacts step. That was only useful for debugging. Signed-off-by: Abdelatif Guettouche <[email protected]> * Pull request/Issue Templates and Readme update (espressif#6577) * Templates and readme * Templates_and_readme * Delete libraries/RainMaker directory * Delete tools/sdk/esp32/include/esp_rainmaker directory * Delete tools/sdk/esp32s2/include/esp_rainmaker directory * Delete tools/sdk/esp32s3/include/esp_rainmaker directory * Delete tools/sdk/esp32c3/include/esp_rainmaker directory Co-authored-by: Me No Dev <[email protected]> Co-authored-by: Jan Procházka <[email protected]> Co-authored-by: Abdelatif Guettouche <[email protected]> Co-authored-by: Vojtěch Bartoška <[email protected]>
1 parent 7f0f17d commit 7c5330d

File tree

14 files changed

+474
-253
lines changed

14 files changed

+474
-253
lines changed

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ body:
3939
label: Version
4040
description: What version of Arduino ESP32 are you running? If possible, consider updating to the latest version.
4141
options:
42-
- latest master
42+
- latest master (checkout manually)
43+
- latest development Release Candidate (RC-X)
4344
- v2.0.2
4445
- v2.0.1
4546
- v2.0.0
@@ -52,7 +53,7 @@ body:
5253
attributes:
5354
label: IDE Name
5455
description: What IDE are you using?
55-
placeholder: eg. Arduino IDE, PlatformIO, IDF component...
56+
placeholder: eg. Arduino IDE, PlatformIO, Sloeber...
5657
validations:
5758
required: true
5859
- type: input
@@ -101,8 +102,8 @@ body:
101102
id: sketch
102103
attributes:
103104
label: Sketch
104-
description: Please provide your sketch/code which was run
105-
placeholder: ex. related part of the code
105+
description: Please provide full minimal sketch/code which can be run to reproduce your issue
106+
placeholder: ex. Related part of the code to replicate the issue
106107
render: cpp
107108
validations:
108109
required: true

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
*By completing this PR sufficiently, you help us to improve the quality of Release Notes*
1+
*By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes*
22

33
### Checklist
4-
1. [ ] Please provide specific title of the PR describing the change, including the component name (eg. *„Update of Documentation link on Readme.md“*)
5-
2. [ ] Please provide related links (eg. Issue, other Project, submodule PR..)
6-
3. [ ] Please check [Contributing guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html)
4+
1. [ ] Please provide specific title of the PR describing the change, including the component name (*eg. „Update of Documentation link on Readme.md“*)
5+
2. [ ] Please provide related links (*eg. Issue which will be closed by this Pull Request*)
6+
3. [ ] Please **update relevant Documentation** if applicable
7+
4. [ ] Please check [Contributing guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html)
78

89
*This entire section above can be deleted if all items are checked.*
910

1011
-----------
11-
## Summary
12-
Please describe your proposed PR and what it contains.
12+
## Description of Change
13+
Please describe your proposed Pull Request and it's impact.
1314

14-
## Impact
15-
Please describe impact of your PR and it's function.
15+
## Tests scenarios
16+
Please describe on what Hardware and Software combinations you have tested this Pull Request and how.
17+
18+
(*eg. I have tested my Pull Request on Arduino-esp32 core v2.0.2 with ESP32 and ESP32-S2 Board with this scenario*)
1619

1720
## Related links
1821
Please provide links to related issue, PRs etc.
22+
23+
(*eg. Closes #number of issue*)

Diff for: .github/scripts/sketch_utils.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <fqbn> <path-to-i
77
return 1
88
fi
99

10-
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
11-
if [ -z "$ARDUINO_BUILD_DIR" ]; then
12-
build_dir="$(dirname $sketch)/build"
13-
else
14-
build_dir="$ARDUINO_BUILD_DIR"
15-
fi
1610
local ide_path=$1
1711
local usr_path=$2
1812
local fqbn=$3
1913
local sketch=$4
2014
local xtra_opts=$5
2115
local win_opts=$6
2216

17+
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
18+
if [ -z "$ARDUINO_BUILD_DIR" ]; then
19+
build_dir="$(dirname $sketch)/build"
20+
else
21+
build_dir="$ARDUINO_BUILD_DIR"
22+
fi
23+
24+
echo $sketch
25+
2326
rm -rf "$build_dir"
2427
mkdir -p "$build_dir"
2528
mkdir -p "$ARDUINO_CACHE_DIR"

Diff for: .github/workflows/hil.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ jobs:
6767
Test:
6868
needs: [gen_chunks, Build]
6969
name: ${{matrix.chip}}-Test#${{matrix.chunks}}
70-
runs-on: ESP32
70+
runs-on:
71+
- ESP32
72+
- ESP32-S2
73+
- ESP32-S3
74+
- ESP32-C3
75+
7176
strategy:
7277
fail-fast: false
7378
matrix:
@@ -87,11 +92,6 @@ jobs:
8792
name: ${{matrix.chip}}-${{matrix.chunks}}.artifacts
8893
path: tests/
8994

90-
- name: Check Artifacts
91-
run: |
92-
ls -R tests
93-
cat tests/*/build/build.options.json
94-
9595
- name: Install dependencies
9696
run: |
9797
pip install -U pip

Diff for: .github/workflows/publish.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515
if: |
1616
github.event.workflow_run.event == 'pull_request' &&
17-
github.event.workflow_run.conclusion != 'skipped'
17+
(github.event.workflow_run.conclusion == 'success' ||
18+
(github.event.workflow_run.conclusion == 'failure')
1819
steps:
1920
- name: Download and Extract Artifacts
2021
env:

Diff for: README.md

+16-5
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,33 @@
22

33
![Build Status](https://github.com/espressif/arduino-esp32/workflows/ESP32%20Arduino%20CI/badge.svg) [![Documentation Status](https://readthedocs.com/projects/espressif-arduino-esp32/badge/?version=latest)](https://docs.espressif.com/projects/arduino-esp32/en/latest/?badge=latest)
44

5-
### Need help or have a question? Join the chat at [![https://gitter.im/espressif/arduino-esp32](https://badges.gitter.im/espressif/arduino-esp32.svg)](https://gitter.im/espressif/arduino-esp32?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5+
### Need help or have a question? Join the chat at [![https://gitter.im/espressif/arduino-esp32](https://badges.gitter.im/espressif/arduino-esp32.svg)](https://gitter.im/espressif/arduino-esp32?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) or [open a new Discussion](https://github.com/espressif/arduino-esp32/discussions)
66

77
## Contents
88

9-
- [Development Status](#development-status)
10-
- [Decoding Exceptions](#decoding-exceptions)
11-
- [Issue/Bug report template](#issuebug-report-template)
9+
- [Development Status](#development-status)
10+
- [Development Planning](#development-planning)
11+
- [Documentation](#documentation)
12+
- [Supported Chips](#supported-chips)
13+
- [Decoding exceptions](#decoding-exceptions)
14+
- [Issue/Bug report template](#issuebug-report-template)
15+
- [Contributing](#contributing)
1216

1317
### Development Status
1418

1519
Latest Stable Release [![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Release Date](https://img.shields.io/github/release-date/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Downloads](https://img.shields.io/github/downloads/espressif/arduino-esp32/latest/total.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/)
1620

1721
Latest Development Release [![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32/all.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/) [![Release Date](https://img.shields.io/github/release-date-pre/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/) [![Downloads](https://img.shields.io/github/downloads-pre/espressif/arduino-esp32/latest/total.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/)
1822

23+
### Development Planning
24+
25+
Our Development is fully tracked on this public **[Roadmap 🎉](https://github.com/orgs/espressif/projects/3)**
26+
27+
For even more information you can take a look at [Sprint Meeting notes](https://github.com/espressif/arduino-esp32/discussions/categories/sprints-meeting-notes) or join [Monthly Community Meetings 🔔](https://github.com/espressif/arduino-esp32/discussions/categories/monthly-community-meetings)
28+
1929
### Documentation
2030

21-
You can use [Arduino-ESP32 Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/) to get all information about this project.
31+
You can use the [Arduino-ESP32 Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/) to get all information about this project.
2232

2333
* [Getting Started](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html)
2434
* [Installing (Windows, Linux and macOS)](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html)
@@ -36,6 +46,7 @@ Visit the [supported chips](https://docs.espressif.com/projects/arduino-esp32/en
3646
You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) to get meaningful call trace.
3747

3848
### Issue/Bug report template
49+
3950
Before reporting an issue, make sure you've searched for similar one that was already created. Also make sure to go through all the issues labelled as [Type: For reference](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue+label%3A%22Type%3A+For+reference%22+).
4051

4152
Finally, if you are sure no one else had the issue, follow the **Issue template** or **Feature request template** while reporting any [new Issue](https://github.com/espressif/arduino-esp32/issues/new/choose).

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ extern "C" {
4242

4343
//GPIO FUNCTIONS
4444
#define INPUT 0x01
45-
#define OUTPUT 0x02
45+
// Changed OUTPUT from 0x02 to behave the same as Arduino pinMode(pin,OUTPUT)
46+
// where you can read the state of pin even when it is set as OUTPUT
47+
#define OUTPUT 0x03
4648
#define PULLUP 0x04
4749
#define INPUT_PULLUP 0x05
4850
#define PULLDOWN 0x08

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
uint8_t channels_resolution[LEDC_CHANNELS] = {0};
5656

57-
double ledcSetup(uint8_t chan, double freq, uint8_t bit_num)
57+
uint32_t ledcSetup(uint8_t chan, uint32_t freq, uint8_t bit_num)
5858
{
5959
if(chan >= LEDC_CHANNELS || bit_num > LEDC_MAX_BIT_WIDTH){
6060
log_e("No more LEDC channels available! (maximum %u) or bit width too big (maximum %u)", LEDC_CHANNELS, LEDC_MAX_BIT_WIDTH);
@@ -106,7 +106,7 @@ uint32_t ledcRead(uint8_t chan)
106106
return ledc_get_duty(group,channel);
107107
}
108108

109-
double ledcReadFreq(uint8_t chan)
109+
uint32_t ledcReadFreq(uint8_t chan)
110110
{
111111
if(!ledcRead(chan)){
112112
return 0;
@@ -115,7 +115,7 @@ double ledcReadFreq(uint8_t chan)
115115
return ledc_get_freq(group,timer);
116116
}
117117

118-
double ledcWriteTone(uint8_t chan, double freq)
118+
uint32_t ledcWriteTone(uint8_t chan, uint32_t freq)
119119
{
120120
if(chan >= LEDC_CHANNELS){
121121
return 0;
@@ -142,12 +142,12 @@ double ledcWriteTone(uint8_t chan, double freq)
142142
}
143143
channels_resolution[chan] = 10;
144144

145-
double res_freq = ledc_get_freq(group,timer);
145+
uint32_t res_freq = ledc_get_freq(group,timer);
146146
ledcWrite(chan, 0x1FF);
147147
return res_freq;
148148
}
149149

150-
double ledcWriteNote(uint8_t chan, note_t note, uint8_t octave){
150+
uint32_t ledcWriteNote(uint8_t chan, note_t note, uint8_t octave){
151151
const uint16_t noteFrequencyBase[12] = {
152152
// C C# D Eb E F F# G G# A Bb B
153153
4186, 4435, 4699, 4978, 5274, 5588, 5920, 6272, 6645, 7040, 7459, 7902
@@ -156,7 +156,7 @@ double ledcWriteNote(uint8_t chan, note_t note, uint8_t octave){
156156
if(octave > 8 || note >= NOTE_MAX){
157157
return 0;
158158
}
159-
double noteFreq = (double)noteFrequencyBase[note] / (double)(1 << (8-octave));
159+
uint32_t noteFreq = (uint32_t)noteFrequencyBase[note] / (uint32_t)(1 << (8-octave));
160160
return ledcWriteTone(chan, noteFreq);
161161
}
162162

@@ -184,7 +184,7 @@ void ledcDetachPin(uint8_t pin)
184184
pinMatrixOutDetach(pin, false, false);
185185
}
186186

187-
double ledcChangeFrequency(uint8_t chan, double freq, uint8_t bit_num)
187+
uint32_t ledcChangeFrequency(uint8_t chan, uint32_t freq, uint8_t bit_num)
188188
{
189189
if(chan >= LEDC_CHANNELS || bit_num > LEDC_MAX_BIT_WIDTH){
190190
log_e("LEDC channel not available! (maximum %u) or bit width too big (maximum %u)", LEDC_CHANNELS, LEDC_MAX_BIT_WIDTH);

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ typedef enum {
2727
} note_t;
2828

2929
//channel 0-15 resolution 1-16bits freq limits depend on resolution
30-
double ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);
30+
uint32_t ledcSetup(uint8_t channel, uint32_t freq, uint8_t resolution_bits);
3131
void ledcWrite(uint8_t channel, uint32_t duty);
32-
double ledcWriteTone(uint8_t channel, double freq);
33-
double ledcWriteNote(uint8_t channel, note_t note, uint8_t octave);
32+
uint32_t ledcWriteTone(uint8_t channel, uint32_t freq);
33+
uint32_t ledcWriteNote(uint8_t channel, note_t note, uint8_t octave);
3434
uint32_t ledcRead(uint8_t channel);
35-
double ledcReadFreq(uint8_t channel);
35+
uint32_t ledcReadFreq(uint8_t channel);
3636
void ledcAttachPin(uint8_t pin, uint8_t channel);
3737
void ledcDetachPin(uint8_t pin);
38-
double ledcChangeFrequency(uint8_t channel, double freq, uint8_t resolution_bits);
38+
uint32_t ledcChangeFrequency(uint8_t channel, uint32_t freq, uint8_t resolution_bits);
3939

4040

4141
#ifdef __cplusplus

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

+48-15
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,35 @@
66
// Ensure ESP32 Wrover Module or other board with PSRAM is selected
77
// Partial images will be transmitted if image exceeds buffer size
88
//
9+
// You must select partition scheme from the board menu that has at least 3MB APP space.
10+
// Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15
11+
// seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well
912

13+
// ===================
1014
// Select camera model
11-
#define CAMERA_MODEL_WROVER_KIT // Has PSRAM
15+
// ===================
16+
//#define CAMERA_MODEL_WROVER_KIT // Has PSRAM
1217
//#define CAMERA_MODEL_ESP_EYE // Has PSRAM
18+
//#define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM
1319
//#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM
1420
//#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM
1521
//#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM
1622
//#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM
1723
//#define CAMERA_MODEL_M5STACK_UNITCAM // No PSRAM
18-
//#define CAMERA_MODEL_AI_THINKER // Has PSRAM
24+
#define CAMERA_MODEL_AI_THINKER // Has PSRAM
1925
//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM
26+
// ** Espressif Internal Boards **
27+
//#define CAMERA_MODEL_ESP32_CAM_BOARD
28+
//#define CAMERA_MODEL_ESP32S2_CAM_BOARD
29+
//#define CAMERA_MODEL_ESP32S3_CAM_LCD
2030

2131
#include "camera_pins.h"
2232

23-
const char* ssid = "*********";
24-
const char* password = "*********";
33+
// ===========================
34+
// Enter your WiFi credentials
35+
// ===========================
36+
const char* ssid = "**********";
37+
const char* password = "**********";
2538

2639
void startCameraServer();
2740

@@ -50,19 +63,32 @@ void setup() {
5063
config.pin_pwdn = PWDN_GPIO_NUM;
5164
config.pin_reset = RESET_GPIO_NUM;
5265
config.xclk_freq_hz = 20000000;
53-
config.pixel_format = PIXFORMAT_JPEG;
66+
config.frame_size = FRAMESIZE_UXGA;
67+
config.pixel_format = PIXFORMAT_JPEG; // for streaming
68+
//config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition
69+
config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
70+
config.fb_location = CAMERA_FB_IN_PSRAM;
71+
config.jpeg_quality = 12;
72+
config.fb_count = 1;
5473

5574
// if PSRAM IC present, init with UXGA resolution and higher JPEG quality
5675
// for larger pre-allocated frame buffer.
57-
if(psramFound()){
58-
config.frame_size = FRAMESIZE_UXGA;
59-
config.jpeg_quality = 10;
60-
config.fb_count = 2;
76+
if(config.pixel_format == PIXFORMAT_JPEG){
77+
if(psramFound()){
78+
config.jpeg_quality = 10;
79+
config.fb_count = 2;
80+
config.grab_mode = CAMERA_GRAB_LATEST;
81+
} else {
82+
// Limit the frame size when PSRAM is not available
83+
config.frame_size = FRAMESIZE_SVGA;
84+
config.fb_location = CAMERA_FB_IN_DRAM;
85+
}
6186
} else {
62-
config.frame_size = FRAMESIZE_SVGA;
63-
config.jpeg_quality = 12;
64-
config.fb_count = 1;
65-
config.fb_location = CAMERA_FB_IN_DRAM;
87+
// Best option for face detection/recognition
88+
config.frame_size = FRAMESIZE_240X240;
89+
#if CONFIG_IDF_TARGET_ESP32S3
90+
config.fb_count = 2;
91+
#endif
6692
}
6793

6894
#if defined(CAMERA_MODEL_ESP_EYE)
@@ -85,14 +111,21 @@ void setup() {
85111
s->set_saturation(s, -2); // lower the saturation
86112
}
87113
// drop down frame size for higher initial frame rate
88-
s->set_framesize(s, FRAMESIZE_QVGA);
114+
if(config.pixel_format == PIXFORMAT_JPEG){
115+
s->set_framesize(s, FRAMESIZE_QVGA);
116+
}
89117

90118
#if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)
91119
s->set_vflip(s, 1);
92120
s->set_hmirror(s, 1);
93121
#endif
94122

123+
#if defined(CAMERA_MODEL_ESP32S3_EYE)
124+
s->set_vflip(s, 1);
125+
#endif
126+
95127
WiFi.begin(ssid, password);
128+
WiFi.setSleep(false);
96129

97130
while (WiFi.status() != WL_CONNECTED) {
98131
delay(500);
@@ -109,6 +142,6 @@ void setup() {
109142
}
110143

111144
void loop() {
112-
// put your main code here, to run repeatedly:
145+
// Do nothing. Everything is done in another task by the web server
113146
delay(10000);
114147
}

0 commit comments

Comments
 (0)