Adjustment to autostart and M226 for QA

Made changed requested by Logan fori testing jigs in production.

- Fixed "auto0.g" autostart which was not working.
- Made it so M226 works on protected pins:
   - There are no longer protected pins
   - However, will only work on pins that are already inputs (like endstops)
master
Marcio Teixeira 7 years ago
parent 520b2b2fb1
commit c00305ae40

@ -39,7 +39,7 @@
#error Must specify model and toolhead. Please see "Configuration_LulzBot.h" for directions. #error Must specify model and toolhead. Please see "Configuration_LulzBot.h" for directions.
#endif #endif
#define LULZBOT_FW_VERSION ".5" #define LULZBOT_FW_VERSION ".6"
// Select options based on printer model // Select options based on printer model
@ -162,6 +162,12 @@
// so long as UBL is disabled. // so long as UBL is disabled.
#define LULZBOT_G26_BACKWARDS_COMPATIBILITY #define LULZBOT_G26_BACKWARDS_COMPATIBILITY
// Fix for auto0.g, which is broken
#define LULZBOT_AUTOSTART_BUGFIX
// Q&A wants to be able to use M226 on endstops switches
#define LULZBOT_NO_PIN_PROTECTION_ON_M226
// The following should be kept more or less like M999 // The following should be kept more or less like M999
#define LULZBOT_G26_RESET_ACTION \ #define LULZBOT_G26_RESET_ACTION \
Running = true; \ Running = true; \

@ -8802,13 +8802,22 @@ inline void gcode_M226() {
const int pin_number = parser.value_int(), const int pin_number = parser.value_int(),
pin_state = parser.intval('S', -1); // required pin state - default is inverted pin_state = parser.intval('S', -1); // required pin state - default is inverted
#if defined(LULZBOT_NO_PIN_PROTECTION_ON_M226)
if (WITHIN(pin_state, -1, 1) && pin_number > -1) {
#else
if (WITHIN(pin_state, -1, 1) && pin_number > -1 && !pin_is_protected(pin_number)) { if (WITHIN(pin_state, -1, 1) && pin_number > -1 && !pin_is_protected(pin_number)) {
#endif
int target = LOW; int target = LOW;
stepper.synchronize(); stepper.synchronize();
#if !defined(LULZBOT_NO_PIN_PROTECTION_ON_M226)
pinMode(pin_number, INPUT); pinMode(pin_number, INPUT);
#else
// Don't switch pin mode. Since we are disabling protection,
// we should only poll pins that already are inputs.
#endif
switch (pin_state) { switch (pin_state) {
case 1: case 1:
target = HIGH; target = HIGH;

@ -27,6 +27,7 @@
#include "language.h" #include "language.h"
#include "Marlin.h" #include "Marlin.h"
#include "Configuration.h"
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
@ -532,8 +533,13 @@ void CardReader::write_command(char *buf) {
} }
void CardReader::checkautostart(bool force) { void CardReader::checkautostart(bool force) {
#if defined(LULZBOT_AUTOSTART_BUGFIX)
if (!force && (!autostart_stilltocheck || ! ELAPSED(millis(), next_autostart_ms)))
return;
#else
if (!force && (!autostart_stilltocheck || ELAPSED(millis(), next_autostart_ms))) if (!force && (!autostart_stilltocheck || ELAPSED(millis(), next_autostart_ms)))
return; return;
#endif
autostart_stilltocheck = false; autostart_stilltocheck = false;

Loading…
Cancel
Save