Skip to content

Commit ce2b444

Browse files
committedNov 28, 2012
Initial commit after rewrite of script
This rewrite is based on the open source packages available from Atmel at http://distribute.atmel.no/tools/opensource/
0 parents  commit ce2b444

31 files changed

+3260
-0
lines changed
 

‎.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
._*
3+
xcuserdata
4+
/patches
5+
/manual
6+
/packages
7+
/compile
8+
/math
+256
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXFileReference section */
10+
4066DB6314EAA6220051D0F4 /* mkdist.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = mkdist.sh; sourceTree = "<group>"; };
11+
4066DB6714EBD0BC0051D0F4 /* 010-fix-64-bit.patch */ = {isa = PBXFileReference; lastKnownFileType = text; path = "010-fix-64-bit.patch"; sourceTree = "<group>"; };
12+
4066DB6914EBEE560051D0F4 /* 20-gcc-binary-constants.patch */ = {isa = PBXFileReference; lastKnownFileType = text; path = "20-gcc-binary-constants.patch"; sourceTree = "<group>"; };
13+
4066DB6A14EBEE560051D0F4 /* 21-gcc-avr-misspelled-sig-1.patch */ = {isa = PBXFileReference; lastKnownFileType = text; path = "21-gcc-avr-misspelled-sig-1.patch"; sourceTree = "<group>"; };
14+
4066DB6B14EBEE560051D0F4 /* 60-new-devices.patch */ = {isa = PBXFileReference; lastKnownFileType = text; path = "60-new-devices.patch"; sourceTree = "<group>"; };
15+
4066DB7014EC5E8C0051D0F4 /* Readme.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = Readme.rtf; sourceTree = "<group>"; };
16+
4066DB7B14EC5E8C0051D0F4 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
17+
4066DB7C14EC5E8C0051D0F4 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
18+
4066DB7D14EC5E8C0051D0F4 /* TemplateProject.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = TemplateProject.xcodeproj; sourceTree = "<group>"; };
19+
4066DB8514EC81B00051D0F4 /* documentation.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = documentation.html; sourceTree = "<group>"; };
20+
4066DB8614EC81B00051D0F4 /* footer.php */ = {isa = PBXFileReference; lastKnownFileType = text.script.php; path = footer.php; sourceTree = "<group>"; };
21+
4066DB8714EC81B00051D0F4 /* gettingstarted.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = gettingstarted.html; sourceTree = "<group>"; };
22+
4066DB8814EC81B00051D0F4 /* header.php */ = {isa = PBXFileReference; lastKnownFileType = text.script.php; path = header.php; sourceTree = "<group>"; };
23+
4066DB8914EC81B00051D0F4 /* index.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = index.html; sourceTree = "<group>"; };
24+
4066DB8A14EC81B00051D0F4 /* installation.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = installation.html; sourceTree = "<group>"; };
25+
4066DB8B14EC81B00051D0F4 /* licenses.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = licenses.html; sourceTree = "<group>"; };
26+
4066DB8C14EC81B00051D0F4 /* links.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = links.html; sourceTree = "<group>"; };
27+
4066DB8D14EC81B00051D0F4 /* mkmanual.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = mkmanual.sh; sourceTree = "<group>"; };
28+
4066DB8E14EC81B00051D0F4 /* releasenotes.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = releasenotes.html; sourceTree = "<group>"; };
29+
4066DB9014EC81B00051D0F4 /* logo150.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = logo150.jpg; sourceTree = "<group>"; };
30+
4066DB9114EC81B00051D0F4 /* style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = style.css; sourceTree = "<group>"; };
31+
4066DB9414ECF9D90051D0F4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = ReadMe.rtf; sourceTree = "<group>"; };
32+
4066DB9614ECF9D90051D0F4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = Welcome.rtf; sourceTree = "<group>"; };
33+
406D9473166655FD004D70FD /* mkclean.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = mkclean.sh; sourceTree = "<group>"; };
34+
406D9474166655FD004D70FD /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.md; sourceTree = "<group>"; };
35+
406D947716665618004D70FD /* License.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = License.txt; sourceTree = "<group>"; };
36+
406D947916665641004D70FD /* postinstall */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = "<group>"; };
37+
406D947A16665653004D70FD /* background.jp2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = background.jp2; sourceTree = "<group>"; };
38+
/* End PBXFileReference section */
39+
40+
/* Begin PBXGroup section */
41+
4066DB5714EAA5C00051D0F4 = {
42+
isa = PBXGroup;
43+
children = (
44+
406D9473166655FD004D70FD /* mkclean.sh */,
45+
4066DB6314EAA6220051D0F4 /* mkdist.sh */,
46+
406D9474166655FD004D70FD /* README.md */,
47+
406D947716665618004D70FD /* License.txt */,
48+
4066DB8414EC81B00051D0F4 /* manual-source */,
49+
4066DB6C14EC5E8C0051D0F4 /* package-info */,
50+
4066DB7814EC5E8C0051D0F4 /* templates */,
51+
4066DB6514EBD0BC0051D0F4 /* patches-local */,
52+
);
53+
sourceTree = "<group>";
54+
};
55+
4066DB6514EBD0BC0051D0F4 /* patches-local */ = {
56+
isa = PBXGroup;
57+
children = (
58+
4066DB6814EBEE560051D0F4 /* gcc-3.4.6 */,
59+
4066DB6614EBD0BC0051D0F4 /* libusb-0.1.12 */,
60+
);
61+
path = "patches-local";
62+
sourceTree = "<group>";
63+
};
64+
4066DB6614EBD0BC0051D0F4 /* libusb-0.1.12 */ = {
65+
isa = PBXGroup;
66+
children = (
67+
4066DB6714EBD0BC0051D0F4 /* 010-fix-64-bit.patch */,
68+
);
69+
path = "libusb-0.1.12";
70+
sourceTree = "<group>";
71+
};
72+
4066DB6814EBEE560051D0F4 /* gcc-3.4.6 */ = {
73+
isa = PBXGroup;
74+
children = (
75+
4066DB6914EBEE560051D0F4 /* 20-gcc-binary-constants.patch */,
76+
4066DB6A14EBEE560051D0F4 /* 21-gcc-avr-misspelled-sig-1.patch */,
77+
4066DB6B14EBEE560051D0F4 /* 60-new-devices.patch */,
78+
);
79+
path = "gcc-3.4.6";
80+
sourceTree = "<group>";
81+
};
82+
4066DB6C14EC5E8C0051D0F4 /* package-info */ = {
83+
isa = PBXGroup;
84+
children = (
85+
4066DB7014EC5E8C0051D0F4 /* Readme.rtf */,
86+
4066DB7114EC5E8C0051D0F4 /* Resources */,
87+
406D947816665641004D70FD /* scripts */,
88+
);
89+
path = "package-info";
90+
sourceTree = "<group>";
91+
};
92+
4066DB7114EC5E8C0051D0F4 /* Resources */ = {
93+
isa = PBXGroup;
94+
children = (
95+
406D947A16665653004D70FD /* background.jp2 */,
96+
4066DB9214ECF9D90051D0F4 /* en.lproj */,
97+
);
98+
path = Resources;
99+
sourceTree = "<group>";
100+
};
101+
4066DB7814EC5E8C0051D0F4 /* templates */ = {
102+
isa = PBXGroup;
103+
children = (
104+
4066DB7914EC5E8C0051D0F4 /* TemplateProject */,
105+
);
106+
path = templates;
107+
sourceTree = "<group>";
108+
};
109+
4066DB7914EC5E8C0051D0F4 /* TemplateProject */ = {
110+
isa = PBXGroup;
111+
children = (
112+
4066DB7A14EC5E8C0051D0F4 /* firmware */,
113+
4066DB7D14EC5E8C0051D0F4 /* TemplateProject.xcodeproj */,
114+
);
115+
path = TemplateProject;
116+
sourceTree = "<group>";
117+
};
118+
4066DB7A14EC5E8C0051D0F4 /* firmware */ = {
119+
isa = PBXGroup;
120+
children = (
121+
4066DB7B14EC5E8C0051D0F4 /* main.c */,
122+
4066DB7C14EC5E8C0051D0F4 /* Makefile */,
123+
);
124+
path = firmware;
125+
sourceTree = "<group>";
126+
};
127+
4066DB7E14EC5E8C0051D0F4 /* Products */ = {
128+
isa = PBXGroup;
129+
children = (
130+
);
131+
name = Products;
132+
sourceTree = "<group>";
133+
};
134+
4066DB8414EC81B00051D0F4 /* manual-source */ = {
135+
isa = PBXGroup;
136+
children = (
137+
4066DB8514EC81B00051D0F4 /* documentation.html */,
138+
4066DB8614EC81B00051D0F4 /* footer.php */,
139+
4066DB8714EC81B00051D0F4 /* gettingstarted.html */,
140+
4066DB8814EC81B00051D0F4 /* header.php */,
141+
4066DB8914EC81B00051D0F4 /* index.html */,
142+
4066DB8A14EC81B00051D0F4 /* installation.html */,
143+
4066DB8B14EC81B00051D0F4 /* licenses.html */,
144+
4066DB8C14EC81B00051D0F4 /* links.html */,
145+
4066DB8D14EC81B00051D0F4 /* mkmanual.sh */,
146+
4066DB8E14EC81B00051D0F4 /* releasenotes.html */,
147+
4066DB8F14EC81B00051D0F4 /* resources */,
148+
);
149+
path = "manual-source";
150+
sourceTree = "<group>";
151+
};
152+
4066DB8F14EC81B00051D0F4 /* resources */ = {
153+
isa = PBXGroup;
154+
children = (
155+
4066DB9014EC81B00051D0F4 /* logo150.jpg */,
156+
4066DB9114EC81B00051D0F4 /* style.css */,
157+
);
158+
path = resources;
159+
sourceTree = "<group>";
160+
};
161+
4066DB9214ECF9D90051D0F4 /* en.lproj */ = {
162+
isa = PBXGroup;
163+
children = (
164+
4066DB9314ECF9D90051D0F4 /* ReadMe.rtf */,
165+
4066DB9514ECF9D90051D0F4 /* Welcome.rtf */,
166+
);
167+
path = en.lproj;
168+
sourceTree = "<group>";
169+
};
170+
406D947816665641004D70FD /* scripts */ = {
171+
isa = PBXGroup;
172+
children = (
173+
406D947916665641004D70FD /* postinstall */,
174+
);
175+
path = scripts;
176+
sourceTree = "<group>";
177+
};
178+
/* End PBXGroup section */
179+
180+
/* Begin PBXProject section */
181+
4066DB5914EAA5C00051D0F4 /* Project object */ = {
182+
isa = PBXProject;
183+
attributes = {
184+
LastUpgradeCheck = 0420;
185+
ORGANIZATIONNAME = "Objective Development Software GmbH";
186+
};
187+
buildConfigurationList = 4066DB5C14EAA5C00051D0F4 /* Build configuration list for PBXProject "CrossPack-AVR" */;
188+
compatibilityVersion = "Xcode 3.2";
189+
developmentRegion = English;
190+
hasScannedForEncodings = 0;
191+
knownRegions = (
192+
en,
193+
English,
194+
);
195+
mainGroup = 4066DB5714EAA5C00051D0F4;
196+
projectDirPath = "";
197+
projectReferences = (
198+
{
199+
ProductGroup = 4066DB7E14EC5E8C0051D0F4 /* Products */;
200+
ProjectRef = 4066DB7D14EC5E8C0051D0F4 /* TemplateProject.xcodeproj */;
201+
},
202+
);
203+
projectRoot = "";
204+
targets = (
205+
);
206+
};
207+
/* End PBXProject section */
208+
209+
/* Begin PBXVariantGroup section */
210+
4066DB9314ECF9D90051D0F4 /* ReadMe.rtf */ = {
211+
isa = PBXVariantGroup;
212+
children = (
213+
4066DB9414ECF9D90051D0F4 /* en */,
214+
);
215+
name = ReadMe.rtf;
216+
sourceTree = "<group>";
217+
};
218+
4066DB9514ECF9D90051D0F4 /* Welcome.rtf */ = {
219+
isa = PBXVariantGroup;
220+
children = (
221+
4066DB9614ECF9D90051D0F4 /* en */,
222+
);
223+
name = Welcome.rtf;
224+
sourceTree = "<group>";
225+
};
226+
/* End PBXVariantGroup section */
227+
228+
/* Begin XCBuildConfiguration section */
229+
4066DB5E14EAA5C00051D0F4 /* Debug */ = {
230+
isa = XCBuildConfiguration;
231+
buildSettings = {
232+
};
233+
name = Debug;
234+
};
235+
4066DB5F14EAA5C00051D0F4 /* Release */ = {
236+
isa = XCBuildConfiguration;
237+
buildSettings = {
238+
};
239+
name = Release;
240+
};
241+
/* End XCBuildConfiguration section */
242+
243+
/* Begin XCConfigurationList section */
244+
4066DB5C14EAA5C00051D0F4 /* Build configuration list for PBXProject "CrossPack-AVR" */ = {
245+
isa = XCConfigurationList;
246+
buildConfigurations = (
247+
4066DB5E14EAA5C00051D0F4 /* Debug */,
248+
4066DB5F14EAA5C00051D0F4 /* Release */,
249+
);
250+
defaultConfigurationIsVisible = 0;
251+
defaultConfigurationName = Release;
252+
};
253+
/* End XCConfigurationList section */
254+
};
255+
rootObject = 4066DB5914EAA5C00051D0F4 /* Project object */;
256+
}

‎CrossPack-AVR.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎License.txt

+340
Large diffs are not rendered by default.

‎README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
CrossPack for AVR Development is a development environment for Atmel's AVR
2+
microcontrollers running on Apple's OS X, similar to AVR Studio on Windows.
3+
It consists of the GNU compiler suite, a C library for the AVR, the AVRDUDE
4+
downloader and several other useful tools.
5+
6+
This repository contains a shell script which downloads the source code of
7+
all required packages, compiles them, builds an installer package and wraps
8+
it into a disk image, ready for distribution. It also contains resources such
9+
as a project template, manual etc.
10+
11+
12+
PREREQUISITES
13+
=============
14+
15+
* Xcode 4.4. It probably also works with newer versions of Xcode.
16+
* autoconf 2.63 or newer. Configure it with
17+
18+
export M4="xcrun m4"
19+
./configure --prefix=/usr/local
20+

‎manual-source/documentation.html

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<?include "header.php"?>
2+
<h1>Documentation</h1>
3+
The various packages contained in <?echo $pkgname?> come with different forms of documentation. Some have HTML documentation, some have Unix man pages and some have GNU Info files.
4+
<p>
5+
This section is a starting point for all documentation resources. Unfortunately, we can't link Unix man pages and GNU Info files into this HTML page. You must type the appropriate commands yourself.
6+
7+
<?
8+
function htmlLink($module)
9+
{
10+
global $prefix;
11+
echo "file://$prefix/doc/$module/index.html";
12+
}
13+
?>
14+
<h2>Documentation Available in HTML Format</h2>
15+
<a href="<?htmlLink("avr-libc")?>">AVR Libc - a C library for GCC on AVR microcontrollers</a><br>
16+
<a href="<?htmlLink("avrdude")?>">AVRDUDE - AVR Downloader/Uploader</a><br>
17+
18+
<h2>Documentation Available as Unix Man Pages</h2>
19+
<?echo $pkgname?> includes the command <tt>avr-man</tt> to ensure that AVR specific manual pages are printed. Example:
20+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ avr-man strcpy
21+
&lt;string.h&gt;: Strings(3) avr-libc &lt;string.h&gt;: Strings(3)
22+
23+
NAME
24+
&lt;string.h&gt;: Strings -
25+
26+
Detailed Description
27+
#include &lt;string.h&gt;
28+
29+
The string functions perform string operations on NULL terminated
30+
strings.
31+
...
32+
</div>
33+
<?
34+
global $prefix;
35+
$sfp = opendir("$prefix/man");
36+
while($dir = readdir($sfp)){
37+
if(ereg('^man([0-9a-zA-Z.]+)', $dir, $regs)){
38+
$section = $regs[1];
39+
echo "<h3>Documents in Section $section</h3>\n";
40+
$fp = opendir("$prefix/man/$dir");
41+
while($name = readdir($fp)){
42+
if(!ereg(".$section\$", $name))
43+
continue;
44+
if(filesize("$prefix/man/$dir/$name") < 300)
45+
continue;
46+
$f = fopen("$prefix/man/$dir/$name", "r");
47+
$description = "";
48+
while($line = fgets($f, 1000)){
49+
if(ereg('^[.]SH NAME', $line)){
50+
$description = trim(fgets($f, 1000));
51+
break;
52+
}
53+
}
54+
fclose($f);
55+
$name = ereg_replace(".$section\$", "", $name);
56+
$description = ereg_replace('[ \t]*\\\\[a-zA-Z0-9]+[ \t]*', ' ', $description);
57+
$description = ereg_replace('[.]PP', '', $description);
58+
if(ereg('^(.*) \\\\- ?(.*)$', $description, $regs)){
59+
$part1 = trim($regs[1]);
60+
$part2 = trim($regs[2]);
61+
if($part1 == ""){
62+
$description = $part2;
63+
}else if($part1 == $name || "avr-$part1" == $name){
64+
$description = $part2;
65+
}else if($part2 == ""){
66+
$description = $part1;
67+
}else{
68+
$description = "$part1 - $part2";
69+
}
70+
}
71+
if(strlen($description) > 70)
72+
$description = "";
73+
if($description == ""){
74+
echo "$name<br>\n";
75+
}else{
76+
echo "$name: " . htmlspecialchars($description) . "<br>\n";
77+
}
78+
}
79+
closedir($fp);
80+
}
81+
}
82+
closedir($sfp);
83+
?>
84+
85+
<h2>Documentation Available as GNU Info Pages</h2>
86+
<?echo $pkgname?> includes the command <tt>avr-info</tt> to ensure that AVR specific info pages are printed. Example:
87+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ avr-info binutils
88+
File: binutils.info, Node: Top, Next: ar, Up: (dir)
89+
90+
Introduction
91+
************
92+
93+
This brief manual contains documentation for the GNU binary utilities
94+
(GNU Binutils) version 2.17.90:
95+
...
96+
</div>
97+
<h3>List of Info Documents</h3>
98+
<?
99+
global $prefix;
100+
$fp = opendir("$prefix/share/info");
101+
unset($docs);
102+
while($file = readdir($fp)){
103+
if(ereg('^(.*)[.]info.*$', $file, $regs)){
104+
$docs[$regs[1]] = true;
105+
}
106+
}
107+
closedir($fp);
108+
$names = array_keys($docs);
109+
sort($names, SORT_STRING);
110+
for($i = 0; $i < count($names); $i++){
111+
$name = $names[$i];
112+
echo "$name<br>\n";
113+
}
114+
115+
?>
116+
117+
<h2>AVR Libc Examples</h2>
118+
<?
119+
$fp = popen("echo \"$prefix/share/doc/avr-libc-\"*/examples/", "r");
120+
$path = trim(fgets($fp, 10000));
121+
pclose($fp);
122+
?>
123+
AVR Libc comes with a set of example projects. These can be viewed <a href="<?echo "file://$path"?>">here</a>.
124+
125+
<?include "footer.php"?>

‎manual-source/footer.php

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
</td></table>
2+
</body></html>

‎manual-source/gettingstarted.html

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?include "header.php"?>
2+
<h1>Getting Started</h1>
3+
Let's start with a simple example. We have an ATMega8 and want to blink an LED connected to Port D bit 4. To create a template project, run the following commands in a Terminal window:
4+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ cd ~/Documents
5+
bash$ mkdir AVR
6+
bash$ cd AVR
7+
bash$ avr-project Demo
8+
bash$ open Demo
9+
</div>
10+
We have added a new subdirectory to your Documents folder and created a project named "Demo" in it. Then we opened the newly created folder in Finder. The contents of the folder are:
11+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ cd Demo
12+
bash$ ls -l
13+
total 0
14+
drwxr-xr-x 5 cs cs 170 Nov 19 13:58 Demo.xcodeproj
15+
drwxr-xr-x 4 cs cs 136 Nov 19 13:58 firmware
16+
</div>
17+
You can later create new subdirectories for the circuit diagrams, construction drawings and maybe Mac software here. If you don't have Xcode installed, you can delete Demo.xcodeproj. The subdirectory <tt>firmware</tt> is intended for the AVR firmware, it contains:
18+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ cd firmware
19+
bash$ ls -l
20+
total 24
21+
-rw-r--r-- 1 cs cs 4139 Nov 19 13:58 Makefile
22+
-rw-r--r-- 1 cs cs 348 Nov 19 13:58 main.c
23+
</div>
24+
<tt>Makefile</tt> controls the build process and <tt>main.c</tt> contains the C source code for the project. We first edit Makefile. We want to configure the fuse values so that the AVR runs on an internal RC oscillator at 8 MHz and choose our programming tool. For this example we assume that you use Thomas Fischl's <a href="http://www.fischl.de/usbasp/" target="_blank">USBasp</a>. We edit the options at the beginning of <tt>Makefile</tt> to look like this:
25+
<div class="code box header">Excerpt of Makefile:</div><div class="code box">DEVICE = atmega8
26+
CLOCK = 8000000 # 8 MHz in Hz
27+
PROGRAMMER = -c USBasp
28+
FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x24:m
29+
OBJECTS = main.o
30+
</div>
31+
The first two lines are obvious. The third line is <tt>avrdude</tt>'s command line option for the USBasp programmer. The fourth line contains <tt>avrdude</tt>'s command line options to program the fuses appropriately (see the ATMega8 data sheet for more information on fuse bits or use one of the tools in the <a href="links.html">Links</a> section to calculate the values). And the last line lists all modules which should be compiled. That's the same as the list of source files, but with the file extension changed to <tt>.o</tt>.
32+
<p>
33+
Then we edit <tt>main.c</tt>, make it look like this:
34+
<div class="code box header">main.c:</div><div class="code box">#include &lt;avr/io.h&gt;
35+
#include &lt;util/delay.h&gt;
36+
37+
int main(void)
38+
{
39+
DDRD = 1 &lt;&lt; 4; /* make the LED pin an output */
40+
for(;;){
41+
char i;
42+
for(i = 0; i &lt; 10; i++){
43+
_delay_ms(30); /* max is 262.14 ms / F_CPU in MHz */
44+
}
45+
PORTD ^= 1 &lt;&lt; 4; /* toggle the LED */
46+
}
47+
return 0; /* never reached */
48+
}
49+
</div>
50+
Now we can run the build process in the <tt>firmware</tt> directory:
51+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ make
52+
avr-gcc -Wall -Os -DF_CPU=8000000 -mmcu=atmega8 -c main.c -o main.o
53+
avr-gcc -Wall -Os -DF_CPU=8000000 -mmcu=atmega8 -o main.elf main.o
54+
rm -f main.hex
55+
avr-objcopy -j .text -j .data -O ihex main.elf main.hex
56+
</div>
57+
If you use Xcode, you can also click the Build button to build the firmware.
58+
<tt>Make</tt> has now created the files <tt>main.o</tt>, the compiled version of <tt>main.c</tt>, <tt>main.elf</tt>, that is <tt>main.o</tt> linked with all required external libraries and finally <tt>main.hex</tt>, an Intel-Hex file ready for passing to the programmer:
59+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ ls -l
60+
total 48
61+
-rw-r--r-- 1 cs cs 4142 Nov 19 14:05 Makefile
62+
-rw-r--r-- 1 cs cs 367 Nov 19 14:06 main.c
63+
-rwxr-xr-x 1 cs cs 3161 Nov 19 14:07 main.elf
64+
-rw-r--r-- 1 cs cs 390 Nov 19 14:07 main.hex
65+
-rw-r--r-- 1 cs cs 808 Nov 19 14:07 main.o
66+
</div>
67+
<p>
68+
The final step consists of uploading the code and fuses through the programmer:
69+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ make flash
70+
avrdude -c USBasp -p atmega8 -U flash:w:main.hex:i
71+
72+
avrdude: AVR device initialized and ready to accept instructions
73+
74+
Reading | ################################################## | 100% 0.19s
75+
76+
avrdude: Device signature = 0x1e9307
77+
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
78+
To disable this feature, specify the -D option.
79+
avrdude: erasing chip
80+
avrdude: reading input file "main.hex"
81+
avrdude: writing flash (130 bytes):
82+
83+
Writing | ################################################## | 100% 0.21s
84+
85+
avrdude: 130 bytes of flash written
86+
avrdude: verifying flash memory against main.hex:
87+
avrdude: load data flash data from input file main.hex:
88+
avrdude: input file main.hex contains 130 bytes
89+
avrdude: reading on-chip flash data:
90+
91+
Reading | ################################################## | 100% 0.15s
92+
93+
avrdude: verifying ...
94+
avrdude: 130 bytes of flash verified
95+
96+
avrdude: safemode: Fuses OK
97+
98+
avrdude done. Thank you.
99+
</div>
100+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ make fuse
101+
avrdude -c USBasp -p atmega8 -U hfuse:w:0xd9:m -U lfuse:w:0x24:m
102+
103+
avrdude: AVR device initialized and ready to accept instructions
104+
105+
Reading | ################################################## | 100% 0.19s
106+
107+
avrdude: Device signature = 0x1e9307
108+
avrdude: reading input file "0xd9"
109+
avrdude: writing hfuse (1 bytes):
110+
111+
Writing | ################################################## | 100% 0.19s
112+
113+
avrdude: 1 bytes of hfuse written
114+
avrdude: verifying hfuse memory against 0xd9:
115+
avrdude: load data hfuse data from input file 0xd9:
116+
avrdude: input file 0xd9 contains 1 bytes
117+
avrdude: reading on-chip hfuse data:
118+
119+
Reading | ################################################## | 100% 0.07s
120+
121+
avrdude: verifying ...
122+
avrdude: 1 bytes of hfuse verified
123+
avrdude: reading input file "0x24"
124+
avrdude: writing lfuse (1 bytes):
125+
126+
Writing | ################################################## | 100% 0.20s
127+
128+
avrdude: 1 bytes of lfuse written
129+
avrdude: verifying lfuse memory against 0x24:
130+
avrdude: load data lfuse data from input file 0x24:
131+
avrdude: input file 0x24 contains 1 bytes
132+
avrdude: reading on-chip lfuse data:
133+
134+
Reading | ################################################## | 100% 0.07s
135+
136+
avrdude: verifying ...
137+
avrdude: 1 bytes of lfuse verified
138+
139+
avrdude: safemode: Fuses OK
140+
141+
avrdude done. Thank you.
142+
</div>
143+
The LED connected to Port D bit 4 should blink now.
144+
<?include "footer.php"?>

‎manual-source/header.php

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?
2+
global $prefix, $version, $pkgname, $pkgUnixName;
3+
$prefix = $_SERVER['argv'][1];
4+
$pkgname = $_SERVER['argv'][2];
5+
eregi('/([ a-zA-Z-]+)-([0-9.]+)$', $prefix, $regs);
6+
$pkgUnixName = $regs[1];
7+
$version = $regs[2];
8+
?>
9+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
10+
<html><head>
11+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
12+
<title><?echo $pkgname?> - A Development Environment for AVR Microcontrollers</title>
13+
<link rel="stylesheet" href="resources/style.css" type="text/css">
14+
</head>
15+
<body>
16+
<?
17+
function odImageTag($path, $altText, $align)
18+
{
19+
global $lang;
20+
$fpath = $path;
21+
if(!file_exists($fpath)){ /* try to find at various places */
22+
$fpath = "$lang/$path";
23+
if(!file_exists($fpath)){
24+
$fpath = "default/$path";
25+
if(!file_exists($fpath))
26+
$fpath = "../default/$path";
27+
}
28+
}
29+
$size = getImageSize($fpath);
30+
$aligntag = $alttag = "";
31+
if($altText)
32+
$alttag = " alt=\"$altText\"";
33+
if($align)
34+
$aligntag = " align=$align";
35+
echo "<img src='$path' $size[3] border=0$alttag$aligntag>";
36+
}
37+
?>
38+
<table border=0 cellspacing=0 cellpadding=0><tr>
39+
<td valign=top align=left><div class="index">
40+
<?odImageTag("resources/logo150.jpg", "Logo", "center");?>
41+
<h3><?echo "$pkgname $version"?></h3>
42+
<p>
43+
<a href="index.html">Overview</a><p>
44+
<a href="installation.html">Installation and Removal</a><p>
45+
<a href="gettingstarted.html">Getting Started</a><p>
46+
<a href="documentation.html">Documentation</a><p>
47+
<a href="links.html">Links</a><p>
48+
<a href="releasenotes.html">Release Notes</a><p>
49+
<a href="licenses.html">Software Licenses</a>
50+
</p>
51+
</div></td>
52+
<td bgcolor="#bbb" width=1></td><td width=20>&nbsp;</td>
53+
<td valign=top align=left>

‎manual-source/index.html

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?include "header.php"?>
2+
<h1>Overview</h1>
3+
<h2>What is <?echo $pkgname?>?</h2>
4+
<?echo $pkgname?> is a development environment for <a href="http://www.atmel.com/products/AVR/" target="_blank">Atmel's AVR microcontrollers</a> running on Apple's Mac OS X, similar to <a href="http://winavr.sourceforge.net/" target="_blank">WinAVR</a> for Windows. It consists of the GNU compiler suite, a C library for the AVR, the AVRDUDE uploader and several other useful tools.
5+
6+
<?echo $pkgname?> consists of the following packages:
7+
<ul>
8+
<?
9+
global $prefix;
10+
$fp = fopen("$prefix/versions.txt", "r");
11+
while($line = fgets($fp, 1000)){
12+
$line = trim($line);
13+
ereg('^(.*): (.*)$', $line, $regs);
14+
$package = $regs[1];
15+
$version = $regs[2];
16+
switch($package){
17+
case "binutils":
18+
case "make":
19+
$package = "GNU $package";
20+
break;
21+
}
22+
echo "<li>$package in version $version</li>\n";
23+
}
24+
fclose($fp);
25+
?>
26+
</ul>
27+
28+
<h2>Supported Devices</h2>
29+
<h3>Devices supported by <tt>avr-gcc</tt></h3>
30+
<?
31+
function gccDevices($gccVersion)
32+
{
33+
global $prefix;
34+
//system("$prefix/bin/avr-gcc-select $gccVersion >/dev/null 2>&1");
35+
$devices = array();
36+
$fp = popen("$prefix/bin/avr-gcc --target-help -mlist-devices | grep __AVR", "r");
37+
while($line = fgets($fp, 1000)){
38+
$arr = explode(" ", $line, 2);
39+
$devices[] = $arr[0];
40+
}
41+
pclose($fp);
42+
sort($devices, SORT_STRING);
43+
for($i = 0; $i < count($devices); $i++){
44+
if($i != 0){
45+
echo ", ";
46+
}
47+
echo $devices[$i];
48+
}
49+
}
50+
51+
gccDevices("4");
52+
?>
53+
54+
<h3>Devices supported by the assembler <tt>avr-as</tt></h3>
55+
<?
56+
$devices = array();
57+
$fp = popen("echo | $prefix/bin/avr-as -mmcu=x - 2>&1", "r");
58+
while($line = fgets($fp, 1000)){
59+
$line = trim($line);
60+
if($line == "" || eregi('known', $line) || eregi('assembler', $line) || eregi('fatal', $line))
61+
continue;
62+
$list = explode(" ", $line);
63+
for($i = 0; $i < count($list); $i++){
64+
$devices[] = $list[$i];
65+
}
66+
}
67+
pclose($fp);
68+
sort($devices, SORT_STRING);
69+
for($i = 0; $i < count($devices); $i++){
70+
if($i != 0){
71+
echo ", ";
72+
}
73+
echo $devices[$i];
74+
}
75+
?>
76+
<?include "footer.php"?>

‎manual-source/installation.html

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?include "header.php"?>
2+
<h1>Installing <?echo $pkgname?></h1>
3+
<?echo $pkgname?> comes as a Mac OS X installer package. Simply double-click <?echo $pkgUnixName?>.pkg to install. Please restart Terminal after installation to make sure that it inherits the new <tt>PATH</tt> environment variable.
4+
<p>
5+
<?echo $pkgname?> does not include a text editor for editing source files. If you have Xcode already installed (e.g. because you also need to develop software for the Mac), simply use Xcode to edit your sources. If you don't have Xcode, recommend <a href="http://www.barebones.com/products/textwrangler/" target="_blank">BareBone's TextWrangler</a> instead. It's free. You may also use TextEdit (which ships with Mac OS X) for source code editing, but it lacks things like auto-indentation.
6+
7+
<h1>Upgrading</h1>
8+
<?echo $pkgname?> installs into <tt>/usr/local/<?echo $pkgUnixName?>-&lt;version&gt;</tt> and <tt>/usr/local/<?echo $pkgUnixName?></tt> is always a symbolic link to the version which has been installed last. Several versions of <?echo $pkgname?> can therefore coexist and you can switch between them by changing the symbolic link. If you want only one version, remove the old installation before installing the new package, or delete it any time later from <tt>/usr/local/</tt>:
9+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ cd /usr/local/
10+
bash$ ls -ld <?echo $pkgUnixName?>*
11+
lrwxr-xr-x 1 root wheel 19 Dec 1 18:04 <?echo $pkgUnixName?> -&gt; <?echo $pkgUnixName?>-20071201
12+
drwxr-xr-x 15 root wheel 568 Nov 26 22:12 <?echo $pkgUnixName?>-20071126
13+
drwxr-xr-x 18 root wheel 612 Dec 1 18:04 <?echo $pkgUnixName?>-20071201
14+
bash$ sudo rm -rf <?echo $pkgUnixName?>-20071126
15+
Password:
16+
</div>
17+
18+
19+
<h1>Removing <?echo $pkgname?></h1>
20+
To remove <?echo $pkgname?> completely, run the following command in a Terminal window:
21+
<div class="shell box header">Shell Session:</div><div class="shell box">bash$ sudo /usr/local/<?echo $pkgUnixName?>/uninstall
22+
Password:
23+
Are you sure you want to uninstall <?echo $pkgname?> <?echo $version?>?
24+
[y/N]
25+
yes
26+
Starting uninstall.
27+
<?echo $pkgname?> is now removed.
28+
</div>
29+
30+
<?include "footer.php"?>

‎manual-source/licenses.html

+407
Large diffs are not rendered by default.

‎manual-source/links.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?include "header.php"?>
2+
<h1>Links</h1>
3+
This section lists software packages and sites which may be useful for people working with the AVR.
4+
5+
<h2><a href="http://www.barebones.com/products/textwrangler/" target="_blank">Barebone's TextWrangler</a></h2>
6+
This is a text editor. We list it here because it's a powerful programming editor and it's free. If you don't want to install Xcode, you probably want TextWrangler for source code editing.
7+
8+
<h2><a href="http://www.engbedded.com/fusecalc/" target="_blank">AVR Fuse Calculator</a></h2>
9+
This web site is an interactive fuse value calculator for AVR devices. You choose the desired options from pop-up menus or checkboxes and it tells you the hexadecimal fuse values to be used with AVRDUDE.
10+
11+
<h2><a href="http://www.vonnieda.org/AVRFuses/" target="_blank">AVRFuses</a></h2>
12+
This native Mac application is a GUI frontend for AVRDUDE, the uploader/downloader tool which ships with <?echo $pkgname?>. AVRFuses, as the name suggests, contains a fuse value calculator for user friendly feature selection. AVRFuses is free!
13+
14+
<h2><a href="http://www.obdev.at/products/avrusb/" target="_blank">V-USB</a></h2>
15+
Objective Development has a USB library for AVR microcontrollers. This library implements low speed USB device functionality without special hardware resources. Only one edge triggered interrupt is required. This library is free (Gnu General Public License version 2 and 3).
16+
17+
<h2><a href="http://www.atmel.com/avrstudio" target="_blank">AVR Studio 5</a></h2>
18+
This is Atmel's development environment for AVRs running on Windows. It ships with avr-gcc for C/C++ development. <?echo $pkgname?> tracks the development of AVR Studio and tries to provide the same functionality.
19+
20+
<?include "footer.php"?>

‎manual-source/mkmanual.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
dest="../manual"
3+
4+
rm -rf "$dest"
5+
mkdir "$dest"
6+
for i in *.html; do
7+
php -f $i >"$dest/$i" "$@"
8+
done
9+
cp -r resources "$dest"

‎manual-source/releasenotes.html

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?include "header.php"?>
2+
<h1>Release Notes</h1>
3+
The following list is in reverse historic order, new releases are inserted at the top:
4+
5+
<h2>AVR MacPack 20120217</h2>
6+
<ul>
7+
<li>Based on gcc version 4.5.1 and patches obtained from FreeBSD's ports section.</li>
8+
<li>New versions of all packages.</li>
9+
<li>Dropped support for Mac OS X 10.5 and older.</li>
10+
<li>Dropped support for avr-gcc version 3.</li>
11+
</ul>
12+
13+
<h2>AVR MacPack 20100115</h2>
14+
<ul>
15+
<li>Based on WinAVR 20100110.</li>
16+
<li>Added binutils bfd library for AVR to distribution.</li>
17+
<li>New versions: avr-gcc 4.3.3, avr-libc 1.6.7, avrdude 5.8, simulavr 0.9</li>
18+
</ul>
19+
20+
<h2>CrossPack-AVR 20090415</h2>
21+
<ul>
22+
<li>Renamed project to CrossPack due to trademark issues.</li>
23+
</ul>
24+
25+
<h2>AVR MacPack 20090319</h2>
26+
<ul>
27+
<li>Based on WinAVR 20090313.</li>
28+
<li>New patches from WinAVR fix linker bug which affected 8k devices in avr25 class such as ATTiny85.</li>
29+
<li>Support for new devices: AT90PWM81, AT90SCR100, ATA6289, ATmega16M1, ATmega16U4, ATmega64C1, ATmega64M1, ATmega128RFA1, ATtiny87, ATxmega32A4, ATxmega32D4, ATxmega16A4, ATxmega16D4.</li>
30+
<li>New versions: avr-libc 1.6.6, avrdude 5.6, avarice 2.9, simulavr 0.1.2.6.</li>
31+
</ul>
32+
33+
<h2>AVR MacPack 20081213</h2>
34+
<ul>
35+
<li>Removed all "<tt>.svn</tt>" directories from release.</li>
36+
<li>New versions and patches from WinAVR 20081205: binutils 2.19, gcc 4.3.2, avr-libc 1.6.4, gdb 6.8, avarice 2.8.</li>
37+
<li>These versions and patches bring support for new devices: ATxmega64A3, ATxmega128A3, ATxmega256A3, ATxmega256A3B and ATmega32U6.
38+
</li>
39+
</ul>
40+
41+
<h2>AVR MacPack 20080721</h2>
42+
<ul>
43+
<li>Avrdude linked libusb from /usr/local/lib instead of /usr/local/AVRMacPack/lib in version 20080716. This problem was caused by a changed precedence of library paths in Mac OS X 10.5. Only 20080716 is affected since this was the first release built on 10.5.</li>
44+
</ul>
45+
46+
<h2>AVR MacPack 20080716</h2>
47+
<ul>
48+
<li>Based on patches from WinAVR 20080610.</li>
49+
<li>Added "binary constants" patch for gcc 3.</li>
50+
</ul>
51+
52+
<h2>AVR MacPack 20080514</h2>
53+
<ul>
54+
<li>New versions: gcc 4.3, avr-libc 1.6.2, simulavr 1.2.5.</li>
55+
<li>Based on patches from WinAVR 20080512.</li>
56+
</ul>
57+
58+
<h2>AVR MacPack 20080318</h2>
59+
<ul>
60+
<li>Upgraded to avr-libc 1.6.1 patch level 20080228. Gcc 4.2.2 requires this version for some of the newer devices.</li>
61+
<li>Added links to fuse calculators and other related information in manual.</li>
62+
<li>Fixed a problem with changes in /etc/csh.login which caused an error message for users with tcsh as login shell.</li>
63+
</ul>
64+
65+
66+
<h2>AVR MacPack 20080121</h2>
67+
<ul>
68+
<li>Fixed a problem in the template project where Xcode could not find avr-gcc and related tools (problem with PATH environment variable).</li>
69+
<li>Fixed listing of supported devices in manual.</li>
70+
<li>Allow user specific template projects in ~/.AVRMacPack/templates/TemplateProject.</li>
71+
</ul>
72+
73+
74+
<h2>AVR MacPack 20071201</h2>
75+
Cleaner separation into avr-gcc version 3 and 4. We now switch not only gcc, but also avr-libc so that it has been compiled with the same version of gcc.
76+
77+
78+
<h2>AVR MacPack 20071126</h2>
79+
This is the initial release.
80+
81+
<?include "footer.php"?>

‎manual-source/resources/logo150.jpg

6.13 KB
Loading

‎manual-source/resources/style.css

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/* elements */
2+
3+
A:link { text-decoration: none; color: #049; }
4+
A:visited { text-decoration: none; color: #049; }
5+
A:active { text-decoration: none; color: #025; }
6+
A:hover { text-decoration: underline; }
7+
8+
BODY {
9+
color: #222;
10+
text-align: left;
11+
font-family: Lucida Grande,Verdana,Arial,Helvetica;
12+
font-size: 12px;
13+
margin: 20px;
14+
padding: 0px 0px;
15+
}
16+
TD {
17+
font-size: 12px;
18+
}
19+
20+
H1 {
21+
font-size: 24px;
22+
color: #334;
23+
margin: 32px 0px;
24+
margin-bottom: 1em;
25+
padding-bottom: 0.2em;
26+
border-bottom: 2px solid #bbb;
27+
line-height: 1.1em;
28+
}
29+
30+
H2 {
31+
font-size: 14px;
32+
color: #555;
33+
margin: 2em 0em 1em 0px;
34+
padding: 2px 0px 3px 0px;
35+
border-bottom: 1px solid #bbb;
36+
line-height: normal;
37+
}
38+
H3 { font-size: 13px; margin-top: 1.8em; margin-bottom: 0.8em; color: #333; }
39+
H4 { font-size: 12px; margin-bottom: 3px; color: #333; }
40+
H5 { font-size: 11px; margin-bottom: 3px; }
41+
H6 { font-size: 10px; }
42+
43+
HR.dotted {
44+
border: none;
45+
height: 1px;
46+
background-image: url(images/hdots.gif);
47+
margin: 10px 0px;
48+
padding: 0px;
49+
}
50+
51+
I { font-family: Helvetica; margin-right: 0.3em; }
52+
INPUT { font-size: 12px; }
53+
PRE { font-family: Courier; font-size: 12px; }
54+
SELECT { font-size: 12px; }
55+
SMALL { font-size: 10px; line-height: 145%; }
56+
TT, KBD { font-family: Monaco, Courier, monospace; font-size: 90%; }
57+
UL { list-style-image: url(images/bullet.png); padding-left: 20px; margin-left: 0px; }
58+
UL UL { list-style: circle outside none; }
59+
OL { list-style-image: none; padding-left: 36px; margin-left: 0px; }
60+
61+
/* classes */
62+
63+
.index {
64+
width: 150px;
65+
padding: 8px 10px;
66+
margin-top: 16px;
67+
height: 100%;
68+
}
69+
70+
.box {
71+
background-color: #eee;
72+
border: 1px solid #bbb;
73+
border-left-width: 1px;
74+
padding: 8px 10px;
75+
margin-top: 0px;
76+
margin-bottom: 18px;
77+
font-family: Courier, Monaco;
78+
font-size: 12px;
79+
white-space: pre;
80+
line-height: 130%;
81+
width: 580px;
82+
}
83+
84+
.box.shell {
85+
background-color: #eee;
86+
border-color: #bbb;
87+
}
88+
.box.code {
89+
background-color: #ffee80;
90+
border-color: #ddcc60;
91+
}
92+
.box.shell.header {
93+
margin-top: 12px;
94+
margin-bottom: 0px;
95+
padding: 0px 10px;
96+
border-bottom-width: 0px;
97+
background-color: #bbb;
98+
font-size: 10px;
99+
}
100+
.box.code.header {
101+
margin-top: 12px;
102+
margin-bottom: 0px;
103+
padding: 0px 10px;
104+
border-bottom-width: 0px;
105+
background-color: #ddcc60;
106+
font-size: 10px;
107+
}

‎mkclean.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
if [ ! -x ./mkclean.sh ]; then
4+
echo "mkclean.sh must be called from the current directory as ./mkclean.sh"
5+
exit 1
6+
fi
7+
8+
rm -rf compile math patches manual packages

‎mkdist.sh

+816
Large diffs are not rendered by default.

‎package-info/Readme.rtf

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320
2+
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
3+
{\colortbl;\red255\green255\blue255;}
4+
\paperw12240\paperh15840\vieww9600\viewh8400\viewkind0
5+
\pard\tx1440\tx2880\tx4320\tx5760\tx7200
6+
7+
\f0\fs20 \cf0 For more information about %pkgPrettyName% please visit http://www.obdev.at/%pkgUrlName%/\
8+
\pard\tx1440\tx2880\tx4320\tx5760\tx7200
9+
10+
\fs24 \cf0 \
11+
\
12+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
13+
14+
\b\fs48 \cf0 Welcome to %pkgPrettyName%!\
15+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
16+
17+
\b0\fs24 \cf0 \
18+
\pard\pardeftab720
19+
\cf0 \CocoaLigature0 %pkgPrettyName% is a development environment for Atmel's AVR microcontrollers running on Apple's Mac OS X, similar to AVR Studio on Windows. It consists of the GNU compiler suite, a C library for the AVR, the AVRDUDE downloader and several other useful tools.\
20+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
21+
\cf0 \
22+
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural
23+
24+
\b\fs28 \cf0 Installing %pkgPrettyName%\
25+
26+
\fs12 \
27+
28+
\b0\fs24 %pkgPrettyName% comes as a Mac OS X installer package. Simply double-click %pkgUnixName%.pkg to install. Please restart Terminal after installation to make sure that it inherits the new set of environment variables.\
29+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
30+
\cf0 \CocoaLigature1 \
31+
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural
32+
33+
\b\fs28 \cf0 \CocoaLigature0 Upgrading\
34+
35+
\fs12 \
36+
37+
\b0\fs24 %pkgPrettyName% installs into /usr/local/%pkgUnixName%-<version> and /usr/local/%pkgUnixName% is always a symbolic link to the version which has been installed last. Several versions of %pkgPrettyName% can therefore coexist. If you want only one version, remove the old installation before installing the new package, or delete it any time later from /usr/local/.\
38+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
39+
\cf0 \CocoaLigature1 \
40+
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural
41+
42+
\b\fs28 \cf0 \CocoaLigature0 Software Licenses\
43+
44+
\fs12 \
45+
46+
\b0\fs24 All software in this package is distributed under the terms of the GNU General Public License version 2, except AVR Libc which is distributed under a more liberal license. See the manual for the full text of these licenses.\
47+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
48+
\cf0 \CocoaLigature1 \
49+
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural
50+
51+
\b\fs28 \cf0 \CocoaLigature0 More Information\
52+
53+
\fs12 \
54+
55+
\b0\fs24 More information is available after installation. Type "avr-help" in a Terminal window to open the manual. An alias to the manual is also created in the Applications folder.\
56+
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural
57+
\cf0 \CocoaLigature1 \
58+
\pard\tx1440\tx2880\tx4320\tx5760\tx7200
59+
\cf0 __________________________________________\
60+
\pard\tx1440\tx2880\tx4320\tx5760\tx7200
61+
62+
\fs18 \cf0 Copyright 2012, OBJECTIVE DEVELOPMENT Software GmbH.}

‎package-info/Resources/background.jp2

41.7 KB
Binary file not shown.
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320
2+
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
3+
{\colortbl;\red255\green255\blue255;}
4+
\paperw12240\paperh15840\vieww9600\viewh8400\viewkind0
5+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
6+
7+
\f0\b\fs48 \cf0 Getting Started with %pkgPrettyName%\
8+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
9+
10+
\b0\fs24 \cf0 \
11+
%pkgPrettyName% has no Graphic User Interface, it consists of command line tools only. For help with the package, type "avr-help" in a Terminal window. This opens the manual in your favorite web browser. An alias to this manual is also created in the Applications folder during installation.\
12+
13+
\fs12 \
14+
15+
\b\fs24 Please restart Terminal after the initial installation!\
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320
2+
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
3+
{\colortbl;\red255\green255\blue255;}
4+
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}}
5+
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
6+
\paperw12240\paperh15840\vieww9600\viewh8400\viewkind0
7+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
8+
9+
\f0\b\fs48 \cf0 Welcome to %pkgPrettyName% %version%\
10+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
11+
12+
\b0\fs24 \cf0 \
13+
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural
14+
15+
\b\fs28 \cf0 \CocoaLigature0 What is %pkgPrettyName%?\
16+
17+
\fs12 \
18+
19+
\b0\fs24 %pkgPrettyName% is a development environment for Atmel's AVR microcontrollers running on Apple's Mac OS X, similar to AVR Studio on Windows. It consists of the GNU compiler suite, a C library for the AVR, the AVRDUDE downloader and several other useful tools.\
20+
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
21+
\cf0 \CocoaLigature1 \
22+
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural
23+
24+
\b\fs28 \cf0 \CocoaLigature0 Features\
25+
26+
\fs12 \
27+
\pard\tx220\tx440\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li440\fi-440
28+
\ls1\ilvl0
29+
\b0\fs24 \cf0 \CocoaLigature1 {\listtext \'95 }Easy installation and removal.\CocoaLigature0 \
30+
{\listtext \'95 }Does not depend on Xcode for building AVR code.\
31+
\pard\tx220\tx440\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li440\fi-440
32+
\ls1\ilvl0\cf0 {\listtext \'95 }Runs on Mac OS X 10.6 (Snow Leopard) and higher.\
33+
{\listtext \'95 }Patched gcc to support more devices (at least as many as AVR Studio)\
34+
{\listtext \'95 }Includes gdb for debugging with simulavr and avarice.\
35+
}

‎package-info/scripts/postinstall

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
# Parameters passed:
3+
# $1: full path to the installation package (xxx.pkg)
4+
# $2: full path to destination (/)
5+
# $3: mountpoint of destination volume (/)
6+
# $4: root directory for current system folder (/)
7+
8+
realPrefix="%prefix%"
9+
genericPrefix=$(echo "$realPrefix" | sed -e 's/-[0-9.]*$//g')
10+
pkgUnixName=$(basename "$genericPrefix")
11+
12+
rm -f "$genericPrefix"
13+
ln -s `basename "$realPrefix"` "$genericPrefix"
14+
ln -s "$genericPrefix/manual/index.html" "/Applications/$pkgUnixName-Manual.html"
15+
16+
echo "$genericPrefix/bin" >"/etc/paths.d/50-at.obdev.$pkgUnixName"
17+
18+
(sleep 3; open "$genericPrefix/manual/index.html") & # Wait until the user realized that install is ready
19+
20+
exit 0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
--- gcc/cpplib.h.orig Mon Feb 9 13:23:51 2004
2+
+++ gcc/cpplib.h Thu Apr 29 12:24:10 2004
3+
@@ -630,6 +630,7 @@
4+
#define CPP_N_DECIMAL 0x0100
5+
#define CPP_N_HEX 0x0200
6+
#define CPP_N_OCTAL 0x0400
7+
+#define CPP_N_BINARY 0x0800
8+
9+
#define CPP_N_UNSIGNED 0x1000 /* Properties. */
10+
#define CPP_N_IMAGINARY 0x2000
11+
--- gcc/cppexp.c.orig Thu Feb 12 00:52:56 2004
12+
+++ gcc/cppexp.c Thu Apr 29 12:29:40 2004
13+
@@ -22,6 +22,9 @@
14+
#include "system.h"
15+
#include "cpplib.h"
16+
#include "cpphash.h"
17+
+#include "flags.h"
18+
+#include "coretypes.h"
19+
+#include "toplev.h"
20+
21+
#define PART_PRECISION (sizeof (cpp_num_part) * CHAR_BIT)
22+
#define HALF_MASK (~(cpp_num_part) 0 >> (PART_PRECISION / 2))
23+
@@ -75,6 +78,9 @@
24+
#define SYNTAX_ERROR2(msgid, arg) \
25+
do { cpp_error (pfile, CPP_DL_ERROR, msgid, arg); goto syntax_error; } \
26+
while(0)
27+
+#define SYNTAX_ERROR3(msgid, arg1, arg2) \
28+
+ do { cpp_error (pfile, CPP_DL_ERROR, msgid, arg1, arg2); goto syntax_error; } \
29+
+ while(0)
30+
31+
/* Subroutine of cpp_classify_number. S points to a float suffix of
32+
length LEN, possibly zero. Returns 0 for an invalid suffix, or a
33+
@@ -171,6 +177,11 @@
34+
radix = 16;
35+
str++;
36+
}
37+
+ else if ((*str == 'b' || *str == 'B') && (str[1] == '0' || str[1] == '1'))
38+
+ {
39+
+ radix = 2;
40+
+ str++;
41+
+ }
42+
}
43+
44+
/* Now scan for a well-formed integer or float. */
45+
@@ -209,7 +220,8 @@
46+
radix = 10;
47+
48+
if (max_digit >= radix)
49+
- SYNTAX_ERROR2 ("invalid digit \"%c\" in octal constant", '0' + max_digit);
50+
+ SYNTAX_ERROR3 ("invalid digit \"%c\" in %s constant", '0' + max_digit,
51+
+ radix == 2? "binary": "octal");
52+
53+
if (float_flag != NOT_FLOAT)
54+
{
55+
@@ -288,11 +300,16 @@
56+
if ((result & CPP_N_IMAGINARY) && CPP_PEDANTIC (pfile))
57+
cpp_error (pfile, CPP_DL_PEDWARN,
58+
"imaginary constants are a GCC extension");
59+
+ if (radix == 2 && CPP_PEDANTIC (pfile))
60+
+ cpp_error (pfile, CPP_DL_PEDWARN,
61+
+ "binary constants are a GCC extension");
62+
63+
if (radix == 10)
64+
result |= CPP_N_DECIMAL;
65+
else if (radix == 16)
66+
result |= CPP_N_HEX;
67+
+ else if (radix == 2)
68+
+ result |= CPP_N_BINARY;
69+
else
70+
result |= CPP_N_OCTAL;
71+
72+
@@ -341,6 +358,11 @@
73+
else if ((type & CPP_N_RADIX) == CPP_N_HEX)
74+
{
75+
base = 16;
76+
+ p += 2;
77+
+ }
78+
+ else if ((type & CPP_N_RADIX) == CPP_N_BINARY)
79+
+ {
80+
+ base = 2;
81+
p += 2;
82+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2004-05-12 Theodore A. Roth <troth@openavr.org>
2+
3+
* gcc/config/avr/avr.c (avr_handle_fndecl_attribute): Generate a
4+
warning if the function name does not begin with "__vector" and the
5+
function has either the 'signal' or 'interrupt' attribute.
6+
7+
Index: gcc/config/avr/avr.c
8+
===================================================================
9+
RCS file: /cvsroot/gcc/gcc/gcc/config/avr/avr.c,v
10+
retrieving revision 1.118
11+
diff -u -p -p -r1.118 avr.c
12+
--- gcc/config/avr/avr.c 13 Mar 2004 06:43:30 -0000 1.118
13+
+++ gcc/config/avr/avr.c 12 May 2004 19:40:28 -0000
14+
@@ -4566,6 +4559,32 @@ avr_handle_fndecl_attribute (tree *node,
15+
warning ("`%s' attribute only applies to functions",
16+
IDENTIFIER_POINTER (name));
17+
*no_add_attrs = true;
18+
+ }
19+
+ else
20+
+ {
21+
+ const char *func_name = IDENTIFIER_POINTER (DECL_NAME (*node));
22+
+ const char *attr = IDENTIFIER_POINTER (name);
23+
+
24+
+ /* If the function has the 'signal' or 'interrupt' attribute, test to
25+
+ make sure that the name of the function is "__vector_NN" so as to
26+
+ catch when the user misspells the interrupt vector name. */
27+
+
28+
+ if (strncmp (attr, "interrupt", strlen ("interrupt")) == 0)
29+
+ {
30+
+ if (strncmp (func_name, "__vector", strlen ("__vector")) != 0)
31+
+ {
32+
+ warning ("`%s' appears to be a misspelled interrupt handler",
33+
+ func_name);
34+
+ }
35+
+ }
36+
+ else if (strncmp (attr, "signal", strlen ("signal")) == 0)
37+
+ {
38+
+ if (strncmp (func_name, "__vector", strlen ("__vector")) != 0)
39+
+ {
40+
+ warning ("`%s' appears to be a misspelled signal handler",
41+
+ func_name);
42+
+ }
43+
+ }
44+
}
45+
46+
return NULL_TREE;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
diff -ur ../gcc-3.4.6.orig/gcc/config/avr/avr.c ./gcc/config/avr/avr.c
2+
--- ../gcc-3.4.6.orig/gcc/config/avr/avr.c Sun Mar 20 22:14:28 2005
3+
+++ ./gcc/config/avr/avr.c Sun Mar 19 23:06:42 2006
4+
@@ -175,6 +175,18 @@
5+
{ "at90c8534", 2, "__AVR_AT90C8534__" },
6+
{ "at90s8535", 2, "__AVR_AT90S8535__" },
7+
{ "at86rf401", 2, "__AVR_AT86RF401__" },
8+
+ { "attiny261", 2, "__AVR_ATtiny261__" },
9+
+ { "attiny461", 2, "__AVR_ATtiny461__" },
10+
+ { "attiny861", 2, "__AVR_ATtiny861__" },
11+
+ /* Classic + MOVW, <= 8K. */
12+
+ { "attiny13", 2, "__AVR_ATtiny13__" },
13+
+ { "attiny2313", 2, "__AVR_ATtiny2313__" },
14+
+ { "attiny24", 2, "__AVR_ATtiny24__" },
15+
+ { "attiny44", 2, "__AVR_ATtiny44__" },
16+
+ { "attiny84", 2, "__AVR_ATtiny84__" },
17+
+ { "attiny25", 2, "__AVR_ATtiny25__" },
18+
+ { "attiny45", 2, "__AVR_ATtiny45__" },
19+
+ { "attiny85", 2, "__AVR_ATtiny85__" },
20+
/* Classic, > 8K. */
21+
{ "avr3", 3, NULL },
22+
{ "atmega103", 3, "__AVR_ATmega103__" },
23+
@@ -185,19 +197,50 @@
24+
/* Enhanced, <= 8K. */
25+
{ "avr4", 4, NULL },
26+
{ "atmega8", 4, "__AVR_ATmega8__" },
27+
+ { "atmega48", 4, "__AVR_ATmega48__" },
28+
+ { "atmega88", 4, "__AVR_ATmega88__" },
29+
{ "atmega8515", 4, "__AVR_ATmega8515__" },
30+
{ "atmega8535", 4, "__AVR_ATmega8535__" },
31+
+ { "at90pwm2", 4, "__AVR_AT90PWM2__" },
32+
+ { "at90pwm3", 4, "__AVR_AT90PWM3__" },
33+
/* Enhanced, > 8K. */
34+
{ "avr5", 5, NULL },
35+
{ "atmega16", 5, "__AVR_ATmega16__" },
36+
{ "atmega161", 5, "__AVR_ATmega161__" },
37+
{ "atmega162", 5, "__AVR_ATmega162__" },
38+
{ "atmega163", 5, "__AVR_ATmega163__" },
39+
+ { "atmega164p",5, "__AVR_ATmega164P__" },
40+
+ { "atmega165", 5, "__AVR_ATmega165__" },
41+
+ { "atmega165p", 5,"__AVR_ATmega165P__" },
42+
+ { "atmega168", 5, "__AVR_ATmega168__" },
43+
{ "atmega169", 5, "__AVR_ATmega169__" },
44+
+ { "atmega169p", 5,"__AVR_ATmega169P__" },
45+
{ "atmega32", 5, "__AVR_ATmega32__" },
46+
{ "atmega323", 5, "__AVR_ATmega323__" },
47+
+ { "atmega324p",5, "__AVR_ATmega324P__" },
48+
+ { "atmega325", 5, "__AVR_ATmega325__" },
49+
+ { "atmega3250", 5, "__AVR_ATmega3250__" },
50+
+ { "atmega329", 5, "__AVR_ATmega329__" },
51+
+ { "atmega3290", 5, "__AVR_ATmega3290__" },
52+
+ { "atmega406", 5, "__AVR_ATmega406__" },
53+
+ { "atmega640", 5, "__AVR_ATmega640__" },
54+
{ "atmega64", 5, "__AVR_ATmega64__" },
55+
+ { "atmega644", 5, "__AVR_ATmega644__" },
56+
+ { "atmega644p",5, "__AVR_ATmega644P__" },
57+
+ { "atmega645", 5, "__AVR_ATmega645__" },
58+
+ { "atmega6450", 5, "__AVR_ATmega6450__" },
59+
+ { "atmega649", 5, "__AVR_ATmega649__" },
60+
+ { "atmega6490", 5, "__AVR_ATmega6490__" },
61+
{ "atmega128", 5, "__AVR_ATmega128__" },
62+
+ { "atmega1280",5, "__AVR_ATmega1280__" },
63+
+ { "atmega1281",5, "__AVR_ATmega1281__" },
64+
+ { "at90can32", 5, "__AVR_AT90CAN32__" },
65+
+ { "at90can64", 5, "__AVR_AT90CAN64__" },
66+
+ { "at90can128", 5, "__AVR_AT90CAN128__" },
67+
+ { "at90usb646", 5, "__AVR_AT90USB646__" },
68+
+ { "at90usb647", 5, "__AVR_AT90USB647__" },
69+
+ { "at90usb1286", 5, "__AVR_AT90USB1286__" },
70+
+ { "at90usb1287", 5, "__AVR_AT90USB1287__" },
71+
{ "at94k", 5, "__AVR_AT94K__" },
72+
/* Assembler only. */
73+
{ "avr1", 1, NULL },
74+
diff -ur ../gcc-3.4.6.orig/gcc/config/avr/avr.h ./gcc/config/avr/avr.h
75+
--- ../gcc-3.4.6.orig/gcc/config/avr/avr.h Tue Mar 9 04:00:15 2004
76+
+++ ./gcc/config/avr/avr.h Sun Mar 19 23:08:23 2006
77+
@@ -2351,12 +2351,13 @@
78+
Do not define this macro if it does not need to do anything. */
79+
80+
#define LINK_SPEC " %{!mmcu*:-m avr2}\
81+
-%{mmcu=at90s1200|mmcu=attiny1*|mmcu=attiny28:-m avr1} \
82+
-%{mmcu=attiny22|mmcu=attiny26|mmcu=at90s2*|mmcu=at90s4*|mmcu=at90s8*|mmcu=at90c8*|mmcu=at86rf401:-m avr2}\
83+
+%{mmcu=at90s1200|mmcu=attiny11|mmcu=attiny12|mmcu=attiny15|mmcu=attiny28:-m avr1} \
84+
+%{mmcu=attiny22|mmcu=attiny26|mmcu=at90s2*|mmcu=at90s4*|mmcu=at90s8*|mmcu=at90c8*|mmcu=at86rf401|mmcu=attiny13|mmcu=attiny2313|mmcu=attiny24|mmcu=attiny44|mmcu=attiny84|mmcu=attiny25|mmcu=attiny45|mmcu=attiny85|mmcu=attiny261|mmcu=attiny461|mmcu=attiny861:-m avr2}\
85+
%{mmcu=atmega103|mmcu=atmega603|mmcu=at43*|mmcu=at76*:-m avr3}\
86+
-%{mmcu=atmega8*:-m avr4}\
87+
-%{mmcu=atmega16*|mmcu=atmega32*|mmcu=atmega64|mmcu=atmega128|mmcu=at94k:-m avr5}\
88+
-%{mmcu=atmega64|mmcu=atmega128|mmcu=atmega162|mmcu=atmega169: -Tdata 0x800100} "
89+
+%{mmcu=atmega8*|mmcu=atmega48|mmcu=at90pwm*:-m avr4}\
90+
+%{mmcu=atmega16*|mmcu=atmega32*|mmcu=atmega406|mmcu=atmega64*|mmcu=atmega128*|mmcu=at90can*|mmcu=at90usb*|mmcu=at94k:-m avr5}\
91+
+%{mmcu=atmega324*|mmcu=atmega325|mmcu=atmega3250|mmcu=atmega329|mmcu=atmega3290|mmcu=atmega406|mmcu=atmega48|mmcu=atmega88|mmcu=atmega64|mmcu=atmega644*|mmcu=atmega645|mmcu=atmega6450|mmcu=atmega649|mmcu=atmega6490|mmcu=atmega128|mmcu=at90can*|mmcu=atmega162|mmcu=atmega164*|mmcu=atmega165*|mmcu=atmega168|mmcu=atmega169*|mmcu=at90pwm*|mmcu=at90usb*: -Tdata 0x800100}\
92+
+%{mmcu=atmega640|mmcu=atmega1280|mmcu=atmega1281: -Tdata 0x800200} "
93+
94+
/* A C string constant that tells the GCC driver program options to
95+
pass to the linker. It can also specify how to translate options
96+
@@ -2365,7 +2366,7 @@
97+
Do not define this macro if it does not need to do anything. */
98+
99+
#define LIB_SPEC \
100+
- "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lc }}}"
101+
+ "%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lc }}}}}"
102+
/* Another C string constant used much like `LINK_SPEC'. The
103+
difference between the two is that `LIB_SPEC' is used at the end
104+
of the command given to the linker.
105+
@@ -2377,7 +2378,7 @@
106+
/* No libstdc++ for now. Empty string doesn't work. */
107+
108+
#define LIBGCC_SPEC \
109+
- "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lgcc }}}"
110+
+ "%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lgcc }}}}}"
111+
/* Another C string constant that tells the GCC driver program how
112+
and when to place a reference to `libgcc.a' into the linker
113+
command line. This constant is placed both before and after the
114+
@@ -2421,23 +2422,65 @@
115+
%{mmcu=at90c8534:crtc8534.o%s} \
116+
%{mmcu=at90s8535:crts8535.o%s} \
117+
%{mmcu=at86rf401:crt86401.o%s} \
118+
+%{mmcu=attiny13:crttn13.o%s} \
119+
+%{mmcu=attiny2313:crttn2313.o%s} \
120+
+%{mmcu=attiny24:crttn24.o%s} \
121+
+%{mmcu=attiny44:crttn44.o%s} \
122+
+%{mmcu=attiny84:crttn84.o%s} \
123+
+%{mmcu=attiny25:crttn25.o%s} \
124+
+%{mmcu=attiny45:crttn45.o%s} \
125+
+%{mmcu=attiny85:crttn85.o%s} \
126+
+%{mmcu=attiny261:crttn261.o%s} \
127+
+%{mmcu=attiny461:crttn461.o%s} \
128+
+%{mmcu=attiny861:crttn861.o%s} \
129+
%{mmcu=atmega103|mmcu=avr3:crtm103.o%s} \
130+
%{mmcu=atmega603:crtm603.o%s} \
131+
%{mmcu=at43usb320:crt43320.o%s} \
132+
%{mmcu=at43usb355:crt43355.o%s} \
133+
%{mmcu=at76c711:crt76711.o%s} \
134+
%{mmcu=atmega8|mmcu=avr4:crtm8.o%s} \
135+
+%{mmcu=atmega48:crtm48.o%s} \
136+
+%{mmcu=atmega88:crtm88.o%s} \
137+
%{mmcu=atmega8515:crtm8515.o%s} \
138+
%{mmcu=atmega8535:crtm8535.o%s} \
139+
+%{mmcu=at90pwm2:crt90pwm2.o%s} \
140+
+%{mmcu=at90pwm3:crt90pwm3.o%s} \
141+
%{mmcu=atmega16:crtm16.o%s} \
142+
%{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \
143+
%{mmcu=atmega162:crtm162.o%s} \
144+
%{mmcu=atmega163:crtm163.o%s} \
145+
+%{mmcu=atmega164p:crtm164p.o%s} \
146+
+%{mmcu=atmega165:crtm165.o%s} \
147+
+%{mmcu=atmega165p:crtm165p.o%s} \
148+
+%{mmcu=atmega168:crtm168.o%s} \
149+
%{mmcu=atmega169:crtm169.o%s} \
150+
+%{mmcu=atmega169p:crtm169p.o%s} \
151+
%{mmcu=atmega32:crtm32.o%s} \
152+
%{mmcu=atmega323:crtm323.o%s} \
153+
+%{mmcu=atmega324p:crtm324p.o%s} \
154+
+%{mmcu=atmega325:crtm325.o%s} \
155+
+%{mmcu=atmega3250:crtm3250.o%s} \
156+
+%{mmcu=atmega329:crtm329.o%s} \
157+
+%{mmcu=atmega3290:crtm3290.o%s} \
158+
+%{mmcu=atmega406:crtm406.o%s} \
159+
%{mmcu=atmega64:crtm64.o%s} \
160+
+%{mmcu=atmega640:crtm640.o%s} \
161+
+%{mmcu=atmega644:crtm644.o%s} \
162+
+%{mmcu=atmega644p:crtm644p.o%s} \
163+
+%{mmcu=atmega645:crtm645.o%s} \
164+
+%{mmcu=atmega6450:crtm6450.o%s} \
165+
+%{mmcu=atmega649:crtm649.o%s} \
166+
+%{mmcu=atmega6490:crtm6490.o%s} \
167+
%{mmcu=atmega128:crtm128.o%s} \
168+
+%{mmcu=atmega1280:crtm1280.o%s} \
169+
+%{mmcu=atmega1281:crtm1281.o%s} \
170+
+%{mmcu=at90can32:crtcan32.o%s} \
171+
+%{mmcu=at90can64:crtcan64.o%s} \
172+
+%{mmcu=at90can128:crtcan128.o%s} \
173+
+%{mmcu=at90usb646:crtusb646.o%s} \
174+
+%{mmcu=at90usb647:crtusb647.o%s} \
175+
+%{mmcu=at90usb1286:crtusb1286.o%s} \
176+
+%{mmcu=at90usb1287:crtusb1287.o%s} \
177+
%{mmcu=at94k:crtat94k.o%s}"
178+
179+
#define EXTRA_SPECS {"crt_binutils", CRT_BINUTILS_SPECS},
180+
diff -ur ../gcc-3.4.6.orig/gcc/config/avr/t-avr ./gcc/config/avr/t-avr
181+
--- ../gcc-3.4.6.orig/gcc/config/avr/t-avr Mon Apr 25 06:17:34 2005
182+
+++ ./gcc/config/avr/t-avr Sun Mar 19 23:08:56 2006
183+
@@ -46,12 +46,31 @@
184+
mmcu?avr3=mmcu?at43usb320 mmcu?avr3=mmcu?at43usb355 \
185+
mmcu?avr3=mmcu?at76c711 \
186+
mmcu?avr4=mmcu?atmega8515 mmcu?avr4=mmcu?atmega8535 \
187+
- mmcu?avr4=mmcu?atmega8 \
188+
+ mmcu?avr4=mmcu?atmega8 mmcu?avr4=mmcu?atmega48 \
189+
+ mmcu?avr4=mmcu?atmega88 \
190+
+ mmcu?avr4=mmcu?at90pwm2 mmcu?avr4=mmcu?at90pwm3 \
191+
mmcu?avr5=mmcu?atmega161 mmcu?avr5=mmcu?atmega162 \
192+
- mmcu?avr5=mmcu?atmega163 mmcu?avr5=mmcu?atmega169 \
193+
+ mmcu?avr5=mmcu?atmega163 mmcu?avr5=mmcu?atmega164p \
194+
+ mmcu?avr5=mmcu?atmega165 mmcu?avr5=mmcu?atmega165p \
195+
+ mmcu?avr5=mmcu?atmega168 mmcu?avr5=mmcu?atmega169 \
196+
+ mmcu?avr5=mmcu?atmega169p \
197+
mmcu?avr5=mmcu?atmega16 \
198+
- mmcu?avr5=mmcu?atmega323 mmcu?avr5=mmcu?atmega32 \
199+
- mmcu?avr5=mmcu?atmega64 mmcu?avr5=mmcu?atmega128 \
200+
+ mmcu?avr5=mmcu?atmega323 mmcu?avr5=mmcu?atmega324p \
201+
+ mmcu?avr5=mmcu?atmega325 mmcu?avr5=mmcu?atmega3250 \
202+
+ mmcu?avr5=mmcu?atmega329 mmcu?avr5=mmcu?atmega3290 \
203+
+ mmcu?avr5=mmcu?atmega32 \
204+
+ mmcu?avr5=mmcu?atmega406 \
205+
+ mmcu?avr5=mmcu?atmega640 mmcu?avr5=mmcu?atmega644 \
206+
+ mmcu?avr5=mmcu?atmega644p mmcu?avr5=mmcu?atmega645 \
207+
+ mmcu?avr5=mmcu?atmega6450 mmcu?avr5=mmcu?atmega649 \
208+
+ mmcu?avr5=mmcu?atmega6490 mmcu?avr5=mmcu?atmega64 \
209+
+ mmcu?avr5=mmcu?atmega128 \
210+
+ mmcu?avr5=mmcu?atmega1280 mmcu?avr5=mmcu?atmega1281 \
211+
+ mmcu?avr5=mmcu?at90can32 \
212+
+ mmcu?avr5=mmcu?at90can64 \
213+
+ mmcu?avr5=mmcu?at90can128 \
214+
+ mmcu?avr5=mmcu?at90usb646 mmcu?avr5=mmcu?at90usb647 \
215+
+ mmcu?avr5=mmcu?at90usb1286 mmcu?avr5=mmcu?at90usb1287 \
216+
mmcu?avr5=mmcu?at94k
217+
218+
MULTILIB_EXCEPTIONS =
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
diff -ruwN darwin.c.orig darwin.c
2+
--- darwin.c.orig 2006-03-04 03:52:46.000000000 +0100
3+
+++ darwin.c 2012-02-15 12:25:18.000000000 +0100
4+
@@ -247,7 +247,8 @@
5+
io_cf_plugin_ref_t *plugInInterface = NULL;
6+
usb_device_t **device;
7+
io_service_t usbDevice;
8+
- long result, score;
9+
+ long result;
10+
+ SInt32 score;
11+
12+
if (!IOIteratorIsValid (deviceIterator) || !(usbDevice = IOIteratorNext(deviceIterator)))
13+
return NULL;
14+
@@ -447,7 +448,7 @@
15+
IOUSBFindInterfaceRequest request;
16+
17+
struct darwin_dev_handle *device;
18+
- long score;
19+
+ SInt32 score;
20+
int current_interface;
21+
22+
device = dev->impl_info;
23+
@@ -769,9 +770,9 @@
24+
25+
if (usb_debug > 2)
26+
fprintf(stderr, "io async operation completed: %s, size=%lu, result=0x%08x\n", darwin_error_str(result),
27+
- (UInt32)io_size, result);
28+
+ (unsigned long)io_size, (int)result);
29+
30+
- rw_arg->io_size = (UInt32)io_size;
31+
+ rw_arg->io_size = (long)io_size;
32+
rw_arg->result = result;
33+
34+
CFRunLoopStop(rw_arg->cf_loop);
35+
@@ -1064,7 +1065,7 @@
36+
result = (*(device))->GetDeviceAddress(device, (USBDeviceAddress *)&address);
37+
38+
if (usb_debug >= 2)
39+
- fprintf(stderr, "usb_os_find_devices: Found USB device at location 0x%08lx\n", location);
40+
+ fprintf(stderr, "usb_os_find_devices: Found USB device at location 0x%08lx\n", (long)location);
41+
42+
/* first byte of location appears to be associated with the device's bus */
43+
if (location >> 24 == bus_loc >> 24) {
44+
@@ -1092,7 +1093,7 @@
45+
46+
if (usb_debug >= 2)
47+
fprintf(stderr, "usb_os_find_devices: Found %s on %s at location 0x%08lx\n",
48+
- dev->filename, bus->dirname, location);
49+
+ dev->filename, bus->dirname, (long)location);
50+
}
51+
52+
/* release the device now */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 42;
7+
objects = {
8+
9+
/* Begin PBXFileReference section */
10+
4079525E0CEA38CC00E202DC /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
11+
4079525F0CEA38CC00E202DC /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
12+
/* End PBXFileReference section */
13+
14+
/* Begin PBXGroup section */
15+
4079523B0CEA382200E202DC = {
16+
isa = PBXGroup;
17+
children = (
18+
4079525D0CEA38CC00E202DC /* firmware */,
19+
);
20+
sourceTree = "<group>";
21+
};
22+
4079525D0CEA38CC00E202DC /* firmware */ = {
23+
isa = PBXGroup;
24+
children = (
25+
4079525F0CEA38CC00E202DC /* Makefile */,
26+
4079525E0CEA38CC00E202DC /* main.c */,
27+
);
28+
path = firmware;
29+
sourceTree = "<group>";
30+
};
31+
/* End PBXGroup section */
32+
33+
/* Begin PBXLegacyTarget section */
34+
407952600CEA391500E202DC /* firmware */ = {
35+
isa = PBXLegacyTarget;
36+
buildArgumentsString = $ACTION;
37+
buildConfigurationList = 407952610CEA393300E202DC /* Build configuration list for PBXLegacyTarget "firmware" */;
38+
buildPhases = (
39+
);
40+
buildToolPath = /usr/bin/make;
41+
buildWorkingDirectory = firmware;
42+
dependencies = (
43+
);
44+
name = firmware;
45+
passBuildSettingsInEnvironment = 1;
46+
productName = "Build All";
47+
};
48+
/* End PBXLegacyTarget section */
49+
50+
/* Begin PBXProject section */
51+
4079523D0CEA382200E202DC /* Project object */ = {
52+
isa = PBXProject;
53+
buildConfigurationList = 4079523E0CEA382200E202DC /* Build configuration list for PBXProject "TemplateProject" */;
54+
compatibilityVersion = "Xcode 2.4";
55+
hasScannedForEncodings = 0;
56+
mainGroup = 4079523B0CEA382200E202DC;
57+
projectDirPath = "";
58+
projectRoot = "";
59+
targets = (
60+
407952600CEA391500E202DC /* firmware */,
61+
);
62+
};
63+
/* End PBXProject section */
64+
65+
/* Begin XCBuildConfiguration section */
66+
407952400CEA382200E202DC /* Release */ = {
67+
isa = XCBuildConfiguration;
68+
buildSettings = {
69+
COPY_PHASE_STRIP = YES;
70+
};
71+
name = Release;
72+
};
73+
407952630CEA393300E202DC /* Release */ = {
74+
isa = XCBuildConfiguration;
75+
buildSettings = {
76+
PATH = "$(PATH):/usr/local/CrossPack-AVR/bin";
77+
};
78+
name = Release;
79+
};
80+
/* End XCBuildConfiguration section */
81+
82+
/* Begin XCConfigurationList section */
83+
4079523E0CEA382200E202DC /* Build configuration list for PBXProject "TemplateProject" */ = {
84+
isa = XCConfigurationList;
85+
buildConfigurations = (
86+
407952400CEA382200E202DC /* Release */,
87+
);
88+
defaultConfigurationIsVisible = 0;
89+
defaultConfigurationName = Release;
90+
};
91+
407952610CEA393300E202DC /* Build configuration list for PBXLegacyTarget "firmware" */ = {
92+
isa = XCConfigurationList;
93+
buildConfigurations = (
94+
407952630CEA393300E202DC /* Release */,
95+
);
96+
defaultConfigurationIsVisible = 0;
97+
defaultConfigurationName = Release;
98+
};
99+
/* End XCConfigurationList section */
100+
};
101+
rootObject = 4079523D0CEA382200E202DC /* Project object */;
102+
}
+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Name: Makefile
2+
# Author: <insert your name here>
3+
# Copyright: <insert your copyright message here>
4+
# License: <insert your license reference here>
5+
6+
# This is a prototype Makefile. Modify it according to your needs.
7+
# You should at least check the settings for
8+
# DEVICE ....... The AVR device you compile for
9+
# CLOCK ........ Target AVR clock rate in Hertz
10+
# OBJECTS ...... The object files created from your source files. This list is
11+
# usually the same as the list of source files with suffix ".o".
12+
# PROGRAMMER ... Options to avrdude which define the hardware you use for
13+
# uploading to the AVR and the interface where this hardware
14+
# is connected. We recommend that you leave it undefined and
15+
# add settings like this to your ~/.avrduderc file:
16+
# default_programmer = "stk500v2"
17+
# default_serial = "avrdoper"
18+
# FUSES ........ Parameters for avrdude to flash the fuses appropriately.
19+
20+
DEVICE = atmega8
21+
CLOCK = 8000000
22+
PROGRAMMER = #-c stk500v2 -P avrdoper
23+
OBJECTS = main.o
24+
FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x24:m
25+
26+
# ATMega8 fuse bits used above (fuse bits for other devices are different!):
27+
# Example for 8 MHz internal oscillator
28+
# Fuse high byte:
29+
# 0xd9 = 1 1 0 1 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
30+
# ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0
31+
# | | | | | +-------- BOOTSZ1
32+
# | | | | +---------- EESAVE (set to 0 to preserve EEPROM over chip erase)
33+
# | | | +-------------- CKOPT (clock option, depends on oscillator type)
34+
# | | +---------------- SPIEN (if set to 1, serial programming is disabled)
35+
# | +------------------ WDTON (if set to 0, watchdog is always on)
36+
# +-------------------- RSTDISBL (if set to 0, RESET pin is disabled)
37+
# Fuse low byte:
38+
# 0x24 = 0 0 1 0 0 1 0 0
39+
# ^ ^ \ / \--+--/
40+
# | | | +------- CKSEL 3..0 (8M internal RC)
41+
# | | +--------------- SUT 1..0 (slowly rising power)
42+
# | +------------------ BODEN (if 0, brown-out detector is enabled)
43+
# +-------------------- BODLEVEL (if 0: 4V, if 1: 2.7V)
44+
#
45+
# For computing fuse byte values for other devices and options see
46+
# the fuse bit calculator at http://www.engbedded.com/fusecalc/
47+
48+
49+
# Tune the lines below only if you know what you are doing:
50+
51+
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE)
52+
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE)
53+
54+
# symbolic targets:
55+
all: main.hex
56+
57+
.c.o:
58+
$(COMPILE) -c $< -o $@
59+
60+
.S.o:
61+
$(COMPILE) -x assembler-with-cpp -c $< -o $@
62+
# "-x assembler-with-cpp" should not be necessary since this is the default
63+
# file type for the .S (with capital S) extension. However, upper case
64+
# characters are not always preserved on Windows. To ensure WinAVR
65+
# compatibility define the file type manually.
66+
67+
.c.s:
68+
$(COMPILE) -S $< -o $@
69+
70+
flash: all
71+
$(AVRDUDE) -U flash:w:main.hex:i
72+
73+
fuse:
74+
$(AVRDUDE) $(FUSES)
75+
76+
# Xcode uses the Makefile targets "", "clean" and "install"
77+
install: flash fuse
78+
79+
# if you use a bootloader, change the command below appropriately:
80+
load: all
81+
bootloadHID main.hex
82+
83+
clean:
84+
rm -f main.hex main.elf $(OBJECTS)
85+
86+
# file targets:
87+
main.elf: $(OBJECTS)
88+
$(COMPILE) -o main.elf $(OBJECTS)
89+
90+
main.hex: main.elf
91+
rm -f main.hex
92+
avr-objcopy -j .text -j .data -O ihex main.elf main.hex
93+
avr-size --format=avr --mcu=$(DEVICE) main.elf
94+
# If you have an EEPROM section, you must also create a hex file for the
95+
# EEPROM and add it to the "flash" target.
96+
97+
# Targets for code debugging and analysis:
98+
disasm: main.elf
99+
avr-objdump -d main.elf
100+
101+
cpp:
102+
$(COMPILE) -E main.c
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* Name: main.c
2+
* Author: <insert your name here>
3+
* Copyright: <insert your copyright message here>
4+
* License: <insert your license reference here>
5+
*/
6+
7+
#include <avr/io.h>
8+
9+
int main(void)
10+
{
11+
/* insert your hardware initialization here */
12+
for(;;){
13+
/* insert your main loop code here */
14+
}
15+
return 0; /* never reached */
16+
}

0 commit comments

Comments
 (0)
Please sign in to comment.