Commit Graph

4573 Commits

Author SHA1 Message Date
Xiang Xiao
fd5fc2ab07 sched: Check the mutex consistent in main thread too
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2d91154572805699237cfc028202021c8f8eee40
2020-06-15 07:16:21 -06:00
Xiang Xiao
309dda3ef8 sched: pthread_cleanup_[push|pop] should be callable from main thread
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ifefccda6cb7e2335e11976dcec74e308d64c7f5e
2020-06-15 07:16:21 -06:00
Alan C. Assis
7609b67496 Fix issues reported on PR #1233 2020-06-15 07:13:21 -06:00
Alan C. Assis
e1be7ace4b Fix netdev and add Apache license to the file 2020-06-15 07:13:21 -06:00
Adam Porter
07c0faff59 Add support to CDC-MBIM USB host driver
This driver was created by Adam Porter and posted on NuttX
mailing list at Google Group on Nov 14 2019
2020-06-15 07:13:21 -06:00
Alin Jerpelea
c6c0214f9a boards: arm: cxd56: initilize the video stream driver from the board
The video stream driver must be intialized from the board to comply with NuttX

NOTE:
Please remove the initalization from any camera example

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-06-15 08:10:49 +09:00
Ouss4
02ad0e9094 drivers/leds/ncp5623c&pca9635pw: Fix nxstyle issues. 2020-06-12 17:51:23 -03:00
Ouss4
0acf6da4d8 drivers/analog/ and include/nuttx/analog: Fix typos and nxstyle issues. 2020-06-12 16:04:02 -03:00
Ouss4
fe7dfec37d include/nuttx/input/djoystick.h: Fix some trivial typos and nxstyle
issues.
2020-06-11 17:05:13 -06:00
Xiang Xiao
43d7c1e807 libc: Add IPTR for puts/fputs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2a83afb4d934a44ad1b56ec6dd72e654f4e112a3
2020-06-10 00:03:53 -07:00
Xiang Xiao
4fbbd2e3bf arch: Move PRIxMAX and SCNxMAX definition to include/stdint.h
like other related macro(e.g. INTMAX_MIN, INTMAX_MAX...)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8863599960b1a9b1c22ae9c35735a379a4c745b0
2020-06-10 08:24:47 +02:00
Xiang Xiao
7758eb8658 arch: Define INTx_C and UINTx_C macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia50ea8764880fabd3d878c95328632c761be6b43
2020-06-10 08:24:47 +02:00
Xiang Xiao
6f3cef856d libc: Add the remaining wscanf series declaration
The function isn't implemented like other wide printf/scanf

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I0b26bb5174d1a9295fe2454d0e33f8227b8cbf8a
2020-06-08 11:42:56 +01:00
Xiang Xiao
7a18ebe459 drivers/led: Extend userled_set_t from 8bits to 32bits
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I5701b42ff930998198b1d915316cc4f2d085d4eb
2020-06-07 19:28:10 +01:00
Xiang Xiao
76965474ac drivers/led: Let board_userled_initialize return the led number
so the lower half driver don't need include the specific board.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Icf6638a6865bac42150b5957376e55909f041d40
2020-06-07 19:28:10 +01:00
Xiang Xiao
1ba1c34b01 drivers/led: Decopule USERLED from ARCH_HAVE_LEDS
and let USERLED_LOWER depends on ARCH_HAVE_LEDS instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie03e76d90b61a3d8d3457ccdd319a247b6075fa8
2020-06-07 19:28:10 +01:00
Xiang Xiao
a61b8a13c6 Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-07 19:28:10 +01:00
Xiang Xiao
1b47aa1cb2 drivers/button: Let board_button_initialize return the button number
so the lower half driver don't need include the specific board.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2ff5c30049a5c5e8ee90baea56e9f4cb1a8a4f87
2020-06-07 19:28:10 +01:00
Ouss4
8da4b02350 drivers/audio: Add CS4344 driver. 2020-06-05 15:54:17 -03:00
Xiang Xiao
3409c989bd sched/task: Simplify atexit and onexit implementation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3028b74fe4872ae5cb376fa160e3cff79d5ad449
2020-06-05 13:29:22 +01:00
David Sidrane
b7ab9aa8f2 nuttx compiler.h: Add location directive for code and data
The ability to locate data and code in different sections
   is becomming critical and common place in cores with multiple
   bus matrices and power domains, where DMA can be limited to
   a specific memory.
2020-06-05 15:21:42 +08:00
Masayuki Ishikawa
ef30832e67 include: audio: Remove CONFIG_AUDIO_DRIVER_SPECIFIC_BUFFERS from audio.h
NOTE: struct ap_buffer_info_s can be used without the config

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-06-05 12:02:33 +08:00
Xiang Xiao
a69678810d sched: Change the return type of nxtask_activate to void
to simplify the error handling logic

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I00fedd4d69620a7cc7b9f9e8bf4ba7f7989dc2b2
2020-06-04 22:20:45 +01:00
Xiang Xiao
b4bd9427f7 arch: Rename _exit to up_exit to follow the naming convention
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2779a2a3ccb5426fe78714fdcc629b8dfbb7aaf6
2020-06-04 22:20:45 +01:00
liuhaitao
ff9d435a95 include/cxx/cwchar: include wctype.h to fix libcxx build break
Note that iswalnum etc functions defined in wctype.h, and cwchar uses them.
So include wctype.h to fix libcxx build break.

Change-Id: I0f6b402d817f0927729800bdb8b9fce15e76ec3d
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-06-04 12:07:16 +01:00
Xiang Xiao
a55f8d24a2 libc: Implement vscanf() function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2421e57b2c848c43afb749b8ebfa79ec457cde26
2020-06-03 07:35:08 -06:00
Xiang Xiao
9ff32427bf libc: Implement tmpfile() function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I00bdb42006b40bf1b9bc0bb6865b9b88b4acbb7b
2020-06-02 09:32:25 -06:00
Xiang Xiao
a7174cee30 libc: Unify the selection of inline or macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I44a26550ff856af07d2d96a6f0a6066f988d6da3
2020-06-02 09:32:25 -06:00
Xiang Xiao
de509004fd libc: Implement mblen, mbstowcs and wcstombs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I682c39fc132a1614b91284670882e331add765a9
2020-06-02 07:13:37 -06:00
Xiang Xiao
7cbcbcde51 libc: Implement wcsrtombs, wcsnrtombs and mbsnrtowcs
and update the related stuff in libs/libc/libc.csv

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id695a7f07bf18a7b4e526297f9131c75ddb79d30
2020-06-02 07:13:37 -06:00
Xiang Xiao
57caa4e121 libc: Move MB_LEN_MAX from lib_wctob.c to limits.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3a5addac99adb02f57aba05aa9fe2e6aaf31071d
2020-06-02 07:13:37 -06:00
Xiang Xiao
4f0957aca0 threads.h: Support mtx_timedlock and recursive mutex
And fix the minor typo error

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic554b51beb7430db08f9c8a02798bc53eb998f5e
2020-06-02 09:45:05 +02:00
YAMAMOTO Takashi
4fe0f3d99e stdint.h: Fix a comment 2020-06-02 14:09:19 +08:00
Gregory Nutt
0e425584b8 include/nuttx/video/video.h: Move global variable declaration out of header file
Move global variable declaration out of include/nuttx/video/video.h and into the file where it is initialized.  With some toolchains/environments, declaring globals in header files results in multiply defined symobl errors at link time.  This corrects that build problem.
2020-06-01 20:22:40 +01:00
Xiang Xiao
d1343df68f libc/time: Implement timespec_get for C11
https://en.cppreference.com/w/c/chrono/timespec_get

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3eb19c687cb0dc905380b10c931d66e8bb20ac55
2020-06-01 07:10:50 -06:00
Xiang Xiao
b8b61dc070 lib/stdlib: Implement aligned_alloc and posix_memalign
https://linux.die.net/man/3/aligned_alloc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I73db1c982e2c3eb73e5960e91c0d471ab967be51
2020-06-01 07:10:50 -06:00
Xiang Xiao
eac66d76b3 lib/stdlib: Change some macro to inline function
to avoid the build break for "using ::xxx"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib5d861a6c2b9e6ba585df83b3cdff8a3e1495bce
2020-06-01 07:10:50 -06:00
Xiang Xiao
b932b653dd arch: Select 64bit elf base on the architecture characteristic
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I09eec5a76f255016a910cfec3b3f70cd7577525e
2020-05-31 21:38:32 -07:00
Xiang Xiao
06972c02f1 dps.h: Remove CONFIG_LIBM and CONFIG_ARCH_MATH_H
since the user may use math library from toolchain directly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I67ccc4830403e3c15a84a8f9b1420d9a10894ddf
2020-05-31 14:09:03 -06:00
Gregory Nutt
5a9f7927ee nxstyle fixes 2020-05-28 12:22:46 -06:00
Nicholas Chin
560ba3adcd usbhost: adds a driver for the FTDI FT232R USB to serial converter 2020-05-28 12:22:46 -06:00
Gregory Nutt
1c002e1049 fs/vfs/fs_fstat: Correct fstat() for proxied block and MTD drivers.
Block and MTD drivers may be opened and managed as though they were character drivers.  But this is really sleight of hand; there is a hidden character driver proxy that mediates the interface to the block and MTD drivers in this case.

fstat(), however, did not account for this.  It would report the characteristics of the proxy character driver, not of the underlying block or MTD driver.

This change corrects that.  fstat now checks if the character driver is such a proxy and, if so, reports the characteristics of the underlying block or MTD driver, not the proxy character driver.
2020-05-28 17:34:09 +01:00
Jukka Laitinen
e030047f45 update to SPI slave intefaces
Make it possible to enqueue and receive full buffers of data with
single call, to avoid call overhead when sending / receiving large amounts
of data.

Also make it possible for the slave device to leave received data in the
controller receive buffers and retrieve it from there by polling

Signed-off-by: Jukka Laitinen <jukka.laitinen@intel.com>
2020-05-28 05:14:38 -07:00
Gregory Nutt
124e6ee53d sched/sched/sched_releasetcb.c: Handle custom stack allocations.
sched_releasetcb() will normally free the stack allocated for a task.  However, a task with a custom, user-managed stack may be created using nxtask_init() followed by nxtask_activer.  If such a custom stack is used then it must not be free in this many or a crash will most likely result.

This chagne addes a flag call TCB_FLAG_CUSTOM_STACK that may be passed in the the pre-allocted TCB to nxtask_init().  This flag is not used internally anywhere in the OS except that if set, it will prevent sched_releasetcb() from freeing that custom stack.
2020-05-27 20:00:14 +01:00
Gregory Nutt
b9042f5900 sched/task/task_init.c: Add nxtask_uninit()
Add trivial function nxtask_uninit().  This function will undo all operations on a TCB performed by task_init() and release the TCB by calling kmm_free().  This is intended primarily to support error recovery operations after a successful call to task_init() such was when a subsequent call to task_activate fails.

That error recovery is trivial but not obvious.  This helper function should eliminate confusion about what to do to recover after calling nxtask_init()
2020-05-27 17:53:46 +01:00
Xiang Xiao
f90968ace4 stddef.h: Add max_align_t typedef
defined by C11:
https://en.cppreference.com/w/c/types/max_align_t

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6f6094d054c475031ff83f648aa43f482d86b930
2020-05-27 05:40:37 -06:00
Gregory Nutt
82debdc213 Make task_init() and task_activate() internal OS functions.
-Move task_init() and task_activate() prototypes from include/sched.h to include/nuttx/sched.h.  These are internal OS functions and should not be exposed to the user.
-Remove references to task_init() and task_activate() from the User Manual.
-Rename task_init() to nxtask_init() since since it is an OS internal function
-Rename task_activate() to nxtask_activate since it is an OS internal function
2020-05-25 23:54:45 +01:00
Xiang Xiao
dd61d3d9f9 build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 18:00:40 +01:00
Gregory Nutt
154a87993f fs/vfs/fd_open.c: fs_fdopen() must not set errno
Functions within the OS must never set the errno value.  fs_fdopen() was setting the errno value.  Now, after some parameter changes, it reports errors via a negated errno integer return value as do most all other internal OS functions.
2020-05-23 15:22:09 +08:00
Gregory Nutt
57bc329aac Run nxstyle all .c and .h files modified by PR. 2020-05-17 14:01:00 -03:00