-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Klaas, Wilfried
authored and
Klaas, Wilfried
committed
Aug 20, 2015
1 parent
095a399
commit 3bc4606
Showing
4 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
debug.h - Definition von 2 Debugfunktionen - Version 0.1 | ||
Copyright (c) 2012 Wilfried Klaas. All right reserved. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
// Program im Debugmodus kompilieren, dann werden zus. Ausgaben auf die serielle Schnittstelle geschrieben. | ||
// Zum aktivieren der Debug Funktion bitte den Define VOR dem #include "debug.h" in die Hauptdatei eintragen. | ||
//#define debug | ||
|
||
#ifdef debug | ||
#define dbgOut(S) \ | ||
Serial.print(S); | ||
#define dbgOut2(S,P) \ | ||
Serial.print(S,P); | ||
#define dbgOutLn(S) \ | ||
Serial.println(S); | ||
#define dbgOutLn2(S,P) \ | ||
Serial.println(S,P); | ||
#define initDebug() \ | ||
Serial.begin(57600); \ | ||
Serial.flush(); \ | ||
delay(100); | ||
#else | ||
#define dbgOut(S) | ||
#define dbgOut2(S,P) | ||
#define dbgOutLn(S) | ||
#define dbgOutLn2(S,P) | ||
#define initDebug() | ||
#endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
makros.cpp - Ein paar nützliche Makros - Version 0.1 | ||
Copyright (c) 2012 Wilfried Klaas. All right reserved. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#ifndef between | ||
#define between(a,x,y) ((a >=x) && (a <= y)) | ||
#endif | ||
|
||
#ifndef cbi | ||
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) | ||
#endif | ||
#ifndef sbi | ||
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) | ||
#endif |