Browse Source

Move shell stuff to the pdbs namespace

Clara Hobbs 6 years ago
parent
commit
357bedb11e
3 changed files with 11 additions and 11 deletions
  1. 1
    1
      src/main.c
  2. 6
    6
      src/shell.c
  3. 4
    4
      src/shell.h

+ 1
- 1
src/main.c View File

107
     usbConnectBus(serusbcfg.usbp);
107
     usbConnectBus(serusbcfg.usbp);
108
 
108
 
109
     /* Start the shell */
109
     /* Start the shell */
110
-    pdb_shell();
110
+    pdbs_shell();
111
 }
111
 }
112
 
112
 
113
 /*
113
 /*

+ 6
- 6
src/shell.c View File

382
 /*
382
 /*
383
  * List of shell commands
383
  * List of shell commands
384
  */
384
  */
385
-static const struct pdb_shell_cmd commands[] = {
385
+static const struct pdbs_shell_cmd commands[] = {
386
     {"license", cmd_license, "Show copyright and license information"},
386
     {"license", cmd_license, "Show copyright and license information"},
387
     {"erase", cmd_erase, "Erase all stored configuration"},
387
     {"erase", cmd_erase, "Erase all stored configuration"},
388
     {"write", cmd_write, "Store the configuration buffer"},
388
     {"write", cmd_write, "Store the configuration buffer"},
404
 /*
404
 /*
405
  * The shell's configuration
405
  * The shell's configuration
406
  */
406
  */
407
-const struct pdb_shell_cfg shell_cfg = {
407
+const struct pdbs_shell_cfg shell_cfg = {
408
     (BaseSequentialStream *)&SDU1,
408
     (BaseSequentialStream *)&SDU1,
409
     commands
409
     commands
410
 };
410
 };
430
     return *token ? token : NULL;
430
     return *token ? token : NULL;
431
 }
431
 }
432
 
432
 
433
-static void list_commands(BaseSequentialStream *chp, const struct pdb_shell_cmd *scp)
433
+static void list_commands(BaseSequentialStream *chp, const struct pdbs_shell_cmd *scp)
434
 {
434
 {
435
     while (scp->cmd != NULL) {
435
     while (scp->cmd != NULL) {
436
         chprintf(chp, "\t%s: %s\r\n", scp->cmd, scp->desc);
436
         chprintf(chp, "\t%s: %s\r\n", scp->cmd, scp->desc);
438
     }
438
     }
439
 }
439
 }
440
 
440
 
441
-static bool cmdexec(const struct pdb_shell_cmd *scp, BaseSequentialStream *chp,
441
+static bool cmdexec(const struct pdbs_shell_cmd *scp, BaseSequentialStream *chp,
442
         char *name, int argc, char *argv[])
442
         char *name, int argc, char *argv[])
443
 {
443
 {
444
     while (scp->cmd != NULL) {
444
     while (scp->cmd != NULL) {
454
 /*
454
 /*
455
  * PD Buddy Sink configuration shell
455
  * PD Buddy Sink configuration shell
456
  */
456
  */
457
-void pdb_shell(void)
457
+void pdbs_shell(void)
458
 {
458
 {
459
     int n;
459
     int n;
460
     BaseSequentialStream *chp = shell_cfg.io;
460
     BaseSequentialStream *chp = shell_cfg.io;
461
-    const struct pdb_shell_cmd *scp = shell_cfg.commands;
461
+    const struct pdbs_shell_cmd *scp = shell_cfg.commands;
462
     char *lp, *cmd, *tokp, line[PDB_SHELL_MAX_LINE_LENGTH];
462
     char *lp, *cmd, *tokp, line[PDB_SHELL_MAX_LINE_LENGTH];
463
     char *args[PDB_SHELL_MAX_ARGUMENTS + 1];
463
     char *args[PDB_SHELL_MAX_ARGUMENTS + 1];
464
 
464
 

+ 4
- 4
src/shell.h View File

42
 
42
 
43
 
43
 
44
 /* Structure for PD Buddy shell commands */
44
 /* Structure for PD Buddy shell commands */
45
-struct pdb_shell_cmd {
45
+struct pdbs_shell_cmd {
46
     char *cmd;
46
     char *cmd;
47
     void (*func)(BaseSequentialStream *chp, int argc, char *argv[]);
47
     void (*func)(BaseSequentialStream *chp, int argc, char *argv[]);
48
     char *desc;
48
     char *desc;
49
 };
49
 };
50
 
50
 
51
 /* Structure for PD Buddy shell configuration */
51
 /* Structure for PD Buddy shell configuration */
52
-struct pdb_shell_cfg {
52
+struct pdbs_shell_cfg {
53
     BaseSequentialStream *io;
53
     BaseSequentialStream *io;
54
-    const struct pdb_shell_cmd *commands;
54
+    const struct pdbs_shell_cmd *commands;
55
 };
55
 };
56
 
56
 
57
 
57
 
58
-void pdb_shell(void);
58
+void pdbs_shell(void);
59
 
59
 
60
 bool shellGetLine(BaseSequentialStream *chp, char *line, unsigned size);
60
 bool shellGetLine(BaseSequentialStream *chp, char *line, unsigned size);
61
 
61
 

Loading…
Cancel
Save