You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 rivejä
426 B

  1. #include "Log.h"
  2. namespace log {
  3. namespace details {
  4. void waitForSerial() {
  5. while (!Serial);
  6. Serial.begin(DEBUG_SERIAL_SPEED);
  7. }
  8. }
  9. void setup() {
  10. #if _DEBUG
  11. details::waitForSerial();
  12. Log.begin(LOG_LEVEL_VERBOSE, &Serial);
  13. #else
  14. if (Serial) {
  15. Serial.begin(DEBUG_SERIAL_SPEED);
  16. Log.begin(LOG_LEVEL_NOTICE, &Serial);
  17. }
  18. #endif
  19. if (Serial) Serial.println(F("============================="));
  20. }
  21. }