Selaa lähdekoodia

Pins-related cleanup, formatting

Scott Lahteine 7 vuotta sitten
vanhempi
commit
52e20aeab3

+ 1
- 1
Marlin/pinsDebug.h Näytä tiedosto

@@ -357,7 +357,7 @@ static void pwm_details(uint8_t pin) {
357 357
   // on pins that have two PWMs, print info on second PWM
358 358
   #if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY
359 359
     // looking for port B7 - PWMs 0A and 1C
360
-    if ( ('B' == digitalPinToPort(pin) + 64) && (0x80 == digitalPinToBitMask(pin))) {
360
+    if (digitalPinToPort(pin) == 2 && digitalPinToBitMask(pin) == 0x80) {
361 361
       #ifndef TEENSYDUINO_IDE
362 362
         SERIAL_PROTOCOLPGM("\n .");
363 363
         SERIAL_PROTOCOL_SP(18);

+ 1
- 1
Marlin/pins_BRAINWAVE.h Näytä tiedosto

@@ -41,7 +41,7 @@
41 41
  *
42 42
  *    "Marlin_AT90USB" makes PWM0A available rather than the usual PWM1C. These PWMs share
43 43
  *    the same physical pin. Marlin uses TIMER1 to generate interrupts and sets it up such
44
- *    that PWM1A, PWM1B & PWM1C can not be used.
44
+ *    that PWM1A, PWM1B & PWM1C can't be used.
45 45
  *
46 46
  *  Installation:
47 47
  *

+ 1
- 1
Marlin/pins_BRAINWAVE_PRO.h Näytä tiedosto

@@ -63,7 +63,7 @@
63 63
  *
64 64
  *    "Marlin_AT90USB" makes PWM0A available rather than the usual PWM1C. These PWMs share
65 65
  *    the same physical pin. Marlin uses TIMER1 to generate interrupts and sets it up such
66
- *    that PWM1A, PWM1B & PWM1C can not be used.
66
+ *    that PWM1A, PWM1B & PWM1C can't be used.
67 67
  *
68 68
  *    Installation:
69 69
  *

+ 2
- 2
Marlin/pins_RUMBA.h Näytä tiedosto

@@ -100,7 +100,7 @@
100 100
 #endif
101 101
 
102 102
 #if TEMP_SENSOR_2 == -1
103
-  #define TEMP_2_PIN        7   // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_BED is defined as thermocouple)
103
+  #define TEMP_2_PIN        7   // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can't be used when TEMP_SENSOR_BED is defined as thermocouple)
104 104
 #else
105 105
   #define TEMP_2_PIN       13   // Analog Input (default connector for thermistor *T2* on rumba board is used)
106 106
 #endif
@@ -109,7 +109,7 @@
109 109
 //#define TEMP_X_PIN         12   // Analog Input (default connector for thermistor *T3* on rumba board is used)
110 110
 
111 111
 #if TEMP_SENSOR_BED == -1
112
-  #define TEMP_BED_PIN      7   // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can not be used when TEMP_SENSOR_2 is defined as thermocouple)
112
+  #define TEMP_BED_PIN      7   // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can't be used when TEMP_SENSOR_2 is defined as thermocouple)
113 113
 #else
114 114
   #define TEMP_BED_PIN     11   // Analog Input (default connector for thermistor *THB* on rumba board is used)
115 115
 #endif

+ 1
- 1
Marlin/pins_TEENSYLU.h Näytä tiedosto

@@ -68,7 +68,7 @@
68 68
  *
69 69
  *  NOTE - the "Marlin_AT90USB" pin maps make PWM0A available rather than the usual PWM1C.
70 70
  *         These PWMs share the same physical pin. Marlin uses TIMER1 to generate
71
- *         interrupts and sets it up such that PWM1A, PWM1B & PWM1C can not be used.
71
+ *         interrupts and sets it up such that PWM1A, PWM1B & PWM1C can't be used.
72 72
  */
73 73
 
74 74
  /**

+ 11
- 11
buildroot/share/pin_interrupt_test/pin_interrupt_test.ino Näytä tiedosto

@@ -1,26 +1,26 @@
1
-// Search pins uasable for endstop-interupts
2
-// Compile with the same settings you'd use with Marlin.
1
+// Search pins usable for endstop-interrupts
2
+// Compile with the same build settings you'd use for Marlin.
3 3
 
4 4
 #if defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_AVR_MEGA)
5 5
     #undef  digitalPinToPCICR
6
-    #define digitalPinToPCICR(p)    ( (((p) >= 10) && ((p) <= 15)) || \
7
-                                    (((p) >= 50) && ((p) <= 53)) || \
8
-                                    (((p) >= 62) && ((p) <= 69)) ? (&PCICR) : ((uint8_t *)0) )
6
+    #define digitalPinToPCICR(p)    ( ((p) >= 10 && (p) <= 15) || \
7
+                                      ((p) >= 50 && (p) <= 53) || \
8
+                                      ((p) >= 62 && (p) <= 69) ? &PCICR : (uint8_t *)0)
9 9
 #endif
10 10
 
11 11
 void setup() {
12 12
   Serial.begin(9600);
13 13
   Serial.println("PINs causing interrups are:");
14
-  for(int i=2; i<NUM_DIGITAL_PINS; i++){
15
-    if( digitalPinToPCICR(i) != NULL || (int)digitalPinToInterrupt(i) != -1 ) {
16
-      for (int j= 0; j<NUM_ANALOG_INPUTS; j++){
17
-        if(analogInputToDigitalPin(j) == i) {
18
-          Serial.print("A");
14
+  for (int i = 2; i < NUM_DIGITAL_PINS; i++) {
15
+    if (digitalPinToPCICR(i) || (int)digitalPinToInterrupt(i) != -1) {
16
+      for (int j = 0; j < NUM_ANALOG_INPUTS; j++) {
17
+        if (analogInputToDigitalPin(j) == i) {
18
+          Serial.print('A');
19 19
           Serial.print(j);
20 20
           Serial.print(" = ");
21 21
         }
22 22
       }
23
-      Serial.print("D");
23
+      Serial.print('D');
24 24
       Serial.println(i);
25 25
     }
26 26
   }

Loading…
Peruuta
Tallenna