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/>.
10 #include "libs/Module.h"
19 class Endstops
: public Module
{
22 void on_module_loaded();
23 void on_gcode_received(void* argument
);
28 bool wait_for_homed();
29 bool wait_for_homed_corexy(int axis
);
30 void corexy_home(int home_axis
, bool dirx
, bool diry
, float fast_rate
, float slow_rate
, unsigned int retract_steps
);
32 void move_to_origin();
33 void on_get_public_data(void* argument
);
34 void on_set_public_data(void* argument
);
35 void on_idle(void *argument
);
36 bool debounced_get(int pin
);
37 void process_home_command(Gcode
* gcode
);
38 void set_homing_offset(Gcode
* gcode
);
39 uint32_t read_endstops(uint32_t dummy
);
41 float homing_position
[3];
43 float saved_position
[3]{0}; // save G28 (in grbl mode)
44 float alpha_max
, beta_max
, gamma_max
;
46 unsigned int debounce_count
;
52 std::array
<uint16_t, 3> debounce
;
54 std::bitset
<3> home_direction
;
55 std::bitset
<3> limit_enable
;
56 std::bitset
<3> axis_to_home
;
59 uint8_t homing_order
:6;
61 volatile char status
:3;
66 bool move_to_origin_after_home
:1;