cleanup all libs/ headers and dependent files
[clinton/Smoothieware.git] / src / libs / StepTicker.h
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
9
10 #ifndef STEPTICKER_H
11 #define STEPTICKER_H
12
13 using namespace std;
14 #include <vector>
15 #include <stdint.h>
16
17 class StepperMotor;
18
19 class StepTicker{
20 public:
21 StepTicker();
22 void set_frequency( float frequency );
23 void tick();
24 void signal_moves_finished();
25 StepperMotor* add_stepper_motor(StepperMotor* stepper_motor);
26 void set_reset_delay( float seconds );
27 void reset_tick();
28 void add_motor_to_active_list(StepperMotor* motor);
29 void remove_motor_from_active_list(StepperMotor* motor);
30
31 float frequency;
32 vector<StepperMotor*> stepper_motors;
33 uint32_t delay;
34 uint32_t period;
35 uint32_t debug;
36 uint32_t last_duration;
37 bool has_axes;
38
39 bool moves_finished;
40 bool reset_step_pins;
41
42 StepperMotor* active_motors[12];
43 uint32_t active_motor_bm;
44
45 };
46
47
48
49 #endif