Add COUNT macro and apply

This commit is contained in:
Scott Lahteine
2015-07-22 15:50:20 -07:00
committed by Richard Wackerbarth
parent d85861d296
commit 278aa15301
7 changed files with 16 additions and 11 deletions

View File

@ -50,7 +50,7 @@ void digipot_i2c_init() {
const float digipot_motor_current[] = DIGIPOT_I2C_MOTOR_CURRENTS;
Wire.begin();
// setup initial currents as defined in Configuration_adv.h
for(int i = 0; i <= sizeof(digipot_motor_current) / sizeof(float); i++) {
for(int i = 0; i < COUNT(digipot_motor_current); i++) {
digipot_i2c_set_current(i, digipot_motor_current[i]);
}
}