-
Notifications
You must be signed in to change notification settings - Fork 16
/
core_build_options.h
169 lines (119 loc) · 5.23 KB
/
core_build_options.h
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*==============================================================================
core_build_options.h - Various options for mapping functionality to hardware.
Copyright 2010 Rowdy Dog Software.
This file is part of Arduino-Tiny.
Arduino-Tiny is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
Arduino-Tiny is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with Arduino-Tiny. If not, see <http://www.gnu.org/licenses/>.
==============================================================================*/
#ifndef core_build_options_h
#define core_build_options_h
/*=============================================================================
Low power / smaller code options
=============================================================================*/
#define INITIALIZE_ANALOG_TO_DIGITAL_CONVERTER 1
#define INITIALIZE_SECONDARY_TIMERS 0
/*=============================================================================
Build options for the ATtiny2313 processor
=============================================================================*/
#if defined( __AVR_ATtiny2313__ )
/*
The old standby ... millis on Timer 0.
*/
#define TIMER_TO_USE_FOR_MILLIS 1
/*
Tone goes on whichever timer was not used for millis.
*/
#if TIMER_TO_USE_FOR_MILLIS == 1
#define TIMER_TO_USE_FOR_TONE 0
#else
#define TIMER_TO_USE_FOR_TONE 1
#endif
#define HAVE_ADC 0
#define DEFAULT_TO_TINY_DEBUG_SERIAL 0
#endif
/*=============================================================================
Build options for the ATtiny84 processor
=============================================================================*/
#if defined( __AVR_ATtiny24__ ) || defined( __AVR_ATtiny44__ ) || defined( __AVR_ATtiny84__ )
#define __AVR_ATtinyX4__
#endif
#if defined( __AVR_ATtinyX4__ )
/*
The old standby ... millis on Timer 0.
*/
#define TIMER_TO_USE_FOR_MILLIS 1
/*
Tone goes on whichever timer was not used for millis.
*/
#if TIMER_TO_USE_FOR_MILLIS == 1
#define TIMER_TO_USE_FOR_TONE 0
#else
#define TIMER_TO_USE_FOR_TONE 1
#endif
#define HAVE_ADC 1
#define DEFAULT_TO_TINY_DEBUG_SERIAL 1
#endif
/*=============================================================================
Build options for the ATtiny85 processor
=============================================================================*/
#if defined( __AVR_ATtiny25__ ) || defined( __AVR_ATtiny45__ ) || defined( __AVR_ATtiny85__ )
#define __AVR_ATtinyX5__
#endif
#if defined( __AVR_ATtinyX5__ )
/*
For various reasons, Timer 1 is a better choice for the millis timer on the
'85 processor.
*/
#define TIMER_TO_USE_FOR_MILLIS 1
/*
If the following is true (non-zero) there will be two phase-correct PWM
pins and one fast PWM pin. If false there will be one phase-correct PWM
pin and two fast PWM pins.
*/
#define FAVOR_PHASE_CORRECT_PWM 1
/*
Tone goes on whichever timer was not used for millis.
*/
#if TIMER_TO_USE_FOR_MILLIS == 1
#define TIMER_TO_USE_FOR_TONE 0
#else
#define TIMER_TO_USE_FOR_TONE 1
#endif
#define HAVE_ADC 1
#define DEFAULT_TO_TINY_DEBUG_SERIAL 1
#endif
/*=============================================================================
There doesn't seem to be many people using a bootloader so we'll assume
there isn't one. If the following is true (non-zero), the timers are
reinitialized to their power-up state in init just in case the bootloader
left them in a bad way.
=============================================================================*/
#define HAVE_BOOTLOADER 0
/*=============================================================================
Allow the ADC to be optional for low-power applications
=============================================================================*/
#if ! defined( HAVE_ADC )
#define HAVE_ADC 0
#endif
#if ! HAVE_ADC
#define INITIALIZE_ANALOG_TO_DIGITAL_CONVERTER 0
#else
#if ! defined( INITIALIZE_ANALOG_TO_DIGITAL_CONVERTER )
#define INITIALIZE_ANALOG_TO_DIGITAL_CONVERTER 1
#endif
#endif
/*=============================================================================
Allow the "secondary timers" to be optional for low-power applications
=============================================================================*/
#if ! defined( INITIALIZE_SECONDARY_TIMERS )
#define INITIALIZE_SECONDARY_TIMERS 1
#endif
#endif