Skip to content

Replace Serial with Debug? #46

@joshgoebel

Description

@joshgoebel

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions