2268 Commits

Author SHA1 Message Date
yinshengkai
dbef7b5f85 examples: fix usrsocktest compiler warning
error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
   112 |   int ret;

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 10:35:20 +08:00
likun17
3927b33237 examples/bmi160:bmi160 add urob mode example.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-12 10:34:22 +08:00
Neo Xu
d91e3db9fd noteprintf: fix compile warnings
noteprintf_main.c:52:7: warning: unused variable 'binary' [-Wunused-variable]
   52 |     } binary =

Fix typo of sched.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-11 18:30:33 +08:00
Huang Qi
648e25bac1 examples/pipe: Enhance test by different r/w thread priority
By arranging and combining the priorities of read and write
threads to cover more usage scenarios.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-10-11 18:20:29 +08:00
xuxin19
190926b467 cmake:add romfs/unionfs/tcpblaster/udpblaster exmaple app CMake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-09 20:15:49 +08:00
yinshengkai
30df081276 examples: fix noteprint compile error
The sched_note_string/bprintf/dump interfaces have been removed and replaced with printf and event

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-08 23:35:46 +08:00
wangmingrong
cc1c4a3722 examples/romfs: Compilation error after enabling options
Enable CONFIG_PROFIG_EXAMPLES_ROMFS compilation error

Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2024-10-08 14:04:39 +08:00
wanggang26
d5d8e9eacb fix build error:
[linguini@pastabox nuttx]$ make -j
CC:  tcpblaster_server.c
LN: platform/board to
/home/linguini/cuinspace/pico-nuttx/apps/platform/dummy
tcpblaster_server.c: In function ‘tcpblaster_server’:
tcpblaster_server.c:159:14: error: implicit declaration of function
‘accept4’; did you mean ‘accept’? [-Wimplicit-function-declaration]
  159 |   acceptsd = accept4(listensd, (FAR struct sockaddr *)&myaddr,
&addrlen,
      |              ^~~~~~~
      |              accept
make[3]: *** [Makefile:92: tcpblaster_server.hobj] Error 1
make[2]: *** [Makefile:53:
/home/linguini/cuinspace/pico-nuttx/apps/examples/tcpblaster_context]
Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:180: context] Error 2
make: *** [tools/Unix.mk:457:
/home/linguini/cuinspace/pico-nuttx/apps/.context] Error 2
make: *** Waiting for unfinished jobs....

from https://github.com/apache/nuttx-apps/issues/2632

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-05 09:06:43 +08:00
Petro Karashchenko
66b79a7c89 style: fix indentation issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-04 08:17:51 +08:00
xucheng5
76d419ca45 example/can: replace field ch_unused with ch_tcf
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-02 21:22:14 +08: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
dongjiuzhu1
6c88a1ad76 examples/elf/sotest: enable and run them simultaneously
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:53:14 +08:00
dongjiuzhu1
15c90ac17e examples/sotest/elf: rename romfs_img to run test with CONFIG_NSH_ROMFSETC
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:53:14 +08:00
dongjiuzhu1
fdc35d0bad examples/elf: remove unnecessary config CONFIG_EXAMPLES_ELF_DEVPATH
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:53:14 +08:00
Kevin Zhou
23bf7fb449 usbserial: Add config for customize direction, message and wait time 2024-10-01 11:37:45 +08:00
dulibo1
46768fc85d gpio:add example for wakeup gpio type
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-30 18:31:03 +08:00
Huang Qi
2ecaf0ec48 examples: Add wamr_module
This example demonstrates how to register a external module
into WAMR runtime.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-28 15:47:40 +08:00
jianglianfang
e4e46c3f53 fb_main: fix draw_rect24
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-09-28 10:51:34 +08:00
wanggang26
eab2cba4a1 enable SOCK_CLOEXEC explicit
leaking here means fork/vfork will duplicate fd without O_CLOEXEC flag
to the child process.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-26 16:13:29 +08:00
wangjianyu3
b1c4e39205 examples/gps: Add default case for switch-warning of vendor extended sentence
Vendor may add extended sentence may not handled in switch, error if -Werror=switch enabled.
And extended sentence should not added to general examples.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 22:11:39 +08:00
wangjianyu3
ad2514fc6f examples/gps: Fix switch error
Log:
  gps_main.c:83:7: error: enumeration value 'MINMEA_SENTENCE_LOR_LSQ' not handled in switch [-Werror=switch]
     83 |       switch (minmea_sentence_id(line, false))
        |       ^~~~~~

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:42:31 +08:00
wangjianyu3
dae4d7572f module/sotest: Try devminor of romdisk
For case that /dev/ram${EXAMPLES_SOTEST_DEVMINOR}(e.g. /dev/ram0) already exists, and users may not care which device to use.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-18 12:16:02 +08:00
wangjianyu3
758ed55722 examples/sotest: Fix warning of unused variable 'devname'
Config:
  +CONFIG_EXAMPLES_SOTEST=y
  +CONFIG_EXAMPLES_SOTEST_BINDIR="/data"
Log:
  sotest_main.c: In function 'sotest_main':
  sotest_main.c:105:8: error: unused variable 'devname' [-Werror=unused-variable]
    105 |   char devname[32];
        |        ^~~~~~~

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-18 11:36:27 +08:00
wangjianyu3
74b05468d6 module/sotest: Fix depends of SOTEST_BUILTINFS
Log:
  sotest_main.c: In function 'sotest_main':
  sotest_main.c:116:29: error: storage size of 'desc' isn't known
    116 |   struct boardioc_romdisk_s desc;
        |                             ^~~~
  sotest_main.c:116:29: error: unused variable 'desc' [-Werror=unused-variable]
  cc1: all warnings being treated as errors

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-18 11:36:27 +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
683f25af15 cmake:support romfs prog for SIM CMake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 23:16:26 +08:00
xuxin19
3d8dc5dce5 cmake:implement CMake build for NuttX Lua interpreter
add CMake module for register lua mod
nsh> lua
Lua 5.4.0  Copyright (C) 1994-2020 Lua.org, PUC-Rio
> hello.say_hello()
Hello World!
> io.write("abs is =",math.abs(-10),"\n")
abs is =10
> os.exit()
nsh>

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 12:31:10 +08:00
meijian
1f51bfe64d apps/ipforward: fix ci check failure
note: static declaration of 'chksum' follows non-static declaration

Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 13:38:38 +08:00
meijian
002e31c56d apps/dhcpd: fix dhcpd set dip error
dhcpd will set dip routing table 0.0.0.0|0.0.0.0|10.0.0.1 (TARGET|NETMASK|ROUTER) which will cover other's router 0.0.0.0|0.0.0.0|10.1.10.1.
And will cause shell/apps to internet failure.

Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 01:11:30 +08:00
Luchian Mihai
0a4c97ac09 examples/amg88xx: add example for amg88xx driver
Simple example for the amg88xx driver
2024-09-09 19:45:44 +08:00
raiden00pl
d71046c139 examples/nimble: fix example after update to latest master
this example is broken since bc68d954a

since bf76183741
ble_hci_sock_init is called from nimble code, so we can't call it again in example code
2024-08-30 21:29:25 +08:00
Michal Lenc
75d5f63f14 can: add support for FD frames if FD mode is configured
This enhances can example application with the possibility to send
CAN FD frames if FD mode is configured. Both EDL and BRS flags are
now correctly set with the latter one configurable with application's
arguments. Also data bytes are now correctly switched to DLC.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-08-30 01:16:04 +08:00
jianglianfang
73f26ca084 fb: supported bpp = 24
Added new draw_rect24 function to support bpp=24 devices.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-27 02:46:41 +08:00
jianglianfang
2305255373 fb: select the FB_NO_OVERLAY because it will be showed on the main surface
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-27 02:46:41 +08:00
jianglianfang
009fc1a28a fix: uninitialized pointer read
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-27 02:46:41 +08:00
jianglianfang
72e186f64a apps/examples: fb_main need ioctl(FBIOPAN_DISPLAY) to update and adapt to double buffer mode.
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-27 02:46:41 +08:00
gaohedong
481d4b6e23 can: Merge netpacket/can.h into nuttx/can.h
This patch is associated with 'https://github.com/apache/nuttx/pull/13048', so it cannot be verified separately by CI. Please help to associate and review it. Thank you!

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2024-08-26 05:05:41 -04:00
Matheus Catarino
89dd0c29e2 Zig & D examples clean & refactor
dlang: use importC to get NuttX include
zig: leds_zig added
2024-08-26 10:22:16 +08:00
meijian
c91a1817aa netlib/setroute: fix dhcpd stack-overflow when calls netlib_set_dripv4addr with debug info-level
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-26 01:54:46 +08:00
zhangkai25
39d053ef74 apps/examples: Add test of edges counting at capture
Description: Add test of the function of counting cap edges

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2024-08-26 01:29:08 +08:00
Matheus Catarino
7c4590b818 hello_swift added
required: swift 6 (embedded module)
2024-08-23 09:04:31 +08:00
Kevin Zhou
ab67cb1911 examples/usbserial: Check if usbserial device exist before register 2024-08-22 04:28:53 +02:00
zhanghongyu
a1dbc8f37d examples/telnetd: fix compile telnetd multi definition error
Compiling system/telnetd and examples/telnetd at the same time could not
generate two builtin commands, Because the name is the same, one will be
overwritten, but there will be no compilation errors.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-21 17:08:07 +08:00
jianglianfang
7abd0a7303 lvgldemo: fix uninit_use_in_call
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-20 02:49:34 +08:00
Rushabh Gala
437c903c47 examples/leds_rust: Add Rust App for blinking the LED
- This PR adds `examples/leds_rust` to call NuttX POSIX APIs like `open()` and `ioctl()`, so that it blinks an LED
- The `leds_rust` app is also used for testing the GPIO and LED Drivers for Ox64 BL808 SBC and QEMU RISC-V Emulator in Google Summer of Code
- `leds_rust` be executed locally on Linux / macOS / Windows, by commenting out the first 2 lines of code
- The code is based on `examples/leds` in C, and `examples/hello_rust` in Rust

Co-Authored-By: Lup Yuen Lee <9960133+lupyuen@users.noreply.github.com>
2024-08-06 00:26:44 +08:00
Pressl, Štěpán
1a7da54a9b examples/qencoder: obtain samples using the QEIOC_GETINDEX ioctl call
Normally, the qencoder position is obtained using the QEIOC_POSITION
ioctl call. Adding the -i argument uses the QEIOC_GETINDEX to
obtain the qe_index_s struct containing the position alongisde
other fields.

Signed-off-by: Stepan Pressl <pressste@fel.cvut.cz>
2024-07-29 22:28:56 +08:00
SPRESENSE
8a82400929 examples/camera: Fix wrong device file path
In camera_main.c, the dev paths of capture_initialize() and open()
are different. So open could always failed.
2024-07-28 15:52:26 +08:00
Rodrigo Sim
4aea0dff38 examples/telnetd: Add support to reset command
Signed-off-by: Rodrigo Sim rcsim10@gmail.com
2024-07-16 09:06:16 +08:00
Alan Carvalho de Assis
e9f60d85b9 examples/telnetd: Make it clear the goal of this telned
Signed-of-by: Alan C. Assis <acassis@gmail.com>
2024-07-03 17:47:10 +08:00
Alan Carvalho de Assis
c7072b45bb examples/stepper: Fix typo inside for() loop 2024-06-30 13:29:01 +08:00