Commit Graph

5370 Commits

Author SHA1 Message Date
zhuyanlin
012bd1494c arch:debug: add struct for task aware debug.
When enable DEBUG_TCBINFO config, a global struct will
provide, then debuggers can aware nuttx task infomation.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-11-10 14:31:10 -03:00
Gustavo Henrique Nihei
5dfb2713f6 include: Add __socklen_t_defined for compatibility to other C libraries
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-09 08:19:27 -06:00
futerigele
7381245159 input/touchscreen: separate the interface for user interaction
Separate the interface for user interaction, touch upper half
provides the interface uniformly.

Signed-off-by: futerigele <futerigele@xiaomi.com>
2021-11-08 21:56:03 -06:00
raiden00pl
bf23abfbd5 drivers/qencoder: add an interface to configure the encoder index pin position 2021-11-07 03:52:48 -06:00
David Sidrane
040a04241e drivers/spi:Define SPI_~CS~_DELAY_CONTROL to support other delays 2021-11-06 05:14:05 -05:00
ligd
00ef4fca51 rpmgs_socket: set RPMSG_SOCKET_NAME_SIZE to 16 for handing prefix
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-11-04 13:29:51 -05:00
Jukka Laitinen
c79d2067c7 Move timespec calculations from sched into libc/sched
Allow using these functions also outside sched, where systick
related calculations are performed

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-04 13:19:01 -05:00
ligd
131e8dc7e7 socket.h: set SOMAXCONN default value to 8
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-11-01 13:52:10 -05:00
Xiang Xiao
aec01e96fa libc: Remove the empty lib_initialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-01 11:03:02 -03:00
Jiuzhu Dong
1ed4118378 power/battery: add baterr, batinfo, batwarn for debug log
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-26 13:59:42 -03:00
zhuyanlin
b4ea11f7b1 arch:cache: add lock feature for cache
Some architectures support lock & unlock cache feature.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-10-22 13:31:32 -03:00
anjiahao
0aa14f832d mq_open: add long file name check and parameter check
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2021-10-21 11:01:45 -03:00
Jiuzhu Dong
f1f0bcc521 driver/sensor: support new sensor type:ECG,PPG,Imdepance
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-20 09:55:18 -05:00
zhangguoliang
12b2b7c240 fix: charger: change the operations of battery ioctl to common
Almost all charger chip need the same oprations, which was not
appropriate only for BQ2429X. Therefore, open the operations to
all charger chips.

Signed-off-by: zhangguoliang <zhangguoliang3@xiaomi.com>
2021-10-20 09:52:21 +02:00
weizhifang
2a6673bcdd feature: charge: modify battery_gauge code
add temperature and current ioctl api

Signed-off-by: weizhifang <weizhifang@xiaomi.com>
2021-10-20 09:52:11 +02:00
Alexander Lunev
6bdc737f5c bcm43xxx: supported high-speed timing mode with a clock rate up to 50MHz 2021-10-18 21:58:03 -05:00
Jari van Ewijk
b1d5eff52d Userled driver: Add option to check actual pin state with getall 2021-10-18 12:30:18 -07:00
Xiang Xiao
643e34efde sdio: Update the defintion to the latest spec
and correct the comment:
https://www.sdcard.org/downloads/pls/
https://www.jedec.org/standards-documents/technology-focus-areas/flash-memory-ssds-ufs-emmc/e-mmc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-17 06:29:13 -03:00
Xiang Xiao
8b67944c75 sched: Remove pidhash_s and move ticks to tcb_s
simplify the code logic and reduce memory a little bit

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-16 06:19:17 -03:00
Juha Niskanen
fc1ac6e3e0 include/nuttx/net/netconfig.h: add MSS values for usrsock
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2021-10-15 06:18:27 -07:00
anjiahao
1623848720 battery_monitor:add poll support
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2021-10-11 05:33:22 -07:00
anjiahao
ef7c61ae2d battery_gauge:add poll support
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2021-10-11 05:33:22 -07:00
anjiahao
0d95d6fa45 battery_charger:add poll support
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2021-10-11 05:33:22 -07:00
Jiuzhu Dong
9bc913abef wd_start: use sclock_t type replace int
when enable SYSTEM_TIME64, tick may exceed the int32 range
example:
pthread_cond_clockwait
        ---->clock_abstime2ticks
                    ---->wd_start

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-10 19:59:57 -07:00
Jiuzhu Dong
5ee16ee684 driver/sensor: support sensor_ops: selftest
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-10 08:28:49 -03:00
Jari van Ewijk
20bf309939 Userled driver: Rename functions to make it more consistent and avoid confusion 2021-10-05 06:08:10 -07:00
liushuai25
6c374fc06c feat: driver: support double buffer for display
add pan display for fb driver.

reference links:
https://github.com/torvalds/linux/blob/master/drivers/video/fbdev/core/fbmem.c
https://github.com/torvalds/linux/blob/master/drivers/video/fbdev/goldfishfb.c

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>

Update include/nuttx/video/fb.h

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>

Update include/nuttx/video/fb.h

Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-09-30 09:07:48 -03:00
Xiang Xiao
77bc1d1bdf power/battery: Move the enumurate to the common place
so the userspace program can handle the different battery driver equally

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-09-30 14:58:42 +09:00
Alin Jerpelea
b0ddc6e2c5 include: Omni Hoverboards: update licenses to Apache
Gregory Nutt has submitted the SGA
Omni Hoverboards has submitted the SGA
Paul Alexander Patience  has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-28 04:37:38 -07:00
futerigele
a264fd9541 input/touch: add io command for touch firmware version
Signed-off-by: futerigele <futerigele@xiaomi.com>
2021-09-27 18:17:17 -07:00
FASTSHIFT
649f99ce30 libc/misc: add lib_glob.
Signed-off-by: FASTSHIFT <vifextech@foxmail.com>
2021-09-25 07:54:39 -03:00
zhuyanlin
a41f92d1f6 sched:tcb_s:rearrange sched_priority/int_priority to word align
As pid_t is uint16_t,this could save space for many archs.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-09-23 23:08:51 -07:00
chao.an
c132e5bed4 net/tcp: sanity check for the listen address
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-23 23:07:57 -07:00
FASTSHIFT
f3477a86d2 libc/string: add lib_strchrnul. 2021-09-22 09:20:06 -03:00
iceaway
beba1056a8 userleds: add missing include (stdbool.h)
Would not compile without stdbool.h included (uses the bool type in
the header file)
2021-09-20 02:01:47 -07:00
Alexander Lunev
36fbedcbfc net/devif/devif_callback.c: corrected the connection event list to work as FIFO instead of LIFO.
In case of enabled packet forwarding mode, packets were forwarded in a reverse order
because of LIFO behavior of the connection event list.
The issue exposed only during high network traffic. Thus the event list started to grow
that resulted in changing the order of packets inside of groups of several packets
like the following: 3, 2, 1, 6, 5, 4, 8, 7 etc.

Remarks concerning the connection event list implementation:
* Now the queue (list) is FIFO as it should be.
* The list is singly linked.
* The list has a head pointer (inside of outer net_driver_s structure),
  and a tail pointer is added into outer net_driver_s structure.
* The list item is devif_callback_s structure.
  It still has two pointers to two different list chains (*nxtconn and *nxtdev).
* As before the first argument (*dev) of the list functions can be NULL,
  while the other argument (*list) is effective (not NULL).
* An extra (*tail) argument is added to devif_callback_alloc()
  and devif_conn_callback_free() functions.
* devif_callback_alloc() time complexity is O(1) (i.e. O(n) to fill the whole list).
* devif_callback_free() time complexity is O(n) (i.e. O(n^2) to empty the whole list).
* devif_conn_event() time complexity is O(n).
2021-09-18 21:01:39 -05:00
Alin Jerpelea
48f92e6f1d author: Bill Gatliff : update licenses to Apache
Gregory Nutt has submitted the SGA
Bill Gatliff has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-16 21:56:08 -05:00
Abdelatif Guettouche
3b2aea204c sched/irq/irq_csection.c: Fix typos and correct some comments.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-09-16 10:53:51 -05:00
Peter Bee
a5406c63cb drivers/lcd: Add GC9A01 driver and refine ST7735
Added custom resolution, offset and BGR mode for ST7735 driver
Added GC9A01 driver (based on ST7789 driver)

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2021-09-16 08:39:35 -03:00
Alin Jerpelea
49667a230e include: author: Hexagon AB: update licenses to Apache
Hexagon AB has submitted the SGA
as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-15 18:19:42 +08:00
SPRESENSE
ebd736240e drivers/video: Replace error output macro to verr
Add video debug macros verr/vwarn/vinfo, and replace error output macro to verr.
2021-09-15 07:06:35 +02:00
SPRESENSE
74df4b70b3 drivers: video: Rearchitect video driver
Rearchitect video driver:
- Define two video I/F(struct imgsensor_ops_s and struct imgdata_ops_s),
  and support them.
- CISIF driver supports new video I/F struct imgdata_ops_s.
- ISX012 driver supports new video I/F struct imgsensor_ops_s.
- Move ISX012 driver to general driver directory.
2021-09-15 07:06:35 +02:00
chao.an
e8d7779ab1 sys/socket/scm: add more socket message control helper
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-15 12:04:01 +08:00
Abdelatif Guettouche
20d34cce98 sched/irq_section.c: irq_waitlock is a private function; remove its
prototype from irq.h and define it as static.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-09-15 06:20:59 +09:00
liushuai25
fdcd1228b2 feature: driver: add interface for lcd dev driver
add get and set framerate interface for lcd dev driver.

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
2021-09-13 18:18:27 -03:00
liushuai25
3183251de0 feature: driver: add interface for fb driver
add get and set panel power interface for fb driver.
add get and set framerate interface for fb driver.
add panel information at videoinfo for fb driver.

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
2021-09-13 18:18:27 -03:00
Alin Jerpelea
bb54ed4227 author: OffCode Ltd : update licenses to Apache
OffCode Ltd has submitted the SGA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-13 22:43:36 +08:00
Jiuzhu Dong
6df9d1907c fs/ioctl: using FIOC_FILEPATH instead of FIOC_FILENAME.
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-13 08:56:10 +08:00
Jiuzhu Dong
dfb4b6e3d8 lib_vsprintf: Add %pV format support
test case:
void test(const char *fmt, ...)
{
  struct va_format vaf;
  va_list ap;

  va_start(ap, fmt);
  vaf.fmt = fmt;
  vaf.va = &ap;
  printf("func:%s, %pV, line:%d\n", __func__, &vaf, __LINE__);
  va_end(ap);
}

int main(int argc, FAR char *argv[])
{
  char str[] = "Hello Boy and Girl!";
  int count = 10;

  test("%s %d", str, count);
  return 0;
}

>> test
func:test, Hello Boy and Girl! 10, line:49

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-12 21:14:46 +08:00
Jiuzhu Dong
2438403f23 libc/rexec/rexec_af: support remote execution
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-12 21:14:06 +08:00
Jiuzhu Dong
d8ea482b58 errno: use staic errno to replace tl_errno before tls initialization
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-12 11:48:31 +08:00
Jiuzhu Dong
c9c284089f debug: allow customize EXTRA_FMT
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-12 11:33:20 +08:00
Abdelatif Guettouche
083272ad92 spinlock.h: In single CPU case force the lock passed to
spin_lock_irqsave to be unused in the macro to avoid spreading
UNUSED() or void throughout the code base.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-09-11 23:24:32 +09:00
daviepeng
3b5914f57b add support for power management ic axp202 2021-09-07 13:42:54 +08:00
Jukka Laitinen
1b75b5d5aa Fix compilation of arm protected build
Correct typos in include/nuttx/arch.h and suppress
"'noreturn' function does return" warning coming from arm_pthread_exit.c

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-09-07 00:31:47 +08:00
liushuai25
0368cbdf7c modify comments
Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
2021-09-07 00:31:33 +08:00
Alin Jerpelea
df088c39f0 author: Anthony Merlino : update licenses to Apache
Verge Aero has submitted the SGA

Anthony Merlino has submitted the SGA

Gregory Nutt has submitted the SGA

Sebastien Lorquet has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-06 20:38:14 +08:00
Alin Jerpelea
a20d4ac4ec author: Aleksandr Vyhovanec: update licenses to Apache
Aleksandr Vyhovanec has submitted the ICLA
as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-03 17:38:33 +08:00
Alin Jerpelea
7f0aefa632 include: nxstyle fixes
fixes for nxstyle warnings reported by the nexstyle tool

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-02 21:56:05 +08:00
Alin Jerpelea
110632293c LICENSE: revert to the original license from Atmel Corporation
revert to the original license from Atmel Corporation and add the files to
the LICENSE file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-02 21:56:05 +08:00
Gustavo Henrique Nihei
a6e9be88c4 nuttx: Add function attribute for inhibiting stack protector
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-09-01 23:11:03 +08:00
Alin Jerpelea
151f6eab3c author: Anton D. Kachalov: update licenses to Apache
Anton D. Kachalov has submitted the ICLA
as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-01 21:02:34 +08:00
Gustavo Henrique Nihei
558b772146 include/threads: Fix pthread_mutexattr_t initialization on mtx_init
pthread_attr_init was being erroneously called for initializing an
instance of pthread_mutexattr_t.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-31 11:21:22 +08:00
Gustavo Henrique Nihei
270e9196c6 include/threads: Prevent operator precedence issues
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-31 11:21:22 +08:00
Gustavo Henrique Nihei
b628d92e63 include/threads: Fix incompatible pointer type on call to pthread_join
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-31 11:21:22 +08:00
daviepeng
60b6199120 fix nxstyle 2021-08-30 02:52:30 +08:00
daviepeng
c7cda607f4 Adds driver for msa301 sensore module 2021-08-30 02:52:30 +08:00
zhuyanlin
3c58b01721 stddef: Let offset be defined from toolchain
Let `offset` could be defined from toolchain,
Which will be usefull for fixed code project.
2021-08-27 08:55:45 -07:00
Abdelatif Guettouche
5ff703d5d0 arch/*_testset: Fix few typos.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-08-25 00:20:20 +08:00
François Schauber
0bfacf4d12 include/threads.h: add missing semi-colon 2021-08-24 00:14:12 +08:00
chao.an
c826c37277 nuttx/up_backtrace: add up_backtrace interface
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-20 13:11:45 -03:00
Jiuzhu Dong
ccaea473f3 endian.h: add prefix for __LITTLE/__BIG_ENDIAN, __BYTE_ODRER
Change-Id: If072b69e37a89ccd6dc62e1d485b15703da029ac
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-20 07:47:07 -07:00
Jiuzhu Dong
1f93071370 byteswap.h: add byteswap.h header file
Change-Id: I2b00618f608efbb8834328823b5e0eaa66f42aba
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-20 07:47:07 -07:00
Xiang Xiao
af72376773 fs: Remove magic field from partition_info_s
since it is wrong and impossible to return file
system magic number from the block or mtd layer.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-20 09:19:52 -03:00
Alin Jerpelea
c7a2da8acf update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-08-20 01:45:00 -07:00
raiden00pl
b30f5e146d drivers/sensors: add an upper half 3-phase Hall effect sensor driver 2021-08-19 08:19:38 -07:00
chao.an
1060953567 sched/backtrace: add sched_backtrace support
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-19 01:30:50 -07:00
chao.an
83964231a5 libs/libc: move the backtrace implement to sched
1. move the backtrace implement to sched
2. rename CONFIG_UNWINDER to CONFIG_SCHED_BACKTRACE

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-19 01:30:50 -07:00
Alin Jerpelea
dc7b9b8dbb include: can: move error.h to apps/canutils
This file is used by the libcanutils and can be isolated in apps

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-08-17 06:28:12 -07:00
Alin Jerpelea
12ebe75fa0 include: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-08-16 07:11:32 -07:00
Xiang Xiao
4f8c3ab901 fs: Support 64bit in register_[block|mtd]partition
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-16 10:16:09 -03:00
Abdelatif Guettouche
5b350f3a0f arch/*_reprioritizertr.c: Fix typos in comments.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-08-14 11:19:34 -07:00
Xiang Xiao
6b6c11f0ad mtd: Replace MTDIOC_XIPBASE with BIOC_XIPBASE
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-12 08:01:29 -03:00
Xiang Xiao
177e1ced3f Revert "mtd: Add MTDIOC_FLUSH IOCTL like MTDIOC_XIPBASE"
to simplify flt and partion layer implementation

This reverts commit 2e49e1bc5c.
2021-08-12 08:01:29 -03:00
Xiang Xiao
f4addbd640 mtd: Replace MTDIOC_PARTINFO with BIOC_PARTINFO
to simplify flt and partion layer implementation

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-12 08:01:29 -03:00
Xiang Xiao
76904371a1 fs: Remove endsector from partition_info_s
since it can be computed from startsector and numsectors simply

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-11 09:26:43 -03:00
Gustavo Henrique Nihei
b321ae023c fs: Add ioctl command for retrieving partition info of a block device
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-10 19:45:14 -07:00
Gustavo Henrique Nihei
cddd9c9c38 mtd: Enable retrieval of MTD partition information
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-10 19:45:14 -07:00
Gustavo Henrique Nihei
6f5d02fb91 fs: Add data structure for Partition Information
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-10 19:45:14 -07:00
Abdelatif Guettouche
054e284785 *_cpustart.c: Fix typos in function description.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-08-11 11:06:27 +09:00
Xiang Xiao
a09f262f1e fs/userfs: Support fchstat and chstat callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-10 14:57:48 -03:00
raiden00pl
dca8c65331 drivers/qencoder: add command to set the maximum encoder position 2021-08-10 11:19:05 -03:00
Xiang Xiao
776458143c fs/hostfs: Support fchstat and chstat callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-09 17:55:44 -03:00
Xiang Xiao
6c61d032db fs: Add utimens and lutimens
https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html
https://www.daemon-systems.org/man/utimens.2.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-09 17:55:44 -03:00
Michal Lenc
87c5cc1a5d adc: add IOCTL commands ANIOC_RESET_FIFO and ANIOC_SAMPLES_ON_READ
This commit adds two new IOCTL commnands for ADC driver. Command
ANIOC_RESET_FIFO resets FIFO head and tail which causes the driver
to wait for the new data to be received. Calling this command before
reading ADC data in user space ensures that the read data are newly
sampled.

Command ANIOC_SAMPLES_ON_READ return the number of read channels in
the buffer. This can be useful in nonblocking mode when the application
needs to get the samples received before the app was started.

Both IOCTL commands are used only in generic driver section only and do
not have any effect on existing architecture specific drivers.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2021-08-06 21:10:59 -07:00
Xiang Xiao
b12f588140 Rename CONFIG_LIB_BOARDCTL to CONFIG_BOARDCTL
since boardctl isn't a libc feature

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-06 13:58:26 +02:00
Xiang Xiao
5025fbef8d Rename LIB_ to LIBC_ for all libc Kconfig
follow other libc component naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-05 19:45:24 +02:00
Xiang Xiao
319474b1b1 fs: Change off_t and related types to int64_t if long long is supported
since it is very popular that the storage capcacity is large than 4GB
even in the embedded system:
https://www.opengroup.org/platform/lfs.html
https://en.wikipedia.org/wiki/Large-file_support

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I019dc08aff02f9ea01eb6d750033bbc358994da5
2021-08-04 06:48:30 -07:00
Xiang Xiao
c597721633 libc: Implement gettext function
https://www.man7.org/linux/man-pages/man3/dcgettext.3.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-03 12:14:07 -03:00
Xiang Xiao
4a23737016 libc: Remove include/nuttx/lib/regex.h and libs/libc/misc/lib_match.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-03 08:59:54 -03:00
Xiang Xiao
ae7fe055fc fs: Save umask to tls_task_s for non kernel mode only
since the kernel mode has the dedicated userspace

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-02 15:59:51 -03:00
Xiang Xiao
98de773081 libc: Support message catalog function
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/nl_types.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-02 08:24:59 -03:00
Xiang Xiao
a262eebe34 libc: Rename match to fnmatch
specified here:
https://pubs.opengroup.org/onlinepubs/007904875/functions/fnmatch.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-02 08:23:35 -03:00
Xiang Xiao
0e2cbe9a79 libc: Add the empty nl_langinfo implementation
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-31 15:35:47 -03:00
Xiang Xiao
f181ed6fd2 libc: Reorder LC_XXX as Linux
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-31 15:35:47 -03:00
Gustavo Henrique Nihei
ae714baae5 board/ctrl: Add BOARDIOC_BOOT_IMAGE for booting a new application image
This command enables the application to perform the final steps of the
booting process prior to finally switching the execution to another
firmware image.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-07-30 09:47:46 -07:00
Xiang Xiao
cdc781bdfd libc: Implement local_t related functions
since local_t isn't really implemented on NuttX,
we can simply redirect to the non-locale version.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-30 09:43:26 -03:00
Xiang Xiao
decf7d0ad9 locale: Add LC_GLOBAL_LOCALE which is specified by the standard
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-30 09:43:26 -03:00
Xiang Xiao
5d1a444812 Replace __attribute__ ((unused)) with unused_code
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-29 21:55:21 -03:00
Xiang Xiao
69df58c2e8 Replace __attribute__((no_instrument_function)) with noinstrument_function;
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-29 21:55:21 -03:00
Xiang Xiao
007adc7736 Replace all __attribute__((section(x)) with locate_data(x)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-29 21:55:21 -03:00
Xiang Xiao
b3f9ffbe72 Replace all __attribute__((aligned(x)) with aligned_data(x)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-29 21:55:21 -03:00
Xiang Xiao
545a93301b fs: Don't define UTIME_OMIT if __cplusplus is defined
to avoid libcxx misdetect NuttX support utimensat(_LIBCPP_USE_UTIMENSAT).
This patch need be reverted after utimensat is supported in NuttX.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-29 06:33:49 -03:00
Xiang Xiao
307cc61893 fs: Add fchstat and chstat callback into mountpt_operations
and implement all status related change function. the individual
file system change will provide in other upcoming patchset.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8fde9db8eba9586e9c8da078b67e020c26623cf4
2021-07-29 06:33:49 -03:00
raiden00pl
919008c51e add upper-half CORDIC driver 2021-07-28 14:23:13 -03:00
Jiuzhu Dong
23d87ff9df usrwqueue: implement order work queue
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-27 21:01:38 -07:00
Jiuzhu Dong
855c78bb9d work_queue: schedule the work queue using the timer mechanism
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-27 21:01:38 -07:00
Michal Lenc
9fc806984c adc: add ioctl command to get the number of configured channels
Number of configured ADC channels is currently only defined in board
level section, typically in xxx_adc.c file. This commit introduces
ioctl command ANIOC_GET_NCHANNELS that returns the number of configured
channels which is determined by the driver code. The change can allow the
applications to be more flexible when it comes to multiple ADC devices
with different number of configured channels.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2021-07-26 19:45:47 -07:00
Xiang Xiao
5e01fe050a arch/sim: Copy include/nuttx/config.h to the local folder
so the source code compiled by host environment can include config.h
directly and then avoid pass Kconfig option through Makefile manually

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic9fe6f846082cef2d0808dc717df8ae6ed929edf
2021-07-27 07:44:33 +09:00
Xiang Xiao
3488a98bd7 sim: Correct the typedef in nuttx/hostfs.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I5fbfd519417c5686325822549c068b1d42f83946
2021-07-27 07:44:33 +09:00
Michal Lenc
7354ab187e pwm: add option to break the loops when using multiple PWM channels
PWM drivers currently use channel number 0 for the channels that are not
used by the application. This commit adds number -1 which indicates that
all following channels are not configured and that the loop can be broken.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2021-07-26 10:34:16 -03:00
Nathan Hartman
b92aeb8209 Fix various typos
arch/arm/src/eoss3/eoss3_serial.c:
arch/arm/src/imxrt/hardware/imxrt_flexcan.h:
arch/arm/src/imxrt/imxrt_flexcan.c:
arch/arm/src/imxrt/imxrt_flexpwm.c:
arch/arm/src/imxrt/imxrt_lpi2c.c:
arch/arm/src/kinetis/kinetis_flexcan.c:
arch/arm/src/nrf52/hardware/nrf52_rtc.h:
arch/arm/src/nrf52/nrf52_clockconfig.c:
arch/arm/src/nrf52/nrf52_radio.c:
arch/arm/src/nrf52/nrf52_tim.c:
arch/arm/src/rtl8720c/amebaz_depend.c:
arch/arm/src/s32k1xx/Kconfig:
arch/arm/src/s32k1xx/s32k1xx_flexcan.c:
arch/arm/src/s32k1xx/s32k1xx_lpi2c.c:
arch/arm/src/sama5/hardware/sam_sdmmc.h:
arch/arm/src/sama5/sam_gmac.c:
arch/arm/src/samd5e5/sam_wdt.c:
arch/avr/src/avr32/up_exceptions.S:
arch/avr/src/avr32/up_fullcontextrestore.S:
arch/renesas/src/rx65n/rx65n_dtc.c:
arch/renesas/src/rx65n/rx65n_usbhost.c:
arch/risc-v/src/esp32c3/esp32c3_tickless.c:
boards/arm/stm32h7/stm32h747i-disco/include/board.h:
include/nuttx/lcd/ili9225.h:
libs/libc/stdio/lib_fgetpos.c:
libs/libc/stdio/lib_fseek.c:
libs/libc/stdio/lib_fsetpos.c:

    * Fix typos.
2021-07-25 18:36:53 -07:00
liuhaitao
a02f450773 board/ctrl: add BOARDCTL_SWITCH_BOOT switch boot system support
BOARDIOC_SWITCH_BOOT is required to communicate the boot partition from
userspace (OTA subsystem) to board. It can be used to change the system
boot behavior. So it's useful for A/B boot or even single boot case.

For the board support A/B boot case:
1. Download the new image from the sever
2. Write the new image to the alternative partition
3. Call BOARDCTL_SWITCH_BOOT to the alternative system

For single boot partition case:
1. Download the new image from the sever
2. Call BOARDCTL_SWITCH_BOOT and reboot to a small system
3. Write the new image to the main partition in the small system
4. Call BOARDCTL_SWITCH_BOOT again to the main system

Change-Id: Ifebb495784ecf06842946a249bec64f75dce894f
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2021-07-22 09:03:51 -07:00
liuhaitao
200c86bc92 board/ctrl: correct BOARDIOC_USER command value
Change-Id: I3a8eb8c6c39516bbf24b1aee73312767c37158cd
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2021-07-22 09:03:51 -07:00
ligd
4919d9b7df arm: add up_secure_irq support
Change-Id: Ibc9402dcef4045ca122da400940d57de6b508308
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-22 10:50:53 -03:00
Xiang Xiao
af1dceb3e3 libc: Implement times function
https://pubs.opengroup.org/onlinepubs/009604599/functions/times.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: If2cccfedd532a77f86035d16d36d94ae38d8f09c
2021-07-21 13:11:54 -03:00
chao.an
7d4502aca6 net/socket: add SO_SNDBUF support
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-07-20 20:24:58 -07:00
Nathan Hartman
609ee6b54b Fix typos in comments and identifiers 2021-07-19 22:55:30 -03:00
Huang Qi
ad2f859170 sched: Move tls_ndxset_t & tls_dtor_t to tls.h
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-19 04:26:58 -07:00
Huang Qi
95cb33dbf5 sched: Remove unused TLS member from task_group_s
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-19 04:26:58 -07:00
Masayuki Ishikawa
cfd1c28606 fs, include: Use fsblkcnt_t and fsfilcnt_t instead of off_t
Summary:
- On Linux, fsblkcnt_t and fsfilcnt_t are used in struct statfs
- This commit applies the same logic

Impact:
- None

Testing:
- Tested with spresense:rndis_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-07-19 04:26:44 -07:00
Alin Jerpelea
7689392528 author: Zilogic Systems: update licenses to Apache
Gregory Nutt has submitted the SGA

Zilogic Systems has submitted the SGA

Uniquix Tecnologia has submitted the SGA

Michael Jung has submitted the ICLA

Alan Carvalho de Assis has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-07-19 03:08:00 -07:00
Gustavo Henrique Nihei
30cb497fe1 mtd: Add MTDIOC_ERASESTATE command for retrieving erase state value
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-07-17 09:00:41 -07:00
Xiang Xiao
663104a2e9 fs: Simplify sendfile implementation
and avoid call nx_ file API in the kernel space

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id951ca161df2c2ee267dc4b5a0d7dfa67df4c1e6
2021-07-17 07:39:15 -03:00
Xiang Xiao
2e0901fcaa net: Add file_socket function
and move the socket special process from fstat/nx_vfcntl/ to file_fstat/file_vfcntl

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia10341538488ba3a8444df8e73fb5257b2a1f512
2021-07-17 07:39:15 -03:00
Nathan Hartman
af1fd49fb0 wqueue: Fix typos
include/nuttx/wqueue.h:
libs/libc/wqueue/work_cancel.c:
libs/libc/wqueue/work_queue.c:
sched/wqueue/kwork_cancel.c:
sched/wqueue/kwork_queue.c:

    * Fix spelling, grammar, and typos.
    * Improve wording in a few areas.
    * These changes affect comments only. No functional changes.
2021-07-16 19:54:08 -03:00
Jiuzhu Dong
9d264af4fc rptun: fix compile break when disable openamp
Change-Id: I63251524d94fae43bfb0a71c324d55bf91d363f8
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-14 23:36:14 -07:00
mage1
def007e2d7 add #undef for some libc function
since it's useful to redirect these functions to others
sometime(e.g. validate the memory before write).

Change-Id: I6253a9231af8809e8362f4bc5a1bd67fb094c3b0
2021-07-14 15:09:58 -03:00
Xiang Xiao
a0f2f6c362 fs: Move umask to task_info_s
and implement the related semantic correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I0587341e2c505e41b5e24e55dba039ed200d65f2
2021-07-14 10:35:15 -03:00
Xiang Xiao
0148e1d501 fs: Support the root file system attributes(mode, uid, gid and time)
Note: all attributes is guarded by PSEUDOFS_ATTRIBUTES to save the space

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I664d60382e356068fd920f08aca5b4a49d8d92a9
2021-07-14 10:35:15 -03:00
zhouliang3
f230ba7b34 Increase the function of crc8 to use custom polynomials
N/A

Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
Change-Id: I3c53bf25541c1811a05d025b39dfe24cb0613b72
(cherry picked from commit 07b2bd769e608d4c46f8e039d091514b1b3d3ff0)
2021-07-12 20:33:21 -07:00
Huang Qi
e5c278981a net: Rename IP_TTL to IP_TTL_DEFAULT
Since a SOL option IP_TTL exist, we should rename this IP_TTL
in netconfig.h to avoid confusion.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: Ib04c36553f23bce8d362e97294a8b83eaa050cf3
2021-07-12 16:30:37 -03:00
Huang Qi
c303a12f26 include/netinet: Add missing IP_TTL definition
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: Ic0c4bcb840952a4ccf7f262306ba0c3d43e01811
2021-07-12 16:30:37 -03:00
chao.an
80b7394a95 sys/poll: add POLLRDHUP definition
Change-Id: I1117279d9a620138789256d699ae32d47eab3a90
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-07-12 16:13:40 -03:00
chao.an
a018a3a26b bluetooth/filter: add more OGF definition
Change-Id: I4f1b98dc63ab2d9eeb523b8040aae88ea285bb9a
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-07-12 16:13:15 -03:00
Xiang Xiao
2fa1e55628 libc: Implement ttyname and ttyname_r
Note: this patch can get file path from root pseudo file handle,
but a general infrastructure is setup for other file system too.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I86cd79ebb741f2f43fdd398bb7498c40687d949b
2021-07-09 18:23:34 -03:00
zhouliang3
b7653e2fae fs: Add parent node of inode
N/A

Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
Change-Id: I006c6172ced8edd47b9d4661880e04d3a4274854
2021-07-09 18:23:34 -03:00
Xiang Xiao
ee767021b3 fs: Remove the inernal st_count field from struct stat
it's more simple to reuse the resolve argument as the recursive count

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I826b2fef3af8b12aae230e4766ab09f8de988f8a
2021-07-09 16:38:51 -03:00
Xiang Xiao
800acff10e libc: Implement utime on top of utimes
https://man7.org/linux/man-pages/man2/utime.2.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia10574fdd0d07eabbc93aceeea5a0b953e30339a
2021-07-09 15:51:28 -03:00
Xiang Xiao
bae265274a libc: Move the declaration of futimens from sys/time.h to sys/stat.h
to follow the spec here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id8e418794bd43827c01af772ce704a8d3e7681c5
2021-07-09 15:51:28 -03:00