This is an automated email from Gerrit. Freddie Chopin ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/427
-- gerrit commit 5745091028fcc24348b94c9a9e7779d8d0757c57 Author: Freddie Chopin <[email protected]> Date: Fri Feb 3 20:37:45 2012 +0100 Add init_board procedure executed after init_targets This adds init_board procedure that behaves exactly the same as init_targets - it can be overriden by "next level" scripts. This procedure is executed after init_targets, allowing common stuff (jtag chain, memory, flash, ...) to be configured in target script (via init_target) and leaving rest (like additional memory, reset configuration, reset-init handlers, ...) to be done in init_board. This makes init_targets scheme more complete and easier to use - current board scripts will not need new init_targets, because everything can be "packed" in init_boards. Moreover it solves the problem of variables being set in init_targets (executed after init), which were not accessible by "linear" scripts (parsed before init). All that has to be done is to enclose all code in board config file in init_board procedure. Change-Id: I0736b1ff9873a687966407d62b58ccf29a8e597b Signed-off-by: Freddie Chopin <[email protected]> diff --git a/src/target/startup.tcl b/src/target/startup.tcl index 425e1ec..02cefb0 100644 --- a/src/target/startup.tcl +++ b/src/target/startup.tcl @@ -159,3 +159,7 @@ proc armv4_5 params { # By default(classic) the config scripts will set up the target configuration proc init_targets {} { } + +# Additionally board config scripts can define a procedure init_board that will be executed after init and init_targets +proc init_board {} { +} diff --git a/src/target/target.c b/src/target/target.c index ab094f9..1f6f120 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1064,6 +1064,10 @@ COMMAND_HANDLER(handle_target_init_command) if (ERROR_OK != retval) return retval; + retval = command_run_line(CMD_CTX, "init_board"); + if (ERROR_OK != retval) + return retval; + LOG_DEBUG("Initializing targets..."); return target_init(CMD_CTX); } -- ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
