Bläddra i källkod

Stop redefining MOTHERBOARD and #define AT90USB instead. Also put #ifndef AT90USB around the HardwareSerial_h trick, so now Printrboard / Brainwave support compiles on Arduino 1.0.2 as well.

Johann Rocholl 12 år sedan
förälder
incheckning
6cba11f087
5 ändrade filer med 12 tillägg och 13 borttagningar
  1. 3
    1
      Marlin/Marlin.h
  2. 2
    3
      Marlin/MarlinSerial.cpp
  3. 2
    2
      Marlin/MarlinSerial.h
  4. 2
    4
      Marlin/pins.h
  5. 3
    3
      Marlin/stepper.cpp

+ 3
- 1
Marlin/Marlin.h Visa fil

@@ -4,7 +4,9 @@
4 4
 #ifndef MARLIN_H
5 5
 #define MARLIN_H
6 6
 
7
+#ifndef AT90USB
7 8
 #define  HardwareSerial_h // trick to disable the standard HWserial
9
+#endif
8 10
 
9 11
 #define  FORCE_INLINE __attribute__((always_inline)) inline
10 12
 
@@ -45,7 +47,7 @@
45 47
 
46 48
 #include "WString.h"
47 49
 
48
-#if MOTHERBOARD == 8  // Teensylu
50
+#ifdef AT90USB
49 51
   #define MYSERIAL Serial
50 52
 #else
51 53
   #define MYSERIAL MSerial

+ 2
- 3
Marlin/MarlinSerial.cpp Visa fil

@@ -23,7 +23,7 @@
23 23
 #include "Marlin.h"
24 24
 #include "MarlinSerial.h"
25 25
 
26
-#if MOTHERBOARD != 8 // !teensylu
26
+#ifndef AT90USB
27 27
 // this next line disables the entire HardwareSerial.cpp, 
28 28
 // this is so I can support Attiny series and any other chip without a uart
29 29
 #if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)
@@ -319,5 +319,4 @@ void MarlinSerial::printFloat(double number, uint8_t digits)
319 319
 MarlinSerial MSerial;
320 320
 
321 321
 #endif // whole file
322
-#endif //teensylu
323
-
322
+#endif // !AT90USB

+ 2
- 2
Marlin/MarlinSerial.h Visa fil

@@ -65,7 +65,7 @@
65 65
 #define BYTE 0
66 66
 
67 67
 
68
-#if MOTHERBOARD != 8 // ! teensylu
68
+#ifndef AT90USB
69 69
 // Define constants and variables for buffering incoming serial data.  We're
70 70
 // using a ring buffer (I think), in which rx_buffer_head is the index of the
71 71
 // location to which to write the next incoming character and rx_buffer_tail
@@ -179,6 +179,6 @@ class MarlinSerial //: public Stream
179 179
 };
180 180
 
181 181
 extern MarlinSerial MSerial;
182
-#endif // ! teensylu
182
+#endif // !AT90USB
183 183
 
184 184
 #endif

+ 2
- 4
Marlin/pins.h Visa fil

@@ -963,9 +963,8 @@
963 963
 * See http://reprap.org/wiki/Printrboard for more info
964 964
 ****************************************************************************************/
965 965
 #if MOTHERBOARD == 8 || MOTHERBOARD == 81
966
-#undef MOTHERBOARD
967
-#define MOTHERBOARD 8  // Disable MarlinSerial etc.
968 966
 #define KNOWN_BOARD 1
967
+#define AT90USB 1286  // Disable MarlinSerial etc.
969 968
 
970 969
 #ifndef __AVR_AT90USB1286__
971 970
 #error Oops!  Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
@@ -1026,9 +1025,8 @@
1026 1025
    https://github.com/unrepentantgeek/brainwave-arduino
1027 1026
  ****************************************************************************************/
1028 1027
 #if MOTHERBOARD == 82
1029
-#undef MOTHERBOARD
1030
-#define MOTHERBOARD 8  // Disable MarlinSerial etc.
1031 1028
 #define KNOWN_BOARD 1
1029
+#define AT90USB 646  // Disable MarlinSerial etc.
1032 1030
 
1033 1031
 #ifndef __AVR_AT90USB646__
1034 1032
 #error Oops!  Make sure you have 'Brainwave' selected from the 'Tools -> Boards' menu.

+ 3
- 3
Marlin/stepper.cpp Visa fil

@@ -478,10 +478,10 @@ ISR(TIMER1_COMPA_vect)
478 478
 
479 479
     
480 480
     for(int8_t i=0; i < step_loops; i++) { // Take multiple steps per interrupt (For high speed moves) 
481
-      #if MOTHERBOARD != 8 // !teensylu
481
+      #ifndef AT90USB
482 482
       MSerial.checkRx(); // Check for serial chars.
483
-      #endif 
484
-      
483
+      #endif
484
+
485 485
       #ifdef ADVANCE
486 486
       counter_e += current_block->steps_e;
487 487
       if (counter_e > 0) {

Laddar…
Avbryt
Spara