summarylogtreecommitdiffstats
path: root/eep24c_0.1.2-5.patch
blob: 354bbc75b97820c94a06af3aabda77788ae4ea2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- eep24c-0.1.2.orig/mcdelay.h
+++ eep24c-0.1.2/mcdelay.h
@@ -24,7 +24,7 @@
 #ifndef _MICRODELAY_H
 #define _MICRODELAY_H
 
-void microdelay_init(int multiply_factor);
+void microdelay_init(unsigned int multiply_factor);
 void microdelay(unsigned int microsec);
 
 #endif
--- eep24c-0.1.2.orig/mcdelay.c
+++ eep24c-0.1.2/mcdelay.c
@@ -43,7 +43,7 @@
 int old_port_value;
 unsigned int m_f;
 
-void microdelay_init(int multiply_factor) {
+void microdelay_init(unsigned int multiply_factor) {
     /* permition to write in port 0x80
      nothing is suposed to use this port
     however, we will write the same value we read... */
@@ -61,19 +61,15 @@
 }
 
 void microdelay(unsigned int microsec) {
-  unsigned int i;
-  i = m_f;
+  unsigned long int i;
+  i = m_f * microsec;
   while (i)
     {
-      while (microsec)
-	{
 #ifdef __dos__
-	  outportb(0x80, old_port_value);
+      outportb(0x80, old_port_value);
 #else
-	  outb(old_port_value,0x80);
+      outb(old_port_value,0x80);
 #endif
-	  microsec--;
-	}
       i--;
     }
 }