From a79e3f82d6c19f9991327444ea156380801bffda Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周日, 14 2月 2016 00:25:03 +0800
Subject: [PATCH] Emit also queue overflow error (issue #66)

---
 examples/common/scpi-def.c |   26 +++++---------------------
 1 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/examples/common/scpi-def.c b/examples/common/scpi-def.c
index dde9217..809fb1e 100644
--- a/examples/common/scpi-def.c
+++ b/examples/common/scpi-def.c
@@ -345,7 +345,7 @@
     return SCPI_RES_OK;
 }
 
-static const scpi_command_t scpi_commands[] = {
+const scpi_command_t scpi_commands[] = {
     /* IEEE Mandated Commands (SCPI std V1999.0 4.1.1) */
     { .pattern = "*CLS", .callback = SCPI_CoreCls,},
     { .pattern = "*ESE", .callback = SCPI_CoreEse,},
@@ -403,7 +403,7 @@
     SCPI_CMD_LIST_END
 };
 
-static scpi_interface_t scpi_interface = {
+scpi_interface_t scpi_interface = {
     .error = SCPI_Error,
     .write = SCPI_Write,
     .control = SCPI_Control,
@@ -411,23 +411,7 @@
     .reset = SCPI_Reset,
 };
 
-#define SCPI_INPUT_BUFFER_LENGTH 256
-static char scpi_input_buffer[SCPI_INPUT_BUFFER_LENGTH];
+char scpi_input_buffer[SCPI_INPUT_BUFFER_LENGTH];
+int16_t scpi_error_queue_data[SCPI_ERROR_QUEUE_SIZE];
 
-static scpi_reg_val_t scpi_regs[SCPI_REG_COUNT];
-
-
-scpi_t scpi_context = {
-    .cmdlist = scpi_commands,
-    .buffer =
-    {
-        .length = SCPI_INPUT_BUFFER_LENGTH,
-        .data = scpi_input_buffer,
-    },
-    .interface = &scpi_interface,
-    .registers = scpi_regs,
-    .units = scpi_units_def,
-    .idn =
-    {"MANUFACTURE", "INSTR2013", NULL, "01-02"},
-};
-
+scpi_t scpi_context;

--
Gitblit v1.9.1