-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving logic code into libraries #70
Comments
Great idea - I was also thinking about... |
Yep, this is something I wanted to do, prior to moving these to antares itself.
|
I can split i2c modules to two parts: library for antares and command for frankenstein, but I do not know how to do it better way. Tons of i2c_* files seems terrible to me. I try to combine all i2c libs in one file and leave separated cmd files, and it's look much more terrible :D Maybe try combine all cmd_i2c in one file (with ifdef's for every driver) and leave separated i2c drivers? |
@darkbyte-ru Don't do it just yet, give me a little time to make an proper i2c subsystem for antares. |
Hi, this is just an option for discussion, it depends on which way you want to take this.
I have a project I'm basing on frankenstein and one of the things I will be doing is writing a program that schedules a timer task to poll a bunch of sensors. To this end it included copying the bulk of the code out of ds18b20.c to another file and making the entry point extern so I could call it from my code.
Longer term for most of the commands like ds18b20 that do similar things, they could be improved by making them expose an internal API (usually, just a single extern function) that the static method that parses the argv would call, that could then be called by other code to use the same functionality.
The tcp_send command is another similar example
If you like I can submit that change for ds18b20 and dht22 as a proof of concept
If this is not suitable I'm not fussed, I'll just keep a local fork of relevant logic code in my project
The text was updated successfully, but these errors were encountered: