Browse Source

Add VS code files and clang-format/tidy

master
Maximilian Grau 11 months ago
parent
commit
14fdce7eb6
  1. 9
      .clang-format
  2. 65
      .clang-tidy
  3. 1
      .gitignore
  4. 26
      .vscode/c_cpp_properties.json
  5. 42
      .vscode/launch.json
  6. 61
      .vscode/tasks.json

9
.clang-format

@ -0,0 +1,9 @@
BasedOnStyle: "LLVM"
AccessModifierOffset: "-4"
AllowShortFunctionsOnASingleLine: "false"
BreakBeforeBraces: "Allman"
ColumnLimit: "100"
IndentCaseLabels: "false"
IndentWidth: "4"
AlwaysBreakTemplateDeclarations: "true"

65
.clang-tidy

@ -0,0 +1,65 @@
Checks: abseil-*,
altera-struct-pack-align,
bugprone-*,
-bugprone-bool-pointer-implicit-conversion,
-bugprone-exception-escape,
-bugprone-infinite-loop,
-bugprone-signed-char-misuse,
boost-*,
cert-dcl03-c,
cert-dcl21-cpp,
cert-dcl58-cpp,
cert-err34-c,
cert-err52-cpp,
cert-err58-cpp,
cert-err60-cpp,
cert-flp30-c,
cert-msc50-cpp,
cert-msc51-cpp,
cert-oop54-cpp,
cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-narrowing-conversions,
cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-slicing,
google-default-arguments,
google-explicit-constructor,
google-runtime-operator,
hicpp-exception-baseclass,
hicpp-multiway-paths-covered,
misc-*,
-misc-non-private-member-variables-in-classes,
-misc-unused-*,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-use-default-member-init,
-modernize-use-trailing-return-type,
mpi-*,
openmp-use-default-none,
performance-*,
portability-*,
readability-*,
-readability-braces-around-statements,
-readability-convert-member-functions-to-static,
-readability-function-size,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-named-parameter,
-readability-qualified-auto,
-readability-redundant-access-specifiers,
-readability-uppercase-literal-suffix,

1
.gitignore vendored

@ -4,3 +4,4 @@ build/
!.vscode/launch.json
!.vscode/tasks.json
cubemx/*.mxproject
compile_commands.json

26
.vscode/c_cpp_properties.json vendored

@ -0,0 +1,26 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/",
"${workspaceFolder}/cubemx/Core/Inc",
"${workspaceFolder}/cubemx/Drivers/STM32L4xx_HAL_Driver/Inc",
"${workspaceFolder}/cubemx/Drivers/STM32L4xx_HAL_Driver/Inc/Legacy",
"${workspaceFolder}/cubemx/Middlewares/Third_Party/FreeRTOS/Source/include",
"${workspaceFolder}/cubemx/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2",
"${workspaceFolder}/cubemx/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F",
"${workspaceFolder}/cubemx/Drivers/CMSIS/Device/ST/STM32L4xx/Include",
"${workspaceFolder}/cubemx/Drivers/CMSIS/Include",
"${workspaceFolder}/src"
],
"defines": [
"STM32L432xB"
],
"compilerPath": "arm-none-eabi-gcc",
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 4
}

42
.vscode/launch.json vendored

@ -0,0 +1,42 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "cortex-debug",
"request": "launch",
"name": "Debug (ST-LINK)",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/build/debug/solder_workspace_lighting.elf",
"servertype": "stutil",
"device": "STM32L432KB",
"runToMain": true
},
{
"type": "cortex-debug",
"request": "launch",
"name": "Debug (J-Link)",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/build/debug/solder_workspace_lighting.elf",
"serverpath": "JLinkGDBServer",
"servertype": "jlink",
"device": "STM32L432KB",
"interface": "swd",
"runToMain": true
},
{
"type": "cortex-debug",
"request": "launch",
"name": "Debug (J-Link, RTOS-aware)",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/build/debug/solder_workspace_lighting.elf",
"serverpath": "JLinkGDBServer",
"servertype": "jlink",
"device": "STM32L432KB",
"interface": "swd",
"rtos": "FreeRTOS"
}
]
}

61
.vscode/tasks.json vendored

@ -0,0 +1,61 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"type": "shell",
"command": "make",
"args": [
"-j8"
],
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
},
"tasks": [
{
"label": "Clean all",
"args": [
"clean"
],
"group": "build",
"problemMatcher": []
},
{
"label": "Build firmware (Debug)",
"args": [],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "Build firmware (Release)",
"args": [
"RELEASE=1",
"RELEASE_OPT=3"
],
"group": "build",
"problemMatcher": [
"$gcc"
]
},
{
"label": "Build firmware (Release, size-optimized)",
"args": [
"RELEASE=1",
"RELEASE_OPT=s"
],
"group": "build",
"problemMatcher": [
"$gcc"
]
}
]
}
Loading…
Cancel
Save