Commit graph

607 commits

Author SHA1 Message Date
Acfboy
6870186707 graphics/microwindows: fix missing HAVE_FNT_SUPPORT in Makefile
Without this Make variable, Objects.rules does not add font_fnt.o
to the build, causing undefined reference to fnt_createfont at link time.

Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-07-30 09:42:18 +02:00
Acfboy
ae601e2892 graphics/microwindows: introduce Microwindows graphics support to NuttX
This commit integrates the Microwindows core into the NuttX apps
build system:

- Downloads a pinned upstream commit during build and compiles the
  engine, drivers and precompiled bitmap fonts via Microwindows'
  Objects.rules files.
- Adds Kconfig options for framebuffer path, keyboard driver
  selection (event-mode, raw byte-stream, none, custom), and
  mouse/touchscreen driver selection (relative, touchscreen, none,
  custom).
- Uses the MWCONFIG_FILE mechanism to inject NuttX-specific
  configuration (mwconfig.nuttx) without modifying upstream headers.
- The NuttX screen, keyboard, mouse and touchscreen drivers are
  pulled from upstream Microwindows. Driver selection is controlled
  via ARCH=NUTTX and Kconfig-driven KEYBOARD/MOUSE variables in
  the Makefile.
- Depends on VIDEO_FB for the framebuffer device.
- Builds the mwin library (Win32 API layer) when MICROWINDOWS_MWIN
  is enabled.

Co-authored-by: Pavel Pisa <ppisa@pikron.com>
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-07-28 09:53:05 +02:00
Xiang Xiao
f9f59bd0f8 !apps: drop redundant casts on tv_sec/tv_nsec and fix printf formats
Now that time_t is unconditionally 64-bit (signed int64_t) and the
struct timespec fields tv_sec / tv_nsec are wide enough on their own,
the explicit (uint64_t)/(int64_t)/(int) casts that used to guard the
multiplications and subtractions in *_us / *_ms / *_ns helpers are no
longer needed.  Drop them to keep the timekeeping math readable.

In the same spirit, this commit also normalises the printf-style format
specifiers and casts used to print tv_sec / tv_nsec / tv_usec values.
The prior code was a mix of "%d"/"%u"/"%ld"/"%lu"/"%lld" with matching
(int)/(unsigned long)/(long long) casts; some formats truncated time_t
on 32-bit hosts, others mismatched signedness or width.  Replace all
such cases with the portable POSIX-recommended forms:

  - tv_sec  (time_t,       signed, impl-defined width) -> %jd  + (intmax_t)
  - tv_nsec (long,         signed)                     -> %ld  (no cast)
  - tv_usec (suseconds_t / long)                       -> %ld  (no cast)

Also drop two stale `(FAR const time_t *)&ts.tv_sec` casts that are
unnecessary now that ts.tv_sec is plain time_t.

Arithmetic-cleanup files (existing scope):

  - benchmarks/cyclictest/cyclictest.c:        timediff_us()
  - benchmarks/sd_bench/sd_bench_main.c:       get_time_delta_us()
  - examples/oneshot/oneshot_main.c:           maxus computation
  - examples/watchdog/watchdog_main.c:         current_time_ms (x2)
  - industry/nxmodbus/nxmb_internal.h:         nxmb_util_clock_ms()
  - netutils/ntpclient/ntpclient.c:            timespec2ntp()
  - netutils/ptpd/ptpd.c:                      ptp_adjtime()
  - system/dd/dd_main.c:                       elapsed accounting
  - testing/drivers/drivertest/drivertest_posix_timer.c:
                                               get_timestamp()
  - testing/drivers/sd_stress/sd_stress_main.c:get_time_delta()
  - testing/sched/getprime/getprime_main.c:    elapsed accounting
  - testing/sched/pthread_mutex_perf/pthread_mutex_perf.c:
                                               timespec_avg()

Printf-format-fix files (new in this revision):

  - examples/adjtime/adjtime_main.c
  - examples/charger/charger_main.c
  - examples/netpkt/netpkt_ethercat.c
  - fsutils/mkfatfs/mkfatfs.c
  - graphics/tiff/tiff_initialize.c
  - netutils/ptpd/ptpd.c
  - nshlib/nsh_timcmds.c
  - system/coredump/coredump.c
  - system/ptpd/ptpd_main.c
  - testing/drivers/drivertest/drivertest_oneshot.c
  - testing/mm/kasantest/kasantest.c
  - testing/ostest/semtimed.c
  - testing/sched/pthread_mutex_perf/pthread_mutex_perf.c
  - testing/sched/timerjitter/timerjitter.c
  - testing/testsuites/kernel/time/cases/clock_test_clock01.c
  - testing/testsuites/kernel/time/cases/clock_test_smoke.c

No behavioural change.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-22 13:38:25 +08:00
Matteo Golin
5b0cae9ab0 !apps: Simplify NuttX initialization
BREAKING: In an effort to simplify board initialization logic for NuttX,
NSH will no longer support architecture initialization. This will happen
during boot via the BOARD_LATE_INITIALIZE option. The boardctl command
BOARDIOC_INIT is also no longer available from user-space.

Quick fix:
Any application relying on BOARDIOC_INIT should now enable
BOARD_LATE_INITIALIZE to have initialization performed by the kernel in
advance of the application running. If control over initialization is
still necessary, BOARDIOC_FINALINIT should be implemented and used.
Boards relying on NSH for initialization should also enable
BOARD_LATE_INITIALIZE instead.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-06 13:27:05 +08:00
Serg Podtynnyi
ded0a17514 graphics/lvgl: bump version to 9.2.2
Update lvlg version to 9.2.2, includes fix for nuttx lcd release
Get version from config in Makefile
Get version from config in cmake file

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2026-05-03 17:39:10 +02:00
Piyush Patle
96a003072d include/debug.h: fix checkpatch fallout in touched apps files
Clean up style issues in the files touched by the <nuttx/debug.h> include
migration so the full apps-side PR passes checkpatch.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-11 10:39:27 -03:00
Piyush Patle
9d849adfab include/debug.h: Use <nuttx/debug.h> in apps
Replace app-side includes of <debug.h> with <nuttx/debug.h> to use the
header from the NuttX tree explicitly after the header move.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-11 10:39:27 -03:00
liuhongchao
a6286ee0ea graphics/input: Add getevent input event monitor tool.
Add getevent utility for monitoring input events including
mouse clicks/movement, multi-touch coordinates/pressure,
and keyboard key presses. Supports automatic device detection
in /dev and command-line device path specification with
non-blocking I/O.

Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2026-04-09 11:59:19 +02:00
Lup Yuen Lee
9db3e26c85 graphics/libyuv: Download libyuv from NuttX Mirror Repo
NuttX Build Target `sim:nxcamera` failed to build because chromium.googlesource.com is blocking our download of libyuv library: https://github.com/apache/nuttx/actions/runs/24106742084/job/70356374433#step:10:603

```
Configuration/Tool: sim/nxcamera
Building NuttX...
curl -L https://chromium.googlesource.com/libyuv/libyuv/+archive/refs/heads/stable.tar.gz -o libyuv.tar.gz
gzip: stdin: not in gzip format
```

This PR updates the libyuv Makefile to download libyuv from the NuttX Mirror Repo instead: https://github.com/NuttX/nuttx/releases/tag/libyuv

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2026-04-08 18:40:26 +08:00
zhanghongyu
3e3b8c6936 graphics/libyuv: fix the typo.
fix the typo.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 16:46:40 +08:00
Kevin Witteveen (MartiniMarter)
452ae235c6 graphics/jpgresizetool: Add libjpeg resize tool
Add a libjpeg based JPEG resize tool.
Simple resizer that can resize JPEGs using
"jpgresize input.jpg output.jpg scale_denom(1,2,4,8) quality%".
Tries to use little memory by scanning per line.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-10-27 00:14:45 +08:00
liuchan3
fdf6f57d6c graphics/input: Adjust input tool priority and sampling rate
Align to monkey's priority, with a sampling rate similar to a real touch.

Signed-off-by: liuchan3 <liuchan3@xiaomi.com>
2025-08-12 20:20:01 +08:00
liuchan3
6f93e401aa apps/graphics: Refactor the input tool using input generator library
Signed-off-by: liuchan3 <liuchan3@xiaomi.com>
2025-08-12 20:20:01 +08:00
liuchan3
36b117c00a apps/graphics: Refactor monkey using input generator library
Signed-off-by: liuchan3 <liuchan3@xiaomi.com>
2025-08-12 20:20:01 +08:00
Zhe Weng
7bfd5e5790 apps/system: Move input/monkey to apps/graphics/input
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-08-12 20:20:01 +08:00
Zhe Weng
7a2d5bbc64 apps/graphics: Add input generator library
We can use it to unify our monkey / input tools, and for other input
generation purposes easily.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-08-12 20:20:01 +08:00
Kevin Witteveen (MartiniMarter)
6bca3c2ca2 Add JPEG compressor support to Makefile
Before this PR only the decompressor files were added to the Makefile.
Now all the required compressor files are added.
Decompression and compression tested on STM32H7 with 1:8 JPEG scaling.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-07-17 13:54:22 +08:00
raiden00pl
3764ab041a cmake: remove empty strings from FetchContent
remove empty strings from FetchContent to eliminate cmake build warnings like this:

CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1564 (cmake_parse_arguments):
  The BUILD_COMMAND keyword was followed by an empty string or no value at
  all.  Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
  ARG_BUILD_COMMAND variable rather than setting it to an empty string.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 14:20:21 +08:00
Alin Jerpelea
c8ec20fe4d graphics: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Daniel Jasinski
eec957a514 build: increase FetchContent timeout to 120 seconds for LVGL
LVGL 9.2.1 archive is ~70MB. Over poor connections, it may take
longer to download it. This renders CMake build unusable in such
environments.

Signed-off-by: Daniel Jasinski <jasinskidaniel95szcz@gmail.com>
2024-11-09 23:32:45 +08:00
Neo Xu
1506c6f54d lvgl: upgrade to release/v9.2.1
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-25 09:27:15 +02:00
Petro Karashchenko
161c996079 apps: use sizeof array in snprintf
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-02 10:40:05 +02:00
pengyiqiang
c0d8a07042 lvgl/Makefile: support multiple options for LV_OPTLEVEL
This configuration is added to put LVGL into PSRAM for execution, and the lv_*.o file needs to be matched in the link script. Since LTO optimization will cause the file name to be modified, resulting in a matching failure, it will only take effect if LTO optimization is removed during compilation.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-09-19 03:46:34 +08:00
pengyiqiang
eee2a2ef6b lvgl: add customize compilation optimization level config
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-09-19 03:46:34 +08:00
Huang Qi
140647cf8c Minor code style fixes
Fix issue in these files:
examples/flowc/flowc_mktestdata.c
examples/nxhello/nxhello_listener.c
examples/system/system_main.c
fsutils/passwd/passwd_append.c
graphics/ft80x/ft80x_gpio.c
graphics/pdcurs34/pdcurses/pdc_keyname.c
graphics/pdcurs34/pdcurses/pdc_touch.c
modbus/functions/mbfuncdiag.c

Fixed by AI and checked by manual

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-15 02:27:41 +08:00
xuxin19
f96461c385 cmake:refine libyuv CMakeLists
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 23:16:26 +08:00
liuhongchao
913792c7be libyuv: Export libyuv include
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 14:48:50 +08:00
liuhongchao
c054dfef76 libyuv: Add CMake for libyuv
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 14:48:50 +08:00
xuxin19
b79727c985 cmake:change lvgl CMake porting scripts
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-08-20 14:48:50 +08:00
Xu Xingliang
9bffd840b9 lvgl/cmake: export lvgl header
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-08-20 14:48:50 +08:00
Xu Xingliang
5165ad8422 lvgl/cmake: link external library if required
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-08-20 14:48:50 +08:00
pengyiqiang
bdc0c006bd lvgl/Makefile: add LV_SYSMON_GET_IDLE and LV_PROFILER porting
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-08-20 13:37:56 +08:00
simbit18
d0e030ff00 fix nxstyle
fix Relative file path does not match actual file.
2024-05-15 23:53:05 +08:00
Xu Xingliang
943aa68069 apps/lvgl: fix distclean warnings
Cleaning...
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/src': No such file or directory
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/src': No such file or directory
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/src': No such file or directory
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/demos': No such file or directory
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/examples': No such file or directory
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/src': No such file or directory

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-04-30 17:39:07 +08:00
simbit18
dadbea7e3b fix nxstyle
fix Relative file path does not match actual file.
Add missing Apache Foundation copyright header
2024-04-30 00:02:31 +08:00
Xu Xingliang
4b35eec39a apps/lvgl: fix compile warning
Add patch to fix the compile warning, which is already fixed in upstream: https://github.com/lvgl/lvgl/pull/6100

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-04-29 19:33:23 +08:00
Neo Xu
c53abc5fdb apps/lvgl: upgrade to lvgl version v9
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-04-29 10:04:34 +08:00
Junbo Zheng
9e71031a09 graphics/lvgl: remove unused code
Since it has beed used from https://github.com/apache/nuttx-apps/blob/master/graphics/lvgl/CMakeLists.txt#L72-L74

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2024-02-25 09:16:42 -08:00
Neo Xu
c1dfeae0b3 cmake: add lvgl cmake support
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-02-22 21:22:41 -08:00
rongyichang
1e9daf0200 apps/graphics: add lcddev_obj initialization to fix crash in lcd_dev mode.
Reference: https://github.com/apache/nuttx/issues/11683

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2024-02-20 21:55:39 -08:00
chao an
f289cdb2ec lvgl/makefile: workaround for lvgl.v8
Since this change is only merged into the lvgl.v9, let us workaround for v8:
 37835260ca

 ./lvgl/src/core/lv_obj.c:363:25: warning: variable 'x' set but not used [-Wunused-but-set-variable]
   363 |         static uint32_t x = 0;
       |                         ^
 1 warning generated.

CFLAGS += -Wno-unused-but-set-variable

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-28 03:52:27 -08:00
raiden00pl
d313bbad9c remove graphics/xxx/README.md. Migrated to Documentation/applications/graphics 2023-10-30 10:00:01 +08:00
Xiang Xiao
054cf3b1cb Change all sizeof(arr)/sizeof(arr[0]) to nitems
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-17 22:51:51 +03:00
liuhongchao
75f04dd775 drivertest:Add touch panel test case.
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-14 09:05:52 +08:00
Peter Bee
04e86fc2d5 graphics/libyuv: refine patching logic
Only stable branch need custom patch, main is fixed by upstream

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-08-09 13:51:50 +08:00
Peter Bee
24caccbd02 graphics/libyuv: add -Wno-undef
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-08-09 13:51:50 +08:00
Xiang Xiao
8083b094c3 Kconfig: Simplify the conditional default statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-25 09:51:09 +08:00
chao an
4d79a5cbaf add initial cmake build system
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
simbit18
83bddd86c5 Fix Kconfig style
Remove TABs from Kconfig files
Add comments
2023-06-21 00:36:52 +08:00
Xiang Xiao
7032c72f2f Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 07:39:53 +03:00