Fix bugs in total_machine_angle calculate and pid integer anti-constr… #152
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compile Firmware | |
on: [ push ] | |
#schedule: | |
# - cron: '40 15 * * *' # compile at 23:50 each day | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Configure Software | |
run: | | |
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get install -y cmake gcc g++ automake autoconf libtool make build-essential wget | |
wget -q https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 | |
- name: Install Compiler | |
run: | | |
tar jxf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 | |
mv gcc-arm-none-eabi-10-2020-q4-major ./gcc-arm-none-eabi | |
rm gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 | |
- name: Configure CMake | |
run: | | |
PATH="$PATH:/home/runner/work/miniFOC/miniFOC/gcc-arm-none-eabi/bin" && echo $PATH | |
mkdir build -p && cd build && cmake ../program | |
- name: Build Hex | |
run: | | |
PATH="$PATH:/home/runner/work/miniFOC/miniFOC/gcc-arm-none-eabi/bin" && echo $PATH | |
cd build && ls && make && ls | |
- name: Upload Hex | |
uses: actions/upload-artifact@v2 | |
with: | |
name: miniFOC-hex | |
path: build/miniFOC.hex | |
deploy: | |
needs: build | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: miniFOC-hex | |
path: ./ | |
- name: Initialize Git | |
env: | |
LOCAL_ACCOUNT_KEY_ENV: ${{ secrets.LOCAL_ACCOUNT_KEY }} | |
run: | | |
mkdir -p ~/.ssh && echo "$LOCAL_ACCOUNT_KEY_ENV" > ~/.ssh/id_rsa && sudo chmod 600 ~/.ssh/id_rsa | |
export GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no" | |
git clone git@github.com:ZhuYanzhen1/miniFOC_Firmware.git && ls | |
- name: Upload Firmware | |
run: | | |
currentmonth=$(date +%Y%m) && currentdate=$(date +%Y%m%d) && filename="./miniFOC_Firmware/"$currentmonth'/'$currentdate".hex" | |
cd miniFOC_Firmware && mkdir -p $currentmonth && cd .. && mv miniFOC.hex $filename && cd miniFOC_Firmware | |
git config --global user.email "2208213223@qq.com" && git config --global user.name "LaoZhu" | |
git add . && git commit -m "Upload new firmware from Github Actions" && git push origin master | |
cd .. && ls && sudo rm -rf firmware && mv miniFOC_Firmware firmware | |
- name: Update Pages | |
env: | |
LOCAL_ACCOUNT_KEY_ENV: ${{ secrets.LOCAL_ACCOUNT_KEY }} | |
run: | | |
ls && currentdate=$(date +%Y%m%d) && currentmonth=$(date +%Y%m) && commit_info=$(git log -1 --oneline) | |
filestr="/下载。 /a\ \r\n+ ["$currentdate"](https://raw.githubusercontent.com/ZhuYanzhen1/miniFOC_Firmware/master/"$currentmonth'/'$currentdate".hex): "$commit_info | |
sed -i "$filestr" ./docs/_mainpage.md && echo $filestr && rm ~/.ssh/id_rsa | |
echo "$LOCAL_ACCOUNT_KEY_ENV" > ~/.ssh/id_rsa && sudo chmod 600 ~/.ssh/id_rsa | |
git add . && git commit -m "Update new firmware link to Github Pages" && git push origin main | |