summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gentoo.org>2011-05-07 09:43:32 +0000
committerTim Harder <radhermit@gentoo.org>2011-05-07 09:43:32 +0000
commitade033942c59334d66fab15e09f937264e499a6e (patch)
tree060f0ef1b58a9da0fdc27682a9588b7d02e53f13 /dev-embedded/picprog/files/picprog-1.7-werner-almesberger.diff
parentAdded changes suggested by Arfrever in #366137, renaming of function in src_i... (diff)
downloadgentoo-2-ade033942c59334d66fab15e09f937264e499a6e.tar.gz
gentoo-2-ade033942c59334d66fab15e09f937264e499a6e.tar.bz2
gentoo-2-ade033942c59334d66fab15e09f937264e499a6e.zip
Version bump and remove old. Update LICENSE and use EAPI 4.
(Portage version: 2.2.0_alpha30/cvs/Linux x86_64)
Diffstat (limited to 'dev-embedded/picprog/files/picprog-1.7-werner-almesberger.diff')
-rw-r--r--dev-embedded/picprog/files/picprog-1.7-werner-almesberger.diff125
1 files changed, 0 insertions, 125 deletions
diff --git a/dev-embedded/picprog/files/picprog-1.7-werner-almesberger.diff b/dev-embedded/picprog/files/picprog-1.7-werner-almesberger.diff
deleted file mode 100644
index 5be24442eb35..000000000000
--- a/dev-embedded/picprog/files/picprog-1.7-werner-almesberger.diff
+++ /dev/null
@@ -1,125 +0,0 @@
---- picprog-1.7/main.cc.orig 2004-10-18 07:33:58.995275000 -0300
-+++ picprog-1.7/main.cc 2004-10-18 08:06:50.275140000 -0300
-@@ -41,7 +41,7 @@
-
- program prog;
-
--char short_opts [] = "d:p:i:o:c:qh?";
-+char short_opts [] = "d:p:i:o:c:qsh?";
-
- int
- main (int argc, char **argv)
-@@ -81,6 +81,7 @@
- {"erase", no_argument, &opt_erase, 1},
- {"burn", no_argument, &opt_burn, 1},
- {"force-calibration", no_argument, &opt_calibration, 1},
-+ {"slow", no_argument, NULL, 's'},
- {0, 0, 0, 0}
- };
-
-@@ -113,6 +114,12 @@
- case 'q':
- opt_quiet = 1;
- break;
-+ case 's':
-+ // Add extra delays for capacity added by very long cable
-+ picport::t_edge = 10; // 10 us
-+ picport::t_on = 200000; // 200 ms
-+ picport::t_off = 700000; // 700 ms - I'm not kidding !
-+ break;
- default: // -? -h --help unknown flag
- opt_usage = 1;
- }
---- picprog-1.7/picport.h.orig 2004-10-18 07:39:03.325205000 -0300
-+++ picprog-1.7/picport.h 2004-10-18 07:40:52.113394000 -0300
-@@ -59,6 +59,10 @@
-
- public:
-
-+ static int t_on;
-+ static int t_off;
-+ static int t_edge;
-+
- static void delay (long ns);
-
- enum commands {
---- picprog-1.7/picport.cc.orig 2004-10-18 07:28:46.554692000 -0300
-+++ picprog-1.7/picport.cc 2004-10-18 08:30:38.385152000 -0300
-@@ -54,6 +54,11 @@
- unsigned int picport::tsc_1000ns = 0;
- int picport::use_nanosleep = -1;
-
-+// Extra delays for long cables, in us
-+int picport::t_on = 0;
-+int picport::t_off = 0;
-+int picport::t_edge = 0;
-+
- void
- picport::set_clock_data (int rts, int dtr)
- {
-@@ -102,7 +107,7 @@
- // Before first call to set_clock_data, read the modem status.
- ioctl (fd, TIOCMGET, &modembits);
- set_clock_data (0, 0);
-- usleep (50);
-+ usleep (50+t_edge);
- // Check the CTS. If it is up, even when we just lowered DTR,
- // we probably are not talking to a JDM type programmer.
- int i;
-@@ -200,13 +205,13 @@
- cerr << "Unable to start break on tty " << tty << ":" << strerror (e) << endl;
- exit (EX_IOERR);
- }
-- usleep (10);
-+ usleep (10+t_off);
- }
-
- picport::~picport ()
- {
- ioctl (fd, TIOCCBRK, 0);
-- usleep (1);
-+ usleep (1+t_off);
- tcsetattr (fd, TCSANOW, &saved);
- close (fd);
- delete [] portname;
-@@ -216,15 +221,15 @@
- {
- set_clock_data (0, 0);
- ioctl (fd, TIOCCBRK, 0);
-- usleep (50);
-+ usleep (50+t_off);
- ioctl (fd, TIOCSBRK, 0);
-- usleep (10);
-+ usleep (10+t_on);
- addr = 0;
- }
-
- void picport::delay (long ns)
- {
-- if (1 == use_nanosleep) {
-+ if (1 == use_nanosleep && !t_edge) {
- timespec ts = {ns / 1000000000, ns % 1000000000}, ts2;
- while (nanosleep (&ts, &ts2) && EINTR == errno)
- ts = ts2;
-@@ -232,7 +237,7 @@
- }
-
- #ifdef RDTSC_WORKS
-- if (tsc_1000ns > 1) {
-+ if (tsc_1000ns > 1 && !t_edge) {
- unsigned long a1, d1, a2, d2;
- asm volatile("rdtsc":"=a" (a1), "=d" (d1));
- d2 = d1;
-@@ -259,10 +264,10 @@
- volatile int i;
- gettimeofday (&tv1, 0);
- tv2.tv_sec = tv1.tv_sec;
-- tv2.tv_usec = 0xffffffff & (tv1.tv_usec + 1 + (ns + 999)/1000);
-+ tv2.tv_usec = 0xffffffff & (tv1.tv_usec + 1 + (ns + 999)/1000+t_edge);
- if (tv2.tv_usec < tv1.tv_usec)
- tv2.tv_sec++;
-- for (i = 0; i < 10000; i++) {
-+ for (i = 0; i < 10000 || t_edge; i++) {
- gettimeofday (&tv1, 0);
- if (tv1.tv_sec > tv2.tv_sec
- || tv1.tv_sec == tv2.tv_sec && tv1.tv_usec >= tv2.tv_usec)