Skip to content

Commit a994343

Browse files
Merge branch 'main' into main
2 parents af1a452 + 7e83b8b commit a994343

File tree

4 files changed

+35
-26
lines changed

4 files changed

+35
-26
lines changed

.github/workflows/compile-examples.yml

+22-14
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,26 @@ jobs:
3838
- libraries/RTC/examples/Test_RTC
3939
- libraries/SoftwareSerial
4040
- libraries/WDT
41+
SKETCHES_REPORTS_PATH: sketches-reports
4142

4243
strategy:
4344
fail-fast: false
4445

4546
matrix:
46-
board: [
47-
{"fqbn": "arduino:renesas_portenta:portenta_c33"},
48-
{"fqbn": "arduino:renesas_uno:minima"},
49-
{"fqbn": "arduino:renesas_uno:unor4wifi"},
50-
{"fqbn": "arduino-git:renesas:portenta_c33"},
51-
{"fqbn": "arduino-git:renesas:minima"},
52-
{"fqbn": "arduino-git:renesas:unor4wifi"},
53-
]
47+
board:
48+
- fqbn: arduino:renesas_portenta:portenta_c33
49+
id: c33
50+
- fqbn: arduino:renesas_uno:minima
51+
id: minima
52+
- fqbn: arduino:renesas_uno:unor4wifi
53+
id: wifi
54+
- fqbn: arduino-git:renesas:portenta_c33
55+
id: git_c33
56+
- fqbn: arduino-git:renesas:minima
57+
id: git_minima
58+
- fqbn: arduino-git:renesas:unor4wifi
59+
id: git_wifi
60+
5461

5562
# make board type-specific customizations to the matrix jobs
5663
include:
@@ -106,11 +113,11 @@ jobs:
106113
107114
steps:
108115
- name: Checkout repository
109-
uses: actions/checkout@v3
116+
uses: actions/checkout@v4
110117

111118
# The source files are in a subfolder of the ArduinoCore-API repository, so it's not possible to clone it directly to the final destination in the core
112119
- name: Checkout ArduinoCore-API
113-
uses: actions/checkout@v3
120+
uses: actions/checkout@v4
114121
with:
115122
repository: arduino/ArduinoCore-API
116123
path: extras/ArduinoCore-API
@@ -125,7 +132,7 @@ jobs:
125132
if: steps.checkapi.outputs.IS_API == 'true'
126133

127134
- name: Checkout Basic examples
128-
uses: actions/checkout@v3
135+
uses: actions/checkout@v4
129136
with:
130137
repository: arduino/arduino-examples
131138
path: examples
@@ -173,9 +180,10 @@ jobs:
173180
enable-deltas-report: 'false'
174181
verbose: 'true'
175182
github-token: ${{ secrets.GITHUB_TOKEN }}
183+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
176184

177185
- name: Save memory usage change report as artifact
178-
uses: actions/upload-artifact@v3
186+
uses: actions/upload-artifact@v4
179187
with:
180-
name: sketches-reports
181-
path: sketches-reports
188+
path: ${{ env.SKETCHES_REPORTS_PATH }}
189+
name: sketches-reports-${{ matrix.board.id }}

libraries/WiFiS3/src/Modem.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@ ModemClass::~ModemClass() {
3030
}
3131

3232
/* -------------------------------------------------------------------------- */
33-
void ModemClass::begin(int badurate){
33+
void ModemClass::begin(int badurate, int retry){
3434
/* -------------------------------------------------------------------------- */
3535
if(_serial != nullptr && !beginned) {
3636
_serial->begin(badurate);
37-
beginned = true;
3837
string res = "";
3938
_serial->flush();
40-
modem.write(string(PROMPT(_SOFTRESETWIFI)),res, "%s" , CMD(_SOFTRESETWIFI));
39+
modem.timeout(500);
40+
while(!beginned && retry > 0) {
41+
beginned = modem.write(string(PROMPT(_SOFTRESETWIFI)),res, "%s" , CMD(_SOFTRESETWIFI));
42+
retry -= 1;
43+
}
44+
modem.timeout(MODEM_TIMEOUT);
4145
}
4246
}
4347

libraries/WiFiS3/src/Modem.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ class ModemClass {
4545
*/
4646
~ModemClass();
4747

48+
4849
/**
4950
* @brief Initializes the modem communication with a specified baud rate.
5051
*
5152
* @param[in] `badurate` sets the baud rate for the serial connection.
5253
*/
53-
void begin(int badurate = 115200);
54+
void begin(int badurate = 115200, int retry = 3);
5455

5556
/**
5657
* @brief Ends the modem communication.

libraries/WiFiS3/src/WiFiClient.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,11 @@ int WiFiClient::read(uint8_t *buf, size_t size) {
185185
/* -------------------------------------------------------------------------- */
186186
int WiFiClient::peek() {
187187
/* -------------------------------------------------------------------------- */
188-
int rv = -1;
189-
if(_sock >= 0) {
190-
string res = "";
191-
modem.begin();
192-
if(modem.write(string(PROMPT(_PEEK)),res, "%s%d\r\n" , CMD_WRITE(_PEEK), _sock)) {
193-
rv = atoi(res.c_str());
194-
}
188+
read_if_needed(1);
189+
if(_sock >= 0 && rx_buffer != nullptr) {
190+
return rx_buffer->peek();
195191
}
196-
return rv;
192+
return -1;
197193
}
198194

199195

0 commit comments

Comments
 (0)