From 8328827059b229c0b6938b05f45364b2b1b37b96 Mon Sep 17 00:00:00 2001 From: Stefan Hechenberger Date: Sun, 12 Feb 2012 20:14:48 +0100 Subject: [PATCH] merging, pausing on external input --- flash.py | 2 +- gcode.c | 2 +- main.c | 2 +- sense_control.c | 6 +++--- sense_control.h | 6 +++--- stepper.c | 10 ++++++++-- stepper.h | 2 +- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/flash.py b/flash.py index 5e90e00dc..dc0e421e7 100644 --- a/flash.py +++ b/flash.py @@ -70,7 +70,7 @@ def build(): BITRATE = "115200" BUILDNAME = "LasaurGrbl" - OBJECTS = ["main", "serial", "gcode", "planner", "io_control", "stepper"] + OBJECTS = ["main", "serial", "gcode", "planner", "sense_control", "stepper"] COMPILE = AVRGCCAPP + " -Wall -Os -DF_CPU=" + CLOCK + " -mmcu=" + DEVICE + " -I. -ffunction-sections" diff --git a/gcode.c b/gcode.c index b10f0b0b5..16ccf4a61 100644 --- a/gcode.c +++ b/gcode.c @@ -28,7 +28,7 @@ #include "gcode.h" #include "config.h" #include "serial.h" -#include "io_control.h" +#include "sense_control.h" #include "planner.h" #include "stepper.h" diff --git a/main.c b/main.c index 3ed768bb8..1c445237d 100644 --- a/main.c +++ b/main.c @@ -22,7 +22,7 @@ #include "config.h" #include "planner.h" #include "stepper.h" -#include "io_control.h" +#include "sense_control.h" #include "gcode.h" #include "serial.h" diff --git a/sense_control.c b/sense_control.c index d85f9511d..4fa720f54 100644 --- a/sense_control.c +++ b/sense_control.c @@ -1,5 +1,5 @@ /* - io_control.h - controlling sensors and actuators + sense_control.h - sensing and controlling inputs and outputs Part of LasaurGrbl Copyright (c) 2011 Stefan Hechenberger @@ -19,7 +19,7 @@ #include #include #include -#include "io_control.h" +#include "sense_control.h" #include "stepper.h" #include "planner.h" @@ -57,7 +57,7 @@ void control_init() { //// limits overwrite control LIMITS_OVERWRITE_DDR |= 1< diff --git a/stepper.c b/stepper.c index 681c194bc..444fc159c 100644 --- a/stepper.c +++ b/stepper.c @@ -1,5 +1,5 @@ /* - stepper.c - stepper motor driver + stepper.c - stepper motor pulse generation Processes block from the queue generated by the planer and pulses steppers accordingly via a dynamically adapted timer interrupt. Part of LasaurGrbl @@ -48,7 +48,7 @@ #include "stepper.h" #include "config.h" #include "planner.h" -#include "io_control.h" +#include "sense_control.h" #define CYCLES_PER_MICROSECOND (F_CPU/1000000) //16000000/1000000 = 16 @@ -189,6 +189,12 @@ ISR(TIMER1_COMPA_vect) { if (busy) { return; } // The busy-flag is used to avoid reentering this interrupt if (stop_requested) { stepper_go_idle(); stop_requested = false; } + if (SENSE_ANY) { + // no power (e-stop), no chiller, door open, limit switch situation + // pause operation + return; + } + // pulse steppers STEPPING_PORT = (STEPPING_PORT & ~DIRECTION_MASK) | (out_bits & DIRECTION_MASK); STEPPING_PORT = (STEPPING_PORT & ~STEPPING_MASK) | out_bits; diff --git a/stepper.h b/stepper.h index 07b3cdd9c..ad0876d56 100644 --- a/stepper.h +++ b/stepper.h @@ -1,5 +1,5 @@ /* - stepper.c - stepper motor driver + stepper.c - stepper motor pulse generation Processes block from the queue generated by the planer and pulses steppers accordingly via a dynamically adapted timer interrupt. Part of LasaurGrbl