From e4250f9b7ba49da9f7ab6215be9963d60bfb2c1c Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Thu, 15 Feb 2024 10:55:53 -0600 Subject: [PATCH 1/3] update espp to latest --- components/espp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/espp b/components/espp index b6ec4c4..761b524 160000 --- a/components/espp +++ b/components/espp @@ -1 +1 @@ -Subproject commit b6ec4c46ef1cfb09beae141406c30966ba80772f +Subproject commit 761b52412c903319f06e66f66696e5ac29ded285 From a79e20619da5b07107a403632239f0ce0e9d0c8d Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Thu, 15 Feb 2024 10:57:59 -0600 Subject: [PATCH 2/3] chore: update peripheral interface for mt6701 with latest changes after base_peripheral refactor --- main/main.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 083ed33..6ad8ba3 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -51,14 +51,15 @@ extern "C" void app_main(void) { }; // now make the mt6701 which decodes the data - std::shared_ptr mt6701 = std::make_shared(espp::Mt6701::Config{ - .write = std::bind(&espp::I2c::write, &i2c, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3), - .read = std::bind(&espp::I2c::read_at_register, &i2c, std::placeholders::_1, - std::placeholders::_2, std::placeholders::_3, std::placeholders::_4), - .velocity_filter = filter_fn, - .update_period = std::chrono::duration(core_update_period), - .log_level = espp::Logger::Verbosity::WARN}); + std::shared_ptr mt6701 = std::make_shared( + espp::Mt6701::Config{.write = std::bind(&espp::I2c::write, &i2c, std::placeholders::_1, + std::placeholders::_2, std::placeholders::_3), + .read_register = std::bind(&espp::I2c::read_at_register, &i2c, + std::placeholders::_1, std::placeholders::_2, + std::placeholders::_3, std::placeholders::_4), + .velocity_filter = filter_fn, + .update_period = std::chrono::duration(core_update_period), + .log_level = espp::Logger::Verbosity::WARN}); // now make the bldc driver std::shared_ptr driver = std::make_shared( From aff41f6738c0f8c4711890b78bf67ad9ce14adc0 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Thu, 15 Feb 2024 11:06:34 -0600 Subject: [PATCH 3/3] add ci --- .clang-format | 2 +- .github/workflows/build.yml | 21 ++++++++++++ .github/workflows/package_main.yml | 48 +++++++++++++++++++++++++++ .github/workflows/static_analysis.yml | 25 ++++++++++++++ suppressions.txt | 11 ++++++ 5 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/package_main.yml create mode 100644 .github/workflows/static_analysis.yml create mode 100644 suppressions.txt diff --git a/.clang-format b/.clang-format index 0e0bcba..e49f21e 100644 --- a/.clang-format +++ b/.clang-format @@ -40,7 +40,7 @@ BreakBeforeBinaryOperators: None BreakBeforeBraces: Attach BreakBeforeInheritanceComma: false BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializersBeforeComma: true BreakConstructorInitializers: BeforeColon BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..99fd921 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,21 @@ +name: Build + +on: [pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Build Examples + uses: espressif/esp-idf-ci-action@v1 + with: + esp_idf_version: release-v5.2 + target: esp32s3 + path: '.' diff --git a/.github/workflows/package_main.yml b/.github/workflows/package_main.yml new file mode 100644 index 0000000..ff38428 --- /dev/null +++ b/.github/workflows/package_main.yml @@ -0,0 +1,48 @@ +name: Build and Package Main + +on: + push: + branches: [main] + release: + types: [published] + +jobs: + build: + + runs-on: ubuntu-latest + continue-on-error: false + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Build Main Code + uses: espressif/esp-idf-ci-action@v1 + with: + esp_idf_version: release-v5.2 + target: esp32s3 + path: '.' + command: 'idf.py build' + + - name: Upload Build Outputs + uses: actions/upload-artifact@v3 + with: + name: build-artifacts + path: | + build/bootloader/bootloader.bin + build/partition_table/partition-table.bin + build/bldc_test_stand.bin + build/flash_args + + - name: Attach files to release + uses: softprops/action-gh-release@v1 + if: ${{ github.event.release && github.event.action == 'published' }} + with: + files: | + build/bldc_test_stand.bin + build/bootloader/bootloader.bin + build/partition_table/partition-table.bin + build/flash_args + diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml new file mode 100644 index 0000000..ebe8ae6 --- /dev/null +++ b/.github/workflows/static_analysis.yml @@ -0,0 +1,25 @@ +name: Static analysis + +on: [pull_request] + +jobs: + static_analysis: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Run static analysis + uses: esp-cpp/StaticAnalysis@master + with: + # Do not build the project and do not use cmake to generate compile_commands.json + use_cmake: false + + # Use the 5.2 release version since it's what we build with + esp_idf_version: release/v5.2 + + # (Optional) cppcheck args + cppcheck_args: -i$GITHUB_WORKSPACE/components/espp --force --enable=all --inline-suppr --inconclusive --platform=mips32 --std=c++17 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt diff --git a/suppressions.txt b/suppressions.txt new file mode 100644 index 0000000..7466731 --- /dev/null +++ b/suppressions.txt @@ -0,0 +1,11 @@ +// category of errors to suppress, e.g. unusedFunction +missingInclude +missingIncludeSystem +unusedFunction +unusedStructMember +functionStatic +cstyleCast + +// Specific suppressions of the form: +// [error id]:[filename]:[line] +*:components/espp/*