vcu
vcu copied to clipboard
refactor!: wrap module states in context structs
Current Implementation
Currently, each module has single, static instances of its data (threads, semaphores, variables, etc).
Proposed Improvement
For modularity, it would be better to wrap the context for a module into a struct (similar to the way the STM32 HAL does handles for CAN, I2C, etc). This has been done for some newer modules already, but old modules don't follow this style and should be refactored to do so.
Tasks
- [x] Top level VCU.
- [x] Control thread.
- [x] Sensor thread.
- [ ] APPS.
- [ ] BPS.
- [ ] Ready-to-drive.
- [ ] Shutdown.
- [ ] Watchdog.
- [ ] Fault monitor / handler.
This is going to be a bit of a monstrosity when it becomes a PR, but nobody else is working on VCU at the moment so it should be fine...