浏览代码

Merge pull request #8554 from tcm0116/2.0.x-cleanup

[2.0.x] Fix for #8525 and other cleanup
Scott Lahteine 7 年前
父节点
当前提交
7576ad7fc2
没有帐户链接到提交者的电子邮件

+ 0
- 4
Marlin/src/HAL/HAL_AVR/fastio_AVR.h 查看文件

@@ -55,10 +55,6 @@
55 55
   #error "Pins for this chip not defined in Arduino.h! If you have a working pins definition, please contribute!"
56 56
 #endif
57 57
 
58
-#ifndef _BV
59
-  #define _BV(bit) (1UL << (bit))
60
-#endif
61
-
62 58
 /**
63 59
  * Magic I/O routines
64 60
  *

+ 0
- 2
Marlin/src/HAL/HAL_DUE/HAL_Due.h 查看文件

@@ -53,8 +53,6 @@
53 53
   #define MYSERIAL customizedSerial
54 54
 #endif
55 55
 
56
-#define _BV(bit) (1 << (bit))
57
-
58 56
 // We need the previous define before the include, or compilation bombs...
59 57
 #include "MarlinSerial_Due.h"
60 58
 

+ 0
- 2
Marlin/src/HAL/HAL_LPC1768/include/arduino.h 查看文件

@@ -38,8 +38,6 @@
38 38
 #define OUTPUT       0x01
39 39
 #define INPUT_PULLUP 0x02
40 40
 
41
-#define _BV(bit) (1 << (bit))
42
-
43 41
 #define E2END 0xFFF // EEPROM end address
44 42
 
45 43
 typedef uint8_t byte;

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/pinmapping.cpp 查看文件

@@ -27,8 +27,8 @@
27 27
 #include "../../gcode/parser.h"
28 28
 
29 29
 // Get the digital pin for an analog index
30
-pin_t analogInputToDigitalPin(const uint8_t p) {
31
-  return (p < COUNT(adc_pin_table) ? adc_pin_table[p] : P_NC);
30
+pin_t analogInputToDigitalPin(const int8_t p) {
31
+  return (WITHIN(p, 0, NUM_ANALOG_INPUTS) ? adc_pin_table[p] : P_NC);
32 32
 }
33 33
 
34 34
 // Return the index of a pin number

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/pinmapping.h 查看文件

@@ -239,7 +239,7 @@ constexpr pin_t pin_map[] = {
239 239
   P_NC,  P_NC,  P_NC,  P_NC,  P4_28, P4_29, P_NC,  P_NC
240 240
 };
241 241
 
242
-constexpr int16_t NUM_DIGITAL_PINS = COUNT(pin_map);
242
+constexpr int8_t NUM_DIGITAL_PINS = COUNT(pin_map);
243 243
 
244 244
 constexpr pin_t adc_pin_table[] = {
245 245
   P0_23, P0_24, P0_25, P0_26, P1_30, P1_31,
@@ -255,7 +255,7 @@ constexpr int16_t NUM_ANALOG_INPUTS = COUNT(adc_pin_table);
255 255
 #define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09, P0_29, P0_30
256 256
 
257 257
 // Get the digital pin for an analog index
258
-pin_t analogInputToDigitalPin(const uint8_t p);
258
+pin_t analogInputToDigitalPin(const int8_t p);
259 259
 
260 260
 // Return the index of a pin number
261 261
 // The pin number given here is in the form ppp:nnnnn

+ 0
- 2
Marlin/src/HAL/HAL_STM32F1/HAL_Stm32f1.h 查看文件

@@ -77,8 +77,6 @@
77 77
   #define MYSERIAL Serial3
78 78
 #endif
79 79
 
80
-#define _BV(bit) 	(1 << (bit))
81
-
82 80
 /**
83 81
  * TODO: review this to return 1 for pins that are not analog input
84 82
  */

+ 3
- 0
Marlin/src/HAL/HAL_TEENSY35_36/HAL_Teensy.h 查看文件

@@ -30,6 +30,9 @@
30 30
 // Includes
31 31
 // --------------------------------------------------------------------------
32 32
 
33
+// _BV is re-defined in Arduino.h
34
+#undef _BV
35
+
33 36
 #include <Arduino.h>
34 37
 
35 38
 // Redefine sq macro defined by teensy3/wiring.h

+ 1
- 1
Marlin/src/inc/SanityCheck.h 查看文件

@@ -637,7 +637,7 @@ static_assert(1 >= 0
637 637
   , "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
638 638
 );
639 639
 
640
-#if HAS_BED_PROBE
640
+#if PROBE_SELECTED && DISABLED(PROBE_MANUALLY)
641 641
 
642 642
   /**
643 643
    * Z_PROBE_SLED is incompatible with DELTA

+ 6
- 9
Marlin/src/pins/pins.h 查看文件

@@ -485,9 +485,6 @@
485 485
   #define MAX_EXTRUDERS 5
486 486
 #endif
487 487
 
488
-// Marlin needs to account for pins that equal -1
489
-#define marlinAnalogInputToDigitalPin(p) ((p) == -1 ? -1 : analogInputToDigitalPin(p))
490
-
491 488
 //
492 489
 // Assign auto fan pins if needed
493 490
 //
@@ -541,7 +538,7 @@
541 538
   #endif // EXTRUDERS > 2
542 539
 #endif // EXTRUDERS > 1
543 540
 
544
-#define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN),
541
+#define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN),
545 542
 #define _H1_PINS
546 543
 #define _H2_PINS
547 544
 #define _H3_PINS
@@ -549,16 +546,16 @@
549 546
 
550 547
 #if HOTENDS > 1
551 548
   #undef _H1_PINS
552
-  #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_1_PIN),
549
+  #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN),
553 550
   #if HOTENDS > 2
554 551
     #undef _H2_PINS
555
-    #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_2_PIN),
552
+    #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_2_PIN),
556 553
     #if HOTENDS > 3
557 554
       #undef _H3_PINS
558
-      #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN),
555
+      #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_3_PIN),
559 556
       #if HOTENDS > 4
560 557
         #undef _H4_PINS
561
-        #define _H4_PINS HEATER_4_PIN, marlinAnalogInputToDigitalPin(TEMP_4_PIN),
558
+        #define _H4_PINS HEATER_4_PIN, analogInputToDigitalPin(TEMP_4_PIN),
562 559
       #endif // HOTENDS > 4
563 560
     #endif // HOTENDS > 3
564 561
   #endif // HOTENDS > 2
@@ -579,7 +576,7 @@
579 576
   #endif // MIXING_STEPPERS > 2
580 577
 #endif // MIXING_STEPPERS > 1
581 578
 
582
-#define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN),
579
+#define BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
583 580
 
584 581
 //
585 582
 // Assign endstop pins for boards with only 3 connectors

正在加载...
取消
保存