Skip to content
This repository was archived by the owner on Aug 9, 2022. It is now read-only.

Commit 37fad90

Browse files
neophobFederico Fissore
authored andcommitted
apply low latency patch
1 parent d882d2f commit 37fad90

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/SerialImp.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4065,10 +4065,11 @@ void report_serial_events( struct event_info_struct *eis )
40654065
/*
40664066
report(".");
40674067
*/
4068-
usleep(20000);
4068+
//low latency patch here, sleep was 20000
4069+
usleep(1000);
40694070
#if !defined(__sun__)
40704071
/* FIXME: No time to test on all OS's for production */
4071-
usleep(20000);
4072+
usleep(1000);
40724073
#endif /* !__sun__ */
40734074
return;
40744075
}
@@ -4081,7 +4082,7 @@ void report_serial_events( struct event_info_struct *eis )
40814082
#if !defined(__sun__)
40824083
#endif /* !__sun__ */
40834084
}
4084-
usleep(20000);
4085+
usleep(1000);
40854086
}
40864087
}
40874088

@@ -4292,7 +4293,7 @@ RXTXVersion.nativeGetVersion
42924293
JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env,
42934294
jclass jclazz )
42944295
{
4295-
return (*env)->NewStringUTF( env, "RXTX-2.2" );
4296+
return (*env)->NewStringUTF( env, "RXTX-2.2 http://PixelInvaders.ch low latency edition" );
42964297
}
42974298

42984299
/*----------------------------------------------------------

src/gnu/io/RXTXPort.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ protected void waitForTheNativeCodeSilly()
892892
while( MonitorThreadLock )
893893
{
894894
try {
895-
Thread.sleep(5);
895+
Thread.sleep(1);
896896
} catch( Exception e ) {}
897897
}
898898
}

src/gnu/io/RXTXVersion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class RXTXVersion
7676

7777
static {
7878
RXTXVersion.loadLibrary( "rxtxSerial" );
79-
Version = "RXTX-2.2";
79+
Version = "RXTX-2.2 http://PixelInvaders.ch low latency edition";
8080
}
8181
/**
8282
* static method to return the current version of RXTX

src/termios.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3207,7 +3207,7 @@ int serial_select( int n, fd_set *readfds, fd_set *writefds,
32073207
}
32083208
end:
32093209
/* You may want to chop this out for lower latency */
3210-
usleep(1000);
3210+
// usleep(1000);
32113211
LEAVE( "serial_select" );
32123212
return( 1 );
32133213
timeout:

0 commit comments

Comments
 (0)