️ Handle shared enable pins (#22824)

This commit is contained in:
Scott Lahteine
2021-09-28 01:07:51 -05:00
committed by Scott Lahteine
parent 25a131b942
commit 021ceeba0b
26 changed files with 523 additions and 252 deletions

View File

@ -37,6 +37,7 @@
#include "FileNavigator.h"
#include "../../../gcode/queue.h"
#include "../../../module/stepper.h"
#include "../../../sd/cardreader.h"
#include "../../../libs/numtostr.h"
#include "../../../MarlinCore.h"
@ -665,7 +666,7 @@ void ChironTFT::PanelAction(uint8_t req) {
case 19: // A19 Motors off
if (!isPrinting()) {
disable_all_steppers(); // from marlincore.h
stepper.disable_all_steppers();
SendtoTFTLN(AC_msg_ready);
}
break;

View File

@ -27,6 +27,7 @@
#include "../ui_api.h"
#include "../../../libs/numtostr.h"
#include "../../../module/stepper.h" // for disable_all_steppers
#include "../../../module/motion.h" // for quickstop_stepper, A20 read printing speed, feedrate_percentage
#include "../../../MarlinCore.h" // for disable_steppers
#include "../../../inc/MarlinConfig.h"
@ -738,7 +739,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
case 19: // A19 stop stepper drivers - sent on stop extrude command and on turn motors off command
if (!isPrinting()) {
quickstop_stepper();
disable_all_steppers();
stepper.disable_all_steppers();
}
SENDLINE_PGM("");

View File

@ -33,6 +33,7 @@
#include "../../../core/language.h"
#include "../../../module/temperature.h"
#include "../../../module/printcounter.h"
#include "../../../module/stepper.h"
#include "../../../gcode/queue.h"
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#include "../../../feature/pause.h"
@ -375,10 +376,10 @@ void DGUSRxHandler::Steppers(DGUS_VP &vp, void *data_ptr) {
switch (control) {
case DGUS_Data::Control::ENABLE:
enable_all_steppers();
stepper.enable_all_steppers();
break;
case DGUS_Data::Control::DISABLE:
disable_all_steppers();
stepper.disable_all_steppers();
break;
}
@ -553,7 +554,7 @@ void DGUSRxHandler::FilamentSelect(DGUS_VP &vp, void *data_ptr) {
default: return;
case DGUS_Data::Extruder::CURRENT:
case DGUS_Data::Extruder::E0:
TERN_(HAS_MULTI_EXTRUDER, case DGUS_Data::Extruder::E1:)
E_TERN_(case DGUS_Data::Extruder::E1:)
dgus_screen_handler.filament_extruder = extruder;
break;
}

View File

@ -286,14 +286,8 @@ void DGUSTxHandler::TempMax(DGUS_VP &vp) {
}
void DGUSTxHandler::StepperStatus(DGUS_VP &vp) {
if (X_ENABLE_READ() == X_ENABLE_ON
&& Y_ENABLE_READ() == Y_ENABLE_ON
&& Z_ENABLE_READ() == Z_ENABLE_ON) {
dgus_display.Write((uint16_t)vp.addr, Swap16((uint16_t)DGUS_Data::Status::ENABLED));
}
else {
dgus_display.Write((uint16_t)vp.addr, Swap16((uint16_t)DGUS_Data::Status::DISABLED));
}
const bool motor_on = stepper.axis_enabled.bits & (_BV(LINEAR_AXES) - 1);
dgus_display.Write((uint16_t)vp.addr, Swap16(uint16_t(motor_on ? DGUS_Data::Status::ENABLED : DGUS_Data::Status::DISABLED)));
}
void DGUSTxHandler::StepIcons(DGUS_VP &vp) {

View File

@ -125,7 +125,7 @@ void StressTestScreen::onIdle() {
injectCommands_P(PSTR(
"G0 X100 Y100 Z100 F6000\n"
"T0\nG4 S1"
TERN_(HAS_MULTI_EXTRUDER, "\nT1\nG4 S1")
E_TERN_("\nT1\nG4 S1")
"\nG0 X150 Y150 Z150"
));
}

View File

@ -33,6 +33,7 @@
#include "../../../MarlinCore.h"
#include "../../../feature/pause.h"
#include "../../../module/stepper.h"
#include "../../../gcode/queue.h"
#include "../../../libs/numtostr.h"
#include "../../../sd/cardreader.h"
@ -536,7 +537,7 @@ void NextionTFT::PanelAction(uint8_t req) {
case 57: // Disable Motors
if (!isPrinting()) {
disable_all_steppers(); // from marlincore.h
stepper.disable_all_steppers();
SEND_TXT("tmppage.M117", "Motors disabled");
}
break;