Skip to content

Commit

Permalink
add error messages for mask and enable
Browse files Browse the repository at this point in the history
  • Loading branch information
agaget committed Jan 25, 2024
1 parent 03aa78d commit 020fe0b
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion mrmShared/src/mrmSeq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ struct SoftSequence : public mrf::ObjectInst<SoftSequence>
void setMask(const epicsUInt8 *arr, epicsUInt32 count)
{
masks_t masks(count);
if (*arr>15){
std::string msg("4 bits code. Authorized range is [0-15]");
last_err = msg;
scanIoRequest(onErr);
throw std::runtime_error(msg);
}
std::copy(arr,
arr + count,
masks.begin());
Expand All @@ -286,6 +292,12 @@ struct SoftSequence : public mrf::ObjectInst<SoftSequence>

void setEna(const epicsUInt8 *arr, epicsUInt32 count)
{
if (*arr>15){
std::string msg("4 bits code. Authorized range is [0-15]");
last_err = msg;
scanIoRequest(onErr);
throw std::runtime_error(msg);
}
enables_t enables(count);
std::copy(arr,
arr + count,
Expand Down Expand Up @@ -534,6 +546,12 @@ epicsUInt32 SoftSequence::getSwMask() const
void SoftSequence::setSwMask(epicsUInt32 src)
{

if (src>15){
std::string msg("4 bits code. Authorized range is [0-15]");
last_err = msg;
scanIoRequest(onErr);
throw std::runtime_error(msg);
}
DEBUG(3, ("SW Mask setter\n"));
if (!hw || !is_enabled)
{
Expand Down Expand Up @@ -573,7 +591,12 @@ epicsUInt32 SoftSequence::getSwEna() const

void SoftSequence::setSwEna(epicsUInt32 src)
{

if (src>15){
std::string msg("4 bits code. Authorized range is [0-15]");
last_err = msg;
scanIoRequest(onErr);
throw std::runtime_error(msg);
}
DEBUG(3, ("SW Enable setter\n"));
if (!hw || !is_enabled)
{
Expand Down

0 comments on commit 020fe0b

Please sign in to comment.