diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-09-25 21:24:55 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-09-25 21:24:55 +0000 |
commit | fd0d41353777804d890caf150c749da928da4d79 (patch) | |
tree | 9278307eb81e760066cbe758f227edffa5a790b6 /cli_classic.c | |
parent | 98feaa5c2cd4f6b217ac0dbf57d1b5254bbdcd81 (diff) | |
download | ast2050-flashrom-fd0d41353777804d890caf150c749da928da4d79.zip ast2050-flashrom-fd0d41353777804d890caf150c749da928da4d79.tar.gz |
Introduce a compile time option to select a default programmer
Heavily influenced by a discussion with (and based on code from) Peter Stuge.
Please read the comment in the Makefile before using this option.
Corresponding to flashrom svn r1607.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'cli_classic.c')
-rw-r--r-- | cli_classic.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/cli_classic.c b/cli_classic.c index 58696ad..4ae375c 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -402,11 +402,17 @@ int main(int argc, char *argv[]) } if (prog == PROGRAMMER_INVALID) { - msg_perr("Please select a programmer with the --programmer parameter.\n" - "Valid choices are:\n"); - list_programmers_linebreak(0, 80, 0); - ret = 1; - goto out; + if (CONFIG_DEFAULT_PROGRAMMER != PROGRAMMER_INVALID) { + prog = CONFIG_DEFAULT_PROGRAMMER; + msg_pinfo("Using default programmer \"%s\".\n", + programmer_table[CONFIG_DEFAULT_PROGRAMMER].name); + } else { + msg_perr("Please select a programmer with the --programmer parameter.\n" + "Valid choices are:\n"); + list_programmers_linebreak(0, 80, 0); + ret = 1; + goto out; + } } /* FIXME: Delay calibration should happen in programmer code. */ |