forked from auracaster/openocd
target: add API to temporarily mask target polling
The same flag 'jtag_poll' is currently used as local data for the command 'poll' and to temporarily mask the target polling. This can cause unexpected behavior if the command 'poll' is executed while polling is temporarily masked. Add a new flag 'jtag_poll_en' to hold the temporarily mask condition and keep 'jtag_poll' for the 'poll' command only. While there, change the initial assignment of 'jtag_poll' using the proper boolean value. Change-Id: I18dcf7c65b07aefadf046caaa2fcd2d74fa6fbae Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7009 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
This commit is contained in:
@@ -651,8 +651,8 @@ static int psoc4_write(struct flash_bank *bank, const uint8_t *buffer,
|
||||
if (row_offset)
|
||||
memset(row_buffer, bank->default_padded_value, row_offset);
|
||||
|
||||
bool save_poll = jtag_poll_get_enabled();
|
||||
jtag_poll_set_enabled(false);
|
||||
/* Mask automatic polling triggered by execution of halted events */
|
||||
bool save_poll_mask = jtag_poll_mask();
|
||||
|
||||
while (count) {
|
||||
uint32_t chunk_size = psoc4_info->row_size - row_offset;
|
||||
@@ -693,7 +693,7 @@ static int psoc4_write(struct flash_bank *bank, const uint8_t *buffer,
|
||||
}
|
||||
|
||||
cleanup:
|
||||
jtag_poll_set_enabled(save_poll);
|
||||
jtag_poll_unmask(save_poll_mask);
|
||||
|
||||
free(sysrq_buffer);
|
||||
return retval;
|
||||
|
||||
Reference in New Issue
Block a user