damienmaguire / Stm32-vcu

A Vehicle Control Unit for Electric Vehicle Conversion Projects based on an STM32F107. Software based on the Openinverter Project.
GNU General Public License v3.0
113 stars 68 forks source link

Various non-function affecting code cleanups #111

Closed davefiddes closed 2 months ago

davefiddes commented 2 months ago

Totally fine if you want to reject this but I was looking at the VCU code-base to see where things were at and me and my code linter (cppcheck) kept spotting minor problems. So I did a bit of tidying as I went.

There were various bits of non-obvious dead code highlighted. The linker probably removed a lot of this but it made it difficult to understand. I've left all of the commented out code as that looks to be WIP/documentation which is of value.

I found a few data tables which could be marked constant so they can stay in flash without causing any detriment.

There should be no function affecting changes which should break anything. I worked on the principle if compilation can't prove correctness I wasn't going to touch it.

damienmaguire commented 2 months ago

Thanks Dave will review. Really appreciate the help:)