Refactor and optimize Stepper/Planner

Better encapsulation and considerably reduce stepper jitter
This commit is contained in:
etagle
2018-05-09 02:17:53 -03:00
committed by Scott Lahteine
parent 0566badcef
commit a11eb50a3e
16 changed files with 975 additions and 738 deletions

View File

@ -25,6 +25,7 @@
*/
#include "temperature.h"
#include "endstops.h"
#include "../Marlin.h"
#include "../lcd/ultralcd.h"
@ -1725,6 +1726,7 @@ void Temperature::set_current_temp_raw() {
* - Step the babysteps value for each axis towards 0
* - For PINS_DEBUGGING, monitor and report endstop pins
* - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged
* - Call planner.tick to count down its "ignore" time
*/
HAL_TEMP_TIMER_ISR {
HAL_timer_isr_prologue(TEMP_TIMER_NUM);
@ -2249,15 +2251,19 @@ void Temperature::isr() {
endstops.run_monitor(); // report changes in endstop status
#endif
// Update endstops state, if enabled
#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
extern volatile uint8_t e_hit;
if (e_hit && ENDSTOPS_ENABLED) {
endstops.update(); // call endstop update routine
endstops.update();
e_hit--;
}
#else
if (ENDSTOPS_ENABLED) endstops.update();
#endif
// Periodically call the planner timer
planner.tick();
}
#if HAS_TEMP_SENSOR