replaced usleep with sleep_for

This commit is contained in:
Erik Frojdh
2020-07-23 11:07:42 +02:00
parent 9ea8882c05
commit 78a6896ae9
4 changed files with 16 additions and 8 deletions

View File

@ -10,6 +10,8 @@
#include "versionAPI.h"
#include <fstream>
#include <chrono>
#include <thread>
namespace sls {
@ -399,7 +401,7 @@ void Detector::setPowerChip(bool on, Positions pos) {
if ((pos.empty() || pos[0] == -1) && on && pimpl->size() > 3) {
for (int i = 0; i != pimpl->size(); ++i) {
pimpl->Parallel(&Module::setPowerChip, {i}, on);
usleep(1000 * 1000);
std::this_thread::sleep_for(std::chrono::seconds(1));
}
} else {
pimpl->Parallel(&Module::setPowerChip, pos, on);

View File

@ -15,6 +15,8 @@
#include <bitset>
#include <cassert>
#include <cmath>
#include <chrono>
#include <thread>
#include <cstdlib>
#include <iomanip>
#include <iterator>
@ -3160,7 +3162,7 @@ void Module::programFPGAviaBlackfin(std::vector<char> buffer) {
const int ERASE_TIME = 65;
int count = ERASE_TIME + 1;
while (count > 0) {
usleep(1 * 1000 * 1000);
std::this_thread::sleep_for(std::chrono::seconds(1));
--count;
printf(
"%d%%\r",