Commit Graph

5721 Commits

Author SHA1 Message Date
Duane Skelton
df4b8adacf Added extern C {} wrapper consistent with other headers in include/sys 2022-08-16 12:04:01 +08:00
anjiahao
beb9144141 include:add sys/queue.h support form openbsd
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-08-16 12:03:45 +08:00
zhanghongyu
b80b4831e0 wireless: Add ioctl cmd to setting PTA prio
info:
https://docs.silabs.com/wifi/wf200/content-source/application-note/wifi-coexistence#pta-state-request

Is the PTA priority enumeration type sufficient?

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 23:15:45 +08:00
Xiang Xiao
ba9486de4a iob: Remove iob_user_e enum and related code
since it is impossible to track producer and consumer
correctly if TCP/IP stack pass IOB directly to netdev

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-15 08:41:20 +03:00
curuvar
e247eaf3e8 Add gSPI mode support for Infineon CYW43539 2022-08-15 10:31:36 +08:00
Nathan Hartman
0892c895fc ioexpander: Fix typos in comments
include/nuttx/ioexpander/gpio.h:
* Fix some typos in comments.
2022-08-15 10:25:11 +08:00
Nathan Hartman
9d5a91c41a ioexpander: Honor C89 standard 2022-08-15 10:24:39 +08:00
luojun1
4e62772be5 modify iob to support header padding and alignment features
Signed-off-by: luojun1 <luojun1@xiaomi.com>
2022-08-14 21:00:28 +08:00
Tiago Medicci Serrano
ab60d0d3fb Framebuffer's callback buffer starts from the area being drawn.
The commit 664d45dcba updated the
behavior of the framebuffer's putarea callback enabling it to be
used to draw a particular area of the display. Previously, putarea
was only used to draw the entire area of the display. Any different
area was drawn, row by row, by putrun. Also, before checking for
which callback to call, the framebuffer driver adjusted the buffer
reference that was going to be used for calling the driver's callback
to point to the init of the relevant data. After that commit, the
framebuffer's buffer reference passed to the driver's putarea now
contains the data to draw the entire display. Unlike the previous
version of that implementation, only the putrun's callback buffer
was being referenced from the address that contains the data that
actually is being drawn.

This commit fixes it by adjusting the reference for the run buffer
passed to the putrun/putarea callback. It always starts from the
beginning of the relevant data that is actually being drawn. That is
necessary because lcddev (which uses the same LCD display driver
callbacks) actually don't allocate a buffer containing the data to
draw the whole display, so the same putarea implementation of the
LCD drivers would'n be able to work for both lcddev and framebuffer.
Also it's necessary to pass the stride argument to the LCD drivers
in order to enable them to do partial writes by calculating the
buffer offset while sending row-by-row. The stride is equal the
width multiplied by the bytes per pixel (may add some padding)
for framebuffer and is equal to the lenght of the row being drawn
(multiplied by the same BPP) for lcddev.

Why this approach?
Other possible approaches would be:
1) modify lcddev driver to translate received buffer data to a
buffer similar to the framebuffer. That wouldn't be efficient
considering memory allocation.
2) Create a new callback function. While possible, it'd be confusing
to create a different callback to draw the whole screen and another
to draw only an area of the screen. Also, these callbacks would
differ themselves only from the way the buffer is filled.
3) Simply reverting 664d45dcba would
break the usage of the putarea callback to draw an area of the
display, which would also be inefficient.

This approach is based on the Zephyr's implementation of the ST7789
driver: the buffer starts from the beginiing of the region that would
be drawn. The display device driver's putarea implementation should
check if the operation refers to a full screen/full row and implement
(if possible) a single operation to send the data to be drawn more
efficiently.

Finally, this approach requires that the drivers which implement
the putarea callback and expects the entire framebuffer buffer
to be modified. They don't need to calculate where the data begins
as the new buffer represents the data from the address that is
actually being drawn. This includes adjusting the LCD drivers
GC9A01 and ST7789 and the driver for APA102-based LED matrix display.
2022-08-13 20:36:45 +08:00
Xiang Xiao
2b37909c9e libc: Move crc8.h, crc16.h and crc32.h from include to include/nuttx
to avoid the conflict with the 3rd party library

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-13 13:28:24 +03:00
Xiang Xiao
5f93ae9dd2 fs/rpmsg: Move the server initialization to fs_initialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-11 02:08:42 +03:00
Jiuzhu Dong
aeec797511 syscall: remove directory syscall
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-10 13:33:08 +08:00
Xiang Xiao
fa2e1897ea libc: Implement memfd on top of tmpfs
https://man7.org/linux/man-pages/man2/memfd_create.2.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-09 22:13:09 +03:00
Jiuzhu Dong
4dbf4555eb fs/dir: support fchdir and dirfd
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong
fe17f747a7 fs/directory: move private directory information to filesystem
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong
90db4daca9 fs/directory: update readdir interface for all filesystem
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong
3a70962b7a fs/directory: use file mode to manage directory
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong
094e986bbd fcntl/O_CLOEXEC: add O_CLOEXEC map for hostfs
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong
c18b5602e8 fs/procfs: add mempool info to proc/mempool
server> cat /proc/mempool
                   total    bsize    nused    nfree   nifree  nwaiter
       hello:        400       20       17        3        0        0

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 15:38:57 +08:00
Jiuzhu Dong
e3bbbfe4d0 mm/mempool: support memory buffer pool
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 15:38:57 +08:00
Jiuzhu Dong
c4bed9eae9 driver/sensor: rename /dev/sensor -> /dev/uorb
because this directory contains all topics by uorb using, not just sensors.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-08 19:45:52 +08:00
Xiang Xiao
16d858f3ee libc/err: Add _func suffix to avoid the the penitential symbol collision
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-08 07:39:59 -04:00
Xiang Xiao
e26d8759d0 libc: Remove CONFIG_LIBC_ERR
let linker remove the unused object files from the final image

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-08 07:39:59 -04:00
sheyunhu
a623b5f31e tls: fix conflicting types for 'up_tls_initialize' compilation problem
Signed-off-by: sheyunhu <sheyunhu@xiaomi.com>
2022-08-05 08:45:11 +03:00
Peter van der Perk
f64677b8c9 Add Embedded Template Library (ETL) support 2022-08-05 09:38:48 +08:00
liyi
0083a2e4f2 optimize UNUSED macro
Signed-off-by: liyi <liyi25@xiaomi.com>
2022-08-04 16:34:45 +08:00
Xiang Xiao
306431d16f list: Remove the unnecessary ? : operator
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-02 18:50:46 +03:00
Xiang Xiao
992747cef3 drivers/battery: Handle the early changed event correctly
since it may happen before battery_xxx_register sometime

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-02 18:50:46 +03:00
Peter van der Perk
013a562478 Net thread-safe ntoa functions
Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-08-02 21:04:19 +08:00
Takayoshi Koizumi
883c6fc2ef drivers/wireless/gs2200m: Notify disssociation event
After recover disassociation, usrsock daemon must destroy all sockets.
Add notification to prompt the daemon to do so.
2022-08-02 15:13:00 +09:00
haopengxiang
4bb393a24e nuttx: change TCB_FLAG_MEM_CHECK to TCB_FLAG_HEAPCHECK
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2022-08-02 10:46:44 +08:00
Xiang Xiao
605ea33238 sensor: Add CODE and FAR for sensor_[lock|unlock] callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-01 20:23:11 -03:00
Jiuzhu Dong
ad20bd4bb3 driver/sensor: fix rpmsg send failed when buffer is NULL
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-02 01:28:56 +08:00
Jiuzhu Dong
5b91641a09 driver/sensor: add cmd SNIOC_UPDATED and remove readlast
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-02 01:28:56 +08:00
Jiuzhu Dong
107e3e5d52 driver/sensor: export upper half lock
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-02 01:28:56 +08:00
Jiuzhu Dong
fa4cebce32 driver/sensor: support sensor data persist
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-02 01:28:56 +08:00
Jiuzhu Dong
6f3873dfa2 sensor: add SNIOC_READLAST
If enable SNIOC_READLAST, sensor_read will return 0
when there is no new data until last read.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-02 01:28:56 +08:00
Jiuzhu Dong
c5f87bb5c6 driver/sensor: support access remote sensor by rpmsg
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-02 01:28:56 +08:00
Jiuzhu Dong
f758e0f260 sensor: format custom ioctl argument by stucture sensor_ioctl_s
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-30 03:15:23 +08:00
Jiuzhu Dong
bb07354198 driver/sensors: add open/close api and struct file for sensor_ops
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-30 03:15:23 +08:00
Michał Łyszczek
a9f78a64db drivers/ipcc: add Inter Processor Communication driver
This patch adds upper half driver for IPCC character driver. IPCC
is a Inter Processor Communication Controller.

Driver is still immature and not thoroughly tested, thus
CONFIG_EXPERIMENTAL is required.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2022-07-29 23:11:32 +08:00
zhuyanlin
031c89db89 power: add PM_IDLE_DOMAIN to pm.h and remove definations
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-07-29 11:15:40 +08:00
xiangdong6
f1fdba28a7 include: Add IPTR/IOBJ definitions.
In case of other compiler, these deinitions are missed.

Signed-off-by: xiangdong6 <xiangdong6@xiaomi.com>
2022-07-28 12:26:25 +08:00
ligd
8a3683fb9f rptun: add ns_match callback to resolve rptun deadlock
thread A: accept -> net_lock -> socket_rpmsg_accept
          -> rpmsg_register_callabck -> rptun_lock
thread B: ns_bind -> rpmsg_socket_ns_bind -> get_tx_payload_buffer
          -> rptun_wait_tx -> usrsock_rpmsg_ept_cb -> usrsockdev_write
          -> net_lock -> deadlock

fix:
add ns_match callback

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-27 20:36:51 +08:00
ligd
a014a19f0e rptun_ping: add sleep param to rptun_ping
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-27 20:36:51 +08:00
Xiang Xiao
0f7da4fd75 libc: Remove the unnecessary include from wchar and wctype
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-27 10:55:37 +03:00
Jiuzhu Dong
673a2e0136 libc/wchar: support wchar
Implemented according to https://en.wikipedia.org/wiki/UTF-8

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-27 00:36:49 +08:00
Jiuzhu Dong
035840a770 libc/wchar: remove unnecessary config
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-27 00:36:49 +08:00
Jiuzhu Dong
9899dd0ec0 mm/mm_heap: change CONFIG_MM_BACKTRACE to int type
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 23:45:31 +08:00
anjiahao
645ff50609 power:record features by add mask to drivers
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 12:07:51 +03:00