POSIX: STM32: Check re-enumeration by inode

This is much more stable than waiting for a set amount of time
We still timeout at 5s, if we see that being hit it can be increased
This commit is contained in:
Paul Hollinsky
2021-05-04 22:22:30 -04:00
parent b7c7d4349a
commit 6d22b1e001
2 changed files with 32 additions and 3 deletions
+3
View File
@@ -6,7 +6,9 @@
#include "icsneo/communication/driver.h"
#include "icsneo/device/neodevice.h"
#include "icsneo/api/eventmanager.h"
#include "icsneo/platform/optional.h"
#include <chrono>
#include <sys/stat.h>
#include <stdint.h>
namespace icsneo {
@@ -37,6 +39,7 @@ public:
private:
neodevice_t& device;
int fd = -1;
optional<ino_t> disallowedInode;
std::atomic<bool> modeChanging{false};
std::thread modeChangeThread;
std::mutex modeChangeMutex;