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.
This commit is contained in:
Zachary T Welch
2009-11-21 19:27:20 -08:00
parent d89c631014
commit a93b404161
5 changed files with 62 additions and 5 deletions

View File

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