Commit Graph

4780 Commits

Author SHA1 Message Date
dongjiuzhu bb6fac6152 mm/circ-buf: support circular buffer managerment
N/A

Change-Id: I3f996639a51c60d095e292fc43981e4da9929092
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-18 15:05:45 +08:00
丁欣童 52a60155f5 drivers/sensors: l3gd20 support fetch function
N/A

Change-Id: I3450d9aaf92fea04f9a03c407358aaddcb437273
Signed-off-by: 丁欣童 <dingxintong@xiaomi.com>
(cherry picked from commit 0b4d4768e90eea5915da2109f7535c771579578c)
2020-11-17 14:25:36 +08:00
dongjiuzhu 0e9f35c1f9 driver/sensor: add fetch api to read sensor data directly
N/A

1.use userspace buffer rather than intermediate buffer of upperhalf driver
2.support block and non-block ways.

Change-Id: I8e9c100f5c2a2176ab2a3f903c8940462bdcd2f7
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 15:53:33 +08:00
dongjiuzhu de30e82f92 driver/sensor: add new feature about sensor driver
N/A

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: Ida1c01fb8f505de8a28349c1b26167614aa56acc
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 15:53:33 +08:00
丁欣童 d977381060 drivers: l3gd20 supports the sensor framework
N/A

Signed-off-by: 丁欣童 <dingxintong@xiaomi.com>
Change-Id: Id5799090ff99393e96f8dde3c2dc5f1db864aca7
2020-11-11 15:20:51 +08:00
dongjiuzhu 070e08bd6e driver/sensor: user specifies device register number
N/A

Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
Change-Id: I05eb4d6ee3f6746732515f6dd5770b7229227c7b
2020-11-11 15:20:39 +08:00
Xiang Xiao dc176e2fb3 Make getopt function family more posix complaint
by porting Gregory Pietsch's version

Change-Id: I9a792734b45278863630f060a20589b0d9ab8bed
2020-11-10 16:21:46 +08:00
liuhaitao da9b962e97 sysconf: add _SC_PAGESIZE sysconf support
MIRTOS-262

Also implement getpagesize() based on sysconf(_SC_PAGESIZE).

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Change-Id: Ib6baccb9f7dac19f5e3c681db1c51e8a2fe8d3fe
2020-11-10 11:16:51 +08:00
chao.an 8f5561b018 pthread/spinlock: mode 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;
      |           ^~

Signed-off-by: chao.an <anchao@xiaomi.com>
Change-Id: If4f05d3ca736dcede990998c63a50c6c766f3b0a
2020-11-09 20:55:03 +08:00
chao.an aba2cf71cc net/wireless: add country code control support
Change-Id: Ie3917815e9004bae9c1116916bc4eadb752f6e44
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-09 20:55:03 +08:00
liuhaitao c2b8086496 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-09 20:55:03 +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
Masayuki Ishikawa 02b08590a1 drivers: wireless: Fix to handle UDP connect() with bind() in gs2200m.c
Summary:
- This commit fixes to handle UDP connect() with bind() to a local port.

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

Testing:
- Tested with spresense:wifi
- Create a UDP socket and bind() to a local port.
- Then connect() to remote address with port and send()

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-26 10:53:34 +01:00
YAMAMOTO Takashi 6a2bd9a75b Change the default value of SIGPIPE
To avoid the conflicting default with SIGQUIT.
2020-10-25 20:35:41 -07:00
YAMAMOTO Takashi ad5c168b30 signalh.h: Use the right config for SIGPIPE 2020-10-25 20:35:41 -07:00
Matias N 5386f972fa bluetooth: Add support for HCI RAW channel; make host layer optional 2020-10-25 17:04:25 -07:00
Brennan Ashton 1080d3f411 Bluetooth: Start implementing BTPROTO_HCI socket support
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-10-25 17:04:25 -07:00
YAMAMOTO Takashi df812d09a2 math: Make this friendly with libcxx
- Turn some macros into functions

- Implement some type-agnostic functions.
  (Just use __builtin_xxx)

- Add some missing function prototypes
  (Just prototypes, not actually implemented in this commit)
2020-10-25 07:30:14 -07:00
Yoshinori Sugino 3ac90fca79 Remove tabs and spaces at the end of lines 2020-10-24 09:38:21 +01:00
dongjiuzhu a3f978da02 sensor/driver: wtgahrs2 by serial interface follow sensor.c/sensor.h
Wtgahrs2 integrates multiple sensor: accel, gyro, mag, baro and gps.

Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-10-22 10:17:36 -03:00
dongjiuzhu fa09c6a8bc driver/sensor: add unified management for sensor
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-10-22 10:17:36 -03:00
dongjiuzhu 2b5be56bd0 serial/termios: support custom baud rate setting
N/A

Change-Id: I0cc00f6d0fda852533bd4a38ea6fc39e0d0059da
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-10-21 10:11:21 -07:00