bebenlebricolo / bebenlebricolo/LabBenchPowerSupply

Reduce Drivers and memory footprint

Open
#30 0 comments 0 reactions 1 assignee Claimed by @bebenlebricolo View on GitHub
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.
![Capture d’écran du 2021-02-10 20-01-24](https://user-images.githubusercontent.com/29211687/107559787-ce1e4700-6bdc-11eb-9b2d-d5c74ff21a76.png)

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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.