Apply loop shorthand macros (#17159)
This commit is contained in:
@ -90,7 +90,7 @@
|
||||
|
||||
inline void spin_photo_pin() {
|
||||
static constexpr uint32_t sequence[] = PHOTO_PULSES_US;
|
||||
for (uint8_t i = 0; i < COUNT(sequence); i++)
|
||||
LOOP_L_N(i, COUNT(sequence))
|
||||
pulse_photo_pin(sequence[i], !(i & 1));
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ void GcodeSuite::M907() {
|
||||
|
||||
LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.digipot_current(i, parser.value_int());
|
||||
if (parser.seenval('B')) stepper.digipot_current(4, parser.value_int());
|
||||
if (parser.seenval('S')) for (uint8_t i = 0; i <= 4; i++) stepper.digipot_current(i, parser.value_int());
|
||||
if (parser.seenval('S')) LOOP_LE_N(i, 4) stepper.digipot_current(i, parser.value_int());
|
||||
|
||||
#elif HAS_MOTOR_CURRENT_PWM
|
||||
|
||||
@ -74,7 +74,7 @@ void GcodeSuite::M907() {
|
||||
#if ENABLED(DAC_STEPPER_CURRENT)
|
||||
if (parser.seenval('S')) {
|
||||
const float dac_percent = parser.value_float();
|
||||
for (uint8_t i = 0; i <= 4; i++) dac_current_percent(i, dac_percent);
|
||||
LOOP_LE_N(i, 4) dac_current_percent(i, dac_percent);
|
||||
}
|
||||
LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) dac_current_percent(i, parser.value_float());
|
||||
#endif
|
||||
|
@ -79,7 +79,7 @@ void GcodeSuite::M7219() {
|
||||
}
|
||||
|
||||
if (parser.seen('P')) {
|
||||
for (uint8_t r = 0; r < MAX7219_LINES; r++) {
|
||||
LOOP_L_N(r, MAX7219_LINES) {
|
||||
SERIAL_ECHOPGM("led_line[");
|
||||
if (r < 10) SERIAL_CHAR(' ');
|
||||
SERIAL_ECHO(int(r));
|
||||
|
Reference in New Issue
Block a user