From 9acf72c82d752849172297359c399057b04e6ba1 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周二, 27 11月 2012 23:54:10 +0800 Subject: [PATCH] Netbeans project cleanup --- scpi/scpi_ieee488.c | 59 +++++++++++++++++++++++++++++------------------------------ 1 files changed, 29 insertions(+), 30 deletions(-) diff --git a/scpi/scpi_ieee488.c b/scpi/scpi_ieee488.c index 005ea90..a0983e3 100644 --- a/scpi/scpi_ieee488.c +++ b/scpi/scpi_ieee488.c @@ -34,12 +34,10 @@ * */ -#include "scpi.h" +#include "scpi_parser.h" #include "scpi_ieee488.h" #include "scpi_error.h" #include "scpi_constants.h" -#include <string.h> -#include <stdint.h> /* register array */ static scpi_reg_val_t regs[SCPI_REG_COUNT]; @@ -157,17 +155,18 @@ } /** - * *CLS + * *CLS - This command clears all status data structures in a device. + * For a device which minimally complies with SCPI. (SCPI std 4.1.3.2) * @param context * @return */ -int SCPI_CoreCls(scpi_context_t * context) { +scpi_result_t SCPI_CoreCls(scpi_t * context) { (void) context; SCPI_EventClear(); SCPI_ErrorClear(context); SCPI_RegSet(SCPI_REG_OPER, 0); SCPI_RegSet(SCPI_REG_QUES, 0); - return 0; + return SCPI_RES_OK; } /** @@ -175,12 +174,12 @@ * @param context * @return */ -int SCPI_CoreEse(scpi_context_t * context) { +scpi_result_t SCPI_CoreEse(scpi_t * context) { int32_t new_ESE; if (SCPI_ParamInt(context, &new_ESE, TRUE)) { SCPI_RegSet(SCPI_REG_ESE, new_ESE); } - return 0; + return SCPI_RES_OK; } /** @@ -188,10 +187,10 @@ * @param context * @return */ -int SCPI_CoreEseQ(scpi_context_t * context) { +scpi_result_t SCPI_CoreEseQ(scpi_t * context) { (void) context; SCPI_ResultInt(context, SCPI_RegGet(SCPI_REG_ESE)); - return 0; + return SCPI_RES_OK; } /** @@ -199,11 +198,11 @@ * @param context * @return */ -int SCPI_CoreEsrQ(scpi_context_t * context) { +scpi_result_t SCPI_CoreEsrQ(scpi_t * context) { (void) context; SCPI_ResultInt(context, SCPI_RegGet(SCPI_REG_ESR)); SCPI_RegSet(SCPI_REG_ESR, 0); - return 0; + return SCPI_RES_OK; } /** @@ -211,12 +210,12 @@ * @param context * @return */ -int SCPI_CoreIdnQ(scpi_context_t * context) { +scpi_result_t SCPI_CoreIdnQ(scpi_t * context) { (void) context; SCPI_ResultString(context, SCPI_MANUFACTURE); SCPI_ResultString(context, SCPI_DEV_NAME); SCPI_ResultString(context, SCPI_DEV_VERSION); - return 0; + return SCPI_RES_OK; } /** @@ -224,10 +223,10 @@ * @param context * @return */ -int SCPI_CoreOpc(scpi_context_t * context) { +scpi_result_t SCPI_CoreOpc(scpi_t * context) { (void) context; SCPI_RegSetBits(SCPI_REG_ESR, ESR_OPC); - return 0; + return SCPI_RES_OK; } /** @@ -235,11 +234,11 @@ * @param context * @return */ -int SCPI_CoreOpcQ(scpi_context_t * context) { +scpi_result_t SCPI_CoreOpcQ(scpi_t * context) { (void) context; // Operation is always completed SCPI_ResultInt(context, 1); - return 0; + return SCPI_RES_OK; } /** @@ -247,11 +246,11 @@ * @param context * @return */ -int SCPI_CoreRst(scpi_context_t * context) { +scpi_result_t SCPI_CoreRst(scpi_t * context) { if (context && context->interface && context->interface->reset) { return context->interface->reset(context); } - return 0; + return SCPI_RES_OK; } /** @@ -259,12 +258,12 @@ * @param context * @return */ -int SCPI_CoreSre(scpi_context_t * context) { +scpi_result_t SCPI_CoreSre(scpi_t * context) { int32_t new_SRE; if (SCPI_ParamInt(context, &new_SRE, TRUE)) { SCPI_RegSet(SCPI_REG_SRE, new_SRE); } - return 0; + return SCPI_RES_OK; } /** @@ -272,10 +271,10 @@ * @param context * @return */ -int SCPI_CoreSreQ(scpi_context_t * context) { +scpi_result_t SCPI_CoreSreQ(scpi_t * context) { (void) context; SCPI_ResultInt(context, SCPI_RegGet(SCPI_REG_SRE)); - return 0; + return SCPI_RES_OK; } /** @@ -283,10 +282,10 @@ * @param context * @return */ -int SCPI_CoreStbQ(scpi_context_t * context) { +scpi_result_t SCPI_CoreStbQ(scpi_t * context) { (void) context; SCPI_ResultInt(context, SCPI_RegGet(SCPI_REG_STB)); - return 0; + return SCPI_RES_OK; } /** @@ -294,14 +293,14 @@ * @param context * @return */ -int SCPI_CoreTstQ(scpi_context_t * context) { +scpi_result_t SCPI_CoreTstQ(scpi_t * context) { (void) context; int result = 0; if (context && context->interface && context->interface->test) { result = context->interface->test(context); } SCPI_ResultInt(context, result); - return 0; + return SCPI_RES_OK; } /** @@ -309,9 +308,9 @@ * @param context * @return */ -int SCPI_CoreWai(scpi_context_t * context) { +scpi_result_t SCPI_CoreWai(scpi_t * context) { (void) context; // NOP - return 0; + return SCPI_RES_OK; } -- Gitblit v1.9.1