Apply loop shorthand macros (#17159)

This commit is contained in:
Scott Lahteine
2020-03-13 23:18:16 -05:00
committed by GitHub
parent a96be32fae
commit 118bd2f8b2
93 changed files with 465 additions and 505 deletions

View File

@ -92,11 +92,11 @@ void digipot_i2c_set_current(const uint8_t channel, const float current) {
void digipot_i2c_init() {
static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS;
for (uint8_t i = 0; i < DIGIPOT_I2C_NUM_CHANNELS; i++)
LOOP_L_N(i, DIGIPOT_I2C_NUM_CHANNELS)
pots[i].i2c_init();
// setup initial currents as defined in Configuration_adv.h
for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++)
LOOP_L_N(i, COUNT(digipot_motor_current))
digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i]));
}

View File

@ -83,7 +83,7 @@ void digipot_i2c_init() {
#endif
// setup initial currents as defined in Configuration_adv.h
static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS;
for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++)
LOOP_L_N(i, COUNT(digipot_motor_current))
digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i]));
}