Prior to this commit, i2c and at24 may be used uninitialized on line
113, 117, 129, and 143 when gd32_at24_wr_test() is called the second
time because these two variables are not static. I don't think making
them static is the correct fix because i2c is released at the end of
this function. Fixed by removing the `if (!initialized)` condition
surrounding the initialization of i2c and at24, making them initialized
at every call to this function.
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
"ioexpander/gpio.c", line 529: warning #186-D: pointless comparison of
unsigned integer with zero
if (pintype < GPIO_INPUT_PIN || pintype >= GPIO_NPINTYPES)
^
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
Description:
Example to interact with KEY button and user external button connected to PA1.
For KEY button pull-up resistor is active, board schematic does not show any pull-up or pull-down resistor.
Results: Example working as expected.
BlackPill PWM example
Description:
PWM example using PB0 - Timer3 - Channel 3
Create default configuration for the example.
Controlling_RGB_LED
Description: Controlling a RGB LED on NuttX for Black Pill board [STM32F411]
Note: Example currently not working as expected.
Add TUNSETCARRIER ioctl, then we may change the carrier state of TUN dynamically. Note that we don't need an ioctl for getting carrier, it can be done by SIOCGIFFLAGS already.
Ref: https://github.com/torvalds/linux/blob/v6.10/drivers/net/tun.c#L3374-L3380
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
since not all Armv7-m platform support double-precision floating
operations, so we add an extra option that help those specific platform
could define the single-precision floating operations.
for example, qemu-mps platform(armv7-m) support double-precision
floating operations, so we do not need to open
CONFIG_ARM_FPU_SINGLE_HARDWARE build options;
but for fc7300 platform(armv7-m) only support single-precision floating
operations, so if we pass "-fhard" build option to "ghs" compiler, then
the following instruction will be generated:
vcvt.f64.s32 d9, s18
which will fail to execute on fc7300 platform.
with "-fsingle" build option, the "ghs" compiler will generate hardware
instruction for single-precision floating operation, and generate
software instruction for double-precision floating operation.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
To support greenhill compilation, LDFLAGS removes the code that adds -T through addprefix to ARCHSCRIPT(greenhill requires a space between -T and ldscript files, but addprefix didn't do it). However,if we modified like this, when ARCHSCRIPT has more than one ldscript, the -T is only added to the first ldscript, but not to the following ldscripts, which results in a warning when linking.
To solve this problem, we can just add a space after $(SCRIPT_OPT) when using addprefix, instead of deleting addprefix.
Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
CC: serial/serial_io.c "/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/power/regulator.h", line 227: warning #231-D:
declaration is not visible outside of function
int regulator_gpio_init(FAR struct ioexpander_dev_s *iodev,
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/sys/types.h", line 319: warning #228-D:
trailing comma is nonstandard
OK = 0,
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
"/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_removeblocked.c", line 58: warning #188-D:
enumerated type mixed with another type
tstate_t task_state = btcb->task_state;
"/mnt/yang/qixinwei_cmake/nuttx/sched/sched/sched_setpriority.c", line 243: warning #188-D:
enumerated type mixed with another type
tstate_t task_state = tcb->task_state;
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
After changing sp, following functions calling will result
in unpredictable behavior in case of jumping
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
when tcp socket stays in TCP_FIN_WAIT_1 or TCP_FIN_WAIT_2,not actively calling tcp_close_eventhandler,can reuslt in some TCP socket being set to a closed state,but nofosegs are not directly released,leading to IOB resource leakage.
Signed-off-by: wangchen <wangchen41@xiaomi.com>
If the device's CPU resources are scarce and unable to execute the
ip_fragin_timerwork callback in a timely manner, this assert will
be triggered. This is a normal scenario that can occur. The logic
should be modified to wait for the ip_fragin_timerwork to be
executed if it has not been executed yet.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Wait for CMDDONE in esp32s3_waitresponse even an error response is received.
Otherwise, the CMDDONE event of this command will disrupt later command.
Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
The main objective is to determine if the examples really work or if they have been obsoleted.
The languages included in the list promote good interoperability with the NuttX API (C predominant).
This will show if they are worth integrating in NuttX.
**FFI method**
- Rust: bindgen or c2rust
- D: importC
- Swift: Bridging header or clang modulemap.
- Zig: `@cImport/@cInclude` or translate-c
This is a memory monitoring interface implemented with reference to Linux's PSI (Pressure Stall Information),
which can send notifications when the system's remaining memory is below the threshold.
The following example code sets two different thresholds.
When the system memory is below 10MB, a notification is triggered.
When the system memory is below 20 MB, a notification (POLLPRI event) is triggered every 1s.
```
int main(int argc, FAR char *argv[])
{
struct pollfd fds[2];
int ret;
if (argc == 2)
{
char *ptr = malloc(1024*1024*atoi(argv[1]));
printf("Allocating %d MB\n", atoi(argv[1]));
ptr[0] = 0;
return 0;
}
fds[0].fd = open("/proc/pressure/memory", O_RDWR);
fds[1].fd = open("/proc/pressure/memory", O_RDWR);
fds[0].events = POLLPRI;
fds[1].events = POLLPRI;
dprintf(fds[0].fd, "%llu -1", 1024LLU*1024 * 10);
dprintf(fds[1].fd, "%llu 1000000", 1024LLU*1024 * 20);
while (1)
{
ret = poll(fds, 2, -1);
if (ret > 0)
{
printf("Memory pressure: POLLPRI, %d\n", ret);
}
}
return 0;
}
```
https://docs.kernel.org/accounting/psi.html
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>