Kees Jongenburger <kees.jongenburger@gmail.com> old" syntax target command appears...
[fw/openocd] / src / target / target_request.c
index 3487f160285a0e16d11ab8e3563940fd272a5e11..b266fea5ed48d0854a1305f16eb7433df1f8dcb4 100644 (file)
@@ -2,6 +2,12 @@
  *   Copyright (C) 2007 by Dominic Rath                                    *
  *   Dominic.Rath@gmx.de                                                   *
  *                                                                         *
+ *   Copyright (C) 2007,2008 Ã˜yvind Harboe                                 *
+ *   oyvind.harboe@zylin.com                                               *
+ *                                                                         *
+ *   Copyright (C) 2008 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
@@ -173,18 +179,18 @@ int add_debug_msg_receiver(struct command_context_s *cmd_ctx, target_t *target)
 
 debug_msg_receiver_t* find_debug_msg_receiver(struct command_context_s *cmd_ctx, target_t *target)
 {
-       int all_targets = 0;
+       int do_all_targets = 0;
        debug_msg_receiver_t **p = &target->dbgmsg;
        
        /* if no target has been specified search all of them */
        if (target == NULL)
        {
                /* if no targets haven been specified */
-               if (targets == NULL)
+               if (all_targets == NULL)
                        return NULL;
 
-               target = targets;
-               all_targets = 1;
+               target = all_targets;
+               do_all_targets = 1;
        }
        
        do
@@ -199,7 +205,7 @@ debug_msg_receiver_t* find_debug_msg_receiver(struct command_context_s *cmd_ctx,
                }
                
                target = target->next;
-       } while (target && all_targets);
+       } while (target && do_all_targets);
        
        return NULL;
 }
@@ -208,17 +214,17 @@ int delete_debug_msg_receiver(struct command_context_s *cmd_ctx, target_t *targe
 {
        debug_msg_receiver_t **p;
        debug_msg_receiver_t *c;
-       int all_targets = 0;
+       int do_all_targets = 0;
        
        /* if no target has been specified search all of them */
        if (target == NULL)
        {
                /* if no targets haven been specified */
-               if (targets == NULL)
+               if (all_targets == NULL)
                        return ERROR_OK;
                
-               target = targets;
-               all_targets = 1;
+               target = all_targets;
+               do_all_targets = 1;
        }
 
        do
@@ -245,7 +251,7 @@ int delete_debug_msg_receiver(struct command_context_s *cmd_ctx, target_t *targe
                }
        
                target = target->next;
-       } while (target && all_targets);
+       } while (target && do_all_targets);
        
        return ERROR_OK;
 }
@@ -298,7 +304,7 @@ int target_request_register_commands(struct command_context_s *cmd_ctx)
                register_command(cmd_ctx, NULL, "target_request", NULL, COMMAND_ANY, "target_request commands");
        
        register_command(cmd_ctx, target_request_cmd, "debugmsgs", handle_target_request_debugmsgs_command,
-               COMMAND_EXEC, "enable/disable reception of debug messgages from target");
+               COMMAND_EXEC, "enable/disable reception of debug messages from target");
 
        return ERROR_OK;
 }