OSDN Git Service

[UART][v2.0] Enable to shell.Work temporally.
[openi2cradio/OpenI2CRadio.git] / term_shell.c
index 93511f4..7708797 100644 (file)
@@ -358,17 +358,17 @@ char term_shell(unsigned int timeout)
     do {
         uart_term_putstr("\n$>");
         uart_term_getstr(cmd_shellstr, 128, 1); // With Echo
-
-        ii = shell_gettok(pool, cmd_shellstr);
+        ClrWdt();
+//        ii = shell_gettok(pool, cmd_shellstr);
 //        if(ii >= 128) return SHELL_CMD_TOOLONG;
-        if(ii >= 128) continue; // Discard
+//        if(ii >= 128) continue; // Discard
 
         for(t = 0; t < SHELL_TOPCMDS; t++){
-            i = shell_strcmp((char *)cmdstr[t], pool);
+            i = shell_strcmp((char *)cmdstr[t], cmd_shellstr);
             if(i > 0) break;
         }
         //if(i <= 0) return SHELL_CMD_NOTFOUND;
-        ii = shell_gettok(pool, &cmd_shellstr[ii]);
+        //ii = shell_gettok(pool, &cmd_shellstr[ii]);
         switch(t){
             case 0:
                 cmd_help(pool);
@@ -390,12 +390,14 @@ char term_shell(unsigned int timeout)
                 break;
             case 15: // Exit
                 uart_term_putstr("\nBye... (^^)/~~\n");
+               uart_init();
                 return SHELL_CMD_OK;
                 break;
             default:
                 uart_term_putstr("\n?? CMD Error\n");
                 break;
         }
+
     } while(1);
     return SHELL_CMD_OK;
 }