mirror of
https://github.com/lupyuen/pinephone-nuttx.git
synced 2025-01-12 20:58:34 +08:00
Update doc
This commit is contained in:
parent
746ea1f72c
commit
aadeec0a47
1 changed files with 11 additions and 3 deletions
14
README.md
14
README.md
|
@ -5644,11 +5644,15 @@ Let's create a Terminal App in LVGL, that will let us interact with the NuttX NS
|
|||
|
||||
![LVGL Terminal for NuttX](https://lupyuen.github.io/images/lvgl2-terminal2.jpg)
|
||||
|
||||
We begin by piping a command to NSH Shell...
|
||||
|
||||
# Pipe a Command to NuttX NSH Shell
|
||||
|
||||
Our LVGL Terminal App needs to...
|
||||
|
||||
1. Start the NSH Task
|
||||
1. Start the NuttX Task for NSH Shell
|
||||
|
||||
1. Redirect the Console Input / Output to LVGL
|
||||
1. Redirect the NSH Console Input / Output to LVGL
|
||||
|
||||
Here's a simple test that starts the NSH Task and sends a command to NSH Console via a POSIX Pipe: [lvgldemo.c](https://github.com/lupyuen2/wip-pinephone-nuttx-apps/blob/a9d67c135c458088946ed35c1b24be1b4aee3553/examples/lvgldemo/lvgldemo.c#L246-L390)
|
||||
|
||||
|
@ -5852,7 +5856,7 @@ has_input: timeout: fd=8
|
|||
|
||||
[(See the Complete Log)](https://github.com/lupyuen2/wip-pinephone-nuttx-apps/blob/c30e1968d5106794f435882af69dfb7b1858d694/examples/lvgldemo/lvgldemo.c#L403-L556)
|
||||
|
||||
Let's talk about the LVGL Timer...
|
||||
This polling needs to be done in an LVGL Timer, here's why...
|
||||
|
||||
# Timer for LVGL Terminal
|
||||
|
||||
|
@ -5920,6 +5924,8 @@ But LVGL is NOT Thread-Safe. Thus we need a Mutex to lock the LVGL Widgets, whic
|
|||
|
||||
For now, it's simpler to run an LVGL Timer to poll for NSH Output.
|
||||
|
||||
Let's add the polling to the LVGL Timer Callback...
|
||||
|
||||
# Poll for NSH Output in LVGL Timer
|
||||
|
||||
In the previous section we've created an LVGL Timer that's triggered periodically.
|
||||
|
@ -6024,6 +6030,8 @@ nsh>
|
|||
|
||||
[(See the Complete Log)](https://github.com/lupyuen2/wip-pinephone-nuttx-apps/blob/c30e1968d5106794f435882af69dfb7b1858d694/examples/lvgldemo/lvgldemo.c#L403-L556)
|
||||
|
||||
Now that our background processing is ready, let's render the LVGL Widgets for our terminal...
|
||||
|
||||
# Render Terminal with LVGL Widgets
|
||||
|
||||
TODO: Use the [LVGL Keyboard Widget](https://docs.lvgl.io/master/widgets/keyboard.html)
|
||||
|
|
Loading…
Reference in a new issue