Skip to content

Commit

Permalink
Make framer_open_p300 more robust (#37)
Browse files Browse the repository at this point in the history
* fixed ">FRAMER: addr was still active FE06" error log

* fixed some formattings (again ...)

* send EOT for all attempts in framer_open_p300()
  • Loading branch information
hmueller01 authored and speters committed Sep 22, 2018
1 parent 7a9ef5d commit 8983732
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/framer.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static int framer_preset_result(char *r_buf, int r_len, unsigned long *petime)
return FRAMER_ERROR;
}

// Synchronization for P300 + switch to P300, back to normal for close -> repeating 05
// Synchronization for P300 + switch to P300, back to normal for close -> repeating P300X_ATTEMPTS
static int framer_close_p300(int fd)
{
char string[100];
Expand Down Expand Up @@ -227,13 +227,13 @@ static int framer_open_p300(int fd)
unsigned long etime;
int rlen;

if (! framer_close_p300(fd)) {
snprintf(string, sizeof(string), ">FRAMER: could not set start condition");
logIT(LOG_ERR, string);
return FRAMER_ERROR;
}

for (i = 0; i < P300X_ATTEMPTS; i++) {
if (! framer_close_p300(fd)) {
snprintf(string, sizeof(string), ">FRAMER: could not set start condition");
logIT(LOG_ERR, string);
return FRAMER_ERROR;
}

if (! my_send(fd, enable, sizeof(enable))) {
framer_set_result(P300_ERROR);
snprintf(string, sizeof(string), ">FRAMER: enable not send");
Expand Down

0 comments on commit 8983732

Please sign in to comment.