From 36cc1c8144db8c0a84d7b79dd3011fb2a0398cfb Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Thu, 24 Dec 2009 03:11:55 +0000 Subject: Internal.c was always compiled in because it hosted the function internal_delay() Move that function to udelay.c and compile internal.c only if really needed. physmap.c is only needed if the programmer is internal or a PCI card. Make its compilation conditional. Corresponding to flashrom svn r822. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Idwer Vollering --- udelay.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'udelay.c') diff --git a/udelay.c b/udelay.c index 9a0ab36..f61d793 100644 --- a/udelay.c +++ b/udelay.c @@ -63,3 +63,16 @@ void myusec_calibrate_delay(void) (unsigned long)micro, timeusec); printf("OK.\n"); } + +void internal_delay(int usecs) +{ + /* If the delay is >1 s, use usleep because timing does not need to + * be so precise. + */ + if (usecs > 1000000) { + usleep(usecs); + } else { + myusec_delay(usecs); + } +} + -- cgit v1.1