2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie 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.
4 Smoothie 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.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
8 #ifndef ENDSTOPS_MODULE_H
9 #define ENDSTOPS_MODULE_H
11 #include "libs/Module.h"
19 class Endstops
: public Module
{
22 void on_module_loaded();
23 void on_gcode_received(void* argument
);
24 void on_config_reload(void* argument
);
25 void acceleration_tick(void);
28 void home(char axes_to_move
);
29 void do_homing_cartesian(char axes_to_move
);
30 void do_homing_corexy(char axes_to_move
);
31 bool wait_for_homed(char axes_to_move
);
32 bool wait_for_homed_corexy(int axis
);
33 void corexy_home(int home_axis
, bool dirx
, bool diry
, float fast_rate
, float slow_rate
, unsigned int retract_steps
);
34 void back_off_home(char axes_to_move
);
35 void move_to_origin(char);
36 void on_get_public_data(void* argument
);
37 void on_set_public_data(void* argument
);
38 void on_idle(void *argument
);
39 bool debounced_get(int pin
);
40 void process_home_command(Gcode
* gcode
);
41 void set_homing_offset(Gcode
* gcode
);
43 float homing_position
[3];
46 std::bitset
<3> home_direction
;
47 std::bitset
<3> limit_enable
;
48 float saved_position
[3]{0}; // save G28 (in grbl mode)
50 unsigned int debounce_count
;
56 volatile float feed_rate
[3];
62 bool move_to_origin_after_home
:1;
64 volatile char status
:3;