Skip to content

Commit

Permalink
fixed a bug in usb worker
Browse files Browse the repository at this point in the history
  • Loading branch information
A-J-Bauer committed Feb 6, 2024
1 parent c5f39c2 commit 2eca252
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Sharpi/Sharpi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<Description>C# Library for 64 bit Raspberry Pi OS</Description>
<Copyright>A.J.Bauer</Copyright>
<PackageIcon>img\sharpi.png</PackageIcon>
<AssemblyVersion>1.0.4.1</AssemblyVersion>
<FileVersion>1.0.4.1</FileVersion>
<Version>1.0.4.1</Version>
<AssemblyVersion>1.0.4.2</AssemblyVersion>
<FileVersion>1.0.4.2</FileVersion>
<Version>1.0.4.2</Version>
<PackageReadmeFile></PackageReadmeFile>
<PackageTags>Raspberry;Pi;iot;</PackageTags>
<PackageProjectUrl>https://github.com/A-J-Bauer/sharpi</PackageProjectUrl>
Expand Down
6 changes: 5 additions & 1 deletion Sharpi/cpp/sharpi/UsbWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,16 @@ void UsbWorker::work(int deviceId, unsigned int baud, int deadAfterMs)
fd = -1;
}

if (stop)
{
break;
}

mtxState.lock();
UsbWorker::ttyDevs[ttyDevCount].state = UsbWorker::TtyDevState::Unused;
mtxState.unlock();

ttyDevCount = (ttyDevCount + 1) % UsbWorker::ttyDevsSize;
}

}
}
1 change: 0 additions & 1 deletion Sharpi/cpp/sharpi/UsbWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <termios.h> //POSIX terminal control definitions
#include <unistd.h> // write(), read(), close()
#include <errno.h>
//#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
Expand Down
Binary file modified Sharpi/native/libsharpi.so
Binary file not shown.

0 comments on commit 2eca252

Please sign in to comment.