You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anytime ANY file in hb_utilities is referenced the entire folder gets compiled and linked. The linker is pretty good about throwing out what isn't used but I think because eventSerial is referenced in the main.cpp (internal to Arduino) that somehow the Serial stuff sticks in a bad way.
My code:
#include <click_counter.h>
Building:
Global variables use 195 bytes (19%) of dynamic memory,
With that line commented:
Global variables use 22 bytes (2%) of dynamic memory,
Note, I'm not even actually using any click_counter code in this example... the whole difference you are seeing is the extra Serial variable space that's getting added.
I'm not sure of anyway to fix this without putting each of the libraries into separate folders instead of having them all in the same folder. At the very least print_binary should be split off. I can do this and submit a pull request I just wasn't sure what direction I should go with fixing this. Or maybe you have a better idea?
I'm using Arduino 1.5.x but I'd guess the older IDE might exhibit the same behavior.
The text was updated successfully, but these errors were encountered:
This memory issue is something I've not seen, as I only see memory usage at run time via DEBUG_* (using Serial).
I'd expect the problem to occurs with 1.0.5 as well, as I'd be surprised if Arduino 1.5 is using a significantly newer version of avr-gcc on the backend.
Simply moving all hb_utilities that use Serial to a separate directory would fix it (this is a bit of a kludge).
My first thought was to slap #ifdef DEBUG around the calls but then I saw the only place that file is used is by one of the test programs... could we just say that serial only works in debug mode and require the test program to define DEBUG?
Anytime ANY file in hb_utilities is referenced the entire folder gets compiled and linked. The linker is pretty good about throwing out what isn't used but I think because eventSerial is referenced in the main.cpp (internal to Arduino) that somehow the Serial stuff sticks in a bad way.
My code:
#include <click_counter.h>
Building:
Global variables use 195 bytes (19%) of dynamic memory,
With that line commented:
Global variables use 22 bytes (2%) of dynamic memory,
Note, I'm not even actually using any click_counter code in this example... the whole difference you are seeing is the extra Serial variable space that's getting added.
I'm not sure of anyway to fix this without putting each of the libraries into separate folders instead of having them all in the same folder. At the very least print_binary should be split off. I can do this and submit a pull request I just wasn't sure what direction I should go with fixing this. Or maybe you have a better idea?
I'm using Arduino 1.5.x but I'd guess the older IDE might exhibit the same behavior.
The text was updated successfully, but these errors were encountered: