Skip to content

Commit

Permalink
SUKU formatting added
Browse files Browse the repository at this point in the history
  • Loading branch information
SukuWc committed Jan 22, 2024
1 parent 8447aed commit b269b5f
Show file tree
Hide file tree
Showing 44 changed files with 3,960 additions and 4,258 deletions.
5 changes: 5 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ColumnLimit: 200 # Set to a very large value
BasedOnStyle: LLVM
IndentWidth: 2
DerivePointerAlignment: false
PointerAlignment: Left
10 changes: 10 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to 'ignore-words.txt' (one word per line).
# Or copy & paste the whole problematic line to 'exclude-file.txt'
ignore-words = ./ignore-words.txt
exclude-file = ./exclude-file.txt
check-filenames =
check-hidden =
count =
skip = .git
1 change: 0 additions & 1 deletion .github/workflows/convert_bottom_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@
row[5] -= 360.0
startwriter.writerow(row)
print(row)

1 change: 0 additions & 1 deletion .github/workflows/convert_position_offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@
row[4] = float(row[4])-100.0
startwriter.writerow(row)
print(row)

15 changes: 7 additions & 8 deletions .github/workflows/electrical_boards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
generate-artifacts:
name: kicad export
runs-on: ubuntu-latest
container: "setsoft/kicad_auto:ki7"
container: "setsoft/kicad_auto:ki7"
strategy:
fail-fast: false
matrix:
Expand All @@ -40,8 +40,8 @@ jobs:
run: |
python3 .github/workflows/convert_bottom_position.py ../../Electrical/Design/${{ matrix.board }}/mfg-bot/mfg/${{ matrix.board }}-both_pos.csv ../../Electrical/Design/${{ matrix.board }}/mfg-bot/mfg/${{ matrix.board }}-both_pos_fixed.csv
rm Electrical/Design/${{ matrix.board }}/mfg-bot/mfg/${{ matrix.board }}-both_pos.csv
- name: Zipping gerber
- name: Zipping gerber
uses: vimtor/action-zip@v1
with:
files: Electrical/Design/${{ matrix.board }}/mfg-bot/JLCPCB
Expand All @@ -56,7 +56,7 @@ jobs:
mv Electrical/Design/${{ matrix.board }}/mfg-bot/PCB_Bottom.pdf Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}_PCB_Bottom.pdf
mv Electrical/Design/${{ matrix.board }}/mfg-bot/kibot_errors.filter Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}_kibot_errors.filter
mv Electrical/Design/${{ matrix.board }}/kibot_error.log Electrical/Design/${{ matrix.board }}/mfg-bot/${{ matrix.board }}_kibot_error.log
rm -r Electrical/Design/${{ matrix.board }}/mfg-bot/JLCPCB
- name: Upload results
Expand All @@ -70,7 +70,7 @@ jobs:

deploy-results:
runs-on: ubuntu-latest
needs: generate-artifacts
needs: generate-artifacts
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -97,10 +97,9 @@ jobs:
done
- name: Commit the files
run: |
run: |
git config --global user.name ${{ github.actor }}
git config --global user.email ${{ github.actor }}@users.noreply.github.com
git config --global user.email ${{ github.actor }}@users.noreply.github.com
git add Preview/*
git commit -m "BOT ${{ github.workflow }} ${{ github.sha }}"
git push
6 changes: 3 additions & 3 deletions .github/workflows/firmware_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ jobs:
knot_esp32_nightly_${{ env.ACTION_DATE }}.uf2
knot_esp32_nightly.uf2
- name: Zipping artifacts for Github Release
- name: Zipping artifacts for Github Release
uses: vimtor/action-zip@v1
if: ${{ env.RELEASE_VERSION != '' }}
with:
files: knot_esp32_release_${{ env.ACTION_DATE }}.uf2
dest: knot_release.zip
dest: knot_release.zip

- name: Release
uses: softprops/action-gh-release@v1
if: ${{ env.RELEASE_VERSION != '' }}
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: pre-commit

on:
workflow_dispatch:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Checkout code
uses: actions/checkout@v3

- name: Run pre-commit
uses: pre-commit/action@v3.0.0
53 changes: 53 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
#
# SPDX-License-Identifier: Unlicense

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: trailing-whitespace
exclude: |
(?x)^(
Firmware/bootloader/|
Mechanical/|
Electrical/|
Graphics/|
Render/
)
- id: end-of-file-fixer
exclude: |
(?x)^(
Firmware/bootloader/|
Mechanical/|
Electrical/|
Graphics/|
Render/
)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
args: [-w]
exclude: |
(?x)^(
Firmware/bootloader/|
Mechanical/|
Electrical/|
Graphics/|
Render/
)
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
hooks:
- id: clang-format
exclude: |
(?x)^(
Firmware/bootloader/|
Mechanical/|
Electrical/|
Graphics/|
Render/
)
2 changes: 1 addition & 1 deletion Firmware/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
build
managed_components
dependencies.lock
dependencies.lock
36 changes: 18 additions & 18 deletions Firmware/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/**"
],
"defines": [],
"compilerPath": "/bin/cpp",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/**"
],
"defines": [],
"compilerPath": "/bin/cpp",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}
69 changes: 39 additions & 30 deletions Firmware/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,45 @@
"grid_led.h": "c",
"knot_midi_translator.h": "c",
"knot_midi_uart.h": "c"
},
},
"actionButtons": {
"defaultColor": "#ff0034", // Can also use string color names.
"loadNpmCommands":false, // Disables automatic generation of actions for npm commands.
"reloadButton":"♻️", // Custom reload button text or icon (default ↻). null value enables automatic reload on configuration change
"defaultColor": "#ff0034",
// Can also use string color names.
"loadNpmCommands": false,
// Disables automatic generation of actions for npm commands.
"reloadButton": "♻️",
// Custom reload button text or icon (default ↻). null value enables automatic reload on configuration change
"commands": [
{
"name": "ESP32 Docker",
"color": "white",
"singleInstance": true,
"command": "podman run --privileged -it -v /dev:/dev -v $PWD:/project -w /project espressif/idf:release-v5.1",
// clear && idf.py build && idf.py -p $(ls /dev/ttyACM*) flash
// ./burn_bootloader.sh
// clear && idf.py build && esptool.py --chip esp32s3 -p $(ls /dev/ttyACM*) --before=default_reset --after=no_reset write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x10000 build/midi_host_fw.bin && otatool.py -p $(ls /dev/ttyACM*) switch_ota_partition --slot 0
// clear && idf.py build && ./uf2convert.sh
},
{
"name": "ESP32 Monitor",
"color": "white",
"singleInstance": true,
"command": "podman run --privileged -it -v /dev:/dev -v $PWD:/project -w /project espressif/idf:release-v5.1",
// idf.py -p $(ls /dev/ttyUSB0) monitor
},
{
"name": "Unit Test",
"color": "white",
"singleInstance": true,
"command": "cd ./components/knot_midi_translator/host_test && ./test.sh",
}
{
"name": "pre-commit formatting",
"color": "white",
"singleInstance": true,
"command": "pre-commit run --show-diff-on-failure --color=always --all-files",
},
{
"name": "ESP32 Docker",
"color": "white",
"singleInstance": true,
"command": "podman run --privileged -it -v /dev:/dev -v $PWD:/project -w /project espressif/idf:release-v5.1",
// clear && idf.py build && idf.py -p $(ls /dev/ttyACM*) flash
// ./burn_bootloader.sh
// clear && idf.py build && esptool.py --chip esp32s3 -p $(ls /dev/ttyACM*) --before=default_reset --after=no_reset write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x10000
// build/midi_host_fw.bin && otatool.py -p $(ls /dev/ttyACM*) switch_ota_partition --slot 0 clear && idf.py build && ./uf2convert.sh
},
{
"name": "ESP32 Monitor",
"color": "white",
"singleInstance": true,
"command": "podman run --privileged -it -v /dev:/dev -v $PWD:/project -w /project espressif/idf:release-v5.1",
// idf.py -p $(ls /dev/ttyUSB0) monitor
},
{
"name": "Unit Test",
"color": "white",
"singleInstance": true,
"command": "cd ./components/knot_midi_translator/host_test && ./test.sh",
}
]
},
"git.ignoreLimitWarning": true
}
},
"git.ignoreLimitWarning": true
}
2 changes: 1 addition & 1 deletion Firmware/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. $HOME/$whoami/Documents/esp-idf/export.sh

idf.py build
idf.py build
2 changes: 1 addition & 1 deletion Firmware/burn_bootloader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ esptool.py --chip esp32s3 -p $(ls /dev/ttyACM*) --before=default_reset \
0x0 bootloader/bootloader.bin \
0x8000 bootloader/partition-table.bin \
0xe000 bootloader/ota_data_initial.bin \
0x410000 bootloader/tinyuf2.bin
0x410000 bootloader/tinyuf2.bin
2 changes: 1 addition & 1 deletion Firmware/burn_firmware.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
clear && idf.py build && esptool.py --chip esp32s3 -p $(ls /dev/ttyACM* | head -n 1) --before=default_reset --after=no_reset write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x10000 build/midi_host_fw.bin && otatool.py -p $(ls /dev/ttyACM* | head -n 1) switch_ota_partition --slot 0
clear && idf.py build && esptool.py --chip esp32s3 -p $(ls /dev/ttyACM* | head -n 1) --before=default_reset --after=no_reset write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x10000 build/midi_host_fw.bin && otatool.py -p $(ls /dev/ttyACM* | head -n 1) switch_ota_partition --slot 0
Loading

0 comments on commit b269b5f

Please sign in to comment.