Skip to content

Commit

Permalink
Remove use of g_sbuf in JTAG mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Baldanos committed Jan 22, 2021
1 parent eef1d49 commit 5dca6b4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/hydrabus/hydrabus_mode_jtag.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,11 @@ void openOCD(t_hydra_console *con)

uint8_t ocd_command, values;
uint8_t ocd_parameters[2] = {0};
static uint8_t *buffer = (uint8_t *)g_sbuf;
uint8_t *buffer = pool_alloc_bytes(0x2000); // 8192 bytes - magic value from bus pirate

if(buffer == 0) {
return;
}

while (!hydrabus_ubtn()) {
if(chnReadTimeout(con->sdu, &ocd_command, 1, 1)) {
Expand Down Expand Up @@ -731,7 +735,7 @@ void openOCD(t_hydra_console *con)
cprintf(con, "%c%c%c", CMD_OCD_TAP_SHIFT, ocd_parameters[0],
ocd_parameters[1]);

chnRead(con->sdu, g_sbuf,((num_sequences+7)/8)*2);
chnRead(con->sdu, buffer,((num_sequences+7)/8)*2);
i=0;
while(num_sequences>0) {
bits = (num_sequences > 8) ? 8 : num_sequences;
Expand All @@ -752,6 +756,7 @@ void openOCD(t_hydra_console *con)
}
}
}
pool_free(buffer);
}

void jtag_enter_openocd(t_hydra_console *con)
Expand Down

0 comments on commit 5dca6b4

Please sign in to comment.