Replace the switch statement with an array-based register lookup and a
modulo operation to resolve a Coverity "integer handling" issue and make
the code simpler.
The original subtractions (*led -= 4U/8U/12U) were guarded by switch cases
making underflow impossible in practice, but the pattern was flagged
nevertheless. The new array-based approach is semantically equivalent and
arguably more readable.
Fixeszephyrproject-rtos/zephyr#84770
Fixes Coverity CID 487606
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Placing device drivers in vendor-specific subfolders provides greater
flexibility for approaches like `<vendor/device>-common.c/h` without
cluttering a shared directory. The sensor subsystem provides good
examples of the benefits of this approach -- in particular, the
/drivers/sensor/ti/ina2xx/ subdirectory.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
Enable CONFIG_SHARED_INTERRUPTS to allow multiple devices
to register handlers on the same IRQ line.
Replace irq_connect_dynamic() with IRQ_CONNECT() to configure
interrupts at build time, eliminating runtime setup overhead.
Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
Reorganize ESP32-C6 LP SRAM into dedicated memory regions:
- ulp_shm: ULP shared memory for LP core communication
- ipc_shm: IPC shared memory for mbox driver
- lp_rtc: RTC data section for deep sleep persistence
- retainedmem: retained memory region with zephyr,retained-ram
Reduce main LP SRAM from 16K to 15K to accommodate the new
dedicated regions in upper LP SRAM. Update mbox overlay
references from shmlp to ipc_shm nodelabel.
Remove deep_sleep and retained_mem board overlays that are no
longer needed with the updated base DTS.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
This ensures public Doxygen documentation clearly indicate what Kconfig
options need to be enabled for the documented functions to be available.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add more complete/dedicated documentation page for UUID API.
Drop the old services/misc page as it's empty/deleted now
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Avoid this warning associated with the spi_context_cs_* functions
when DT_SPI_CTX_HAS_NO_CS_GPIOS is defined.
warning: statement with no effect [-Wunused-value]
Signed-off-by: Bill Waters <bill.waters@infineon.com>
Enhance accel_trig sample with activity detection support and
improved error reporting for testing interrupt functionality.
Signed-off-by: Tobias Kässer <t.kaesser@gmail.com>
Fix interrupt enable/disable sequence per ADXL345 datasheet
recommendations.
The ADXL345 datasheet (page 19) states: "When initially configuring
the interrupt pins, it is recommended that the functions and interrupt
mapping be done before enabling the interrupts."
Main changes:
1. Remove adxl345_interrupt_config() which incorrectly enabled
interrupts during driver initialization without proper sequencing.
It's not clear to me what was the purpose of this function as all
the required logic (setting gpio interrups, adxl mapping and enabling
happens already in tigger_set).
I checked other drivers and this seems to be the common pattern.
2. Implement proper INT_ENABLE disable/enable sequence in
adxl345_submit_stream() when reconfiguring watermark interrupts:
- Disable watermark interrupt in INT_ENABLE
- Configure interrupt mapping in INT_MAP
- Flush FIFO
- Re-enable watermark interrupt in INT_ENABLE
3. Add datasheet-based comments in adxl345_trigger.c explaining
non-obvious register operations:
- AC/DC coupling modes (ACT_INACT_CTL register)
- INT_MAP routing logic (0=INT1, 1=INT2)
- Interrupt clearing by reading data registers
4. Fix bug in adxl345_trigger_set() where ADXL345_INT_MAP_DATA_RDY_MSK
was hardcoded instead of using the correct int_mask variable.
Fixes#100891
Tested on ebyte_e73_tbb with samples `accel_polling` and `accel_trig`
Signed-off-by: Tobias Kässer <t.kaesser@gmail.com>
Added support for the low side power switch pin used for switching
DUTs attached to the ADC. The switch is configured though the
drivers device tree.
Signed-off-by: Noah Stephens <nstephens78@gmail.com>
Rename it to USB buffers so we can use it in host support without
confusion. Keep the UDC_* macros for now, we can deprecate and remove
them later.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Use platform_allow to explicitly list supported boards instead of
a config filter. This restricts the test to specific devkit boards
and avoids running on appcpu targets.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
as mdio and phy init prio is now on the same value
and the therefore the prority from the dt is used,
we can remove these default overwrites.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
set the init prio of ethernet, mdio and the ethernet phy
to the same value, that way the prio from the dt is used.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The message queue 'buffer_end' field points to the next address AFTER
the end of the buffer. When the buffer goes to the last addressable
byte, the next byte is 0x0. To ensure proper evaluation of the bounds
the __ASSERT_NO_MSG() checks must not use "< buffer_end", but
"<= buffer_end - 1".
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
The implementation only used the receive state's PA sync state
to determine whether to call the PA sync req or PA sync term req,
but that state does not include the syncing state.
Rather than using the receive state's PA sync state, we add a local
boolean to keep track of whether the PA sync was requested, so if
we receive a mod_src with PA sync == BT_BAP_BASS_PA_REQ_NO_SYNC then
we request a termination, even if the PA sync was not established yet.
Some cleanup in the mutex handling was also done as part of this.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Make sure to check packet length check before starting the
IPv4 fragmentation reassembly process. This way we can drop the
malformed packet without consuming resources.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This increases out-of-the-box compatibility with various shields
and drivers and also makes the configuration consistent with
other Arduino boards.
Signed-off-by: Tamas Jozsi <tamas.jozsi@silabs.com>
This increases out-of-the-box compatibility with various shields
and drivers and also makes the configuration consistent with
other Arduino boards.
Signed-off-by: Tamas Jozsi <tamas.jozsi@silabs.com>
Refactor MAX32 UART driver to use pm_device_driver_init so that the
device is moved to the appropriate power state expected by the system
during initialization.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Add PM policy constraints so that UART driver can prevent the system
going to sleep before all characters are sent or received.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Add support for fetching blobs from Git LFS HTTP(s) servers using
the LFS API to discover the blob URL.
This fetcher relies on the `sha256` and `size` fields in the blob
metadata to perform an API request to the LFS API in `url` to
get the download URL for the blob.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Decouple fetcher selection from the URL by adding a new field
`fetcher` to the blob metadata. If not set, fall back to parsing
the schema from the URL.
Add an optional field `size` to declare the size of the blob in
bytes.
Update documentation to cover the new additions. Fix a typo
`uri`->`url` and document the `click-through` field together
with the new fields.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Pass the entire blob context to the fetcher instead of only
the URL to allow for fetchers that require more context than
a single URL.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
The cva6.dtsi contains bad reg values for eth and gpio peripherals.
The form reg=<0x0 base 0x0 size> has been replaced with expected
reg=<base size>.
Signed-off-by: Egon Carusi <egon.carusi@swhard.it>
Delete entries in NVS are represented by an ATE with len == 0 and
no associated data.
However, when GC is triggered by a delete operation, the
propagated ATE length may become non-zero due to unconditional CRC
addition, leading to inconsistent semantics and potential mount or
space calculation issues.
Introduce nvs_data_len_with_crc() to centralize the logic of
conditionally adding the data CRC size. This ensures that delete
entries always retain len == 0 and restores consistency across write,
GC and space calculation paths.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Boards should not define own CDC ACM UART.
See Board Porting Guide, General recommendations.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Boards should not define own CDC ACM UART.
See Board Porting Guide, General recommendations.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Suppoted feature 'usb' is not required or used in any of the USB
samples or tests. The only valid feature for USB is `usbd`, or
`usb_device` for the legacy samples and tests.
See also commit 4df50a057f
("boards: remove supported feature 'usb'")
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This separates the mem_domain and kobject test suites to use
different thread variables. Reusing the child_thread from
mem_domain tests in kobject tests is not really desirable
as the child_thread is under test_domain and not the default
memory domain.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is simply calling another setup function. So remove it
and call that setup function directly. There is no need for
this redirection.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This supports de-initialization of memory domains to release
allocated page tables back to the pool.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the ability to de-initialization a memory domain.
This requires support in the architecture layer. One usage of
this is to release the resources associated with the domain.
For example, we can release allocated page tables so they can
go back to the pool of page tables to be allocated later.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
When a L2 table is no longer being used, we should set all PTEs
in the table to be illegal PTEs. This is simply a precautious
so that any stray references to the L2 table would not result
in incorrect permissions being applied.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
`gpio_xec_pin_interrupt_config` returned early when the computed IDET
configuration matched the current CR1 IDET field. On some reset paths
the GPIO control register can retain the same IDET value while the
interrupt aggregator state is reset/reconfigured. In that case, the
early return prevents re-enabling the aggregator and interrupts remain
disabled.
Remove the IDET equality early-return so the driver always updates the
level/edge bookkeeping and programs the interrupt aggregator enable
state.
Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
In commit 7a671993eacf7542a450d62439c012503b7cda2e a change was introduced
that placed variables in llextspecific sections. In the linker script
these are guarded by `#ifdef CONFIG_LLEXT`, but not the corresponding
C code, so these variables are being put in sections that are not
specified in linker scripts. This causes issues with IAR linker,
which warns about these orphan sections.
Signed-off-by: Gustav Holmberg <gustav.holmberg@iar.com>