From 6ab7baa413b520fde11f588e288b391b39bf4cd8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 8 Apr 2021 15:43:16 -0500 Subject: [PATCH] tick() => isr() to spotlight interrupt-time --- Marlin/src/module/planner.h | 6 ++---- Marlin/src/module/temperature.cpp | 10 +++++----- Marlin/src/module/temperature.h | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 570fcc08af..d4ed00d2fa 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -885,11 +885,9 @@ class Planner { // Wait for moves to finish and disable all steppers 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 - static void tick() { - if (cleaning_buffer_counter) --cleaning_buffer_counter; - } + static void isr() { if (cleaning_buffer_counter) --cleaning_buffer_counter; } /** * Does the buffer have any blocks queued? diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 992681632d..faa5bb5b10 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -2835,12 +2835,12 @@ void Temperature::readings_ready() { * - 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 + * - Call planner.isr to count down its "ignore" time */ HAL_TEMP_TIMER_ISR() { HAL_timer_isr_prologue(TEMP_TIMER_NUM); - Temperature::tick(); + Temperature::isr(); HAL_timer_isr_epilogue(TEMP_TIMER_NUM); } @@ -2879,7 +2879,7 @@ public: * - Endstop polling * - Planner clean buffer */ -void Temperature::tick() { +void Temperature::isr() { static int8_t temp_count = -1; static ADCSensorState adc_sensor_state = StartupDelay; @@ -3363,8 +3363,8 @@ void Temperature::tick() { // Poll endstops state, if required endstops.poll(); - // Periodically call the planner timer - planner.tick(); + // Periodically call the planner timer service routine + planner.isr(); } #if HAS_TEMP_SENSOR diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 92e436c73f..13dcca2932 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -600,8 +600,8 @@ class Temperature { /** * Called from the Temperature ISR */ + static void isr(); static void readings_ready(); - static void tick(); /** * Call periodically to manage heaters