From 3a4f333781a481b70fcd598bcc5a93ed9c5a619b Mon Sep 17 00:00:00 2001 From: Justin Fichtner <justin.fichtner@lakeshore.com> Date: ćšć, 30 11æ 2017 22:26:30 +0800 Subject: [PATCH] Fix typos in tests --- libscpi/src/ieee488.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/libscpi/src/ieee488.c b/libscpi/src/ieee488.c index 667e9da..4e1be81 100644 --- a/libscpi/src/ieee488.c +++ b/libscpi/src/ieee488.c @@ -51,6 +51,17 @@ } /** + * Update latching event register value based on bit transitions from 0 -> 1 + * in the condition register + * @param context + * @param condReg - condition register name + * @param eventReg - event register name + */ +static void regUpdateEvent(scpi_t * context, scpi_reg_val_t oldCondVal, scpi_reg_val_t newCondVal, scpi_reg_name_t eventReg) { + SCPI_RegSet(context, eventReg, ((oldCondVal ^ newCondVal) & newCondVal) | SCPI_RegGet(context, eventReg)); +} + +/** * Update STB register according to value and its mask register * @param context * @param val value of register @@ -142,12 +153,18 @@ case SCPI_REG_QUESE: regUpdate(context, SCPI_REG_QUES); break; + case SCPI_REG_QUESC: + regUpdateEvent(context, old_val, val, SCPI_REG_QUES); + break; case SCPI_REG_OPER: regUpdateSTB(context, val, SCPI_REG_OPERE, STB_OPS); break; case SCPI_REG_OPERE: regUpdate(context, SCPI_REG_OPER); break; + case SCPI_REG_OPERC: + regUpdateEvent(context, old_val, val, SCPI_REG_OPER); + break; case SCPI_REG_COUNT: -- Gitblit v1.9.1