/* limits.h - code pertaining to limit-switches and performing the homing cycle Part of Grbl Copyright (c) 2009-2011 Simen Svale Skogsrud Grbl is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Grbl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Grbl. If not, see . */ #include #include #include "stepper.h" #include "settings.h" #include "nuts_bolts.h" #include "config.h" void limits_init() { LIMIT_DDR &= ~(LIMIT_MASK); } static void homing_cycle(bool x_axis, bool y_axis, bool z_axis, bool reverse_direction, uint32_t microseconds_per_pulse) { // First home the Z axis uint32_t step_delay = microseconds_per_pulse - settings.pulse_microseconds; uint8_t out_bits = DIRECTION_MASK; uint8_t limit_bits; if (x_axis) { out_bits |= (1<