Browse Source

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

pull/907/head
Thiadmer Riemersma 3 years ago
committed by UweBonnes
parent
commit
be534a9c5e
  1. 18
      src/gdb_main.c
  2. 2
      src/morse.c

18
src/gdb_main.c

@ -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");

2
src/morse.c

@ -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
}

Loading…
Cancel
Save