summaryrefslogtreecommitdiffstats
path: root/source/AVR_Studio/Soccer/global.h
blob: 4b9339a9d1bcc530d992df460885821a33573e30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#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"); 
    }
  }
};

inline void msleep(int msec)
{
  for (int s=0; s<msec; s++) {
    for (long int i=0; i<1405; i++) {
      asm volatile("nop"); 
    }
  }
};

void *operator new(size_t sz);
void operator delete(void *p);

// Typendefinitionen für den CT-Bot-Code
typedef unsigned char uint8;                       /*!< vorzeichenlose 8-Bit-Zahl  */
typedef unsigned int word;                         /*!< vorzeichenlose 16-Bit-Zahl  */
typedef signed char int8;                          /*!< vorzeichenbehaftete 8-Bit-Zahl */ 
typedef short int int16;                           /*!< vorzeichenbehaftete 16-Bit-Zahl  */

typedef unsigned long uint32;		/*!< vorzeichenlose 32-Bit-Zahl  */
typedef signed long int32;			/*!< vorzeichenbehaftete 32-Bit-Zahl  */

#define uint16                  word				/*!< Int mit 16 Bit */
	

/* 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