diff --git a/.clangd b/.clangd new file mode 100644 index 000000000..c86df530d --- /dev/null +++ b/.clangd @@ -0,0 +1,2 @@ +CompileFlags: + CompilationDatabase: "firmware/build" diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index 3c11f29cc..000000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "env": { - "PROJECT" : "DemoProjectRTOS" - }, - "configurations": [ - { - "name": "STM32F7", - "includePath": [ - "${workspaceFolder}/firmware", - "${workspaceFolder}/firmware/projects/${PROJECT}/inc", - "${workspaceFolder}/firmware/projects/FrontController/vehicle_control_system/src/vehicle_control_system-autogen/controller_autogen_ert_rtw", - "${workspaceFolder}/firmware/projects/${PROJECT}/platforms/stm32f767/cubemx/Inc", - "${workspaceFolder}/firmware/drivers/stm32f767/CMSIS/Device", - "${workspaceFolder}/firmware/drivers/stm32f767/CMSIS/Device/ST/STM32F7xx/Include", - "${workspaceFolder}/firmware/drivers/stm32f767/CMSIS/Core/Include", - "${workspaceFolder}/firmware/drivers/stm32f767/", - "${workspaceFolder}/firmware/drivers/stm32f767/STM32F7xx_HAL_Driver/Inc", - "${workspaceFolder}/firmware/projects/${PROJECT}/platforms/stm32f767/cubemx/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2" - ], - "defines": [ - "_DEBUG", - "UNICODE", - "_UNICODE", - "STM32F767xx", - "USE_HAL_DRIVER" - ], - "windowsSdkVersion": "10.0.19041.0", - "compilerPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-g++.exe", - "cStandard": "c17", - "cppStandard": "c++20", - "intelliSenseMode": "windows-gcc-arm" - }, - { - "name": "Windows", - "includePath": [ - "${workspaceFolder}/firmware", - "${workspaceFolder}/firmware/projects/${PROJECT}/inc" - ], - "defines": [ - "_DEBUG", - "UNICODE", - "_UNICODE" - ], - "compilerPath": "g++", - "cStandard": "c17", - "cppStandard": "c++20", - "intelliSenseMode": "windows-gcc-x64" - }, - { - "name" : "Test", - "includePath": [ - "${workspaceFolder}/firmware", - "${workspaceFolder}/firmware/tests/googletest/googletest/include", - "${workspaceFolder}/firmware/projects/${PROJECT}/inc", - ], - "cppStandard": "c++20", - "configurationProvider": "ms-vscode.cpptools", - "intelliSenseMode": "windows-gcc-x64" - } - ], - "version": 4 -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 1141b3e46..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "files.associations": { - "*.pyscn": "python", - "*.py": "python", - "ios": "cpp", - "cstdint": "cpp", - "stm32f7xx_hal.h": "c", - "stm32f7xx_hal_conf.h": "c", - "array": "cpp", - "atomic": "cpp", - "bit": "cpp", - "*.tcc": "cpp", - "cctype": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "compare": "cpp", - "concepts": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "deque": "cpp", - "unordered_map": "cpp", - "vector": "cpp", - "exception": "cpp", - "algorithm": "cpp", - "functional": "cpp", - "iterator": "cpp", - "memory": "cpp", - "memory_resource": "cpp", - "numeric": "cpp", - "optional": "cpp", - "random": "cpp", - "string": "cpp", - "string_view": "cpp", - "system_error": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "utility": "cpp", - "initializer_list": "cpp", - "iosfwd": "cpp", - "iostream": "cpp", - "istream": "cpp", - "limits": "cpp", - "new": "cpp", - "ostream": "cpp", - "ranges": "cpp", - "stdexcept": "cpp", - "streambuf": "cpp", - "cinttypes": "cpp", - "typeinfo": "cpp" - } -} \ No newline at end of file diff --git a/firmware/Makefile b/firmware/Makefile index 586c535e0..2f553f757 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -1,15 +1,20 @@ PLATFORM = PROJECT = -BUILD_DIR = build/$(PROJECT)/$(PLATFORM) +BUILD = build +BUILD_DIR = $(BUILD)/$(PROJECT)/$(PLATFORM) CUBEMX_DIR := projects/$(PROJECT)/platforms/$(PLATFORM)/cubemx +COMPILE_COMMANDS_DEST = $(BUILD)/compile_commands.json + build: FORCE - cmake -B $(BUILD_DIR) -S. -G"Unix Makefiles" -DPROJECT=$(PROJECT) -DPLATFORM=$(PLATFORM) + cmake -B $(BUILD_DIR) -S. -G"Unix Makefiles" -DPROJECT=$(PROJECT) -DPLATFORM=$(PLATFORM) -D CMAKE_EXPORT_COMPILE_COMMANDS=1 cmake --build $(BUILD_DIR) + cp $(BUILD_DIR)/compile_commands.json $(COMPILE_COMMANDS_DEST) clean: FORCE rm -rf $(BUILD_DIR) + rm $(COMPILE_COMMANDS_DEST) deepclean: clean ifeq ($(findstring stm32,$(PLATFORM)),stm32) diff --git a/firmware/README.md b/firmware/README.md index bd021df77..9c95be925 100644 --- a/firmware/README.md +++ b/firmware/README.md @@ -22,3 +22,9 @@ The following dependecies must be installed __and added to your PATH variable.__ * STM32CubeMX 6.8.1 - [link](https://www.st.com/en/development-tools/stm32cubemx) * Select the 6.8.1 version in the __Get Software__ section. * Verify by running `stm32cubemx`. The application should open. + +* clangd - [link](https://clangd.llvm.org/installation) + * This is our "official" C/C++ language server. + * You should also install the __clangd__ extension for your IDE. + * If you have the Microsoft __C/C++__ extension installed, disable it for the `racecar` workspace. + * Verify with ``clangd --version``.