Skip to content

Commit d66b740

Browse files
authored
Merge branch 'espressif:master' into master
2 parents 5d745a1 + b98255d commit d66b740

File tree

12 files changed

+99
-116
lines changed

12 files changed

+99
-116
lines changed

.github/scripts/sketch_utils.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,26 +117,27 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
117117
# 3. Created at the sketch level as "buildX" where X is the number
118118
# of configuration built in case of a multiconfiguration test.
119119

120+
sketchname=$(basename $sketchdir)
121+
120122
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
121123
if [ -n "$ARDUINO_BUILD_DIR" ]; then
122124
build_dir="$ARDUINO_BUILD_DIR"
123125
elif [ $len -eq 1 ]; then
124126
# build_dir="$sketchdir/build"
125-
build_dir="$HOME/.arduino/build.tmp"
127+
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
126128
fi
127129

128130
mkdir -p "$ARDUINO_CACHE_DIR"
129131
for i in `seq 0 $(($len - 1))`
130132
do
131133
if [ $len -ne 1 ]; then
132134
# build_dir="$sketchdir/build$i"
133-
build_dir="$HOME/.arduino/build$i.tmp"
135+
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
134136
fi
135137
rm -rf $build_dir
136138
mkdir -p $build_dir
137139

138140
currfqbn=`echo $fqbn | jq -r --argjson i $i '.[$i]'`
139-
sketchname=$(basename $sketchdir)
140141

141142
if [ -f "$ide_path/arduino-cli" ]; then
142143
echo "Building $sketchname with arduino-cli and FQBN=$currfqbn"
@@ -152,6 +153,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
152153
$xtra_opts "${sketchdir}"
153154
elif [ -f "$ide_path/arduino-builder" ]; then
154155
echo "Building $sketchname with arduino-builder and FQBN=$currfqbn"
156+
echo "Build path = $build_dir"
155157

156158
$ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
157159
-fqbn=\"$currfqbn\" \

.github/scripts/tests_run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ function run_test() {
1515
fi
1616

1717
if [ $len -eq 1 ]; then
18-
build_dir="tests/$sketchname/build"
18+
# build_dir="tests/$sketchname/build"
19+
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
1920
report_file="tests/$sketchname/$sketchname.xml"
2021
fi
2122

@@ -27,7 +28,8 @@ function run_test() {
2728
fi
2829

2930
if [ $len -ne 1 ]; then
30-
build_dir="tests/$sketchname/build$i"
31+
# build_dir="tests/$sketchname/build$i"
32+
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
3133
report_file="tests/$sketchname/$sketchname$i.xml"
3234
fi
3335

.github/workflows/hil.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
set -e
4040
rm sketches.txt
4141
CHUNKS=$(jq -c -n '$ARGS.positional' --args `seq 0 1 $((sketches - 1))`)
42-
echo "::set-output name=chunks::${CHUNKS}"
42+
echo "chunks=${CHUNKS}" >>$GITHUB_OUTPUT
4343
4444
Build:
4545
needs: gen_chunks
@@ -49,21 +49,20 @@ jobs:
4949
matrix:
5050
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3']
5151
chunks: ${{fromJson(needs.gen_chunks.outputs.chunks)}}
52-
5352
steps:
5453
- name: Checkout Repository
5554
uses: actions/checkout@v3
56-
5755
- name: Build sketches
5856
run: |
5957
bash .github/scripts/tests_build.sh -c -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}}
6058
- name: Upload ${{matrix.chip}}-${{matrix.chunks}} artifacts
61-
uses: actions/upload-artifact@v2
59+
uses: actions/upload-artifact@v3
6260
with:
6361
name: ${{matrix.chip}}-${{matrix.chunks}}.artifacts
6462
path: |
65-
tests/*/build*/*.bin
66-
tests/*/build*/*.json
63+
~/.arduino/tests/*/build*.tmp/*.bin
64+
~/.arduino/tests/*/build*.tmp/*.json
65+
if-no-files-found: error
6766
Test:
6867
needs: [gen_chunks, Build]
6968
name: ${{matrix.chip}}-Test#${{matrix.chunks}}
@@ -87,10 +86,10 @@ jobs:
8786
uses: actions/checkout@v3
8887

8988
- name: Download ${{matrix.chip}}-${{matrix.chunks}} artifacts
90-
uses: actions/download-artifact@v2
89+
uses: actions/download-artifact@v3
9190
with:
9291
name: ${{matrix.chip}}-${{matrix.chunks}}.artifacts
93-
path: tests/
92+
path: ~/.arduino/tests/
9493

9594
- name: Install dependencies
9695
run: |
@@ -103,7 +102,7 @@ jobs:
103102
bash .github/scripts/tests_run.sh -c -t ${{matrix.chip}} -i ${{matrix.chunks}} -m ${{env.MAX_CHUNKS}} -e
104103
105104
- name: Upload test result artifacts
106-
uses: actions/upload-artifact@v2
105+
uses: actions/upload-artifact@v3
107106
if: always()
108107
with:
109108
name: test_results-${{matrix.chip}}-${{matrix.chunks}}
@@ -118,7 +117,7 @@ jobs:
118117
runs-on: ubuntu-latest
119118
steps:
120119
- name: Upload
121-
uses: actions/upload-artifact@v2
120+
uses: actions/upload-artifact@v3
122121
with:
123122
name: Event File
124123
path: ${{github.event_path}}

.github/workflows/lib.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[
22
{
33
"name": "Adafruit NeoPixel",
4-
"version": "1.10.6",
54
"exclude_targets": [],
65
"sketch_path": [
76
"~/Arduino/libraries/Adafruit_NeoPixel/examples/strandtest/strandtest.ino"

.github/workflows/lib.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,6 @@ jobs:
7272
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
7373
path: ${{ env.SKETCHES_REPORTS_PATH }}
7474

75-
report-comment:
76-
needs: compile-sketch # Wait for the compile job to finish to get the data for the report
77-
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
78-
runs-on: ubuntu-latest
79-
steps:
80-
# This step is needed to get the size data produced by the compile jobs
81-
- name: Download sketches reports artifact
82-
uses: actions/download-artifact@v3
83-
with:
84-
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
85-
path: ${{ env.SKETCHES_REPORTS_PATH }}
86-
87-
- name: Report results
88-
uses: P-R-O-C-H-Y/report-size-deltas@main
89-
with:
90-
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
91-
9275
report-to-file:
9376
needs: compile-sketch # Wait for the compile job to finish to get the data for the report
9477
if: github.event_name == 'schedule' # Only run the job when the workflow is triggered by a schedule
@@ -126,3 +109,16 @@ jobs:
126109
git add ${{ env.RESULT_LIBRARY_TEST_FILE }}
127110
git commit -m "Generated External Libraries Test Results"
128111
git push
112+
113+
event_file:
114+
name: "Event File"
115+
if: |
116+
contains(github.event.pull_request.labels.*.name, 'lib_test')
117+
needs: compile-sketch
118+
runs-on: ubuntu-latest
119+
steps:
120+
- name: Upload
121+
uses: actions/upload-artifact@v2
122+
with:
123+
name: Event File
124+
path: ${{github.event_path}}

.github/workflows/publishlib.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: External Libraries Results
2+
3+
on:
4+
workflow_run:
5+
workflows: [External Libraries Test]
6+
types:
7+
- completed
8+
9+
workflow_dispatch:
10+
env:
11+
# It's convenient to set variables for values used multiple times in the workflow
12+
SKETCHES_REPORTS_PATH: artifacts/libraries-report
13+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
14+
PR_EVENT_PATH: artifacts/Event File/event.json
15+
16+
jobs:
17+
lib-test-results:
18+
name: External Libraries Test Results
19+
runs-on: ubuntu-latest
20+
if: |
21+
github.event.workflow_run.event == 'pull_request' &&
22+
github.event.workflow_run.conclusion == 'success'
23+
24+
steps:
25+
- name: Download and Extract Artifacts
26+
run: |
27+
mkdir -p artifacts && cd artifacts
28+
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
29+
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
30+
do
31+
IFS=$'\t' read name url <<< "$artifact"
32+
gh api $url > "$name.zip"
33+
unzip -d "$name" "$name.zip"
34+
done
35+
36+
- name: Report results
37+
uses: P-R-O-C-H-Y/report-size-deltas@main
38+
with:
39+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
40+
github-token: ${{ env.GITHUB_TOKEN }}
41+
pr-event-path: ${{ env.PR_EVENT_PATH }}

cores/esp32/Print.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ size_t Print::printf(const char *format, ...)
7474
return len;
7575
}
7676

77-
size_t Print::print(const __FlashStringHelper *ifsh)
78-
{
79-
return print(reinterpret_cast<const char *>(ifsh));
80-
}
81-
8277
size_t Print::print(const String &s)
8378
{
8479
return write(s.c_str(), s.length());
@@ -152,13 +147,6 @@ size_t Print::print(double n, int digits)
152147
return printFloat(n, digits);
153148
}
154149

155-
size_t Print::println(const __FlashStringHelper *ifsh)
156-
{
157-
size_t n = print(ifsh);
158-
n += println();
159-
return n;
160-
}
161-
162150
size_t Print::print(const Printable& x)
163151
{
164152
return x.printTo(*this);

cores/esp32/Print.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Print
7878
// default to zero, meaning "a single write may block"
7979
// should be overriden by subclasses with buffering
8080
virtual int availableForWrite() { return 0; }
81-
size_t print(const __FlashStringHelper *);
81+
size_t print(const __FlashStringHelper *ifsh) { return print(reinterpret_cast<const char *>(ifsh)); }
8282
size_t print(const String &);
8383
size_t print(const char[]);
8484
size_t print(char);
@@ -93,7 +93,7 @@ class Print
9393
size_t print(const Printable&);
9494
size_t print(struct tm * timeinfo, const char * format = NULL);
9595

96-
size_t println(const __FlashStringHelper *);
96+
size_t println(const __FlashStringHelper *ifsh) { return println(reinterpret_cast<const char *>(ifsh)); }
9797
size_t println(const String &s);
9898
size_t println(const char[]);
9999
size_t println(char);

cores/esp32/WString.cpp

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ String::String(const String &value) {
4747
*this = value;
4848
}
4949

50-
String::String(const __FlashStringHelper *pstr) {
51-
init();
52-
*this = pstr; // see operator =
53-
}
54-
5550
#ifdef __GXX_EXPERIMENTAL_CXX0X__
5651
String::String(String &&rval) {
5752
init();
@@ -235,16 +230,6 @@ String & String::copy(const char *cstr, unsigned int length) {
235230
return *this;
236231
}
237232

238-
String & String::copy(const __FlashStringHelper *pstr, unsigned int length) {
239-
if (!reserve(length)) {
240-
invalidate();
241-
return *this;
242-
}
243-
memcpy_P(wbuffer(), (PGM_P)pstr, length + 1); // We know wbuffer() cannot ever be in PROGMEM, so memcpy safe here
244-
setLen(length);
245-
return *this;
246-
}
247-
248233
#ifdef __GXX_EXPERIMENTAL_CXX0X__
249234
void String::move(String &rhs) {
250235
if(buffer()) {
@@ -308,15 +293,6 @@ String & String::operator =(const char *cstr) {
308293
return *this;
309294
}
310295

311-
String & String::operator =(const __FlashStringHelper *pstr) {
312-
if(pstr)
313-
copy(pstr, strlen_P((PGM_P)pstr));
314-
else
315-
invalidate();
316-
317-
return *this;
318-
}
319-
320296
/*********************************************/
321297
/* concat */
322298
/*********************************************/
@@ -424,20 +400,6 @@ bool String::concat(double num) {
424400
return concat(string, strlen(string));
425401
}
426402

427-
bool String::concat(const __FlashStringHelper * str) {
428-
if (!str)
429-
return false;
430-
int length = strlen_P((PGM_P)str);
431-
if (length == 0)
432-
return true;
433-
unsigned int newlen = len() + length;
434-
if (!reserve(newlen))
435-
return false;
436-
memcpy_P(wbuffer() + len(), (PGM_P)str, length + 1);
437-
setLen(newlen);
438-
return true;
439-
}
440-
441403
/*********************************************/
442404
/* Concatenate */
443405
/*********************************************/
@@ -526,14 +488,6 @@ StringSumHelper & operator +(const StringSumHelper &lhs, unsigned long long num)
526488
return a;
527489
}
528490

529-
StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs)
530-
{
531-
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
532-
if (!a.concat(rhs))
533-
a.invalidate();
534-
return a;
535-
}
536-
537491
/*********************************************/
538492
/* Comparison */
539493
/*********************************************/

0 commit comments

Comments
 (0)