summaryrefslogtreecommitdiffstats
path: root/source/AVR_Studio/Soccer/global.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/AVR_Studio/Soccer/global.h')
-rwxr-xr-xsource/AVR_Studio/Soccer/global.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/AVR_Studio/Soccer/global.h b/source/AVR_Studio/Soccer/global.h
new file mode 100755
index 0000000..3f57a8c
--- /dev/null
+++ b/source/AVR_Studio/Soccer/global.h
@@ -0,0 +1,35 @@
+#ifndef _GLOBAL_H_
+#define _GLOBAL_H_
+
+#include <stdlib.h>
+#include "hal/board.h"
+
+inline void sleep(int sec)
+{
+ for (int s=0; s<sec; s++) {
+ for (long int i=0; i<1405678; i++) {
+ asm volatile("nop");
+ }
+ }
+};
+
+void *operator new(size_t sz);
+void operator delete(void *p);
+
+
+
+
+
+/* defines for compatibility */
+#ifndef cbi
+#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
+#endif
+#ifndef sbi
+#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
+#endif
+#ifndef BV
+#define BV _BV
+#endif
+
+#endif
+