Bladeren bron

Move shell stuff to the pdbs namespace

Clara Hobbs 7 jaren geleden
bovenliggende
commit
357bedb11e
3 gewijzigde bestanden met toevoegingen van 11 en 11 verwijderingen
  1. 1
    1
      src/main.c
  2. 6
    6
      src/shell.c
  3. 4
    4
      src/shell.h

+ 1
- 1
src/main.c Bestand weergeven

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

+ 6
- 6
src/shell.c Bestand weergeven

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

+ 4
- 4
src/shell.h Bestand weergeven

@@ -42,20 +42,20 @@
42 42
 
43 43
 
44 44
 /* Structure for PD Buddy shell commands */
45
-struct pdb_shell_cmd {
45
+struct pdbs_shell_cmd {
46 46
     char *cmd;
47 47
     void (*func)(BaseSequentialStream *chp, int argc, char *argv[]);
48 48
     char *desc;
49 49
 };
50 50
 
51 51
 /* Structure for PD Buddy shell configuration */
52
-struct pdb_shell_cfg {
52
+struct pdbs_shell_cfg {
53 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 60
 bool shellGetLine(BaseSequentialStream *chp, char *line, unsigned size);
61 61
 

Laden…
Annuleren
Opslaan