1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 <2015> 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 <2015> 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | signal enable/disable in drvSIS3820 driver |
From: | Hovanes Egiyan <[email protected]> |
To: | "[email protected]" <[email protected]> |
Date: | Thu, 24 Sep 2015 10:55:40 -0400 |
Hi, when we were trying to use SIS3820 struck scalers with mca record on a Linux CPU using modified EPICS mca module, we run into a problem when we could not enable all inputs (signals) of the Struck scaler module in EPICS, which is probably the most frequent mode for this scaler readout. We tracked it down to the line# 480 in drvSIS3820.cpp asyn driver for SIS3820:
The result of the left-shift of a 32-bit variable by 32 bits in C apparently is undefined, and it happens to be 0 on our Motorolla VME controllers running VxWorks, and 0xFFFFFFFF on our Intel-based Linux controllers. Therefore, when we were enabling all input signals, the driver for Linux was actually disabling all of the signals. We patched it using an if-statement and it seems to work for us now for our customized version of the driver, but it would probably be useful to do something similar in the official driver. disableMask = ( allEnabled << maxSignals_ ); if( maxSignals_ >= SIS38XX_MAX_SIGNALS ) disableMask = 0; vmeWrite32((volatile unsigned int*)®isters_->copy_disable_reg, disableMask );The same issue probably will arise at line# 521 (SCALER mode):
Best, Hovanes Egiyan |