]> git.sur5r.net Git - openocd/blobdiff - src/target/target.c
Michael Bruck: fixed warnings
[openocd] / src / target / target.c
index 377bb0dc07dbd9f9c9ea4dd19cdc8787778fd46d..baf57565cc9988e06dec1ec84aba9689e36c0e8d 100644 (file)
@@ -122,7 +122,7 @@ char *target_debug_reason_strings[] =
 {
        "debug request", "breakpoint", "watchpoint",
        "watchpoint and breakpoint", "single step",
-       "target not halted"
+       "target not halted", "undefined"
 };
 
 char *target_endianess_strings[] =
@@ -362,7 +362,9 @@ int target_process_reset(struct command_context_s *cmd_ctx)
                                                command_print(cmd_ctx, "Timed out waiting for reset");
                                                goto done;
                                        }
-                                       usleep(100*1000); /* Do not eat all cpu */
+                                       /* this will send alive messages on e.g. GDB remote protocol. */
+                                       usleep(500*1000); 
+                                       USER_N("%s", ""); /* avoid warning about zero length formatting message*/ 
                                        goto again;
                                }
                        }
@@ -1178,6 +1180,7 @@ int handle_target_command(struct command_context_s *cmd_ctx, char *cmd, char **a
                                (*last_target_p)->backup_working_area = 0;
                                
                                (*last_target_p)->state = TARGET_UNKNOWN;
+                               (*last_target_p)->debug_reason = DBG_REASON_UNDEFINED;
                                (*last_target_p)->reg_cache = NULL;
                                (*last_target_p)->breakpoints = NULL;
                                (*last_target_p)->watchpoints = NULL;
@@ -1698,8 +1701,6 @@ int handle_resume_command(struct command_context_s *cmd_ctx, char *cmd, char **a
 
        target_process_events(cmd_ctx);
        
-       target_arch_state(target);
-       
        return retval;
 }