Skip to content

Commit

Permalink
Merge branch 'master' into release/v2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev authored May 3, 2023
2 parents f89df42 + 7e51a03 commit 362a81b
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 7 deletions.
35 changes: 35 additions & 0 deletions .github/scripts/find_all_boards.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Get all boards
boards_array=()

for line in `grep '.tarch=' boards.txt`; do
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
boards_array+=("espressif:esp32:$board_name")
echo "Added 'espressif:esp32:$board_name' to array"
done

# Create JSON like string with all boards found and pass it to env variable
board_count=${#boards_array[@]}
echo "Boards found: $board_count"
echo "BOARD-COUNT=$board_count" >> $GITHUB_ENV

if [ $board_count -gt 0 ]
then
json_matrix='['
for board in ${boards_array[@]}
do
json_matrix+='"'$board'"'
if [ $board_count -gt 1 ]
then
json_matrix+=","
fi
board_count=$(($board_count - 1))
done
json_matrix+=']'

echo $json_matrix
echo "FQBNS=${json_matrix}" >> $GITHUB_ENV
else
echo "FQBNS=" >> $GITHUB_ENV
fi
86 changes: 86 additions & 0 deletions .github/workflows/allboards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Boards Test - Remote trigger

# The workflow will run on remote dispath with event-type set to "test-boards"
on:
repository_dispatch:
types: [test-boards]

jobs:
find-boards:
runs-on: ubuntu-latest

outputs:
fqbns: ${{ env.FQBNS }}
board-count: ${{ env.BOARD-COUNT }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch }}

- name: Get boards fqbns
run:
bash .github/scripts/find_all_boards.sh

setup-chunks:
needs: find-boards
runs-on: ubuntu-latest
if: needs.find-boards.outputs.fqbns != ''

outputs:
test-chunks: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}

steps:
- uses: actions/checkout@v3
- run: npm install
- name: Setup jq
uses: dcarbone/install-jq-action@v1.0.1

- id: set-test-chunks
name: Set Chunks
run:
echo "test-chunks<<EOF" >> $GITHUB_OUTPUT

echo "$( jq -nc '${{ needs.find-boards.outputs.fqbns }} | [_nwise( ${{ needs.find-boards.outputs.board-count }}/15 | ceil)]')" >> $GITHUB_OUTPUT

echo "EOF" >> $GITHUB_OUTPUT

test-boards:
needs: setup-chunks
runs-on: ubuntu-latest

env:
REPOSITORY: |
- source-path: '.'
name: "espressif:esp32"
strategy:
fail-fast: false
matrix:
chunk: ${{ fromJSON(needs.setup-chunks.outputs['test-chunks']) }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Echo FQBNS to file
run:
echo "$FQBN" > fqbns.json
env:
FQBN: ${{ toJSON(matrix.chunk) }}

- name: Compile sketch
uses: P-R-O-C-H-Y/compile-sketches@main
with:
platforms: |
${{ env.REPOSITORY }}
multiple-fqbn: true
multiple-fqbn-path: "fqbns.json"
use-json-file: false
enable-deltas-report: false
enable-warnings-report: false
cli-compile-flags: |
- --warnings="all"
sketch-paths:
"- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
2 changes: 2 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7314,6 +7314,7 @@ dfrobot_beetle_esp32c3.menu.EraseFlash.all.upload.erase_cmd=-e
dfrobot_firebeetle2_esp32e.name=FireBeetle 2 ESP32-E

dfrobot_firebeetle2_esp32e.upload.tool=esptool_py
dfrobot_firebeetle2_esp32e.upload.tool.default=esptool_py
dfrobot_firebeetle2_esp32e.upload.maximum_size=1310720
dfrobot_firebeetle2_esp32e.upload.maximum_data_size=327680
dfrobot_firebeetle2_esp32e.upload.flags=
Expand Down Expand Up @@ -22259,6 +22260,7 @@ esp32c3m1IKit.menu.EraseFlash.all.upload.erase_cmd=-e
roboheart_hercules.name=RoboHeart Hercules

roboheart_hercules.upload.tool=esptool_py
roboheart_hercules.upload.tool.default=esptool_py
roboheart_hercules.upload.maximum_size=1310720
roboheart_hercules.upload.maximum_data_size=327680
roboheart_hercules.upload.wait_for_upload_port=true
Expand Down
2 changes: 1 addition & 1 deletion cores/esp32/WString.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// A pure abstract class forward used as a means to proide a unique pointer type
// but really is never defined.
class __FlashStringHelper;
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
#define FPSTR(str_pointer) (reinterpret_cast<const __FlashStringHelper *>(str_pointer))
#define F(string_literal) (FPSTR(PSTR(string_literal)))

// An inherited class for holding the result of a concatenation. These
Expand Down
18 changes: 15 additions & 3 deletions docs/source/api/timer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ This function is used to end timer.
* ``timer`` timer struct.

timerSetConfig
timerGetConfig
**************

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

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

timerSetConfig
**************

This function is used to configure initialized timer (timerBegin() called).

.. code-block:: arduino
void timerSetConfig(hw_timer_t *timer, uint32_t config);
* ``timer`` timer struct.
* ``config`` configuration as uint32_t number. Use configuration struct ``timer_cfg_t`` and pass ``timer_cfg_t.val`` as ``config`` paramater.

timerAttachInterrupt
********************

Expand Down Expand Up @@ -372,4 +384,4 @@ Repeat timer example:
Watchdog timer example:

.. literalinclude:: ../../../libraries/ESP32/examples/Timer/WatchdogTimer/WatchdogTimer.ino
:language: arduino
:language: arduino
1 change: 1 addition & 0 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ in the examples menu or inside each library folder.

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

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

.. include:: common/datasheet.inc

Expand Down
4 changes: 2 additions & 2 deletions libraries/ESPmDNS/src/ESPmDNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ MDNSResponder::~MDNSResponder() {
end();
}

bool MDNSResponder::begin(const char* hostName){
bool MDNSResponder::begin(const String& hostName){
if(mdns_init()){
log_e("Failed starting MDNS");
return false;
}
//WiFi.onEvent(_on_sys_event);
_hostname = hostName;
_hostname.toLowerCase();
if(mdns_hostname_set(hostName)) {
if(mdns_hostname_set(hostName.c_str())) {
log_e("Failed setting MDNS hostname");
return false;
}
Expand Down
5 changes: 4 additions & 1 deletion libraries/ESPmDNS/src/ESPmDNS.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ class MDNSResponder {
public:
MDNSResponder();
~MDNSResponder();
bool begin(const char* hostName);
bool begin(const String& hostName);
bool begin(const char* hostName){
return begin(String(hostName));
}
void end();

void setInstanceName(String name);
Expand Down
6 changes: 6 additions & 0 deletions libraries/WiFi/src/WiFiSTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ class WiFiSTAClass
public:

wl_status_t begin(const char* wpa2_ssid, wpa2_auth_method_t method, const char* wpa2_identity=NULL, const char* wpa2_username=NULL, const char *wpa2_password=NULL, const char* ca_pem=NULL, const char* client_crt=NULL, const char* client_key=NULL, int32_t channel=0, const uint8_t* bssid=0, bool connect=true);
wl_status_t begin(const String& wpa2_ssid, wpa2_auth_method_t method, const String& wpa2_identity = (const char*)NULL, const String& wpa2_username = (const char*)NULL, const String& wpa2_password = (const char*)NULL, const String& ca_pem = (const char*)NULL, const String& client_crt = (const char*)NULL, const String& client_key = (const char*)NULL, int32_t channel=0, const uint8_t* bssid=0, bool connect=true) {
return begin(wpa2_ssid.c_str(), method, wpa2_identity.c_str(), wpa2_username.c_str(), wpa2_password.c_str(), ca_pem.c_str(), client_crt.c_str(), client_key.c_str(), channel, bssid, connect);
}
wl_status_t begin(const char* ssid, const char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true);
wl_status_t begin(const String& ssid, const String& passphrase = (const char*)NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true) {
return begin(ssid.c_str(), passphrase.c_str(), channel, bssid, connect);
}
wl_status_t begin(char* ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true);
wl_status_t begin();

Expand Down

0 comments on commit 362a81b

Please sign in to comment.