36 lines
542 B
C
36 lines
542 B
C
![]() |
#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
|
||
|
|