-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompilers.h
More file actions
executable file
·61 lines (50 loc) · 1.51 KB
/
Copy pathcompilers.h
File metadata and controls
executable file
·61 lines (50 loc) · 1.51 KB
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
53
54
55
56
57
58
59
60
//***************************************************************************
//
// Author(s)...: Pashgan http://ChipEnable.Ru
//
// Target(s)...: ATMega
//
// Compiler....: IAR, GCC, CodeVision
//
// Description.: ôàéë äëÿ ïîðòèðîâàíèÿ ïðîåêòîâ, èñõîäíèêîâ áèáëèîòåê
//
// Data........: 08.03.13
//
//***************************************************************************
#ifndef COMPILERS_H
#define COMPILERS_H
//________________________________________
#ifdef __ICCAVR__
#include <ioavr.h>
#include <inavr.h>
#include <intrinsics.h>
#define read_byte_flash(x) (x)
#endif
//________________________________________
#ifdef __GNUC__
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#define __save_interrupt() SREG
#define __restore_interrupt(var) SREG = (var)
#define __disable_interrupt() cli()
#define __enable_interrupt() sei()
#define __delay_cycles(var) _delay_us((unsigned int)(var)/(F_CPU/1000000))
#define __flash PROGMEM const
#define read_byte_flash(x) pgm_read_byte(&(x))
#endif
//________________________________________
#ifdef __CODEVISIONAVR__
#include <io.h>
#include <delay.h>
#define __save_interrupt() SREG
#define __restore_interrupt(var) SREG = (var)
#define __disable_interrupt() #asm("cli")
#define __enable_interrupt() #asm("sei")
#define __delay_cycles(var) delay_us((unsigned int)(var)/(_MCU_CLOCK_FREQUENCY_/1000000))
#define read_byte_flash(x) (x)
#endif
//____________________________________________
#include <stdint.h>
#endif //COMPILERS_H