Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
606 commits
Select commit Hold shift + click to select a range
e4a14e6
✏️ Fix typo on follow wall variable
GabrielCosme Apr 27, 2025
7e47a37
🎨 Improve variable names and comments
GabrielCosme Apr 28, 2025
f69afe9
🎨 Improve function names from states and actions
GabrielCosme Apr 28, 2025
8faa187
🚚 Move run function to Micras
GabrielCosme Apr 29, 2025
e4fb633
🚸 Add start_orientation to turn action
GabrielCosme Apr 29, 2025
0025630
✨ Add interface class
GabrielCosme Apr 29, 2025
902a276
✨ Add on_entry function to states
GabrielCosme Apr 29, 2025
cc9f2e7
🎨 Add sensor name enum to follow wall
GabrielCosme Apr 29, 2025
ff966bf
🚸 Add enum for the action types
GabrielCosme Apr 29, 2025
800400c
🚨 Fix linter warnings
GabrielCosme Apr 29, 2025
77aa3ff
🚚 Move observation to follow wall
GabrielCosme Apr 29, 2025
20ef6b3
🎨 Apply suggestions from code review
GabrielCosme Apr 30, 2025
4f8119d
🎨 Add max_angular_speed calculation function to turn action
GabrielCosme Apr 30, 2025
21cde1f
🎨 Add enum to wall sensors
GabrielCosme Apr 30, 2025
d9e7774
🚨 Fix linter warnings on FollowWall
GabrielCosme Apr 30, 2025
a8b0fbd
Merge commit 'd9e7774a0a451dbf2b37aef812ab5689801d8f6d' into feature/…
GabrielCosme Apr 30, 2025
308e4b4
🔥 Remove comments from Maze constructor
GabrielCosme Apr 30, 2025
cb7f1fc
🚸 Add WallSensorIndex struct to core
GabrielCosme Apr 30, 2025
80345bc
Merge pull request #40 from Team-Micras/feature/new-architecture
GabrielCosme Apr 30, 2025
af9b57d
Merge branch 'main' of github.com:Team-Micras/MicrasFirmware into fea…
GabrielCosme Apr 30, 2025
7530d31
✨ Add lint target
GabrielCosme May 1, 2025
ef50a07
🚸 Simplify linter script
GabrielCosme May 1, 2025
b1f8feb
🚚 Move run_clang_tidy to scripts folder
GabrielCosme May 2, 2025
f4c85bb
🐛 Fix run_clang_tidy script
GabrielCosme May 2, 2025
9ed01c0
🚸 Make run_clang_tidy a script template
GabrielCosme May 2, 2025
6419344
💄 Improve run_clang_tidy script
GabrielCosme May 2, 2025
5cfe90b
🎨 Format shell script
GabrielCosme May 2, 2025
ee3e0da
📝 Add missing action_is param to actions documentation
GabrielCosme May 2, 2025
db10971
🚚 Move recompute function to prepare
GabrielCosme May 2, 2025
60882da
🚨 Remove initializer from action_queuer queue
GabrielCosme May 2, 2025
6af78a0
Merge pull request #42 from Team-Micras/feature/interface
GabrielCosme May 2, 2025
3dcf1ee
Merge branch 'main' of github.com:Team-Micras/MicrasFirmware into fea…
GabrielCosme May 3, 2025
a367c06
🚚 Move Point to core as Vector
GabrielCosme May 3, 2025
4a2f727
🔥 Delete Information struct
GabrielCosme May 3, 2025
235ee72
⚡️ Improve flood fill function
GabrielCosme May 4, 2025
0da45e1
✨ Add new return algorithm
GabrielCosme May 4, 2025
4ebd47b
🐛 Fix compute costmap calls on exploration
GabrielCosme May 4, 2025
7309047
⚡️ Improve visited cell logic
GabrielCosme May 4, 2025
bf8d932
⚡️ Add flip cost to maze get next goal
GabrielCosme May 4, 2025
e191944
🐛 Fix new_cost type on compute_best_route
GabrielCosme May 4, 2025
cffd70f
🐛 Fix current_cost type on compute_best_route
GabrielCosme May 4, 2025
962cab6
🚸 Make get_next_goal deterministic
GabrielCosme May 4, 2025
b9b2cda
🥅 Fix compilation errors
GabrielCosme May 4, 2025
191148c
⚡️ Fix unexplored cells values
GabrielCosme May 4, 2025
4436f59
🔥 Remove unused includes
GabrielCosme May 6, 2025
6c99620
🚸 Move sysroot search from .clang-tidy to run script
GabrielCosme May 6, 2025
136b63c
Merge pull request #43 from Team-Micras/feature/lint-target
GabrielCosme May 8, 2025
f1b6c7f
Merge branch 'main' of github.com:Team-Micras/MicrasFirmware into fea…
GabrielCosme May 8, 2025
82af9d4
🚧 Add new return algorithm to maze using costmap layers
GabrielCosme May 9, 2025
c898ee0
📝 Add costmap and maze documentation
GabrielCosme May 9, 2025
f5124ae
🐛 Fix costmap bugs
GabrielCosme May 10, 2025
e473787
⚡️ Improve recompute function on costmap
GabrielCosme May 10, 2025
bb60580
🐛 Make get_best_route use bfs
GabrielCosme May 10, 2025
5a7cc2b
🐛 Change best_route from map to list
GabrielCosme May 10, 2025
c48de28
🐛 Fix virtual walls being overwritten
GabrielCosme May 10, 2025
227ae6c
🐛 Fix number of layers in costmap
GabrielCosme May 10, 2025
4177c41
⚡️ Recompute best route at each new wall
GabrielCosme May 10, 2025
7386db7
Merge pull request #44 from Team-Micras/feature/maze-algorithms
PedroDeSanti Jun 7, 2025
e42be99
🐛 Set BOARD_VERSION to "v1" in CMakeLists.txt and adjust ADC calibrat…
PedroDeSanti Dec 13, 2025
19f13d9
🔧Update ioc file
GabrielCosme Dec 13, 2025
603bf67
🚧 comment flash code
PedroDeSanti Dec 13, 2025
0cbbb78
🚧 comment fan direction code
PedroDeSanti Dec 13, 2025
0f1d733
🐛 Fix flash memory hal
GabrielCosme Dec 14, 2025
fc4a6fe
🐛 Fix flash hal import
GabrielCosme Sep 16, 2026
fc29bb4
⬆️ Update imu library and implementation
GabrielCosme Sep 16, 2026
9e4a6a7
🐛 Fix storage proxy for flash changes
GabrielCosme Sep 16, 2026
1ee36f1
🐛 Fix CMake after cube 6.14
GabrielCosme Sep 16, 2026
dd369a6
♻️ Refactor flash and storage
GabrielCosme Sep 16, 2026
5e10da8
✨ Add changes from micras 1.5 branch
GabrielCosme Sep 17, 2026
5d5f22c
✨ Drive all wall sensor emitters
GabrielCosme Sep 17, 2026
cc12355
🥅 Fail build on unsupported ADC calibration platform
GabrielCosme Sep 17, 2026
df29bad
⚡ Enable instruction cache
GabrielCosme Sep 17, 2026
1be6bc0
🐛 Use timer clock to set PWM frequency
GabrielCosme Sep 17, 2026
3f35f05
🚨 Fix clang-tidy crash in flash word alignment check
GabrielCosme Sep 17, 2026
d1d2d9a
Merge pull request #48 from Team-Micras/feature/new_microcontroller
GabrielCosme Sep 18, 2026
b1b1259
✨ Add maze graph
GabrielCosme May 14, 2025
0129d0e
✨ Add action id and total time to actions
GabrielCosme May 14, 2025
15cdd3a
✨ Add get_relative_side to GridPose
GabrielCosme May 14, 2025
deb2136
✨ Add push_solving function to action queuer
GabrielCosme May 14, 2025
aadfdad
📝 Add comments to nav methods
GabrielCosme May 15, 2025
12124ef
✨ Make graph return best route
GabrielCosme May 15, 2025
c5c650b
🚸 Split maze constructor
GabrielCosme May 16, 2025
1daeafb
✨ Add route optimizations to action queuer
GabrielCosme May 17, 2025
40f2788
🐛 Fix trim distance on diagonals
GabrielCosme May 18, 2025
bf0ce38
🐛 Fix turn action orientation
GabrielCosme May 18, 2025
c1df2b2
🐛 Fix deceleration angle on turn
GabrielCosme May 18, 2025
a39e077
🐛 Fiz erase order on maze graph
GabrielCosme May 18, 2025
3fbc594
🐛 Fix action queuer diagonal check
GabrielCosme May 18, 2025
a3741b7
🐛 Fix start action when solving
GabrielCosme May 18, 2025
db09489
🐛 Fix action queuer pop
GabrielCosme May 18, 2025
e2030d4
🐛 Remove 180 turns from remove_extra_nodes function
GabrielCosme May 19, 2025
71ac76f
🐛 Fix dijkstra pop top
GabrielCosme May 19, 2025
4ba8f22
🐛 Fix speed calculation on turn action
GabrielCosme May 19, 2025
9d29ece
🐛 Disable diagonal follow wall
GabrielCosme May 19, 2025
62b79a6
🐛 Fix correction factor on turn action
GabrielCosme May 19, 2025
656d97f
⚡️ Improve correction factor on turn action
GabrielCosme May 19, 2025
839ee9a
🐛 Fix diagonal distance and total time on action queuer
GabrielCosme May 19, 2025
5fd581d
⚡️ Change actions to be time based
GabrielCosme May 19, 2025
926d852
⚡️ Make move action use current robot pose
GabrielCosme May 19, 2025
968ffed
🐛 Remove const from action finished
GabrielCosme May 19, 2025
3438169
🐛 Fix get_relative_side function
GabrielCosme May 19, 2025
f7511ef
🐛 Fix second turn angle on diagonal
GabrielCosme May 19, 2025
2206869
✨ Fix trim distances before and after diagonals
GabrielCosme May 20, 2025
5948932
🐛 Fix side displacement on action queuer trim distance
GabrielCosme May 20, 2025
b24edcd
🐛 Fix forward displacement from turn action
GabrielCosme May 20, 2025
21eb37e
🐛 Fix action queuer get_trim_distances
GabrielCosme May 21, 2025
2af20c9
🐛 Fix turn max_angular_speed calculation
GabrielCosme May 21, 2025
914a5d4
🥅 Add reset function to maze_graph
GabrielCosme May 21, 2025
89828dd
🐛 Fix total time calculations on actions
GabrielCosme May 21, 2025
cf42b77
✨ Add variable radius to action queuer
GabrielCosme May 22, 2025
1c0b6be
✨ Improve maze graph node connections
GabrielCosme May 22, 2025
12c9642
🐛 Fix max angular speed on exploration turn actions
GabrielCosme May 22, 2025
5a2cc90
🐛 Fix displacement calculation from solving turn actions
GabrielCosme May 22, 2025
d82dcc1
🐛 Fix solve start action distance
GabrielCosme May 22, 2025
8e457a7
🐛 Disable follow wall on diagonal
GabrielCosme May 22, 2025
a3eb191
✨ Add remove_node method to maze_graph
GabrielCosme May 23, 2025
00790a5
⚡️ Remove time from diagonal trim on get_edge_cost
GabrielCosme May 23, 2025
b4cf46b
✨ Add fan events to interface
GabrielCosme May 24, 2025
9ee46b2
✨ Add curve safety margin to action queuer
GabrielCosme May 24, 2025
95d7abe
♿️ Improve action queuer constructor
GabrielCosme May 24, 2025
342612d
🐛 Disable follow wall on actions
GabrielCosme May 24, 2025
56b0439
⚡️ Add move_from_turn action
GabrielCosme May 24, 2025
dfd4f08
🐛 Fix curve parameters access
GabrielCosme May 24, 2025
06aed30
🐛 Can't skip using 180 turn
GabrielCosme May 24, 2025
fc5f054
⚡️ Add first run flag to pid
GabrielCosme May 24, 2025
b7911d6
⚡️ Clamp follow wall response
GabrielCosme May 24, 2025
2557120
⚡️ Fix exploration linear speed on action queuer
GabrielCosme May 25, 2025
6f8e630
✨ Clear the odometry positional error from the follow wall
GabrielCosme May 25, 2025
7edcfd1
🐛 Add odometry initial pose
GabrielCosme May 25, 2025
e3d5673
⚡️ Use reading instead of error on follow wall check posts
GabrielCosme May 25, 2025
f6672eb
🐛 Fix post reference on follow wall
GabrielCosme May 25, 2025
48c9913
⏪ Add post clearance back
GabrielCosme May 25, 2025
b715e26
⚡️ Remove feed forward limiter
GabrielCosme May 25, 2025
dc2fd8e
🔥 Disable follow wall near post references
GabrielCosme May 26, 2025
7f9bc04
🔥 Remove max_linear_speed from follow wall
GabrielCosme May 26, 2025
8881af6
🐛 Fix angle to grid conversion
GabrielCosme May 26, 2025
d99d748
⚡️ Reset pid after follow wall change
GabrielCosme May 26, 2025
96889e8
🚧 Use dfs instead of graph to compute best route
GabrielCosme May 26, 2025
fcb9a39
✨ Add diagonals post processing to action queuer
GabrielCosme May 27, 2025
83d96b9
⚡️ Change best_route computation to recursive approach
GabrielCosme May 27, 2025
38c5fb2
⚗️ Add heuristic function to compute best route
GabrielCosme May 27, 2025
43d6d5a
🐛 Fix action queuer join actions
GabrielCosme May 28, 2025
89cbc97
✨ Add signal handler
GabrielCosme May 30, 2025
66969e1
🚸 Change imu submodule to CMake fetch
GabrielCosme Jun 8, 2025
2565be3
🚨 Fix linter warnings
GabrielCosme Jun 8, 2025
724e4ef
⬆️ Update imu library to 5.1.1
GabrielCosme Dec 15, 2025
da777b1
⬆️ Move the toolchain to Ubuntu 26.04, clang 22 and C++23
GabrielCosme Sep 18, 2026
0797c37
🚨 Scope every enum and make the integer conversions explicit
GabrielCosme Sep 18, 2026
9b0bff4
🚨 Use std::get for the constant container indices
GabrielCosme Sep 18, 2026
676eb6d
🚨 Name the fields when returning aggregates
GabrielCosme Sep 18, 2026
f6cbb18
🚨 Re-enable the suspended clang-tidy checks
GabrielCosme Sep 18, 2026
6df9f31
🐛 Filter the padded progress counters from the lint output
GabrielCosme Sep 18, 2026
9c17b55
🚑️ Fix the clocks, the timebase and the SPI modes in micras_hal
GabrielCosme Sep 19, 2026
eb52e62
🚑️ Correct the filter mathematics and index the FSM by state id
GabrielCosme Sep 19, 2026
727d7b6
🚑️ Fix the sensors and actuators in micras_proxy
GabrielCosme Sep 19, 2026
3417ee8
♻️ Borrow the proxies instead of sharing ownership of them
GabrielCosme Sep 19, 2026
cf2f096
📝 Move the explanations out of the function bodies
GabrielCosme Sep 19, 2026
bff88e9
♻️ Take the generated initialization functions instead of naming them
GabrielCosme Sep 19, 2026
5d42957
🏗️ Make the packages depend downwards only
GabrielCosme Sep 19, 2026
174f3f9
📝 Justify the comments instead of narrating them
GabrielCosme Sep 19, 2026
640cbf3
✨ Generate the motion as segments, one speed evaluator and a referenc…
GabrielCosme Sep 20, 2026
c33f176
✨ Control the position with a feed forward and measure its constants …
GabrielCosme Sep 20, 2026
73fc028
♻️ Rebuild the navigation around one pose estimate, a wall map and a …
GabrielCosme Sep 20, 2026
75d7551
✨ Add constant expression math and the filter delay to micras_core
GabrielCosme Sep 20, 2026
10a32c8
♻️ Choose the monitored PID controller in its configuration
GabrielCosme Sep 20, 2026
43e652f
🚚 Move the template implementations to impl/*.tpp
GabrielCosme Sep 20, 2026
662cce0
✨ Let a PWM output be inverted and an ADC keep whole sequences
GabrielCosme Sep 20, 2026
ad0b7a3
✨ Add the watchdog and tick proxies
GabrielCosme Sep 20, 2026
39abc31
🐛 Keep the low pass filter accurate at cutoffs far below its rate
GabrielCosme Sep 20, 2026
1dec503
🐛 Start an inverted PWM output off instead of fully on
GabrielCosme Sep 20, 2026
453575b
✨ Let the DMA carry out an SPI transfer
GabrielCosme Sep 20, 2026
87b2024
⚡️ Read the inertial measurement unit in one burst that the DMA carri…
GabrielCosme Sep 20, 2026
6251e46
⚡️ Fire the wall sensor emitters in two groups, twice as often
GabrielCosme Sep 20, 2026
cab4f77
📝 Say what the filter math accelerator can really hold
GabrielCosme Sep 20, 2026
459f4bb
✨ Describe the variables of the robot in one place
GabrielCosme Sep 22, 2026
7c64573
♻️ Keep the flash image and the variables that fill it apart
GabrielCosme Sep 22, 2026
d2c04a5
✨ Let the robot be watched and steered over a link
GabrielCosme Sep 22, 2026
026e7e4
🔌 Reach the radio module without spending the control loop
GabrielCosme Sep 22, 2026
17a804e
✨ Put the link in the control loop
GabrielCosme Sep 22, 2026
1235787
✅ Run the parts with no hardware behind them on the host
GabrielCosme Sep 22, 2026
b7da80f
♻️ Leave the choice of what to publish to whoever is publishing
GabrielCosme Sep 22, 2026
61ddf58
🔥 Drop what the rest of it already answers
GabrielCosme Sep 22, 2026
81a54e3
🔥 Take the scope out
GabrielCosme Sep 23, 2026
bc69df8
📝 Say what the receptacle actually is
GabrielCosme Sep 23, 2026
5285e2d
♻️ Compute the frame check from the polynomial
GabrielCosme Sep 23, 2026
246da9c
♻️ Check frames with two running sums
GabrielCosme Sep 23, 2026
dadd8e7
✨ Describe the robot physically and design the turns from it
GabrielCosme Sep 20, 2026
af05357
🐛 Correct the sensing, the estimate and the control the simulation fo…
GabrielCosme Sep 25, 2026
804c3e8
✨ Plan with labels and add the turns of two bends
GabrielCosme Sep 25, 2026
f9250c1
✨ Brake and accelerate through the turns as their curvature allows
GabrielCosme Sep 25, 2026
f4a55cb
✨ Drive a racing line through the cells of the route, on the second s…
GabrielCosme Sep 25, 2026
26cf332
♻️ Split the simulator into an engine, a view, a bridge and an app ov…
GabrielCosme Sep 25, 2026
150d960
🐛 Address the review of the low level layer
GabrielCosme Sep 26, 2026
3c16178
⚡️ Design the turn tables once, and take out what the navigation neve…
GabrielCosme Sep 27, 2026
3fa4b67
✨ Watch everything through the variable pool, and run the fan in main…
GabrielCosme Sep 27, 2026
ec2b8bf
📝 Say what the rest of the firmware does, not how it got there
GabrielCosme Sep 27, 2026
251688a
♻️ Cut what nothing uses from the simulator, and fix what the review …
GabrielCosme Sep 27, 2026
a1f39b9
Merge pull request #52 from Team-Micras/low-level-review
PedroDeSanti Sep 27, 2026
3eeb3a5
🎨 Format with the clang-format the CI runs
GabrielCosme Sep 27, 2026
7f412b3
🐛 Build, test and lint the navigation the way the CI does
GabrielCosme Sep 27, 2026
4784aba
⬆️ Follow the firmware onto the merged low level review
GabrielCosme Sep 27, 2026
93c3b35
🐛 Restart a converter that an overrun stopped
GabrielCosme Sep 27, 2026
a3a4bc8
⬆️ Follow the firmware's restart of a stopped converter
GabrielCosme Sep 27, 2026
f6df2b1
🐛 Answer the review of the navigation
GabrielCosme Sep 27, 2026
f402f6f
⬆️ Follow the firmware's answer to the review of the navigation
GabrielCosme Sep 27, 2026
429018a
⏪ Price the turns at their speed again, without the factor
GabrielCosme Sep 27, 2026
96a96a3
🐛 Price a turn entered slowly at a blend, and a slower next turn at n…
GabrielCosme Sep 27, 2026
db65a19
🐛 Answer the second review of the navigation
GabrielCosme Sep 27, 2026
fb1d9ef
🐛 Answer the third review of the navigation
GabrielCosme Sep 27, 2026
788a44e
✨ Brake no harder than the motors can
GabrielCosme Sep 27, 2026
2244659
🐛 Answer the fourth review of the navigation
GabrielCosme Sep 27, 2026
e738fb3
Merge pull request #54 from Team-Micras/high-level-review
GabrielCosme Sep 27, 2026
a8fdbe7
✨ Give the host SPI a device slot keyed by bus and chip select
GabrielCosme Sep 28, 2026
7aed279
✨ Model the LSM6DSV and AS5047U as SPI devices
GabrielCosme Sep 28, 2026
9f6f297
✨ Run the firmware's own SPI chip proxies over the chip models
GabrielCosme Sep 28, 2026
892a56e
🔀 Bring the host HAL with its history
GabrielCosme Sep 28, 2026
c14c6a7
🔧 Make the shared build and style files canonical
GabrielCosme Sep 28, 2026
cb09be0
🏗️ Build the libraries from one root project
GabrielCosme Sep 28, 2026
3f14d1d
✨ Run the FMAC and a power loss on the host backend
GabrielCosme Sep 28, 2026
9c9c55e
🚚 Move the tests into one folder per suite
GabrielCosme Sep 28, 2026
a69bd07
✅ Test the libraries with doctest over a fake reference board
GabrielCosme Sep 28, 2026
6600191
✅ Seed the navigation tests on the contest mazes
GabrielCosme Sep 28, 2026
995b82c
🚨 Lint the tpp files and the ported tests with clang-tidy 22
GabrielCosme Sep 28, 2026
c6c958c
🔗 Keep the core's archive after the HAL's on a consumer's link line
GabrielCosme Sep 28, 2026
2cba869
🔥 Leave the robot's wall sensor layout and radio wiring to the robot
GabrielCosme Sep 28, 2026
bcaa4d6
✨ Build and link a bench on a reference STM32H725 project
GabrielCosme Sep 28, 2026
8145cf5
📝 Document the libraries for their consumers
GabrielCosme Sep 28, 2026
a2a5203
👷 Check every push in the host and STM32H7 jobs
GabrielCosme Sep 28, 2026
b75c696
🔧 Store every text file with LF
GabrielCosme Sep 28, 2026
7d3d42b
✏️ Spell normalization the American way in the attributes
GabrielCosme Sep 28, 2026
2ca7a5f
👷 Cache the fetch stamps with the fetched sources
GabrielCosme Sep 28, 2026
af794c0
📝 Name the HAL callbacks AdcDma and Spi define for their consumers
GabrielCosme Sep 28, 2026
1224489
🔧 Store the reference's derived clock frequencies for its 400 MHz PLL
GabrielCosme Sep 28, 2026
978476b
♻️ Move the STM32H7 steps of the stm32 backend behind family functions
GabrielCosme Sep 28, 2026
0478b4a
✨ Add the STM32G4 family to the stm32 backend
GabrielCosme Sep 28, 2026
81e5496
🚨 Check the shared code for chip macros in the host job
GabrielCosme Sep 28, 2026
c97845d
♻️ Share the bench program and the reference CMake between families
GabrielCosme Sep 28, 2026
8bbf81a
✨ Build and link a bench on a reference STM32G474 project
GabrielCosme Sep 28, 2026
5220917
📝 Document the STM32 families for their consumers
GabrielCosme Sep 28, 2026
3d1e055
📝 Document the watchdog registers of the host backend
GabrielCosme Sep 28, 2026
3f05112
♻️ Derive the STM32H7 storage address from the family flash header
GabrielCosme Sep 28, 2026
b7cdd33
🔥 Drop the G4 data cache flush that HAL_FLASH_Program already does
GabrielCosme Sep 28, 2026
dc2d3d8
✏️ Spell traveled the American way in the mission
GabrielCosme Sep 28, 2026
5782dab
♻️ Declare the STM32G4 storage checks in the family flash header
GabrielCosme Sep 28, 2026
4b83fbd
♻️ Keep the STM32H7 debug unlock key in an anonymous namespace
GabrielCosme Sep 28, 2026
d826b41
📝 Document the SPI modes, the host SPI and FMAC types and the test bo…
GabrielCosme Sep 28, 2026
5ecc620
🔀 Grow from the empty main
GabrielCosme Sep 28, 2026
e621cd6
🐛 Finish a UART transmission without the UART interrupt
GabrielCosme Oct 4, 2026
901ebd9
⚡️ Run the torque, battery and serial transfers without interrupts
GabrielCosme Oct 4, 2026
d9beafd
👷 Check each commit once, by its push, and pull requests only from forks
GabrielCosme Oct 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent
AlignConsecutiveBitFields:
Enabled: true
PadOperators: true
AlignConsecutiveDeclarations:
Enabled: true
PadOperators: true
AlignConsecutiveMacros:
PadOperators: true
AlignEscapedNewlines: Left
AllowShortBlocksOnASingleLine: Empty
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
ColumnLimit: 120
EmptyLineBeforeAccessModifier: Always
IncludeCategories:
- Regex: '^<.*>'
Priority: 1
SortPriority: 1
- Regex: '^".*"'
SortPriority: 2
# No include is treated as the main header, so that sorting preserves the existing
# grouping instead of promoting the header matching the source file name
IncludeIsMainRegex: 'NO_MAIN_INCLUDE'
IndentCaseLabels: true
IndentExternBlock: NoIndent
IndentPPDirectives: BeforeHash
IndentRequiresClause: false
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
LineEnding: LF
PackConstructorInitializers: NextLine
PointerAlignment: Left
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 0
SortIncludes: CaseSensitive
SpaceInEmptyBlock: true
SpacesBeforeTrailingComments: 2
Standard: Latest
TabWidth: 4
...
79 changes: 79 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
# llvm-include-order enforces LLVM's own ordering, which contradicts the project's
# .clang-format rules; clang-format is the single authority on include order here.
#
# The trailing group disables checks for constructs this project cannot contain. They match
# nothing, so they only cost time scanning the standard library and the Cube headers:
# string_view, coroutines, Objective-C, GoogleTest, the LLVM internal APIs, std::bind,
# iostreams, std::auto_ptr and std::random_shuffle (both removed in C++17), and printf.
# It also drops clang-analyzer-core.FixedAddressDereference, which every memory mapped
# peripheral access looks like by construction.
Checks:
-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-dynamic-static-initializers,
-bugprone-bitwise-pointer-cast,
clang-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-pro-type-union-access,
google-*,
llvm-*,
-llvm-header-guard,
-llvm-include-order,
misc-*,
-misc-use-anonymous-namespace,
modernize-*,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
performance-*,
readability-*,
-readability-duplicate-include,
-readability-magic-numbers,
-readability-math-missing-parentheses,
-bugprone-stringview-nullptr,
-cppcoreguidelines-no-suspend-with-lock,
-google-objc-*,
-google-upgrade-googletest-case,
-llvm-prefer-isa-or-dyn-cast-in-conditionals,
-llvm-prefer-register-over-unsigned,
-llvm-twine-local,
-modernize-avoid-bind,
-modernize-deprecated-ios-base-aliases,
-modernize-replace-auto-ptr,
-modernize-replace-random-shuffle,
-modernize-use-std-print,
-clang-analyzer-core.FixedAddressDereference,
HeaderFileExtensions:
- ''
- h
- hh
- hpp
- hxx
ImplementationFileExtensions:
- c
- cc
- cpp
- cxx
HeaderFilterRegex: '(include|config)/.*\.(hpp|tpp)$'
ExcludeHeaderFilterRegex: '(_deps|external)/'
FormatStyle: file
CheckOptions:
# The vendor HAL module headers are not standalone; they require stm32<family>xx_hal.h to have
# pulled in stm32<family>xx_hal_def.h first, so include-cleaner must not suggest or remove them.
# This is why micras_hal includes the generated main.h, which reaches the right one for the
# family it was generated for, instead of naming a module header of its own. main.h is on the
# list for the same reason: every symbol behind it resolves to a header already listed here, so
# nothing is credited to main.h and it would otherwise be reported as unused.
misc-include-cleaner.IgnoreHeaders: 'stm32.*;core_cm.*;cmsis.*;system_stm32.*;lsm6dsv.*;main\.h'
readability-identifier-length.MinimumVariableNameLength: 2
readability-identifier-length.IgnoredVariableNames: ^[nxyz]$
readability-identifier-length.MinimumParameterNameLength: 2
readability-identifier-length.IgnoredParameterNames: ^[nxyz]$
misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: true
bugprone-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion: false
SystemHeaders: false
...
103 changes: 103 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# syntax=docker/dockerfile:1.27

# >>> host stage >>>
###############################################################################
# Host tools: shared byte for byte by micras-lib, micras-simulation and #
# MicrasFirmware, whose CI compares the lines between the two markers #
###############################################################################
FROM ubuntu:26.04 AS host

# The compilers and the clang tooling are pinned to a major version, so that a distribution update
# can move neither the generated code nor the formatting rules and the enabled check set
ARG HOST_GCC_VERSION=15
ARG HOST_CLANG_VERSION=22

# The apt caches are kept in BuildKit cache mounts instead of the image layers, so the hook that
# deletes the downloaded packages after every install has to go
RUN rm -f /etc/apt/apt.conf.d/docker-clean

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
doxygen \
git \
graphviz \
ninja-build \
python3 \
python3-matplotlib \
python3-numpy \
"gcc-${HOST_GCC_VERSION}" \
"g++-${HOST_GCC_VERSION}" \
"clang-${HOST_CLANG_VERSION}" \
"clang-format-${HOST_CLANG_VERSION}" \
"clang-tidy-${HOST_CLANG_VERSION}"

WORKDIR /project
# <<< host stage <<<

#############################################################
# Reference projects' Cube files, generated by STM32CubeMX #
#############################################################
FROM thunderatz/stm32cubemx:6.18.1-h7 AS generator-h7

WORKDIR /project
COPY reference/h7/reference.ioc reference/h7/

# Without network, CubeMX skips its online update check, which can hang the project generation. The
# CMakeLists.txt and CMakePresets.json CubeMX writes next to the .ioc are its own suggestion of a
# project, which the reference replaces, so they are left out of the generated tree.
RUN --network=none <<EOT
set -e
printf 'config load /project/reference/h7/reference.ioc\nproject generate\nexit\n' > /tmp/cube_script
xvfb-run --auto-servernum "${CUBE_PATH}/STM32CubeMX" -q /tmp/cube_script
rm /tmp/cube_script
test -f reference/h7/cmake/stm32cubemx/CMakeLists.txt || { echo "STM32CubeMX failed to generate the project" >&2; exit 1; }
rm -f reference/h7/CMakeLists.txt reference/h7/CMakePresets.json reference/h7/reference.ioc
EOT

# Only the generated files, can be replaced by already generated ones with --build-context generated-h7=<dir>
FROM scratch AS generated-h7

COPY --from=generator-h7 /project/reference/h7 /

FROM thunderatz/stm32cubemx:6.18.1-g4 AS generator-g4

WORKDIR /project
COPY reference/g4/reference.ioc reference/g4/

# The same generation as the H7 reference's, with the STM32CubeMX image that carries the G4 package
RUN --network=none <<EOT
set -e
printf 'config load /project/reference/g4/reference.ioc\nproject generate\nexit\n' > /tmp/cube_script
xvfb-run --auto-servernum "${CUBE_PATH}/STM32CubeMX" -q /tmp/cube_script
rm /tmp/cube_script
test -f reference/g4/cmake/stm32cubemx/CMakeLists.txt || { echo "STM32CubeMX failed to generate the project" >&2; exit 1; }
rm -f reference/g4/CMakeLists.txt reference/g4/CMakePresets.json reference/g4/reference.ioc
EOT

# Only the generated files, can be replaced by already generated ones with --build-context generated-g4=<dir>
FROM scratch AS generated-g4

COPY --from=generator-g4 /project/reference/g4 /

##########################################################
# ARM toolchain for the reference projects and benches #
##########################################################
FROM host AS stm32

# The ARM libraries come prebuilt for every ARM core, only the Cortex-M4F and Cortex-M7 double
# precision ones are kept
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends \
gcc-arm-none-eabi \
libnewlib-arm-none-eabi \
libstdc++-arm-none-eabi-newlib \
make && \
find /usr/lib/arm-none-eabi/lib/thumb /usr/lib/gcc/arm-none-eabi/*/thumb -mindepth 1 -maxdepth 1 \
-not -name "v7e-m+fp" -not -name "v7e-m+dp" -exec rm -rf {} + && \
rm -rf /usr/lib/arm-none-eabi/lib/arm /usr/lib/gcc/arm-none-eabi/*/arm
6 changes: 6 additions & 0 deletions .docker/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The images need no source: the CI mounts the checkout into the containers it runs
.git/
build/
docs/
reference/*/*
!reference/*/reference.ioc
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Every text file is stored with LF in the repository and checked out with LF, whatever platform
# wrote it.
#
# The files this exists for are reference/*/reference.ioc. STM32CubeMX writes its project file with
# the line endings of the platform it runs on, CRLF from a Windows install and LF from the Linux
# container the CI uses, so without normalization the same regeneration shows up as a whole file
# rewrite depending on who ran it, burying the handful of settings that actually changed.
* text=auto eol=lf

# Binary types, so that git never rewrites them
*.png binary
*.jpg binary
*.pdf binary
*.ico binary
*.bin binary
*.elf binary
*.hex binary
128 changes: 128 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Build test lint and check formatting

on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# A push to a branch of this repository is checked once by its push run, so a pull request only runs
# here when it comes from a fork
jobs:
host:
name: 🧪 Host build, tests, format, lint and docs
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
timeout-minutes: 45
steps:
- name: 🔀 Checkout
uses: actions/checkout@v7

- name: 🐋 Build the host image
run: docker build --file .docker/Dockerfile --target host --tag micras-lib:host .

- name: 🗃️ Restore the fetched dependencies
uses: actions/cache@v6
with:
path: |
build/host/_deps
build/host/CMakeFiles/fc-stamp
key: deps-host-${{ hashFiles('micras_proxy/CMakeLists.txt', 'tests/CMakeLists.txt', 'cmake/micras_docs.cmake') }}

# One long lived container runs every step below, as the user that owns the checkout
- name: 📦 Start the host container
run: >
docker run --detach --name host --user "$(id -u):$(id -g)" --env HOME=/tmp
--volume "$PWD:/project" --workdir /project micras-lib:host sleep infinity

- name: ⚙️ Configure
run: docker exec host cmake --preset host -DMICRAS_LIB_WERROR=ON

- name: 🔨 Build
run: docker exec host cmake --build --preset host

- name: 🧪 Run the tests
run: docker exec host ctest --preset host

- name: 🎨 Check the formatting
run: docker exec host cmake --build --preset host --target format_check

- name: 🚨 Lint
run: docker exec host cmake --build --preset host --target lint

- name: 📝 Build the documentation
run: docker exec host cmake --build --preset host --target docs

- name: 🔍 Check the shared code for chip macros
run: docker exec host scripts/check_no_chip_macros.sh

- name: 🧹 Stop the host container
if: always()
run: docker rm --force host

stm32:
name: 🔩 ${{ matrix.name }} reference and bench
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- family: h7
name: STM32H7
- family: g4
name: STM32G4
steps:
- name: 🔀 Checkout
uses: actions/checkout@v7

- name: 🗃️ Restore the generated Cube files
id: cube
uses: actions/cache/restore@v6
with:
path: build/generated-${{ matrix.family }}
key: cube-${{ matrix.family }}-${{ hashFiles(format('reference/{0}/reference.ioc', matrix.family), '.docker/Dockerfile') }}

- name: ⚙️ Generate the Cube files
if: steps.cube.outputs.cache-hit != 'true'
run: >
docker build --file .docker/Dockerfile --target generated-${{ matrix.family }}
--output type=local,dest=build/generated-${{ matrix.family }} .

- name: 🗃️ Save the generated Cube files
if: steps.cube.outputs.cache-hit != 'true'
uses: actions/cache/save@v6
with:
path: build/generated-${{ matrix.family }}
key: ${{ steps.cube.outputs.cache-primary-key }}

- name: 📂 Place the Cube files in the reference project
run: cp -r build/generated-${{ matrix.family }}/. reference/${{ matrix.family }}/

- name: 🐋 Build the ARM image
run: docker build --file .docker/Dockerfile --target stm32 --tag micras-lib:stm32 .

- name: 📦 Start the ARM container
run: >
docker run --detach --name stm32 --user "$(id -u):$(id -g)" --env HOME=/tmp
--volume "$PWD:/project" --workdir /project micras-lib:stm32 sleep infinity

- name: ⚙️ Configure the reference project
run: docker exec stm32 cmake --preset reference-${{ matrix.family }}

- name: 🔨 Build the reference and its bench
run: docker exec stm32 cmake --build --preset reference-${{ matrix.family }} --parallel

- name: 🚨 Lint the stm32 backend and the bench
run: docker exec stm32 cmake --build --preset reference-${{ matrix.family }} --target lint

- name: 🧹 Stop the ARM container
if: always()
run: docker rm --force stm32
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
docs/
Loading
Loading