Commit Graph

4790 Commits

Author SHA1 Message Date
YAMAMOTO Takashi
d167ec6038 compiler.h: Add scanflike macro 2020-11-19 18:03:04 -08:00
YAMAMOTO Takashi
1f6d54fde4 include/nuttx/streams.h: Add printflike 2020-11-19 18:03:04 -08:00
YAMAMOTO Takashi
7e702817c1 stdio.h: Sprinkle printflike attribute 2020-11-19 18:03:04 -08:00
YAMAMOTO Takashi
eb406a8394 compiler.h: Add printflike macro
The name was inspired from NetBSD's __printflike.

We can add similar macros for __syslog__, __scanf__, __format_arg__
later.
2020-11-19 18:03:04 -08:00
YAMAMOTO Takashi
6ee7fdf874 include/inttypes.h: Provide PRIdMAX and friends using 'j' modifier
Replace definitions in other places.
2020-11-19 00:49:56 -08:00
YAMAMOTO Takashi
c10a8dc73b include/stdint.h: Use _uintmax_t and _intmax_t from arch types.h
As we do for other intXX_t types.
2020-11-19 00:49:56 -08:00
Alan C. Assis
e7c99480ea Fix nxstyle issue existing on fs/ioctl.h 2020-11-18 22:21:53 +01:00
Alan C. Assis
f09d103528 xtensa/esp32: Add high memory support to work with PSRAM 2020-11-18 22:21:53 +01:00
liuhaitao
55deefdb30 Add debug.h selection choice to support include chip debug.h
Select debug.h which may be under include/arch or include/arch/chip.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Change-Id: I5f465c41ba27d040e5e24b2eef2918cfbc18a0bd
2020-11-18 05:22:13 -08:00
liuhaitao
fd94a32468 sysconf: add _SC_PAGESIZE sysconf support
Also implement getpagesize() based on sysconf(_SC_PAGESIZE).

Change-Id: I812eb8f34ed602f7bc12c4cafafcebc0d98fd136
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-11-17 02:03:23 -08:00
YAMAMOTO Takashi
18b3b3f5c1 include/nuttx/streams.h: Appease nxstyle 2020-11-16 05:46:53 -08:00
Frank-Christian Kruegel
bf5fa5557d Support for MAX1161X family of I2C 12 bit ADC chips:
MAX11612:  4 channels VCC=5V0 Int VRef=4.096V
MAX11613:  4 channels VCC=3V3 Int VRef=2.048V
MAX11614:  8 channels VCC=5V0 Int VRef=4.096V
MAX11615:  8 channels VCC=3V3 Int VRef=2.048V
MAX11616: 12 channels VCC=5V0 Int VRef=4.096V
MAX11617: 12 channels VCC=3V3 Int VRef=2.048V
Note: The chips' auto-scanning feature is not supported in this revision.
2020-11-15 05:59:01 -08:00
Matias N
14d14bce05 pm.h: nxstyle fixes; change License to Apache (Greg and myself authors) 2020-11-12 08:01:25 +01:00
Matias N
13619ea0df nrf52: add SPI PM support (disable/enable SPI peripheral on sleep) 2020-11-12 08:01:25 +01:00
dongjiuzhu
089b1c17f6 driver/sensor: add fetch api to read sensor data directly
1.use userspace buffer rather than intermediate buffer of upperhalf driver
2.support block and non-block ways.

Change-Id: I1d0cecfaa20ce54961c58713d8f2f8857e349791
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 18:25:22 -08:00
dongjiuzhu
2cda16b606 driver/sensor: add new feature about sensor driver
1.support for multi-user access
2.support special cmd to control sensor
3.support userspace to set size of intermediate buffer
  by ioctl: SNOIC_SET_BUFFER_SIZE

Change-Id: I9ce3a65b88b12c28388ec397431f1a277b120c2a
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 18:25:22 -08:00
dongjiuzhu
2482052228 driver/sensor: user specifies device register number
N/A

Change-Id: Idd11461f933dd21b7271cd3ca87a2e33127a9d34
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 18:25:22 -08:00
Xiang Xiao
84b90e00f0 libc/stdio: Preallocate the stdin, stdout and stderr
to handle the uninitialized stdin/stdout/stderr gracefully
report here:
https://github.com/apache/incubator-nuttx/issues/2203

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-11 09:56:10 -08:00
chao.an
27932faf1a sys/epoll: sync the epoll define with linux
Change-Id: If876e0c0b44de73cf2847a9d3c21ac138dd4f879
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-09 18:53:48 -08:00
chao.an
8b42e6abd2 pthread/spinlock: move the structure prototype out of the definition
pthread/pthread_spinlock.c: In function ‘pthread_spin_init’:
pthread/pthread_spinlock.c:114:11: error: dereferencing pointer to incomplete type ‘pthread_spinlock_t’ {aka ‘struct pthread_spinlock_s’}
  114 |       lock->sp_lock   = SP_UNLOCKED;
      |           ^~

Change-Id: I49dbb2682e36a17bb25a647c6468b7fb511e4a76
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-09 18:45:48 -08:00
Nathan Hartman
616b3e7436 include/nuttx/spi/spi.h: Fix typos in comments 2020-11-09 18:20:15 -08:00
chao.an
8604e98196 unistd/sched_sporadic: correct the disable value
Reference here:
https://github.com/openbsd/src/blob/master/include/unistd.h

Change-Id: Ifb08a69c9a2a2b68179bcfd716fb180ec3577e54
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-09 09:11:51 -03:00
chao.an
54d0c1c296 sys/uio: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-09 02:33:52 -08:00
chao.an
176d850445 sys/uio: include-able from C++ files
Change-Id: I4b512851fa96e1d696dbc886b25af4ab043da8dd
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-09 02:33:52 -08:00
chao.an
06d93828af sys/resource: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-09 02:22:34 -08:00
chao.an
82f1263db9 sys/resource: include-able from C++ files
Change-Id: I914ab40495a25da184d0b7f8f8b1fa0d376c66a4
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-09 02:22:34 -08:00
Juha Niskanen
70cbb7e537 include/nuttx/net/netconfig.h: fix typos and nxstyle
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-11-08 18:58:20 +01:00
Juha Niskanen
62d38c32e8 drivers/lcd/memlcd.c: fix typos and nxstyle
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-11-08 18:58:20 +01:00
Subhra Sankha Sarkar
6d32ad04dd Minor fixes & NuttX coding standards compliance 2020-11-07 06:41:40 -03:00
Daniel P. Carvalho
a5d340a5df Add injected channel support. 2020-11-06 18:31:32 -03:00
YAMAMOTO Takashi
4c33d608d2 include/inttypes.h: Appease nxstyle 2020-11-05 18:49:22 -08:00
YAMAMOTO Takashi
6e3551866c include/inttypes.h: Provide PRI/SCN macros for least and fast types
* To be consistent with stdint.h

* To reduce arch-dependent code
2020-11-05 18:49:22 -08:00
dongjiuzhu
8562e17ef1 rc/dummy: add dummy driver to test driver skeleton
N/A

Change-Id: Iae3c22587f9939f6923b102bf4c51bb7f88a6429
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-05 11:38:28 -03:00
dongjiuzhu
2ed6e13241 driver/rc: support IR remote control
N/A

guide link: https://www.kernel.org/doc/html/v4.14/media/uapi/rc/lirc-dev.html

Change-Id: I84abfc12578d444d72c8c0df31d06d1a85ce0725
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-05 11:38:28 -03:00
ligd
2dfd7a4e8f signal.h: fix compile failed when open TTY_SIGINT
In file included from string/lib_strsignal.c:40:0:
string/lib_strsignal.c: In function ‘strsignal’:
string/lib_strsignal.c:142:12: error: ‘CONFIG_SIG_STOP’ undeclared (first use in this function); did you mean ‘CONFIG_SIG_PIPE’?
       case SIGSTOP:
            ^
string/lib_strsignal.c:142:12: note: each undeclared identifier is reported only once for each function it appears in
string/lib_strsignal.c:147:12: error: ‘CONFIG_SIG_STP’ undeclared (first use in this function); did you mean ‘CONFIG_SIG_STOP’?
       case SIGSTP:

Esnure all standard signal number is always defined

Change-Id: I3abce86079ebeba7bab038d7c770efc90b9cffd7
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-11-05 08:28:53 +01:00
Matias N
9266c54bc2 lcd: add optional putarea()/getarea() operations 2020-11-04 04:00:22 -08:00
Nakamura, Yuuichi
7905ee17d4 Add task name recording for note RAM driver 2020-11-02 01:12:08 -08:00
YAMAMOTO Takashi
e99e185712 Don't typedef wchar_t for C++
wchar_t is a builtin type in C++.

clang complains like the following even with -fshort-wchar:

    error: cannot combine with previous 'type-name' declaration specifier

my clang version if it matters:

    spacetanuki% clang++ --version
    Apple clang version 11.0.0 (clang-1100.0.33.17)
    Target: x86_64-apple-darwin18.7.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    spacetanuki% clang++ -dM -E - < /dev/null | grep WCHAR
    #define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
    #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
    #define __SIZEOF_WCHAR_T__ 4
    #define __WCHAR_MAX__ 2147483647
    #define __WCHAR_TYPE__ int
    #define __WCHAR_WIDTH__ 32
    spacetanuki% clang++ -fshort-wchar -dM -E - < /dev/null | grep WCHAR
    #define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
    #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
    #define __SIZEOF_WCHAR_T__ 2
    #define __WCHAR_MAX__ 65535
    #define __WCHAR_TYPE__ unsigned short
    #define __WCHAR_UNSIGNED__ 1
    #define __WCHAR_WIDTH__ 16
    spacetanuki%
2020-11-01 18:19:13 -08:00
Matias N
f97f1bbd1a lcd_dev: put header in correct location; fix missing const 2020-10-31 13:26:30 -07:00
Yoshinori Sugino
51af06243f include/nuttx/serial/serial.h: Fix nxstyle errors 2020-10-29 01:12:43 -07:00
Yoshinori Sugino
c13f869432 Modify SIGSTP to SIGTSTP
Follow the POSIX description.
SIGTSTP should be sent when the Ctrl-Z characters is encountered, not SIGSTP.

Testing:
Built with hifive1-revb:nsh (CONFIG_SERIAL_TERMIOS=y, CONFIG_SIG_DEFAULT=y and CONFIG_TTY_SIGTSTP=y)
2020-10-29 01:12:43 -07:00
Matias N
9833256406 bt_hci: add various definitions, better expose some fields 2020-10-28 22:02:09 -07:00
Juha Niskanen
75c332e008 include/nuttx/lcd/ssd1306.h: cleanup for non-existent configs, nxstyle
Correct typo LCD_SSD1306_SPI to CONFIG_LCD_SSD1306_SPI, remove
references to non-existent config variable names in comments.

Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-10-28 19:28:30 -07:00
Yoshinori Sugino
04c0055355 Fix typos 2020-10-28 19:15:04 -07:00
Juha Niskanen
1115452061 drivers/pipes: nx_pipe syscall takes three params, also use nx_close on error path
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-10-28 09:11:05 -07:00
GAEHWILER Reto
83745652c4 TCP-stack fix for stalled tcp sockets due to broken keepalive
Fixes an issue where tcp sockets with activated keepalives stalled and
were not properly closed. Poll would not indicate a POLLHUP and therefore
locks down the application.

* tcp_conn_s.tcp_conn_s & tcp_conn_s.keepintvl changed to uint32_t
  According RFC1122 keepidle MUST have a default of 2 hours.
2020-10-27 11:21:56 -07:00
ligd
d0966b800f usrsock.h: add reserved value to usrsock struct
N/A

access (struct usrsock_message_req_ack_s)->result can caused
unaligend-access, add reserved value to avoid this

Change-Id: I6c7d49c57bf898fbf8459b5db9a219122494e254
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-10-27 01:20:52 -07:00
ligd
b69c587dc9 stdio: remove depends on setbuf setvbuf
N/A

Cause the function realize will handle this

Change-Id: I154c21c7a40667afae423bb0ebb67de8f5fc42fd
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-10-26 22:12:02 -07:00
Simon Piriou
b405722276 usbdev: add Android Debug Bridge driver 2020-10-26 08:28:48 -03:00
Masayuki Ishikawa
f12d49076c drivers: wireless: Fix to handle address info in accept() in gs2200m.c
Summary:
- This commit fixes to handle address info in accept() in gs2200m.c

Impact:
- All use cases which use accept() with gs2200m
- Need to update apps/wireless/gs2200m as well

Testing:
- Tested with spresene:wifi
- Tested with telnet daemon

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>>
2020-10-26 10:53:34 +01:00