From a93b404161dc42f8dee805c8f95bc4974aded9cb Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Sat, 21 Nov 2009 19:27:20 -0800 Subject: improve command handling examples Removes hello and foo commands from top-level registration. Instead, the dummy interface driver and faux flash driver have been augmented to register these commands as sub-commands. --- src/jtag/dummy.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/jtag') diff --git a/src/jtag/dummy.c b/src/jtag/dummy.c index 11b6f71a..c2beb092 100644 --- a/src/jtag/dummy.c +++ b/src/jtag/dummy.c @@ -23,6 +23,7 @@ #include "interface.h" #include "bitbang.h" +#include "../hello.h" /* my private tap controller state, which tracks state for calling code */ @@ -146,12 +147,25 @@ static int dummy_quit(void) return ERROR_OK; } +static const struct command_registration dummy_command_handlers[] = { + { + .name = "dummy", + .mode = COMMAND_ANY, + .help = "dummy interface driver commands", + + .chain = hello_command_handlers, + }, + COMMAND_REGISTRATION_DONE, +}; + /* The dummy driver is used to easily check the code path * where the target is unresponsive. */ struct jtag_interface dummy_interface = { .name = "dummy", + .commands = dummy_command_handlers, + .execute_queue = &bitbang_execute_queue, .speed = &dummy_speed, -- cgit v1.2.3