Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Running out of space, anything I can delete to make more room? #3224
My apologies if this is in the wrong place, but I like to update my keyboard's firmware every so often to keep up with your hard work on QMK.
Unfortunately, every time I update, I have to disable 2-3 macros from my leader dictionary.
Is there anything I can delete/disable to make room for my Ergodox EZ keymap? (Which is already at 100%!)
It's a great place to ask. You should check out my userspace, since I've ran into this, as well.
That said, there are a few things you can do.
EXTRAFLAGS += -flto
This enables Link Time Optimization. This can save a good chunk of space (several KB for me), but the macro and function ... functions cause it to error out.
And since you won't be using those, you can add these defines to your config.h to save some additional space.
#define NO_ACTION_MACRO #define NO_ACTION_FUNCTION
This disables those functions globally.
If you're not using leader keys, you can add this too:
And it may be worth adding:
#ifndef NO_DEBUG #define NO_DEBUG #endif // !NO_DEBUG #if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) #define NO_PRINT #endif // !NO_PRINT
If you're not doing debugging, then no need to have these on.
Also, depending on what features you're using, you could probably add this to your rules.mk file:
COMMAND_ENABLE = no # Commands for debug and configuration UNICODE_ENABLE = no# Unicode MOUSEKEY_ENABLE = no # Mouse keys(+4700)
If you're using mouse keys, then don't enable the last one. But if you're not, it's a good chunk of space.
And with most of these optimizations and a bunch of additional stuff, my firmware compiles to about 29428 bytes, and fits well within the teensy's firmware size (91% capacity)
Hey @drashna, thank you for your great advice!
Thanks again for your great advice, it was painless to get me an extra 7%! If there are any more ideas, I'll be sure to share!
Well, if you convert your macros to
It's specifically the
I don't know if there are any issues with them, but they're depreciated:
I think the
Also, ... the