This commit is contained in:
2024-12-22 05:22:46 +03:00
commit 1992e632d3
232 changed files with 20394 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#!/bin/sh
TARGETS=${1:-espidf}
echo "execute for ${TARGETS}"
if [ "$GITHUB_WORKSPACE" != "" ]
then
# Make sure we are inside the github workspace
cd $GITHUB_WORKSPACE
fi
# Whatever this script is started from, cd to the top level
ROOT=`git rev-parse --show-toplevel`
cd $ROOT
# install platformio, if needed
which pio
if [ $? -ne 0 ]
then
# Install PlatformIO CLI
export PATH=$PATH:~/.platformio/penv/bin
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
python3 get-platformio.py
# Use automated install from pio run
# pio platform install "atmelavr"
# pio platform install "atmelsam"
# pio platform install "espressif32"
fi
set -e
for i in pio_espidf/*
do
for p in ${TARGETS}
do
echo $p: $i
(cd $i;pio run -s -e $p)
done
done

View File

@@ -0,0 +1,59 @@
#!/bin/sh
echo "build directories"
if [ "$GITHUB_WORKSPACE" != "" ]
then
# Make sure we are inside the github workspace
cd $GITHUB_WORKSPACE
fi
# Whatever this script is started from, cd to the top level
ROOT=`git rev-parse --show-toplevel`
cd $ROOT
pwd
# So create the pio_dirs-directory during the github action
rm -fR pio_dirs
mkdir pio_dirs
for i in `ls examples`
do
mkdir -p pio_dirs/$i/src
cd pio_dirs/$i
ln -s ../../extras/ci/platformio.ini .
cd src
FILES=`cd ../../../examples/$i;find . -type f`
for f in $FILES;do ln -s ../../../examples/$i/$f .;done
cd ../../..
done
# for espidf as of now, the src/* files need to be linked into the example build directory
rm -fR pio_espidf
mkdir pio_espidf
for i in `cd extras;ls idf_examples`
do
mkdir -p pio_espidf/$i/src
cd pio_espidf/$i
ln -s ../../extras/ci/platformio.ini .
cd src
FILES=`cd ../../../extras/idf_examples/$i;find . -type f`
for f in $FILES;do ln -s ../../../extras/idf_examples/$i/$f .;done
cd ../../..
done
mkdir -p pio_espidf/StepperDemo/src
(cd pio_espidf/StepperDemo;ln -s ../../extras/ci/platformio.ini;cd src;cp ../../../examples/StepperDemo/* .;mv StepperDemo.ino StepperDemo.cpp)
# Make one directory to test PoorManFloat on simulator
mkdir pio_dirs/PMF_test
mkdir pio_dirs/PMF_test/src
cd pio_dirs/PMF_test
ln -s ../../extras/ci/platformio.ini .
cd src
#sed -e 's/%d/%ld/g' <../../../tests/test_03.h >test_03.h
ln -s ../../../extras/tests/pc_based/test_03.h .
ln -s ../../../extras/tests/pc_based/PMF_test.ino PMF_test.ino
cd ../../..
ls -al pio_*

View File

@@ -0,0 +1,43 @@
#!/bin/sh
TARGETS=${1:-nanoatmega168 nanoatmega328 atmega2560 esp32 esp32s2 esp32c3 atmelsam atmega32u4}
echo "execute for ${TARGETS}"
if [ "$GITHUB_WORKSPACE" != "" ]
then
# Make sure we are inside the github workspace
cd $GITHUB_WORKSPACE
fi
# Whatever this script is started from, cd to the top level
ROOT=`git rev-parse --show-toplevel`
cd $ROOT
# install platformio, if needed
which pio
if [ $? -ne 0 ]
then
# Install PlatformIO CLI
export PATH=$PATH:~/.platformio/penv/bin
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
python3 get-platformio.py
# Use automated install from pio run
# pio platform install "atmelavr"
# pio platform install "atmelsam"
# pio platform install "espressif32"
fi
set -e
for i in pio_dirs/*
do
for p in ${TARGETS}
do
if [ "$p" = "nanoatmega168" ] && [ "$i" = "pio_dirs/StepperDemo" ]; then
echo $p: Skipping $i for $p due to space constraints
continue
fi
echo $p: $i
(cd $i;pio run -s -e $p)
done
done

11
extras/scripts/format_code.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
PRJ_ROOT=`git rev-parse --show-toplevel`
VERSION=`git rev-parse --short HEAD`
FILES=`find ${PRJ_ROOT} -type f -name '*.ino' -or -type f -name '*.cpp' -or -type f -name '*.h'`
clang-format -style="{BasedOnStyle: Google, SortIncludes: false}" -i ${FILES}
echo ${VERSION}
sed -i -e 's/#define VERSION.*$$/#define VERSION "post-$(VERSION)"/' ${PRJ_ROOT}/examples/StepperDemo/StepperDemo.ino

View File

@@ -0,0 +1,50 @@
#!/bin/sh
# This extract all lines with C-comments // as plain text
# Places all C-lines in quotes
gawk '
BEGIN {
in_c_header = 1
in_code = 0
quote_code = 0
}
/#include/ { next }
(NF != 0) && (in_c_header == 1) { next }
/\/\/ *clang-format/ { next }
{ in_c_header = 0 }
(NF == 0) {
if (in_code == 1) {
print("```")
}
in_code = 0
quote_code = 0
next
}
/\/\// {
if (in_code == 1) {
print("```")
}
gsub("[ \t]*// ?","")
print
in_code = 0
quote_code = 1
next
}
(quote_code == 1) {
print("```cpp")
in_code = 1
quote_code = 0
}
in_code == 1 {
gsub("inline ","")
print
}
' ../../src/FastAccelStepper.h >../doc/FastAccelStepper_API.md