vcu icon indicating copy to clipboard operation
vcu copied to clipboard

refactor!: wrap module states in context structs

Open t-bre opened this issue 3 years ago • 1 comments

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.

t-bre avatar Oct 11 '22 20:10 t-bre

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...

t-bre avatar Oct 12 '22 00:10 t-bre