52 lines
1.3 KiB
C
Executable file
52 lines
1.3 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");
|
|
}
|
|
}
|
|
};
|
|
|
|
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
|
|
|