X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Ftarget.c;h=60a8a773909129edf126abd8546a4b36c9265b75;hp=ed1a2cc4c4400c48c9607ff02f58c027bbbcf250;hb=8faa419fad72592970911b7973c61a88e785bcc0;hpb=a7e3418258f79d6e0081b8e6d01d8f4268629ded diff --git a/src/target/target.c b/src/target/target.c index ed1a2cc4c4..60a8a77390 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -36,7 +36,7 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H @@ -56,6 +56,9 @@ #include "image.h" #include "rtos/rtos.h" +/* default halt wait timeout (ms) */ +#define DEFAULT_HALT_TIMEOUT 5000 + static int target_read_buffer_default(struct target *target, uint32_t address, uint32_t size, uint8_t *buffer); static int target_write_buffer_default(struct target *target, uint32_t address, @@ -89,6 +92,9 @@ extern struct target_type dsp5680xx_target; extern struct target_type testee_target; extern struct target_type avr32_ap7k_target; extern struct target_type hla_target; +extern struct target_type nds32_v2_target; +extern struct target_type nds32_v3_target; +extern struct target_type nds32_v3m_target; static struct target_type *target_types[] = { &arm7tdmi_target, @@ -113,6 +119,9 @@ static struct target_type *target_types[] = { &testee_target, &avr32_ap7k_target, &hla_target, + &nds32_v2_target, + &nds32_v3_target, + &nds32_v3m_target, NULL, }; @@ -450,7 +459,7 @@ int target_poll(struct target *target) target->halt_issued = false; else { long long t = timeval_ms() - target->halt_issued_time; - if (t > 1000) { + if (t > DEFAULT_HALT_TIMEOUT) { target->halt_issued = false; LOG_INFO("Halt timed out, wake up GDB."); target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT); @@ -2403,7 +2412,7 @@ COMMAND_HANDLER(handle_wait_halt_command) if (CMD_ARGC > 1) return ERROR_COMMAND_SYNTAX_ERROR; - unsigned ms = 5000; + unsigned ms = DEFAULT_HALT_TIMEOUT; if (1 == CMD_ARGC) { int retval = parse_uint(CMD_ARGV[0], &ms); if (ERROR_OK != retval) @@ -5016,7 +5025,7 @@ static int target_create(Jim_GetOptInfo *goi) } /* now - create the new target name command */ - const const struct command_registration target_subcommands[] = { + const struct command_registration target_subcommands[] = { { .chain = target_instance_command_handlers, }, @@ -5025,7 +5034,7 @@ static int target_create(Jim_GetOptInfo *goi) }, COMMAND_REGISTRATION_DONE }; - const const struct command_registration target_commands[] = { + const struct command_registration target_commands[] = { { .name = cp, .mode = COMMAND_ANY,