Hi,
While using a pull request on github is a good approach in general, in this case it is more work for Hovanes than necessary, because he is using a modified version of the driver, and so he would need to patch
both his version and the original version.
The problem does indeed occur 2 places in drvSSIS3820.cpp, and also in 1 place in drvSIS3801.cpp. I have fixed both and pushed the fixes back to github. My fix is very similar but not identical to the fix
that Hovanes suggested. I also fixed a number of compiler warnings.
Mark
Hi Hovanes,
The “mca” module is now on github which makes it a lot easier to feedback fixes to the developers. I suggest that you make a github fork of the
mca repository from here: https://github.com/epics-modules/mca then apply your change to your fork and issue a Pull Request back to the original repository. Then the maintainer(s) can review, discuss and hopefully
accept the change all in one place.
If you are not familiar with git/github then the github help pages are a good starting point – this one will take you through the forking/pull
request workflows: https://help.github.com/articles/fork-a-repo/
Cheers,
Ulrik
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:
/* Disable channel in MCS mode. We enable the first maxSignals_ inputs */
|
|
registers_->copy_disable_reg = 0xFFFFFFFF << maxSignals_;
|
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):
/* Disable channel in scaler mode. */
|
|
registers_->count_disable_reg = 0xFFFFFFFF << maxSignals_;
|
Best,
Hovanes Egiyan
--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please
notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom