commander rewrite almost completed, WIP

This commit is contained in:
Anton Babushkin
2013-07-31 20:58:27 +04:00
parent 8c1067a017
commit 02d4480e8e
4 changed files with 460 additions and 501 deletions

View File

@@ -213,7 +213,7 @@ float battery_remaining_estimate_voltage(float voltage)
ret = (voltage - ncells * chemistry_voltage_empty) / (ncells * (chemistry_voltage_full - chemistry_voltage_empty));
/* limit to sane values */
ret = (ret < 0) ? 0 : ret;
ret = (ret > 1) ? 1 : ret;
ret = (ret < 0.0f) ? 0.0f : ret;
ret = (ret > 1.0f) ? 1.0f : ret;
return ret;
}
}