瀏覽代碼

Unify AVR90USB: fastio changes

Scott Lahteine 7 年之前
父節點
當前提交
b378deaf89
共有 7 個檔案被更改,包括 48 行新增717 行删除
  1. 1
    1
      Marlin/boards.h
  2. 12
    19
      Marlin/fastio.h
  3. 0
    681
      Marlin/fastio_AT90USB-Marlin.h
  4. 18
    2
      Marlin/fastio_AT90USB.h
  5. 16
    13
      Marlin/pins.h
  6. 0
    0
      Marlin/ultralcd.cpp
  7. 1
    1
      platformio.ini

+ 1
- 1
Marlin/boards.h 查看文件

@@ -71,7 +71,7 @@
71 71
 #define BOARD_PRINTRBOARD_REVF  811  // Printrboard Revision F (AT90USB1286)
72 72
 #define BOARD_BRAINWAVE         82   // Brainwave (AT90USB646)
73 73
 #define BOARD_SAV_MKI           83   // SAV Mk-I (AT90USB1286)
74
-#define BOARD_TEENSY2           84   // Teensy++2.0 (AT90USB1286) - CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84  make
74
+#define BOARD_TEENSY2           84   // Teensy++2.0 (AT90USB1286) - CLI compile: HARDWARE_MOTHERBOARD=84  make
75 75
 #define BOARD_BRAINWAVE_PRO     85   // Brainwave Pro (AT90USB1286)
76 76
 #define BOARD_GEN3_PLUS         9    // Gen3+
77 77
 #define BOARD_GEN3_MONOLITHIC   22   // Gen3 Monolithic Electronics

+ 12
- 19
Marlin/fastio.h 查看文件

@@ -32,27 +32,25 @@
32 32
 #include <avr/io.h>
33 33
 #include "macros.h"
34 34
 
35
-/**
36
- * Enable this option to use Teensy++ 2.0 assignments for AT90USB processors.
37
- */
38
-//#define AT90USBxx_TEENSYPP_ASSIGNMENTS
35
+#define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__)  || defined(__AVR_AT90USB647__))
36
+#define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__))
37
+#define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__))
38
+#define AVR_ATmega2561_FAMILY (defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__))
39
+#define AVR_ATmega328_FAMILY (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328p__))
40
+
39 41
 
40 42
 /**
41 43
  * Include Ports and Functions
42 44
  */
43
-#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
45
+#if AVR_ATmega328_FAMILY
44 46
   #include "fastio_168.h"
45
-#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)
47
+#elif AVR_ATmega1284_FAMILY
46 48
   #include "fastio_644.h"
47
-#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
49
+#elif AVR_ATmega2560_FAMILY
48 50
   #include "fastio_1280.h"
49
-#elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
50
-  #ifdef AT90USBxx_TEENSYPP_ASSIGNMENTS
51
-    #include "fastio_AT90USB-Teensy.h"
52
-  #else
53
-    #include "fastio_AT90USB-Marlin.h"
54
-  #endif
55
-#elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
51
+#elif AVR_AT90USB1286_FAMILY
52
+  #include "fastio_AT90USB.h"
53
+#elif AVR_ATmega2561_FAMILY
56 54
   #include "fastio_1281.h"
57 55
 #else
58 56
   #error "Pins for this chip not defined in Arduino.h! If you have a working pins definition, please contribute!"
@@ -243,11 +241,6 @@ typedef enum {
243 241
 /**
244 242
  * PWM availability macros
245 243
  */
246
-#define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__)  || defined(__AVR_AT90USB647__))
247
-#define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__))
248
-#define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__))
249
-#define AVR_ATmega2561_FAMILY (defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__))
250
-#define AVR_ATmega328_FAMILY (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328p__))
251 244
 
252 245
 //find out which harware PWMs are already in use
253 246
 #if PIN_EXISTS(CONTROLLER_FAN)

+ 0
- 681
Marlin/fastio_AT90USB-Marlin.h 查看文件

@@ -1,681 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
- *
5
- * Based on Sprinter and grbl.
6
- * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-
23
-/**
24
- * Pin mapping (Marlin) for AT90USB646, 647, 1286, and 1287
25
- *
26
- *   AT90USB  51 50 49 48 47 46 45 44 10 11 12 13 14 15 16 17 35 36 37 38 39 40 41 42 25 26 27 28 29 30 31 32 33 34 43 09 18 19 01 02 61 60 59 58 57 56 55 54
27
- *   Teensy   28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45
28
- *   Port     A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7
29
- * > Marlin   00 01 02 03 04 05 06 07 08 09 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
30
- *            The pins 46 and 47 are not supported by Teensyduino, but are supported below.
31
- */
32
-
33
-#ifndef _FASTIO_AT90USB
34
-#define _FASTIO_AT90USB
35
-
36
-#include "fastio.h"
37
-
38
-// change for your board
39
-#define DEBUG_LED   DIO31 /* led D5 red */
40
-
41
-// SPI
42
-#define SCK         DIO9   // 21
43
-#define MISO        DIO11  // 23
44
-#define MOSI        DIO10  // 22
45
-#define SS          DIO8   // 20
46
-
47
-// Digital I/O
48
-
49
-#define DIO0_PIN    PINA0
50
-#define DIO0_RPORT  PINA
51
-#define DIO0_WPORT  PORTA
52
-#define DIO0_PWM    NULL
53
-#define DIO0_DDR    DDRA
54
-
55
-#define DIO1_PIN    PINA1
56
-#define DIO1_RPORT  PINA
57
-#define DIO1_WPORT  PORTA
58
-#define DIO1_PWM    NULL
59
-#define DIO1_DDR    DDRA
60
-
61
-#define DIO2_PIN    PINA2
62
-#define DIO2_RPORT  PINA
63
-#define DIO2_WPORT  PORTA
64
-#define DIO2_PWM    NULL
65
-#define DIO2_DDR    DDRA
66
-
67
-#define DIO3_PIN    PINA3
68
-#define DIO3_RPORT  PINA
69
-#define DIO3_WPORT  PORTA
70
-#define DIO3_PWM    NULL
71
-#define DIO3_DDR    DDRA
72
-
73
-#define DIO4_PIN    PINA4
74
-#define DIO4_RPORT  PINA
75
-#define DIO4_WPORT  PORTA
76
-#define DIO4_PWM    NULL
77
-#define DIO4_DDR    DDRA
78
-
79
-#define DIO5_PIN    PINA5
80
-#define DIO5_RPORT  PINA
81
-#define DIO5_WPORT  PORTA
82
-#define DIO5_PWM    NULL
83
-#define DIO5_DDR    DDRA
84
-
85
-#define DIO6_PIN    PINA6
86
-#define DIO6_RPORT  PINA
87
-#define DIO6_WPORT  PORTA
88
-#define DIO6_PWM    NULL
89
-#define DIO6_DDR    DDRA
90
-
91
-#define DIO7_PIN    PINA7
92
-#define DIO7_RPORT  PINA
93
-#define DIO7_WPORT  PORTA
94
-#define DIO7_PWM    NULL
95
-#define DIO7_DDR    DDRA
96
-
97
-#define DIO8_PIN    PINB0
98
-#define DIO8_RPORT  PINB
99
-#define DIO8_WPORT  PORTB
100
-#define DIO8_PWM    NULL
101
-#define DIO8_DDR    DDRB
102
-
103
-#define DIO9_PIN    PINB1
104
-#define DIO9_RPORT  PINB
105
-#define DIO9_WPORT  PORTB
106
-#define DIO9_PWM    NULL
107
-#define DIO9_DDR    DDRB
108
-
109
-#define DIO10_PIN   PINB2
110
-#define DIO10_RPORT PINB
111
-#define DIO10_WPORT PORTB
112
-#define DIO10_PWM   NULL
113
-#define DIO10_DDR   DDRB
114
-
115
-#define DIO11_PIN   PINB3
116
-#define DIO11_RPORT PINB
117
-#define DIO11_WPORT PORTB
118
-#define DIO11_PWM   NULL
119
-#define DIO11_DDR   DDRB
120
-
121
-#define DIO12_PIN   PINB4
122
-#define DIO12_RPORT PINB
123
-#define DIO12_WPORT PORTB
124
-#define DIO12_PWM   NULL
125
-#define DIO12_DDR   DDRB
126
-
127
-#define DIO13_PIN   PINB5
128
-#define DIO13_RPORT PINB
129
-#define DIO13_WPORT PORTB
130
-#define DIO13_PWM   NULL
131
-#define DIO13_DDR   DDRB
132
-
133
-#define DIO14_PIN   PINB6
134
-#define DIO14_RPORT PINB
135
-#define DIO14_WPORT PORTB
136
-#define DIO14_PWM   NULL
137
-#define DIO14_DDR   DDRB
138
-
139
-#define DIO15_PIN   PINB7
140
-#define DIO15_RPORT PINB
141
-#define DIO15_WPORT PORTB
142
-#define DIO15_PWM   NULL
143
-#define DIO15_DDR   DDRB
144
-
145
-#define DIO16_PIN   PINC0
146
-#define DIO16_RPORT PINC
147
-#define DIO16_WPORT PORTC
148
-#define DIO16_PWM   NULL
149
-#define DIO16_DDR   DDRC
150
-
151
-#define DIO17_PIN   PINC1
152
-#define DIO17_RPORT PINC
153
-#define DIO17_WPORT PORTC
154
-#define DIO17_PWM   NULL
155
-#define DIO17_DDR   DDRC
156
-
157
-#define DIO18_PIN   PINC2
158
-#define DIO18_RPORT PINC
159
-#define DIO18_WPORT PORTC
160
-#define DIO18_PWM   NULL
161
-#define DIO18_DDR   DDRC
162
-
163
-#define DIO19_PIN   PINC3
164
-#define DIO19_RPORT PINC
165
-#define DIO19_WPORT PORTC
166
-#define DIO19_PWM   NULL
167
-#define DIO19_DDR   DDRC
168
-
169
-#define DIO20_PIN   PINC4
170
-#define DIO20_RPORT PINC
171
-#define DIO20_WPORT PORTC
172
-#define DIO20_PWM   NULL
173
-#define DIO20_DDR   DDRC
174
-
175
-#define DIO21_PIN   PINC5
176
-#define DIO21_RPORT PINC
177
-#define DIO21_WPORT PORTC
178
-#define DIO21_PWM   NULL
179
-#define DIO21_DDR   DDRC
180
-
181
-#define DIO22_PIN   PINC6
182
-#define DIO22_RPORT PINC
183
-#define DIO22_WPORT PORTC
184
-#define DIO22_PWM   NULL
185
-#define DIO22_DDR   DDRC
186
-
187
-#define DIO23_PIN   PINC7
188
-#define DIO23_RPORT PINC
189
-#define DIO23_WPORT PORTC
190
-#define DIO23_PWM   NULL
191
-#define DIO23_DDR   DDRC
192
-
193
-#define DIO24_PIN   PIND0
194
-#define DIO24_RPORT PIND
195
-#define DIO24_WPORT PORTD
196
-#define DIO24_PWM   NULL
197
-#define DIO24_DDR   DDRD
198
-
199
-#define DIO25_PIN   PIND1
200
-#define DIO25_RPORT PIND
201
-#define DIO25_WPORT PORTD
202
-#define DIO25_PWM   NULL
203
-#define DIO25_DDR   DDRD
204
-
205
-#define DIO26_PIN   PIND2
206
-#define DIO26_RPORT PIND
207
-#define DIO26_WPORT PORTD
208
-#define DIO26_PWM   NULL
209
-#define DIO26_DDR   DDRD
210
-
211
-#define DIO27_PIN   PIND3
212
-#define DIO27_RPORT PIND
213
-#define DIO27_WPORT PORTD
214
-#define DIO27_PWM   NULL
215
-#define DIO27_DDR   DDRD
216
-
217
-#define DIO28_PIN   PIND4
218
-#define DIO28_RPORT PIND
219
-#define DIO28_WPORT PORTD
220
-#define DIO28_PWM   NULL
221
-#define DIO28_DDR   DDRD
222
-
223
-#define DIO29_PIN   PIND5
224
-#define DIO29_RPORT PIND
225
-#define DIO29_WPORT PORTD
226
-#define DIO29_PWM   NULL
227
-#define DIO29_DDR   DDRD
228
-
229
-#define DIO30_PIN   PIND6
230
-#define DIO30_RPORT PIND
231
-#define DIO30_WPORT PORTD
232
-#define DIO30_PWM   NULL
233
-#define DIO30_DDR   DDRD
234
-
235
-#define DIO31_PIN   PIND7
236
-#define DIO31_RPORT PIND
237
-#define DIO31_WPORT PORTD
238
-#define DIO31_PWM   NULL
239
-#define DIO31_DDR   DDRD
240
-
241
-#define DIO32_PIN   PINE0
242
-#define DIO32_RPORT PINE
243
-#define DIO32_WPORT PORTE
244
-#define DIO32_PWM   NULL
245
-#define DIO32_DDR   DDRE
246
-
247
-#define DIO33_PIN   PINE1
248
-#define DIO33_RPORT PINE
249
-#define DIO33_WPORT PORTE
250
-#define DIO33_PWM   NULL
251
-#define DIO33_DDR   DDRE
252
-
253
-#define DIO34_PIN   PINE2
254
-#define DIO34_RPORT PINE
255
-#define DIO34_WPORT PORTE
256
-#define DIO34_PWM   NULL
257
-#define DIO34_DDR   DDRE
258
-
259
-#define DIO35_PIN   PINE3
260
-#define DIO35_RPORT PINE
261
-#define DIO35_WPORT PORTE
262
-#define DIO35_PWM   NULL
263
-#define DIO35_DDR   DDRE
264
-
265
-#define DIO36_PIN   PINE4
266
-#define DIO36_RPORT PINE
267
-#define DIO36_WPORT PORTE
268
-#define DIO36_PWM   NULL
269
-#define DIO36_DDR   DDRE
270
-
271
-#define DIO37_PIN   PINE5
272
-#define DIO37_RPORT PINE
273
-#define DIO37_WPORT PORTE
274
-#define DIO37_PWM   NULL
275
-#define DIO37_DDR   DDRE
276
-
277
-#define DIO38_PIN   PINE6
278
-#define DIO38_RPORT PINE
279
-#define DIO38_WPORT PORTE
280
-#define DIO38_PWM   NULL
281
-#define DIO38_DDR   DDRE
282
-
283
-#define DIO39_PIN   PINE7
284
-#define DIO39_RPORT PINE
285
-#define DIO39_WPORT PORTE
286
-#define DIO39_PWM   NULL
287
-#define DIO39_DDR   DDRE
288
-
289
-#define AIO0_PIN    PINF0
290
-#define AIO0_RPORT  PINF
291
-#define AIO0_WPORT  PORTF
292
-#define AIO0_PWM    NULL
293
-#define AIO0_DDR    DDRF
294
-
295
-#define AIO1_PIN    PINF1
296
-#define AIO1_RPORT  PINF
297
-#define AIO1_WPORT  PORTF
298
-#define AIO1_PWM    NULL
299
-#define AIO1_DDR    DDRF
300
-
301
-#define AIO2_PIN    PINF2
302
-#define AIO2_RPORT  PINF
303
-#define AIO2_WPORT  PORTF
304
-#define AIO2_PWM    NULL
305
-#define AIO2_DDR    DDRF
306
-
307
-#define AIO3_PIN    PINF3
308
-#define AIO3_RPORT  PINF
309
-#define AIO3_WPORT  PORTF
310
-#define AIO3_PWM    NULL
311
-#define AIO3_DDR    DDRF
312
-
313
-#define AIO4_PIN    PINF4
314
-#define AIO4_RPORT  PINF
315
-#define AIO4_WPORT  PORTF
316
-#define AIO4_PWM    NULL
317
-#define AIO4_DDR    DDRF
318
-
319
-#define AIO5_PIN    PINF5
320
-#define AIO5_RPORT  PINF
321
-#define AIO5_WPORT  PORTF
322
-#define AIO5_PWM    NULL
323
-#define AIO5_DDR    DDRF
324
-
325
-#define AIO6_PIN    PINF6
326
-#define AIO6_RPORT  PINF
327
-#define AIO6_WPORT  PORTF
328
-#define AIO6_PWM    NULL
329
-#define AIO6_DDR    DDRF
330
-
331
-#define AIO7_PIN    PINF7
332
-#define AIO7_RPORT  PINF
333
-#define AIO7_WPORT  PORTF
334
-#define AIO7_PWM    NULL
335
-#define AIO7_DDR    DDRF
336
-
337
-#define DIO40_PIN   PINF0
338
-#define DIO40_RPORT PINF
339
-#define DIO40_WPORT PORTF
340
-#define DIO40_PWM   NULL
341
-#define DIO40_DDR   DDRF
342
-
343
-#define DIO41_PIN   PINF1
344
-#define DIO41_RPORT PINF
345
-#define DIO41_WPORT PORTF
346
-#define DIO41_PWM   NULL
347
-#define DIO41_DDR   DDRF
348
-
349
-#define DIO42_PIN   PINF2
350
-#define DIO42_RPORT PINF
351
-#define DIO42_WPORT PORTF
352
-#define DIO42_PWM   NULL
353
-#define DIO42_DDR   DDRF
354
-
355
-#define DIO43_PIN   PINF3
356
-#define DIO43_RPORT PINF
357
-#define DIO43_WPORT PORTF
358
-#define DIO43_PWM   NULL
359
-#define DIO43_DDR   DDRF
360
-
361
-#define DIO44_PIN   PINF4
362
-#define DIO44_RPORT PINF
363
-#define DIO44_WPORT PORTF
364
-#define DIO44_PWM   NULL
365
-#define DIO44_DDR   DDRF
366
-
367
-#define DIO45_PIN   PINF5
368
-#define DIO45_RPORT PINF
369
-#define DIO45_WPORT PORTF
370
-#define DIO45_PWM   NULL
371
-#define DIO45_DDR   DDRF
372
-
373
-#define DIO46_PIN   PINF6
374
-#define DIO46_RPORT PINF
375
-#define DIO46_WPORT PORTF
376
-#define DIO46_PWM   NULL
377
-#define DIO46_DDR   DDRF
378
-
379
-#define DIO47_PIN   PINF7
380
-#define DIO47_RPORT PINF
381
-#define DIO47_WPORT PORTF
382
-#define DIO47_PWM   NULL
383
-#define DIO47_DDR   DDRF
384
-
385
-// Analog Outputs
386
-
387
-#undef PA0
388
-#define PA0_PIN     PINA0
389
-#define PA0_RPORT   PINA
390
-#define PA0_WPORT   PORTA
391
-#define PA0_PWM     NULL
392
-#define PA0_DDR     DDRA
393
-#undef PA1
394
-#define PA1_PIN     PINA1
395
-#define PA1_RPORT   PINA
396
-#define PA1_WPORT   PORTA
397
-#define PA1_PWM     NULL
398
-#define PA1_DDR     DDRA
399
-#undef PA2
400
-#define PA2_PIN     PINA2
401
-#define PA2_RPORT   PINA
402
-#define PA2_WPORT   PORTA
403
-#define PA2_PWM     NULL
404
-#define PA2_DDR     DDRA
405
-#undef PA3
406
-#define PA3_PIN     PINA3
407
-#define PA3_RPORT   PINA
408
-#define PA3_WPORT   PORTA
409
-#define PA3_PWM     NULL
410
-#define PA3_DDR     DDRA
411
-#undef PA4
412
-#define PA4_PIN     PINA4
413
-#define PA4_RPORT   PINA
414
-#define PA4_WPORT   PORTA
415
-#define PA4_PWM     NULL
416
-#define PA4_DDR     DDRA
417
-#undef PA5
418
-#define PA5_PIN     PINA5
419
-#define PA5_RPORT   PINA
420
-#define PA5_WPORT   PORTA
421
-#define PA5_PWM     NULL
422
-#define PA5_DDR     DDRA
423
-#undef PA6
424
-#define PA6_PIN     PINA6
425
-#define PA6_RPORT   PINA
426
-#define PA6_WPORT   PORTA
427
-#define PA6_PWM     NULL
428
-#define PA6_DDR     DDRA
429
-#undef PA7
430
-#define PA7_PIN     PINA7
431
-#define PA7_RPORT   PINA
432
-#define PA7_WPORT   PORTA
433
-#define PA7_PWM     NULL
434
-#define PA7_DDR     DDRA
435
-
436
-#undef PB0
437
-#define PB0_PIN     PINB0
438
-#define PB0_RPORT   PINB
439
-#define PB0_WPORT   PORTB
440
-#define PB0_PWM     NULL
441
-#define PB0_DDR     DDRB
442
-#undef PB1
443
-#define PB1_PIN     PINB1
444
-#define PB1_RPORT   PINB
445
-#define PB1_WPORT   PORTB
446
-#define PB1_PWM     NULL
447
-#define PB1_DDR     DDRB
448
-#undef PB2
449
-#define PB2_PIN     PINB2
450
-#define PB2_RPORT   PINB
451
-#define PB2_WPORT   PORTB
452
-#define PB2_PWM     NULL
453
-#define PB2_DDR     DDRB
454
-#undef PB3
455
-#define PB3_PIN     PINB3
456
-#define PB3_RPORT   PINB
457
-#define PB3_WPORT   PORTB
458
-#define PB3_PWM     NULL
459
-#define PB3_DDR     DDRB
460
-#undef PB4
461
-#define PB4_PIN     PINB4
462
-#define PB4_RPORT   PINB
463
-#define PB4_WPORT   PORTB
464
-#define PB4_PWM     NULL
465
-#define PB4_DDR     DDRB
466
-#undef PB5
467
-#define PB5_PIN     PINB5
468
-#define PB5_RPORT   PINB
469
-#define PB5_WPORT   PORTB
470
-#define PB5_PWM     NULL
471
-#define PB5_DDR     DDRB
472
-#undef PB6
473
-#define PB6_PIN     PINB6
474
-#define PB6_RPORT   PINB
475
-#define PB6_WPORT   PORTB
476
-#define PB6_PWM     NULL
477
-#define PB6_DDR     DDRB
478
-#undef PB7
479
-#define PB7_PIN     PINB7
480
-#define PB7_RPORT   PINB
481
-#define PB7_WPORT   PORTB
482
-#define PB7_PWM     NULL
483
-#define PB7_DDR     DDRB
484
-
485
-#undef PC0
486
-#define PC0_PIN     PINC0
487
-#define PC0_RPORT   PINC
488
-#define PC0_WPORT   PORTC
489
-#define PC0_PWM     NULL
490
-#define PC0_DDR     DDRC
491
-#undef PC1
492
-#define PC1_PIN     PINC1
493
-#define PC1_RPORT   PINC
494
-#define PC1_WPORT   PORTC
495
-#define PC1_PWM     NULL
496
-#define PC1_DDR     DDRC
497
-#undef PC2
498
-#define PC2_PIN     PINC2
499
-#define PC2_RPORT   PINC
500
-#define PC2_WPORT   PORTC
501
-#define PC2_PWM     NULL
502
-#define PC2_DDR     DDRC
503
-#undef PC3
504
-#define PC3_PIN     PINC3
505
-#define PC3_RPORT   PINC
506
-#define PC3_WPORT   PORTC
507
-#define PC3_PWM     NULL
508
-#define PC3_DDR     DDRC
509
-#undef PC4
510
-#define PC4_PIN     PINC4
511
-#define PC4_RPORT   PINC
512
-#define PC4_WPORT   PORTC
513
-#define PC4_PWM     NULL
514
-#define PC4_DDR     DDRC
515
-#undef PC5
516
-#define PC5_PIN     PINC5
517
-#define PC5_RPORT   PINC
518
-#define PC5_WPORT   PORTC
519
-#define PC5_PWM     NULL
520
-#define PC5_DDR     DDRC
521
-#undef PC6
522
-#define PC6_PIN     PINC6
523
-#define PC6_RPORT   PINC
524
-#define PC6_WPORT   PORTC
525
-#define PC6_PWM     NULL
526
-#define PC6_DDR     DDRC
527
-#undef PC7
528
-#define PC7_PIN     PINC7
529
-#define PC7_RPORT   PINC
530
-#define PC7_WPORT   PORTC
531
-#define PC7_PWM     NULL
532
-#define PC7_DDR     DDRC
533
-
534
-#undef PD0
535
-#define PD0_PIN     PIND0
536
-#define PD0_RPORT   PIND
537
-#define PD0_WPORT   PORTD
538
-#define PD0_PWM     NULL
539
-#define PD0_DDR     DDRD
540
-#undef PD1
541
-#define PD1_PIN     PIND1
542
-#define PD1_RPORT   PIND
543
-#define PD1_WPORT   PORTD
544
-#define PD1_PWM     NULL
545
-#define PD1_DDR     DDRD
546
-#undef PD2
547
-#define PD2_PIN     PIND2
548
-#define PD2_RPORT   PIND
549
-#define PD2_WPORT   PORTD
550
-#define PD2_PWM     NULL
551
-#define PD2_DDR     DDRD
552
-#undef PD3
553
-#define PD3_PIN     PIND3
554
-#define PD3_RPORT   PIND
555
-#define PD3_WPORT   PORTD
556
-#define PD3_PWM     NULL
557
-#define PD3_DDR     DDRD
558
-#undef PD4
559
-#define PD4_PIN     PIND4
560
-#define PD4_RPORT   PIND
561
-#define PD4_WPORT   PORTD
562
-#define PD4_PWM     NULL
563
-#define PD4_DDR     DDRD
564
-#undef PD5
565
-#define PD5_PIN     PIND5
566
-#define PD5_RPORT   PIND
567
-#define PD5_WPORT   PORTD
568
-#define PD5_PWM     NULL
569
-#define PD5_DDR     DDRD
570
-#undef PD6
571
-#define PD6_PIN     PIND6
572
-#define PD6_RPORT   PIND
573
-#define PD6_WPORT   PORTD
574
-#define PD6_PWM     NULL
575
-#define PD6_DDR     DDRD
576
-#undef PD7
577
-#define PD7_PIN     PIND7
578
-#define PD7_RPORT   PIND
579
-#define PD7_WPORT   PORTD
580
-#define PD7_PWM     NULL
581
-#define PD7_DDR     DDRD
582
-
583
-#undef PE0
584
-#define PE0_PIN     PINE0
585
-#define PE0_RPORT   PINE
586
-#define PE0_WPORT   PORTE
587
-#define PE0_PWM     NULL
588
-#define PE0_DDR     DDRE
589
-#undef PE1
590
-#define PE1_PIN     PINE1
591
-#define PE1_RPORT   PINE
592
-#define PE1_WPORT   PORTE
593
-#define PE1_PWM     NULL
594
-#define PE1_DDR     DDRE
595
-#undef PE2
596
-#define PE2_PIN     PINE2
597
-#define PE2_RPORT   PINE
598
-#define PE2_WPORT   PORTE
599
-#define PE2_PWM     NULL
600
-#define PE2_DDR     DDRE
601
-#undef PE3
602
-#define PE3_PIN     PINE3
603
-#define PE3_RPORT   PINE
604
-#define PE3_WPORT   PORTE
605
-#define PE3_PWM     NULL
606
-#define PE3_DDR     DDRE
607
-#undef PE4
608
-#define PE4_PIN     PINE4
609
-#define PE4_RPORT   PINE
610
-#define PE4_WPORT   PORTE
611
-#define PE4_PWM     NULL
612
-#define PE4_DDR     DDRE
613
-#undef PE5
614
-#define PE5_PIN     PINE5
615
-#define PE5_RPORT   PINE
616
-#define PE5_WPORT   PORTE
617
-#define PE5_PWM     NULL
618
-#define PE5_DDR     DDRE
619
-#undef PE6
620
-#define PE6_PIN     PINE6
621
-#define PE6_RPORT   PINE
622
-#define PE6_WPORT   PORTE
623
-#define PE6_PWM     NULL
624
-#define PE6_DDR     DDRE
625
-#undef PE7
626
-#define PE7_PIN     PINE7
627
-#define PE7_RPORT   PINE
628
-#define PE7_WPORT   PORTE
629
-#define PE7_PWM     NULL
630
-#define PE7_DDR     DDRE
631
-
632
-#undef PF0
633
-#define PF0_PIN     PINF0
634
-#define PF0_RPORT   PINF
635
-#define PF0_WPORT   PORTF
636
-#define PF0_PWM     NULL
637
-#define PF0_DDR     DDRF
638
-#undef PF1
639
-#define PF1_PIN     PINF1
640
-#define PF1_RPORT   PINF
641
-#define PF1_WPORT   PORTF
642
-#define PF1_PWM     NULL
643
-#define PF1_DDR     DDRF
644
-#undef PF2
645
-#define PF2_PIN     PINF2
646
-#define PF2_RPORT   PINF
647
-#define PF2_WPORT   PORTF
648
-#define PF2_PWM     NULL
649
-#define PF2_DDR     DDRF
650
-#undef PF3
651
-#define PF3_PIN     PINF3
652
-#define PF3_RPORT   PINF
653
-#define PF3_WPORT   PORTF
654
-#define PF3_PWM     NULL
655
-#define PF3_DDR     DDRF
656
-#undef PF4
657
-#define PF4_PIN     PINF4
658
-#define PF4_RPORT   PINF
659
-#define PF4_WPORT   PORTF
660
-#define PF4_PWM     NULL
661
-#define PF4_DDR     DDRF
662
-#undef PF5
663
-#define PF5_PIN     PINF5
664
-#define PF5_RPORT   PINF
665
-#define PF5_WPORT   PORTF
666
-#define PF5_PWM     NULL
667
-#define PF5_DDR     DDRF
668
-#undef PF6
669
-#define PF6_PIN     PINF6
670
-#define PF6_RPORT   PINF
671
-#define PF6_WPORT   PORTF
672
-#define PF6_PWM     NULL
673
-#define PF6_DDR     DDRF
674
-#undef PF7
675
-#define PF7_PIN     PINF7
676
-#define PF7_RPORT   PINF
677
-#define PF7_WPORT   PORTF
678
-#define PF7_PWM     NULL
679
-#define PF7_DDR     DDRF
680
-
681
-#endif // _FASTIO_AT90USB

Marlin/fastio_AT90USB-Teensy.h → Marlin/fastio_AT90USB.h 查看文件

@@ -26,8 +26,7 @@
26 26
  *   AT90USB  51 50 49 48 47 46 45 44 10 11 12 13 14 15 16 17 35 36 37 38 39 40 41 42 25 26 27 28 29 30 31 32 33 34 43 09 18 19 01 02 61 60 59 58 57 56 55 54
27 27
  * > Teensy   28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45
28 28
  *   Port     A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7
29
- *   Marlin   00 01 02 03 04 05 06 07 08 09 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
30
- *            The pins 46 and 47 are not supported by Teensyduino, but are supported below.
29
+ *            The pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
31 30
  */
32 31
 
33 32
 #ifndef _FASTIO_AT90USB
@@ -679,4 +678,21 @@
679 678
 #define PF7_PWM     NULL
680 679
 #define PF7_DDR     DDRF
681 680
 
681
+
682
+/**
683
+ *  some of the pin mapping functions of the Teensduino extension to the Arduino IDE
684
+ *  do not function the same as the other Arduino extensions
685
+ */
686
+
687
+//digitalPinToTimer(pin) function works like Arduino but Timers are not defined
688
+#define TIMER0B 1
689
+#define TIMER1A 7
690
+#define TIMER1B 8
691
+#define TIMER1C 9
692
+#define TIMER2A 6
693
+#define TIMER2B 2
694
+#define TIMER3A 5
695
+#define TIMER3B 4
696
+#define TIMER3C 3
697
+
682 698
 #endif // _FASTIO_AT90USB

+ 16
- 13
Marlin/pins.h 查看文件

@@ -20,6 +20,18 @@
20 20
  *
21 21
  */
22 22
 
23
+/**
24
+ * Include pins definitions
25
+ *
26
+ * Pins numbering schemes:
27
+ *
28
+ *  - Digital I/O pin number if used by READ/WRITE macros. (e.g., X_STEP_DIR)
29
+ *    The FastIO headers map digital pins to their ports and functions.
30
+ *
31
+ *  - Analog Input number if used by analogRead or DAC. (e.g., TEMP_n_PIN)
32
+ *    These numbers are the same in any pin mapping.
33
+ */
34
+
23 35
 #ifndef __PINS_H__
24 36
 #define __PINS_H__
25 37
 
@@ -537,19 +549,10 @@
537 549
   #define AVR_MOSI_PIN 51
538 550
   #define AVR_SS_PIN   53
539 551
 #elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
540
-  #if ENABLED(AT90USBxx_TEENSYPP_ASSIGNMENTS)
541
-    // Teensy pin assignments
542
-    #define AVR_SCK_PIN  21
543
-    #define AVR_MISO_PIN 23
544
-    #define AVR_MOSI_PIN 22
545
-    #define AVR_SS_PIN   20
546
-  #else
547
-    // Traditional pin assignments
548
-    #define AVR_SCK_PIN  9
549
-    #define AVR_MISO_PIN 11
550
-    #define AVR_MOSI_PIN 10
551
-    #define AVR_SS_PIN   8
552
-  #endif
552
+  #define AVR_SCK_PIN  21
553
+  #define AVR_MISO_PIN 23
554
+  #define AVR_MOSI_PIN 22
555
+  #define AVR_SS_PIN   20
553 556
 #elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
554 557
   #define AVR_SCK_PIN  10
555 558
   #define AVR_MISO_PIN 12

+ 0
- 0
Marlin/ultralcd.cpp 查看文件


+ 1
- 1
platformio.ini 查看文件

@@ -50,7 +50,7 @@ lib_deps = ${common.lib_deps}
50 50
 platform = teensy
51 51
 framework = arduino
52 52
 board = teensy20pp
53
-build_flags = -I $BUILDSRC_DIR -D MOTHERBOARD=BOARD_BRAINWAVE_PRO -D AT90USBxx_TEENSYPP_ASSIGNMENTS
53
+build_flags = -I $BUILDSRC_DIR -D MOTHERBOARD=BOARD_BRAINWAVE_PRO
54 54
 lib_deps = ${common.lib_deps}
55 55
 
56 56
 [env:rambo]

Loading…
取消
儲存