mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-01-19 08:08:25 +00:00
✨ MAX7219_DEBUG_MULTISTEPPING
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
This commit is contained in:
parent
f9d3939d23
commit
4fdb0fbe8e
3 changed files with 16 additions and 0 deletions
|
@ -4052,6 +4052,7 @@
|
|||
#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.
|
||||
// See class CodeProfiler.
|
||||
//#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multistepping 1 to 128 on this LED matrix row.
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "max7219.h"
|
||||
|
||||
#include "../module/planner.h"
|
||||
#include "../module/stepper.h"
|
||||
#include "../MarlinCore.h"
|
||||
#include "../HAL/shared/Delay.h"
|
||||
|
||||
|
@ -723,6 +724,19 @@ void Max7219::idle_tasks() {
|
|||
}
|
||||
#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
|
||||
suspended--;
|
||||
if (!suspended)
|
||||
|
|
|
@ -459,6 +459,7 @@ constexpr ena_mask_t enable_overlap[] = {
|
|||
// Stepper class definition
|
||||
//
|
||||
class Stepper {
|
||||
friend class Max7219;
|
||||
friend void stepperTask(void *);
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in a new issue