Browse Source

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

Daid 12 years ago
parent
commit
fcd9de72ef
7 changed files with 123 additions and 44 deletions
  1. 2
    0
      Marlin/Configuration.h
  2. 6
    4
      Marlin/Marlin.h
  3. 2
    3
      Marlin/MarlinSerial.cpp
  4. 2
    2
      Marlin/MarlinSerial.h
  5. 1
    1
      Marlin/fastio.h
  6. 107
    31
      Marlin/pins.h
  7. 3
    3
      Marlin/stepper.cpp

+ 2
- 0
Marlin/Configuration.h View File

@@ -37,6 +37,8 @@
37 37
 // 7  = Ultimaker
38 38
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
39 39
 // 8  = Teensylu
40
+// 81 = Printrboard (AT90USB1286)
41
+// 82 = Brainwave (AT90USB646)
40 42
 // 9  = Gen3+
41 43
 // 70 = Megatronics
42 44
 // 90 = Alpha OMCA board

+ 6
- 4
Marlin/Marlin.h View File

@@ -4,8 +4,6 @@
4 4
 #ifndef MARLIN_H
5 5
 #define MARLIN_H
6 6
 
7
-#define  HardwareSerial_h // trick to disable the standard HWserial
8
-
9 7
 #define  FORCE_INLINE __attribute__((always_inline)) inline
10 8
 
11 9
 #include <math.h>
@@ -24,6 +22,10 @@
24 22
 #include "Configuration.h"
25 23
 #include "pins.h"
26 24
 
25
+#ifndef AT90USB
26
+#define  HardwareSerial_h // trick to disable the standard HWserial
27
+#endif
28
+
27 29
 #if ARDUINO >= 100 
28 30
   #if defined(__AVR_ATmega644P__)
29 31
     #include "WProgram.h"
@@ -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
@@ -179,7 +181,7 @@ void setPwmFrequency(uint8_t pin, int val);
179 181
 
180 182
 extern float homing_feedrate[];
181 183
 extern bool axis_relative_modes[];
182
-extern int feedmultiply;
184
+extern int feedmultiply;
183 185
 extern bool feedmultiplychanged;
184 186
 extern int extrudemultiply; // Sets extrude multiply factor (in percent)
185 187
 extern float current_position[NUM_AXIS] ;

+ 2
- 3
Marlin/MarlinSerial.cpp View File

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

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

+ 1
- 1
Marlin/fastio.h View File

@@ -1928,7 +1928,7 @@ pins
1928 1928
 
1929 1929
 #endif
1930 1930
 
1931
-#if defined (__AVR_AT90USB1287__) || defined (__AVR_AT90USB1286__)
1931
+#if defined (__AVR_AT90USB1287__) || defined (__AVR_AT90USB1286__) || defined (__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
1932 1932
 // SPI
1933 1933
 #define	SCK					DIO9
1934 1934
 #define	MISO				DIO11

+ 107
- 31
Marlin/pins.h View File

@@ -957,64 +957,140 @@
957 957
 #endif
958 958
 
959 959
 /****************************************************************************************
960
-* Teensylu 0.7 pin assingments (ATMEGA90USB)
961
-* Requires the Teensyduino software with Teensy2.0++ selected in arduino IDE!
960
+* Teensylu 0.7 / Printrboard pin assignments (AT90USB1286)
961
+* Requires the Teensyduino software with Teensy++ 2.0 selected in Arduino IDE!
962
+  http://www.pjrc.com/teensy/teensyduino.html
963
+* See http://reprap.org/wiki/Printrboard for more info
962 964
 ****************************************************************************************/
963
-#if MOTHERBOARD == 8
964
-#define MOTHERBOARD 8
965
+#if MOTHERBOARD == 8 || MOTHERBOARD == 81
965 966
 #define KNOWN_BOARD 1
967
+#define AT90USB 1286  // Disable MarlinSerial etc.
966 968
 
969
+#ifndef __AVR_AT90USB1286__
970
+#error Oops!  Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
971
+#endif
967 972
 
968
-#define X_STEP_PIN          0  
969
-#define X_DIR_PIN           1  
970
-#define X_ENABLE_PIN       39 
971
-#define X_MIN_PIN          13 
972
-#define X_MAX_PIN          -1    
973
+#define X_STEP_PIN          0
974
+#define X_DIR_PIN           1
975
+#define X_ENABLE_PIN       39
976
+#define X_MIN_PIN          13
977
+#define X_MAX_PIN          -1
973 978
 
974
-#define Y_STEP_PIN          2  
975
-#define Y_DIR_PIN           3 
976
-#define Y_ENABLE_PIN       38 
977
-#define Y_MIN_PIN          14 
978
-#define Y_MAX_PIN          -1    
979
+#define Y_STEP_PIN          2
980
+#define Y_DIR_PIN           3
981
+#define Y_ENABLE_PIN       38
982
+#define Y_MIN_PIN          14
983
+#define Y_MAX_PIN          -1
979 984
 
980 985
 #define Z_STEP_PIN          4
981
-#define Z_DIR_PIN           5 
982
-#define Z_ENABLE_PIN       23 
983
-#define Z_MIN_PIN          15 
984
-#define Z_MAX_PIN          -1    
985
-
986
-#define E0_STEP_PIN         6  
987
-#define E0_DIR_PIN          7 
988
-#define E0_ENABLE_PIN       19 
989
-
986
+#define Z_DIR_PIN           5
987
+#define Z_ENABLE_PIN       23
988
+#define Z_MIN_PIN          15
989
+#define Z_MAX_PIN          -1
990 990
 
991
+#define E0_STEP_PIN         6
992
+#define E0_DIR_PIN          7
993
+#define E0_ENABLE_PIN      19
991 994
 
992 995
 #define HEATER_0_PIN       21  // Extruder
993 996
 #define HEATER_1_PIN       -1
994 997
 #define HEATER_2_PIN       -1
995 998
 #define HEATER_BED_PIN     20  // Bed
996
-#define FAN_PIN            22  // Fan   
999
+#define FAN_PIN            22  // Fan
1000
+
1001
+#if MOTHERBOARD == 8
1002
+  #define TEMP_0_PIN          7  // Extruder / Analog pin numbering
1003
+  #define TEMP_BED_PIN        6  // Bed / Analog pin numbering
1004
+#else
1005
+  #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
1006
+  #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
1007
+#endif
997 1008
 
998
-#define TEMP_0_PIN          7  // Extruder
999 1009
 #define TEMP_1_PIN         -1
1000 1010
 #define TEMP_2_PIN         -1
1001
-#define TEMP_BED_PIN        6  // Bed
1002 1011
 
1003 1012
 #define SDPOWER            -1
1004 1013
 #define SDSS                8
1005 1014
 #define LED_PIN            -1
1006 1015
 #define PS_ON_PIN          -1
1007
-#define KILL_PIN           -1 
1016
+#define KILL_PIN           -1
1008 1017
 #define ALARM_PIN          -1
1009 1018
 
1010 1019
 #ifndef SDSUPPORT
1011
-// these pins are defined in the SD library if building with SD support  
1012
-  #define SCK_PIN           9 
1013
-  #define MISO_PIN         11 
1014
-  #define MOSI_PIN         10 
1020
+// these pins are defined in the SD library if building with SD support
1021
+  #define SCK_PIN           9
1022
+  #define MISO_PIN         11
1023
+  #define MOSI_PIN         10
1024
+#endif
1025
+
1026
+#endif  // MOTHERBOARD == 8 (Teensylu) or 81 (Printrboard)
1027
+
1028
+/****************************************************************************************
1029
+ * Brainwave 1.0 pin assignments (AT90USB646)
1030
+ * Requires hardware bundle for Arduino:
1031
+   https://github.com/unrepentantgeek/brainwave-arduino
1032
+ ****************************************************************************************/
1033
+#if MOTHERBOARD == 82
1034
+#define KNOWN_BOARD 1
1035
+#define AT90USB 646  // Disable MarlinSerial etc.
1036
+
1037
+#ifndef __AVR_AT90USB646__
1038
+#error Oops!  Make sure you have 'Brainwave' selected from the 'Tools -> Boards' menu.
1015 1039
 #endif
1040
+
1041
+#define X_STEP_PIN         27
1042
+#define X_DIR_PIN          29
1043
+#define X_ENABLE_PIN       28
1044
+#define X_MIN_PIN           7
1045
+#define X_MAX_PIN          -1
1046
+#define X_ATT_PIN          26
1047
+
1048
+#define Y_STEP_PIN         31
1049
+#define Y_DIR_PIN          33
1050
+#define Y_ENABLE_PIN       32
1051
+#define Y_MIN_PIN           6
1052
+#define Y_MAX_PIN          -1
1053
+#define Y_ATT_PIN          30
1054
+
1055
+#define Z_STEP_PIN         17
1056
+#define Z_DIR_PIN          19
1057
+#define Z_ENABLE_PIN       18
1058
+#define Z_MIN_PIN           5
1059
+#define Z_MAX_PIN          -1
1060
+#define Z_ATT_PIN          16
1061
+
1062
+#define E0_STEP_PIN        21
1063
+#define E0_DIR_PIN         23
1064
+#define E0_ENABLE_PIN      22
1065
+#define E0_ATT_PIN         20
1066
+
1067
+#define HEATER_0_PIN        4  // Extruder
1068
+#define HEATER_1_PIN       -1
1069
+#define HEATER_2_PIN       -1
1070
+#define HEATER_BED_PIN     38  // Bed
1071
+#define FAN_PIN             3  // Fan
1072
+
1073
+#define TEMP_0_PIN          7  // Extruder / Analog pin numbering
1074
+#define TEMP_1_PIN         -1
1075
+#define TEMP_2_PIN         -1
1076
+#define TEMP_BED_PIN        6  // Bed / Analog pin numbering
1077
+
1078
+#define SDPOWER            -1
1079
+#define SDSS               -1
1080
+#define LED_PIN            39
1081
+#define PS_ON_PIN          -1
1082
+#define KILL_PIN           -1
1083
+#define ALARM_PIN          -1
1084
+
1085
+#ifndef SDSUPPORT
1086
+// these pins are defined in the SD library if building with SD support
1087
+  #define SCK_PIN           9
1088
+  #define MISO_PIN         11
1089
+  #define MOSI_PIN         10
1016 1090
 #endif
1017 1091
 
1092
+#endif  // MOTHERBOARD == 82 (Brainwave)
1093
+
1018 1094
 /****************************************************************************************
1019 1095
 * Gen3+ pin assignment
1020 1096
 *

+ 3
- 3
Marlin/stepper.cpp View File

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

Loading…
Cancel
Save