
Hi Anatolij,
Up to now only reading 'appreg' value was implemented in the digsyMTC special 'mtc appreg' command. Extend the command to support writing appreg value, too.
Signed-off-by: Werner Pfister Pfister_Werner@intercontrol.de Signed-off-by: Anatolij Gustschin agust@denx.de
board/digsy_mtc/cmd_mtc.c | 46 +++++++++++++++++++++++++++++++++++++++----- 1 files changed, 40 insertions(+), 6 deletions(-)
diff --git a/board/digsy_mtc/cmd_mtc.c b/board/digsy_mtc/cmd_mtc.c index ba0c367..a12becf 100644 --- a/board/digsy_mtc/cmd_mtc.c +++ b/board/digsy_mtc/cmd_mtc.c
[...]
@@ -214,13 +222,34 @@ static int do_mtc_appreg(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv pcmd.cmd_val0 = 5; /* max. Count */ pcmd.cmd_val1 = 5; /* max. Time */ pcmd.cmd_val2 = 0; /* =0 means read appreg */
pcmd.user_out = user_out;
mtc_calculate_checksum(&pcmd); err = msp430_xfer(&pcmd, &prx);
/* on success decide between read or write */ if (!err) {
sprintf(buf, "%d", prx.ack2);
setenv("appreg", buf);
if (argc == 2) {
appreg = simple_strtol(argv[1], NULL, 10);
if (appreg == 0) {
printf("mtc appreg: invalid parameter - "
"must be betwenn 1 and 255\n");
Typo, should be "between"
Otherwise
Acked-by: Detlev Zundel dzu@denx.de
Thanks Detlev