...
This commit is contained in:
parent
fd03e903c4
commit
6d7e7f14b5
@ -327,15 +327,15 @@ bool RaptorEagleCCD::initCamera(int unitmap)
|
|||||||
std::format("pxd_serialConfigure({}, 0, {}, {}, 0, {}, 0, 0, 0)", _cameraUnitmap, CL_DEFAULT_BAUD_RATE,
|
std::format("pxd_serialConfigure({}, 0, {}, {}, 0, {}, 0, 0, 0)", _cameraUnitmap, CL_DEFAULT_BAUD_RATE,
|
||||||
CL_DEFAULT_DATA_BITS, CL_DEFAULT_STOP_BIT));
|
CL_DEFAULT_DATA_BITS, CL_DEFAULT_STOP_BIT));
|
||||||
|
|
||||||
bool ok = resetMicro();
|
bool ok = resetFPGA();
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
logError("Cannot reset microcontroller!");
|
logError("Cannot reboot FPGA!");
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = resetFPGA();
|
ok = resetMicro();
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
logError("Cannot reboot FPGA!");
|
logError("Cannot reset microcontroller!");
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -592,7 +592,7 @@ bool RaptorEagleCCD::resetMicro(const std::chrono::milliseconds& timeout)
|
|||||||
tm = std::chrono::milliseconds(MICRO_RESET_DEFAULT_TIMEOUT);
|
tm = std::chrono::milliseconds(MICRO_RESET_DEFAULT_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte_seq_t ack;
|
byte_seq_t ack(1);
|
||||||
std::chrono::milliseconds::rep cnt = (tm - MICRO_RESET_TIME_CONSTANT).count();
|
std::chrono::milliseconds::rep cnt = (tm - MICRO_RESET_TIME_CONSTANT).count();
|
||||||
std::chrono::milliseconds sleep_dur =
|
std::chrono::milliseconds sleep_dur =
|
||||||
cnt > 10 ? std::chrono::milliseconds(cnt / 10) : std::chrono::milliseconds(10);
|
cnt > 10 ? std::chrono::milliseconds(cnt / 10) : std::chrono::milliseconds(10);
|
||||||
@ -611,8 +611,8 @@ bool RaptorEagleCCD::resetMicro(const std::chrono::milliseconds& timeout)
|
|||||||
auto start = std::chrono::steady_clock::now();
|
auto start = std::chrono::steady_clock::now();
|
||||||
do {
|
do {
|
||||||
// poll camera with 'set-system-status'
|
// poll camera with 'set-system-status'
|
||||||
// clWrite({0x4F, 0x51});
|
clWrite({0x4F, 0x51});
|
||||||
clWrite({0x4F, 0x50});
|
//clWrite({0x4F, 0x50});
|
||||||
std::this_thread::sleep_for(sleep_dur);
|
std::this_thread::sleep_for(sleep_dur);
|
||||||
clRead(ack);
|
clRead(ack);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user