Skip to content
Snippets Groups Projects
Commit 5abe403b authored by Gabriel Fedel's avatar Gabriel Fedel :speech_balloon:
Browse files

Fix acquisition loop to works correctly with base 7.0.5

The change introduced by this commit
https://code.launchpad.net/~dirk.zimoch/epics-base/+git/epics-base/+merge/394327
on epics base changes the way the mutex works. Due to that the acquisition
loop when at 14Hz got in a wrong state:
When the state machine is going to RESET or INIT the acquisition loop tries
to arm the device, but on this situation the device cannot be armed and goes
to error state.

It is not clear which change on mutex changes this behavior, but it was
possible to fix the issue checking on loop acquisition on 2 different points
if the state machine was different then ON (the only state which the
acquisition should happen).
parent 6cc9e319
No related branches found
No related tags found
1 merge request!25Fix acquisition loop to works correctly with base 7.0.5
......@@ -1195,6 +1195,13 @@ ndsStatus sis8300llrfDevice::controlLoopTask(nds::TaskServiceBase &service) {
* LOCKING THE DEVICE AND CG PORT!!!
*****/
lock();
//This avoids the loop task start when is at reset or init state
if (getCurrentState() != nds::DEVICE_STATE_ON)
{
unlock();
continue;
}
NDS_INF("Before clear latched");
status = sis8300llrfdrv_clear_latched_statuses(_DeviceUser, SIS8300LLRFDRV_STATUS_CLR_GENERAL | SIS8300LLRFDRV_STATUS_CLR_SIGMON);
SIS8300NDS_STATUS_ASSERT_UNLOCK("sis8300llrfdrv_clear_gop", status, this);
......@@ -1254,6 +1261,13 @@ ndsStatus sis8300llrfDevice::controlLoopTask(nds::TaskServiceBase &service) {
*****/
lock();
//This avoids the loop task run when is at reset or init state
if (getCurrentState() != nds::DEVICE_STATE_ON)
{
unlock();
continue;
}
getFirmwareStatus();
getFirmwareInfo();
if (_FSMFirmware >= fsm_state_lps_daq){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment