Commit | Line | Data |
---|---|---|
201bcb94 AW |
1 | /* |
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/>. | |
6 | */ | |
7 | ||
8 | #ifndef ENDSTOPS_MODULE_H | |
9 | #define ENDSTOPS_MODULE_H | |
10 | ||
11 | #include "libs/Module.h" | |
12 | #include "libs/Kernel.h" | |
13 | #include "modules/communication/utils/Gcode.h" | |
14 | #include "libs/StepperMotor.h" | |
750277f8 | 15 | #include "libs/Pin.h" |
201bcb94 AW |
16 | |
17 | #define ALPHA_AXIS 0 | |
18 | #define BETA_AXIS 1 | |
19 | #define GAMMA_AXIS 2 | |
20 | ||
21 | #define NOT_HOMING 0 | |
22 | #define MOVING_TO_ORIGIN_FAST 1 | |
3b948656 | 23 | #define MOVING_BACK 2 |
9b0ac510 | 24 | #define MOVING_TO_ORIGIN_SLOW 3 |
201bcb94 | 25 | |
750277f8 AW |
26 | #define alpha_min_endstop_checksum 28684 |
27 | #define beta_min_endstop_checksum 23457 | |
28 | #define gamma_min_endstop_checksum 16137 | |
9b0ac510 AW |
29 | #define alpha_fast_homing_rate_checksum 19720 |
30 | #define beta_fast_homing_rate_checksum 9373 | |
31 | #define gamma_fast_homing_rate_checksum 3333 | |
32 | #define alpha_slow_homing_rate_checksum 45599 | |
33 | #define beta_slow_homing_rate_checksum 35252 | |
34 | #define gamma_slow_homing_rate_checksum 29212 | |
35 | #define alpha_homing_retract_checksum 4419 | |
36 | #define beta_homing_retract_checksum 48344 | |
37 | #define gamma_homing_retract_checksum 54848 | |
38 | ||
750277f8 | 39 | |
201bcb94 AW |
40 | class Endstops : public Module{ |
41 | public: | |
42 | Endstops(); | |
43 | void on_module_loaded(); | |
44 | void on_gcode_received(void* argument); | |
750277f8 | 45 | void on_config_reload(void* argument); |
201bcb94 AW |
46 | |
47 | StepperMotor* steppers[3]; | |
750277f8 | 48 | Pin* pins[3]; |
9b0ac510 AW |
49 | unsigned int slow_rates[3]; |
50 | unsigned int fast_rates[3]; | |
51 | unsigned int retract_steps[3]; | |
750277f8 | 52 | char status; |
201bcb94 AW |
53 | }; |
54 | ||
55 | ||
56 | ||
57 | ||
58 | ||
59 | ||
60 | ||
61 | ||
62 | ||
63 | ||
64 | ||
65 | ||
66 | ||
67 | ||
68 | ||
69 | ||
70 | ||
71 | #endif |