|
@@ -1076,6 +1076,9 @@ void Stepper::init() {
|
1076
|
1076
|
#if HAS_E3_STEP
|
1077
|
1077
|
E_AXIS_INIT(3);
|
1078
|
1078
|
#endif
|
|
1079
|
+ #if HAS_E4_STEP
|
|
1080
|
+ E_AXIS_INIT(4);
|
|
1081
|
+ #endif
|
1079
|
1082
|
|
1080
|
1083
|
// waveform generation = 0100 = CTC
|
1081
|
1084
|
CBI(TCCR1B, WGM13);
|
|
@@ -1477,6 +1480,18 @@ void Stepper::report_positions() {
|
1477
|
1480
|
SET_OUTPUT(E1_MS1_PIN);
|
1478
|
1481
|
SET_OUTPUT(E1_MS2_PIN);
|
1479
|
1482
|
#endif
|
|
1483
|
+ #if HAS_MICROSTEPS_E2
|
|
1484
|
+ SET_OUTPUT(E2_MS1_PIN);
|
|
1485
|
+ SET_OUTPUT(E2_MS2_PIN);
|
|
1486
|
+ #endif
|
|
1487
|
+ #if HAS_MICROSTEPS_E3
|
|
1488
|
+ SET_OUTPUT(E3_MS1_PIN);
|
|
1489
|
+ SET_OUTPUT(E3_MS2_PIN);
|
|
1490
|
+ #endif
|
|
1491
|
+ #if HAS_MICROSTEPS_E4
|
|
1492
|
+ SET_OUTPUT(E4_MS1_PIN);
|
|
1493
|
+ SET_OUTPUT(E4_MS2_PIN);
|
|
1494
|
+ #endif
|
1480
|
1495
|
static const uint8_t microstep_modes[] = MICROSTEP_MODES;
|
1481
|
1496
|
for (uint16_t i = 0; i < COUNT(microstep_modes); i++)
|
1482
|
1497
|
microstep_mode(i, microstep_modes[i]);
|
|
@@ -1497,6 +1512,15 @@ void Stepper::report_positions() {
|
1497
|
1512
|
#if HAS_MICROSTEPS_E1
|
1498
|
1513
|
case 4: WRITE(E1_MS1_PIN, ms1); break;
|
1499
|
1514
|
#endif
|
|
1515
|
+ #if HAS_MICROSTEPS_E2
|
|
1516
|
+ case 5: WRITE(E2_MS1_PIN, ms1); break;
|
|
1517
|
+ #endif
|
|
1518
|
+ #if HAS_MICROSTEPS_E3
|
|
1519
|
+ case 6: WRITE(E3_MS1_PIN, ms1); break;
|
|
1520
|
+ #endif
|
|
1521
|
+ #if HAS_MICROSTEPS_E4
|
|
1522
|
+ case 7: WRITE(E4_MS1_PIN, ms1); break;
|
|
1523
|
+ #endif
|
1500
|
1524
|
}
|
1501
|
1525
|
if (ms2 >= 0) switch (driver) {
|
1502
|
1526
|
case 0: WRITE(X_MS2_PIN, ms2); break;
|
|
@@ -1512,6 +1536,15 @@ void Stepper::report_positions() {
|
1512
|
1536
|
#if HAS_MICROSTEPS_E1
|
1513
|
1537
|
case 4: WRITE(E1_MS2_PIN, ms2); break;
|
1514
|
1538
|
#endif
|
|
1539
|
+ #if HAS_MICROSTEPS_E2
|
|
1540
|
+ case 5: WRITE(E2_MS2_PIN, ms2); break;
|
|
1541
|
+ #endif
|
|
1542
|
+ #if HAS_MICROSTEPS_E3
|
|
1543
|
+ case 6: WRITE(E3_MS2_PIN, ms2); break;
|
|
1544
|
+ #endif
|
|
1545
|
+ #if HAS_MICROSTEPS_E4
|
|
1546
|
+ case 7: WRITE(E4_MS2_PIN, ms2); break;
|
|
1547
|
+ #endif
|
1515
|
1548
|
}
|
1516
|
1549
|
}
|
1517
|
1550
|
|
|
@@ -1550,6 +1583,21 @@ void Stepper::report_positions() {
|
1550
|
1583
|
SERIAL_PROTOCOL(READ(E1_MS1_PIN));
|
1551
|
1584
|
SERIAL_PROTOCOLLN(READ(E1_MS2_PIN));
|
1552
|
1585
|
#endif
|
|
1586
|
+ #if HAS_MICROSTEPS_E2
|
|
1587
|
+ SERIAL_PROTOCOLPGM("E2: ");
|
|
1588
|
+ SERIAL_PROTOCOL(READ(E2_MS1_PIN));
|
|
1589
|
+ SERIAL_PROTOCOLLN(READ(E2_MS2_PIN));
|
|
1590
|
+ #endif
|
|
1591
|
+ #if HAS_MICROSTEPS_E3
|
|
1592
|
+ SERIAL_PROTOCOLPGM("E3: ");
|
|
1593
|
+ SERIAL_PROTOCOL(READ(E3_MS1_PIN));
|
|
1594
|
+ SERIAL_PROTOCOLLN(READ(E3_MS2_PIN));
|
|
1595
|
+ #endif
|
|
1596
|
+ #if HAS_MICROSTEPS_E4
|
|
1597
|
+ SERIAL_PROTOCOLPGM("E4: ");
|
|
1598
|
+ SERIAL_PROTOCOL(READ(E4_MS1_PIN));
|
|
1599
|
+ SERIAL_PROTOCOLLN(READ(E4_MS2_PIN));
|
|
1600
|
+ #endif
|
1553
|
1601
|
}
|
1554
|
1602
|
|
1555
|
1603
|
#endif // HAS_MICROSTEPS
|