This macro is defined in a few places which leads to macro redefinition
error e.g. when compiling prometheus network sample for NPCX boards.
Provide one definition of IS_BIT_SET() in util_macro.h to fix the
problem.
Signed-off-by: Patryk Duda <patrykd@google.com>
This macro will help us to enable the 5th bit CIRC on the DMA_CCRx
register for all stm32 series having this configuration.
Thus the DMA will be able to handle the circular buffers.
Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
co-authored-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
Repeated references to _current won't produce a different result as the
executing thread instance is always the same. Use the const attribute to
let the compiler know it may reuse a previously obtained value. This offset
the penalty for moving z_smp_current_get() out of line and provides yet
more binary size reduction.
This change is isolated in its own commit to ease bisecting in case some
unexpected misbehavior is eventually observed.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Define the generic _current directly and get rid of the generic
arch_current_get().
The SMP default implementation is now known as z_smp_current_get().
It is no longer inlined which saves significant binary size (about 10%
for some random test case I checked).
Introduce z_current_thread_set() and use it in place of
arch_current_thread_set() for updating the current thread pointer
given this is not necessarily an architecture specific operation.
The architecture specific optimization, when enabled, should only care
about its own things and not have to also update the generic
_current_cpu->current copy.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Mostly a revert of commit b1def7145f ("arch: deprecate `_current`").
This commit was part of PR #80716 whose initial purpose was about providing
an architecture specific optimization for _current. The actual deprecation
was sneaked in later on without proper discussion.
The Zephyr core always used _current before and that was fine. It is quite
prevalent as well and the alternative is proving rather verbose.
Furthermore, as a concept, the "current thread" is not something that is
necessarily architecture specific. Therefore the primary abstraction
should not carry the arch_ prefix.
Hence this revert.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Support printing WPA3 enterprise type in scan result for more
accurate display, including the suiteb, suiteb-192 and WPA3
enterprise only.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
For 'wifi status' and 'wifi ap status' cmd of the hostap case,
originally only support getting 'EAP-TLS' for the enterprise
mode, which is not correct. Now support getting the specific
enterprise mode, including the WPA3 enterprise mode and
the EAP method type.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Change Wi-Fi suiteb type into WPA3 enterprise security type, it
includes suiteB, suiteB-192 and WPA3 enterprise only mode.
Support setting WPA3 enterprise only mode, which should use
cipher_config->key_mgmt as WPA-EAP-SHA256, and the AKM in RSN
IE will show 00-0F-AC:5.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Remove EAP TLS SHA256 security, as it was added to support the AKM
of 00-0F-AC:5 in RSN IE, but actually this AKM is used by WPA3
enterprise only mode.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Both the TMAP kconfig file and public header file defined
which roles were supported.
The Kconfig file options were recently added and were more
up to date (and correct), and allows for other Kconfig files
to use these values, thus allowing for more flexibility when
implementing applications.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Ensure that HTTP resources can only be served to a client connected on
the specific service(s) that the resource was registered against using
the HTTP_RESOURCE_DEFINE macro.
This allows different resources to be registered to different services,
for example to make some resources only available via an HTTPS service
and not via unencrypted HTTP.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Passing HTTP upgrade request context to the user callback allows the
user to decide whether to accept or reject the websocket connection
based on the HTTP headers in the request. The primary reason for this is
to enable authentication of the websocket connection (e.g. via cookies
or Authorization header).
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
The CCP API for the Call Control Profile works on top of the
TBS API, and will eventually replace parts of the TBS API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This is a squash of all the groundwork needed to
get a functioning driver for the DS3231 with the RTC API.
Signed-off-by: Gergo Vari <work@gergovari.com>
Even though calculating the priority queue index in the priority
multiq is quick, caching it allows us to extract an extra 2% in
terms of performance as measured by the thread_metric cooperative
benchmark.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Dequeuing from a doubly linked list is similar to removing an item
except that it does not re-initialize the dequeued node.
This comes in handy when sorting a doubly linked list (where the
node gets removed and re-added). In that circumstance, re-initializing
the node is required. Furthermore, the compiler does not always
'understand' this. Thus, when performance is critical, dequeuing
may be preferred to removing.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
The commit changes requirements for stream_flash_init, where size
can no longer be 0 and has to be explicitly set, to avoid situation
where size autodetection, invoked by size == 0, would miss changes in
layout and silently allow overflow of Stream Flash into other partitions.
There has also been new Kconfig option CONFIG_STREAM_FLASH_INSPECT,
set to y by default to keep legacy behaviour, that can be used to turn
off stream_flash_ctx vs device inspection, allowing user to shed
inspection code once it is not useful anymore.
Fixes: #71042
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Add NRF_PERIPH_GET_FREQUENCY() that returns the frequency of clock
that is used for the node.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add the SDR Error Code to be written in to the payload following
section 5.1.10.2 of the I3C v1.1.1 specification.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
For ENTDAA, BCR and DCR is always transmitted back up to the controller.
When `i3c_bus_init` is done, it does the ENTDAA then it would get the
basic info would get the BCR and DCR again. This was rather reduntant.
This now splits it up so there is a function called
`i3c_device_adv_info_get` which gets the mrl, mwl, getcaps, and the
mxds. `i3c_device_basic_info_get` now only just gets the bcr and dcr.
There is also an inline function called `i3c_device_info_get` which
will get everything.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Cleans up the doxygen comments in the stepper api header. Includes:
- documentation for MICRO_STEP_RES_INDEX
- constistent use of microsteps instead of micro_steps or micro steps
- fix for previously renamed set_target_position refrence
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
Two functions have parameters in the wrong order in the function
description, fix them to the correct order
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds a new error code that can be used to signify that a query was
valid but the response was not valid
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Add the Sensor Fusion Low Power (SFLP) FIFO streaming capability,
using RTIO. The decode function is now aware of parsing following FIFO
tags:
- LSM6DSV16X_SFLP_GAME_ROTATION_VECTOR_TAG
- LSM6DSV16X_SFLP_GYROSCOPE_BIAS_TAG
- LSM6DSV16X_SFLP_GRAVITY_VECTOR_TAG
To activate SFLP the user should put in DT the proper configuration.
For example, to activate a 60Hz SFLP FIFO batching rate of game rotation
vector, gravity vector and gbias components, the user should add in DT
the following:
sflp-odr = <LSM6DSV16X_DT_SFLP_ODR_AT_60Hz>;
sflp-fifo-enable = <LSM6DSV16X_DT_SFLP_FIFO_GAME_ROTATION_GRAVITY_GBIAS>;
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Add three new channels and relative data:
- SENSOR_CHAN_GAME_ROTATION_VECTOR
The "game rotation vector" reports the four components x/y/z/w
(quaternions) of the unit vector representing a 3D spatial
rotation or orientation.
- SENSOR_CHAN_GRAVITY_VECTOR
The "gravity vector" reports the three axis x/y/z of the gravity
vector separated from the linear acceleration components.
The measurement unit is m/s^2.
- SENSOR_CHAN_GBIAS_XYZ
The "gbias" reports the gyroscope offset x/y/z components.
The measurement unit is radians/s.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
It is not sufficient to check if the given node_id has the requested
property in GPIO_DT_SPEC_GET_BY_IDX_OR(), the index also needs to valid.
Change the logic to test for a valid index (which, in turn, also checks if
the property is valid), otherwise return the default value provided by the
caller.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Pull the register variable into the private scope that ARCH_EXCEPT
creates so that the macro can be used multiple times in the same caller
scope. This can happen via k_panic(), e.g. in subsys/fs/ext2/ext2_impl.c.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Fixes two isolated instances of implicit void pointer casting in spi.h.
While this is legal in C, it causes a compiler error in C++.
Signed-off-by: Dane Wagner <dane.wagner@gmail.com>
For the lists of properties passed as a pointer to the get_props and
set_props functions, there is no reason to not make the pointer const as
the called functions will not and should not alter the pointed-to data.
In practice, not having the pointers const can cause compilation errors
if trying to pass in a const array of properties.
Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
The fuel_gauge_get_props and fuel_gauge_set_prop functions were missing
casts for the device struct which causes compiler warnings when using
the -fpermissive compiler flag.
Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
In the fuel_gauge_get_props and fuel_gauge_set_props functions, an array
len is passed as a size_t but compared against an int, which leads to
C++ compiler warnings when using -Werror=sign-compare. The fix is to use
a size_t for the loop counter.
Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
Use uint64_t instead of uint32_t for the FLASH_STM32_EX_OP_SECTOR_WP
extended operation.
Some chips have two banks, more than 16 sectors each e.g. stm32h7a3xx
chips, so more than 32 bits are required.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
The routine k_reschedule() allows an application to manually force
a schedule point. Although similar to k_yield(), it has different
properties. The most significant difference is that k_yield() if
invoked from a cooperative thread will voluntarily give up execution
control to the next thread of equal or higher priority while
k_reschedule() will not.
Applications that play with EDF deadlines via k_thread_deadline_set()
may need to use k_reschedule() to force a reschedule.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Avoid referring to Pico 2 (the name of a board). In this context,
RPI_PICO is used to refer to the (Zephyr) `SOC_FAMILY` rather than the
Pico 1 board. This clarifies common numerical values between the RP2040
and RP2350 SoC series, and enables existing DTS files to be used with
RP2350-based boards with fewer changes.
Remove the use of Zehpyr's `CONFIG_` macros from the device tree files,
and replace them with `SOC_SERIES`-specific files. Update the driver
implementation to conditionally include the correct file. Update
documentation and samples to match.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>