Ver código fonte

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 anos atrás
pai
commit
6cba11f087
5 arquivos alterados com 12 adições e 13 exclusões
  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 Ver arquivo

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

+ 2
- 3
Marlin/MarlinSerial.cpp Ver arquivo

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

+ 2
- 2
Marlin/MarlinSerial.h Ver arquivo

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

+ 2
- 4
Marlin/pins.h Ver arquivo

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

+ 3
- 3
Marlin/stepper.cpp Ver arquivo

478
 
478
 
479
     
479
     
480
     for(int8_t i=0; i < step_loops; i++) { // Take multiple steps per interrupt (For high speed moves) 
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
       MSerial.checkRx(); // Check for serial chars.
482
       MSerial.checkRx(); // Check for serial chars.
483
-      #endif 
484
-      
483
+      #endif
484
+
485
       #ifdef ADVANCE
485
       #ifdef ADVANCE
486
       counter_e += current_block->steps_e;
486
       counter_e += current_block->steps_e;
487
       if (counter_e > 0) {
487
       if (counter_e > 0) {

Carregando…
Cancelar
Salvar