X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/05994bd90cb36f10ff72c6a70d7cecc61b67fb2f..910e72069ea19a79e06e7146a5e42d0bb05a9c2f:/avr/cmd_gpio.c diff --git a/avr/cmd_gpio.c b/avr/cmd_gpio.c index 84723d2..d3ef716 100644 --- a/avr/cmd_gpio.c +++ b/avr/cmd_gpio.c @@ -1,3 +1,9 @@ +/* + * (C) Copyright 2014 Leo C. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + #include "common.h" #include #include @@ -29,7 +35,9 @@ static void pinnames_get(void) memset(pin_names, 0, sizeof(pin_names)); pin_names_width = 0; - if ((lp = getenv(PSTR(ENV_PINALIAS))) != NULL) { +/* TODO: enters endless loop on wrong parameters */ + + if ((lp = getenv_char(PSTR(ENV_PINALIAS))) != NULL) { pin_names[namestr] = strdup(lp); ptr = strtok_P(pin_names[namestr], delim1); while (ptr != NULL) { @@ -177,7 +185,7 @@ command_ret_t do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) (void) cmdtp; (void) flag; /* reset getopt() */ - optind = 1; + optind = 0; int opt; while ((opt = getopt(argc, argv, PSTR("s"))) != -1) {