The implementation of the <misc/math_extras.h> functions will use the
portable C code when PORTABLE_MISC_MATH_EXTRAS is defined before
including the header.
Use this feature macro to make sure that the unit test always tests the
portable functions in addition to the ones using builtins for the
current compiler.
Signed-off-by: Jakob Olesen <jolesen@fb.com>
When available, use the GCC / Clang builtins to implement the
math_extras functions. Otherwise, use the portable versions.
Signed-off-by: Jakob Olesen <jolesen@fb.com>
Compilers based on Clang provide a __has_builtin(x) macro which can be
used to detect in the preprocessor if a given builtin function is
supported by the compiler.
For other compilers (notably GCC), we provide an alternative definition
of HAS_BUILTIN(x) that depends on the toolchain-specific header file to
declare which builtin functions are supported based on the current
compiler version.
Signed-off-by: Jakob Olesen <jolesen@fb.com>
Add a <misc/math_extras.h> header file with portable implementations of
a number of commonly used math and bit counting operations that are not
available in the C programming language.
The math_extras functions fall into two groups:
1. Unsigned integer arithmetic with overflow detection. Addition and
multiplication are provides for the u32_t, u64_t, and size_t types.
This commit doesn't include subtraction and division, and there are
no signed operations. These could be added later if there is a need.
2. Bit-counting operations like clz, ctz, and ffs. These are provided
for u32_t and u64_t only. I don't see a need for size_t operations,
but they could be added if needed.
A follow-on commit will add more efficient implementations using
compiler builtins for those compilers that support it.
Another commit will replace other uses of "naked" compiler builtins with
calls to these functions.
Signed-off-by: Jakob Olesen <jolesen@fb.com>
Hygiene: We don't query MPtables (anymore?), so the related definitions
in the local APIC driver are unused. Removed.
Signed-off-by: Charles Youse <charles.youse@intel.com>
Add support for the NXP TWR-KE18F development board. This board
feautures an NXP MKE18F16 MCU, a selection of user LEDs and
push-buttons, potentiometer, thermistor, CAN interface, and FlexIO
header.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Add support for CLKOUT source selection and divider as found on the
NXP Kinetis KE1xF SoC series.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Add support for NXP MCUX LPUART devices with separate IRQ lines for
transmit and receive status interrupts (e.g. the Kinetis KE1xF SoC
series).
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Add a new clock control driver for NXP Kinetis SoCs that have the
Peripheral Clock Controller module (PCC).
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This is placeholder for extended warning flags, likely to change between
toolchains.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
This is placeholder for base warning flags, common to most toolchains.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
The introduced macros are placeholders for the cmake parameter warning
level.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
Without first triggering TASKS_STOP{RX,TX}, I observed that the UARTE
was never disabled when using device_set_power_state which resulted in
the HFCLK never being shut down and several hundred microamps in
unnecessary current consumption when idle. This seems to fix the issue.
Also added special treatment of uarte if CONFIG_UART_ASYNC_API is
selected. Note that the #ifdef isn't enough, since it's possible that
the option is set, but only one of the UARTs uses it.
Signed-off-by: Benjamin Lindqvist <benjamin.lindqvist@endian.se>
This is a pure refactoring of the k32src_wait function. It used the
following rules when refactoring:
Don't use the preprocessor when unprocessed C language suffices.
Don't undefine macro's.
Avoid global variables when possible.
Use consistent names for similiar things (hf_clock, lf_clock).
Signed-off-by: Alexander Svensen <alsv@nordicsemi.no>
Fix broken master role RSSI measurement. Since the original
contribution clean up into Zephyr, the radio shorts that was
set for measuring the RSSI for master role has been broken,
as it was cleared by the radio switching code further in the
Tx ISR.
Signed-off-by: Alexander Svensen <alsv@nordicsemi.no>
The mikroe_mini_m4_for_stm32 board is developed by Mikroelektronika
not by STMicroelectronics.
Also use more appropriate "mini-m4-for-stm32" board name for
compatible dt property.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
We replied to an ARP request that has the same Sender Hardware Address
than that of ours. Such an ARP request must be discarded, no reply
should be sent and translation table should not be updated.
Fixes#16110
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If a packet is received with Ethernet source address different
from ARP's sender hardware address field, then DUT must use the
latter address in response packets.
Fixes#16098
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The old footer was appended after PDU using pointer arithmetic. Now
the footer fields have been moved to the header struct, the
footer fields are now statically located in the data structure,
this is type safe and fields can be referred to by their actual
names rather than indirectly through reference to other members,
thus avoiding pointer arithmetic. Secondly, this change will pave
the way for adding other meta data in the future.
Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
Enable the counter capability in the board and add a .conf file for the
nRF52810 running on the PCA10040 board.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The 'Bluetooth' menu contains just 'config BT' and its indented
children.
Remove one menu level by removing the 'Bluetooth' menu and turning BT
into a 'menuconfig' symbol. Also change the prompt from "Bluetooth
support" to just "Bluetooth", to make it consistent with e.g. "Logging".
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This menu contains just the MCUMGR symbol and its children. Get rid of
one menu level by removing it.
Makes the 'External Sources' menu look like this:
HALs --->
Cryptography --->
[ ] Fnmatch Support
[ ] OpenAMP Support
(open-amp) OpenAMP library source path
[ ] mcumgr Support
('OpenAMP library source path' being visible there might be a separate
issue.)
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The supported field is used by sanitycheck to select which tests will be
run on a particular board. The issue with the counter drivers, and in
particular on nRF ICs, is that the timer peripherals are disabled by
default and need to be enabled on a per-board basis inside a .conf file.
Since this board doesn't have a .conf file in
tests/drivers/counter/counter_basic_api/boards/ the test cannot be run
on this board.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit adds support for board: nrf52811_PCA10056.
The nRF52840 DK: PCA10056 is the recommend development kit, it emulates
the nRF52811, and can be used as a starting point for development
before moving over to a custom board.
Please note that this development kit does not support Bluetooth
Direction Finding. What is more it cannot be used with most of Arduino
shields because of PCA10056 PIN layout.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit adds basic support for nrf52811 in the arch SoC, dts
and nrfx folders.
The nRF52811 is a Bluetooth 5.1 Direction Finding SoC with comprehensive
protocol support.
The nRF52811 SoC is capable of the latest features of Bluetooth 5.1,
the most prominent being Direction Finding.
The radio in the nRF52811 SoC has comprehensive protocol capabilities,
including Bluetooth 5.1 Directing Finding, all Bluetooth 5 features,
802.15.4, Thread, Zigbee, ANT and 2.4 GHz proprietary.
It has 4 dBm TX power and has been optimized to offer the best RX
sensitivity of all SoCs in the nRF52 series.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Increase ram size as flash simulator need it for
emulated storage. The qemu_x86 flash size is puted back to
its original value of 4092K
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Added basic tests for the NVS file system. One of the tests covers power
down during the flash write operation.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Added a new runtime parameter to the Flash Simulator. It can be used to
ignore any writes to the simulated flash memory after a certain number
of flash write calls has been executed. This behaviour is useful for
simulating power down during the flash write operation.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Aligned format specifiers for the NVS FS. Now, the format specifier
matches the variable type for qemu_x86 types.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Clear status bits before mapping them to the interrupt pin, so the
interrupt will occur on the next event instead of a pending event. Also
the status bits are cleared independently, because the threshold and
data ready functions can be enabled simultaneously.
Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
Enabling and disabling the GPIO callbacks is error prone and unnecessary
since the trigger data is protected with a mutex, so it has been
removed. This resolves the following issues:
- The GPIO callbacks are not being re-enabled properly in the error path
of the trigger setting function.
- The device pointer used in the GPIO callback to retrieve the ADXL362
driver configuration data is the GPIO device not the ADXL362 device,
so this cast is invalid and the int_gpio field is garbage.
- There are potential timing issues between enabling interrupts and
re-enabling the callbacks.
Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>