This commit removes redundant parentheses in the macro definitions to
fix the `-Wparentheses` warning:
warning: unnecessary parentheses in declaration of
'...' [-Wparentheses]
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
Pinctrl API has taken over pinmux. As planned, pinmux is going to be
deprecated for the next release (3.2). This patch flags all pinmux APIs
as deprecated.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Adds the -EBUSY return code to the documentation of the
counter_set_channel_alarm function which is returned when an alarm
is already active.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Some CAN controllers do not support all filter combinations (standard
11-bit ID filters, extended 29-bit filter, data frame filters, remote
transmission request).
Document the expected return value (-ENOTSUP) for unsupported filter
types/combinations.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Moves a .h file added outside of the zephyr include folder to be
within the zephyr include folder.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Currently, to compute the 'item' size in a ring buffer, we have
`SIZE32_OF`.
Several issues with this:
- `SIZE32_OF` only works on variables, not types, due to an extra
parenthesis pair. Indeed, `sizeof((int))` is not valid C, whereas
`sizeof((my_var))` is.
- `SIZE32_OF` is not a proper public API
- `SIZE32_OF` rounds down if the argument size is not a multiple
of 4 bytes.
Thus, we introduce a proper `RING_BUF_ITEM_SIZEOF`, fixing the
aforementioned issues.
Signed-off-by: Henri Xavier <datacomos@huawei.com>
Mcuboot bootutil_public.h provides original definition.
Thanks to previous commit there is no need to copy then any
more.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Static packaging is using only argument types to build a package. There
is one case where analysing argument type only is not enough to
determine package content. That is %p with (unsigned) char pointer vs
%s. In case of %s a string might need to be appended to the package
and in case of %p it must be avoided. Format string analysis is required
to distinguish those two cases.
In order to speed up the runtime inspection, additional information is
added to a static package. That is index of the string argument (where
first argument has index 0). This information allows quick format string
inspection where nth format specifier is found and checked if it is a
pointer format specifier.
Inspection algorithm is added to cbprintf_package_convert() and if %p
is found then data for that argument is discarded. Additionally, log
warning is printed with suggestion to cast pointer argument to void *
to avoid confusion. It is desired to get rid of this ambiguity because
there are going to be logging configurations where strings are stripped
from a binary and runtime inspection cannot be performed.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Static packaging is analyzing string argument type and based
on that builds a package. The most tricky one are pointers
which can be used for %s or %p. %s are strings which may be
transient and must be appended to the package to allow string
formatting from that package when original transient string
location is lost.
It is allowed (gcc printflike extension does not complain) to
using unsigned char for %s. So far static packaging allowed
only char or wchar_t pointers. Extending detection to unsigned
char as well.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Since db11fcd174 [net/net_pkt: Fully
separate struct net_pkt from struct net_buf], net_pkt_compact() can not
fail anymore.
This commit acknowledges this and simplifies the API accordingly.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
GCC doesn't actually need this treatment, only clang. (GCC is smart
enough to use "const" as the needed clue to suppress instrumentation
it seems like). And it turns out older gcc's emit a warning
(attribute ignored, which is... sort of weird to warn about?) in that
circumstance, which breaks builds. Just turn it off rather than try
to find a way to suppress that one warning.
Signed-off-by: Andy Ross <andyross@google.com>
Up until now, the Zephyr CAN controller drivers set a default bitrate (or
timing) specified via devicetree and start the CAN controller in their
respective driver initialization functions.
This is fine for CAN nodes using only one fixed bitrate, but if the bitrate
is set by the user (e.g. via a DIP-switch or other HMI which is very
common), the CAN driver will still initialise with the default
bitrate/timing at boot and use this until the application has determined
the requested bitrate/timing and set it using
can_set_bitrate()/can_set_timing().
During this period, the CAN node will potentially destroy valid CAN frames
on the CAN bus (which is using the soon-to-be-set-by-the-application
bitrate) by sending error frames. This causes interruptions to the ongoing
CAN bus traffic when a Zephyr-based CAN node connected to the bus is
(re-)booted.
Instead, require all configuration (setting bitrate, timing, or mode) to
take place when the CAN controller is stopped. This maps nicely to entering
"reset mode" (called "configuration mode" or "freeze mode" for some CAN
controller implementations) when stopping and exiting this mode when
starting the CAN controller.
Fixes: #45304
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
method_from_code() signature has changed to return error and
the method. In case of an invalid code it returns -EINVAL and
causes coap_handle_request() to return -ENOTSUP.
Fixes: #49498
Signed-off-by: Sagar Shah <sagar.shah@legrand.us>
According to MshPRFv1.0.1, section 3.10.7, the Provisioner shall only
use reuse addresses of the deleted nodes after IV Index is updated.
This change prevents CDB reusing addresses of the deleted nodes until IV
Index is updated. Due to a high range of the unicast addresses, CDB only
stores the highest deleted address once a node is deleted. This creates
a limitation where allocating a node with the high primary unicast
address and then deleting it will make CDB skip big range of address
until next IV Index update.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Used the registry lock in the functions lwm2m_registry_lock() and
lwm2m_registry_unlock() to make the registry lockable through a public
API. If writing to multiple resources that are composite-observed,
locking will halt the main thread until every resource is written to,
ensuring that only one notify message will be sent. Updated
the documentation in lwm2m to include this addition.
Signed-off-by: Ola Tangen Kulseng <ola.kulseng@nordicsemi.no>
This adds a very basic driver to utilize the I3C IP block
on MCUX (e.g. RT685). Note that, for now, this only supports
being the active controller on the bus.
Origin: NXP MCUXpresso SDK
License: BSD 3-Clause
URL: https://github.com/zephyrproject-rtos/hal_nxp
Commit: 2302a1e94f5bc00ce59db4e249b688ad2e959f58
Purpose: Enabling the I3C controller on RT685.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Adds support for a global workqueue so drivers can defer
IBI callbacks instead of doing it in interrupt context.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the bits to allow an I3C controller to act as target
device. This is modelled after the I2C target model.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This introduces the I3C API for I3C controllers. Currently,
this supports one controller per bus under Zephyr.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
DT node "st,stm32f105-pll2-clock" already exists but was not actually used
and PLL2 was not being configured.
PLL2 is available on STM32F105/F107 and should be turned off after turning
off PLL and turned on before turning on PLL again since PLL2 can be
used as a source for PLL. Source for PLL2 is always HSE.
Signed-off-by: Pierre-Emmanuel Novac <piernov@piernov.org>
Fixes an issue with outgoing mcumgr frames that are larger than the
transport MTU size whereby they would wrongly be split up into multiple
frames with multiple start frame headers, which affected SMP over
console transports.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
`IS_ARRAY_ELEMENT(array, ptr)` behaves like `PART_OF_ARRAY()`
except that it checks that `ptr` is aligned to an array-element
boundary.
`ARRAY_INDEX(array, ptr)` returns the index of `ptr`, where
`ptr` is aligned to an array-element boundary.
`ARRAY_INDEX_FLOOR(array, ptr)` returns the index of `ptr`,
where `ptr` does not need to be aligned to an array-element
boundary.
If `CONFIG_ASSERT=y`, then `ARRAY_INDEX()` and
`ARRAY_INDEX_FLOOR()` will trigger an assertion for invalid
`ptr`.
Signed-off-by: Christopher Friedt <cfriedt@fb.com>
On GICv3, when we send an IPI interrupt, aff3, aff2 and aff1 should
be assigned a value corespond to a PE for which interrupt will be
generated. target_list only corresponds to aff0.
On real hardware, aff3, aff2, aff1 and aff0 should be treated as a
whole to determine a PE.
Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
Use k_us_to_cyc_ceil32() for calculating the number of hardware cycles for
the given timeout value instead of using a custom calculation.
Fixes: #50032
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
When I originally was writing this header, I abused DT_PROP()
liberally when trying to access other generated macros as a
convenience to save a bit of typing.
Somewhere during the v2.3 timeline, though, I realized that adding the
DT_CAT(), DT_CAT2(), etc macros was going to be needed in order to
recursively expand macro arguments, so we could do things like this:
#define INDEX 3
DT_FOO_BY_IDX(..., INDEX)
So I duly added those in and used them wherever something broke, but
it's been a longstanding TODO for me to clean this up and apply
recursive expansion of public DT API macro arguments consistently.
Do that now.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
USBC port (Port 0/1/2/3) OCP (Over Current Protection) status
should be sent to PCH over eSPI VW index 0x50h. But there is
no dedicated VW register mapped to VW index 0x50h.
In this patch, configuring spare VW register SMVW06 to OCP VW
index 50h.
Signed-off-by: Diwakar C <diwakar.c@intel.com>
Fix the BT_CODEC_LC3_META (prefer context) and
BT_CODEC_LC3_CONFIG_META (streaming context) macros, as
they did not properly set the right values due to missing
parenthesis.
This commit also modifies the BT_CODEC_LC3_CONFIG_DATA
and BT_CODEC_LC3_DATA macros, to ensure correctness, and
to be more similar to e.g. the BT_UUID_128_ENCODE type
macros.
Also added casts to `uint8_t` to avoid compiler warnings on
e.g. GCC when assigning a non uint8_t value to a uint8_t array.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The `node@...` syntax is not accepted by the Pygments Devicetree Lexer
as it is not valid. Add dummy addresses to fix the problem.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
`@internal`/`@endinternal` is used to put "internal" information within
docstring blocks, but not to hide from public documentation any
macro/function. For this purpose, we use `@cond`/`@endcond` blocks with
the INTERNAL_HIDDEN convention.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
- Use `@code`/`@endcode` commands so that examples will have code
highlighing
- Remove redundant `@ref` commands
- Fix some incorrect `@p` usages (it is for function/macro parameters)
- Use `@p` name to reference macro arguments
- Convert a few "quoted strings" to literals using Markdown syntax (``)
- Always use Markdown syntax for literals (no `<tt>`, `@c`, etc.)
- Move implementation details to `@internal`/`@endinternal` blocks inside
the relevant macro.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This adds a dummy SMP backend which can be used for unit testing or
virtual interface purposes.
Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
Add emulator functionality to the serial_test driver, so that it can be
used to simulate a device on the other end of the uart.
If you don't set the buffer-size property in the dts node, there should
be effectively no change from the previous behavior.
Signed-off-by: Jeremy Bettis <jbettis@google.com>
The timestamp is not part of the SDU, and should
thus not be used to get the maximum SDU size.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is fixing placing the vectors section through
zephyr_linker_sources(ROM_START ...) (as done in the ARM
architecture port) so its order can be adjusted by SORT_KEY.
Fixes#49903
Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
The Xtensa arch has historically had state/user register accessor
macros with bare three-byte symbol names. I think this might have
been in the original Cadence-contributed arch integration, but I'm not
sure. In any case they also exist in the same names in vendor
HAL/toolchain code and are causing collisions. We never should have
had these symbols exposed in our header.
Put them under an XTENSA_ prefix to decollide.
Signed-off-by: Andy Ross <andyross@google.com>