2004-07-08 Theodore A. Roth
* AUTHORS: Add names of recent major contributors.
* main.c (main): Don't indent CPP directives.
When showing update progress in a no tty situation, use unbuffered IO
for all systems, not just win32 native.
Update copyright year when printing version.
Remove warning about native win32 being experimental.
Split a line string.
* ppiwin.c: Update copyright year.
Add cvs Id keyword.
(usleep): Cleanup debug CPP directives to improve readability.
Index: AUTHORS
===================================================================
RCS file: /cvsroot/avrdude/avrdude/AUTHORS,v
retrieving revision 1.5
diff -u -p -p -r1.5 AUTHORS
--- AUTHORS 13 May 2003 18:10:55 -0000 1.5
+++ AUTHORS 8 Jul 2004 17:44:19 -0000
@@ -5,6 +5,11 @@ AVRDUDE was written by:
Contributors:
Joerg Wunsch
- Eric Weddington
+ Eric Weddington
+ Jan-Hinnerk Reichert
+ Alex Shepherd
+ Martin Thomas
Theodore A. Roth
+For minor contributions, please see the ChangeLog files.
+
Index: main.c
===================================================================
RCS file: /cvsroot/avrdude/avrdude/main.c,v
retrieving revision 1.95
diff -u -p -p -r1.95 main.c
--- main.c 5 Jul 2004 15:04:19 -0000 1.95
+++ main.c 8 Jul 2004 17:44:19 -0000
@@ -747,12 +747,12 @@ int main(int argc, char * argv [])
baudrate = 0;
- #if defined(WIN32NATIVE)
+#if defined(WIN32NATIVE)
win_sys_config_set(sys_config);
win_usr_config_set(usr_config);
- #else
+#else
strcpy(sys_config, CONFIG_DIR);
i = strlen(sys_config);
@@ -770,7 +770,7 @@ int main(int argc, char * argv [])
strcat(usr_config, ".avrduderc");
}
- #endif
+#endif
len = strlen(progname) + 2;
for (i=0; idesc, "flash") == 0) && (upd->op == DEVICE_WRITE)) {
erase = 1;
fprintf(stderr,
- "%s: NOTE: FLASH memory has been specified, an erase cycle will be performed\n"
+ "%s: NOTE: FLASH memory has been specified, an erase cycle "
+ "will be performed\n"
"%sTo disable this feature, specify the -D option.\n",
progname, progbuf);
break;
Index: ppiwin.c
===================================================================
RCS file: /cvsroot/avrdude/avrdude/ppiwin.c,v
retrieving revision 1.8
diff -u -p -p -r1.8 ppiwin.c
--- ppiwin.c 24 Jun 2004 11:05:07 -0000 1.8
+++ ppiwin.c 8 Jul 2004 17:44:19 -0000
@@ -1,6 +1,6 @@
/*
* avrdude - A Downloader/Uploader for AVR device programmers
- * Copyright (C) 2003 Eric B. Weddington
+ * Copyright (C) 2003, 2004 Eric B. Weddington
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,6 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/* $Id$ */
/*
This is the parallel port interface for Windows built using Cygwin.
@@ -327,13 +328,30 @@ void gettimeofday(struct timeval*tv, voi
// #define W32USLEEPDBG
+#ifdef W32USLEEPDBG
+
+# define DEBUG_QueryPerformanceCounter(arg) QueryPerformanceCounter(arg)
+# define DEBUG_DisplayTimingInfo(start, stop, freq, us, has_highperf) \
+ do { \
+ unsigned long dt; \
+ dt = (unsigned long)((stop.QuadPart - start.QuadPart) * 1000 * 1000 \
+ / freq.QuadPart); \
+ fprintf(stderr, \
+ "hpt:%i usleep usec:%lu sleep msec:%lu timed usec:%lu\n", \
+ has_highperf, us, ((us + 999) / 1000), dt); \
+ } while (0)
+
+#else
+
+# define DEBUG_QueryPerformanceCounter(arg)
+# define DEBUG_DisplayTimingInfo(start, stop, freq, us, has_highperf)
+
+#endif
+
void usleep(unsigned long us)
{
int has_highperf;
LARGE_INTEGER freq,start,stop,loopend;
- #ifdef W32USLEEPDBG
- unsigned long dt;
- #endif
// workaround: although usleep is very precise if using
// high-performance-timers there are sometimes problems with
@@ -354,21 +372,15 @@ void usleep(unsigned long us)
} while (stop.QuadPart<=loopend.QuadPart);
}
else {
- #ifdef W32USLEEPDBG
- QueryPerformanceCounter(&start);
- #endif
+ DEBUG_QueryPerformanceCounter(&start);
+
Sleep(1);
Sleep( (DWORD)((us+999)/1000) );
- #ifdef W32USLEEPDBG
- QueryPerformanceCounter(&stop);
- #endif
+
+ DEBUG_QueryPerformanceCounter(&stop);
}
- #ifdef W32USLEEPDBG
- dt=(unsigned long)((stop.QuadPart-start.QuadPart)*1000*1000/freq.QuadPart);
- fprintf(stderr,"hpt:%i usleep usec:%lu sleep msec:%lu timed usec:%lu\n",
- has_highperf,us,((us+999)/1000),dt);
- #endif
+ DEBUG_DisplayTimingInfo(start, stop, freq, us, has_highperf);
}
#endif