Turn error LED off after successful attach to target (error LED blinks on 'target lost').

This commit is contained in:
Thiadmer Riemersma 2021-08-06 22:28:15 +02:00 committed by UweBonnes
parent 72bd825a60
commit be534a9c5e
2 changed files with 12 additions and 8 deletions

View File

@ -284,6 +284,8 @@ int gdb_main_loop(struct target_controller *tc, bool in_syscall)
else if(last_target) {
cur_target = target_attach(last_target,
&gdb_controller);
if(cur_target)
morse(NULL, false);
target_reset(cur_target);
}
break;
@ -428,9 +430,10 @@ handle_v_packet(char *packet, int plen)
if (sscanf(packet, "vAttach;%08lx", &addr) == 1) {
/* Attach to remote target processor */
cur_target = target_attach_n(addr, &gdb_controller);
if(cur_target)
if(cur_target) {
morse(NULL, false);
gdb_putpacketz("T05");
else
} else
gdb_putpacketz("E01");
} else if (!strncmp(packet, "vRun", 4)) {
@ -470,12 +473,13 @@ handle_v_packet(char *packet, int plen)
cur_target = target_attach(last_target,
&gdb_controller);
/* If we were able to attach to the target again */
if (cur_target) {
/* If we were able to attach to the target again */
if (cur_target) {
target_set_cmdline(cur_target, cmdline);
target_reset(cur_target);
gdb_putpacketz("T05");
} else gdb_putpacketz("E01");
target_reset(cur_target);
morse(NULL, false);
gdb_putpacketz("T05");
} else gdb_putpacketz("E01");
} else gdb_putpacketz("E01");

View File

@ -64,7 +64,7 @@ void morse(const char *msg, char repeat)
DEBUG_WARN("%s\n", msg);
(void) repeat;
#else
morse_msg = morse_ptr = msg;
morse_msg = morse_ptr = msg;
morse_repeat = repeat;
#endif
}