From 1521a6bb4279fb75d99eb7a67d909b390493af80 Mon Sep 17 00:00:00 2001 From: Joseph Coffland Date: Sun, 13 Mar 2016 19:24:19 -0700 Subject: [PATCH] Updated licensing and attributions --- CODE_TAG | 22 ++++++ LICENSE | 41 ++++++++++ Makefile | 4 +- README.md | 14 +--- src/canonical_machine.c | 93 +++++++++++----------- src/canonical_machine.h | 168 +++++++++++++++++++--------------------- src/clock.c | 51 ++++++------ src/clock.h | 50 ++++++------ src/command.c | 36 ++++----- src/command.def | 36 ++++----- src/command.h | 36 ++++----- src/config.h | 39 +++++++--- src/controller.c | 61 +++++++-------- src/controller.h | 64 +++++++-------- src/cpp_magic.h | 36 +++++++-- src/cycle_homing.c | 63 +++++++-------- src/cycle_probing.c | 58 +++++++------- src/encoder.c | 59 +++++++------- src/encoder.h | 73 ++++++++--------- src/gcode_parser.c | 49 ++++++------ src/gcode_parser.h | 51 ++++++------ src/gpio.c | 62 +++++++-------- src/gpio.h | 61 +++++++-------- src/hardware.c | 59 +++++++------- src/hardware.h | 63 +++++++-------- src/main.c | 53 +++++++------ src/messages.def | 29 ++++++- src/plan/arc.c | 49 ++++++------ src/plan/arc.h | 51 ++++++------ src/plan/buffer.c | 60 +++++++------- src/plan/command.c | 60 +++++++------- src/plan/dwell.c | 60 +++++++------- src/plan/exec.c | 61 +++++++-------- src/plan/feedhold.c | 60 +++++++------- src/plan/jog.c | 27 +++++++ src/plan/jog.h | 27 +++++++ src/plan/kinematics.c | 60 +++++++------- src/plan/kinematics.h | 61 +++++++-------- src/plan/line.c | 63 +++++++-------- src/plan/planner.c | 61 +++++++-------- src/plan/planner.h | 61 +++++++-------- src/plan/zoid.c | 70 ++++++++--------- src/pwm.c | 59 +++++++------- src/pwm.h | 61 +++++++-------- src/report.c | 36 ++++----- src/report.h | 38 ++++----- src/ringbuf.def | 70 ++++++++++------- src/rtc.c | 49 ++++++------ src/rtc.h | 51 ++++++------ src/spindle.c | 59 +++++++------- src/spindle.h | 61 +++++++-------- src/status.c | 51 ++++++------ src/status.h | 66 +++++++--------- src/stepper.c | 68 ++++++++-------- src/stepper.h | 158 ++++++++++++++++++------------------- src/switch.c | 90 ++++++++++----------- src/switch.h | 93 +++++++++++----------- src/tmc2660.c | 36 ++++----- src/tmc2660.h | 36 ++++----- src/usart.c | 36 ++++----- src/usart.h | 38 ++++----- src/util.c | 59 +++++++------- src/util.h | 70 ++++++++--------- src/vars.c | 36 ++++----- src/vars.def | 36 ++++----- src/vars.h | 36 ++++----- 66 files changed, 1824 insertions(+), 1831 deletions(-) create mode 100644 CODE_TAG diff --git a/CODE_TAG b/CODE_TAG new file mode 100644 index 0000000..6a26c85 --- /dev/null +++ b/CODE_TAG @@ -0,0 +1,22 @@ + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016, Buildbotics LLC + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" diff --git a/LICENSE b/LICENSE index d159169..b08b657 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,44 @@ +The Buildbotics firmware ("the software") is free software: you can +redistribute it and/or modify it under the terms of the GNU General +Public License, version 2 (with out any licensing exceptions) as +published by the Free Software Foundation. See the full license terms +below. + +*********************************************************************** + +Substantial effort was made to give credit to all authors of this +software and of the works it was derived from and to adhere to the +terms of the applicable license agreements. If you belive any +mistakes have been made in this regard please contact Joseph Coffland +. + +Portions of this software are copyrighted by the following entities: + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2014 Thomas Nixon, Jonathan Heathcote (cpp_magic.h) + Copyright (c) 2013 - 2015 Robert Giseburt + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2008 Atmel Corporation (part of clock.c) + All rights reserved. + +Each source code file lists the entities which claim copyright to +parts of those files. + +Much of this software was originally written by Alden S. Hart, Jr. and +Robert Giseburt as part of the TinyG project. The TinyG project was +in turn derived from grbl/marlin firmwares. All of the original code +has been reformatted and cleaned up to fit our coding standards. +Functionality in many areas has been substantially modified. + +The original TinyG firmware is licensed under the GPL v2 and includes +an exception which allows use of the source code by non-GPLed +libraires and potentially executables linked to those libraries. The +TinyG project's license did not specify that this exception must be +offered in derived works, therefore this software's license DOES NOT +offer any exceptions to the GPL v2 license. + +*********************************************************************** + GNU GENERAL PUBLIC LICENSE Version 2, June 1991 diff --git a/Makefile b/Makefile index ce3c7f4..e396bf6 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -# Makefile for the project TinyG firmware -PROJECT = tinyg +# Makefile for the project Bulidbotics firmware +PROJECT = buildbotics MCU = atxmega192a3u CLOCK = 32000000 diff --git a/README.md b/README.md index 7b1e78d..5080db1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ -TinyG is a 6 axis motion control system designed for high-performance on small to mid-sized machines. This fork contains a modified version of the TinyG firmware. See the [original TinyG](https://github.com/synthetos/TinyG) for more info. +The Buildbotics firmware is a 4 axis motion control system designed for +high-performance on small to mid-sized machines. It was originally +derived from the [TinyG firmware](https://github.com/synthetos/TinyG). # Features -* 6 axis motion (XYZABC axes) +* 4 axis motion * jerk controlled motion for acceleration planning (3rd order motion planning) -* status displays ('?' character) -* XON/XOFF and RTS/CTS protocol over USB serial -* RESTful interface using JSON # Build Instructions To build in Linux run: @@ -21,8 +20,3 @@ Other make commands are: * **read_fuses** - Read and pring AVR fuse bytes * **clean** - Remove build files * **tidy** - Remove backup files - -# Links -* [TinyG Wiki](https://github.com/synthetos/TinyG/wiki) -* [TinyG Support Forum](https://www.synthetos.com/forum/tinyg/) -* [TinyG Github](https://github.com/synthetos/TinyG) diff --git a/src/canonical_machine.c b/src/canonical_machine.c index 9e69b94..757bad5 100644 --- a/src/canonical_machine.c +++ b/src/canonical_machine.c @@ -1,36 +1,31 @@ -/* - * canonical_machine.c - rs274/ngc canonical machine. - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S Hart, Jr. - * Copyright (c) 2014 - 2015 Robert Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ /* This code is a loose implementation of Kramer, Proctor and Messina's * canonical machining functions as described in the NIST RS274/NGC v3 @@ -225,7 +220,7 @@ uint8_t cm_get_spindle_mode(GCodeState_t *gcode_state) { uint8_t cm_get_block_delete_switch() {return cm.gmx.block_delete_switch;} uint8_t cm_get_runtime_busy() {return mp_get_runtime_busy();} - + float cm_get_feed_rate(GCodeState_t *gcode_state) { return gcode_state->feed_rate; } @@ -282,7 +277,7 @@ void cm_set_model_linenum(uint32_t linenum) { * - coordinate system selected. 1-9 correspond to G54-G59 * - absolute override: forces current move to be interpreted in machine * coordinates: G53 (system 0) - * - G92 offsets are added "on top of" the coord system offsets -- + * - G92 offsets are added "on top of" the coord system offsets -- * if origin_offset_enable * - G28 and G30 moves; these are run in absolute coordinates * @@ -290,7 +285,7 @@ void cm_set_model_linenum(uint32_t linenum) { * supposed to be persistent. * * To reduce complexity and data load the following is done: - * - Full data for coordinates/offsets is only accessible by the canonical + * - Full data for coordinates/offsets is only accessible by the canonical * machine, not the downstream * - Resolved set of coord and G92 offsets, with per-move exceptions can * be captured as "work_offsets" @@ -522,7 +517,7 @@ stat_t cm_test_soft_limits(float target[]) { void canonical_machine_init() { // If you can assume all memory has been zeroed by a hard reset you don't // need this code: - memset(&cm.gm, 0, sizeof(GCodeState_t)); + memset(&cm.gm, 0, sizeof(GCodeState_t)); memset(&cm.gn, 0, sizeof(GCodeInput_t)); memset(&cm.gf, 0, sizeof(GCodeInput_t)); @@ -781,7 +776,7 @@ stat_t cm_set_coord_system(uint8_t coord_system) { static void _exec_offset(float *value, float *flag) { // coordinate system is passed in value[0] element - uint8_t coord_system = ((uint8_t)value[0]); + uint8_t coord_system = ((uint8_t)value[0]); float offsets[AXES]; for (uint8_t axis = AXIS_X; axis < AXES; axis++) offsets[axis] = cm.offset[coord_system][axis] + @@ -949,9 +944,9 @@ stat_t cm_set_g28_position() { stat_t cm_goto_g28_position(float target[], float flags[]) { cm_set_absolute_override(MODEL, true); // move through intermediate point, or skip - cm_straight_traverse(target, flags); + cm_straight_traverse(target, flags); - // make sure you have an available buffer + // make sure you have an available buffer while (!mp_get_planner_buffers_available()); // execute actual stored move @@ -971,7 +966,7 @@ stat_t cm_set_g30_position() { stat_t cm_goto_g30_position(float target[], float flags[]) { cm_set_absolute_override(MODEL, true); // move through intermediate point, or skip - cm_straight_traverse(target, flags); + cm_straight_traverse(target, flags); // make sure you have an available buffer while (!mp_get_planner_buffers_available()); float f[] = {1, 1, 1, 1, 1, 1}; @@ -1133,7 +1128,7 @@ stat_t cm_override_enables(uint8_t flag) { /// M50 -stat_t cm_feed_rate_override_enable(uint8_t flag) { +stat_t cm_feed_rate_override_enable(uint8_t flag) { if (fp_TRUE(cm.gf.parameter) && fp_ZERO(cm.gn.parameter)) cm.gmx.feed_rate_override_enable = false; else cm.gmx.feed_rate_override_enable = true; @@ -1143,7 +1138,7 @@ stat_t cm_feed_rate_override_enable(uint8_t flag) { /// M50.1 -stat_t cm_feed_rate_override_factor(uint8_t flag) { +stat_t cm_feed_rate_override_factor(uint8_t flag) { cm.gmx.feed_rate_override_enable = flag; cm.gmx.feed_rate_override_factor = cm.gn.parameter; return STAT_OK; @@ -1151,7 +1146,7 @@ stat_t cm_feed_rate_override_factor(uint8_t flag) { /// M50.2 -stat_t cm_traverse_override_enable(uint8_t flag) { +stat_t cm_traverse_override_enable(uint8_t flag) { if (fp_TRUE(cm.gf.parameter) && fp_ZERO(cm.gn.parameter)) cm.gmx.traverse_override_enable = false; else cm.gmx.traverse_override_enable = true; @@ -1161,7 +1156,7 @@ stat_t cm_traverse_override_enable(uint8_t flag) { /// M51 -stat_t cm_traverse_override_factor(uint8_t flag) { +stat_t cm_traverse_override_factor(uint8_t flag) { cm.gmx.traverse_override_enable = flag; cm.gmx.traverse_override_factor = cm.gn.parameter; return STAT_OK; @@ -1169,7 +1164,7 @@ stat_t cm_traverse_override_factor(uint8_t flag) { /// M51.1 -stat_t cm_spindle_override_enable(uint8_t flag) { +stat_t cm_spindle_override_enable(uint8_t flag) { if (fp_TRUE(cm.gf.parameter) && fp_ZERO(cm.gn.parameter)) cm.gmx.spindle_override_enable = false; else cm.gmx.spindle_override_enable = true; @@ -1179,7 +1174,7 @@ stat_t cm_spindle_override_enable(uint8_t flag) { /// M50.1 -stat_t cm_spindle_override_factor(uint8_t flag) { +stat_t cm_spindle_override_factor(uint8_t flag) { cm.gmx.spindle_override_enable = flag; cm.gmx.spindle_override_factor = cm.gn.parameter; @@ -1296,7 +1291,7 @@ stat_t cm_queue_flush() { * * cm_program_end() implements M2 and M30 * The END behaviors are defined by NIST 3.6.1 are: - * 1. Axis offsets are set to zero (like G92.2) and origin offsets are set + * 1. Axis offsets are set to zero (like G92.2) and origin offsets are set * to the default (like G54) * 2. Selected plane is set to CANON_PLANE_XY (like G17) * 3. Distance mode is set to MODE_ABSOLUTE (like G90) @@ -1308,7 +1303,7 @@ stat_t cm_queue_flush() { * 9. Coolant is turned off (like M9) * * cm_program_end() implments things slightly differently: - * 1. Axis offsets are set to G92.1 CANCEL offsets + * 1. Axis offsets are set to G92.1 CANCEL offsets * (instead of using G92.2 SUSPEND Offsets) * Set default coordinate system (uses $gco, not G54) * 2. Selected plane is set to default plane ($gpl) diff --git a/src/canonical_machine.h b/src/canonical_machine.h index f3422c3..0a5c812 100644 --- a/src/canonical_machine.h +++ b/src/canonical_machine.h @@ -1,38 +1,30 @@ -/* - * canonical_machine.h - rs274/ngc canonical machining functions - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart Jr. - * - * This code is a loose implementation of Kramer, Proctor and Messina's - * canonical machining functions as described in the NIST RS274/NGC v3 - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once @@ -43,9 +35,9 @@ #include /// absolute pointer from canonical machine gm model -#define MODEL (GCodeState_t *)&cm.gm +#define MODEL (GCodeState_t *)&cm.gm /// relative to buffer *bf is currently pointing to -#define PLANNER (GCodeState_t *)&bf->gm +#define PLANNER (GCodeState_t *)&bf->gm /// absolute pointer from runtime mm struct #define RUNTIME (GCodeState_t *)&mr.gm /// active model pointer is maintained by state management @@ -479,7 +471,7 @@ enum cmCoordSystem { /// G Modal Group 13 enum cmPathControlMode { /// G61 - hits corners but does not stop if it does not need to. - PATH_EXACT_PATH, + PATH_EXACT_PATH, PATH_EXACT_STOP, // G61.1 - stops at all corners PATH_CONTINUOUS // G64 and typically the default mode }; @@ -507,14 +499,14 @@ enum cmOriginOffset { enum cmProgramFlow { - PROGRAM_STOP, + PROGRAM_STOP, PROGRAM_END }; /// spindle state settings (See hardware.h for bit settings) enum cmSpindleState { - SPINDLE_OFF, + SPINDLE_OFF, SPINDLE_CW, SPINDLE_CCW }; @@ -531,7 +523,7 @@ enum cmCoolantState { /// used for spindle and arc dir enum cmDirection { - DIRECTION_CW, + DIRECTION_CW, DIRECTION_CCW }; @@ -650,87 +642,87 @@ stat_t cm_soft_alarm(stat_t status); stat_t cm_clear(); // Representation (4.3.3) -stat_t cm_select_plane(uint8_t plane); -stat_t cm_set_units_mode(uint8_t mode); -stat_t cm_set_distance_mode(uint8_t mode); +stat_t cm_select_plane(uint8_t plane); +stat_t cm_set_units_mode(uint8_t mode); +stat_t cm_set_distance_mode(uint8_t mode); stat_t cm_set_coord_offsets(uint8_t coord_system, float offset[], float flag[]); -void cm_set_position(uint8_t axis, float position); -stat_t cm_set_absolute_origin(float origin[], float flag[]); -void cm_set_axis_origin(uint8_t axis, const float position); +void cm_set_position(uint8_t axis, float position); +stat_t cm_set_absolute_origin(float origin[], float flag[]); +void cm_set_axis_origin(uint8_t axis, const float position); -stat_t cm_set_coord_system(uint8_t coord_system); -stat_t cm_set_origin_offsets(float offset[], float flag[]); -stat_t cm_reset_origin_offsets(); -stat_t cm_suspend_origin_offsets(); -stat_t cm_resume_origin_offsets(); +stat_t cm_set_coord_system(uint8_t coord_system); +stat_t cm_set_origin_offsets(float offset[], float flag[]); +stat_t cm_reset_origin_offsets(); +stat_t cm_suspend_origin_offsets(); +stat_t cm_resume_origin_offsets(); // Free Space Motion (4.3.4) -stat_t cm_straight_traverse(float target[], float flags[]); -stat_t cm_set_g28_position(); -stat_t cm_goto_g28_position(float target[], float flags[]); -stat_t cm_set_g30_position(); -stat_t cm_goto_g30_position(float target[], float flags[]); +stat_t cm_straight_traverse(float target[], float flags[]); +stat_t cm_set_g28_position(); +stat_t cm_goto_g28_position(float target[], float flags[]); +stat_t cm_set_g30_position(); +stat_t cm_goto_g30_position(float target[], float flags[]); // Machining Attributes (4.3.5) -stat_t cm_set_feed_rate(float feed_rate); -stat_t cm_set_feed_rate_mode(uint8_t mode); -stat_t cm_set_path_control(uint8_t mode); +stat_t cm_set_feed_rate(float feed_rate); +stat_t cm_set_feed_rate_mode(uint8_t mode); +stat_t cm_set_path_control(uint8_t mode); // Machining Functions (4.3.6) -stat_t cm_straight_feed(float target[], float flags[]); -stat_t cm_arc_feed(float target[], float flags[], +stat_t cm_straight_feed(float target[], float flags[]); +stat_t cm_arc_feed(float target[], float flags[], float i, float j, float k, float radius, uint8_t motion_mode); -stat_t cm_dwell(float seconds); +stat_t cm_dwell(float seconds); // Spindle Functions (4.3.7) // see spindle.h for spindle definitions - which would go right here // Tool Functions (4.3.8) -stat_t cm_select_tool(uint8_t tool); -stat_t cm_change_tool(uint8_t tool); +stat_t cm_select_tool(uint8_t tool); +stat_t cm_change_tool(uint8_t tool); // Miscellaneous Functions (4.3.9) -stat_t cm_mist_coolant_control(uint8_t mist_coolant); -stat_t cm_flood_coolant_control(uint8_t flood_coolant); +stat_t cm_mist_coolant_control(uint8_t mist_coolant); +stat_t cm_flood_coolant_control(uint8_t flood_coolant); -stat_t cm_override_enables(uint8_t flag); -stat_t cm_feed_rate_override_enable(uint8_t flag); -stat_t cm_feed_rate_override_factor(uint8_t flag); -stat_t cm_traverse_override_enable(uint8_t flag); -stat_t cm_traverse_override_factor(uint8_t flag); -stat_t cm_spindle_override_enable(uint8_t flag); -stat_t cm_spindle_override_factor(uint8_t flag); +stat_t cm_override_enables(uint8_t flag); +stat_t cm_feed_rate_override_enable(uint8_t flag); +stat_t cm_feed_rate_override_factor(uint8_t flag); +stat_t cm_traverse_override_enable(uint8_t flag); +stat_t cm_traverse_override_factor(uint8_t flag); +stat_t cm_spindle_override_enable(uint8_t flag); +stat_t cm_spindle_override_factor(uint8_t flag); -void cm_message(char *message); +void cm_message(char *message); // Program Functions (4.3.10) void cm_request_feedhold(); void cm_request_queue_flush(); void cm_request_cycle_start(); -stat_t cm_feedhold_sequencing_callback(); -stat_t cm_queue_flush(); +stat_t cm_feedhold_sequencing_callback(); +stat_t cm_queue_flush(); -void cm_cycle_start(); -void cm_cycle_end(); -void cm_feedhold(); -void cm_program_stop(); -void cm_optional_program_stop(); -void cm_program_end(); +void cm_cycle_start(); +void cm_cycle_end(); +void cm_feedhold(); +void cm_program_stop(); +void cm_optional_program_stop(); +void cm_program_end(); char cm_get_axis_char(const int8_t axis); // Cycles // Homing cycles -stat_t cm_homing_cycle_start(); -stat_t cm_homing_cycle_start_no_set(); -stat_t cm_homing_callback(); +stat_t cm_homing_cycle_start(); +stat_t cm_homing_cycle_start_no_set(); +stat_t cm_homing_callback(); // Probe cycles -stat_t cm_straight_probe(float target[], float flags[]); -stat_t cm_probe_callback(); +stat_t cm_straight_probe(float target[], float flags[]); +stat_t cm_probe_callback(); diff --git a/src/clock.c b/src/clock.c index 3ae2852..006fde6 100644 --- a/src/clock.c +++ b/src/clock.c @@ -1,24 +1,30 @@ -/* - * Part of TinyG project - * - * Copyright (c) 2010 - 2013 Alden S. Hart Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "clock.h" @@ -68,7 +74,7 @@ void clock_init() { } /****************************************************************************** - * The following code was excerpted from the Atmel AVR1003 clock driver example + * The following code was excerpted from the Atmel AVR1003 clock driver example * and carries its copyright: * * $Revision: 2771 $ @@ -163,4 +169,3 @@ asm volatile( AVR_LEAVE_CRITICAL_REGION(); #endif } - diff --git a/src/clock.h b/src/clock.h index 818bd26..02fd34d 100644 --- a/src/clock.h +++ b/src/clock.h @@ -1,24 +1,30 @@ -/* - * Part of TinyG project - * - * Copyright (c) 2010 - 2013 Alden S. Hart Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once @@ -27,5 +33,3 @@ void clock_init(); void CCPWrite(volatile uint8_t *address, uint8_t value); - - diff --git a/src/command.c b/src/command.c index 0742043..1fd22ca 100644 --- a/src/command.c +++ b/src/command.c @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ diff --git a/src/command.def b/src/command.def index cdf9677..fc5e06d 100644 --- a/src/command.def +++ b/src/command.def @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ diff --git a/src/command.h b/src/command.h index 37594c3..e23c7f3 100644 --- a/src/command.h +++ b/src/command.h @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ diff --git a/src/config.h b/src/config.h index f712ab8..b9ca7c0 100644 --- a/src/config.h +++ b/src/config.h @@ -1,3 +1,30 @@ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ + #pragma once #include @@ -28,7 +55,6 @@ #define M1_MICROSTEPS MOTOR_MICROSTEPS #define M1_POLARITY MOTOR_POLARITY_NORMAL #define M1_POWER_MODE MOTOR_POWER_MODE -#define M1_POWER_LEVEL MOTOR_POWER_LEVEL #define M2_MOTOR_MAP AXIS_Y #define M2_STEP_ANGLE 1.8 @@ -36,7 +62,6 @@ #define M2_MICROSTEPS MOTOR_MICROSTEPS #define M2_POLARITY MOTOR_POLARITY_NORMAL #define M2_POWER_MODE MOTOR_POWER_MODE -#define M2_POWER_LEVEL MOTOR_POWER_LEVEL #define M3_MOTOR_MAP AXIS_A #define M3_STEP_ANGLE 1.8 @@ -44,7 +69,6 @@ #define M3_MICROSTEPS MOTOR_MICROSTEPS #define M3_POLARITY MOTOR_POLARITY_NORMAL #define M3_POWER_MODE MOTOR_POWER_MODE -#define M3_POWER_LEVEL MOTOR_POWER_LEVEL #define M4_MOTOR_MAP AXIS_Z #define M4_STEP_ANGLE 1.8 @@ -52,7 +76,6 @@ #define M4_MICROSTEPS MOTOR_MICROSTEPS #define M4_POLARITY MOTOR_POLARITY_NORMAL #define M4_POWER_MODE MOTOR_POWER_MODE -#define M4_POWER_LEVEL MOTOR_POWER_LEVEL // Switch settings. See switch.h @@ -71,17 +94,13 @@ #define C_SWITCH_MODE_MAX SW_MODE_DISABLED -// Jog settings -#define JOG_ACCELERATION 50000 // mm/min^2 - - // Machine settings #define CHORDAL_TOLERANCE 0.01 // chordal accuracy for arc drawing #define SOFT_LIMIT_ENABLE 0 // 0 = off, 1 = on -#define JERK_MAX 40 // yes, that's "20,000,000" mm/min^3 +#define JERK_MAX 40 // yes, that's km/min^3 #define JUNCTION_DEVIATION 0.05 // default value, in mm #define JUNCTION_ACCELERATION 100000 // centripetal corner acceleration - +#define JOG_ACCELERATION 500000 // mm/min^2 // Axis settings #define VELOCITY_MAX 16000 diff --git a/src/controller.c b/src/controller.c index 332dc3c..514827a 100644 --- a/src/controller.c +++ b/src/controller.c @@ -1,36 +1,31 @@ -/* - * controller.c - tinyg controller and top level parser - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2013 - 2015 Robert Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "controller.h" diff --git a/src/controller.h b/src/controller.h index 0c8bfa9..316f880 100644 --- a/src/controller.h +++ b/src/controller.h @@ -1,36 +1,32 @@ -/* - * controller.h - tinyg controller and main dispatch loop - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2014 Alden S. Hart, Jr. - * Copyright (c) 2013 - 2014 Robert Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ + #pragma once @@ -52,5 +48,3 @@ extern controller_t cs; // controller state structure void controller_init(); void controller_run(); - - diff --git a/src/cpp_magic.h b/src/cpp_magic.h index 8402486..c7abc59 100644 --- a/src/cpp_magic.h +++ b/src/cpp_magic.h @@ -1,5 +1,33 @@ -/** - * This header file contains a library of advanced C Pre-Processor (CPP) macros +/******************************************************************************\ + + This file is part of the uSHET library. + See https://github.com/18sg/uSHET + + Copyright (c) 2014 Thomas Nixon, Jonathan Heathcote + All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +\******************************************************************************/ + +/* This header file contains a library of advanced C Pre-Processor (CPP) macros * which implement various useful functions, such as iteration, in the * pre-processor. * @@ -91,9 +119,7 @@ #define EVAL1(...) __VA_ARGS__ -/** - * Macros which expand to common values - */ +// Macros which expand to common values #define PASS(...) __VA_ARGS__ #define EMPTY() #define COMMA() , diff --git a/src/cycle_homing.c b/src/cycle_homing.c index 18c403b..9adca0f 100644 --- a/src/cycle_homing.c +++ b/src/cycle_homing.c @@ -1,35 +1,30 @@ -/* - * cycle_homing.c - homing cycle extension to canonical_machine - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "canonical_machine.h" #include "switch.h" @@ -106,7 +101,9 @@ static int8_t _get_next_axis(int8_t axis); // G28.2 homing cycle /* Homing works from a G28.2 according to the following writeup: - * https://github.com/synthetos/TinyG/wiki/TinyG-Homing-(version-0.95-and-above) + * + * https://github.com/synthetos + * /TinyG/wiki/Homing-and-Limits-Description-and-Operation * * How does this work? * diff --git a/src/cycle_probing.c b/src/cycle_probing.c index 3544c49..618a1de 100644 --- a/src/cycle_probing.c +++ b/src/cycle_probing.c @@ -1,34 +1,30 @@ -/* cycle_probing.c - probing cycle extension to canonical_machine.c - * Part of TinyG project - * - * Copyright (c) 2010 - 2015 Alden S Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "canonical_machine.h" #include "spindle.h" diff --git a/src/encoder.c b/src/encoder.c index eca8b59..8ba3fb3 100644 --- a/src/encoder.c +++ b/src/encoder.c @@ -1,35 +1,30 @@ -/* - * encoder.c - encoder interface - * This file is part of the TinyG project - * - * Copyright (c) 2013 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2013 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "encoder.h" diff --git a/src/encoder.h b/src/encoder.h index 5be1bc5..0490ef4 100644 --- a/src/encoder.h +++ b/src/encoder.h @@ -1,38 +1,32 @@ -/* - * encoder.h - encoder interface - * This file is part of TinyG project - * - * Copyright (c) 2013 - 2014 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. -/* - * Encoders + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ + +/* Encoders * * Calling this file "encoders" is kind of a lie, at least for * now. There are no encoders. Instead the steppers count steps to @@ -71,9 +65,8 @@ * somewhere. Targets are propagated downward to the planner runtime * (the EXEC), but the exec will have moved on to moveB by the time we * need it. So moveA's target needs to be saved somewhere. - */ - -/* Error correction + * + * Error correction * * The purpose of this module is to calculate an error term between * the programmed position (target) and the actual measured position @@ -82,8 +75,8 @@ * errors. It's also the basis of closed-loop (servoed) systems. * * Positional error occurs due to floating point numerical - * inaccuracies. TinyG uses 32 bit floating point (GCC 32 bit, which - * is NOT IEEE 32 bit). Errors creep in during planning, move + * inaccuracies. This code uses 32 bit floating point (GCC 32 bit, + * which is NOT IEEE 32 bit). Errors creep in during planning, move * execution, and stepper output phases. Care has been taken to * minimize introducing errors throughout the process, but they still * occur. In most cases errors are not noticeable as they fall below @@ -132,5 +125,3 @@ extern enEncoder_t en[MOTORS]; void encoder_init(); void en_set_encoder_steps(uint8_t motor, float steps); float en_read_encoder(uint8_t motor); - - diff --git a/src/gcode_parser.c b/src/gcode_parser.c index ec69215..40c9eee 100644 --- a/src/gcode_parser.c +++ b/src/gcode_parser.c @@ -1,25 +1,30 @@ -/* - * gcode_parser.c - rs274/ngc Gcode parser - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "gcode_parser.h" diff --git a/src/gcode_parser.h b/src/gcode_parser.h index ab647da..2a7184d 100644 --- a/src/gcode_parser.h +++ b/src/gcode_parser.h @@ -1,25 +1,30 @@ -/* - * gcode_parser.h - rs274/ngc Gcode parser - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2014 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once @@ -27,5 +32,3 @@ #include "status.h" stat_t gc_gcode_parser(char *block); - - diff --git a/src/gpio.c b/src/gpio.c index 06a1c83..4fd46b1 100644 --- a/src/gpio.c +++ b/src/gpio.c @@ -1,38 +1,32 @@ -/* - * gpio.c - general purpose IO bits - * Part of TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ -/* - * This GPIO file is where all parallel port bits are managed that are +/* This GPIO file is where all parallel port bits are managed that are * not already taken up by steppers, serial ports, SPI or PDI programming * * There are 2 GPIO ports: diff --git a/src/gpio.h b/src/gpio.h index 221e8fa..5f48d5b 100644 --- a/src/gpio.h +++ b/src/gpio.h @@ -1,35 +1,30 @@ -/* - * gpio.c - general purpose IO bits - including limit switches, inputs, outputs - * Part of TinyG project - * - * Copyright (c) 2010 - 2014 Alden S. Hart Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once @@ -50,5 +45,3 @@ uint8_t gpio_read_bit(uint8_t b); void gpio_set_bit_on(uint8_t b); void gpio_set_bit_off(uint8_t b); void gpio_set_bit_toggle(uint8_t b); - - diff --git a/src/hardware.c b/src/hardware.c index fd1ea15..1a8f8d1 100644 --- a/src/hardware.c +++ b/src/hardware.c @@ -1,35 +1,30 @@ -/* - * hardware.c - general hardware support functions - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "hardware.h" #include "switch.h" diff --git a/src/hardware.h b/src/hardware.h index 5251016..4e40e4a 100644 --- a/src/hardware.h +++ b/src/hardware.h @@ -1,38 +1,31 @@ -/* - * hardware.h - system hardware configuration - * This file is hardware platform specific - AVR Xmega version - * - * This file is part of the TinyG project - * - * Copyright (c) 2013 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2013 - 2015 Robert Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once diff --git a/src/main.c b/src/main.c index 782da0d..8ef03ee 100644 --- a/src/main.c +++ b/src/main.c @@ -1,26 +1,31 @@ -/* - * main.c - TinyG - An embedded rs274/ngc CNC controller - * This file is part of the TinyG project. - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2013 - 2015 Robert Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2013 - 2015 Robert Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "hardware.h" #include "controller.h" @@ -70,7 +75,7 @@ static void init() { sei(); // enable global interrupts - fprintf_P(stderr, PSTR("TinyG firmware\n")); + fprintf_P(stderr, PSTR("Buildbotics firmware\n")); } diff --git a/src/messages.def b/src/messages.def index db6a9fa..fcb5585 100644 --- a/src/messages.def +++ b/src/messages.def @@ -1,3 +1,30 @@ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ + // Must keep these aligned with defs in status.h MSG(00, "OK") @@ -217,7 +244,7 @@ MSG(197, "197") MSG(198, "198") MSG(199, "199") -MSG(200, "Generic TinyG error") +MSG(200, "Generic firmware error") MSG(201, "Move less than minimum length") MSG(202, "Move less than minimum time") MSG(203, "Machine is alarmed - Command not processed") diff --git a/src/plan/arc.c b/src/plan/arc.c index 2200373..e6a4d43 100644 --- a/src/plan/arc.c +++ b/src/plan/arc.c @@ -1,25 +1,30 @@ -/* - * arc.c - arc planning and motion execution - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ /* This module actually contains some parts that belong ion the * canonical machine, and other parts that belong at the motion planner diff --git a/src/plan/arc.h b/src/plan/arc.h index 79658d2..8d29426 100644 --- a/src/plan/arc.h +++ b/src/plan/arc.h @@ -1,25 +1,30 @@ -/* - * arc.h - arc planning and motion execution - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once @@ -72,5 +77,3 @@ extern arc_t arc; void cm_arc_init(); stat_t cm_arc_callback(); void cm_abort_arc(); - - diff --git a/src/plan/buffer.c b/src/plan/buffer.c index ee6a02a..4dfb4b5 100644 --- a/src/plan/buffer.c +++ b/src/plan/buffer.c @@ -1,35 +1,31 @@ -/* - * buffer.c - Planner buffers - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2012 - 2015 Rob Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ /* Planner buffers are used to queue and operate on Gcode blocks. Each * buffer contains one Gcode block which may be a move, and M code, or diff --git a/src/plan/command.c b/src/plan/command.c index 1815a3b..3cee846 100644 --- a/src/plan/command.c +++ b/src/plan/command.c @@ -1,35 +1,31 @@ -/* - * command.c - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2012 - 2015 Rob Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ /* How this works: * - The command is called by the Gcode interpreter (cm_, e.g. an M diff --git a/src/plan/dwell.c b/src/plan/dwell.c index 855848f..df28f67 100644 --- a/src/plan/dwell.c +++ b/src/plan/dwell.c @@ -1,35 +1,31 @@ -/* - * dwell.c - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2012 - 2015 Rob Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "planner.h" #include "canonical_machine.h" diff --git a/src/plan/exec.c b/src/plan/exec.c index e234217..df94390 100644 --- a/src/plan/exec.c +++ b/src/plan/exec.c @@ -1,36 +1,31 @@ -/* - * exec.c - execution function for acceleration managed lines - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2012 - 2015 Rob Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "planner.h" #include "kinematics.h" diff --git a/src/plan/feedhold.c b/src/plan/feedhold.c index 2af8cf4..d95d8d6 100644 --- a/src/plan/feedhold.c +++ b/src/plan/feedhold.c @@ -1,35 +1,31 @@ -/* - * feedhold.c - functions for performing holds - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2012 - 2015 Rob Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTIN OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "planner.h" #include "stepper.h" diff --git a/src/plan/jog.c b/src/plan/jog.c index f3658a1..91d6b7c 100644 --- a/src/plan/jog.c +++ b/src/plan/jog.c @@ -1,3 +1,30 @@ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ + #include "jog.h" #include "planner.h" #include "stepper.h" diff --git a/src/plan/jog.h b/src/plan/jog.h index 784f537..f71cee9 100644 --- a/src/plan/jog.h +++ b/src/plan/jog.h @@ -1,3 +1,30 @@ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ + #pragma once #include "config.h" diff --git a/src/plan/kinematics.c b/src/plan/kinematics.c index ff7c375..040a7d4 100644 --- a/src/plan/kinematics.c +++ b/src/plan/kinematics.c @@ -1,35 +1,30 @@ -/* - * kinematics.c - inverse kinematics routines - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "kinematics.h" @@ -66,4 +61,3 @@ void ik_kinematics(const float travel[], float steps[]) { else steps[motor] = travel[axis] * st_cfg.mot[motor].steps_per_unit; } } - diff --git a/src/plan/kinematics.h b/src/plan/kinematics.h index 69e17d2..0c0df0f 100644 --- a/src/plan/kinematics.h +++ b/src/plan/kinematics.h @@ -1,39 +1,32 @@ -/* - * kinematics.h - inverse kinematics routines - * This file is part of the TinyG project - * - * Copyright (c) 2013 - 2014 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ -#pragma once + This file is part of the Buildbotics firmware. + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. -void ik_kinematics(const float travel[], float steps[]); + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" +\******************************************************************************/ +#pragma once + + +void ik_kinematics(const float travel[], float steps[]); diff --git a/src/plan/line.c b/src/plan/line.c index 4995656..9b77bd3 100644 --- a/src/plan/line.c +++ b/src/plan/line.c @@ -1,36 +1,31 @@ -/* - * line.c - acceleration managed line planning and motion execution - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2012 - 2015 Rob Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "planner.h" @@ -70,7 +65,7 @@ * turn. The wider it is, the faster through the corner it can go. * * (Note 1: "max_jerk" refers to the old grbl/marlin max_jerk" - * approximation term, not the tinyG jerk terms) + * approximation term, not the TinyG jerk terms) * * If you do the geometry in terms of the known variables, you get: * sin(theta/2) = R/(R+delta) diff --git a/src/plan/planner.c b/src/plan/planner.c index 4cf39a0..8423833 100644 --- a/src/plan/planner.c +++ b/src/plan/planner.c @@ -1,36 +1,31 @@ -/* - * planner.c - Cartesian trajectory planning and motion execution - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2012 - 2015 Rob Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ /* Planner Notes * diff --git a/src/plan/planner.h b/src/plan/planner.h index 0099717..8451f70 100644 --- a/src/plan/planner.h +++ b/src/plan/planner.h @@ -1,36 +1,31 @@ -/* - * planner.h - cartesian trajectory planning and motion execution - * This file is part of the TinyG project - * - * Copyright (c) 2013 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2013 - 2015 Robert Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2013 - 2015 Alden S. Hart, Jr. + Copyright (c) 2013 - 2015 Robert Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once diff --git a/src/plan/zoid.c b/src/plan/zoid.c index a50099f..99ff142 100644 --- a/src/plan/zoid.c +++ b/src/plan/zoid.c @@ -1,37 +1,31 @@ -/* - * zoid.c - acceleration managed line planning and motion execution - - * trapezoid planner. - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2012 - 2015 Rob Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "planner.h" #include "util.h" @@ -433,11 +427,11 @@ float mp_get_target_length(const float Vi, const float Vf, const mpBuf_t *bf) { * * Or * J from L, Vi, and Vf - * J = ((Vf - Vi) (Vi + Vf)²) / L² + * J = ((Vf - Vi) (Vi + Vf)^2) / L^2 * * Replacing Vf with x, and subtracting the known J: - * 0 = ((x - Vi) (Vi + x)²) / L² - J - * Z(x) = ((x - Vi) (Vi + x)²) / L² - J + * 0 = ((x - Vi) (Vi + x)^2) / L^2 - J + * Z(x) = ((x - Vi) (Vi + x)^2) / L^2 - J * * L doesn't resolve to the value very quickly (it graphs near-vertical). * So, we'll use J, which resolves in < 10 iterations, often in only two or @@ -451,7 +445,7 @@ float mp_get_target_length(const float Vi, const float Vf, const mpBuf_t *bf) { * SqrtDeltaOverJ = sqrt((x - Vi) / J) * L'(x) = SqrtDeltaOverJ + (Vi + x) / (2*J) + (Vi + x) / (2 * SqrtDeltaJ) * - * J'(x) = (2 * Vi * x - Vi² + 3 * x²) / L² + * J'(x) = (2 * Vi * x - Vi^2 + 3 * x^2) / L^2 */ #define GET_VELOCITY_ITERATIONS 0 // must be 0, 1, or 2 diff --git a/src/pwm.c b/src/pwm.c index 3a70e53..58ca111 100644 --- a/src/pwm.c +++ b/src/pwm.c @@ -1,35 +1,30 @@ -/* - * pwm.c - pulse width modulation drivers - * This file is part of the TinyG project - * - * Copyright (c) 2012 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2012 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "pwm.h" diff --git a/src/pwm.h b/src/pwm.h index 4c24640..00119b3 100644 --- a/src/pwm.h +++ b/src/pwm.h @@ -1,35 +1,30 @@ -/* - * pwm.h - pulse width modulation drivers - * This file is part of the TinyG project - * - * Copyright (c) 2012 - 2014 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once @@ -75,5 +70,3 @@ extern pwmSingleton_t pwm; void pwm_init(); stat_t pwm_set_freq(uint8_t channel, float freq); stat_t pwm_set_duty(uint8_t channel, float duty); - - diff --git a/src/report.c b/src/report.c index 42b0f23..c49bd83 100644 --- a/src/report.c +++ b/src/report.c @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ diff --git a/src/report.h b/src/report.h index df66057..f42c963 100644 --- a/src/report.h +++ b/src/report.h @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ @@ -38,5 +34,3 @@ void report_init(); void report_request(); void report_request_full(); stat_t report_callback(); - - diff --git a/src/ringbuf.def b/src/ringbuf.def index b99cc5f..eff59c9 100644 --- a/src/ringbuf.def +++ b/src/ringbuf.def @@ -1,40 +1,54 @@ /******************************************************************************\ - Siren Operated Sensor Firmware - Version IX - - Joseph Coffland - Cauldron Development LLC - - November, 2013 - February 2014 + This file is part of the Buildbotics firmware. -\******************************************************************************/ - -/* - This file defines an X-Macro ring buffer. It can be used like this: + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - #define RING_BUF_NAME tx_buf - #define RING_BUF_SIZE 256 - #include "ringbuf.def" + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - This will define the following functions: + The software 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 + Lesser General Public License for more details. - void _init(); - int _empty(); - int _full(); - _peek(); - void _pop(); - void _push( data); + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . - Where is defined by RING_BUF_NAME and by RING_BUF_TYPE. - RING_BUF_SIZE defines the length of the ring buffer and must be a power of 2. + For information regarding this software email: + "Joseph Coffland" - The data type and index type both default to uint8_t but can be changed by - defining RING_BUF_TYPE and RING_BUF_INDEX_TYPE respectively. +\******************************************************************************/ - By default these functions are declared static inline but this can be changed - by defining RING_BUF_FUNC. -*/ +/* This file defines an X-Macro ring buffer. It can be used like this: + * + * #define RING_BUF_NAME tx_buf + * #define RING_BUF_SIZE 256 + * #include "ringbuf.def" + * + * This will define the following functions: + * + * void _init(); + * int _empty(); + * int _full(); + * _peek(); + * void _pop(); + * void _push( data); + * + * Where is defined by RING_BUF_NAME and by RING_BUF_TYPE. + * RING_BUF_SIZE defines the length of the ring buffer and must be a power of 2. + * + * The data type and index type both default to uint8_t but can be changed by + * defining RING_BUF_TYPE and RING_BUF_INDEX_TYPE respectively. + * + * By default these functions are declared static inline but this can be changed + * by defining RING_BUF_FUNC. + */ #include diff --git a/src/rtc.c b/src/rtc.c index 63db2a9..03626f3 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -1,25 +1,30 @@ -/* - * rtc.h - real-time counter/clock - * Part of TinyG project - * - * Copyright (c) 2010 - 2013 Alden S. Hart Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2013 Alden S. Hart Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "rtc.h" diff --git a/src/rtc.h b/src/rtc.h index f042cc5..8e41f79 100644 --- a/src/rtc.h +++ b/src/rtc.h @@ -1,25 +1,30 @@ -/* - * rtc.h - general purpose real-time clock - * Part of TinyG project - * - * Copyright (c) 2010 - 2013 Alden S. Hart Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2013 Alden S. Hart Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once @@ -42,5 +47,3 @@ extern rtClock_t rtc; void rtc_init(); // initialize and start general timer uint32_t rtc_get_time(); - - diff --git a/src/spindle.c b/src/spindle.c index cb76b8f..607afa5 100644 --- a/src/spindle.c +++ b/src/spindle.c @@ -1,35 +1,30 @@ -/* - * spindle.c - canonical machine spindle driver - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "spindle.h" diff --git a/src/spindle.h b/src/spindle.h index a6b2125..188b34c 100644 --- a/src/spindle.h +++ b/src/spindle.h @@ -1,35 +1,30 @@ -/* - * spindle.h - spindle driver - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2014 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once @@ -43,5 +38,3 @@ void cm_exec_spindle_speed(float speed); // callback for above stat_t cm_spindle_control(uint8_t spindle_mode); // M3, M4, M5 void cm_exec_spindle_control(uint8_t spindle_mode); // callback for above - - diff --git a/src/status.c b/src/status.c index 2f3efcb..769b2ec 100644 --- a/src/status.c +++ b/src/status.c @@ -1,26 +1,31 @@ -/* - * status.c - TinyG - An embedded rs274/ngc CNC controller - * This file is part of the TinyG project. - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2013 - 2015 Robert Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2013 - 2015 Robert Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #include "status.h" diff --git a/src/status.h b/src/status.h index 95c6444..9203c8a 100644 --- a/src/status.h +++ b/src/status.h @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ @@ -46,9 +42,9 @@ * 20 - 99 Generic internal and application errors. Internal errors start at * 20 and work up, Assertion failures start at 99 and work down. * - * 100 - 129 Generic data and input errors - not specific to Gcode or TinyG + * 100 - 129 Generic data and input errors - not specific to Gcode * - * 130 - Gcode and TinyG application errors and warnings + * 130 - Gcode and application errors and warnings * * See main.c for associated message strings. Any changes to the codes may also * require changing the message strings and string array in main.c @@ -147,17 +143,17 @@ void print_status_message(const char *msg, stat_t status); #define STAT_GCODE_MODAL_GROUP_VIOLATION 133 #define STAT_GCODE_AXIS_IS_MISSING 134 #define STAT_GCODE_AXIS_CANNOT_BE_PRESENT 135 -#define STAT_GCODE_AXIS_IS_INVALID 136 -#define STAT_GCODE_AXIS_IS_NOT_CONFIGURED 137 -#define STAT_GCODE_AXIS_NUMBER_IS_MISSING 138 -#define STAT_GCODE_AXIS_NUMBER_IS_INVALID 139 - -#define STAT_GCODE_ACTIVE_PLANE_IS_MISSING 140 -#define STAT_GCODE_ACTIVE_PLANE_IS_INVALID 141 -#define STAT_GCODE_FEEDRATE_NOT_SPECIFIED 142 -#define STAT_GCODE_INVERSE_TIME_MODE_CANNOT_BE_USED 143 -#define STAT_GCODE_ROTARY_AXIS_CANNOT_BE_USED 144 -#define STAT_GCODE_G53_WITHOUT_G0_OR_G1 145 +#define STAT_GCODE_AXIS_IS_INVALID 136 +#define STAT_GCODE_AXIS_IS_NOT_CONFIGURED 137 +#define STAT_GCODE_AXIS_NUMBER_IS_MISSING 138 +#define STAT_GCODE_AXIS_NUMBER_IS_INVALID 139 + +#define STAT_GCODE_ACTIVE_PLANE_IS_MISSING 140 +#define STAT_GCODE_ACTIVE_PLANE_IS_INVALID 141 +#define STAT_GCODE_FEEDRATE_NOT_SPECIFIED 142 +#define STAT_GCODE_INVERSE_TIME_MODE_CANNOT_BE_USED 143 +#define STAT_GCODE_ROTARY_AXIS_CANNOT_BE_USED 144 +#define STAT_GCODE_G53_WITHOUT_G0_OR_G1 145 #define STAT_REQUESTED_VELOCITY_EXCEEDS_LIMITS 146 #define STAT_CUTTER_COMPENSATION_CANNOT_BE_ENABLED 147 #define STAT_PROGRAMMED_POINT_SAME_AS_CURRENT_POINT 148 @@ -196,7 +192,7 @@ void print_status_message(const char *msg, stat_t status); #define STAT_T_WORD_IS_MISSING 178 #define STAT_T_WORD_IS_INVALID 179 -// TinyG errors and warnings +// Errors and warnings #define STAT_GENERIC_ERROR 200 #define STAT_MINIMUM_LENGTH_MOVE 201 // move is less than minimum length #define STAT_MINIMUM_TIME_MOVE 202 // move is less than minimum time @@ -230,5 +226,3 @@ void print_status_message(const char *msg, stat_t status); #define STAT_PROBE_ENDPOINT_IS_STARTING_POINT 251 // Do not exceed 255 without also changing stat_t typedef - - diff --git a/src/stepper.c b/src/stepper.c index 44260f7..ff14654 100644 --- a/src/stepper.c +++ b/src/stepper.c @@ -1,40 +1,34 @@ -/* - * stepper.c - stepper motor controls - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2013 - 2015 Robert Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ -/* This module provides the low-level stepper drivers and some related - * functions. See stepper.h for a detailed explanation of this module. - */ + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2013 - 2015 Robert Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ + +// This module provides the low-level stepper drivers and some related +// functions. See stepper.h for a detailed explanation of this module. #include "stepper.h" @@ -512,7 +506,7 @@ stat_t st_prep_line(float travel_steps[], float following_error[], } else pre_mot->timer_clock = TC_CLKSEL_DIV2_gc; } else pre_mot->timer_clock = TC_CLKSEL_DIV1_gc; - pre_mot->timer_period = ticks_per_step * 2; + pre_mot->timer_period = ticks_per_step * 2; // TODO why do we need *2 here? pre_mot->steps = seg_clocks / ticks_per_step; if (false && usart_tx_empty() && motor == 0) diff --git a/src/stepper.h b/src/stepper.h index 7551096..ddc7718 100644 --- a/src/stepper.h +++ b/src/stepper.h @@ -1,93 +1,83 @@ -/* - * stepper.h - stepper motor interface - * This file is part of TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * Copyright (c) 2013 - 2015 Robert Giseburt - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + Copyright (c) 2012 - 2015 Rob Giseburt + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ #pragma once -/* - * Coordinated motion (line drawing) is performed using a classic - * Bresenham DDA. A number of additional steps are taken to - * optimize interpolation and pulse train timing accuracy to - * minimize pulse jitter and make for very smooth motion and - * surface finish. +/* Coordinated motion (line drawing) is performed using a classic + * Bresenham DDA. A number of additional steps are taken to optimize + * interpolation and pulse train timing accuracy to minimize pulse + * jitter and make for very smooth motion and surface finish. * * - The DDA is not used as a 'ramp' for acceleration - * management. Accel is computed upstream in the motion planner - * as 3rd order (controlled jerk) equations. These generate - * accel/decel segments that are passed to the DDA for step - * output. - * - * - The DDA accepts and processes fractional motor steps as - * floating point numbers from the planner. Steps do not need - * to be whole numbers, and are not expected to be. The step - * values are converted to integer by multiplying by a - * fixed-point precision (DDA_SUBSTEPS, 100000). Rounding is - * performed to avoid a truncation bias. - * - * - Constant Rate DDA clock: The DDA runs at a constant, maximum - * rate for every segment regardless of actual step rate - * required. This means that the DDA clock is not tuned to the - * step rate (or a multiple) of the major axis, as is typical - * for most DDAs. Running the DDA flat out might appear to be - * "wasteful", but it ensures that the best aliasing results - * are achieved, and is part of maintaining step accuracy - * across motion segments. - * - * The observation is that TinyG is a hard real-time system in - * which every clock cycle is knowable and can be accounted - * for. So if the system is capable of sustaining max pulse - * rate for the fastest move, it's capable of sustaining this - * rate for any move. So we just run it flat out and get the - * best pulse resolution for all moves. If we were running - * from batteries or otherwise cared about the energy budget we - * might not be so cavalier about this. - * - * At 50 KHz constant clock rate we have 20 uSec between pulse - * timer (DDA) interrupts. On the Xmega we consume <10 uSec in - * the interrupt - a whopping 50% of available cycles going - * into pulse generation. - * - * - Pulse timing is also helped by minimizing the time spent - * loading the next move segment. The time budget for the load - * is less than the time remaining before the next DDA clock - * tick. This means that the load must take < 10 uSec or the - * time between pulses will stretch out when changing - * segments. This does not affect positional accuracy but it - * would affect jitter and smoothness. To this end as much as - * possible about that move is pre-computed during move - * execution (prep cycles). Also, all moves are loaded from - * the DDA interrupt level (HI), avoiding the need for mutual + * management. Accel is computed upstream in the motion planner as + * 3rd order (controlled jerk) equations. These generate accel/decel + * segments that are passed to the DDA for step output. + * + * - The DDA accepts and processes fractional motor steps as floating + * point numbers from the planner. Steps do not need to be whole + * numbers, and are not expected to be. The step values are + * converted to integer by multiplying by a fixed-point precision + * (DDA_SUBSTEPS, 100000). Rounding is performed to avoid a + * truncation bias. + * + * - Constant Rate DDA clock: The DDA runs at a constant, maximum rate + * for every segment regardless of actual step rate required. This + * means that the DDA clock is not tuned to the step rate (or a + * multiple) of the major axis, as is typical for most DDAs. Running + * the DDA flat out might appear to be "wasteful", but it ensures + * that the best aliasing results are achieved, and is part of + * maintaining step accuracy across motion segments. + * + * The observation is this firmware is a hard real-time system in + * which every clock cycle is knowable and can be accounted for. So + * if the system is capable of sustaining max pulse rate for the + * fastest move, it's capable of sustaining this rate for any + * move. So we just run it flat out and get the best pulse + * resolution for all moves. If we were running from batteries or + * otherwise cared about the energy budget we might not be so + * cavalier about this. + * + * At 50 KHz constant clock rate we have 20 uSec between pulse timer + * (DDA) interrupts. On the Xmega we consume <10 uSec in the + * interrupt - a whopping 50% of available cycles going into pulse + * generation. + * + * - Pulse timing is also helped by minimizing the time spent loading + * the next move segment. The time budget for the load is less than + * the time remaining before the next DDA clock tick. This means + * that the load must take < 10 uSec or the time between pulses will + * stretch out when changing segments. This does not affect + * positional accuracy but it would affect jitter and smoothness. To + * this end as much as possible about that move is pre-computed + * during move execution (prep cycles). Also, all moves are loaded + * from the DDA interrupt level (HI), avoiding the need for mutual * exclusion locking or volatiles (which slow things down). */ diff --git a/src/switch.c b/src/switch.c index d0eb517..fd8a18d 100644 --- a/src/switch.c +++ b/src/switch.c @@ -1,35 +1,30 @@ -/* - * switch.c - switch handling functions - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ /* Switch Modes * @@ -62,8 +57,6 @@ #include -static void _switch_isr_helper(uint8_t sw_num); - /* Initialize homing/limit switches * * This function assumes sys_init() and st_init() have been run previously to @@ -78,7 +71,7 @@ void switch_init() { if (sw.mode[MIN_SWITCH(i)] != SW_MODE_DISABLED) { // set min input - see 13.14.14 hw.sw_port[i]->DIRCLR = SW_MIN_BIT_bm; - hw.sw_port[i]->PIN6CTRL = (PIN_MODE | PORT_ISC_BOTHEDGES_gc); + hw.sw_port[i]->PIN6CTRL = PIN_MODE | PORT_ISC_BOTHEDGES_gc; // interrupt on min switch hw.sw_port[i]->INT0MASK = SW_MIN_BIT_bm; @@ -87,7 +80,7 @@ void switch_init() { if (sw.mode[MAX_SWITCH(i)] != SW_MODE_DISABLED) { // set max input - see 13.14.14 hw.sw_port[i]->DIRCLR = SW_MAX_BIT_bm; - hw.sw_port[i]->PIN7CTRL = (PIN_MODE | PORT_ISC_BOTHEDGES_gc); + hw.sw_port[i]->PIN7CTRL = PIN_MODE | PORT_ISC_BOTHEDGES_gc; hw.sw_port[i]->INT1MASK = SW_MAX_BIT_bm; // max on INT1 } else hw.sw_port[i]->INT1MASK = 0; @@ -111,8 +104,7 @@ void switch_init() { } -/* - * These functions interact with each other to process switch closures +/* These functions interact with each other to process switch closures * and firing. Each switch has a counter which is initially set to * negative SW_DEGLITCH_TICKS. When a switch closure is DETECTED the * count increments for each RTC tick. When the count reaches zero @@ -120,17 +112,6 @@ void switch_init() { * increment positive until the lockout is exceeded. */ -// Switch interrupt handler vectors -ISR(X_MIN_ISR_vect) {_switch_isr_helper(SW_MIN_X);} -ISR(Y_MIN_ISR_vect) {_switch_isr_helper(SW_MIN_Y);} -ISR(Z_MIN_ISR_vect) {_switch_isr_helper(SW_MIN_Z);} -ISR(A_MIN_ISR_vect) {_switch_isr_helper(SW_MIN_A);} -ISR(X_MAX_ISR_vect) {_switch_isr_helper(SW_MAX_X);} -ISR(Y_MAX_ISR_vect) {_switch_isr_helper(SW_MAX_Y);} -ISR(Z_MAX_ISR_vect) {_switch_isr_helper(SW_MAX_Z);} -ISR(A_MAX_ISR_vect) {_switch_isr_helper(SW_MAX_A);} - - static void _switch_isr_helper(uint8_t sw_num) { if (sw.mode[sw_num] == SW_MODE_DISABLED) return; // never supposed to happen if (sw.debounce[sw_num] == SW_LOCKOUT) return; // switch is in lockout @@ -145,6 +126,17 @@ static void _switch_isr_helper(uint8_t sw_num) { } +// Switch interrupt handler vectors +ISR(X_MIN_ISR_vect) {_switch_isr_helper(SW_MIN_X);} +ISR(Y_MIN_ISR_vect) {_switch_isr_helper(SW_MIN_Y);} +ISR(Z_MIN_ISR_vect) {_switch_isr_helper(SW_MIN_Z);} +ISR(A_MIN_ISR_vect) {_switch_isr_helper(SW_MIN_A);} +ISR(X_MAX_ISR_vect) {_switch_isr_helper(SW_MAX_X);} +ISR(Y_MAX_ISR_vect) {_switch_isr_helper(SW_MAX_Y);} +ISR(Z_MAX_ISR_vect) {_switch_isr_helper(SW_MAX_Z);} +ISR(A_MAX_ISR_vect) {_switch_isr_helper(SW_MAX_A);} + + /// Called from RTC for each RTC tick void switch_rtc_callback() { for (uint8_t i = 0; i < NUM_SWITCHES; i++) { diff --git a/src/switch.h b/src/switch.h index 8fd98bd..1f4f7db 100644 --- a/src/switch.h +++ b/src/switch.h @@ -1,36 +1,32 @@ -/* - * switch.h - switch handling functions - * This file is part of the TinyG project - * - * Copyright (c) 2013 - 2014 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -/* Switch processing functions under Motate +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ + +/* Switch processing functions * * Switch processing turns pin transitions into reliable switch states. * There are 2 main operations: @@ -55,23 +51,25 @@ #define SW_DEGLITCH_TICKS 3 // 3=30ms // switch modes -#define SW_HOMING_BIT 1 -#define SW_LIMIT_BIT 2 -#define SW_MODE_DISABLED 0 // disabled for all operations +enum { + SW_MODE_DISABLED, + SW_HOMING_BIT, + SW_LIMIT_BIT +}; + #define SW_MODE_HOMING SW_HOMING_BIT // enable switch for homing only #define SW_MODE_LIMIT SW_LIMIT_BIT // enable switch for limits only #define SW_MODE_HOMING_LIMIT (SW_HOMING_BIT | SW_LIMIT_BIT) // homing & limits -#define SW_MODE_MAX_VALUE SW_MODE_HOMING_LIMIT enum swType { - SW_TYPE_NORMALLY_OPEN = 0, + SW_TYPE_NORMALLY_OPEN, SW_TYPE_NORMALLY_CLOSED }; enum swState { SW_DISABLED = -1, - SW_OPEN = 0, // also read as 'false' - SW_CLOSED // also read as 'true' + SW_OPEN, + SW_CLOSED }; // macros for finding the index into the switch table give the axis number @@ -79,13 +77,13 @@ enum swState { #define MAX_SWITCH(axis) (axis * 2 + 1) enum swDebounce { // state machine for managing debouncing and lockout - SW_IDLE = 0, + SW_IDLE, SW_DEGLITCHING, SW_LOCKOUT }; enum swNums { // indexes into switch arrays - SW_MIN_X = 0, + SW_MIN_X, SW_MAX_X, SW_MIN_Y, SW_MAX_Y, @@ -96,11 +94,11 @@ enum swNums { // indexes into switch arrays NUM_SWITCHES // must be last one. Used for array sizing and for loops }; #define SW_OFFSET SW_MAX_X // offset between MIN and MAX switches -#define NUM_SWITCH_PAIRS (NUM_SWITCHES/2) +#define NUM_SWITCH_PAIRS (NUM_SWITCHES / 2) /// Interrupt levels and vectors - The vectors are hard-wired to xmega ports /// If you change axis port assignments you need to change these, too. -#define GPIO1_INTLVL (PORT_INT0LVL_MED_gc|PORT_INT1LVL_MED_gc) +#define GPIO1_INTLVL (PORT_INT0LVL_MED_gc | PORT_INT1LVL_MED_gc) // port assignments for vectors #define X_MIN_ISR_vect PORTA_INT0_vect @@ -112,10 +110,9 @@ enum swNums { // indexes into switch arrays #define Z_MAX_ISR_vect PORTE_INT1_vect #define A_MAX_ISR_vect PORTF_INT1_vect -/* - * Switch control structures - // Note 1: The term "thrown" is used because switches could be normally-open - // or normally-closed. "Thrown" means activated or hit. +/* Switch control structures + * Note 1: The term "thrown" is used because switches could be normally-open + * or normally-closed. "Thrown" means activated or hit. */ struct swStruct { // switch state uint8_t switch_type; // 0=NO, 1=NC - applies to all switches diff --git a/src/tmc2660.c b/src/tmc2660.c index f537b4f..8930073 100644 --- a/src/tmc2660.c +++ b/src/tmc2660.c @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ diff --git a/src/tmc2660.h b/src/tmc2660.h index 5460dd7..ef8605d 100644 --- a/src/tmc2660.h +++ b/src/tmc2660.h @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ diff --git a/src/usart.c b/src/usart.c index 502db7b..9633d5a 100644 --- a/src/usart.c +++ b/src/usart.c @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015-2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ diff --git a/src/usart.h b/src/usart.h index 58fb994..bbe8bc8 100644 --- a/src/usart.h +++ b/src/usart.h @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2015-2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ @@ -75,5 +71,3 @@ int16_t usart_tx_fill(); int16_t usart_tx_space(); inline int usart_tx_empty() {return !usart_tx_fill();} inline int usart_tx_full() {return !usart_tx_space();} - - diff --git a/src/util.c b/src/util.c index 4f883c3..ad4cea5 100644 --- a/src/util.c +++ b/src/util.c @@ -1,35 +1,30 @@ -/* - * util.c - a random assortment of useful functions - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2015 Alden S. Hart, Jr. + All rights reserved. + + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ /* util contains: * - math and min/max utilities and extensions diff --git a/src/util.h b/src/util.h index c6a7767..162ee25 100644 --- a/src/util.h +++ b/src/util.h @@ -1,42 +1,36 @@ -/* - * util.h - a random assortment of useful functions - * This file is part of the TinyG project - * - * Copyright (c) 2010 - 2014 Alden S. Hart, Jr. - * - * This file ("the software") is free software: you can redistribute - * it and/or modify it under the terms of the GNU General Public - * License, version 2 as published by the Free Software - * Foundation. You should have received a copy of the GNU General - * Public License, version 2 along with the software. If not, see - * . - * - * As a special exception, you may use this file as part of a software - * library without restriction. Specifically, if other files - * instantiate templates or use macros or inline functions from this - * file, or you compile this file and link it with other files to - * produce an executable, this file does not by itself cause the - * resulting executable to be covered by the GNU General Public - * License. This exception does not however invalidate any other - * reasons why the executable file might be covered by the GNU General - * Public License. - * - * THE SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT - * WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ +/******************************************************************************\ + + This file is part of the Buildbotics firmware. + + Copyright (c) 2015 - 2016 Buildbotics LLC + Copyright (c) 2010 - 2014 Alden S. Hart, Jr. + All rights reserved. -/* util.c/.h contains a dog's breakfast of supporting functions that are - * not specific to tinyg: including: + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . + + The software 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . + + For information regarding this software email: + "Joseph Coffland" + +\******************************************************************************/ + +/* Supporting functions including: * - * - math and min/max utilities and extensions - * - vector manipulation utilities - * - support for debugging routines + * - math and min/max utilities and extensions + * - vector manipulation utilities + * - support for debugging routines */ #pragma once @@ -129,5 +123,3 @@ uint16_t compute_checksum(char const *string, const uint16_t length); #ifndef M_SQRT3 #define M_SQRT3 (1.73205080756888) #endif - - diff --git a/src/vars.c b/src/vars.c index 65c0067..a839f6d 100644 --- a/src/vars.c +++ b/src/vars.c @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ diff --git a/src/vars.def b/src/vars.def index f797ae1..d9d6916 100644 --- a/src/vars.def +++ b/src/vars.def @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ diff --git a/src/vars.h b/src/vars.h index 9656a78..6ff8864 100644 --- a/src/vars.h +++ b/src/vars.h @@ -1,31 +1,27 @@ /******************************************************************************\ - This file is part of the TinyG firmware. + This file is part of the Buildbotics firmware. - Copyright (c) 2016, Buildbotics LLC - All rights reserved. + Copyright (c) 2015 - 2016 Buildbotics LLC + All rights reserved. - The C! library is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation, either version 2.1 of - the License, or (at your option) any later version. + This file ("the software") is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public License, + version 2 as published by the Free Software Foundation. You should + have received a copy of the GNU General Public License, version 2 + along with the software. If not, see . - The C! library 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 - Lesser General Public License for more details. + The software 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 + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the C! library. If not, see - . - - In addition, BSD licensing may be granted on a case by case basis - by written permission from at least one of the copyright holders. - You may request written permission by emailing the authors. + You should have received a copy of the GNU Lesser General Public + License along with the software. If not, see + . For information regarding this software email: - Joseph Coffland - joseph@buildbotics.com + "Joseph Coffland" \******************************************************************************/ -- 2.27.0