Commit Graph

2133 Commits

Author SHA1 Message Date
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
chao.an
85fe229de0 apps/libtest: add libtest demo
Redefine the name of BIN to support static library:

BIN = $(APPDIR)/libtest$(LIBEXT)

Signed-off-by: chao.an <anchao@xiaomi.com>
2023-07-02 07:48:50 -06:00
raiden00pl
f7072ceea8 examples: add NimBLE example, based on nimble/porting/examples/nuttx
It's better to keep this example as part of nuttx-apps instead of relying on an external project
2023-06-27 22:28:32 +03:00
Petro Karashchenko
c9c4cc13e6 apps: correct print specifiers to fix compilation warnings
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-23 12:05:54 +08:00
Xiang Xiao
e89409cfe6 Remove the unnecessary cast from pid_t to int
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-19 09:05:54 +02:00
Petro Karashchenko
aed0e2873e apps: fix style issues in code
Add missing FAR and CODE to pointers
Remove FAR for non-pointer variables
Remove extra spaces and align the parameters
Add do {} while(0) wrapper in macro
Use nitems to calculate number of elements in arrays

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 18:47:50 +08:00
Xiang Xiao
e81227f99d Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-22 11:57:40 +02: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
raiden00pl
7e5a436ff9 examples/foc: add real time data capture with the NxScope library 2023-05-19 20:18:38 +08:00
raiden00pl
55b296a5c6 examples/foc/foc_thr: get controller type from controller ID 2023-05-19 20:18:38 +08:00
raiden00pl
54bcf3afdd examples/foc/foc_thr: fix mutex logic 2023-05-19 20:18:38 +08:00
simbit18
487d541f36 examples/mlx90614/Kconfig: Fix indentation
Remove spaces from Kconfig
2023-05-19 01:00:38 +08:00
simbit18
a60a5567f4 examples/mqttc/Kconfig: Fix Kconfig style
Remove spaces from Kconfig file
2023-05-18 00:38:54 +08:00
raiden00pl
111e02dbdb examples/foc: improve the readability of the motor structures 2023-05-17 13:45:24 +08:00
Alan Carvalho de Assis
6b720033cc examples/mqttc: Check for MQTT ACK and avoid passing '\0'
This patch will force wait for MQTT ACK (connection) and also
fix the issue caused by "strlen(mqtt_cfg.msg) + 1" that will
include the "\0" in the payload. It's forbidded by MQTT spec.

Some MQTT servers will ignore it, others like TagoIO will refuse
the packet.
2023-05-15 19:20:28 +03:00
raiden00pl
caba5a0a6f examples/foc: add missing deinit calls 2023-05-15 13:19:34 -03:00
raiden00pl
f358bdfcb3 examples/foc: send messages only to active control threads 2023-05-15 13:19:34 -03:00
raiden00pl
beb5369a0d examples/foc/foc_main.c: fix de-initialization sequence 2023-05-15 13:19:34 -03:00
raiden00pl
cc189ef170 examples/foc: add controller IDLE mode 2023-05-15 13:19:34 -03:00
Xiang Xiao
0acd68b391 Indent the include statement by two spaces
follow the coding style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-13 10:16:26 -03:00
Michal Lenc
f270ef644e examples: add adjtime example application
This application demonstrates the usage of adjtime() interface.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-05-10 00:46:53 +08:00
Xiang Xiao
f95d60366a Fix the nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
73701cd7cd Replace all strncpy with strlcpy
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
7c37421266 Replace all sprintf with snprintf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Filipe Cavalcanti
f60d23fdb9 Added example for Bosch BMP280 pressure sensor 2023-05-08 13:02:59 +08:00
Xiang Xiao
a38acd685f examples: Enable cxxinfo output if CONFIG_DEBUG_FEATURES is defined
fix the wrong logic

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-30 09:33:54 +03:00
Xiang Xiao
0786563bba examples/module: Add g_ prefix to chardev_fops
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-30 09:32:21 +03:00
Alan Carvalho de Assis
679dbdac0a Add a simple TinyCBOR Test Example 2023-04-28 12:04:20 +08:00
Peter van der Perk
fa26bab6b2 DroneCAN add socketcan support, rename to DroneCAN
Rename canardv1 to OpenCyphal

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-25 18:24:41 +08:00
Tiago Medicci Serrano
0a9b983e90 apps/examples/pipe: check POSIX-compliant behavior of NuttX's FIFOs
Adjust the test considering the POSIX-compliant behavior of the
NuttX's FIFO (mkfifo), which should block `open` for read-only
and write-only. This test's result is expected to be the same with
any other POSIX-compliant system.

This commit also:

 * Fix redirect test;
 * Use pthread instead `task_create` to be able to run this test
on POSIX-compliant systems;
 * General fixes regarding formatting and error messages;
2023-04-22 01:28:25 +08:00
Petro Karashchenko
f15605da2f nuttx: add missing FAR and CODE
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-19 03:11:19 +08:00
simbit18
90c963677c apps/examples/wgetjson/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
9201c3e8e1 apps/examples/djoystick/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
a7889e122c apps/examples/ajoystick/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
c99a1fd2a5 apps/examples/pty_test/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
1fb35350b9 apps/examples/ipforward/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
c647fc63de apps/examples/sht3x/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
d4ac7cc816 apps/examples/ina219/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
Xiang Xiao
aa99d267b7 Change the private default signal number to 32
and remove the unused private signal number macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-05 03:38:24 -07:00
wangchen
93105568c0 examples/ftpd: Add support for choosing address family
choose the network protocol (ipv4 or ipv6) to bind network in setting ftpd

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-04-03 16:18:15 +03:00
simbit18
75ddde9c56 apps/examples/mqttc/Makefile: Add missing Apache Foundation copyright header
Add missing Apache Foundation copyright header
2023-04-03 16:14:35 +03:00
Gustavo Henrique Nihei
ce68d7a738 examples/popen: Fix NxStyle long line warning
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-28 14:54:16 -03:00
Gustavo Henrique Nihei
efb4e0bc91 Add another batch of missing headers throughout the repository
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-28 14:54:16 -03:00
simbit18
800f1f4bae apps/examples/adc/adc.h: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-23 00:52:38 +02:00
simbit18
ad8478045e apps/examples/charger/Makefile: fix nxstyle
Add missing Apache Foundation copyright header
2023-03-23 00:52:38 +02:00
simbit18
d80b08d07e apps/examples/flash_test/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-23 00:52:38 +02:00
simbit18
c86b154677 apps/examples/fboverlay/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-23 00:52:38 +02:00
Huang Qi
8ae5a1b148 Fix some hard coded buffer len of snprintf
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-21 20:57:56 -03:00
Xiang Xiao
f3c104b99a Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-19 14:53:44 -06:00
Xiang Xiao
86080a110e apps: Remove the check of CONFIG_SERIAL_TERMIOS
If the code only change c_oflag, c_iflag and c_lflag, not c_cflag in termios.
Follow up the change from kernel: https://github.com/apache/nuttx/pull/8843

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-19 14:53:44 -06:00
simbit18
a37267e644 apps/examples/xbc_test/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
3a912b8778 apps/examples/watcher/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
5578539c88 apps/examples/sht3x/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
826b95a377 apps/examples/posix_spawn/filesystem/hello/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
1a0cd7211a apps/examples/nxscope/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
311e1edbdb apps/examples/nxflat/tests/struct/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
478ad2c782 apps/examples/noteprintf/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
e4f0a55673 apps/examples/mount/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
63a80df4e2 apps/examples/hello_zig/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
de4c99f870 apps/examples/hello_rust/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
0a187004c1 apps/examples/hello_nim/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
2235f33033 apps/examples/hello/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
bfdb76c609 apps/examples/cordic/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
jturnsek
b13f70ca59 Nng library and pubsub example 2023-03-08 10:49:13 +08:00
simbit18
4a9752ed3d Update pwm.h
Fix nxstyle
2023-03-07 10:00:43 +08:00
simbit18
5854208e55 apps/examples/dac/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
943fda1aa8 apps/examples/audio_rttl/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
9fc5fea946 apps/examples/audio_rttl/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
2bfa344cc0 apps/examples/relays/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
853e574800 apps/examples/etl/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
15b24123f5 apps/examples/nxdemo/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
b85bd22fe1 apps/examples/esp32_himem/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
82c78c6734 apps/examples/esp32_himem/Make.def:sFix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
b6cd7679e4 apps/examples/pwm/pwm.h: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
71bbfbea43 apps/examples/mtdrwb/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
24667d219e apps/examples/tcp_ipc_server/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
7c803d28e6 apps/examples/tcp_ipc_server/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
2792127849 apps/examples/tcp_ipc_client/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
13315255e5 apps/examples/tcp_ipc_client/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-07 10:00:43 +08:00
Gustavo Henrique Nihei
f500c64962 Include missing headers throughout the repository
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-07 09:58:13 +08:00
simbit18
02d293d4b7 qe.h: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-06 05:19:02 -08:00
simbit18
baf15a1a89 apps/examples/qencoder/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-06 05:19:02 -08:00
chao an
4f11f38c38 interpreters/wamr: add compile role of WebAssembly
Add compilation rules to support WebAssembly(WASM/WAMR):

1. Compile Toolchain
 1> Download WASI sdk and export the WASI_SDK_PATH path:

$ wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz
$ tar xf wasi-sdk-19.0-linux.tar.gz
Put wasi-sdk-19.0 to your host WASI_SDK_PATH environment variable, like:
$ export WASI_SDK_PATH=`pwd`/wasi-sdk-19.0

 2> Download Wamr "wamrc" AOT compiler and export to the PATH:
$ mkdir wamrc
$ wget https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-1.1.2/wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz
$ tar xf wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz
$ export PATH=$PATH:$PWD

2. Configuring and running

 1> Configuring sim/wamr and compile:

nuttx$ ./tools/configure.sh  sim/wamr
nuttx$ make
...
Wamrc Generate AoT: /home/archer/code/nuttx/n5/apps/wasm/hello.aot
Wamrc Generate AoT: /home/archer/code/nuttx/n5/apps/wasm/coremark.aot
LD:  nuttx

 2> Copy the generated wasm file(Interpreter/AoT)

nuttx$ cp ../apps/wasm/hello.aot .
nuttx$ cp ../apps/wasm/hello.wasm .
nuttx$ cp ../apps/wasm/coremark.wasm .

 3> Run iwasm

nuttx$ ./nuttx
NuttShell (NSH) NuttX-10.4.0
nsh> iwasm /data/hello.wasm
Hello, World!!
nsh> iwasm /data/hello.aot
Hello, World!!
nsh> iwasm /data/coremark.wasm
2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 12000
Total time (secs): 12.000000
Iterations/Sec   : 5.000000
Iterations       : 60
Compiler version : Clang 15.0.7
Compiler flags   : Using NuttX compilation options
Memory location  : Defined by the NuttX configuration
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0xa14c
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 5.000000 / Clang 15.0.7 Using NuttX compilation options / Defined by the NuttX configuration

Co-Authored-By: Huang Qi <huangqi3@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-03-06 13:23:44 +02:00
simbit18
b370f77851 Update batt_main.c 2023-03-04 13:50:22 +08:00
simbit18
d4e85ce384 apps/examples/battery/batt_main.c: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 13:50:22 +08:00
simbit18
13d2cc1d88 apps/examples/battery/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 13:50:22 +08:00
simbit18
e7a86f38d3 apps/examples/battery/Makefile:Fix mistakes in comments
Fix mistakes in comments
2023-03-04 13:50:22 +08:00
simbit18
68fee5effb apps/examples/ina226/Makefile: Fix mistake in comment
fix relative path error
2023-03-04 01:43:30 +08:00
simbit18
4e4ccd6c73 apps/examples/apds9960/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 01:43:17 +08:00
simbit18
88b01447b5 apps/examples/lp503x/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 01:43:03 +08:00
simbit18
006e33c646 apps/examples/hidkbd/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 01:43:03 +08:00
simbit18
2254074f82 apps/examples/can/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 01:43:03 +08:00
Xiang Xiao
21bc466a2b Remove the tail space char from all files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-03 00:18:36 +02:00
yinshengkai
4f04151f17 exampels/note: modify SCHED_NOTE_XXX -> sched_note_xxx
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-02 11:20:40 +08:00
SPRESENSE
b58ecee1c9 apps/examples/udp: Fix warnings by -Wformat
Fix warnings where address of IPv4 is displayed.
2023-03-02 11:20:06 +08:00
Michal Lenc
99b99c8c5e pwm: update channel range with support of 0 and -1
PWM drivers support channel numbers 0 (skip the channel) and -1 (skip this
channel and all following channels). This commit enables usage of this
numbers in PWM example application.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-02-27 22:33:56 +08:00
Takeyoshi Kikuchi
c785e32183 add "hello_nim" example application written by Nim.
Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2023-02-27 10:15:33 +01:00
lilei19
41f60bd669 change strcpy to strlcpy
Change-Id: I8b9429a3c225a82842fce136bdb14b8b135066d3
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-22 23:09:55 +08:00
pengyiqiang
e86745b9a2 lvgldemo: use nitems instead of sizeof
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-02-22 23:09:42 +08:00
pengyiqiang
6f192bd1e0 lvgl/port: add libuv porting
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-02-22 15:33:53 +02:00