MHeironimus / ArduinoJoystickLibrary

An Arduino library that adds one or more joysticks to the list of HID devices an Arduino Leonardo or Arduino Micro can support.
GNU Lesser General Public License v3.0
2.06k stars 403 forks source link

Reduce footprint #214

Open CDRXavier opened 2 years ago

CDRXavier commented 2 years ago

Describe your feature request Currently the library:

created a temporary "buffer" of 150 bytes fills content in while calculating size creates a new actual buffer (of perhap 100 bytes) copies content over from "buffer"

This uses 250 bytes of RAM, in addition to PROGMEM, if there are no optimizations from the compiler.

Also, the amount of setAxis and setAxisLim functions can be just reduced to one (for each). a parameter specifying which axis to set can be passed to said function. This will also ease PROGMEM by having less functions.

CDRXavier commented 2 years ago

Anyhow, if you don't feel like it, I had forked one for my "own purposes", and is in progress. You can always direct people to a "quick & dirty" version of your lib.