- added support for Asix Presto JTAG interface (thanks to Pavel Chromy and Asix for...
[fw/openocd] / src / openocd.c
index 035c166a0aa4cd51afa8db4c838fe28635a81d26..33f876b73e4eecfbd1122bf205990fa7488f316d 100644 (file)
@@ -18,7 +18,7 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
-#define OPENOCD_VERSION "Open On-Chip Debugger (2007-06-28 12:30 CEST)"
+#define OPENOCD_VERSION "Open On-Chip Debugger (2007-07-15 13:15 CEST)"
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -57,6 +57,12 @@ int handle_version_command(struct command_context_s *cmd_ctx, char *cmd, char **
        return ERROR_OK;
 }
 
+void exit_handler(void)
+{
+       /* close JTAG interface */
+       if (jtag && jtag->quit) jtag->quit();
+}
+
 int main(int argc, char *argv[])
 {
        /* initialize commandline interface */
@@ -99,6 +105,8 @@ int main(int argc, char *argv[])
 
        command_set_output_handler(cmd_ctx, configuration_output_handler, NULL);
 
+       atexit(exit_handler);
+
        if (jtag_init(cmd_ctx) != ERROR_OK)
                return EXIT_FAILURE;
        DEBUG("jtag init complete");