Fixup displaying measurements (array overflow)

This commit is contained in:
Andreas Eversberg 2017-10-30 07:59:47 +01:00
parent e8a3306eee
commit ca6d70566c
1 changed files with 3 additions and 3 deletions

View File

@ -143,9 +143,9 @@ static void print_measurements(int on)
break;
}
/* add current value to history */
param->value_history[param->value_history_pos++] = value;
param->value2_history[param->value_history_pos++] = value2;
param->value_history_pos %= DISPLAY_PARAM_HISTORIES;
param->value_history[param->value_history_pos] = value;
param->value2_history[param->value_history_pos] = value2;
param->value_history_pos = param->value_history_pos % DISPLAY_PARAM_HISTORIES;
/* calculate hold values */
hold = -NAN;
hold2 = -NAN;