浏览代码

Updates to Makefile to compile for Teensy.

Daid 12 年前
父节点
当前提交
23022f1a82
共有 2 个文件被更改,包括 14 次插入147 次删除
  1. 14
    6
      Marlin/Makefile
  2. 0
    141
      Marlin/wiring.h

+ 14
- 6
Marlin/Makefile 查看文件

@@ -125,13 +125,13 @@ MCU              ?= atmega1280
125 125
 
126 126
 #Teensylu
127 127
 else ifeq  ($(HARDWARE_MOTHERBOARD),8)
128
-HARDWARE_VARIANT ?= Teensyduino
128
+HARDWARE_VARIANT ?= Teensy
129 129
 MCU              ?= at90usb1286
130 130
 else ifeq  ($(HARDWARE_MOTHERBOARD),81)
131
-HARDWARE_VARIANT ?= Teensyduino
131
+HARDWARE_VARIANT ?= Teensy
132 132
 MCU              ?= at90usb1286
133 133
 else ifeq  ($(HARDWARE_MOTHERBOARD),82)
134
-HARDWARE_VARIANT ?= Teensyduino
134
+HARDWARE_VARIANT ?= Teensy
135 135
 MCU              ?= at90usb646
136 136
 
137 137
 #Gen3+
@@ -149,7 +149,8 @@ else ifeq  ($(HARDWARE_MOTHERBOARD),90)
149 149
 HARDWARE_VARIANT ?= SanguinoA
150 150
 MCU              ?= atmega644
151 151
 
152
-#Final OMCA board
152
+#
153
+Final OMCA board
153 154
 else ifeq  ($(HARDWARE_MOTHERBOARD),91)
154 155
 HARDWARE_VARIANT ?= Sanguino
155 156
 MCU              ?= atmega644p
@@ -180,6 +181,7 @@ HARDWARE_SRC = ../ArduinoAddons/Arduino_0.xx/$(HARDWARE_VARIANT)/cores/arduino
180 181
 endif
181 182
 endif
182 183
 
184
+
183 185
 TARGET = $(notdir $(CURDIR))
184 186
 
185 187
 # VPATH tells make to look into these directory for source files,
@@ -228,8 +230,14 @@ OPT = s
228 230
 DEFINES ?=
229 231
 
230 232
 # Place -D or -U options here
231
-CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
232
-CXXDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
233
+CDEFS    = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
234
+CXXDEFS  = $(CDEFS)
235
+
236
+ifeq ($(HARDWARE_VARIANT), Teensy)
237
+CDEFS  += -DUSB_SERIAL
238
+SRC    += usb.c pins_teensy.c
239
+CXXSRC += usb_api.cpp
240
+endif
233 241
 
234 242
 # Add all the source directories as include directories too
235 243
 CINCS = ${addprefix -I ,${VPATH}}

+ 0
- 141
Marlin/wiring.h 查看文件

@@ -1,141 +0,0 @@
1
-/*
2
- * fixed by this patch:
3
- * http://code.google.com/p/arduino/issues/detail?id=604
4
- * */
5
-/*
6
-  wiring.h - Partial implementation of the Wiring API for the ATmega8.
7
-  Part of Arduino - http://www.arduino.cc/
8
-
9
-  Copyright (c) 2005-2006 David A. Mellis
10
-
11
-  This library is free software; you can redistribute it and/or
12
-  modify it under the terms of the GNU Lesser General Public
13
-  License as published by the Free Software Foundation; either
14
-  version 2.1 of the License, or (at your option) any later version.
15
-
16
-  This library is distributed in the hope that it will be useful,
17
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
18
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19
-  Lesser General Public License for more details.
20
-
21
-  You should have received a copy of the GNU Lesser General
22
-  Public License along with this library; if not, write to the
23
-  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
24
-  Boston, MA  02111-1307  USA
25
-
26
-  $Id$
27
-*/
28
-
29
-#ifndef Wiring_h
30
-#define Wiring_h
31
-
32
-#include <avr/io.h>
33
-#include <stdlib.h>
34
-#include "binary.h"
35
-
36
-#ifdef __cplusplus
37
-extern "C"{
38
-#endif
39
-
40
-#define HIGH 0x1
41
-#define LOW  0x0
42
-
43
-#define INPUT 0x0
44
-#define OUTPUT 0x1
45
-
46
-#define true 0x1
47
-#define false 0x0
48
-
49
-#define PI 3.1415926535897932384626433832795
50
-#define HALF_PI 1.5707963267948966192313216916398
51
-#define TWO_PI 6.283185307179586476925286766559
52
-#define DEG_TO_RAD 0.017453292519943295769236907684886
53
-#define RAD_TO_DEG 57.295779513082320876798154814105
54
-
55
-#define SERIAL  0x0
56
-#define DISPLAY 0x1
57
-
58
-#define LSBFIRST 0
59
-#define MSBFIRST 1
60
-
61
-#define CHANGE 1
62
-#define FALLING 2
63
-#define RISING 3
64
-
65
-#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
66
-#define INTERNAL1V1 2
67
-#define INTERNAL2V56 3
68
-#else
69
-#define INTERNAL 3
70
-#endif
71
-#define DEFAULT 1
72
-#define EXTERNAL 0
73
-
74
-// undefine stdlib's abs if encountered
75
-#ifdef abs
76
-#undef abs
77
-#endif
78
-
79
-#define min(a,b) ((a)<(b)?(a):(b))
80
-#define max(a,b) ((a)>(b)?(a):(b))
81
-#define abs(x) ((x)>0?(x):-(x))
82
-#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
83
-#if __AVR_LIBC_VERSION__ < 10701UL
84
-#define round(x)     ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
85
-#endif
86
-#define radians(deg) ((deg)*DEG_TO_RAD)
87
-#define degrees(rad) ((rad)*RAD_TO_DEG)
88
-#define sq(x) ((x)*(x))
89
-
90
-#define interrupts() sei()
91
-#define noInterrupts() cli()
92
-
93
-#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
94
-#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (F_CPU / 1000L) )
95
-#define microsecondsToClockCycles(a) ( ((a) * (F_CPU / 1000L)) / 1000L )
96
-
97
-#define lowByte(w) ((uint8_t) ((w) & 0xff))
98
-#define highByte(w) ((uint8_t) ((w) >> 8))
99
-
100
-#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
101
-#define bitSet(value, bit) ((value) |= (1UL << (bit)))
102
-#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
103
-#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
104
-
105
-
106
-typedef unsigned int word;
107
-
108
-#define bit(b) (1UL << (b))
109
-
110
-typedef uint8_t boolean;
111
-typedef uint8_t byte;
112
-
113
-void init(void);
114
-
115
-void pinMode(uint8_t, uint8_t);
116
-void digitalWrite(uint8_t, uint8_t);
117
-int digitalRead(uint8_t);
118
-int analogRead(uint8_t);
119
-void analogReference(uint8_t mode);
120
-void analogWrite(uint8_t, int);
121
-
122
-unsigned long millis(void);
123
-unsigned long micros(void);
124
-void delay(unsigned long);
125
-void delayMicroseconds(unsigned int us);
126
-unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
127
-
128
-void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
129
-uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
130
-
131
-void attachInterrupt(uint8_t, void (*)(void), int mode);
132
-void detachInterrupt(uint8_t);
133
-
134
-void setup(void);
135
-void loop(void);
136
-
137
-#ifdef __cplusplus
138
-} // extern "C"
139
-#endif
140
-
141
-#endif

正在加载...
取消
保存