half-way commit to explain some of what is going on
[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 "libs/nuts_bolts.h"
16 #include "libs/Module.h"
17 #include "libs/Kernel.h"
18 #include "libs/StepperMotor.h"
19
20 class StepTicker{
21 public:
22 StepTicker();
23 void set_frequency( double frequency );
24 void tick();
25 StepperMotor* add_stepper_motor(StepperMotor* stepper_motor);
26 void set_reset_delay( double seconds );
27 void reset_tick();
28
29 double frequency;
30 vector<StepperMotor*> stepper_motors;
31 uint32_t delay;
32 uint32_t period;
33 uint32_t debug;
34 uint32_t last_duration;
35 };
36
37
38
39 #endif