Commit Graph

2182 Commits

Author SHA1 Message Date
chao an
929f1009c7 system/readline: correct the readline(3) prototype
Reference:
https://man.openbsd.org/readline.3

Signed-off-by: chao an <anchao@xiaomi.com>
2023-10-16 22:04:18 +08:00
xuxin19
77a5666cb7 Revert "fix progname do not match issue"
This reverts commit c230321cae.
2023-10-10 01:02:50 +08:00
Huang Qi
1e5e755ba2 examples: Split hello example into hello and hello_wasm
Decouple the hello example into hello and hello_wasm. The hello_wasm
example is a minimal example to show how to build a wasm application
by using the NuttX build system, and avoid disturbing the hello
(native build).

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-10-08 14:53:08 +08:00
Petteri Aimonen
c340d735ec adjtime: Fix wrong printf format when using CONFIG_SYSTEM_TIME64 2023-10-06 17:25:23 +08:00
ThomasNS
06b4911db4 add shm example using fs shm 2023-10-06 17:24:44 +08:00
raiden00pl
b88057fffd examples/foc: support svm3 state with nxscope 2023-10-05 20:42:46 +08:00
raiden00pl
a56f0922c5 industrial/foc: add an interface that returns the modulation state
Useful for debugging and demonstrating FOC operation
2023-10-05 20:42:46 +08:00
raiden00pl
5cbd9b2b7b examples/foc: allow nxscope transfer over RTT interface
For UART serial interface TERMIOS is required, but for RTT serial interface it's not.
2023-10-02 21:46:52 +03:00
raiden00pl
f505b6cb08 nxscope/serial: ignore baud configuration if set to 0 2023-10-02 21:46:52 +03:00
Eren Terzioglu
85eb37c62b examples/can: TX and RX structs assigned 0 at startup 2023-09-28 19:14:21 +08:00
halyssonJr
02db9c7612 create app for wiegand protocol
update app for wiegand protocol

improve wiegand app

app improvement and fix Kconig
2023-09-25 16:21:40 -04:00
Daniel P. Carvalho
e62e1e91fe Fixes compiler warnings while printing uint32_t and int32_t values. 2023-09-22 09:14:20 +08:00
Xiang Xiao
2bfb9760ad Fix Error: configdata_main.c:402:14: error: variable 'iteration' set but not used [-Werror,-Wunused-but-set-variable]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-12 10:10:16 +08:00
xuxin19
c230321cae fix progname do not match issue
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-09-11 16:37:05 +08:00
Tomáš Pilný
ecded726ce WS2812ESP32 example name is configurable and default name shortened 2023-09-05 12:37:07 +08:00
Xiang Xiao
6aa05b5855 Replace strlen with sizeof for kconfig string
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-02 16:26:51 +03:00
zhanghongyu
956b935511 mqttc: add mbedtls MQTTC support
The mqttc demo under example path can not support mbedtls api.
Because of the MQTT-C source code already contains many types of
link examples, so we added the corresponding makefile to
support mbedtls mqttc connections publisher and posix mqttc
connections publisher and subscriber.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-01 23:21:34 +08:00
wurui3
4981dbe32b apps/examples/pipe:can't print info to screen after calling redirect_test func.
reason:stdin/stdout was redirected and closed in redirect_test.c.
measures:change all printf() to fprint(stderr,...) in pipe_main.c,
and modify fflush(stdout) to fflush(stderr) in line 231.

Signed-off-by: wurui3 <wurui3@xiaomi.com>
2023-08-30 13:56:33 +08:00
yanghuatao
658b847384 apps/rpsock_client: Fix rpsock_client.c [-Wformat=] warning
Fix warning:
CC:  rpsock_client.c rpsock_client.c: In function 'rpsock_unsync_test':
rpsock_client.c:203:30: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
  203 |                       printf("client check fail total %d, \
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  204 |                               i %d, %08x, %08x\n",
      |                               ~~~~~~~~~~~~~~~~~~~
  205 |                               ALIGN_UP(total), i, intp[i],
      |                                                   ~~~~~~~
      |                                                       |
      |                                                       uint32_t {aka long unsigned int}

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-08-28 17:34:02 +03:00
liuhongchao
a3dfef117b apps/examples:Add keyboard example
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-26 17:02:48 +08:00
dongjiuzhu1
d73e6412b7 apps/gpsutils: move gpsutils to nuttx/libs/libc/gpsutils
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-08-22 23:05:53 +08:00
Petro Karashchenko
189d0c803f net/ip: print ip addresses using ip4_addrN macro
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-22 01:36:42 +08:00
simonatoaca
4739b18cb1 examples/bme680: Added test program for the BME680 sensor
The program is an example on how to poll the sensor for data when
all its sub-sensors are enabled.

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>
2023-08-18 23:00:32 +08:00
xucheng5
15edd28a69 example/capture : fixed build warning
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-18 14:08:33 +08:00
Xiang Xiao
7251645685 Fix some coding style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-17 22:51:51 +03: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
xuxin19
32b417a8f7 cmake:refine cmake build for apps/examples
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-17 01:15:17 +08:00
liuhongchao
e5bf64d792 apps/examples:Edit arm64 compilation error
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-14 13:39:59 +08:00
ligd
12a2e14a83 example/poll: add delay for poll testcase
for should setup the fifo firstly

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-11 15:35:06 +08:00
yinshengkai
d090da6b91 examples/watcher: get the thread name using pthread_getname_np
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-10 22:50:58 +08:00
YanXiaowei
b2d5d3f51c apps/examples/pwfb : fix compiling error
fix compiling warning and error when CONFIG_NX=y, EXAMPLES_PWFB=y and EXAMPLES_PWFB_DEFAULT_FONT=y
fix CI-Precheck for pwfb_motion.c

Signed-off-by: YanXiaowei <yanxiaowei@xiaomi.com>
2023-08-09 15:08:44 +08:00
田昕
5449126959 examples/mtdpart:fix compiling warning in printf.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2023-08-09 14:58:19 +08:00
rongyichang
6fecb56aee apps/examples: fix fb example show error
For screens with transparency, the alpha value should be set to 0xFF

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-09 08:34:36 +02:00
zhanghongyu
216df60208 usrsocktest: correct the parameter when pthread_kill is called
When the value of the signal is modified, the function will be faulty

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-03 06:16:19 -07:00
simbit18
85988dc77f Fix nuttx coding style
Remove TABs
2023-08-01 23:10:32 -07:00
dongjiuzhu1
100db2a678 examples/sotest: fix issue about running multiple times
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-30 22:19:03 -07:00
dongjiuzhu1
f890a0b1cb examples/sotest: remove unnecessary config
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-30 22:19:03 -07:00
Xiang Xiao
c9f13d698c examples: Change unionfs_mount to mount
since unionfs_mount isn't exported through syscall

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-30 18:50:24 -03:00
Victor Benso
52ec336c55 Example for controlling a chain of WS2812 LEDs using ESP32 RMT peripheral 2023-07-30 11:40:04 -03:00
yuexinyi
c10e78869b examples/camera: Video driver multi-instance adaptation
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:33 -07: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
raiden00pl
dda21ad57e cmake: support for nimble 2023-07-20 01:44:39 +08:00
Huang Qi
5d37383457 examples: Build both native app and wasm app for hello to pass CI test
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-07-17 23:14:47 +08:00
raiden00pl
ed370ec674 cmake: port nxscope and foc and add missing directories 2023-07-14 22:04:35 +08:00
Petro Karashchenko
355153cff5 examples/nimble: fix assertion during pthread create with zero priority
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-14 09:49:51 +08:00
raiden00pl
4df395bfc4 cmake: add support for boot utils 2023-07-13 23:50:49 +03:00
Lucas Saavedra Vaz
0a7c308f1b examples/pwm: Fix PWM range
This commit fixes the overflow that happens when setting the duty cycle to 100% in the PWM example.
It now correctly passes the value 0xffff rather than 0x0000 when setting the duty cycle to 100 and makes sure that no underflow happens when setting the duty cycle to 0.
2023-07-14 01:25:05 +08:00
chao an
7cfcb49213 cmake/apps: add more applications into cmake support
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-13 19:00:18 +02:00
Xiang Xiao
dab972b907 Remove the const cast from the initialization of boardioc_symtab_s::symtab
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-08 16:01:52 +03: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
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