The `sh_mqtt_rx_rb_flush` function was intended to flush `rx_rb` when
get an error return from `mqtt_read_publish_payload_blocking`.
Instead of retrieving values from `rx_rb` one by one, calling
`ring_buf_reset` achieves the same result more efficiently.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Introduce a local pointer, `struct shell_mqtt *sh`, to minimize access
to the module-scoped `sh_mqtt` variable.
This allows `sh` to be stored in a CPU register, resulting in more
compact code and improved execution efficiency.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Replaced nested loops with a list comprehension
to improve performance. Execution time improved
from 0.0046203136444s to 0.0040774345397s
Signed-off-by: James Roy <rruuaanng@outlook.com>
Up to now, the handling of type float was offloaded to the users of the
JSON utility, with the token JSON_TOK_FLOAT.
Improve handling of floating point types and support the types 'float'
and 'double' in a built-in way so that they can be directly parsed to
and serialized from variables (of type float or double).
The types are serialized in the shortest representation, either as a
decimal number or in scientific notation:
* float (with JSON_TOK_FLOAT_FP): encoded with maximal 9 digits
* double (with JSON_TOK_DOUBLE_FP): encoded with maximal 16 digits
* NaN, Infinity, -Infinity: encoded and decoded as:
{"nan_val":NaN,"inf_pos":Infinity,"inf_neg":-Infinity}
Enable the floating point functionality with the Kconfig option:
JSON_LIBRARY_FP_SUPPORT=y
It requires a libc implementation with support for floating point
functions: strtof(), strtod(), isnan() and isinf().
Fixes: #59412
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
Add support to decode the special floating point values NaN, Infinity
and -Infinity. For example:
{"nan_val":NaN,"inf_pos":Infinity,"inf_neg":-Infinity}
Note that this commit is a preparation for the built-in support of
floating point values and these are only accepted when compiled with
the flag -DCONFIG_JSON_LIBRARY_FP_SUPPORT.
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
Add support to decode floating point numbers in scientific notation,
e.g. 3.40282347e+38. Only the lower-case specifier 'e' is allowed.
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
Loopback test requires this in order to properly execute half
transactions. Otherwise, testsuite fails.
It was overlooked when fixing #85894.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
ESP32-C6 now supports both HP and LP core app.
This fixes and updates XIAO board to support that as well.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Both EXMIF and SPIS peripherals are claiming GPIO port 6 pin 0, but
with different CTRLSEL values. This will trigger a build error with
nrf-regtool 9.0.0 as it is not possible to apply this configuration
to hardware.
Fix the issue by disabling the EXMIF node that is enabled by default.
Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
The recent change to spi.h doc merged a bit too early on accident and
some oddities were left over, fix them, including:
- Weird command causing strange broken topics section in output
- spi_iodev_api should probably be hidden, looks strange in its own
section on the doc output
- Fix return values of transceive based functions to match transceive
description
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Added support to gicv3 driver to utilize the
extended SPI MMIO registers introduced in
GICv3.1 for the extended SPI range.
Documentation for the Extended Shared
Peripheral Interrupts extension can be found
in the ARM General Interrupt Controller
Architecture Specification:
https://developer.arm.com/documentation/ihi0069/latest/
Signed-off-by: Adam Openshaw <quic_adamo@quicinc.com>
Add support to build zephyr to run on ADL-n board
as a VM on ACRN hypervisor.
Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
Updated soc name for acrn_ehl_crb to atom as
CONFIG_ATOM is selected for ACRN_EHL_CRB in
Konfig.acrn_ehl_crb but given soc elkhart_lake
in board.yml
Added common config ACRN_COMMON to enable common
configs of ACRN.
Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
The CMakeLists.txt files in folders modules/hal_nxp/mcux/mcux-sdk-ng/*/
are loaded in modules/hal_nxp/mcux/mcux-sdk-ng/CMakeLists.txt using
cmake function `add_subdirectory`.
One issue is, when variables defined in one CMakeLists.txt are needed
by another CMakeLists.txt, then the variables need be exposed to parent
scope. This is not convenient.
Another issue is, to expose variables, the function `set_variable_ifdef`
sets the variables as global variables. The CMake global variables
named `CONFIG_xxx` will be collected by Kconfig, and results in build
fail.
The solution is:
1. Replace `add_subdirectory` with `include`, so that the variables will
be in the same file scope, don't need to expose them.
2. Modify the implementation of `set_variable_ifdef`, don't set
variables as global variables.
Resolves#88135
Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Renamed the drv8424 stepper driver to indicate its support of the drv8424,
drv8425, drv8426, drv8434 and drv8436 stepper controllors. Also made the
microstep pins optional. All test files are renamed as well.
Signed-off-by: Jan Behrens <jan.behrens@navimatix.de>
Renamed fault event to be more in line with other events and added it to
the stepper shell.
Makes the event callback trigger function of the step-dir implementation
non-static so that step-dir stepper drivers can use it to trigger events
themself.
Signed-off-by: Jan Behrens <jan.behrens@navimatix.de>
- Handled MFP configuration for STA and AP modes
- Updated the MFP configuration based on security modes
Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
- Modified conditions in WIFI_CONNECT()
function to reject SAE password and
PSK based on length parameter
Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
ADC output values can have noise, even if the input is 0V. Add a noise
threshold so that raw ADC readings below the threshold can be zeroed
out. By default the threshold is disabled.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The STM32WB09 TRNG has a prescaler that defaults (on reset) to 256, making
the entropy generation process unbearably slow. Change the prescaler value
to 1 instead, in order to make the IP about as fast as other STM32's.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
only accept new connections until the configured value for concurrent
connections is reached. Also set the backlog of the listening socket
to the configured value.
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
I won't be able to actively maintain this subsystem, but maybe help
reviewing on my spare time. The API has not changed from its
introduction, it's been mostly new drivers.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
I won't be available to collaborate in MFD, Input or GD32 areas, so
let's drop my collaborator entries.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
@kartben has been doing a great job maintaining docs, so we're good in
this area. I'll stay as collaborator so I can still follow what's going
on.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
If the RX FIFO buffer is full and there's nothing being transmitted
no LPUART interrupt will fire anymore. Thus the application will not
receive any bytes anymore. By enabling kLPUART_RxOverrunInterruptEnable
we will receive interrupts even though RX FIFO is full so we can recover
from this.
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
Update exit-latency-us with newly measured values. Measurement is
taking into account additional timing compared to wakeup from
WFI.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add nrf_cache_power_up and nrf_cache_power_down functions. In case of
s2ram power up cache as early as possible, before restoring ARM core
registers. It improves restore time from 180 us to 33 us.
As a minor optimization nrf_memconf_ramblock_control_mask_enable_set is
used which allows to control ram blocks for icache and dcache in a
single register write.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Allow relocate_vector_table() to be overwritten. This is necessary if
the IRQ vector table is handled proprietary, e.g. before the zephyr
kernel is initialized. In this case we want this function to be empty to
avoid overriding the previous configuration.
Co-authored-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
Arm OUT endpoints only when enqueueing first buffer. Disarm IN and OUT
endpoints on endpoint disable. Prevent ISO endpoints from being armed
twice before SOF.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Use USB stack state instead of former HAL state to determine what to do
with control transfer buffers.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>