0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-31 14:12:52 +00:00

MAX7219_DEBUG_MULTISTEPPING

Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
This commit is contained in:
Scott Lahteine 2023-03-11 19:53:32 -06:00
parent f9d3939d23
commit 4fdb0fbe8e
3 changed files with 16 additions and 0 deletions

View file

@ -4052,6 +4052,7 @@
#define MAX7219_DEBUG_PROFILE 6 // Display the fraction of CPU time spent in profiled code on this LED matrix #define MAX7219_DEBUG_PROFILE 6 // Display the fraction of CPU time spent in profiled code on this LED matrix
// row. By default idle() is profiled so this shows how "idle" the processor is. // row. By default idle() is profiled so this shows how "idle" the processor is.
// See class CodeProfiler. // See class CodeProfiler.
//#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multistepping 1 to 128 on this LED matrix row.
#endif #endif
/** /**

View file

@ -44,6 +44,7 @@
#include "max7219.h" #include "max7219.h"
#include "../module/planner.h" #include "../module/planner.h"
#include "../module/stepper.h"
#include "../MarlinCore.h" #include "../MarlinCore.h"
#include "../HAL/shared/Delay.h" #include "../HAL/shared/Delay.h"
@ -723,6 +724,19 @@ void Max7219::idle_tasks() {
} }
#endif #endif
#ifdef MAX7219_DEBUG_MULTISTEPPING
static uint8_t last_multistepping = 0;
const uint8_t multistepping = Stepper::steps_per_isr;
if (multistepping != last_multistepping) {
static uint8_t log2_old = 0;
uint8_t log2_new = 0;
for (uint8_t val = multistepping; val > 1; val >>= 1) log2_new++;
mark16(MAX7219_DEBUG_MULTISTEPPING, log2_old, log2_new, &row_change_mask);
last_multistepping = multistepping;
log2_old = log2_new;
}
#endif
// batch line updates // batch line updates
suspended--; suspended--;
if (!suspended) if (!suspended)

View file

@ -459,6 +459,7 @@ constexpr ena_mask_t enable_overlap[] = {
// Stepper class definition // Stepper class definition
// //
class Stepper { class Stepper {
friend class Max7219;
friend void stepperTask(void *); friend void stepperTask(void *);
public: public: