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/>.
22 friend class StepperMotor
;
23 static StepTicker
* global_step_ticker
;
27 void set_frequency( float frequency
);
28 void signal_a_move_finished();
29 void set_reset_delay( float seconds
);
30 int register_motor(StepperMotor
* motor
);
31 void add_motor_to_active_list(StepperMotor
* motor
);
32 void remove_motor_from_active_list(StepperMotor
* motor
);
33 void set_acceleration_ticks_per_second(uint32_t acceleration_ticks_per_second
);
36 void TIMER0_IRQHandler (void);
37 void PendSV_IRQHandler (void);
39 void register_acceleration_tick_handler(std::function
<void(void)> cb
){
40 acceleration_tick_handlers
.push_back(cb
);
47 uint32_t last_duration
;
48 uint32_t acceleration_tick_period
;
49 uint32_t acceleration_tick_cnt
;
50 std::vector
<std::function
<void(void)>> acceleration_tick_handlers
;
51 std::vector
<StepperMotor
*> motor
;
52 std::bitset
<32> active_motor
; // limit to 32 motors
55 volatile bool a_move_finished
:1;
56 volatile bool pending_sv
:1;
57 volatile bool do_acceleration_tick
:1;
58 bool reset_step_pins
:1;