The commit replaces negative thread state checks with a new,
more descriptivepositive check.
The expression `!z_is_thread_prevented_from_running()`
is updated to `z_is_thread_ready()` where appropriate, making
the code's intent clearer.
Removes a redundant `IS_ENABLED(CONFIG_SMP)`, they are included #ifdef.
Finally, this patch add the missing `#endif` directive.
Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
This patch moves `is_aborting()` and `is_halting()`
from `kernel/sched.c` to `kernel/include/kthread.h`
and renames them to `z_is_thread_aborting()` and `z_is_thread_halting()`,
for consistency with other internal kernel APIs.
It replaces the previous inline function definitions in `sched.c`
with calls to the new header functions. Additionally, direct bitwise
checks like `(thread->base.thread_state & _THREAD_DEAD) != 0U`
are updated to use the new `z_is_thread_dead()` helper function.
This enhances code readability and maintainability.
Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
Use the RTO interrupt for RX timeouts when using the async API.
The workqueue based approach is sensitive to load and has a higher latency
than using hardware timeouts.
Signed-off-by: Kamil Krzyżanowski <kamnxt@kamnxt.com>
Add sample application to demonstrate new ADC stream APIs.
Two tests are also added:
- ad4052-stream
- max32-stream
Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
Fix for gpio-map-mask and gpio-map-pass-thru to enable use of
MAX32_GPIO_VSEL_VDDIOH and other defines with arduino_header connector.
Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
Added support for RTIO stream.
Also added sampling_period property to the DTS. This is for setting the
sampling period when streaming is used.
Hardware or kernel timer can be
used for this.
To use hardware timer you need to add it to the DTS. Example:
{
chosen {
zephyr,adc-clock = &counter0;
};
};
Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
Fix for compatible property.
Addition of hardware timer to be used with APARD32690 board.
Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
Introduce a streaming APIs for ADC devices.
Two new APIs are added to the adc_driver_api: submit and get_decoder.
Added decoder following APIs: get_frame_count, get_size_info, decode,
has_trigger.
Supported triggers are:
- ADC_TRIG_DATA_READY
- ADC_TRIG_FIFO_WATERMARK
- ADC_TRIG_FIFO_FULL
Supported operations to be done on trigger:
- include - whatever data is associated with the trigger
- nop - do nothing with data associated with the trigger
- drop - clear data associated with the trigger
Some changes to the linker scripts were needed to add decoder APIs.
Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
Define the two keys and LED available in the board. Also enable
CONFIG_GPIO=y (considered minimal in Zephyr).
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Add nodes for the GPIO controller (controlling pins PA00-44). Naming is
a bit confusing. In some places you'll find HPSYS_GPIO, other GPIO1,
pins are named PA00-PA44... I've chosen "GPIOA". Because the Zephyr GPIO
API assumes a maximum of 32 pins per controller, we have to split the
controller into 32-bit wide blocks. In reality, the controller
internally works like that (see the `reg` addresses), however, the whole
block is clocked by a single RCC _switch_.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
SiFli SF32LB SoCs have a single GPIO controller block which manages all
pins (> 32). However, Zephyr API expects ports to have up to 32 pins. So
in order to make things compatible, we introduce a Zephyrism in
devicetree: a parent node with common properties (e.g. IRQ, RCC clock,
etc.) and children nodes for each 32 pin block. See upcoming devicetree
definition for more details.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
So we can reference later to any of the PAD_XX_YY registers from e.g.
GPIO nodes, where we need to write pad configs like pull-ups.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Add myself as collaborator to help with reviews and occasional
contributions for the Bouffalo Labs SoC peripherals, configurations,
and HAL.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Like other samples, this moves to net_ipaddr_parse, which can handle IPv4
and IPv6. Additionally, it parses the port as well which removes the need
to have separate Kconfigs for addresses and ports, thus simplifying the
code.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
GCC gave the following warning:
mqtt_sn_transport_udp.c: In function ‘tp_udp_init’:
mqtt_sn_transport_udp.c:117:9: warning: ‘memcpy’ forming offset [12, 105]
is out of the bounds [0, 12] of object ‘mreqn’ with type ‘struct ip_mreqn’
[-Warray-bounds=]
117 | memcpy(&mreqn.imr_multiaddr, &udp->bcaddr.data[2], si...
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mqtt_sn_transport_udp.c:48:25: note: ‘mreqn’ declared here
48 | struct ip_mreqn mreqn;
| ^~~~~
And it turns out that it's right. The original code looks like it tries to
copy the IP address to imr_multiaddr in a way that works for both v4 and
v6. It ignores, that bcaddr.data may be way larger than even a v6 addr,
because it's a buffer that's big enough to hold many other structs as well.
Not only that, IP_ADD_MEMBERSHIP is for IPv4 only and imr_multiaddr can
only hold an IPv4 address anyway.
This modifies the code to have separate code paths for v4 and v6 and call
the correct APIs. This also gets rid of the memcpy, since it can be a
simple struct assignment now.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
Properly adjust the init priorities on the max32690evkit to account for
initialization levels of the MAX32 HPB memc driver.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
Mark pm_device_driver_init() as a boot function to support using it
for early init on devices with demand paging.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
add forgotten if around Kconfig options.
This applied the default of 32 to all
CONFIG_SDHC_BUFFER_ALIGNMENT.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
net_if.h and net_pkt.h are 2 headers required by lldp.h
as it needs to know net_if and net_pkt structs.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Document the refactoring of the PM_S2RAM and PM_S2RAM_CUSTOM_MARKING
in the release notes and migration guide for release 4.3
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The config PM_S2RAM_CUSTOM_MARKING is not an optional config for a
user to select, it is required by some soc implementations of S2RAM,
in which case it must be selected by the soc.
Refactor the configuration to be HAS_PM_S2RAM_CUSTOM_MARKING, and
make the currently only soc which needs it select it. Then update
samples which previously had to select this option for this soc.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Currently it is possible to have an enabled (status="okay")
"suspend-to-ram" "zephyr,power-state" in the devicetree,
CONFIG_PM=y, but CONFIG_PM_S2RAM=n
This means the presence and state of the "suspend-to-ram" power
state in the devicetree does not match the PM_S2RAM option,
despite PM_S2RAM being dependent on the devicetree state.
This commit makes the devicetree the "source of truth" for
whether one or more s2ram power states shall be included and
supported, by enabling PM_S2RAM if any s2ram power state with
status "okay" is present in the devicetree. To disable the
s2ram power state, like with any other state, disable it by
setting its state to "disabled".
The help of the now promptless PM_S2RAM config has been
updated to reflect the new meaning. It previously held
cortex-m specific implementation details, these have been
removed as these details are already present in the file
pointed to as well (arch/arm/core/cortex_m/pm_s2ram.c
line 22)
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
ti_dmtimer.h contains mask definitions only used internally by the
driver. Make it a private header.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
- Both UART5 and UART0 are default states of some of the header pins.
- As such, it's best to enable them by default.
- We also do not have to care too much about code size for a53s due to
the large (for zephyr) RAM.
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Add "external_flash" fixture to the no_explicit_erase testcase
in order to run twister only on boards with such HW setup.
Other runnable test cases has it already.
Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
Move the accept-loop into a socket-service. No dedicated thread is needed
just for the accept loop. This better demonstrates the power of the
socket-service in removing the need for dedicated threads. Make some tiny
improvments and necessary changes to the udp-side of the service.
Signed-off-by: Cla Mattia Galliard <clamattia@gmail.com>
write enable already happens in the write/erase loop
before every write and erase. It is done in the loop,
because it is self cleaning after erase and write.
That is also the reason we don't need to disable it,
as it is automatically disabled after each write and erase.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Enhance the armfvp emulator cmake handling to allow additional options
for setting ARMFVP_BIN_PATH, relaxing the previous requirement to set in
an environment variable. This makes it possible to run twister with
multiple armfvp platforms located in different paths.
Signed-off-by: Maureen Helm <maureen.helm@analog.com>
Add an explicit check to ensure that the acquisition_time
parameter is encoded with the ADC_ACQ_TIME macro and uses
the TICKS unit, as required by the API.
If the unit is not correct, log an error and return -EINVAL.
Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
On certain platforms I2C is not enabled by default, causing build error.
Change pca_series driver to select I2C.
Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>