It is very common to see a comment stating that the
"No Space Before Opening Brackets" style guide is not followed.
To avoid putting this burdon on reviewers, let the compliance
check catch this instead.
Checking for tab indentation was also very simple, so also added
this.
Running this check on all files finds many violations:
- Space before opening brackets: 141 violations
- Tab indentation: 420 violations
Fixing these will not be done as part of this PR. Adding the check
will prevent us from adding new violations.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
These two were introduced after the previous commit, disable the cache
for them as well, reduce some noise from the github caches page.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
With the UART transport test (sample.tracing.transport.uart),
it would fail on qemu_x86_64 complaining about missing
k_event tracing functions. So add them to fix the compilation
error.
Fixes#96818
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The ((0) ? (arg) : (arg)) compiler trick leads to a codechecker
violation:
"conditional operator with identical true and false expressions"
Replace it by ((0) ? (0) : (arg)) to work around this issue.
Signed-off-by: Stefan Gloor <stefan.gloor@siemens.com>
Optimize power consumption for the Nucleo-WB09KE board by
implementing correct pull-up/pull-down configurations when the device
enters lower power states.
Disable the SMPS with floating output in suspend-to-ram (deepstop)
power state.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Add PM support to the STM32WB0x Bluetooth HCI driver.
Implement PM event register to wake up the device for its BLE events.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Provide PM support, specifically suspend-to-ram, for STM32WB0x.
Enable STM32_RADIO_TIMER Kconfig parameter when PM is set.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Use radio timer as the system timer when Bluetooth is used.
Modify CMakeLists.txt to compile radio timer driver when
STM32WB0_RADIO_TIMER is enabled.
Remove the common parts from hci_stm32wb0.c that are present
in the radio timer driver.
Set and retrieve the appropriate value for SYS_CLOCK_TICKS_PER_SEC and
SYS_CLOCK_HW_CYCLES_PER_SEC respectively.
Define radio_timer node and its properties.
Enable radio_timer node in nucleo_wb0x boards.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Fix the improper use of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for STM32WB0
drivers due to the misunderstanding of its definition.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
This commit applies clang-format to file include/zephyr/sys/util.h
to align them with the latest Zephyr coding style guidelines.
Signed-off-by: Firas Sammoura <fsammoura@google.com>
Add two internal Z_INTERNAL_MAX and Z_INTERNAL_MIN macros and use those
for implementing the actual MIN and MAX. This allows a downstream
application to undefine and redefine MIN and MAX, for example to define
them to min and max, which is useful if it relies on MIN and MAX to be
the single call version.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add three argument variants of the single evaluation min and max, seems
like there's few of these in the code we may as well have them.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add support for nested min/max by using unique automatic variables. This
is heavily inspired by the Linux implementation, just reimplemented from
scratch using the Zephyr internal APIs.
Link: https://elixir.bootlin.com/linux/v6.16.8/source/include/linux/minmax.h#L314-L315
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Rename these three macros to an unprefixed lower-case variant. This is
normally not done for Zephyr macros (see container_of) but in this case
it seems like a good idea to adopt the lowercase names to:
1. have the same convention as the equivalent Linux macros, helping devs
working cross project recognizing (mis)use patterns.
2. make it somewhat intuitive that the lowercase ones are meant to be
used in functions while the uppercase ones are to be used for static
evaluation.
Add few c++ guards to avoid colliding with std::min and std::max.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
These three are single evaluation versiono of MIN, MAX and CLAMP, they
are defined in toolchain headers as they use typeof [1] and statement
expressions [2], which are compiler extensions, but given that these are
used by other macros in util.h as well, it seems to be fair to assume
that these are supported by all compilers used with Zephyr today.
[1] https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html
[2] https://gcc.gnu.org/onlinedocs/gcc/Typeof.html
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Currently, EXTEN switch control (mapped to GPIO5) is always 0, due to a bug
in the shift value. This has been reported in Coverity CID 353647.
Following the AXP192-X Datasheet, the EXTEN switch control status is
given by bit 2 of the register 10h. If "GPIO5" corresponds to EXTEN
Switch control (AXP192_GPIO5_OUTPUT_MASK is 0x04U), then the shift
AXP192_GPIO5_OUTPUT_SHIFT should be 2, not 3.
Signed-off-by: Loic Domaigne <tech@domaigne.com>
Setting the peer hostname to NULL does not skip hostname verification.
After discussion in the issue it was agreed that it's better to remove
this comment than to implement skipping hostname verification.
Also fixed a typo in the remaining part of the comment.
Fixes: #96853
Signed-off-by: Kevin ORourke <kevin.orourke@ferroamp.se>
Commit e4650bc349 modified check_compliance
to avoid false negatives when a commit has multiple signoff lines and the
author's signoff line isn't the first one. To avoid this, a signoff line
which matches exactly the author's name and email is searched instead of
matching any line with the proper syntax and checking the fields.
While this solved the original issue, this also introduced a new issue:
whereas the old script would distinguish a properly formed signoff line
with the wrong author from a malformed signoff line, the new method now
checks both the syntax and the author name/email at the same time. As
such, the script will report "signoff line does not follow the syntax"
for both situations, but the signoff line DOES follow the syntax in the
latter case: the error message is then only a misleading red herring.
Fix this issue - and improve the check - by verifying every signoff line
in a commit's message body. Invalid syntax on any line is reported as a
"does not follow syntax" failure, whereas inability to find the commit
author is reported as a separate "no signoff entry matches commit author"
failure as it should always have...
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
When checking for emails/sign-off, if parsing of the commit information
using 'git show' fails, the 'auth_name', 'auth_email' and 'body' variables
are unbound but accessed right afterwards, which would cause an error.
Skip straight to next iteration of the loop when such an error occurs to
ensure access to the unbound variables is never performed.
This error was reported by the VS Code Pylance analyzer.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
After commit 524b72ce40 ("toolchain: llvm: Provide working
BUILD_ASSERT macro") when compiling with clang we have actual
checks and a real assert check using _Static_assert.
Now, when compiling with clang (used by Xtensa internal toolchain)
we get the following error.
$ zephyr/drivers/dai/nxp/sai/sai.c:968:29: error: static_assert expression
is not an integral constant expression
We get this in asserts like this:
BUILD_ASSERT(SAI_DLINE_COUNT(inst) != -1, "...").
This expands to (reduced the macro to easier understand the context):
_Static_assert(((((((I2S_Type *)(uintptr_t)(1493499904U))) ==
((I2S_Type *)(0x59040000u)))
... and clang complains that this is not a constant expression.
So, in order to fix the compile time error remove the compile time
asserts and replace them with runtime checks.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Fixes: commit 524b72ce40 ("toolchain: llvm: Provide working
BUILD_ASSERT macro")
Due to the added overhead on 64 bit native, we also need to increase
the memory pool size to fix crashes as described in here:
https://github.com/lvgl/lvgl/issues/7648
Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
The increased complexity of the LVGL code now overruns the 4 KiB stack
of the main thread. Increase it to 6 KiB to fix the error.
Fixes: #94473
Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
Our build system DT API has a dt_comp_path() function used to look up
paths of nodes with a given compatible. This relies on the generated
edt.pickle.cmake file in the build directory to look inside the
concrete devicetree for the current application build.
The script gen_dts_cmake.py is responsible for generating
edt.pickle.cmake. It currently generates the data needed by
dt_comp_path() by looking inside each edtlib.Node object's "props"
attribute. This attribute in turn is fed by the "properties:" key in
the node's YAML binding. This leads to an edge case which is breaking
the dt_comp_path() API.
In most cases, we don't notice this edge case because base.yaml, which
is included by nearly all bindings, has a definition for "compatible"
in its "properties:" map. However, bindings are not required to
include base.yaml, and bindings do not have to explicitliy define a
"compatible" entry in their "properties:". An example of a binding
that does neither is fixed-partitions.yaml: it only has #address-cells
and #size-cells in its "properties:".
Nonetheless, "compatible:" is always a valid property name because
it's defined in the DT spec, and we should make the CMake API robustly
detect all nodes with a given compatible, regardless of whether that
node's binding explicitly defines it or not.
To make this happen, rely on the edtlib.Node.compats attribute instead
of edtlib.Node.props. The compats attribute is always defined even if
the node's YAML binding doesn't have an explicit entry for
"compatible".
Signed-off-by: Martí Bolívar <marti.bolivar@oss.qualcomm.com>
only switch to 4 bit mode, if it is supported
by the host. for MMC it is already checked,
but not for the sd card.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add the #include <snippets-sections.ld> directive
to include a linker file automatically.
This file defines additional linker sections that
are dynamically added during the build process.
It is placed at the very end of the SECTIONS block,
ensuring that any sections it defines appear after
all standard sections.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
The domain clock configuration for lptim1 node in nucleo_g431kb.dts has a
conflict between the source and the peripheral. The source is specified
as STM32_SRC_LSI - low speed internal, but `LPTIM1_SEL(3)` will actually
configure the low speed external clock as the source, which the Nucleo
G431KB does not have. Update this to actually use the LSI clock. See
RM0440 Rev 9 page 322 - LPTIM1SEL[1:0] for more details.
Signed-off-by: Michael Estes <michael.estes@byteserv.io>
This commit updates the CI workflows to use the CI image v0.28.6, which
adds libfuse3 and additional Clang dependencies such as libclang-rt.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Do not use docker image, use action for setting up zephyr instead.
We need the SDK here to check the headers.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit updates the CI workflows to use the CI image v0.28.5, which
adds Node.js runtime and the TF-M Python dependencies.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The size of each spinlock register might vary depending on the SoC.
Make it configurable in the devicetree.
Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
Using the mpidr of the core to lock the hwspinlock meant it acted as
a spinlock in the cluster itself, which is exactly the opposite of what we
tried to achieve.
Additionally, this tied the driver to the arm architecture, even though the
HW was not.
Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>