Преглед на файлове

Merge pull request #7255 from thinkyhead/bf_cleanup_july_6

Use FastIO for spindle, probe test, and case light
Scott Lahteine преди 7 години
родител
ревизия
ce834bb78e

+ 22
- 22
Marlin/Marlin_main.cpp Целия файл

@@ -5280,7 +5280,7 @@ void home_all_axes() { gcode_G28(true); }
5280 5280
       #if DISABLED(PROBE_MANUALLY)
5281 5281
         home_offset[Z_AXIS] -= probe_pt(dx, dy, stow_after_each, 1, false); // 1st probe to set height
5282 5282
       #endif
5283
-      
5283
+
5284 5284
       do {
5285 5285
 
5286 5286
         float z_at_pt[13] = { 0.0 };
@@ -5380,7 +5380,7 @@ void home_all_axes() { gcode_G28(true); }
5380 5380
           #if ENABLED(PROBE_MANUALLY)
5381 5381
             test_precision = 0.00; // forced end
5382 5382
           #endif
5383
-          
5383
+
5384 5384
           switch (probe_points) {
5385 5385
             case 1:
5386 5386
               test_precision = 0.00; // forced end
@@ -5854,7 +5854,7 @@ inline void gcode_G92() {
5854 5854
         WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT);  // turn spindle off
5855 5855
         delay_for_power_down();
5856 5856
       }
5857
-      digitalWrite(SPINDLE_DIR_PIN, rotation_dir);
5857
+      WRITE(SPINDLE_DIR_PIN, rotation_dir);
5858 5858
     #endif
5859 5859
 
5860 5860
     /**
@@ -6259,7 +6259,7 @@ inline void gcode_M17() {
6259 6259
   inline void gcode_M23() {
6260 6260
     // Simplify3D includes the size, so zero out all spaces (#7227)
6261 6261
     for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
6262
-    card.openFile(parser.string_arg, true); 
6262
+    card.openFile(parser.string_arg, true);
6263 6263
   }
6264 6264
 
6265 6265
   /**
@@ -6474,20 +6474,20 @@ inline void gcode_M42() {
6474 6474
       else {
6475 6475
         report_pin_state_extended(pin, I_flag, true, "Pulsing   ");
6476 6476
         #if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO
6477
-          if (pin == 46) {
6478
-            SET_OUTPUT(46);
6477
+          if (pin == TEENSY_E2) {
6478
+            SET_OUTPUT(TEENSY_E2);
6479 6479
             for (int16_t j = 0; j < repeat; j++) {
6480
-              WRITE(46, 0); safe_delay(wait);
6481
-              WRITE(46, 1); safe_delay(wait);
6482
-              WRITE(46, 0); safe_delay(wait);
6480
+              WRITE(TEENSY_E2, LOW);  safe_delay(wait);
6481
+              WRITE(TEENSY_E2, HIGH); safe_delay(wait);
6482
+              WRITE(TEENSY_E2, LOW);  safe_delay(wait);
6483 6483
             }
6484 6484
           }
6485
-          else if (pin == 47) {
6486
-            SET_OUTPUT(47);
6485
+          else if (pin == TEENSY_E3) {
6486
+            SET_OUTPUT(TEENSY_E3);
6487 6487
             for (int16_t j = 0; j < repeat; j++) {
6488
-              WRITE(47, 0); safe_delay(wait);
6489
-              WRITE(47, 1); safe_delay(wait);
6490
-              WRITE(47, 0); safe_delay(wait);
6488
+              WRITE(TEENSY_E3, LOW);  safe_delay(wait);
6489
+              WRITE(TEENSY_E3, HIGH); safe_delay(wait);
6490
+              WRITE(TEENSY_E3, LOW);  safe_delay(wait);
6491 6491
             }
6492 6492
           }
6493 6493
           else
@@ -6569,10 +6569,10 @@ inline void gcode_M42() {
6569 6569
       for (uint8_t i = 0; i < 4; i++) {
6570 6570
         servo[probe_index].move(z_servo_angle[0]); //deploy
6571 6571
         safe_delay(500);
6572
-        deploy_state = digitalRead(PROBE_TEST_PIN);
6572
+        deploy_state = READ(PROBE_TEST_PIN);
6573 6573
         servo[probe_index].move(z_servo_angle[1]); //stow
6574 6574
         safe_delay(500);
6575
-        stow_state = digitalRead(PROBE_TEST_PIN);
6575
+        stow_state = READ(PROBE_TEST_PIN);
6576 6576
       }
6577 6577
       if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
6578 6578
 
@@ -6607,9 +6607,9 @@ inline void gcode_M42() {
6607 6607
           if (0 == j % (500 * 1)) // keep cmd_timeout happy
6608 6608
             refresh_cmd_timeout();
6609 6609
 
6610
-          if (deploy_state != digitalRead(PROBE_TEST_PIN)) { // probe triggered
6610
+          if (deploy_state != READ(PROBE_TEST_PIN)) { // probe triggered
6611 6611
 
6612
-            for (probe_counter = 1; probe_counter < 50 && deploy_state != digitalRead(PROBE_TEST_PIN); ++probe_counter)
6612
+            for (probe_counter = 1; probe_counter < 50 && deploy_state != READ(PROBE_TEST_PIN); ++probe_counter)
6613 6613
               safe_delay(2);
6614 6614
 
6615 6615
             if (probe_counter == 50)
@@ -6671,7 +6671,7 @@ inline void gcode_M42() {
6671 6671
     if (parser.seen('E')) {
6672 6672
       endstop_monitor_flag = parser.value_bool();
6673 6673
       SERIAL_PROTOCOLPGM("endstop monitor ");
6674
-      SERIAL_PROTOCOL(endstop_monitor_flag ? "en" : "dis");
6674
+      serialprintPGM(endstop_monitor_flag ? PSTR("en") : PSTR("dis"));
6675 6675
       SERIAL_PROTOCOLLNPGM("abled");
6676 6676
       return;
6677 6677
     }
@@ -9876,9 +9876,9 @@ inline void gcode_M907() {
9876 9876
       if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
9877 9877
         analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness );
9878 9878
       }
9879
-      else digitalWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? LOW : HIGH );
9879
+      else WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? LOW : HIGH);
9880 9880
     }
9881
-    else digitalWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? HIGH : LOW);
9881
+    else WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? HIGH : LOW);
9882 9882
   }
9883 9883
 #endif // HAS_CASE_LIGHT
9884 9884
 
@@ -12877,7 +12877,7 @@ void kill(const char* lcd_msg) {
12877 12877
   #if defined(ACTION_ON_KILL)
12878 12878
     SERIAL_ECHOLNPGM("//action:" ACTION_ON_KILL);
12879 12879
   #endif
12880
-  
12880
+
12881 12881
   #if HAS_POWER_SWITCH
12882 12882
     SET_INPUT(PS_ON_PIN);
12883 12883
   #endif

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h Целия файл

@@ -497,7 +497,7 @@
497 497
 
498 498
   // Horizontal distance bridged by diagonal push rods when effector is centered.
499 499
   #define DELTA_RADIUS 101.0 //mm  Get this value from auto calibrate
500
-  
500
+
501 501
   // Trim adjustments for individual towers
502 502
   // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
503 503
   // measured in degrees anticlockwise looking from above the printer

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h Целия файл

@@ -497,7 +497,7 @@
497 497
 
498 498
   // Horizontal distance bridged by diagonal push rods when effector is centered.
499 499
   #define DELTA_RADIUS 101.0 //mm  Get this value from auto calibrate
500
-  
500
+
501 501
   // Trim adjustments for individual towers
502 502
   // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
503 503
   // measured in degrees anticlockwise looking from above the printer

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration.h Целия файл

@@ -487,7 +487,7 @@
487 487
 
488 488
   // Horizontal distance bridged by diagonal push rods when effector is centered.
489 489
   #define DELTA_RADIUS 124.0 //mm  Get this value from auto calibrate
490
-  
490
+
491 491
   // Trim adjustments for individual towers
492 492
   // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
493 493
   // measured in degrees anticlockwise looking from above the printer

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h Целия файл

@@ -487,7 +487,7 @@
487 487
 
488 488
   // Horizontal distance bridged by diagonal push rods when effector is centered.
489 489
   #define DELTA_RADIUS 105.2 //mm  Get this value from auto calibrate
490
-  
490
+
491 491
   // Trim adjustments for individual towers
492 492
   // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
493 493
   // measured in degrees anticlockwise looking from above the printer

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration.h Целия файл

@@ -473,7 +473,7 @@
473 473
 
474 474
   // Horizontal distance bridged by diagonal push rods when effector is centered.
475 475
   #define DELTA_RADIUS 152.357 //mm  Get this value from auto calibrate
476
-  
476
+
477 477
   // Trim adjustments for individual towers
478 478
   // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
479 479
   // measured in degrees anticlockwise looking from above the printer

+ 1
- 1
Marlin/example_configurations/delta/kossel_xl/Configuration.h Целия файл

@@ -491,7 +491,7 @@
491 491
 
492 492
   // Horizontal distance bridged by diagonal push rods when effector is centered.
493 493
   #define DELTA_RADIUS 174.1 //mm  Get this value from auto calibrate
494
-  
494
+
495 495
   // Trim adjustments for individual towers
496 496
   // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
497 497
   // measured in degrees anticlockwise looking from above the printer

+ 4
- 0
Marlin/fastio_AT90USB.h Целия файл

@@ -382,6 +382,10 @@
382 382
 #define DIO47_WPORT PORTE
383 383
 #define DIO47_PWM   NULL
384 384
 #define DIO47_DDR   DDRE
385
+
386
+#define TEENSY_E2   46
387
+#define TEENSY_E3   47
388
+
385 389
 //-- end not supported by Teensyduino
386 390
 
387 391
 #undef PA0

+ 12
- 12
Marlin/pins_PRINTRBOARD_REVF.h Целия файл

@@ -32,9 +32,9 @@
32 32
  *
33 33
  *  Teensyduino - http://www.pjrc.com/teensy/teensyduino.html
34 34
  *    Installation instructions are at the above URL.
35
- *    
35
+ *
36 36
  *    Select Teensy++ 2.0 in Arduino IDE from the 'Tools -> Boards' menu
37
- *    
37
+ *
38 38
  *    Note: With Teensyduino extension, the Arduino IDE will report 130048 bytes of program storage space available,
39 39
  *    but there is actually only 122880 bytes due to the larger DFU bootloader shipped by default on all Printrboard RevF.
40 40
  *
@@ -99,8 +99,8 @@
99 99
 #define DAC_STEPPER_CURRENT
100 100
 
101 101
 // Set default drive strength percents if not already defined - X, Y, Z, E axis
102
-#ifndef DAC_MOTOR_CURRENT_DEFAULT 
103
-  #define DAC_MOTOR_CURRENT_DEFAULT { 70, 70, 50, 70 }    
102
+#ifndef DAC_MOTOR_CURRENT_DEFAULT
103
+  #define DAC_MOTOR_CURRENT_DEFAULT { 70, 70, 50, 70 }
104 104
 #endif
105 105
 
106 106
 // Number of channels available for DAC
@@ -170,17 +170,17 @@
170 170
 
171 171
 #if ENABLED(MINIPANEL)
172 172
   #if ENABLED(USE_INTERNAL_SD)
173
-    //      PIN       FASTIO PIN#  ATUSB90 PIN# Teensy2.0++ PIN# 
174
-    #define SDSS               20  //        10               B0  
173
+    //      PIN       FASTIO PIN#  ATUSB90 PIN# Teensy2.0++ PIN#
174
+    #define SDSS               20  //        10               B0
175 175
     #define SD_DETECT_PIN      -1  // no auto-detect SD insertion on built-in Printrboard SD reader
176 176
   #else
177
-    //      PIN       FASTIO PIN#  ATUSB90 PIN# Teensy2.0++ PIN#  Printrboard RevF Conn.   MKSLCD12864 PIN#  
177
+    //      PIN       FASTIO PIN#  ATUSB90 PIN# Teensy2.0++ PIN#  Printrboard RevF Conn.   MKSLCD12864 PIN#
178 178
     #define SDSS               11  //        36               C1                EXP2-13             EXP2-07
179 179
     #define SD_DETECT_PIN       9  //        34               E1                EXP2-11             EXP2-04
180 180
   #endif
181
-  
182
-    //      PIN       FASTIO PIN#  ATUSB90 PIN# Teensy2.0++ PIN#  Printrboard RevF Conn.   MKSLCD12864 PIN#  
183
-    #define DOGLCD_A0           4  //        29               D4                EXP2-05             EXP1-04      
181
+
182
+    //      PIN       FASTIO PIN#  ATUSB90 PIN# Teensy2.0++ PIN#  Printrboard RevF Conn.   MKSLCD12864 PIN#
183
+    #define DOGLCD_A0           4  //        29               D4                EXP2-05             EXP1-04
184 184
     #define DOGLCD_CS           5  //        30               D5                EXP2-06             EXP1-05
185 185
     #define BTN_ENC             6  //        31               D6                EXP2-07             EXP1-09
186 186
     #define BEEPER_PIN          7  //        32               D7                EXP2-08             EXP1-10
@@ -190,8 +190,8 @@
190 190
   //#define LCD_BACKLIGHT_PIN  43  //        56               F5                EXP1-12     Not Implemented
191 191
   //#define SCK                21  //        11               B1                ICSP-04             EXP2-09
192 192
   //#define MOSI               22  //        12               B2                ICSP-03             EXP2-05
193
-  //#define MISO               23  //        13               B3                ICSP-06             EXP2-05            
194
-  
193
+  //#define MISO               23  //        13               B3                ICSP-06             EXP2-05
194
+
195 195
   // encoder connections present
196 196
   #define BLEN_A 0
197 197
   #define BLEN_B 1

+ 2
- 2
buildroot/share/git/mfup Целия файл

@@ -2,10 +2,10 @@
2 2
 #
3 3
 # mfup
4 4
 #
5
-# - Fetch latest upstream and replace the PR Target branch with 
5
+# - Fetch latest upstream and replace the PR Target branch with
6 6
 # - Rebase the (current or specified) branch on the PR Target
7 7
 # - Force-push the branch to 'origin'
8
-# - 
8
+# -
9 9
 #
10 10
 
11 11
 [[ $# < 2 ]] || { echo "Usage: `basename $0` [branch]" 1>&2 ; exit 1; }

Loading…
Отказ
Запис