mirror of
https://github.com/lindbergh-loader/lindbergh-loader.git
synced 2026-10-14 09:59:08 +03:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d1f2764f3 |
@@ -444,7 +444,7 @@ int main(int argc, char *argv[])
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(argv[i], "-z") == 0 || strcmp(argv[i], "--ziink") == 0)
|
if (strcmp(argv[i], "-z") == 0 || strcmp(argv[i], "--zink") == 0)
|
||||||
{
|
{
|
||||||
zink = 1;
|
zink = 1;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -159,11 +159,8 @@ void *readJVSFrameThread(void * arg)
|
|||||||
ackSize = 0;
|
ackSize = 0;
|
||||||
waitForEnd = 0;
|
waitForEnd = 0;
|
||||||
|
|
||||||
do {
|
do
|
||||||
while (jvsFrameBuffer.ready == 1)
|
{
|
||||||
{
|
|
||||||
usleep(1);
|
|
||||||
}
|
|
||||||
// printf("SERIAL thread debug: trying to read byte.\n");
|
// printf("SERIAL thread debug: trying to read byte.\n");
|
||||||
// Try to read a byte from serial, this call will be blocking if VMIN > 0 and VTIME = 0
|
// Try to read a byte from serial, this call will be blocking if VMIN > 0 and VTIME = 0
|
||||||
bytesRead = read(fd, &localBuffer[byteCount], 1);
|
bytesRead = read(fd, &localBuffer[byteCount], 1);
|
||||||
@@ -198,7 +195,6 @@ void *readJVSFrameThread(void * arg)
|
|||||||
}
|
}
|
||||||
} while (waitForEnd);
|
} while (waitForEnd);
|
||||||
|
|
||||||
|
|
||||||
// Lock the buffer while we write to it
|
// Lock the buffer while we write to it
|
||||||
pthread_mutex_lock(&jvsBuffer_lock);
|
pthread_mutex_lock(&jvsBuffer_lock);
|
||||||
memcpy(jvsFrameBuffer.buffer, localBuffer, byteCount);
|
memcpy(jvsFrameBuffer.buffer, localBuffer, byteCount);
|
||||||
@@ -247,7 +243,7 @@ JVSFrame readJVSFrameFromThread() {
|
|||||||
|
|
||||||
// Check if we have a valid frame
|
// Check if we have a valid frame
|
||||||
if (jvsFrameBuffer.ready == 1) {
|
if (jvsFrameBuffer.ready == 1) {
|
||||||
memcpy(&frame, &jvsFrameBuffer, sizeof(JVSFrame));
|
frame = jvsFrameBuffer;
|
||||||
// It has been red, we disable this frame
|
// It has been red, we disable this frame
|
||||||
jvsFrameBuffer.ready = 0;
|
jvsFrameBuffer.ready = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user