bebenlebricolo / bebenlebricolo/LabBenchPowerSupply
Reduce Drivers and memory footprint
- Dominant language
- C
- Stars
- 4
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Even with full size optimizations, the code is still really heavy and a lot could be optimized (especially in Timebase module).
Here is a sample of what is given by the `avr-nm --size-sort` command on produced firmware.elf file.

Full file can be found here : [minsizerel.txt](https://github.com/bebenlebricolo/LabBenchPowerSupply/files/5960700/minsizerel.txt)
### What is known :
* Lots of drivers try to cover the whole hardware side
* Sometimes we only need our application code to use fractions of the actual driver's code
* This is especially true for functionality *that cannot be stripped away at compile time because of its dynamic nature*
* E.g : in the I2C driver, the 4 master_tx, master_rx, slave_rx, slave_tx internal process commands are kept because the compiler has no clue (at compile time) to tell if the application would use any of them, or none of them. This is the perfect example of the dynamic redirection of the driver, depending on hardware status codes itself
* Timebase module reimplements 3 times the same code (or really close) to support the 3 kinds of timers embedded within the Avr chip.
* Redirecting calls to more generic functions might help reduce the code's size
* A good refactor might be required on that particular module to make it much lighter
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.