Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
CommandProcessor.cpp
00001 #include "mbed.h" 00002 #include "CommandProcessor.h" 00003 #include "PreferenceWriter.h" 00004 #include "globals.h" 00005 00006 #include "config.h" 00007 #include "config_driving.h" 00008 #include "config_inverter.h" 00009 #include "config_logging.h" 00010 #include "config_loop.h" 00011 #include "config_motor.h" 00012 #include "config_pins.h" 00013 #include "config_table.h" 00014 00015 void processCmd(Serial *pc, PreferenceWriter *pref, char *buf) { 00016 char *tokens[10]; 00017 int len = tokenize(buf, tokens, 10); 00018 00019 switch (len) { 00020 case 1: 00021 if (strcmp(tokens[0], "ls") == 0) cmd_ls(pc); 00022 if (strcmp(tokens[0], "defaults") == 0) cmd_defaults(pc); 00023 if (strcmp(tokens[0], "reload") == 0) cmd_reload(pc, pref); 00024 if (strcmp(tokens[0], "load") == 0) cmd_reload(pc, pref); 00025 if (strcmp(tokens[0], "flush") == 0) cmd_flush(pc, pref); 00026 if (strcmp(tokens[0], "mode") == 0) cmd_ls2(pc, tokens[0]); 00027 if (strcmp(tokens[0], "src") == 0) cmd_ls2(pc, tokens[0]); 00028 if (strcmp(tokens[0], "op") == 0) cmd_ls2(pc, tokens[0]); 00029 if (strcmp(tokens[0], "cfg") == 0) cmd_mode(pc, tokens[0]); 00030 if (strcmp(tokens[0], "zero") == 0) cmd_mode(pc, tokens[0]); 00031 if (strcmp(tokens[0], "wizard") == 0) cmd_mode(pc, tokens[0]); 00032 if (strcmp(tokens[0], "exit") == 0) cmd_exit(pc); 00033 break; 00034 case 2: 00035 if (strcmp(tokens[0], "ls") == 0) cmd_ls2(pc, tokens[1]); 00036 if (strcmp(tokens[0], "get") == 0) cmd_ls2(pc, tokens[1]); 00037 if (strcmp(tokens[0], "setp") == 0) cmd_setp(pc, tokens[1]); 00038 if (strcmp(tokens[0], "mode") == 0) cmd_mode(pc, tokens[1]); 00039 if (strcmp(tokens[0], "src") == 0) cmd_src(pc, tokens[1]); 00040 if (strcmp(tokens[0], "op") == 0) cmd_op(pc, tokens[1]); 00041 break; 00042 case 3: 00043 if (strcmp(tokens[0], "set") == 0) cmd_set(pc, tokens[1], tokens[2]); 00044 default: 00045 break; 00046 } 00047 }
Generated on Wed Jul 13 2022 04:37:22 by
1.7.2