From 6e68c79ea97e2b971b444871b2f88fddbb23e2f0 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Thu, 20 May 2021 17:11:56 -0700 Subject: [PATCH 01/17] Add compilation to CI Stolen from ESP8266! --- .github/workflows/pull-request.yml | 31 ++++ tests/astyle_core.conf | 32 ++++ tests/astyle_examples.conf | 44 +++++ tests/build.sh | 22 +++ tests/ci/build_boards.sh | 14 ++ tests/ci/build_docs.sh | 9 + tests/ci/build_package.sh | 16 ++ tests/ci/host_test.sh | 23 +++ tests/ci/pkgrefs_test.sh | 24 +++ tests/ci/style_check.sh | 15 ++ tests/common.sh | 256 +++++++++++++++++++++++++++++ tests/debug.sh | 18 ++ tests/restyle-examples-only.sh | 19 +++ tests/restyle.sh | 50 ++++++ tests/run_CI_locally.sh | 124 ++++++++++++++ 15 files changed, 697 insertions(+) create mode 100644 tests/astyle_core.conf create mode 100644 tests/astyle_examples.conf create mode 100755 tests/build.sh create mode 100755 tests/ci/build_boards.sh create mode 100755 tests/ci/build_docs.sh create mode 100755 tests/ci/build_package.sh create mode 100755 tests/ci/host_test.sh create mode 100755 tests/ci/pkgrefs_test.sh create mode 100755 tests/ci/style_check.sh create mode 100755 tests/common.sh create mode 100755 tests/debug.sh create mode 100755 tests/restyle-examples-only.sh create mode 100755 tests/restyle.sh create mode 100755 tests/run_CI_locally.sh diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c9853fa6..8d1a73e2 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -24,3 +24,34 @@ jobs: with: skip: ./pico-extras,./ArduinoCore-API,./libraries/SdFat,./libraries/Adafruit_TinyUSB_Arduino,./libraries/LittleFS/lib,./tools/pyserial,./pico-sdk,./.github,./docs/i2s.rst ignore_words_list: ser,DOUT + + + build-linux: + name: Build ${{ matrix.chunk }} + runs-on: ubuntu-latest + strategy: + matrix: + chunk: [0, 1, 2, 3, 4, 5, 6, 7] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Cache Linux toolchain + id: cache-linux + uses: actions/cache@v2 + with: + path: ./tools/dist + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} + - name: Build Sketches + env: + TRAVIS_BUILD_DIR: ${{ github.workspace }} + TRAVIS_TAG: ${{ github.ref }} + BUILD_PARITY: custom + mod: 8 + rem: ${{ matrix.chunk }} + run: | + bash ./tests/build.sh + diff --git a/tests/astyle_core.conf b/tests/astyle_core.conf new file mode 100644 index 00000000..f9ee90ad --- /dev/null +++ b/tests/astyle_core.conf @@ -0,0 +1,32 @@ +# Code formatting rules for Arduino examples, taken from: +# +# https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf +# + +mode=c +lineend=linux +style=allman + +# 4 spaces indentation +indent=spaces=4 + +# also indent macros +#indent-preprocessor + +# indent classes, switches (and cases), comments starting at column 1 +indent-col1-comments + +# put a space around operators +pad-oper + +# put a space after if/for/while +pad-header + +# if you like one-liners, keep them +keep-one-line-statements + +attach-closing-while +unpad-paren +pad-oper +remove-comment-prefix +add-braces diff --git a/tests/astyle_examples.conf b/tests/astyle_examples.conf new file mode 100644 index 00000000..f3b77f2c --- /dev/null +++ b/tests/astyle_examples.conf @@ -0,0 +1,44 @@ +# Code formatting rules for Arduino examples, taken from: +# +# https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf +# + +mode=c +lineend=linux + +# 2 spaces indentation +indent=spaces=2 + +# also indent macros +#indent-preprocessor + +# indent classes, switches (and cases), comments starting at column 1 +indent-classes +indent-switches +indent-cases +indent-col1-comments + +# put a space around operators +pad-oper + +# put a space after if/for/while +pad-header + +# if you like one-liners, keep them +keep-one-line-statements +add-braces + +style=java +attach-namespaces +attach-classes +attach-inlines +attach-extern-c +indent-modifiers +indent-namespaces +indent-labels +#indent-preproc-block +#indent-preproc-define +#indent-preproc-cond +unpad-paren +add-braces +remove-comment-prefix \ No newline at end of file diff --git a/tests/build.sh b/tests/build.sh new file mode 100755 index 00000000..45f88e7e --- /dev/null +++ b/tests/build.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +cache_dir=$(mktemp -d) + +source "$TRAVIS_BUILD_DIR"/tests/common.sh + +if [ -z "$BUILD_PARITY" ]; then + mod=1 + rem=0 +elif [ "$BUILD_PARITY" = "even" ]; then + mod=2 + rem=0 +elif [ "$BUILD_PARITY" = "odd" ]; then + mod=2 + rem=1 +fi + +install_arduino nodebug +build_sketches_with_arduino "$mod" "$rem" lm2f + +rm -rf "$cache_dir" + diff --git a/tests/ci/build_boards.sh b/tests/ci/build_boards.sh new file mode 100755 index 00000000..a263bdad --- /dev/null +++ b/tests/ci/build_boards.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# +# CI job which checks that boards.txt and package_esp8266com_index.template.json are up to date + +set -ev + +cd $TRAVIS_BUILD_DIR + +tools/boards.txt.py --boardsgen --ldgen --packagegen --docgen + +git diff --exit-code -- boards.txt \ + doc/boards.rst \ + tools/sdk/ld/ +git diff --exit-code -w -- package/package_esp8266com_index.template.json diff --git a/tests/ci/build_docs.sh b/tests/ci/build_docs.sh new file mode 100755 index 00000000..31db9f8f --- /dev/null +++ b/tests/ci/build_docs.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# +# CI job to run the documentation build + +set -ev + +cd $TRAVIS_BUILD_DIR/doc + +SPHINXOPTS="-W" make html diff --git a/tests/ci/build_package.sh b/tests/ci/build_package.sh new file mode 100755 index 00000000..11e9acf6 --- /dev/null +++ b/tests/ci/build_package.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# +# CI job which builds the boards manager package + +set -ev + +export PKG_URL=https://github.com/esp8266/Arduino/releases/download/$TRAVIS_TAG/esp8266-$TRAVIS_TAG.zip +export DOC_URL=https://arduino-esp8266.readthedocs.io/en/$TRAVIS_TAG/ + +if [ -z "$CI_GITHUB_API_KEY" ]; then + echo "Github API key not set. Skip building the package." + exit 0 +fi + +cd $TRAVIS_BUILD_DIR/package +./build_boards_manager_package.sh diff --git a/tests/ci/host_test.sh b/tests/ci/host_test.sh new file mode 100755 index 00000000..ef143f90 --- /dev/null +++ b/tests/ci/host_test.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# CI job for running tests on the host + +set -ev + +cd $TRAVIS_BUILD_DIR/tests/host + + +make -j2 FORCE32=0 ssl +for i in ../../libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient \ + ../../libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation \ + ../../libraries/ESP8266WebServer/examples/HelloServer/HelloServer \ + ../../libraries/SD/examples/Files/Files \ + ../../libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp \ + ../../libraries/LittleFS/examples/SpeedTest/SpeedTest ; do + make -j2 D=1 FORCE32=0 $i + valgrind --leak-check=full --track-origins=yes --error-limit=no --show-leak-kinds=all --error-exitcode=999 bin/$(basename $i)/$(basename $i) -1 +done + +make -j2 CI + +make clean-objects diff --git a/tests/ci/pkgrefs_test.sh b/tests/ci/pkgrefs_test.sh new file mode 100755 index 00000000..ea4f1c23 --- /dev/null +++ b/tests/ci/pkgrefs_test.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -ev + +fail=0 +for i in $(cat "$TRAVIS_BUILD_DIR/package/package_esp8266com_index.template.json" | jq '.packages[0]."tools" | .[] | .systems[] | "\(.url) \(.checksum)"' | sort -u | sed 's/ /@/'); do + url=$(echo $i | sed 's/@/ /' | cut -f2 -d\" | cut -f1 -d' ') + sha=$(echo $i | sed 's/@/ /' | cut -f2 -d\" | cut -f2 -d' ' | cut -f2 -d:) + echo "INFO: Checking $url" + rm -f file.bin + wget --quiet -O file.bin $url + calc=$(sha256sum file.bin | cut -f1 -d" ") + if [ "$sha" != "$calc" ]; then + echo "ERROR: Download failed or SHA mismatch for $url" + echo "ERROR: Expected $sha" + echo "ERROR: Received $calc" + fail=1 + fi +done + +if [ $fail -ne 0 ]; then + echo ERROR: Package file integrity check failed + exit 1 +fi diff --git a/tests/ci/style_check.sh b/tests/ci/style_check.sh new file mode 100755 index 00000000..609b7e45 --- /dev/null +++ b/tests/ci/style_check.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# +# CI job for checking examples style + +set -ev + +org=$(cd ${0%/*}; pwd) +${org}/../restyle.sh + +# Revert changes which astyle might have done to the submodules, +# as we don't want to fail the build because of the 3rd party libraries +git --version || true +git submodule foreach --recursive 'git reset --hard' + +git diff --exit-code -- $TRAVIS_BUILD_DIR diff --git a/tests/common.sh b/tests/common.sh new file mode 100755 index 00000000..a99ff6a9 --- /dev/null +++ b/tests/common.sh @@ -0,0 +1,256 @@ +#!/usr/bin/env bash + +# return 1 if this test should not be built in CI (for other archs, not needed, etc.) +function skip_ino() +{ + local ino=$1 + local skiplist="" + # Add items to the following list with "\n" netween them to skip running. No spaces, tabs, etc. allowed + read -d '' skiplist << EOL || true +/#attic/ +/AvrAdcLogger/ +/BackwardCompatibility/ +/examplesV1/ +/ExFatFormatter/ +/ExFatLogger/ +/ExFatUnicodeTest/ +/RtcTimestampTest/ +/SoftwareSpi/ +/STM32Test/ +/TeensyRtcTimestamp/ +/TeensySdioDemo/ +/UserChipSelectFunction/ +/UserSPIDriver/ +EOL + echo $ino | grep -q -F "$skiplist" + echo $(( 1 - $? )) +} + +function print_size_info() +{ + elf_file=$1 + + if [ -z "$elf_file" ]; then + printf "sketch data rodata bss text irom0.text dram flash\n" + return 0 + fi + + elf_name=$(basename $elf_file) + sketch_name="${elf_name%.*}" + # echo $sketch_name + xtensa-lx106-elf-size --format=sysv $elf_file | sed s/irom0.text/irom0text/g > size.txt + declare -A segments + for seg in data rodata bss text irom0text; do + segments[$seg]=$(grep ^.$seg size.txt | awk '{sum += $2} END {print sum}') + done + + total_ram=$((${segments[data]} + ${segments[rodata]} + ${segments[bss]})) + total_flash=$((${segments[data]} + ${segments[rodata]} + ${segments[text]} + ${segments[irom0text]})) + + printf "%-28s %-8d %-8d %-8d %-8d %-8d %-8d %-8d\n" $sketch_name ${segments[data]} ${segments[rodata]} ${segments[bss]} ${segments[text]} ${segments[irom0text]} $total_ram $total_flash + return 0 +} + +function build_sketches() +{ + set +e + local arduino=$1 + local srcpath=$2 + local build_arg=$3 + local build_dir=build.tmp + local build_mod=$4 + local build_rem=$5 + local lwip=$6 + mkdir -p $build_dir + local build_cmd="python3 tools/build.py -b generic -v -w all -s 4M1M -v -k --build_cache $cache_dir -p ./$build_dir -n $lwip $build_arg " + if [ "$WINDOWS" = "1" ]; then + # Paths to the arduino builder need to be / referenced, not our native ones + build_cmd=$(echo $build_cmd --ide_path $arduino | sed 's/ \/c\// \//g' ) # replace '/c/' with '/' + fi + local sketches=$(find $srcpath -name *.ino | sort) + print_size_info >size.log + export ARDUINO_IDE_PATH=$arduino + local testcnt=0 + for sketch in $sketches; do + testcnt=$(( ($testcnt + 1) % $build_mod )) + if [ $testcnt -ne $build_rem ]; then + continue # Not ours to do + fi + + if [ -e $cache_dir/core/*.a ]; then + # We need to preserve the build.options.json file and replace the last .ino + # with this sketch's ino file, or builder will throw everything away. + jq '."sketchLocation" = "'$sketch'"' $build_dir/build.options.json > $build_dir/build.options.json.tmp + mv $build_dir/build.options.json.tmp $build_dir/build.options.json + # Set the time of the cached core.a file to the future so the GIT header + # we regen won't cause the builder to throw it out and rebuild from scratch. + touch -d 'now + 1 day' $cache_dir/core/*.a + fi + + # Clear out the last built sketch, map, elf, bin files, but leave the compiled + # objects in the core and libraries available for use so we don't need to rebuild + # them each sketch. + rm -rf $build_dir/sketch $build_dir/*.bin $build_dir/*.map $build_dir/*.elf + + local sketchdir=$(dirname $sketch) + local sketchdirname=$(basename $sketchdir) + local sketchname=$(basename $sketch) + if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then + echo "Skipping $sketch, because it is not the main sketch file"; + continue + fi; + if [[ -f "$sketchdir/.test.skip" ]]; then + echo -e "\n ------------ Skipping $sketch ------------ \n"; + continue + fi + if [[ $(skip_ino $sketch) = 1 ]]; then + echo -e "\n ------------ Skipping $sketch ------------ \n"; + continue + fi + echo -e "\n ------------ Building $sketch ------------ \n"; + # $arduino --verify $sketch; + if [ "$WINDOWS" == "1" ]; then + sketch=$(echo $sketch | sed 's/^\/c//') + # MINGW will try to be helpful and silently convert args that look like paths to point to a spot inside the MinGW dir. This breaks everything. + # http://www.mingw.org/wiki/Posix_path_conversion + # https://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line#34386471 + export MSYS2_ARG_CONV_EXC="*" + export MSYS_NO_PATHCONV=1 + fi + echo "$build_cmd $sketch" + time ($build_cmd $sketch >build.log) + local result=$? + if [ $result -ne 0 ]; then + echo "Build failed ($1)" + echo "Build log:" + cat build.log + set -e + return $result + else + local warns=$( grep -c warning: build.log ) + if [ $warns -ne 0 ]; then + echo "Warnings detected, log follows:" + cat build.log + fi + fi + rm build.log + print_size_info $build_dir/*.elf >>size.log + done + set -e +} + +function install_libraries() +{ + mkdir -p $HOME/Arduino/libraries + pushd $HOME/Arduino/libraries + + # install ArduinoJson library + { test -r ArduinoJson-v6.11.0.zip || curl --output ArduinoJson-v6.11.0.zip -L https://github.com/bblanchon/ArduinoJson/releases/download/v6.11.0/ArduinoJson-v6.11.0.zip; } && unzip -q ArduinoJson-v6.11.0.zip + + popd +} + +function install_ide() +{ + local idever='nightly' + local ideurl='https://www.arduino.cc/download.php?f=/arduino-nightly' + + #local idever='1.8.10' + #local ideurl="https://downloads.arduino.cc/arduino-$idever" + + echo "using Arduino IDE distribution ${idever}" + + local ide_path=$1 + local core_path=$2 + local debug=$3 + mkdir -p ${core_path}/tools/dist + if [ "$WINDOWS" = "1" ]; then + test -r ${core_path}/tools/dist/arduino-windows.zip || curl --output ${core_path}/tools/dist/arduino-windows.zip -L "${ideurl}-windows.zip" + unzip -q ${core_path}/tools/dist/arduino-windows.zip + mv arduino-${idever} arduino-distrib + elif [ "$MACOSX" = "1" ]; then + # MACOS only has next-to-obsolete Python2 installed. Install Python 3 from python.org + wget -q https://www.python.org/ftp/python/3.7.4/python-3.7.4-macosx10.9.pkg + sudo installer -pkg python-3.7.4-macosx10.9.pkg -target / + # Install the Python3 certificates, because SSL connections fail w/o them and of course they aren't installed by default. + ( cd "/Applications/Python 3.7/" && sudo "./Install Certificates.command" ) + # Hack to place arduino-builder in the same spot as sane OSes + test -r ${core_path}/tools/dist/arduino-macos.zip || wget -q -O ${core_path}/tools/dist/arduino-macos.zip "${ideurl}-macosx.zip" + unzip -q ${core_path}/tools/dist/arduino-macos.zip + mv Arduino.app arduino-distrib + mv arduino-distrib/Contents/Java/* arduino-distrib/. + else + test -r ${core_path}/tools/dist/arduino-linux.tar.xz || wget -q -O ${core_path}/tools/dist/arduino-linux.tar.xz "${ideurl}-linux64.tar.xz" + tar xf ${core_path}/tools/dist/arduino-linux.tar.xz + mv arduino-${idever} arduino-distrib + fi + mv arduino-distrib $ide_path + cd $ide_path/hardware + mkdir esp8266com + cd esp8266com + if [ "$WINDOWS" = "1" ]; then + cp -a $core_path esp8266 + else + ln -s $core_path esp8266 + fi + local debug_flags="" + if [ "$debug" = "debug" ]; then + debug_flags="-DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM" + fi + # Set custom warnings for all builds (i.e. could add -Wextra at some point) + echo "compiler.c.extra_flags=-Wall -Wextra -Werror $debug_flags" > esp8266/platform.local.txt + echo "compiler.cpp.extra_flags=-Wall -Wextra -Werror $debug_flags" >> esp8266/platform.local.txt + echo -e "\n----platform.local.txt----" + cat esp8266/platform.local.txt + echo -e "\n----\n" + cd esp8266/tools + python3 get.py -q + if [ "$WINDOWS" = "1" ]; then + # Because the symlinks don't work well under Win32, we need to add the path to this copy, not the original... + relbin=$(realpath $PWD/xtensa-lx106-elf/bin) + export PATH="$ide_path:$relbin:$PATH" + else + export PATH="$ide_path:$core_path/tools/xtensa-lx106-elf/bin:$PATH" + fi +} + +function install_arduino() +{ + local debug=$1 + # Install Arduino IDE and required libraries + echo -e "travis_fold:start:sketch_test_env_prepare" + cd $TRAVIS_BUILD_DIR + install_ide $HOME/arduino_ide $TRAVIS_BUILD_DIR $debug + cd $TRAVIS_BUILD_DIR + install_libraries + echo -e "travis_fold:end:sketch_test_env_prepare" +} + +function build_sketches_with_arduino() +{ + local build_mod=$1 + local build_rem=$2 + local lwip=$3 + + # Compile sketches + echo -e "travis_fold:start:sketch_test" + build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries" $build_mod $build_rem $lwip + echo -e "travis_fold:end:sketch_test" + + # Generate size report + echo -e "travis_fold:start:size_report" + cat size.log + echo -e "travis_fold:end:size_report" +} + + +set -e + +if [ -z "$TRAVIS_BUILD_DIR" ]; then + echo "TRAVIS_BUILD_DIR is not set, trying to guess:" + pushd $(dirname $0)/../ > /dev/null + TRAVIS_BUILD_DIR=$PWD + popd > /dev/null + echo "TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR" +fi + diff --git a/tests/debug.sh b/tests/debug.sh new file mode 100755 index 00000000..bbca35ff --- /dev/null +++ b/tests/debug.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +cache_dir=$(mktemp -d) + +source "$TRAVIS_BUILD_DIR"/tests/common.sh + +if [ "$BUILD_PARITY" = "even" ]; then + mod=2 + rem=0 +elif [ "$BUILD_PARITY" = "odd" ]; then + mod=2 + rem=1 +fi + +install_arduino debug +build_sketches_with_arduino "$mod" "$rem" lm2f + +rm -rf "$cache_dir" diff --git a/tests/restyle-examples-only.sh b/tests/restyle-examples-only.sh new file mode 100755 index 00000000..513a8919 --- /dev/null +++ b/tests/restyle-examples-only.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +org=$(cd ${0%/*}; pwd) +cd ${org}/.. +pwd +test -d cores/esp8266 +test -d libraries + +# in a near future, restyle-all.sh will be renamed to restyle.sh +# and will be checked against CI + +for d in libraries; do + find $d -name "*.ino" -exec \ + astyle \ + --suffix=none \ + --options=${org}/astyle_examples.conf {} \; +done diff --git a/tests/restyle.sh b/tests/restyle.sh new file mode 100755 index 00000000..ea454069 --- /dev/null +++ b/tests/restyle.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +set -e + +org=$(cd ${0%/*}; pwd) +cd ${org}/.. +pwd +test -d cores/esp8266 +test -d libraries + +# should be: all="cores/esp8266 libraries" + +all=" +libraries/ESP8266mDNS +libraries/Wire +libraries/lwIP* +cores/esp8266/Lwip* +cores/esp8266/debug* +cores/esp8266/core_esp8266_si2c.cpp +cores/esp8266/StreamString.* +cores/esp8266/StreamSend.* +libraries/Netdump +" + +# core + +for d in $all; do + if [ -d "$d" ]; then + echo "-------- directory $d:" + for e in c cpp h; do + find $d -name "*.$e" -exec \ + astyle \ + --suffix=none \ + --options=${org}/astyle_core.conf {} \; + done + else + echo "-------- file $d:" + astyle --suffix=none --options=${org}/astyle_core.conf "$d" + fi +done + +# examples + +for d in libraries; do + echo "-------- examples in $d:" + find $d -name "*.ino" -exec \ + astyle \ + --suffix=none \ + --options=${org}/astyle_examples.conf {} \; +done diff --git a/tests/run_CI_locally.sh b/tests/run_CI_locally.sh new file mode 100755 index 00000000..6d0a9709 --- /dev/null +++ b/tests/run_CI_locally.sh @@ -0,0 +1,124 @@ +#!/bin/sh + +# temporary directory + +[ -z "${TMPCI}" ] && TMPCI=/tmp/ci + +################## + +set -e + +TMPDIR=${TMPCI%/*} +CIDIR=${TMPCI##*/} + +mkdir -p ${TMPDIR} + +# set root directory into $ESP +ESP="$(cd ${0%/*}/..; pwd)" +branch=$(git rev-parse --abbrev-ref HEAD) + +echo "" +echo " -- CI directory: ${TMPCI} --" +echo "" +echo "Ensure your changes are committed in current branch ${branch}" +echo "" +echo "press return to run 'git diff'" +read junk +git diff +echo "press return to run CI, or ^C" +read junk + +# clone or update this repository into ${TMPDIR}/${CIDIR} +if [ -d ${TMPCI} ]; then + echo "" + echo " -- updating CI directory in ${TMPCI} --" + echo "" + (cd ${TMPCI}; git checkout master; git branch -D ${branch} || true; git checkout -b ${branch}; git pull origin ${branch}) +else + echo "" + echo " -- installing CI directory in ${TMPCI} --" + echo "" + (cd ${TMPDIR}; git clone ${ESP} ${CIDIR}) +fi + +cd ${TMPCI} +if [ "$branch" != "$branch" ]; then + echo "branch ${cibranch} in ${TMPCI} not matching branch ${branch} in ${ESP}" + exit 1 +fi +rm -rf arduino_ide arduino-nightly Arduino/libraries/ArduinoJson + +while true; do + + cat << EOF +Which build? +1. main +2. main + IPv6 +4. debug even +5. debug odd +6. platformio +7. package +8. host +9. style +EOF + + read ans + + BUILD_TYPE="" + case "$ans" in + 1) BUILD_TYPE=build;; + 2) BUILD_TYPE=build6;; + 4) BUILD_TYPE=debug_even;; + 5) BUILD_TYPE=debug_odd;; + 6) BUILD_TYPE=platformio;; + 7) BUILD_TYPE=package;; + 8) BUILD_TYPE=host;; + 9) BUILD_TYPE=style;; + esac + test -z "$BUILD_TYPE" || break +done + + +git submodule update --init + +export HOME="${TMPCI}" +export TRAVIS_BUILD_DIR="${TMPCI}" +export BUILD_TYPE="$BUILD_TYPE" + +if [ "$BUILD_TYPE" = "build" ]; then + tests/build.sh +elif [ "$BUILD_TYPE" = "build_even" ]; then + BUILD_PARITY=even tests/build.sh +elif [ "$BUILD_TYPE" = "build_odd" ]; then + BUILD_PARITY=odd tests/build.sh + +elif [ "$BUILD_TYPE" = "debug_even" ]; then + BUILD_PARITY=even tests/debug.sh +elif [ "$BUILD_TYPE" = "debug_odd" ]; then + BUILD_PARITY=odd tests/debug.sh + +elif [ "$BUILD_TYPE" = "build6" ]; then + tests/build6.sh +elif [ "$BUILD_TYPE" = "build6_even" ]; then + BUILD_PARITY=even tests/build6.sh +elif [ "$BUILD_TYPE" = "build6_odd" ]; then + BUILD_PARITY=odd tests/build6.sh + +elif [ "$BUILD_TYPE" = "platformio" ]; then + tests/platformio.sh +elif [ "$BUILD_TYPE" = "platformio_even" ]; then + BUILD_PARITY=even tests/platformio.sh +elif [ "$BUILD_TYPE" = "platformio_odd" ]; then + BUILD_PARITY=odd tests/platformio.sh + +elif [ "$BUILD_TYPE" = host ]; then + tests/ci/host_test.sh + +elif [ "$BUILD_TYPE" = style ]; then + tests/ci/install_astyle.sh + +else + echo "BUILD_TYPE not set or invalid" + exit 1 +fi + -- 2.54.0 From 778c3f3b7664fd9227f8d52085a0adf48e594d61 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Thu, 20 May 2021 17:20:10 -0700 Subject: [PATCH 02/17] Add build.py --- tests/run_CI_locally.sh | 4 +- tools/build.py | 173 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+), 2 deletions(-) create mode 100755 tools/build.py diff --git a/tests/run_CI_locally.sh b/tests/run_CI_locally.sh index 6d0a9709..df2d7018 100755 --- a/tests/run_CI_locally.sh +++ b/tests/run_CI_locally.sh @@ -62,10 +62,10 @@ Which build? 9. style EOF - read ans + read answer BUILD_TYPE="" - case "$ans" in + case "$answer" in 1) BUILD_TYPE=build;; 2) BUILD_TYPE=build6;; 4) BUILD_TYPE=debug_even;; diff --git a/tools/build.py b/tools/build.py new file mode 100755 index 00000000..c9aa0c6d --- /dev/null +++ b/tools/build.py @@ -0,0 +1,173 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# build.py — build a sketch using arduino-builder +# +# Wrapper script around arduino-builder which accepts some ESP8266-specific +# options and translates them into FQBN +# +# Copyright © 2016 Ivan Grokhotkov +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# + +from __future__ import print_function +import sys +import os +import argparse +import platform +import subprocess +import tempfile +import shutil + + +# Arduino-builder needs forward-slash paths for passed in params or it cannot +# launch the needed toolset. +def windowsize_paths(l): + """Convert forward-slash paths to backslash paths referenced from C:""" + out = [] + for i in l: + if i.startswith('/'): + i = 'C:' + i + out += [i.replace('/', '\\')] + return out + +def compile(tmp_dir, sketch, cache, tools_dir, hardware_dir, ide_path, f, args): + cmd = [] + cmd += [ide_path + '/arduino-builder'] + cmd += ['-compile', '-logger=human'] + cmd += ['-build-path', tmp_dir] + cmd += ['-tools', ide_path + '/tools-builder'] + if cache != "": + cmd += ['-build-cache', cache ] + if args.library_path: + for lib_dir in args.library_path: + cmd += ['-libraries', lib_dir] + cmd += ['-hardware', ide_path + '/hardware'] + if args.hardware_dir: + for hw_dir in args.hardware_dir: + cmd += ['-hardware', hw_dir] + else: + cmd += ['-hardware', hardware_dir] + # Debug=Serial,DebugLevel=Core____ + fqbn = '-fqbn=rp2040:rp2040:rpipico:' \ + 'xtal={cpu_freq},' \ + 'FlashFreq={flash_freq},' \ + 'FlashMode={flash_mode},' \ + 'baud=921600,' \ + 'eesz={flash_size},' \ + 'ip={lwIP},' \ + 'ResetMethod=nodemcu'.format(**vars(args)) + if args.debug_port and args.debug_level: + fqbn += 'dbg={debug_port},lvl={debug_level}'.format(**vars(args)) + if args.waveform_phase: + fqbn += ',waveform=phase' + cmd += [fqbn] + cmd += ['-built-in-libraries', ide_path + '/libraries'] + cmd += ['-ide-version=10607'] + cmd += ['-warnings={warnings}'.format(**vars(args))] + if args.verbose: + cmd += ['-verbose'] + cmd += [sketch] + + if platform.system() == "Windows": + cmd = windowsize_paths(cmd) + + if args.verbose: + print('Building: ' + " ".join(cmd), file=f) + + p = subprocess.Popen(cmd, stdout=f, stderr=subprocess.STDOUT) + p.wait() + return p.returncode + +def parse_args(): + parser = argparse.ArgumentParser(description='Sketch build helper') + parser.add_argument('-v', '--verbose', help='Enable verbose output', + action='store_true') + parser.add_argument('-i', '--ide_path', help='Arduino IDE path') + parser.add_argument('-p', '--build_path', help='Build directory') + parser.add_argument('-l', '--library_path', help='Additional library path', + action='append') + parser.add_argument('-d', '--hardware_dir', help='Additional hardware path', + action='append') + parser.add_argument('-b', '--board_name', help='Board name', default='generic') + parser.add_argument('-s', '--flash_size', help='Flash size', default='512K64', + choices=['512K0', '512K64', '1M512', '4M1M', '4M3M']) + parser.add_argument('-f', '--cpu_freq', help='CPU frequency', default=80, + choices=[80, 160], type=int) + parser.add_argument('-m', '--flash_mode', help='Flash mode', default='qio', + choices=['dio', 'qio']) + parser.add_argument('-n', '--lwIP', help='lwIP version', default='lm2f', + choices=['lm2f', 'hb2f', 'lm6f', 'hb6f', 'hb1']) + parser.add_argument('-w', '--warnings', help='Compilation warnings level', + default='none', choices=['none', 'all', 'more']) + parser.add_argument('-o', '--output_binary', help='File name for output binary') + parser.add_argument('-k', '--keep', action='store_true', + help='Don\'t delete temporary build directory') + parser.add_argument('--flash_freq', help='Flash frequency', default=40, + type=int, choices=[40, 80]) + parser.add_argument('--debug_port', help='Debug port', + choices=['Serial', 'Serial1']) + parser.add_argument('--waveform_phase', action='store_true', + help='Select waveform locked on phase') + parser.add_argument('--debug_level', help='Debug level') + parser.add_argument('--build_cache', help='Build directory to cache core.a', default='') + parser.add_argument('sketch_path', help='Sketch file path') + return parser.parse_args() + +def main(): + args = parse_args() + + ide_path = args.ide_path + if not ide_path: + ide_path = os.environ.get('ARDUINO_IDE_PATH') + if not ide_path: + print("Please specify Arduino IDE path via --ide_path option" + "or ARDUINO_IDE_PATH environment variable.", file=sys.stderr) + return 2 + + sketch_path = args.sketch_path + tmp_dir = args.build_path + created_tmp_dir = False + if not tmp_dir: + tmp_dir = tempfile.mkdtemp() + created_tmp_dir = True + + tools_dir = os.path.dirname(os.path.realpath(__file__)) + '/../tools' + # this is not the correct hardware folder to add. + hardware_dir = os.path.dirname(os.path.realpath(__file__)) + '/../cores' + + output_name = tmp_dir + '/' + os.path.basename(sketch_path) + '.bin' + + if args.verbose: + print("Sketch: ", sketch_path) + print("Build dir: ", tmp_dir) + print("Cache dir: ", args.build_cache) + print("Output: ", output_name) + + if args.verbose: + f = sys.stdout + else: + f = open(tmp_dir + '/build.log', 'w') + + res = compile(tmp_dir, sketch_path, args.build_cache, tools_dir, hardware_dir, ide_path, f, args) + if res != 0: + return res + + if args.output_binary is not None: + shutil.copy(output_name, args.output_binary) + + if created_tmp_dir and not args.keep: + shutil.rmtree(tmp_dir, ignore_errors=True) + +if __name__ == '__main__': + sys.exit(main()) -- 2.54.0 From b16b51d52997603d85a161659a8d6593ea840eb5 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 21 May 2021 10:16:55 -0700 Subject: [PATCH 03/17] Fix FQBN --- tools/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build.py b/tools/build.py index c9aa0c6d..14d18045 100755 --- a/tools/build.py +++ b/tools/build.py @@ -59,7 +59,7 @@ def compile(tmp_dir, sketch, cache, tools_dir, hardware_dir, ide_path, f, args): else: cmd += ['-hardware', hardware_dir] # Debug=Serial,DebugLevel=Core____ - fqbn = '-fqbn=rp2040:rp2040:rpipico:' \ + fqbn = '-fqbn=pico:rp2040:rpipico:' \ 'xtal={cpu_freq},' \ 'FlashFreq={flash_freq},' \ 'FlashMode={flash_mode},' \ -- 2.54.0 From a55fac8c8261cb0a2274e5d4592ef2a665f001df Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 21 May 2021 13:40:02 -0700 Subject: [PATCH 04/17] Typo fix in docs --- docs/install.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/install.rst b/docs/install.rst index 488b53d7..9f40457c 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -1,5 +1,5 @@ -Intallation -=========== +Installation +============ The Arduino-Pico core can be installed using the Arduino IDE Boards Manager or using `git`. If you want to simply write programs for your RP2040 board, -- 2.54.0 From 10a44c83f1a894b4bd0f76710e04140e4683e9b6 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 21 May 2021 15:32:31 -0700 Subject: [PATCH 05/17] Add quasi-sane abs() implementation to Arduino.h (#157) As mentioned in https://github.com/earlephilhower/arduino-pico/discussions/156#discussion-3376456 --- cores/rp2040/Arduino.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cores/rp2040/Arduino.h b/cores/rp2040/Arduino.h index 28f82484..5c6ca538 100644 --- a/cores/rp2040/Arduino.h +++ b/cores/rp2040/Arduino.h @@ -36,6 +36,18 @@ #include "debug_internal.h" +// Try and make the best of the old Arduino abs() macro. When in C++, use +// the sane std::abs() call, but for C code use their macro since stdlib abs() +// is int but their macro "works" for everything (with potential side effects) +#ifdef abs +#undef abs +#endif // abs +#ifdef __cplusplus +using std::abs; +#else +#define abs(x) ((x)>0?(x):-(x)) +#endif + #ifdef __cplusplus extern "C"{ #endif // __cplusplus -- 2.54.0 From 32e4022acabb33d33df01772ca1d8812309dc793 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 21 May 2021 15:51:58 -0700 Subject: [PATCH 06/17] Update CI hardware directory --- tests/common.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/common.sh b/tests/common.sh index a99ff6a9..09dd2707 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -186,24 +186,24 @@ function install_ide() fi mv arduino-distrib $ide_path cd $ide_path/hardware - mkdir esp8266com - cd esp8266com + mkdir pico + cd pico if [ "$WINDOWS" = "1" ]; then - cp -a $core_path esp8266 + cp -a $core_path rp2040 else - ln -s $core_path esp8266 + ln -s $core_path rp2040 fi local debug_flags="" if [ "$debug" = "debug" ]; then - debug_flags="-DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM" + debug_flags="-DDEBUG_RP2040_WIRE -DDEBUG_RP2040_SPI -DDEBUG_RP2040_CORE -DDEBUG_RP2040_PORT=Serial" fi # Set custom warnings for all builds (i.e. could add -Wextra at some point) - echo "compiler.c.extra_flags=-Wall -Wextra -Werror $debug_flags" > esp8266/platform.local.txt - echo "compiler.cpp.extra_flags=-Wall -Wextra -Werror $debug_flags" >> esp8266/platform.local.txt + echo "compiler.c.extra_flags=-Wall -Wextra -Werror $debug_flags" > rp2040/platform.local.txt + echo "compiler.cpp.extra_flags=-Wall -Wextra -Werror $debug_flags" >> rp2040/platform.local.txt echo -e "\n----platform.local.txt----" - cat esp8266/platform.local.txt + cat rp2040/platform.local.txt echo -e "\n----\n" - cd esp8266/tools + cd rp2040/tools python3 get.py -q if [ "$WINDOWS" = "1" ]; then # Because the symlinks don't work well under Win32, we need to add the path to this copy, not the original... -- 2.54.0 From b1290ffb64888279a3cda576f50882438e790993 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 21 May 2021 16:16:36 -0700 Subject: [PATCH 07/17] Clean up build.py script --- tests/build.sh | 2 +- tests/common.sh | 6 ++---- tools/build.py | 37 +++++++++++-------------------------- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/tests/build.sh b/tests/build.sh index 45f88e7e..264e27d3 100755 --- a/tests/build.sh +++ b/tests/build.sh @@ -16,7 +16,7 @@ elif [ "$BUILD_PARITY" = "odd" ]; then fi install_arduino nodebug -build_sketches_with_arduino "$mod" "$rem" lm2f +build_sketches_with_arduino "$mod" "$rem" rm -rf "$cache_dir" diff --git a/tests/common.sh b/tests/common.sh index 09dd2707..f69b48e4 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -60,9 +60,8 @@ function build_sketches() local build_dir=build.tmp local build_mod=$4 local build_rem=$5 - local lwip=$6 mkdir -p $build_dir - local build_cmd="python3 tools/build.py -b generic -v -w all -s 4M1M -v -k --build_cache $cache_dir -p ./$build_dir -n $lwip $build_arg " + local build_cmd="python3 tools/build.py -b generic -v -w all -v -k --build_cache $cache_dir -p ./$build_dir -n $build_arg " if [ "$WINDOWS" = "1" ]; then # Paths to the arduino builder need to be / referenced, not our native ones build_cmd=$(echo $build_cmd --ide_path $arduino | sed 's/ \/c\// \//g' ) # replace '/c/' with '/' @@ -230,11 +229,10 @@ function build_sketches_with_arduino() { local build_mod=$1 local build_rem=$2 - local lwip=$3 # Compile sketches echo -e "travis_fold:start:sketch_test" - build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries" $build_mod $build_rem $lwip + build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries" $build_mod $build_rem echo -e "travis_fold:end:sketch_test" # Generate size report diff --git a/tools/build.py b/tools/build.py index 14d18045..70a2b268 100755 --- a/tools/build.py +++ b/tools/build.py @@ -60,17 +60,11 @@ def compile(tmp_dir, sketch, cache, tools_dir, hardware_dir, ide_path, f, args): cmd += ['-hardware', hardware_dir] # Debug=Serial,DebugLevel=Core____ fqbn = '-fqbn=pico:rp2040:rpipico:' \ - 'xtal={cpu_freq},' \ - 'FlashFreq={flash_freq},' \ - 'FlashMode={flash_mode},' \ - 'baud=921600,' \ - 'eesz={flash_size},' \ - 'ip={lwIP},' \ - 'ResetMethod=nodemcu'.format(**vars(args)) - if args.debug_port and args.debug_level: - fqbn += 'dbg={debug_port},lvl={debug_level}'.format(**vars(args)) - if args.waveform_phase: - fqbn += ',waveform=phase' + 'flash=2097152_65536,' \ + 'freq={freq},' \ + 'dbgport={dbgport},' \ + 'dbglvl={dbglvl},' \ + 'usbstack={usbstack}'.format(**vars(args)) cmd += [fqbn] cmd += ['-built-in-libraries', ide_path + '/libraries'] cmd += ['-ide-version=10607'] @@ -100,26 +94,17 @@ def parse_args(): parser.add_argument('-d', '--hardware_dir', help='Additional hardware path', action='append') parser.add_argument('-b', '--board_name', help='Board name', default='generic') - parser.add_argument('-s', '--flash_size', help='Flash size', default='512K64', - choices=['512K0', '512K64', '1M512', '4M1M', '4M3M']) - parser.add_argument('-f', '--cpu_freq', help='CPU frequency', default=80, - choices=[80, 160], type=int) - parser.add_argument('-m', '--flash_mode', help='Flash mode', default='qio', - choices=['dio', 'qio']) - parser.add_argument('-n', '--lwIP', help='lwIP version', default='lm2f', - choices=['lm2f', 'hb2f', 'lm6f', 'hb6f', 'hb1']) + parser.add_argument('-f', '--freq', help='CPU frequency', default=133, + choices=[50, 125, 133], type=int) parser.add_argument('-w', '--warnings', help='Compilation warnings level', default='none', choices=['none', 'all', 'more']) parser.add_argument('-o', '--output_binary', help='File name for output binary') parser.add_argument('-k', '--keep', action='store_true', help='Don\'t delete temporary build directory') - parser.add_argument('--flash_freq', help='Flash frequency', default=40, - type=int, choices=[40, 80]) - parser.add_argument('--debug_port', help='Debug port', - choices=['Serial', 'Serial1']) - parser.add_argument('--waveform_phase', action='store_true', - help='Select waveform locked on phase') - parser.add_argument('--debug_level', help='Debug level') + parser.add_argument('--dbgport', help='Debug port', + choices=['Disabled', 'Serial', 'Serial1']) + parser.add_argument('--dbglvl', help='Debug level', + choices=['None', 'All']) parser.add_argument('--build_cache', help='Build directory to cache core.a', default='') parser.add_argument('sketch_path', help='Sketch file path') return parser.parse_args() -- 2.54.0 From d8279c67825aede25eceb3af433a2987b3a7f9fb Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 21 May 2021 18:13:29 -0700 Subject: [PATCH 08/17] More Ci tweak --- cores/rp2040/SerialUSB.h | 2 +- tests/common.sh | 2 +- tools/build.py | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cores/rp2040/SerialUSB.h b/cores/rp2040/SerialUSB.h index 5dec8e8c..c3d0ea56 100644 --- a/cores/rp2040/SerialUSB.h +++ b/cores/rp2040/SerialUSB.h @@ -29,7 +29,7 @@ class SerialUSB : public HardwareSerial { public: SerialUSB() { } void begin(unsigned long baud = 115200) override; - void begin(unsigned long baud, uint16_t config) override { begin(baud); }; + void begin(unsigned long baud, uint16_t config) override { (void) config; begin(baud); }; void end() override; virtual int peek() override; diff --git a/tests/common.sh b/tests/common.sh index f69b48e4..776ef64c 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -61,7 +61,7 @@ function build_sketches() local build_mod=$4 local build_rem=$5 mkdir -p $build_dir - local build_cmd="python3 tools/build.py -b generic -v -w all -v -k --build_cache $cache_dir -p ./$build_dir -n $build_arg " + local build_cmd="python3 tools/build.py -b generic -v -w all -v -k --build_cache $cache_dir -p ./$build_dir $build_arg " if [ "$WINDOWS" = "1" ]; then # Paths to the arduino builder need to be / referenced, not our native ones build_cmd=$(echo $build_cmd --ide_path $arduino | sed 's/ \/c\// \//g' ) # replace '/c/' with '/' diff --git a/tools/build.py b/tools/build.py index 70a2b268..19e8f239 100755 --- a/tools/build.py +++ b/tools/build.py @@ -101,10 +101,12 @@ def parse_args(): parser.add_argument('-o', '--output_binary', help='File name for output binary') parser.add_argument('-k', '--keep', action='store_true', help='Don\'t delete temporary build directory') - parser.add_argument('--dbgport', help='Debug port', + parser.add_argument('--dbgport', help='Debug port', default='Disabled', choices=['Disabled', 'Serial', 'Serial1']) - parser.add_argument('--dbglvl', help='Debug level', + parser.add_argument('--dbglvl', help='Debug level', default='None', choices=['None', 'All']) + parser.add_argument('--usbstack', help='USB stack', default='picosdk', + choices=['picosdk', 'tinyusb']) parser.add_argument('--build_cache', help='Build directory to cache core.a', default='') parser.add_argument('sketch_path', help='Sketch file path') return parser.parse_args() -- 2.54.0 From 129337135dacfd9df74a1398924a7aef23ea44d9 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 22 May 2021 01:58:24 -0700 Subject: [PATCH 09/17] Use ARM toolchain --- tests/common.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/common.sh b/tests/common.sh index 776ef64c..4feaeda1 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -21,6 +21,7 @@ function skip_ino() /TeensySdioDemo/ /UserChipSelectFunction/ /UserSPIDriver/ +/Adafruit_TinyUSB_Arduino/ EOL echo $ino | grep -q -F "$skiplist" echo $(( 1 - $? )) @@ -38,7 +39,7 @@ function print_size_info() elf_name=$(basename $elf_file) sketch_name="${elf_name%.*}" # echo $sketch_name - xtensa-lx106-elf-size --format=sysv $elf_file | sed s/irom0.text/irom0text/g > size.txt + arm-none-eabi-size --format=sysv $elf_file | sed s/irom0.text/irom0text/g > size.txt declare -A segments for seg in data rodata bss text irom0text; do segments[$seg]=$(grep ^.$seg size.txt | awk '{sum += $2} END {print sum}') @@ -206,10 +207,10 @@ function install_ide() python3 get.py -q if [ "$WINDOWS" = "1" ]; then # Because the symlinks don't work well under Win32, we need to add the path to this copy, not the original... - relbin=$(realpath $PWD/xtensa-lx106-elf/bin) + relbin=$(realpath $PWD/../system/arm-none-eabi/bin) export PATH="$ide_path:$relbin:$PATH" else - export PATH="$ide_path:$core_path/tools/xtensa-lx106-elf/bin:$PATH" + export PATH="$ide_path:$core_path/system/arm-none-eabi/bin:$PATH" fi } -- 2.54.0 From eaaee9db4d48de40b95e4e3ed333e32f798e2730 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 22 May 2021 02:07:57 -0700 Subject: [PATCH 10/17] Avoid SDK errors --- tests/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/common.sh b/tests/common.sh index 4feaeda1..93ea62be 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -198,8 +198,8 @@ function install_ide() debug_flags="-DDEBUG_RP2040_WIRE -DDEBUG_RP2040_SPI -DDEBUG_RP2040_CORE -DDEBUG_RP2040_PORT=Serial" fi # Set custom warnings for all builds (i.e. could add -Wextra at some point) - echo "compiler.c.extra_flags=-Wall -Wextra -Werror $debug_flags" > rp2040/platform.local.txt - echo "compiler.cpp.extra_flags=-Wall -Wextra -Werror $debug_flags" >> rp2040/platform.local.txt + echo "compiler.c.extra_flags=-Wall -Wextra -Werror -Wno-ignored-qualifiers $debug_flags" > rp2040/platform.local.txt + echo "compiler.cpp.extra_flags=-Wall -Wextra -Werror -Wno-ignored-qualifiers $debug_flags" >> rp2040/platform.local.txt echo -e "\n----platform.local.txt----" cat rp2040/platform.local.txt echo -e "\n----\n" -- 2.54.0 From 2e16b0e0326f23472fb7f96b61178ec849be58c7 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 22 May 2021 02:13:46 -0700 Subject: [PATCH 11/17] Update sub-sub modules --- tests/run_CI_locally.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/run_CI_locally.sh b/tests/run_CI_locally.sh index df2d7018..a2c1fb5a 100755 --- a/tests/run_CI_locally.sh +++ b/tests/run_CI_locally.sh @@ -80,6 +80,8 @@ done git submodule update --init +(cd pico-sdk && git submodule update --init) +(cd pico-extras && git submodule update --init) export HOME="${TMPCI}" export TRAVIS_BUILD_DIR="${TMPCI}" -- 2.54.0 From e078c031cadb61018f07b4189053a00438f23941 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 22 May 2021 02:25:20 -0700 Subject: [PATCH 12/17] Clean up CI detected warnings --- cores/rp2040/RP2040USB.cpp | 2 +- cores/rp2040/SerialUSB.cpp | 4 ++- cores/rp2040/Tone.cpp | 4 +-- cores/rp2040/posix.cpp | 43 +++++++++++++++++++++++++++++++-- cores/rp2040/wiring_analog.cpp | 7 +++--- cores/rp2040/wiring_digital.cpp | 7 +++--- cores/rp2040/wiring_private.cpp | 1 + cores/rp2040/wiring_pulse.cpp | 2 +- cores/rp2040/wiring_shift.cpp | 20 ++++++++------- tests/common.sh | 6 ++--- 10 files changed, 69 insertions(+), 27 deletions(-) diff --git a/cores/rp2040/RP2040USB.cpp b/cores/rp2040/RP2040USB.cpp index 716ec36a..25f5b748 100644 --- a/cores/rp2040/RP2040USB.cpp +++ b/cores/rp2040/RP2040USB.cpp @@ -161,7 +161,6 @@ uint8_t const * tud_hid_descriptor_report_cb(void) const uint8_t *tud_descriptor_configuration_cb(uint8_t index) { (void)index; - int len = 0; static uint8_t *usbd_desc_cfg; if (!usbd_desc_cfg) { @@ -217,6 +216,7 @@ const uint8_t *tud_descriptor_configuration_cb(uint8_t index) { } const uint16_t *tud_descriptor_string_cb(uint8_t index, uint16_t langid) { + (void) langid; #define DESC_STR_MAX (20) static uint16_t desc_str[DESC_STR_MAX]; diff --git a/cores/rp2040/SerialUSB.cpp b/cores/rp2040/SerialUSB.cpp index 7cc64571..4f38529e 100644 --- a/cores/rp2040/SerialUSB.cpp +++ b/cores/rp2040/SerialUSB.cpp @@ -125,7 +125,7 @@ size_t SerialUSB::write(const uint8_t *buf, size_t length) { static uint64_t last_avail_time; int i = 0; if (tud_cdc_connected()) { - for (int i = 0; i < length;) { + for (size_t i = 0; i < length;) { int n = length - i; int avail = tud_cdc_write_available(); if (n > avail) n = avail; @@ -173,12 +173,14 @@ static void CheckSerialReset() { } extern "C" void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) { + (void) itf; _dtr = dtr ? true : false; _rts = rts ? true : false; CheckSerialReset(); } extern "C" void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const* p_line_coding) { + (void) itf; _bps = p_line_coding->bit_rate; CheckSerialReset(); } diff --git a/cores/rp2040/Tone.cpp b/cores/rp2040/Tone.cpp index 0210ab49..f76fd0f2 100644 --- a/cores/rp2040/Tone.cpp +++ b/cores/rp2040/Tone.cpp @@ -39,7 +39,7 @@ static PIOProgram _tonePgm(&tone_program); static std::map _toneMap; void tone(uint8_t pin, unsigned int frequency, unsigned long duration) { - if ((pin < 0) || (pin > 29)) { + if (pin > 29) { DEBUGCORE("ERROR: Illegal pin in tone (%d)\n", pin); return; } @@ -87,7 +87,7 @@ void tone(uint8_t pin, unsigned int frequency, unsigned long duration) { void noTone(uint8_t pin) { CoreMutex m(&_toneMutex); - if ((pin < 0) || (pin > 29) || !m) { + if ((pin > 29) || !m) { DEBUGCORE("ERROR: Illegal pin in tone (%d)\n", pin); return; } diff --git a/cores/rp2040/posix.cpp b/cores/rp2040/posix.cpp index a8ce0870..b3829ce5 100644 --- a/cores/rp2040/posix.cpp +++ b/cores/rp2040/posix.cpp @@ -35,23 +35,34 @@ extern "C" int errno; extern "C" ssize_t _write(int fd, const void *buf, size_t count) { #if defined DEBUG_RP2040_PORT + (void) fd; return DEBUG_RP2040_PORT.write((const char *)buf, count); #else + (void) fd; + (void) buf; + (void) count; return 0; #endif } extern "C" int _chown (const char *path, uid_t owner, gid_t group) { + (void) path; + (void) owner; + (void) group; errno = ENOSYS; return -1; } -extern "C" int _close (int fildes) { +extern "C" int _close (int fd) { + (void) fd; errno = ENOSYS; return -1; } extern "C" int _execve (char *name, char **argv, char **env) { + (void) name; + (void) argv; + (void) env; errno = ENOSYS; return -1; } @@ -61,7 +72,9 @@ extern "C" int _fork (void) { return -1; } -extern "C" int _fstat (int fildes, struct stat *st) { +extern "C" int _fstat (int fd, struct stat *st) { + (void) fd; + (void) st; errno = ENOSYS; return -1; } @@ -74,6 +87,7 @@ extern "C" int _getpid (void) { static int64_t __timedelta_us = 0.0; extern "C" int _gettimeofday (struct timeval *tv, void *tz) { + (void) tz; uint64_t now_us = to_us_since_boot(get_absolute_time()) + __timedelta_us; if (tv) { tv->tv_sec = now_us / 1000000L; @@ -83,6 +97,7 @@ extern "C" int _gettimeofday (struct timeval *tv, void *tz) { } extern "C" int settimeofday (const struct timeval *tv, const struct timezone *tz) { + (void) tz; uint64_t now_us = to_us_since_boot(get_absolute_time()); if (tv) { uint64_t newnow_us; @@ -94,62 +109,86 @@ extern "C" int settimeofday (const struct timeval *tv, const struct timezone *tz } extern "C" int _isatty (int file) { + (void) file; errno = ENOSYS; return 0; } extern "C" int _kill (int pid, int sig) { + (void) pid; + (void) sig; errno = ENOSYS; return -1; } extern "C" int _link (char *existing, char *newlink) { + (void) existing; + (void) newlink; errno = ENOSYS; return -1; } extern "C" int _lseek (int file, int ptr, int dir) { + (void) file; + (void) ptr; + (void) dir; errno = ENOSYS; return -1; } extern "C" int _open (char *file, int flags, int mode) { + (void) file; + (void) flags; + (void) mode; errno = ENOSYS; return -1; } extern "C" int _read (int file, char *ptr, int len) { + (void) file; + (void) ptr; + (void) len; // return Serial.read(ptr, len); return -1; } extern "C" int _readlink (const char *path, char *buf, size_t bufsize) { + (void) path; + (void) buf; + (void) bufsize; errno = ENOSYS; return -1; } extern "C" int _stat (const char *file, struct stat *st) { + (void) file; + (void) st; errno = ENOSYS; return -1; } extern "C" int _symlink (const char *path1, const char *path2) { + (void) path1; + (void) path2; errno = ENOSYS; return -1; } extern "C" clock_t _times (struct tms *buf) { + (void) buf; errno = ENOSYS; return -1; } extern "C" int _unlink (char *name) { + (void) name; errno = ENOSYS; return -1; } extern "C" int _wait (int *status) { + (void) status; errno = ENOSYS; return -1; } diff --git a/cores/rp2040/wiring_analog.cpp b/cores/rp2040/wiring_analog.cpp index 3048b766..d3110187 100644 --- a/cores/rp2040/wiring_analog.cpp +++ b/cores/rp2040/wiring_analog.cpp @@ -26,8 +26,7 @@ #include #include -static int32_t analogScale = 255; -static uint32_t analogMap = 0; +static uint32_t analogScale = 255; static uint16_t analogFreq = 1000; static bool pwmInitted = false; static bool adcInitted = false; @@ -73,7 +72,7 @@ extern "C" void analogWriteResolution(int res) { extern "C" void analogWrite(pin_size_t pin, int val) { CoreMutex m(&_dacMutex); - if ((pin < 0) || (pin > 29) || !m) { + if ((pin > 29) || !m) { DEBUGCORE("ERROR: Illegal analogWrite pin (%d)\n", pin); return; } @@ -89,7 +88,7 @@ extern "C" void analogWrite(pin_size_t pin, int val) { if (val < 0) { val = 0; - } else if (val > analogScale) { + } else if ((uint32_t)val > analogScale) { val = analogScale; } diff --git a/cores/rp2040/wiring_digital.cpp b/cores/rp2040/wiring_digital.cpp index 24d482a3..67d83576 100644 --- a/cores/rp2040/wiring_digital.cpp +++ b/cores/rp2040/wiring_digital.cpp @@ -51,7 +51,7 @@ extern "C" void pinMode( pin_size_t ulPin, PinMode ulMode ) { return; } - if ((ulPin < 0) || (ulPin > 29)) { + if (ulPin > 29) { DEBUGCORE("ERROR: Illegal pin in pinMode (%d)\n", ulPin); return; } @@ -59,7 +59,7 @@ extern "C" void pinMode( pin_size_t ulPin, PinMode ulMode ) { } extern "C" void digitalWrite( pin_size_t ulPin, PinStatus ulVal ) { - if ((ulPin < 0) || (ulPin > 29)) { + if (ulPin > 29) { DEBUGCORE("ERROR: Illegal pin in pinMode (%d)\n", ulPin); return; } @@ -81,10 +81,9 @@ extern "C" void digitalWrite( pin_size_t ulPin, PinStatus ulVal ) { } extern "C" PinStatus digitalRead( pin_size_t ulPin ) { - if ((ulPin < 0) || (ulPin > 29)) { + if (ulPin > 29) { DEBUGCORE("ERROR: Illegal pin in digitalRead (%d)\n", ulPin); return LOW; } return gpio_get(ulPin) ? HIGH : LOW; } - diff --git a/cores/rp2040/wiring_private.cpp b/cores/rp2040/wiring_private.cpp index e9b63dec..1ceeedc7 100644 --- a/cores/rp2040/wiring_private.cpp +++ b/cores/rp2040/wiring_private.cpp @@ -48,6 +48,7 @@ auto_init_mutex(_irqMutex); static std::map _map; void _gpioInterruptDispatcher(uint gpio, uint32_t events) { + (void) events; // Only need to lock around the std::map check, not the whole IRQ callback voidFuncPtr cb = nullptr; { diff --git a/cores/rp2040/wiring_pulse.cpp b/cores/rp2040/wiring_pulse.cpp index c7a29a45..1d198d96 100644 --- a/cores/rp2040/wiring_pulse.cpp +++ b/cores/rp2040/wiring_pulse.cpp @@ -27,7 +27,7 @@ extern "C" unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeo uint64_t start = time_us_64(); uint64_t abort = start + timeout; - if ((pin < 0) || (pin > 29)) { + if (pin > 29) { DEBUGCORE("ERROR: Illegal pin in pulseIn (%d)\n", pin); return 0; } diff --git a/cores/rp2040/wiring_shift.cpp b/cores/rp2040/wiring_shift.cpp index 069c0b26..e8a61ea4 100644 --- a/cores/rp2040/wiring_shift.cpp +++ b/cores/rp2040/wiring_shift.cpp @@ -24,40 +24,42 @@ extern "C" uint8_t shiftIn(pin_size_t dataPin, pin_size_t clockPin, BitOrder bitOrder) { uint8_t value = 0; uint8_t i; - if ((dataPin < 0) || (dataPin > 29)) { + if (dataPin > 29) { DEBUGCORE("ERROR: Illegal dataPin in shiftIn (%d)\n", dataPin); return 0; } - if ((clockPin < 0) || (clockPin > 29)) { + if (clockPin > 29) { DEBUGCORE("ERROR: Illegal clockPin in shiftIn (%d)\n", clockPin); return 0; } for (i = 0; i < 8; ++i) { digitalWrite(clockPin, HIGH); - if (bitOrder == LSBFIRST) + if (bitOrder == LSBFIRST) { value |= digitalRead(dataPin) << i; - else + } else { value |= digitalRead(dataPin) << (7 - i); - digitalWrite(clockPin, LOW); + } + digitalWrite(clockPin, LOW); } return value; } extern "C" void shiftOut(pin_size_t dataPin, pin_size_t clockPin, BitOrder bitOrder, uint8_t val) { uint8_t i; - if ((dataPin < 0) || (dataPin > 29)) { + if (dataPin > 29) { DEBUGCORE("ERROR: Illegal dataPin in shiftOut (%d)\n", dataPin); return; } - if ((clockPin < 0) || (clockPin > 29)) { + if (clockPin > 29) { DEBUGCORE("ERROR: Illegal clockPin in shiftOut (%d)\n", clockPin); return; } for (i = 0; i < 8; i++) { - if (bitOrder == LSBFIRST) + if (bitOrder == LSBFIRST) { digitalWrite(dataPin, !!(val & (1 << i))); - else + } else { digitalWrite(dataPin, !!(val & (1 << (7 - i)))); + } digitalWrite(clockPin, HIGH); digitalWrite(clockPin, LOW); diff --git a/tests/common.sh b/tests/common.sh index 93ea62be..afaf5b5f 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -32,7 +32,7 @@ function print_size_info() elf_file=$1 if [ -z "$elf_file" ]; then - printf "sketch data rodata bss text irom0.text dram flash\n" + printf "sketch data rodata bss text dram flash\n" return 0 fi @@ -46,9 +46,9 @@ function print_size_info() done total_ram=$((${segments[data]} + ${segments[rodata]} + ${segments[bss]})) - total_flash=$((${segments[data]} + ${segments[rodata]} + ${segments[text]} + ${segments[irom0text]})) + total_flash=$((${segments[data]} + ${segments[rodata]} + ${segments[text]})) - printf "%-28s %-8d %-8d %-8d %-8d %-8d %-8d %-8d\n" $sketch_name ${segments[data]} ${segments[rodata]} ${segments[bss]} ${segments[text]} ${segments[irom0text]} $total_ram $total_flash + printf "%-28s %-8d %-8d %-8d %-8d %-8d %-8d %-8d\n" $sketch_name ${segments[data]} ${segments[rodata]} ${segments[bss]} ${segments[text]} $total_ram $total_flash return 0 } -- 2.54.0 From bd3ce705ee4a62981a93df1214d4aaf0df63ce92 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 22 May 2021 02:44:23 -0700 Subject: [PATCH 13/17] Get sub-submodules --- .github/workflows/pull-request.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8d1a73e2..fe4eaa8e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -44,7 +44,7 @@ jobs: uses: actions/cache@v2 with: path: ./tools/dist - key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} + key: ${{ runner.os }}-${{ hashFiles('package/package_pico_index.template.json', 'tests/common.sh') }} - name: Build Sketches env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -53,5 +53,10 @@ jobs: mod: 8 rem: ${{ matrix.chunk }} run: | + cd pico-sdk + git submodule update --init + cd ../pico-extras + git submodule update --init + cd .. bash ./tests/build.sh -- 2.54.0 From 00efcccd7470d13f2fb24d2c109e563bd014c665 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 22 May 2021 02:46:59 -0700 Subject: [PATCH 14/17] Fix I2S warnings --- libraries/I2S/src/I2S.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/I2S/src/I2S.cpp b/libraries/I2S/src/I2S.cpp index 2c6566e2..1e0b5410 100644 --- a/libraries/I2S/src/I2S.cpp +++ b/libraries/I2S/src/I2S.cpp @@ -32,17 +32,19 @@ I2SClass::I2SClass() { } bool I2SClass::setBCLK(pin_size_t pin) { - if (_running || (pin < 0) || (pin > 28)) { + if (_running || (pin > 28)) { return false; } _pinBCLK = pin; + return true; } bool I2SClass::setDOUT(pin_size_t pin) { - if (_running || (pin < 0) || (pin > 29)) { + if (_running || (pin > 29)) { return false; } _pinDOUT = pin; + return true; } bool I2SClass::begin(long sampleRate) { -- 2.54.0 From c5839597997746ad8a0bf60f6c05c0714ba2c86c Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 22 May 2021 02:49:07 -0700 Subject: [PATCH 15/17] Fix SPI warnings --- libraries/SPI/SPI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/SPI/SPI.cpp b/libraries/SPI/SPI.cpp index c79eacb6..b28b766b 100644 --- a/libraries/SPI/SPI.cpp +++ b/libraries/SPI/SPI.cpp @@ -73,13 +73,13 @@ void SPIClassRP2040::adjustBuffer(const void *s, void *d, size_t cnt, bool by16) } else if (!by16) { const uint8_t *src = (const uint8_t *)s; uint8_t *dst = (uint8_t *)d; - for (auto i = 0; i < cnt; i++) { + for (size_t i = 0; i < cnt; i++) { *(dst++) = reverseByte( *(src++) ); } } else { /* by16 */ const uint16_t *src = (const uint16_t *)s; uint16_t *dst = (uint16_t *)d; - for (auto i = 0; i < cnt; i++) { + for (size_t i = 0; i < cnt; i++) { *(dst++) = reverse16Bit( *(src++) ); } } @@ -114,7 +114,7 @@ uint16_t SPIClassRP2040::transfer16(uint16_t data) { void SPIClassRP2040::transfer(void *buf, size_t count) { DEBUGSPI("SPI::transfer(%p, %d)\n", buf, count); uint8_t *buff = reinterpret_cast(buf); - for (auto i = 0; i < count; i++) { + for (size_t i = 0; i < count; i++) { *buff = transfer(*buff); *buff = (_spis.getBitOrder() == MSBFIRST) ? *buff : reverseByte(*buff); buff++; -- 2.54.0 From 03ddd5e6dd9f16dbc9c50b8d6abd87193cfcc26d Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 22 May 2021 02:53:03 -0700 Subject: [PATCH 16/17] Fix Wire warnings --- libraries/Wire/Wire.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp index 35ffc00f..2cb150d3 100644 --- a/libraries/Wire/Wire.cpp +++ b/libraries/Wire/Wire.cpp @@ -146,7 +146,7 @@ void TwoWire::onIRQ() { } if (_i2c->hw->intr_stat & (1<<2)) { // RX_FULL - if (_slaveStartDet && (_buffLen < sizeof(_buff))) { + if (_slaveStartDet && (_buffLen < (int)sizeof(_buff))) { _buff[_buffLen++] = _i2c->hw->data_cmd & 0xff; } else { _i2c->hw->data_cmd; @@ -179,7 +179,6 @@ size_t TwoWire::requestFrom(uint8_t address, size_t quantity, bool stopBit) { return 0; } - size_t byteRead = 0; _buffLen = i2c_read_blocking_until(_i2c, address, _buff, quantity, !stopBit, make_timeout_time_ms(50)); _buffOff = 0; return _buffLen; @@ -279,7 +278,7 @@ size_t TwoWire::write(uint8_t ucData) { if (_slave) { // Wait for a spot in the TX FIFO - while (0 == _i2c->hw->status & (1<<1)) { /* noop wait */ } + while (0 == (_i2c->hw->status & (1<<1))) { /* noop wait */ } _i2c->hw->data_cmd = ucData; return 1; } else { -- 2.54.0 From 8469307f1db37b28df2b794131c9401b457c1efc Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 22 May 2021 02:55:42 -0700 Subject: [PATCH 17/17] Fix Time demo --- libraries/rp2040/examples/Time/Time.ino | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/rp2040/examples/Time/Time.ino b/libraries/rp2040/examples/Time/Time.ino index 478d8397..5d20d2ac 100644 --- a/libraries/rp2040/examples/Time/Time.ino +++ b/libraries/rp2040/examples/Time/Time.ino @@ -18,7 +18,6 @@ void setup() { void loop() { time_t now; - struct tm *info; char buff[80]; time(&now); -- 2.54.0