Sfoglia il codice sorgente

Rename servos[] array in Marlin to servo[]

Scott Lahteine 10 anni fa
parent
commit
e0e68c5cbc
1 ha cambiato i file con 20 aggiunte e 20 eliminazioni
  1. 20
    20
      Marlin/Marlin_main.cpp

+ 20
- 20
Marlin/Marlin_main.cpp Vedi File

379
 #endif
379
 #endif
380
 
380
 
381
 #if NUM_SERVOS > 0
381
 #if NUM_SERVOS > 0
382
-  Servo servos[NUM_SERVOS];
382
+  Servo servo[NUM_SERVOS];
383
 #endif
383
 #endif
384
 
384
 
385
 #ifdef CHDK
385
 #ifdef CHDK
534
 
534
 
535
 void servo_init() {
535
 void servo_init() {
536
   #if NUM_SERVOS >= 1 && HAS_SERVO_0
536
   #if NUM_SERVOS >= 1 && HAS_SERVO_0
537
-    servos[0].attach(SERVO0_PIN);
537
+    servo[0].attach(SERVO0_PIN);
538
   #endif
538
   #endif
539
   #if NUM_SERVOS >= 2 && HAS_SERVO_1
539
   #if NUM_SERVOS >= 2 && HAS_SERVO_1
540
-    servos[1].attach(SERVO1_PIN);
540
+    servo[1].attach(SERVO1_PIN);
541
   #endif
541
   #endif
542
   #if NUM_SERVOS >= 3 && HAS_SERVO_2
542
   #if NUM_SERVOS >= 3 && HAS_SERVO_2
543
-    servos[2].attach(SERVO2_PIN);
543
+    servo[2].attach(SERVO2_PIN);
544
   #endif
544
   #endif
545
   #if NUM_SERVOS >= 4 && HAS_SERVO_3
545
   #if NUM_SERVOS >= 4 && HAS_SERVO_3
546
-    servos[3].attach(SERVO3_PIN);
546
+    servo[3].attach(SERVO3_PIN);
547
   #endif
547
   #endif
548
 
548
 
549
   // Set position of Servo Endstops that are defined
549
   // Set position of Servo Endstops that are defined
550
   #ifdef SERVO_ENDSTOPS
550
   #ifdef SERVO_ENDSTOPS
551
   for (int i = 0; i < 3; i++)
551
   for (int i = 0; i < 3; i++)
552
     if (servo_endstops[i] >= 0)
552
     if (servo_endstops[i] >= 0)
553
-      servos[servo_endstops[i]].write(servo_endstop_angles[i * 2 + 1]);
553
+      servo[servo_endstops[i]].write(servo_endstop_angles[i * 2 + 1]);
554
   #endif
554
   #endif
555
 
555
 
556
   #if SERVO_LEVELING
556
   #if SERVO_LEVELING
557
     delay(PROBE_SERVO_DEACTIVATION_DELAY);
557
     delay(PROBE_SERVO_DEACTIVATION_DELAY);
558
-    servos[servo_endstops[Z_AXIS]].detach();
558
+    servo[servo_endstops[Z_AXIS]].detach();
559
   #endif
559
   #endif
560
 }
560
 }
561
 
561
 
889
 }
889
 }
890
 
890
 
891
 bool code_has_value() {
891
 bool code_has_value() {
892
-  char c = *(strchr_pointer + 1);
892
+  char c = strchr_pointer[1];
893
   return (c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.';
893
   return (c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.';
894
 }
894
 }
895
 
895
 
1255
       // Engage Z Servo endstop if enabled
1255
       // Engage Z Servo endstop if enabled
1256
       if (servo_endstops[Z_AXIS] >= 0) {
1256
       if (servo_endstops[Z_AXIS] >= 0) {
1257
         #if SERVO_LEVELING
1257
         #if SERVO_LEVELING
1258
-          servos[servo_endstops[Z_AXIS]].attach(0);
1258
+          servo[servo_endstops[Z_AXIS]].attach(0);
1259
         #endif
1259
         #endif
1260
-        servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]);
1260
+        servo[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]);
1261
         #if SERVO_LEVELING
1261
         #if SERVO_LEVELING
1262
           delay(PROBE_SERVO_DEACTIVATION_DELAY);
1262
           delay(PROBE_SERVO_DEACTIVATION_DELAY);
1263
-          servos[servo_endstops[Z_AXIS]].detach();
1263
+          servo[servo_endstops[Z_AXIS]].detach();
1264
         #endif
1264
         #endif
1265
       }
1265
       }
1266
 
1266
 
1319
         #endif
1319
         #endif
1320
 
1320
 
1321
         #if SERVO_LEVELING
1321
         #if SERVO_LEVELING
1322
-          servos[servo_endstops[Z_AXIS]].attach(0);
1322
+          servo[servo_endstops[Z_AXIS]].attach(0);
1323
         #endif
1323
         #endif
1324
 
1324
 
1325
-        servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
1325
+        servo[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
1326
 
1326
 
1327
         #if SERVO_LEVELING
1327
         #if SERVO_LEVELING
1328
           delay(PROBE_SERVO_DEACTIVATION_DELAY);
1328
           delay(PROBE_SERVO_DEACTIVATION_DELAY);
1329
-          servos[servo_endstops[Z_AXIS]].detach();
1329
+          servo[servo_endstops[Z_AXIS]].detach();
1330
         #endif
1330
         #endif
1331
       }
1331
       }
1332
 
1332
 
1520
       #endif
1520
       #endif
1521
         {
1521
         {
1522
           if (servo_endstops[axis] > -1)
1522
           if (servo_endstops[axis] > -1)
1523
-            servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
1523
+            servo[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
1524
         }
1524
         }
1525
 
1525
 
1526
     #endif // SERVO_ENDSTOPS && !Z_PROBE_SLED
1526
     #endif // SERVO_ENDSTOPS && !Z_PROBE_SLED
1598
     // Retract Servo endstop if enabled
1598
     // Retract Servo endstop if enabled
1599
     #ifdef SERVO_ENDSTOPS
1599
     #ifdef SERVO_ENDSTOPS
1600
       if (servo_endstops[axis] > -1)
1600
       if (servo_endstops[axis] > -1)
1601
-        servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
1601
+        servo[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
1602
     #endif
1602
     #endif
1603
 
1603
 
1604
     #if SERVO_LEVELING && !defined(Z_PROBE_SLED)
1604
     #if SERVO_LEVELING && !defined(Z_PROBE_SLED)
3990
       servo_position = code_value();
3990
       servo_position = code_value();
3991
       if ((servo_index >= 0) && (servo_index < NUM_SERVOS)) {
3991
       if ((servo_index >= 0) && (servo_index < NUM_SERVOS)) {
3992
         #if SERVO_LEVELING
3992
         #if SERVO_LEVELING
3993
-          servos[servo_index].attach(0);
3993
+          servo[servo_index].attach(0);
3994
         #endif
3994
         #endif
3995
-        servos[servo_index].write(servo_position);
3995
+        servo[servo_index].write(servo_position);
3996
         #if SERVO_LEVELING
3996
         #if SERVO_LEVELING
3997
           delay(PROBE_SERVO_DEACTIVATION_DELAY);
3997
           delay(PROBE_SERVO_DEACTIVATION_DELAY);
3998
-          servos[servo_index].detach();
3998
+          servo[servo_index].detach();
3999
         #endif
3999
         #endif
4000
       }
4000
       }
4001
       else {
4001
       else {
4010
       SERIAL_PROTOCOL(" Servo ");
4010
       SERIAL_PROTOCOL(" Servo ");
4011
       SERIAL_PROTOCOL(servo_index);
4011
       SERIAL_PROTOCOL(servo_index);
4012
       SERIAL_PROTOCOL(": ");
4012
       SERIAL_PROTOCOL(": ");
4013
-      SERIAL_PROTOCOL(servos[servo_index].read());
4013
+      SERIAL_PROTOCOL(servo[servo_index].read());
4014
       SERIAL_EOL;
4014
       SERIAL_EOL;
4015
     }
4015
     }
4016
   }
4016
   }

Loading…
Annulla
Salva