Browse Source

tick() => isr() to spotlight interrupt-time

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
committed by Scott Lahteine
parent
commit
42d63258e9
  1. 6
      Marlin/src/module/planner.h
  2. 10
      Marlin/src/module/temperature.cpp
  3. 2
      Marlin/src/module/temperature.h

6
Marlin/src/module/planner.h

@ -885,11 +885,9 @@ class Planner {
// Wait for moves to finish and disable all steppers // Wait for moves to finish and disable all steppers
static void finish_and_disable(); static void finish_and_disable();
// Periodic tick to handle cleaning timeouts // Periodic handler to manage the cleaning buffer counter
// Called from the Temperature ISR at ~1kHz // Called from the Temperature ISR at ~1kHz
static void tick() { static void isr() { if (cleaning_buffer_counter) --cleaning_buffer_counter; }
if (cleaning_buffer_counter) --cleaning_buffer_counter;
}
/** /**
* Does the buffer have any blocks queued? * Does the buffer have any blocks queued?

10
Marlin/src/module/temperature.cpp

@ -2835,12 +2835,12 @@ void Temperature::readings_ready() {
* - Step the babysteps value for each axis towards 0 * - Step the babysteps value for each axis towards 0
* - For PINS_DEBUGGING, monitor and report endstop pins * - For PINS_DEBUGGING, monitor and report endstop pins
* - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged * - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged
* - Call planner.tick to count down its "ignore" time * - Call planner.isr to count down its "ignore" time
*/ */
HAL_TEMP_TIMER_ISR() { HAL_TEMP_TIMER_ISR() {
HAL_timer_isr_prologue(TEMP_TIMER_NUM); HAL_timer_isr_prologue(TEMP_TIMER_NUM);
Temperature::tick(); Temperature::isr();
HAL_timer_isr_epilogue(TEMP_TIMER_NUM); HAL_timer_isr_epilogue(TEMP_TIMER_NUM);
} }
@ -2879,7 +2879,7 @@ public:
* - Endstop polling * - Endstop polling
* - Planner clean buffer * - Planner clean buffer
*/ */
void Temperature::tick() { void Temperature::isr() {
static int8_t temp_count = -1; static int8_t temp_count = -1;
static ADCSensorState adc_sensor_state = StartupDelay; static ADCSensorState adc_sensor_state = StartupDelay;
@ -3363,8 +3363,8 @@ void Temperature::tick() {
// Poll endstops state, if required // Poll endstops state, if required
endstops.poll(); endstops.poll();
// Periodically call the planner timer // Periodically call the planner timer service routine
planner.tick(); planner.isr();
} }
#if HAS_TEMP_SENSOR #if HAS_TEMP_SENSOR

2
Marlin/src/module/temperature.h

@ -600,8 +600,8 @@ class Temperature {
/** /**
* Called from the Temperature ISR * Called from the Temperature ISR
*/ */
static void isr();
static void readings_ready(); static void readings_ready();
static void tick();
/** /**
* Call periodically to manage heaters * Call periodically to manage heaters

Loading…
Cancel
Save