Sarthak-Pandey opened a new pull request, #20646:
URL: https://github.com/apache/nuttx/pull/20646

   ## Summary
   
   Addresses issue #15933 by fixing syntax errors in `include/nuttx/vt100.h`, 
correcting horizontal cursor movement documentation, and adding standard 
parameterless 1-step cursor movement macros.
   
   Key changes:
   1. **Fix syntax errors**:
      - `VT100_NUMERIC_9`: Added missing closing brace (`{'9',` -> `{'9'}`).
      - `VT100_RESET`: Removed space typo in macro name (`#define VT100_RESET 
RIS` -> `#define VT100_RESET`).
   2. **Add 1-step cursor macros**:
      - Added standard parameterless array initializers `VT100_CURSORUP_`, 
`VT100_CURSORDN_`, `VT100_CURSORRT_`, and `VT100_CURSORLF_` (corresponding to 
standard VT100/ANSI `\033[A`, `\033[B`, `\033[C`, `\033[D`).
      - Added string equivalents `VT100_STR_CURSORUP`, `VT100_STR_CURSORDN`, 
`VT100_STR_CURSORRT`, and `VT100_STR_CURSORLF` for `printf`-style output.
   3. **Clarify cursor movement comments**:
      - Corrected comments on `VT100_CURSORRT(n)` and `VT100_CURSORLF(n)` from 
"lines" to "columns".
      - Clarified that `(n)` in static array macros expects character constants 
(`'1'..'9'`).
   4. **Update drivers**:
      - Replaced custom hand-rolled arrays in `graphics/nxterm/nxterm_vt100.c` 
with the newly defined standard macros `VT100_CURSORLF_` and `VT100_CURSORRT_`.
   
   Fixes: #15933
   
   ## Impact
   
   - **Users/Drivers**: Drivers and applications (such as console emulators, 
Framebuffer consoles, and nxterm) now have standard, error-free VT100 cursor 
control macros.
   - **Backward Compatibility**: Fully preserved. Existing macros retain their 
previous behavior while fixing syntax errors and expanding macro options.
   
   ## Testing
   
   1. **Coding Style**:
      - Verified with `nxstyle` across `include/nuttx/vt100.h` and 
`graphics/nxterm/nxterm_vt100.c` (0 errors).
   2. **Macro Compilation & Static Assertions**:
      - Verified that all modified and newly introduced macros expand correctly 
with GCC, matching expected ASCII sequences and buffer lengths.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to