[flashrom] [PATCH 2/3] serprog.c: usleep() not found in MinGW, replaced to internal_delay()

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Fri Apr 5 10:15:18 CEST 2013


Hi Maksim,

thanks for your patch.

Am 01.04.2013 17:08 schrieb Maksim Kuleshov:
> >From 845f59d1aab099ccfe8536adb438371207c65aed Mon Sep 17 00:00:00 2001
> From: Maksim Kuleshov <mmcx at mail.ru>
> Date: Mon, 1 Apr 2013 18:56:24 +0400
> Subject: [PATCH 2/3] serprog.c: usleep() not found in MinGW, replaced to
>  internal_delay()
>
> Signed-off-by: Maksim Kuleshov <mmcx at mail.ru>
> ---
>  serprog.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/serprog.c b/serprog.c
> index c36c93d..5d1eea4 100644
> --- a/serprog.c
> +++ b/serprog.c
> @@ -130,7 +130,7 @@ static int sp_sync_read_timeout(unsigned int loops, unsigned char *c)
>  			msg_perr("read: %s\n", strerror(errno));
>  			return -1;
>  		}
> -		usleep(1000);	/* 1ms units */
> +		internal_delay(1000);	/* 1ms units */
>  	}
>  	return 1;
>  }
> @@ -157,7 +157,7 @@ static int sp_synchronize(void)
>  		goto err_out;
>  	}
>  	/* A second should be enough to get all the answers to the buffer */
> -	usleep(1000 * 1000);
> +	internal_delay(1000 * 1000);
>  	sp_flush_incoming();
>  
>  	/* Then try up to 8 times to send syncnop and get the correct special *

It might make sense to create a new similar patch which changes the two
calls of internal_delay() to internal_sleep(). You can take the wiki
page below as a guideline.

http://www.flashrom.org/Easy_projects#Replace_programmer_delay.28.29_with_internal_sleep.28.29_where_appropriate


Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the flashrom mailing list