mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
Documentation: nsh: document the top command
The top command was added to nshlib in 2024 but was never documented. Add a section to the NSH commands page covering syntax, options, example output and configuration dependencies, including the Linux-like summary header. Also enable the command in the linum-stm32h753bi:nsh config: procfs, CPU load measurement, stack coloration and task names, so that top and ps are fully functional out of the box. This requires a dedicated interrupt stack and larger IDLE/init task stacks: with SCHED_CPULOAD the per-tick accounting runs in interrupt context, and with ARCH_INTERRUPTSTACK=0 it lands on the stack of the interrupted task, overflowing the 1 KiB IDLE stack and corrupting the adjacent heap. Also add the VT100 escape sequences used by the top command screen refresh as string literals in include/nuttx/vt100.h (VT100_STR_*), next to the existing VT100_FMT_* definitions. Tested on hardware. Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
This commit is contained in:
parent
4a927bc7e0
commit
b7305d8780
4 changed files with 73 additions and 3 deletions
|
|
@ -225,6 +225,15 @@
|
|||
#define VT100_FMT_HVPOS "\033[%d;%df" /* Move cursor to screen location v,h */
|
||||
#define VT52_FMT_CURSORPOS "\033%d%d" /* Move cursor to v,h location */
|
||||
|
||||
/* VT100 escape sequences as strings, suitable for printf-style output */
|
||||
|
||||
#define VT100_STR_CLEARSCREEN "\033[2J" /* Clear entire screen */
|
||||
#define VT100_STR_CURSORHOME "\033[1;1H" /* Move cursor to upper left corner */
|
||||
#define VT100_STR_CLEAREOL "\033[K" /* Erase to end of current line */
|
||||
#define VT100_STR_CLEAREOS "\033[J" /* Erase to end of screen */
|
||||
#define VT100_STR_BOLD "\033[1m" /* Turn bold mode on */
|
||||
#define VT100_STR_MODESOFF "\033[0m" /* Turn off character attributes */
|
||||
|
||||
/* VT100 Special Key Codes
|
||||
*
|
||||
* These are sent from the terminal back to the computer when the particular
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue