Selaa lähdekoodia

Merge branch 'Marlin_v1' of github.com:ErikZalm/Marlin into Marlin_v1

daid303 12 vuotta sitten
vanhempi
commit
ae1bc83350
2 muutettua tiedostoa jossa 27 lisäystä ja 161 poistoa
  1. 27
    20
      Marlin/Makefile
  2. 0
    141
      Marlin/wiring.h

+ 27
- 20
Marlin/Makefile Näytä tiedosto

@@ -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+
@@ -180,6 +180,7 @@ HARDWARE_SRC = ../ArduinoAddons/Arduino_0.xx/$(HARDWARE_VARIANT)/cores/arduino
180 180
 endif
181 181
 endif
182 182
 
183
+
183 184
 TARGET = $(notdir $(CURDIR))
184 185
 
185 186
 # VPATH tells make to look into these directory for source files,
@@ -227,9 +228,27 @@ OPT = s
227 228
 
228 229
 DEFINES ?=
229 230
 
231
+# Program settings
232
+CC = $(AVR_TOOLS_PATH)avr-gcc
233
+CXX = $(AVR_TOOLS_PATH)avr-g++
234
+OBJCOPY = $(AVR_TOOLS_PATH)avr-objcopy
235
+OBJDUMP = $(AVR_TOOLS_PATH)avr-objdump
236
+AR  = $(AVR_TOOLS_PATH)avr-ar
237
+SIZE = $(AVR_TOOLS_PATH)avr-size
238
+NM = $(AVR_TOOLS_PATH)avr-nm
239
+AVRDUDE = avrdude
240
+REMOVE = rm -f
241
+MV = mv -f
242
+
230 243
 # Place -D or -U options here
231
-CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
232
-CXXDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
244
+CDEFS    = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
245
+CXXDEFS  = $(CDEFS)
246
+
247
+ifeq ($(HARDWARE_VARIANT), Teensy)
248
+CDEFS  += -DUSB_SERIAL
249
+SRC    += usb.c pins_teensy.c
250
+CXXSRC += usb_api.cpp
251
+endif
233 252
 
234 253
 # Add all the source directories as include directories too
235 254
 CINCS = ${addprefix -I ,${VPATH}}
@@ -251,9 +270,9 @@ CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
251 270
 endif
252 271
 #CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
253 272
 
254
-CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING)
255
-CXXFLAGS =         $(CDEFS) $(CINCS) -O$(OPT) -Wall    $(CEXTRA) $(CTUNING)
256
-#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs 
273
+CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING)
274
+CXXFLAGS :=         $(CDEFS) $(CINCS) -O$(OPT) -Wall    $(CEXTRA) $(CTUNING)
275
+#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
257 276
 LDFLAGS = -lm
258 277
 
259 278
 
@@ -264,18 +283,6 @@ AVRDUDE_FLAGS = -D -C $(ARDUINO_INSTALL_DIR)/hardware/tools/avrdude.conf \
264 283
 	-p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
265 284
 	-b $(UPLOAD_RATE)
266 285
 
267
-# Program settings
268
-CC = $(AVR_TOOLS_PATH)avr-gcc
269
-CXX = $(AVR_TOOLS_PATH)avr-g++
270
-OBJCOPY = $(AVR_TOOLS_PATH)avr-objcopy
271
-OBJDUMP = $(AVR_TOOLS_PATH)avr-objdump
272
-AR  = $(AVR_TOOLS_PATH)avr-ar
273
-SIZE = $(AVR_TOOLS_PATH)avr-size
274
-NM = $(AVR_TOOLS_PATH)avr-nm
275
-AVRDUDE = avrdude
276
-REMOVE = rm -f
277
-MV = mv -f
278
-
279 286
 # Define all object files.
280 287
 OBJ = ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}}
281 288
 OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}}

+ 0
- 141
Marlin/wiring.h Näytä tiedosto

@@ -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

Loading…
Peruuta
Tallenna