X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/1b77fa4e36e50258936a4b61fdb11a988d473b1a..0dd441e803f3563839541e7526f8294032aa7743:/avr/cmd_gpio.c diff --git a/avr/cmd_gpio.c b/avr/cmd_gpio.c index 6b7b3f7..8f50ca3 100644 --- a/avr/cmd_gpio.c +++ b/avr/cmd_gpio.c @@ -1,15 +1,12 @@ /* * (C) Copyright 2014 Leo C. * - * SPDX-License-Identifier: GPL-2.0+ + * SPDX-License-Identifier: GPL-2.0 */ -#include "common.h" -#include -#include +#include "cmd_gpio.h" #include -#include "command.h" #include "print-utils.h" #include "getopt-min.h" #include "env.h" @@ -37,7 +34,7 @@ static void pinnames_get(void) /* TODO: enters endless loop on wrong parameters */ - if ((lp = getenv_char(PSTR(ENV_PINALIAS))) != NULL) { + if ((lp = getenv_str(PSTR(ENV_PINALIAS))) != NULL) { pin_names[namestr] = strdup(lp); ptr = strtok_P(pin_names[namestr], delim1); while (ptr != NULL) { @@ -176,7 +173,7 @@ static uint_fast8_t pinarg_get(char * arg, uint_fast8_t pinarg[]) } -command_ret_t do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +command_ret_t do_gpio(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char *const argv[]) { char printheader = 1; uint_fast8_t pinarg[GPIO_MAX]; @@ -185,7 +182,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) {