Closed zacharyburnett closed 7 years ago
I have a number of concerns with this code base as is.
#define
macros. (I.e. #define USE_BME280
in their .ino file would trigger an #ifdef
block in this code that included and initialized that sensor.)
-RAM usage: This sorta ties in with code size. As is, this library instantiates an object for every sensor that code has been written for. If the user doesn't want them there, that's a waste of RAM on a system that has just 8 K of it. As an example, the BNO library alone eats 1% of the Mega's RAM while just sitting there doing nothing, as does the BME library. That may not seem like a lot, but it's still RAM being essentially wasted. This can easily be resolved with the above #define
system, as well, but it's worth noting as a separate issue.getStatusString()
return? Also, in another commit, you mentioned Balloonduino::print()
, which will be confused with Serial.print()
, even though it writes to the SD card. Users are going to want that to be obvious from the name of the function rather than having to crawl through this code to find out. Everything we write here should have a painfully explicit naming convention: getSensorStatusString()
or writeToLogger()
, for example, are better function names.I hope I've done a good job explaining the issues I have, and didn't come across as too harsh. Embedded development is a tough paradigm to get used to, especially when writing code that other people will need to use without having to understand it very much. I'm glad you're working on this without prompting from me, however, and I'm as usual open to any questions or concerns.
Alright, so before we merge this pull request we need to:
I'll make four new issues.
That's the crux of it, yeah. Hope it all made sense, I felt like I was getting a bit rambly.
Incidentally, the more I think about it, I feel like we should ditch the Balloonduino class in favor of a Balloonduino namespace. It'll make the ifdef templating significantly easier, and will also expose the raw sensor library objects to the user, solving two issues in one. See the PythonInterface files in Link-TLM for an example of what I mean.
Alright, well we're reaching the edge of my development knowledge here so I don't know how helpful I'll be until I learn how namespaces work :P
Google is your friend here, but they're super simple, and the syntax is similar to classes. They're mainly used to avoid naming conflicts, which means you can "safely" write C-style functions within one.
Bring master up to date with development, to start work on SD card logging and XBee support.