add thread for rfid_reader
This commit is contained in:
@@ -2,14 +2,12 @@
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <ctime>
|
||||
|
||||
rfid_reader::rfid_reader()
|
||||
{
|
||||
mfrc.PCD_Init();
|
||||
loop();
|
||||
std::this_thread::sleep_for(1s);
|
||||
mfrc.PCD_Init();
|
||||
thread = std::thread(&rfid_reader::loop, this);
|
||||
}
|
||||
|
||||
uint32_t rfid_reader::last_id() const
|
||||
@@ -43,5 +41,7 @@ void rfid_reader::loop()
|
||||
printf("%X\n", last_id());
|
||||
#endif
|
||||
|
||||
std::this_thread::sleep_for(1s);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user