ThingSet / thingset-device-library

ThingSet library for resource-constrained devices written in C/C++
https://thingset.io/thingset-device-library/
Apache License 2.0
13 stars 6 forks source link

Add macros to create data objects with Zephyr iterable sections #34

Closed martinjaeger closed 2 years ago

martinjaeger commented 2 years ago

These macros allow to create the data objects array in a distributed fashion across multiple modules in the firmware.

See Zephyr documentation for iterable sections: https://docs.zephyrproject.org/latest/kernel/iterable_sections/index.html

@towen: I'm wondering if we could add the CMake and linker files (now only mentioned in a comment) to this module, so that they do not have to be copied to every application / module. Creating the PR as draft in order to further evaluate this.

towen commented 2 years ago

Agreed it would be useful to add the CMake and linker files, perhaps with a Kconfig option e.g. CONFIG_THINGSET_ITERABLE which would pull in the linker section (if there is an overhead for a linker section, maybe there isn't) But it would be ideal if thingset items can be added as easily as shell commands

martinjaeger commented 2 years ago

Thanks for testing @towen. CMake and linker file stuff can be added later once I'm more clear about a good approach, so I merged this part already (after a rebase).