Unverified Commit bdbfc45c authored by Me No Dev's avatar Me No Dev Committed by GitHub

Merge branch 'master' into release/v2.x

parents 483bebf8 6b1cc413
#!/bin/bash
# Get inputs from command
owner_repository=$1
pr_number=$2
url="https://api.github.com/repos/$owner_repository/pulls/$pr_number/files"
echo $url
# Get changes in boards.txt file from PR
Patch=$(curl $url | jq -r '.[] | select(.filename == "boards.txt") | .patch ')
# Extract only changed lines number and count
substring_patch=$(echo "$Patch" | grep -o '@@[^@]*@@')
params_array=()
IFS=$'\n' read -d '' -ra params <<< $(echo "$substring_patch" | grep -oE '[-+][0-9]+,[0-9]+')
for param in "${params[@]}"
do
echo "The parameter is $param"
params_array+=("$param")
done
boards_array=()
previous_board=""
file="boards.txt"
# Loop through boards.txt file and extract all boards that were added
for (( c=0; c<${#params_array[@]}; c+=2 ))
do
deletion_count=$( echo "${params_array[c]}" | cut -d',' -f2 | cut -d' ' -f1 )
addition_line=$( echo "${params_array[c+1]}" | cut -d'+' -f2 | cut -d',' -f1 )
addition_count=$( echo "${params_array[c+1]}" | cut -d'+' -f2 | cut -d',' -f2 | cut -d' ' -f1 )
addition_end=$(($addition_line+$addition_count))
addition_line=$(($addition_line + 3))
addition_end=$(($addition_end - $deletion_count))
echo $addition_line
echo $addition_end
i=0
while read -r line
do
i=$((i+1))
if [ $i -lt $addition_line ]
then
continue
elif [ $i -gt $addition_end ]
then
break
fi
board_name=$(echo "$line" | cut -d '.' -f1 | cut -d '#' -f1)
if [ "$board_name" != "" ]
then
if [ "$board_name" != "$previous_board" ]
then
boards_array+=("espressif:esp32:$board_name")
previous_board="$board_name"
echo "Added 'espressif:esp32:$board_name' to array"
fi
fi
done < "$file"
done
# Create JSON like string with all boards found and pass it to env variable
board_count=${#boards_array[@]}
if [ $board_count -gt 0 ]
then
json_matrix='{"fqbn": ['
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
\ No newline at end of file
name: New Board Test
# The workflow will run on schedule and labeled pull requests
on:
pull_request:
env:
# It's convenient to set variables for values used multiple times in the workflow
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
find-boards:
runs-on: ubuntu-latest
outputs:
fqbns: ${{ env.FQBNS }}
steps:
# This step makes the contents of the repository available to the workflow
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup jq
uses: dcarbone/install-jq-action@v1.0.1
- name: Get board name
run:
bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.event.number}}
test-boards:
needs: find-boards
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.services != '' }}
env:
REPOSITORY: |
- source-path: '.'
name: "espressif:esp32"
strategy:
matrix: ${{ fromJson(needs.find-boards.outputs.fqbns) }}
steps:
# This step makes the contents of the repository available to the workflow
- name: Checkout repository
uses: actions/checkout@v3
- name: Compile sketch
uses: P-R-O-C-H-Y/compile-sketches@main
with:
platforms: |
${{ env.REPOSITORY }}
fqbn: ${{ matrix.fqbn }}
use-json-file: false
enable-deltas-report: false
enable-warnings-report: false
cli-compile-flags: |
- --warnings="all"
exit-on-fail: true
sketch-paths:
"- ./libraries/ESP32/examples/ChipID/GetChipID/GetChipID.ino"
......@@ -15,6 +15,8 @@ env:
SKETCHES_REPORTS_ARTIFACT_NAME: libraries-report
RESULT_LIBRARY_TEST_FILE: LIBRARIES_TEST.md
JSON_LIBRARY_LIST_FILE: .github/workflows/lib.json
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
compile-sketch:
if: |
......@@ -80,6 +82,13 @@ jobs:
# Check out repository
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ env.GITHUB_TOKEN }}
fetch-depth: '0'
- name: Switch branch
run:
git checkout remotes/origin/gh-pages
# This step is needed to get the size data produced by the compile jobs
- name: Download sketches reports artifact
......@@ -95,12 +104,8 @@ jobs:
destination-file: ${{ env.RESULT_LIBRARY_TEST_FILE }}
- name: Append file with action URL
uses: DamianReeves/write-file-action@master
with:
path: ${{ env.RESULT_LIBRARY_TEST_FILE }}
contents: |
/ [GitHub Action Link](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})
write-mode: append
run:
echo "/ [GitHub Action Link](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})" >> ${{ env.RESULT_LIBRARY_TEST_FILE }}
- name: Push to github repo
run: |
......@@ -108,8 +113,8 @@ jobs:
git config user.email github-actions@github.com
git add ${{ env.RESULT_LIBRARY_TEST_FILE }}
git commit -m "Generated External Libraries Test Results"
git push
git push origin HEAD:gh-pages
event_file:
name: "Event File"
if: |
......@@ -121,4 +126,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: Event File
path: ${{github.event_path}}
path: ${{github.event_path}}
\ No newline at end of file
Empty file
\ No newline at end of file
......@@ -54,7 +54,7 @@ Finally, if you are sure no one else had the issue, follow the **Issue template*
### External libraries compilation test
We have set-up CI testing for external libraries for ESP32 Arduino core. You can check test results in the file [LIBRARIES_TEST](https://github.com/espressif/arduino-esp32/blob/master/LIBRARIES_TEST.md).
We have set-up CI testing for external libraries for ESP32 Arduino core. You can check test results in the file [LIBRARIES_TEST](https://github.com/espressif/arduino-esp32/blob/gh-pages/LIBRARIES_TEST.md).
For more information and how to add your library to the test see [external library testing](https://docs.espressif.com/projects/arduino-esp32/en/latest/external_libraries_test.html) in the documentation.
### Contributing
......
This diff is collapsed.
......@@ -128,5 +128,5 @@ In the table the results are in order ``BEFORE -> AFTER``.
:height: 2ex
:class: no-scaled-link
.. _LIBRARIES_TEST.md: https://github.com/espressif/arduino-esp32/LIBRARIES_TEST.md
.. _LIBRARIES_TEST.md: https://github.com/espressif/arduino-esp32/blob/gh-pages/LIBRARIES_TEST.md
.. _lib.json: https://github.com/espressif/arduino-esp32/.github/workflow/lib.json
\ No newline at end of file
/*
Simple Sketch for testing HardwareSerial with different CPU Frequencies
Changing the CPU Frequency may affect peripherals and Wireless functionality
In ESP32 Arduino, UART shall work correctly in order to let the user see DGB info
and other application messages.
CPU Frequency is usually lowered in sleep modes
and some other Low Power configurations
*/
int cpufreqs[6] = {240, 160, 80, 40, 20, 10};
#define NUM_CPU_FREQS (sizeof(cpufreqs) / sizeof(int))
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("\n Starting...\n");
Serial.flush();
// initial information
uint32_t Freq = getCpuFrequencyMhz();
Serial.print("CPU Freq = ");
Serial.print(Freq);
Serial.println(" MHz");
Freq = getXtalFrequencyMhz();
Serial.print("XTAL Freq = ");
Serial.print(Freq);
Serial.println(" MHz");
Freq = getApbFrequency();
Serial.print("APB Freq = ");
Serial.print(Freq);
Serial.println(" Hz");
delay(500);
// ESP32-C3 and other RISC-V target may not support 240MHz
#ifdef CONFIG_IDF_TARGET_ESP32C3
uint8_t firstFreq = 1;
#else
uint8_t firstFreq = 0;
#endif
// testing HardwareSerial for all possible CPU/APB Frequencies
for (uint8_t i = firstFreq; i < NUM_CPU_FREQS; i++) {
Serial.printf("\n------- Trying CPU Freq = %d ---------\n", cpufreqs[i]);
Serial.flush(); // wait to empty the UART FIFO before changing the CPU Freq.
setCpuFrequencyMhz(cpufreqs[i]);
Serial.updateBaudRate(115200);
Freq = getCpuFrequencyMhz();
Serial.print("CPU Freq = ");
Serial.print(Freq);
Serial.println(" MHz");
Freq = getXtalFrequencyMhz();
Serial.print("XTAL Freq = ");
Serial.print(Freq);
Serial.println(" MHz");
Freq = getApbFrequency();
Serial.print("APB Freq = ");
Serial.print(Freq);
Serial.println(" Hz");
if (i < NUM_CPU_FREQS - 1) {
Serial.println("Moving to the next frequency after a pause of 2 seconds.");
delay(2000);
}
}
Serial.println("\n-------------------\n");
Serial.println("End of testing...");
Serial.println("\n-------------------\n");
}
void loop() {
// Nothing here so far
}
......@@ -203,6 +203,15 @@ String File::getNextFileName(void)
}
String File::getNextFileName(bool *isDir)
{
if (!_p) {
return "";
}
return _p->getNextFileName(isDir);
}
void File::rewindDirectory(void)
{
if (!*this) {
......
......@@ -81,6 +81,7 @@ public:
boolean seekDir(long position);
File openNextFile(const char* mode = FILE_READ);
String getNextFileName(void);
String getNextFileName(boolean *isDir);
void rewindDirectory(void);
protected:
......
......@@ -45,6 +45,7 @@ public:
virtual FileImplPtr openNextFile(const char* mode) = 0;
virtual boolean seekDir(long position);
virtual String getNextFileName(void);
virtual String getNextFileName(bool *isDir);
virtual void rewindDirectory(void) = 0;
virtual operator bool() = 0;
};
......
......@@ -540,6 +540,32 @@ String VFSFileImpl::getNextFileName()
return name;
}
String VFSFileImpl::getNextFileName(bool *isDir)
{
if (!_isDirectory || !_d) {
return "";
}
struct dirent *file = readdir(_d);
if (file == NULL) {
return "";
}
if (file->d_type != DT_REG && file->d_type != DT_DIR) {
return "";
}
String fname = String(file->d_name);
String name = String(_path);
if (!fname.startsWith("/") && !name.endsWith("/")) {
name += "/";
}
name += fname;
// check entry is a directory
if (isDir) {
*isDir = (file->d_type == DT_DIR);
}
return name;
}
void VFSFileImpl::rewindDirectory(void)
{
if(!_isDirectory || !_d) {
......
......@@ -73,6 +73,7 @@ public:
boolean isDirectory(void) override;
boolean seekDir(long position) override;
String getNextFileName(void) override;
String getNextFileName(bool *isDir) override;
FileImplPtr openNextFile(const char* mode) override;
void rewindDirectory(void) override;
operator bool();
......
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define USB_VID 0x303a
#define USB_PID 0x8161
#define EXTERNAL_NUM_INTERRUPTS 46
#define NUM_DIGITAL_PINS 48
#define NUM_ANALOG_INPUTS 18
static const uint8_t LED_BUILTIN = 38;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
#define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43;
static const uint8_t RX = 44;
static const uint8_t SDA = 9;
static const uint8_t SCL = 10;
static const uint8_t SS = 0;
static const uint8_t MOSI = 11;
static const uint8_t MISO = 13;
static const uint8_t SCK = 12;
static const uint8_t TF_CS = 46;
static const uint8_t TS_CS = 45;
static const uint8_t TFT_CS = 48;
static const uint8_t TFT_DC = 47;
static const uint8_t TFT_RST = 21;
static const uint8_t TFT_LED = 14;
static const uint8_t A0 = 1;
static const uint8_t A1 = 2;
static const uint8_t A2 = 3;
static const uint8_t A3 = 4;
static const uint8_t A4 = 5;
static const uint8_t A5 = 6;
static const uint8_t A6 = 7;
static const uint8_t A7 = 8;
static const uint8_t A8 = 9;
static const uint8_t A9 = 10;
static const uint8_t A10 = 11;
static const uint8_t A11 = 12;
static const uint8_t A12 = 13;
static const uint8_t A13 = 14;
static const uint8_t A14 = 15;
static const uint8_t A15 = 16;
static const uint8_t A16 = 17;
static const uint8_t A17 = 18;
static const uint8_t T1 = 1;
static const uint8_t T2 = 2;
static const uint8_t T3 = 3;
static const uint8_t T4 = 4;
static const uint8_t T5 = 5;
static const uint8_t T6 = 6;
static const uint8_t T7 = 7;
static const uint8_t T8 = 8;
static const uint8_t T9 = 9;
static const uint8_t T10 = 10;
static const uint8_t T11 = 11;
static const uint8_t T12 = 12;
static const uint8_t T13 = 13;
static const uint8_t T14 = 14;
#endif /* Pins_Arduino_h */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment