Skip to content

Commit 0494792

Browse files
authored
Merge pull request #8 from LonghornRacingElectric/hal-abstraction
HAL Abstraction
2 parents 1f30b44 + 406409f commit 0494792

1,210 files changed

Lines changed: 689187 additions & 30184 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,7 @@ build/
7676
.stm32env
7777
compile_commands.json
7878
external/
79+
/VCU/firmware/Drivers
80+
VCU/firmware/.mxproject
81+
82+
.mxproject

VCU/firmware/.mxproject

Lines changed: 0 additions & 27 deletions
This file was deleted.

VCU/firmware/BUILD.bazel

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,29 @@ load("//:tools/outputs/build_outputs.bzl", "binary_out", "hex_out")
33

44
cc_binary(
55
name = "vcu_firmware_2026",
6-
srcs = glob(
7-
[
8-
"Core/Src/**/*.c",
9-
"Drivers/*HAL_Driver/**/*.c",
10-
"Middlewares/**/*.c",
11-
"USB_DEVICE/**/*.c",
12-
"Core/Inc/**/*.h",
13-
"Drivers/**/*.h",
14-
"Middlewares/**/*.h",
15-
"USB_DEVICE/**/*.h",
16-
],
17-
18-
allow_empty = True # allows empty globs, so the codebase can grow without refactoring
19-
),
6+
srcs = glob([
7+
"Core/Src/**/*.c",
8+
"Core/Inc/**/*.h",
9+
], allow_empty = True)
10+
+ [
11+
# Include the HAL for compilation
12+
"//drivers/stm32g4:hal_srcs",
13+
],
2014

2115
includes = [
2216
"Core/Inc",
23-
"Drivers/STM32G4xx_HAL_Driver/Inc",
24-
"Drivers/STM32G4xx_HAL_Driver/Inc/Legacy",
25-
"Drivers/CMSIS/Device/ST/STM32G4xx/Include",
26-
"Drivers/CMSIS/Include",
27-
"USB_DEVICE/App",
28-
"USB_DEVICE/Target",
29-
"Middlewares/ST/STM32_USB_Device_Library/Core/Inc",
30-
"Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc",
31-
"Middlewares/Third_Party/FreeRTOS/Source/include",
32-
"Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2",
33-
"Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F",
34-
"//longhorn-lib:longhorn_lib"
3517
],
3618

37-
# Linker options
19+
deps = [
20+
"//drivers/stm32g4:stm32_headers",
21+
],
22+
23+
# Linker options, also includes the reset handler startup file
3824
linkopts = [
3925
"-T $(location //toolchain:stm32g474vetx_flash_script)",
4026
"$(location //toolchain:stm32g474_startup)",
4127
],
4228

43-
# Defines for the C preprocessor
4429
defines = [
4530
"DEBUG",
4631
"USE_HAL_DRIVER",
@@ -52,7 +37,6 @@ cc_binary(
5237
"//toolchain:stm32g474_startup",
5338
],
5439

55-
# Target platform constraints
5640
target_compatible_with = [
5741
"@platforms//cpu:arm",
5842
"@platforms//os:none",
@@ -67,6 +51,6 @@ binary_out(
6751
)
6852

6953
hex_out(
70-
name = "vcu_firmare_hex",
54+
name = "vcu_firmware_hex",
7155
src = ":vcu_firmware_2026"
72-
)
56+
)

0 commit comments

Comments
 (0)