use the sizeof of struct or variable; use macro to do the data shift.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit d6d567355d08cefd1e11d88563fc300928af4972)
In the cmd result callback, save the configuration to stream if result is
success.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 9a9477fa0214f245a66e24a2edd90132293d5086)
get the avdtp error code based on Zephyr err code to make the codes more
clear.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 1d4d97fdb41791501eb63934f096bcc88cb2da81)
If the previous cmd req is triggered, the cmd fail to trigger again and
keep the previous cmd req.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit f4197d51b62799748a75c97bd0b68778185ff293)
The `a2dp` is got by `req` through CONTAINER_OF, then the if always is
true.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 24ef59d835c69a30fe8a8e6569405791532d9e0d)
avdtp defines the data format by struct, use it to fill net buf.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit a89f4eddac6f13f981f2ca0b94f07edaad104afa)
check the buf tail room before adding data to buf.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 65f8a9e03baf899684198e707170ad17817f7ce5)
In current implementation, the SLC connected event will be early
notified. It causes the SLC state of AG is not aligned with the state
of HF.
The SLC connected event should be notified after the procedure of HF
indicators is done if the HF indicators feature is supported by both
devices.
Do not notify the SLC connected event after the AG has successfully
responded with information about how call hold and multiparty services
are supported if the HF indicators feature is supported by both
devices.
Notify the SLC connected event after the procedure of HF indicators is
done.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
nRF71 supports tri-band, so, to cater both nRF70 and nRF71, rejig the
configuration and add a helper to convert from Kconfig to the interface
structs.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
CCC operation fails when no known devices exist, causing whole bus
initialization procedure to fail. Do not initialize the bus if no known
devices exist.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
A race condition occurs when the TX DMA callback is triggered before
the `dma_stat` variable is initialized to zero. This leads to
`dma_stat` being reset after the DMA TX done flag is already set.
To prevent this, move the initialization of `dma_stat` before starting
the DMA load operation.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
The address resoution from RFC6763 is generally a PTR, SRV, TXT, and
an A or AAAA. Records, so this change is mainly to start drawing a
clear functional change between the DNS query shell and the DNS
service shell that should be more of a "avahi-browse" or "dns-sd"
functional style.
So, this is not a very robust implementation since it is a chain of
queries when the goal should be to get additional records from the
message itself but those changes can be added iteratively.
Basic point of this change is to show the procedure for the "browse"
- PTR service resolution
- SRV query from the result of the PTR
- AAAA (or A) from the result of the SRV
TXT records are ignored for now but should be added into this as
additional record support is extended.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
Shift GPIO pad control flags by one bit so that they do not overlap with
drive strength flags.
Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
Added pmod_serial and pmod_header node labels to EK-RA6M4 device tree
board definition, allowing compatible shield boards to be used.
Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
rename project from can_shell to stepper_shell
drivers.stepper.shell_async is a relic of the past
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
CD pin of the SDMMC on the STM32N6570-DK board was incorrectly set as
active high, but is actually active low
Signed-off-by: Sebastian Dauenhauer <info@magical.rocks>
Previously, `time_t` was only checked in some C libraries to be greater
than or equal to a 64-bit integer and it was skipped in other C libraries.
The C standard still does not make this guarantee, and other code within
Zephyr already has been changed to accomodate both 32-bit `time_t` and
64-bit `time_t`.
There really is no point in having this test, since it is inconsistent
at best.
Until Zephyr changes to a 64-bit `time_t` (e.g. `time64_t`), then there
is no guarantee of safety against the Y2038 problem.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Issue based on rebasing with in-flight changes where the callback adds
an argument on the readout transfers. Moreover, handle that result and
error if failure.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Uses an STM32U585 microcontroller.
Some drivers will need to be developed (led matrix, internal RPC)
Signed-off-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Until now, the main thread preempted thread2 between k_event_post() and
k_event_test(). Then main thread consumed the event before it was tested by
thread2.
This behavior was not correct since the caller can't know the event is in
fact consumed (the CMSIS-RTOS specification says osEventFlagsSet() "returns
the event flags stored in the event")
This behavior is now fixed. So we can fix the test.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
The CMSIS-RTOS specification says "The function returns the event flags
stored in the event control block".
In the original code, osEventFlagsSet() called k_event_post() and then
k_event_test(). It worked mostly fine if the thread has higher priority
than the waiter thread. In the opposite case, the event was not reported
to the user.
With the last changes, the waiter thread use k_event_wait_safe(). So, the
event is posted and consumed in an atomic way. So, the issue above happen
even if the waiter thread has a lower priority then the poster.
This patch fixes the both cases.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
The CMSIS-RTOS specification says "The function returns the event flags
before clearing".
In the original code, if another thread set an event between k_event_test()
and k_event_clear(), there was a risk the function clear a flag without
reporting it to the caller:
T1 T2
k_event_test(..) == 0 ...
... k_event_post(.. 1)
k_event_clear(.. 1) ...
return 0 (while event 1 has been cleared)
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
In osEventFlagsWait(), if an event raises after the call to k_event_wait()
and before the call to k_event_clear(), we may clear it while it is not
going to be report to the caller.
Reported-by: Rahul Gurram <rahul.gurram@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Coverage options deserve their own kconfig, otherwise the testsuite
Kconfig will be very crowded and difficult to read.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The DMA configurations for TX and RX were mixed-up
letting the DMA RX channel not fully configured.
This fix correctly configures the DMA RX channel
with DMA_ADDR_ADJ_NO_CHANGE.
Signed-off-by: Rémy Dziemiaszko <remy.dziemiaszko@smile.fr>
Add support for the `times()` function, which can be used to get the
number of ticks spent in "system" and "user" mode, and which returns
the "real time" that has expired, since an arbitrary point in the past.
The following invariant should always hold:
rtime <= stime + utime
The `times()` function measures time for the calling process and all
of it's child processes. In Zephyr, we don't support separate processes
(yet), so the time spent in child processes is zero.
Additionally, in Zephyr we do not differentiate between "system" time
(i.e. time spent executing kernel code) and "user" time (time spent
executing application code). We only have information on "total time"
(time spent executing code) and "execution time" (time spent executing
code plus idle time).
For now, only report utime, since it is not clear how to obtain other
values.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Set cs_is_gpio only if there is a GPIO CS, configure the CS as
a native hardware CS if not
This fixes incorrectly trying to use a GPIO CS when there isn't one
Signed-off-by: Jeremy Dick <jdick@pivotint.com>
Replace get_last_of(init_state) with get_child_of(init_state, NULL),
and add a brief comment to avoid relying on a trivial wrapper. Also,
the wrapper name get_last_of() is not very descriptive; using
get_child_of() with an comment makes the intent more explicit.
Signed-off-by: Vladislav Kulikov <vlad_kulikov_c@pm.me>