diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-21 19:27:20 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-25 10:29:05 -0800 |
commit | a93b404161dc42f8dee805c8f95bc4974aded9cb (patch) | |
tree | 5dcb1dc0658288fd0385f77bc46a221fbdc06c6f /src/jtag/dummy.c | |
parent | d89c6310146d9e5fd1a4ab364f09c0f841da5c73 (diff) |
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.
Diffstat (limited to 'src/jtag/dummy.c')
-rw-r--r-- | src/jtag/dummy.c | 14 |
1 files changed, 14 insertions, 0 deletions
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, |