Skip to content

Commit

Permalink
Merge pull request #8 from esp-cpp/feature/espp-update
Browse files Browse the repository at this point in the history
Feature/espp update
  • Loading branch information
finger563 authored Feb 15, 2024
2 parents 0527e80 + aff41f6 commit 527655a
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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: '.'
48 changes: 48 additions & 0 deletions .github/workflows/package_main.yml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion components/espp
Submodule espp updated 365 files
17 changes: 9 additions & 8 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ extern "C" void app_main(void) {
};

// now make the mt6701 which decodes the data
std::shared_ptr<espp::Mt6701> mt6701 = std::make_shared<espp::Mt6701>(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<float>(core_update_period),
.log_level = espp::Logger::Verbosity::WARN});
std::shared_ptr<espp::Mt6701> mt6701 = std::make_shared<espp::Mt6701>(
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<float>(core_update_period),
.log_level = espp::Logger::Verbosity::WARN});

// now make the bldc driver
std::shared_ptr<espp::BldcDriver> driver = std::make_shared<espp::BldcDriver>(
Expand Down
11 changes: 11 additions & 0 deletions suppressions.txt
Original file line number Diff line number Diff line change
@@ -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/*

0 comments on commit 527655a

Please sign in to comment.