Skip to content

Commit

Permalink
Maximum list prints
Browse files Browse the repository at this point in the history
  • Loading branch information
preston-rogers committed Sep 5, 2024
1 parent fecf840 commit 0da856d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/jsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,18 @@ void jsd_inspect_context(jsd_t* self) {
if (self->ecx_context.ecaterror) {
MSG("We experienced an ECAT error. When this occurs, error information aught to be saved. "
"Errors in error list displayed below:\n");
while(self->ecx_context.ecaterror) MSG("%s\n", ecx_elist2string(&self->ecx_context));
MSG("Went through all errors in the elist stack.\n");
uint8_t i = 0;
while(self->ecx_context.ecaterror && i < JSD_ELIST_MAX_READS) {
MSG("%s\n", ecx_elist2string(&self->ecx_context));
i++;
}
if (i == JSD_ELIST_MAX_READS) {
MSG("Maximum number of reads from error list experienced."
" This is likely a result of indefinite polling.");
}
else {
MSG("Finished reporting errors in error list.");
}
}
else {
MSG("Despite some slaves not being operational, an ECAT error was not experienced.");
Expand Down
1 change: 1 addition & 0 deletions src/jsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extern "C" {
#include "jsd/jsd_pub.h"

#define JSD_PO2OP_MAX_ATTEMPTS 3
#define JSD_ELIST_MAX_READS 100

/**
* @brief converts ec_state int to human-readable string
Expand Down

0 comments on commit 0da856d

Please sign in to comment.