Skip to content

Commit 527655a

Browse files
authored
Merge pull request #8 from esp-cpp/feature/espp-update
Feature/espp update
2 parents 0527e80 + aff41f6 commit 527655a

File tree

7 files changed

+116
-10
lines changed

7 files changed

+116
-10
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ BreakBeforeBinaryOperators: None
4040
BreakBeforeBraces: Attach
4141
BreakBeforeInheritanceComma: false
4242
BreakBeforeTernaryOperators: true
43-
BreakConstructorInitializersBeforeComma: false
43+
BreakConstructorInitializersBeforeComma: true
4444
BreakConstructorInitializers: BeforeColon
4545
BreakAfterJavaFieldAnnotations: false
4646
BreakStringLiterals: true

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout repo
12+
uses: actions/checkout@v2
13+
with:
14+
submodules: 'recursive'
15+
16+
- name: Build Examples
17+
uses: espressif/esp-idf-ci-action@v1
18+
with:
19+
esp_idf_version: release-v5.2
20+
target: esp32s3
21+
path: '.'

.github/workflows/package_main.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build and Package Main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
continue-on-error: false
14+
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v2
18+
with:
19+
submodules: 'recursive'
20+
21+
- name: Build Main Code
22+
uses: espressif/esp-idf-ci-action@v1
23+
with:
24+
esp_idf_version: release-v5.2
25+
target: esp32s3
26+
path: '.'
27+
command: 'idf.py build'
28+
29+
- name: Upload Build Outputs
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: build-artifacts
33+
path: |
34+
build/bootloader/bootloader.bin
35+
build/partition_table/partition-table.bin
36+
build/bldc_test_stand.bin
37+
build/flash_args
38+
39+
- name: Attach files to release
40+
uses: softprops/action-gh-release@v1
41+
if: ${{ github.event.release && github.event.action == 'published' }}
42+
with:
43+
files: |
44+
build/bldc_test_stand.bin
45+
build/bootloader/bootloader.bin
46+
build/partition_table/partition-table.bin
47+
build/flash_args
48+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Static analysis
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
static_analysis:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repo
11+
uses: actions/checkout@v2
12+
with:
13+
submodules: 'recursive'
14+
15+
- name: Run static analysis
16+
uses: esp-cpp/StaticAnalysis@master
17+
with:
18+
# Do not build the project and do not use cmake to generate compile_commands.json
19+
use_cmake: false
20+
21+
# Use the 5.2 release version since it's what we build with
22+
esp_idf_version: release/v5.2
23+
24+
# (Optional) cppcheck args
25+
cppcheck_args: -i$GITHUB_WORKSPACE/components/espp --force --enable=all --inline-suppr --inconclusive --platform=mips32 --std=c++17 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt

components/espp

Submodule espp updated 365 files

main/main.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ extern "C" void app_main(void) {
5151
};
5252

5353
// now make the mt6701 which decodes the data
54-
std::shared_ptr<espp::Mt6701> mt6701 = std::make_shared<espp::Mt6701>(espp::Mt6701::Config{
55-
.write = std::bind(&espp::I2c::write, &i2c, std::placeholders::_1, std::placeholders::_2,
56-
std::placeholders::_3),
57-
.read = std::bind(&espp::I2c::read_at_register, &i2c, std::placeholders::_1,
58-
std::placeholders::_2, std::placeholders::_3, std::placeholders::_4),
59-
.velocity_filter = filter_fn,
60-
.update_period = std::chrono::duration<float>(core_update_period),
61-
.log_level = espp::Logger::Verbosity::WARN});
54+
std::shared_ptr<espp::Mt6701> mt6701 = std::make_shared<espp::Mt6701>(
55+
espp::Mt6701::Config{.write = std::bind(&espp::I2c::write, &i2c, std::placeholders::_1,
56+
std::placeholders::_2, std::placeholders::_3),
57+
.read_register = std::bind(&espp::I2c::read_at_register, &i2c,
58+
std::placeholders::_1, std::placeholders::_2,
59+
std::placeholders::_3, std::placeholders::_4),
60+
.velocity_filter = filter_fn,
61+
.update_period = std::chrono::duration<float>(core_update_period),
62+
.log_level = espp::Logger::Verbosity::WARN});
6263

6364
// now make the bldc driver
6465
std::shared_ptr<espp::BldcDriver> driver = std::make_shared<espp::BldcDriver>(

suppressions.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// category of errors to suppress, e.g. unusedFunction
2+
missingInclude
3+
missingIncludeSystem
4+
unusedFunction
5+
unusedStructMember
6+
functionStatic
7+
cstyleCast
8+
9+
// Specific suppressions of the form:
10+
// [error id]:[filename]:[line]
11+
*:components/espp/*

0 commit comments

Comments
 (0)