Skip to content

Commit 0ef56a7

Browse files
committed
style tweak
1 parent ae934bf commit 0ef56a7

File tree

3 files changed

+20
-28
lines changed

3 files changed

+20
-28
lines changed

Marlin/Configuration_adv.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -4042,17 +4042,17 @@
40424042
* Sample debug features
40434043
* If you add more debug displays, be careful to avoid conflicts!
40444044
*/
4045-
#define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning
4046-
#define MAX7219_DEBUG_PLANNER_HEAD 2 // Show the planner queue head position on this and the next LED matrix row
4047-
#define MAX7219_DEBUG_PLANNER_TAIL 4 // Show the planner queue tail position on this and the next LED matrix row
4048-
4049-
#define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row
4050-
// If you experience stuttering, reboots, etc. this option can reveal how
4051-
// tweaks made to the configuration are affecting the printer in real-time.
4052-
#define MAX7219_DEBUG_PROFILE 6 // Display the fraction of CPU time spent in profiled code on this LED matrix
4053-
// row. By default idle() is profiled so this shows how "idle" the processor is.
4054-
// See class CodeProfiler.
4055-
//#define MAX7219_DEBUG_MULTISTEPPING 6// Show multistepping 1 to 128 on this LED matrix row.
4045+
#define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning
4046+
#define MAX7219_DEBUG_PLANNER_HEAD 2 // Show the planner queue head position on this and the next LED matrix row
4047+
#define MAX7219_DEBUG_PLANNER_TAIL 4 // Show the planner queue tail position on this and the next LED matrix row
4048+
4049+
#define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row
4050+
// If you experience stuttering, reboots, etc. this option can reveal how
4051+
// tweaks made to the configuration are affecting the printer in real-time.
4052+
#define MAX7219_DEBUG_PROFILE 6 // Display the fraction of CPU time spent in profiled code on this LED matrix
4053+
// row. By default idle() is profiled so this shows how "idle" the processor is.
4054+
// See class CodeProfiler.
4055+
//#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multistepping 1 to 128 on this LED matrix row.
40564056
#endif
40574057

40584058
/**

Marlin/src/feature/max7219.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -731,11 +731,11 @@ void Max7219::idle_tasks() {
731731

732732
#ifdef MAX7219_DEBUG_MULTISTEPPING
733733
static uint8_t last_multistepping = 0;
734-
uint8_t multistepping = Stepper::steps_per_isr;
735-
if (last_multistepping != multistepping) {
734+
const uint8_t multistepping = Stepper::steps_per_isr;
735+
if (multistepping != last_multistepping) {
736736
static uint8_t log2_old = 0;
737737
uint8_t log2_new = 0;
738-
for (uint8_t val = multistepping; val > 1; val >>= 1, log2_new++);
738+
for (uint8_t val = multistepping; val > 1; val >>= 1) log2_new++;
739739
mark16(MAX7219_DEBUG_MULTISTEPPING, log2_old, log2_new, &row_change_mask);
740740
last_multistepping = multistepping;
741741
log2_old = log2_new;

Marlin/src/module/stepper.cpp

+6-14
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ void Stepper::pulse_phase_isr() {
18901890
PULSE_PREP(E);
18911891

18921892
#if ENABLED(LIN_ADVANCE)
1893-
if (step_needed.e && la_active) {
1893+
if (la_active && step_needed.e) {
18941894
// don't actually step here, but do subtract movements steps
18951895
// from the linear advance step count
18961896
step_needed.e = false;
@@ -2070,17 +2070,9 @@ void Stepper::pulse_phase_isr() {
20702070
// Get the timer interval and the number of loops to perform per tick
20712071
hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate, uint8_t loops) {
20722072
#if DISABLED(DISABLE_MULTI_STEPPING)
2073-
if (loops >= 16) {
2074-
step_rate >>= 4;
2075-
loops >>= 4;
2076-
}
2077-
if (loops >= 4) {
2078-
step_rate >>= 2;
2079-
loops >>= 2;
2080-
}
2081-
if (loops >= 2) {
2082-
step_rate >>= 1;
2083-
}
2073+
if (loops >= 16) { step_rate >>= 4; loops >>= 4; }
2074+
if (loops >= 4) { step_rate >>= 2; loops >>= 2; }
2075+
if (loops >= 2) { step_rate >>= 1; }
20842076
#else
20852077
NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X));
20862078
#endif
@@ -2110,7 +2102,7 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate, uint8_t loops) {
21102102
}
21112103
else {
21122104
step_rate = 0;
2113-
uintptr_t table_address = (uintptr_t)&speed_lookuptable_slow[0][0];
2105+
const uintptr_t table_address = (uintptr_t)&speed_lookuptable_slow[0][0];
21142106
return uint16_t(pgm_read_word(table_address));
21152107
}
21162108
}
@@ -2591,7 +2583,7 @@ hal_timer_t Stepper::block_phase_isr() {
25912583
if (stepper_extruder != last_moved_extruder) la_advance_steps = 0;
25922584
#endif
25932585
if (la_active) {
2594-
// apply LA scaling and discount the effect of frequency scaling
2586+
// Apply LA scaling and discount the effect of frequency scaling
25952587
la_dividend = (advance_dividend.e << current_block->la_scaling) << oversampling_factor;
25962588
}
25972589
#endif

0 commit comments

Comments
 (0)