This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-soccer/source/AVR_Studio/Soccer/global.h
2007-02-14 17:47:03 +00:00

63 lines
1.4 KiB
C
Executable file

#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");
}
}
};
inline void usleep(int usec)
{
usec *= 100;
for (int s=0; s<usec; 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