Reinitialize the delay loop upon recalibration
Fix an unescaped % in a format specifier.
Corresponding to flashrom svn r992.
Signed-off-by: Urja Rannikko <urjaman@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
diff --git a/udelay.c b/udelay.c
index ff6620a..bae6467 100644
--- a/udelay.c
+++ b/udelay.c
@@ -66,6 +66,7 @@
printf("Calibrating delay loop... ");
recalibrate:
+ count = 1000;
while (1) {
timeusec = measure_delay(count);
if (timeusec > 1000000 / 4)
@@ -93,7 +94,7 @@
*/
for (i = 0; i < 4; i++) {
if (measure_delay(100) < 90) {
- msg_pdbg("delay more than 10% too short, "
+ msg_pdbg("delay more than 10%% too short, "
"recalculating... ");
goto recalibrate;
}