Skip to content
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

Replace Serial with Debug? #46

Open
joshgoebel opened this issue Mar 31, 2014 · 2 comments
Open

Replace Serial with Debug? #46

joshgoebel opened this issue Mar 31, 2014 · 2 comments

Comments

@joshgoebel
Copy link

What if we changed...

#ifdef FREE_RAM
  Serial.print("Ram available: ");
  Serial.print(freeRam());
  Serial.println("/1024 bytes");
#endif

to

#ifdef FREE_RAM
  Debug.print("Ram available: ");
  Debug.print(freeRam());
  Debug.println("/1024 bytes");
#endif

A new Debug object could be introduced that checked for charge_state of BATTERY and if the user isn't plugged into USB all the serial statements short-circuit without wasting any time... and if it is plugged in then Serial.whatever runs as it usually would. The call overhead would be nothing compared to the Serial overhead itself.

Would that help?

@dhiltonp
Copy link
Owner

dhiltonp commented Apr 1, 2014

That would be quite nice from a run-time perspective. It wouldn't do anything for the string consumption of flash/ram, of course.

It's definitely worth considering.

@joshgoebel
Copy link
Author

Right, if they don't turn them off in the compile it's about the best you could do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants