Some hardware needs to config this delay to write one data block, because
the hardware needs more time to wear leveling and bad block manage.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
The implementation of up_perf_*() is in a different static library in nuttx:
Hardware: libarch.a
Software: libdrivers.a (weak function)
Since functions with weak attributes cannot be correctly replaced in multiple static libraries,
this PR will use macros to replace whether the arch supports hardware perf events
Signed-off-by: chao an <anchao@xiaomi.com>
- considering simplicity and design assumption, the reset function must work without flaw.
If it fails, there is no way to recover but to reset again. so checking return status does not
bring additional benefit
- There is unnecessary switch inside switch which is making code not too readable
Signed-off-by: mks2183 <manishsharma3134@gmail.com>
nuttx/drivers/sensors/wtgahrs2.c: In function ‘wtgahrs2_initialize’:
nuttx/drivers/sensors/wtgahrs2.c:545:22: warning: ‘%lx’ directive output may be truncated writing between 1 and 16 bytes into a region of size 14 [-Wformat-truncation=]
545 | snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)rtdata);
| ^~~~~
nuttx/drivers/sensors/wtgahrs2.c:545:25: note: format string is defined here
545 | snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)rtdata);
nuttx/drivers/sensors/wtgahrs2.c:545:22: note: directive argument in the range [1, 18446744073709551615]
545 | snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)rtdata);
| ^~~~~
nuttx/drivers/sensors/wtgahrs2.c:545:3: note: ‘snprintf’ output between 4 and 19 bytes into a destination of size 16
545 | snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)rtdata);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: chao an <anchao@xiaomi.com>
3 wire interface for ST7789 LCD controller does not use CMD/DATA pin to
specify whether data or command is send but uses 9th bit of SPI transfer.
This commit adds support for 3 wire interface to ST7789 controller.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
use workqueue for rpmsgdev poll notify to prevent
calling rpmsgdev_poll_cb in interrupt context which
will try to hold mutex in rpmsg_send
Signed-off-by: liaoao <liaoao@xiaomi.com>
Remove TABs
Fix indentation
Fix Multi-line comments
Fix Comments to the Right of Statements.
Fix nuttx coding style
Fix Comments to the Right of Statements.
support to control the opening or closing of the specified channel through the syslogmask command at runtime
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
usage:
1. Connect Jlink, start JLinkGDBServer
JLinkGDBServer -if SWD -device stm32h743zi -speed 16000
2. Listen to the RTT port data and forward it to the virtual serial port
sudo socat -d -d PTY,link=/dev/ttyRTT0,raw,ignoreeof TCP:127.0.0.1:19021,reuseaddr
3. Read serial data
minicom -D /dev/ttyRTT0
Performance:(STM32H743, 400MHZ)
time "dd if=/dev/zero of=/dev/console bs=512 count=2048"
6.67 sec 157KB/s
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Take the idea from Linux's iw_handler array and esp32c3_wlan's wlan_ops_s, and make it a common logic of upper-half driver.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)
------------------
How to test
From within nuttx/. Configure:
cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja
(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja
This uses ninja generator (install with sudo apt install ninja-build). To build:
$ cmake --build build
menuconfig:
$ cmake --build build -t menuconfig
--------------------------
2. cmake/build: reformat the cmake style by cmake-format
https://github.com/cheshirekow/cmake_format
$ pip install cmakelang
$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done
Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>
There is no need to use global spinlock to protect netdev
specific data counters. Allocate per-netdev specific spinlock
to get better locking granularity.
Move C/C++ atomic support checking to compiler.h
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
LED effects must be implemented in the lower-half of the LED driver.
The interface is designed to supports the following LED effects:
- intenisty (PWM)
- Bling (Timer)
- Fade in, Fade out (Ramp)
In this nested loop, the iteration variable is the same for both loops.
This is a typo and the inner loop should use a new loop variable.
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
Memory pointed by priv may be used (in line 1289) after it is
freed in line 1283.
Fix by adding the missing return statement in error handling.
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
It is used to write the log message to the channel immediately
when the log message is generated in the interrupt context, which
is faster than the normal force callback.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
syslog_force is used to force the syslog output to the
console in interrupt context, but we can use syslog_write
to do the same(and more) thing.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Summary:
- In this implementation, only one descriptor is used for RX.
- NOTE: we still use two descriptors for TX
Impact:
- None
Testing:
- Tested with qemu-7.1
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
if number of bytes available for reading more than zero,set USRSOCK_EVENT_RECVFROM_AVAIL flag into the event
Signed-off-by: wangchen <wangchen41@xiaomi.com>
If the rptun driver set auto start, the smetx may has been used
in rptun_notify_wait() but not inited.
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
Directly return -ENOTTY in rpmsgxxx_ioctl() when the command is
not supported to avoid fdsan command FIOC_SETTAG and FIOC_GETTAG
pass to the rpmsg dev/mtd/blk server with CONFIG_FDSAN enabled.
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
the previous patch can not handle the revent is POLLHUP or POLLERR,
poll_setup needs to be executed only when the POLLIN or POLLOUT event
changes.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Fix warning:
```
serial/ptmx.c:205:34: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Wformat-truncation=]
205 | snprintf(devname, 16, "/dev/pty%d", minor);
|
serial/ptmx.c:205:25: note: directive argument in the range [0, 2147483647]
205 | snprintf(devname, 16, "/dev/pty%d", minor);
| ^~~~~~~~~~~~
serial/ptmx.c:205:3: note: ‘snprintf’ output between 10 and 19 bytes into a destination of size 16
205 | snprintf(devname, 16, "/dev/pty%d", minor);
```
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Updated alt1250 driver with regarding to the following changes.
- Add LTE hibernation feature
- Split source code per module
- Some refactoring
- Some bug fixes
This commit reverts 19f269e54b and
substitutes the semaphore to a mutex, used as a locking mechanism
to avoid syslog messages being messed.
Considering SMP, threads running on different CPUs could call
syslog_default_write simultaneously. It then calls `up_nputs` that,
in most of the implementations, calls `up_putc` multiple times to
write to the serial. So, calling it at the same would cause syslog
messages to interfere with each other.
`up_nputs` and `up_putc` are low-level functions that could be used
during initialization and by the interrupt handler. Hence, it isn't
advisable to implement any locking mechanism on them. On the other
hand, syslog can also be used from the interrupt: if the interrupt
buffer is selected (`CONFIG_SYSLOG_INTBUFFER=y`), the syslog
messages will be flushed when we aren't serving an interrupt.
On the contrary, if it isn't set, it would call the registered
`sc_force` callback, which calls `syslog_default_putc` instead of
the lock-protected `syslog_default_write`.