debug2.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. debug2.h - Definition von 2 Debugfunktionen - Version 0.1
  3. Copyright (c) 2012 Wilfried Klaas. All right reserved.
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  15. */
  16. // Program im Debugmodus kompilieren, dann werden zus. Ausgaben auf die serielle Schnittstelle geschrieben.
  17. // Zum aktivieren der Debug Funktion bitte den Define VOR dem #include "debug.h" in die Hauptdatei eintragen.
  18. //#define debug
  19. #ifdef debug
  20. #define dbgOut(S) \
  21. Serial2.print(S);
  22. #define dbgOut2(S,P) \
  23. Serial2.print(S,P);
  24. #define dbgOutLn(S) \
  25. Serial2.println(S);
  26. #define dbgOutLn2(S,P) \
  27. Serial2.println(S,P);
  28. #define initDebug() \
  29. Serial2.begin(57600); \
  30. Serial2.flush(); \
  31. delay(100);
  32. #else
  33. #define dbgOut(S)
  34. #define dbgOut2(S,P)
  35. #define dbgOutLn(S)
  36. #define dbgOutLn2(S,P)
  37. #define initDebug()
  38. #endif