Skip to content

Commit

Permalink
HP3478A cal data fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Twilight-Logic committed Mar 18, 2024
1 parent 67dd553 commit e4f44d9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
13 changes: 5 additions & 8 deletions src/AR488/AR488.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "AR488_Eeprom.h"


/***** FWVER "AR488 GPIB controller, ver. 0.51.28, 16/02/2024" *****/
/***** FWVER "AR488 GPIB controller, ver. 0.51.29, 18/03/2024" *****/

/*
Arduino IEEE-488 implementation by John Chajecki
Expand Down Expand Up @@ -631,7 +631,7 @@ uint8_t parseInput(char c) {
// Carriage return or newline? Then process the line
case CR:
case LF:
// If escaped just add to buffer
// If escaped add char 0x10 or 0x13 to buffer and clear Escape flag
if (isEsc) {
addPbuf(c);
isEsc = false;
Expand All @@ -646,7 +646,6 @@ uint8_t parseInput(char c) {
}
return 0;
} else {
// if (isVerb) dataPort.println(); // Move to new line
#ifdef DEBUG_SERIAL_INPUT
DB_PRINT(F("parseInput: Received "), pBuf);
#endif
Expand Down Expand Up @@ -679,12 +678,12 @@ uint8_t parseInput(char c) {
case ESC:
// Handle the escape character
if (isEsc) {
// Add character to buffer and cancel escape
// Add character 0x27 to buffer and clear Escape flag
addPbuf(c);
isEsc = false;
} else {
// Set escape flag
isEsc = true; // Set escape flag
// Flag that we have seen an Escape character
isEsc = true;
}
break;
case PLUS:
Expand All @@ -697,8 +696,6 @@ uint8_t parseInput(char c) {
break;
// Something else?
default: // any char other than defined above
// if (isVerb) dataPort.print(c); // Humans like to see what they are typing...
// Buffer contains '++' (start of command). Stop sending data to serial port by halting GPIB receive.
addPbuf(c);
isEsc = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/AR488/AR488_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


/***** Firmware version *****/
#define FWVER "AR488 GPIB controller, ver. 0.51.28, 16/02/2024"
#define FWVER "AR488 GPIB controller, ver. 0.51.29, 18/03/2024"


/***** BOARD CONFIGURATION *****/
Expand Down
10 changes: 7 additions & 3 deletions src/AR488/AR488_GPIBbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "AR488_Config.h"
#include "AR488_GPIBbus.h"

/***** AR488_GPIB.cpp, ver. 0.51.25, 21/12/2023 *****/
/***** AR488_GPIB.cpp, ver. 0.51.29, 18/03/2024 *****/


/****** Process status values *****/
Expand Down Expand Up @@ -691,13 +691,17 @@ void GPIBbus::sendData(char *data, uint8_t dsize) {
if (cfg.eoi) {
// Send all characters
if (tc) {
state = writeByte(data[i], NO_EOI); // Send EOI with terminator
state = writeByte(data[i], NO_EOI); // Just send the character - EOI will be sent with the terminator
} else {
state = writeByte(data[i], (i == (dsize - 1))); // Send EOI on last character
}
} else {
// Otherwise ignore non-escaped CR, LF and ESC
if ((data[i] != CR) && (data[i] != LF) && (data[i] != ESC)) state = writeByte(data[i], NO_EOI);
// Filter REMOVED as it afftects read of HP3478A cal data
// if ((data[i] != CR) && (data[i] != LF) && (data[i] != ESC)) state = writeByte(data[i], NO_EOI);
// Filter REMOVED as it affects read of HP3478A cal data
//
state = writeByte(data[i], NO_EOI);
}

#ifdef DEBUG_GPIBbus_SEND
Expand Down
2 changes: 1 addition & 1 deletion src/AR488/AR488_GPIBbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#endif
#endif

/***** AR488_GPIBbus.cpp, ver. 0.51.25, 21/12/2023 *****/
/***** AR488_GPIBbus.cpp, ver. 0.51.29, 18/03/2024 *****/


/*********************************************/
Expand Down

0 comments on commit e4f44d9

Please sign in to comment.