Переглянути джерело

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
       #if DISABLED(PROBE_MANUALLY)
5280
       #if DISABLED(PROBE_MANUALLY)
5281
         home_offset[Z_AXIS] -= probe_pt(dx, dy, stow_after_each, 1, false); // 1st probe to set height
5281
         home_offset[Z_AXIS] -= probe_pt(dx, dy, stow_after_each, 1, false); // 1st probe to set height
5282
       #endif
5282
       #endif
5283
-      
5283
+
5284
       do {
5284
       do {
5285
 
5285
 
5286
         float z_at_pt[13] = { 0.0 };
5286
         float z_at_pt[13] = { 0.0 };
5380
           #if ENABLED(PROBE_MANUALLY)
5380
           #if ENABLED(PROBE_MANUALLY)
5381
             test_precision = 0.00; // forced end
5381
             test_precision = 0.00; // forced end
5382
           #endif
5382
           #endif
5383
-          
5383
+
5384
           switch (probe_points) {
5384
           switch (probe_points) {
5385
             case 1:
5385
             case 1:
5386
               test_precision = 0.00; // forced end
5386
               test_precision = 0.00; // forced end
5854
         WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT);  // turn spindle off
5854
         WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT);  // turn spindle off
5855
         delay_for_power_down();
5855
         delay_for_power_down();
5856
       }
5856
       }
5857
-      digitalWrite(SPINDLE_DIR_PIN, rotation_dir);
5857
+      WRITE(SPINDLE_DIR_PIN, rotation_dir);
5858
     #endif
5858
     #endif
5859
 
5859
 
5860
     /**
5860
     /**
6259
   inline void gcode_M23() {
6259
   inline void gcode_M23() {
6260
     // Simplify3D includes the size, so zero out all spaces (#7227)
6260
     // Simplify3D includes the size, so zero out all spaces (#7227)
6261
     for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
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
       else {
6474
       else {
6475
         report_pin_state_extended(pin, I_flag, true, "Pulsing   ");
6475
         report_pin_state_extended(pin, I_flag, true, "Pulsing   ");
6476
         #if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO
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
             for (int16_t j = 0; j < repeat; j++) {
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
             for (int16_t j = 0; j < repeat; j++) {
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
           else
6493
           else
6569
       for (uint8_t i = 0; i < 4; i++) {
6569
       for (uint8_t i = 0; i < 4; i++) {
6570
         servo[probe_index].move(z_servo_angle[0]); //deploy
6570
         servo[probe_index].move(z_servo_angle[0]); //deploy
6571
         safe_delay(500);
6571
         safe_delay(500);
6572
-        deploy_state = digitalRead(PROBE_TEST_PIN);
6572
+        deploy_state = READ(PROBE_TEST_PIN);
6573
         servo[probe_index].move(z_servo_angle[1]); //stow
6573
         servo[probe_index].move(z_servo_angle[1]); //stow
6574
         safe_delay(500);
6574
         safe_delay(500);
6575
-        stow_state = digitalRead(PROBE_TEST_PIN);
6575
+        stow_state = READ(PROBE_TEST_PIN);
6576
       }
6576
       }
6577
       if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
6577
       if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
6578
 
6578
 
6607
           if (0 == j % (500 * 1)) // keep cmd_timeout happy
6607
           if (0 == j % (500 * 1)) // keep cmd_timeout happy
6608
             refresh_cmd_timeout();
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
               safe_delay(2);
6613
               safe_delay(2);
6614
 
6614
 
6615
             if (probe_counter == 50)
6615
             if (probe_counter == 50)
6671
     if (parser.seen('E')) {
6671
     if (parser.seen('E')) {
6672
       endstop_monitor_flag = parser.value_bool();
6672
       endstop_monitor_flag = parser.value_bool();
6673
       SERIAL_PROTOCOLPGM("endstop monitor ");
6673
       SERIAL_PROTOCOLPGM("endstop monitor ");
6674
-      SERIAL_PROTOCOL(endstop_monitor_flag ? "en" : "dis");
6674
+      serialprintPGM(endstop_monitor_flag ? PSTR("en") : PSTR("dis"));
6675
       SERIAL_PROTOCOLLNPGM("abled");
6675
       SERIAL_PROTOCOLLNPGM("abled");
6676
       return;
6676
       return;
6677
     }
6677
     }
9876
       if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
9876
       if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
9877
         analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness );
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
 #endif // HAS_CASE_LIGHT
9883
 #endif // HAS_CASE_LIGHT
9884
 
9884
 
12877
   #if defined(ACTION_ON_KILL)
12877
   #if defined(ACTION_ON_KILL)
12878
     SERIAL_ECHOLNPGM("//action:" ACTION_ON_KILL);
12878
     SERIAL_ECHOLNPGM("//action:" ACTION_ON_KILL);
12879
   #endif
12879
   #endif
12880
-  
12880
+
12881
   #if HAS_POWER_SWITCH
12881
   #if HAS_POWER_SWITCH
12882
     SET_INPUT(PS_ON_PIN);
12882
     SET_INPUT(PS_ON_PIN);
12883
   #endif
12883
   #endif

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h Переглянути файл

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

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h Переглянути файл

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

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration.h Переглянути файл

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

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h Переглянути файл

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

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration.h Переглянути файл

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

+ 1
- 1
Marlin/example_configurations/delta/kossel_xl/Configuration.h Переглянути файл

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

+ 4
- 0
Marlin/fastio_AT90USB.h Переглянути файл

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

+ 12
- 12
Marlin/pins_PRINTRBOARD_REVF.h Переглянути файл

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

+ 2
- 2
buildroot/share/git/mfup Переглянути файл

2
 #
2
 #
3
 # mfup
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
 # - Rebase the (current or specified) branch on the PR Target
6
 # - Rebase the (current or specified) branch on the PR Target
7
 # - Force-push the branch to 'origin'
7
 # - Force-push the branch to 'origin'
8
-# - 
8
+# -
9
 #
9
 #
10
 
10
 
11
 [[ $# < 2 ]] || { echo "Usage: `basename $0` [branch]" 1>&2 ; exit 1; }
11
 [[ $# < 2 ]] || { echo "Usage: `basename $0` [branch]" 1>&2 ; exit 1; }

Завантаження…
Відмінити
Зберегти