Rev 7 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 7 | Rev 8 | ||
|---|---|---|---|
| Line 6... | Line 6... | ||
| 6 | */ |
6 | */ |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | #include <stdio.h> |
9 | #include <stdio.h> |
| 10 | #include <string.h> |
10 | #include <string.h> |
| - | 11 | #include <stdlib.h> |
|
| 11 | 12 | ||
| 12 | #include "ch.h" |
13 | #include "ch.h" |
| 13 | #include "hal.h" |
14 | #include "hal.h" |
| 14 | //#include "test.h" |
15 | //#include "test.h" |
| 15 | #include "shell.h" |
16 | #include "shell.h" |
| 16 | #include "evtimer.h" |
17 | #include "evtimer.h" |
| 17 | #include "chprintf.h" |
18 | #include "chprintf.h" |
| 18 | 19 | ||
| 19 | #include "useLidar.h" |
- | |
| 20 | - | ||
| 21 | #include "shellCmds.h" |
20 | #include "shellCmds.h" |
| 22 | 21 | ||
| 23 | 22 | ||
| 24 | static void cmd_mem(BaseChannel *chp, int argc, char *argv[]) { |
23 | static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) { |
| 25 | size_t n, size , largest; |
24 | size_t n, size , largest; |
| 26 | 25 | ||
| 27 | (void) argv; |
26 | (void) argv; |
| 28 | if (argc > 0) { |
27 | if (argc > 0) { |
| 29 | chprintf(chp, "Usage: mem\r\n"); |
28 | chprintf(chp, "Usage: mem\r\n"); |
| Line 53... | Line 52... | ||
| 53 | #else |
52 | #else |
| 54 | uint32_t stklimit = 0U; |
53 | uint32_t stklimit = 0U; |
| 55 | #endif |
54 | #endif |
| 56 | chprintf(chp, "%08lx %08lx %08lx %4lu %4lu %9s %12s" SHELL_NEWLINE_STR, |
55 | chprintf(chp, "%08lx %08lx %08lx %4lu %4lu %9s %12s" SHELL_NEWLINE_STR, |
| 57 | stklimit, (uint32_t)tp->ctx.sp, (uint32_t)tp, |
56 | stklimit, (uint32_t)tp->ctx.sp, (uint32_t)tp, |
| 58 | (uint32_t)tp->refs - 1, (uint32_t)tp->prio, states[tp->state], |
57 | (uint32_t)tp->refs - 1, (uint32_t)tp->realprio, states[tp->state], |
| 59 | tp->name == NULL ? "" : tp->name); |
58 | tp->name == NULL ? "" : tp->name); |
| 60 | tp = chRegNextThread(tp); |
59 | tp = chRegNextThread(tp); |
| 61 | } while (tp != NULL); |
60 | } while (tp != NULL); |
| 62 | } |
61 | } |
| 63 | 62 | ||
| 64 | 63 | ||
| 65 | static void cmd_pll (BaseChannel *chp, int argc, char *argv[]) |
64 | static void cmd_pll (BaseSequentialStream *chp, int argc, char *argv[]) |
| 66 | { |
65 | { |
| 67 | 66 | ||
| 68 | chprintf(chp,"pll "); |
67 | chprintf(chp,"pll "); |
| 69 | 68 | ||
| 70 | if(argc >= 2) |
69 | if(argc >= 2) |
| Line 91... | Line 90... | ||
| 91 | 90 | ||
| 92 | 91 | ||
| 93 | 92 | ||
| 94 | 93 | ||
| 95 | const ShellCommand shellCommands[] = { { "mem", cmd_mem }, { "threads", |
94 | const ShellCommand shellCommands[] = { { "mem", cmd_mem }, { "threads", |
| 96 | cmd_threads }, { "pll", cmd_pll }, { "lidar", shellLidar }, { NULL, NULL } }; |
95 | cmd_threads }, { "pll", cmd_pll }, { NULL, NULL } }; |
| 97 | 96 | ||
| 98 | 97 | ||