Skip to content

Commit

Permalink
merging, io
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Hechenberger committed Feb 12, 2012
1 parent e6e169a commit bc3509a
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 373 deletions.
19 changes: 9 additions & 10 deletions config.h
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
/*
config.h - compile time configuration
Part of Grbl
Part of LasaurGrbl
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2011 Sungeun K. Jeon
Copyright (c) 2011 Stefan Hechenberger
Grbl is free software: you can redistribute it and/or modify
LasaurGrbl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Grbl is distributed in the hope that it will be useful,
LasaurGrbl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef config_h
Expand All @@ -31,9 +28,9 @@
#define BAUD_RATE 9600


#define LIMIT_OVERWRITE_DDR DDRD
#define LIMIT_OVERWRITE_PORT PORTD
#define LIMIT_OVERWRITE_BIT 7
#define LIMITS_OVERWRITE_DDR DDRD
#define LIMITS_OVERWRITE_PORT PORTD
#define LIMITS_OVERWRITE_BIT 7

#define SENSE_DDR DDRD
#define SENSE_PORT PORTD
Expand Down Expand Up @@ -64,11 +61,13 @@
#define Z_DIRECTION_BIT 5


#define SENSE_MASK ((1<<POWER_BIT)|(1<<CHILLER_BIT)|(1<<DOOR_BIT))
#define LIMIT_MASK ((1<<X1_LIMIT_BIT)|(1<<X2_LIMIT_BIT)|(1<<Y1_LIMIT_BIT)|(1<<Y2_LIMIT_BIT))
#define STEPPING_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT))
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT))
#define INVERT_MASK 24U // 0x00011000 invert direction pin 3 and 4, (1<<X_DIRECTION_BIT) | (1<<Y_DIRECTION_BIT)

// #define INVERT_MASK 24U // typical forLin Engineering Steppers
// #define INVERT_MASK 0U // typical for Nanotec Steppers

#define CONFIG_X_STEPS_PER_MM 32.80839895 //microsteps/mm
#define CONFIG_Y_STEPS_PER_MM 32.80839895 //microsteps/mm
Expand Down
2 changes: 1 addition & 1 deletion flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def build():
BITRATE = "115200"

BUILDNAME = "LasaurGrbl"
OBJECTS = ["main", "serial", "gcode", "planner", "output_control", "input_control", "stepper"]
OBJECTS = ["main", "serial", "gcode", "planner", "io_control", "stepper"]

COMPILE = AVRGCCAPP + " -Wall -Os -DF_CPU=" + CLOCK + " -mmcu=" + DEVICE + " -I. -ffunction-sections"

Expand Down
45 changes: 23 additions & 22 deletions gcode.c
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
/*
gcode.c - rs274/ngc parser.
Part of LasaurGrbl
gcode.c - rs274/ngc parser.
Part of LasaurGrbl
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2011 Stefan Hechenberger
Copyright (c) 2011 Sungeun K. Jeon
Inspired by the Arduino GCode Interpreter by Mike Ellery and the
NIST RS274/NGC Interpreter by Kramer, Proctor and Messina.
LasaurGrbl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2011 Stefan Hechenberger
Copyright (c) 2011 Sungeun K. Jeon
Inspired by the Arduino GCode Interpreter by Mike Ellery and the
NIST RS274/NGC Interpreter by Kramer, Proctor and Messina.
LasaurGrbl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
LasaurGrbl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
LasaurGrbl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/

#include <string.h>
Expand All @@ -26,11 +28,10 @@ GNU General Public License for more details.
#include "gcode.h"
#include "config.h"
#include "serial.h"
#include "input_control.h"
#include "output_control.h"
#include "io_control.h"
#include "planner.h"
#include "stepper.h"


#define MM_PER_INCH (25.4)

#define NEXT_ACTION_NONE 0
Expand Down Expand Up @@ -303,7 +304,7 @@ uint8_t gcode_execute_line(char *line) {
gc.seek_rate, 0 );
break;
case NEXT_ACTION_HOMING_CYCLE:
limits_homing_cycle();
stepper_homing_cycle();
// now that we are at the physical home
// zero all the position vectors
clear_vector(gc.position);
Expand All @@ -327,13 +328,13 @@ uint8_t gcode_execute_line(char *line) {
}
break;
case NEXT_ACTION_AIRGAS_DISABLE:
planner_airgas_disable();
planner_control_airgas_disable();
break;
case NEXT_ACTION_AIR_ENABLE:
planner_air_enable();
planner_control_air_enable();
break;
case NEXT_ACTION_GAS_ENABLE:
planner_gas_enable();
planner_control_gas_enable();
break;
}

Expand Down
116 changes: 0 additions & 116 deletions input_control.c

This file was deleted.

35 changes: 0 additions & 35 deletions input_control.h

This file was deleted.

21 changes: 8 additions & 13 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
/*
main.c - An embedded CNC Controller with rs274/ngc (g-code) support
Part of Grbl
Part of LasaurGrbl
Copyright (c) 2009-2011 Simen Svale Skogsrud
Grbl is free software: you can redistribute it and/or modify
LasaurGrbl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Grbl is distributed in the hope that it will be useful,
LasaurGrbl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
*/

#include <avr/io.h>
Expand All @@ -25,22 +22,20 @@
#include "config.h"
#include "planner.h"
#include "stepper.h"
#include "input_control.h"
#include "output_control.h"
#include "io_control.h"
#include "gcode.h"
#include "serial.h"


int main() {
sei(); //enable interrupts
serial_init();
gcode_init();
planner_init();
stepper_init();
laser_init();
airgas_init();
gcode_init();
limits_init();

sense_init();
control_init();

while(true) {
gcode_process_line();
}
Expand Down
Loading

0 comments on commit bc3509a

Please sign in to comment.