Commit Graph

5695 Commits

Author SHA1 Message Date
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
Jiuzhu Dong
4ef7cf068b driver/power: add charge protocol get
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 12:07:51 +03:00
ligd
7fa3ecde5a pm: modify for nxstyle
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
c0f2b7811e pm: add pm procfs support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
f7a1c2a585 pm: move wdog from domain to wakelock
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
88def0244c power: add pm_wakelock support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
f606689715 power: change pm_stay_timeout to pm_staytimout
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
f0a1a2dc0b power: add pm_stay_timeout API
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
Jiuzhu Dong
e3e59a03b1 driver/sensor: update sensor data structure and state structure
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
24040250f5 driver/sensor: support multi users to access device
1.Allow multi users to access the same sensor device simultaneously.
2.Get real state of sensor device by cmd SNIOC_GET_STATE for users.
3.Get update state since last read by poll without timeout for users.
4.Sensor device will be activated when first user open and will close when
  last user closed.
5.When multi users to access device, driver always set the minimum
  sampling interval and latency to the sensor device and allow
  downsampled for users above the minimum sampling interval.
6.The circbuffer will overwrite old data when buffer is full, so if users
  don't read data soon, data will be lost, and the oldest data in circbuffer
  are returned to the users.
7.Always read the last data in the circbuffer as initial value for new
  users when the sensor device has not yet generated new data.
8.when user uses poll, if subscription interval is satisfied, the POLLIN
  events is returned for each users.
9.When new user generate or the state of sensor device changed, the POLLPRI
  will notify to all users.
10.Support multi advertisers to subscribe their own data as loop test.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
b3ea6522f4 driver/usensor: support register user sensor
1.cmd:SNIOC_REGISTER with struct sensor_reginfo_s to register user sensor
2.cmd:SNIOC_UNREGISTER to unregister user sensor

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
8d971101cd driver/sensor: change protype of set_interval, batch to follow ioctl
1. change unsigned int to unsigned long

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
8f39c5f11b driver/sensor: simplify buffer operation
1.Simplify buffer opeations to avoid frequent resize for batch and no-batch mode.
2.When sensor event is first generated, the buffer is initialized.
3.Remove and merge batch_number to buffer_number when device support batch mode.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
dad5ab75ff driver/sensor: support userspace wirte data into sensor device
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
fc84813b0a driver/sensor: add calibrate interface for sensor driver.
Add standard sensor interface for calibrate, can trigger
calibration and obtain calibration value.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 17:44:31 +08:00
zhanghongyu
7467586d55 netdev: add return value for ifup / ifdown
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-07-25 15:29:24 +08:00
Jiuzhu Dong
6e1244c274 mm/circbuf: add circ_peekat to read data with specified postion
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 13:35:26 +08:00
Jiuzhu Dong
a853c70093 mm/circbuf: add circbuf_is_init to indicate circbuf state
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 13:35:26 +08:00
Jiuzhu Dong
3132f169ef driver/sensor: add sensor type of cap and wake_gesture
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 13:34:58 +08:00
curuvar
c21c7ac8dc Added Adafruit QT Py RP2040 board.
Added ability to configure indivdual UART, SPI and I2C pin location.
2022-07-23 18:25:38 +08:00
Masayuki Ishikawa
0cef7b765e binfmt: Fix memory leak in ELF loader
Summary:
- I noticed that the hello (ELF) application causes a memory leak.
- Finally, I found that the data section is not deallocated.
- This commit fixes this issue.

Impact:
- ELF loader with CONFIG_ARCH_ADDRENV=n

Testing:
- Tested with the following configs
  - sprensense:elf, esp32-devkitc:elf, sabre-6quad:elf
  - spresense:wifi_smp, rv-virt:nsh64, sabre-6quad:netnsh

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-07-23 14:34:27 +08:00
Karel Kočí
6c7f99189b libs/libc/string: add memmem
This function is the GNU extension.
2022-07-22 19:04:11 +03:00
Xiang Xiao
344a9bc838 fs/hostfs: Change nuttx_dev_t from uint16_t to uint32_t
Follow up the following change:
commit 008cb0d31a
Author: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Date:   Thu Jul 14 02:27:34 2022 +0000

    sys/sysmacros.h: support sysmacros header

    Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-22 17:08:50 +03:00
Jiuzhu Dong
978530f5f6 fs/ioctl: add BLKSSZGET cmd to get block sector size
refer to:
https://sites.uclouvain.be/SystInfo/usr/include/sys/mount.h.html

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-22 09:07:57 +03:00
Jiuzhu Dong
008cb0d31a sys/sysmacros.h: support sysmacros header
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-22 11:10:08 +08:00
Karel Kočí
fb0fdea4d4 include/nuttx/lcd: change meaning of buffer argument for putarea
The putarea documentation originally suggested that provided buffer
contains just the rectangle to be updated.
The commit 664d45dcba changed the expected
behavior for lcd_framebuffer but failed to propagate this change to the
driver's documentation. Now the expected behavior is that the whole
frame is passed in buffer and it is driver's responsibility to pick the
correct pixels according to the provided rectangle coordinates.

This change requires update of the LCD drivers if they implement this
function.
2022-07-22 11:08:00 +08:00
Fotis Panagiotopoulos
66f49c1f3c mm: Fixed the usage of CONFIG_MM_BACKTRACE & CONFIG_DEBUG_MM. 2022-07-22 00:53:02 +08:00