]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cmd_cpu.c
reset optind before executing command
[z180-stamp.git] / avr / cmd_cpu.c
index 6f50a2a628fc57b6878cbbc8e4f07ed02a9e3e9c..d69221100e25ab3efe5c208e3f5f613b1df36bd0 100644 (file)
@@ -204,9 +204,6 @@ command_ret_t do_cpu_test(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int
 
        uint32_t pulsewidth = 10; /* ms */
 
-       /* reset getopt() */
-       optind = 0;
-
        int opt;
        while ((opt = getopt(argc, argv, PSTR("t:"))) != -1) {
                switch (opt) {
@@ -237,8 +234,6 @@ command_ret_t do_bus_test(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int
        char ch;
 
 #if 0
-       /* reset getopt() */
-       optind = 0;
        int opt;
        while ((opt = getopt(argc, argv, PSTR("t:"))) != -1) {
                switch (opt) {
@@ -331,9 +326,6 @@ command_ret_t do_cpu_freq(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int
        uint8_t eimsk_save;
        uint8_t mem_save[cpuinfo_length];
 
-       /* reset getopt() */
-       optind = 0;
-
        int opt;
        while ((opt = getopt(argc, argv, PSTR("swnuc:t:"))) != -1) {
                switch (opt) {