KurtE
Senior Member+
While trying to figure out how to resolve anther issue. In particular how to handle the same font defined in a display library as might be contained in a fonts library and not end up with a bunch of multiple defined errors,
I started playing around some with some of the newer library format stuff and was wondering if we should apply it to some of our other system libraries.
To do this, requires us to use the newer library directory structure. In particular move the header files and source files into a sub directory: src
And create a library.properties file.
In the library.properties file you can then have a line: dot_a_linkage=true
More details in the documentation: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification
But what this will do, is to compile everything in the directory and then like the core, will create an archive file, which is then included in the link.
Where I think this might be interesting is with things like the wire library which may create objects and buffers for all possible objects on the device, which then is loaded into your sketch. Whereas if each of these objects are created in their own .c/.cpp file than it may be possible that they will only consume resources in those sketches who actually use those objects.
Does this make sense?
Kurt
I started playing around some with some of the newer library format stuff and was wondering if we should apply it to some of our other system libraries.
To do this, requires us to use the newer library directory structure. In particular move the header files and source files into a sub directory: src
And create a library.properties file.
In the library.properties file you can then have a line: dot_a_linkage=true
More details in the documentation: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification
But what this will do, is to compile everything in the directory and then like the core, will create an archive file, which is then included in the link.
Where I think this might be interesting is with things like the wire library which may create objects and buffers for all possible objects on the device, which then is loaded into your sketch. Whereas if each of these objects are created in their own .c/.cpp file than it may be possible that they will only consume resources in those sketches who actually use those objects.
Does this make sense?
Kurt