Commit Graph

30 Commits

Author SHA1 Message Date
hujun5 e4d0f404f1 driver: There is no need to use sched_[un]lock
purpose:
1 sched_lock is very time-consuming, and reducing its invocations can improve performance.
2 sched_lock is prone to misuse, and narrowing its scope of use is to prevent people from referencing incorrect code and using it

test:
We can use qemu for testing.
compiling
make distclean -j20; ./tools/configure.sh -l qemu-armv8a:nsh_smp ;make -j20
running
qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic -machine virt,virtualization=on,gic-version=3 -net none -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx

We have also tested this patch on other ARM hardware platforms.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-04-30 11:35:13 -03:00
Daniel P. Carvalho 024bdcbca0 Fixes compilation warnings. 2023-09-29 12:57:58 +08:00
Xiang Xiao a37759a6a9 drivers/ioexpander: Add const to the value array of multiwritepin
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-28 10:09:51 +08:00
Xiang Xiao e499c6c1c7 drivers/ioexpander: Add const to the pin array
forget in patch: https://github.com/apache/nuttx/pull/9529

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-28 10:09:51 +08:00
Michal Lenc 888b8e59dd pcf8574: fix incorrect function comment
Comment for pcf8574_register_update() function was incorrect as it was
probably copied from different driver function.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-01 20:36:54 +02:00
Gustavo Henrique Nihei e6b204f438 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-01 23:47:44 +08:00
anjiahao d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Gustavo Henrique Nihei 330eff36d7 sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Alin Jerpelea e5b6305f4a drivers: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-04 18:32:27 -08:00
Xiang Xiao acca9fcc3b sched/wdog: Remove MAX_WDOGPARMS and related stuff
since the variable arguments are error prone and seldom used.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-14 08:19:50 -06:00
Xiang Xiao a0ce81d659 sched/wdog: Don't dynamically allocate wdog_s
to save the preserved space(1KB) and also avoid the heap overhead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I694073f68e1bd63960cedeea1ddec441437be025
2020-08-11 12:28:55 -06:00
Xiang Xiao 4c706771c3 sched/wdog: Replace all callback argument from uint32_t to wdparm_t
and alwasy cast the argument of wd_start to wdparm_t

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Beat Küng a349595316 gpio: extend gpio_pintype_e for pulldown/up and opendrain
- fix code style
- fix bool conversion when calling go_read()
2020-07-07 08:34:25 -05:00
Nakamura, Yuuichi 9029e4daee Fix nxstyle issues 2020-04-07 06:23:15 -06:00
Nakamura, Yuuichi 776e469b02 Remove type casting to wdentry_t (drivers/) 2020-04-07 06:23:15 -06:00
Ouss4 2d13ea7477 drivers/: Check return from nxsem_wait_uninterruptible. 2020-03-30 14:40:01 -06:00
Xiang Xiao 5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Xiang Xiao 6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Gregory Nutt c014400895 drivers/input/ft5x06: Fix a misconception.. WAKE is an output, not an input. 2017-12-18 06:36:44 -06:00
Dmitriy Linikov 3582208496 Merged in hardlulz/modem-3.0-nuttx/fix-pcf8574-build (pull request #556)
Fixed build of PCF8574 driver when its interrupts aren't enabled by config.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-12-18 12:10:49 +00:00
Gregory Nutt 9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt 42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt 83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Juha Niskanen 0113b0db95 drivers: handle I2C_TRANSFER return value consistently. Some I2C peripherals transfers return zero on success, others number of completed transfers. Make drivers robust against this. 2017-08-04 07:31:36 -06:00
Gregory Nutt 95e20afcd2 drivers/: Remove dangling space at the end of lines. 2017-06-28 13:17:17 -06:00
Gregory Nutt 9965cbe428 drivers/: Review and correct some stylistic inconsistencies 2016-08-07 09:43:48 -06:00
Gregory Nutt 3d5df2e5af Extend I/O Expander interrupt controls; Add test of level sensitve interrupt to Simulated I/O expander 2016-08-04 16:19:52 -06:00
Gregory Nutt 1f9799b68d I/O Expanders: Interrupt detection logic should not ignore the no-change case. Still need to handle level interrupts even with no change. 2016-08-03 13:10:20 -06:00
Gregory Nutt 803b540e8a Fix various issues with I/O expander and GPIO lower half drivers from testing with simulated I/O expander 2016-08-03 12:46:54 -06:00
Gregory Nutt d0f6a23a32 Ooops.. forgot to add files before last commit 2016-08-01 11:15:29 -06:00