Move driver specific to dedicated file when relevant (i.e.: more than
1-2 options), use if/endif also.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The result of left shifting a bit into the sign-bit is undefined
behavior. This makes the offending shift operation unsigned.
Signed-off-by: Kristian Klomsten Skordal <kristian.skordal@nordicsemi.no>
The test validates the behavior of calling k_thread_start()
of thread which is already started. The thread has to start
execution only when its state is _THREAD_PRESTART.
Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
Each USB sample, when compiled, will provide a different
USB product string. A "nice to have" feature when trying
out the USB samples (they will show up differently in
`lsusb` or `dmesg`), and also illustrates how to set up
custom USB constants in the config files.
Requires #6589.
Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
The SAM0 SoC was switched to use DTS for SPI configuration. Update
documentation for the SAM0 based boards to use the correct SPI
controller device names.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Added a test for having UTF-8 characters in Kconfig values. This
ensures that issue
https://github.com/zephyrproject-rtos/zephyr/issues/6649 does not
affect any supported platforms and that it does not re-appear in the
future.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
We are using the CMake command 'file(STRINGS' (which defaults to only
decoding ASCII) to read Kconfig configurations. When UTF-8 characters
are detected they are treated as newlines.
This behaviour has caused issues when users have input UTF-8
characters into Kconfig values. E.g. USB device descriptor strings.
This commit adds the flag 'ENCODING "UTF-8"' to the 'file(STRINGS'
command so that UTF-8 characters are correctly passed through the
build system.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Bootlin is kindly providing an instance of their Elixir source code
cross-referencer tool with an index of the Zephyr kernel and samples
code.
This fixes#1420
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Previous implementation was buggy, destroying
resources with pending thread and race conditions.
New version tests basic functionality with 2
threads and basic synchronization.
Signed-off-by: Juan Manuel Torres Palma <j.m.torrespalma@gmail.com>
Modifies several functions that are causing wrong
behaviour.
* semaphore.h: add missing restrict keyword.
* sem_destroy(): check that nobody is waiting
before destroying the object.
* sem_timedwait(): simpify function logic and
fix a bug when abstime > currtime, that passed
ticks instead of ms to k_sem_take().
* sem_wait(): avoid unnecessary checks.
* sem_init(): add pshared value assertion.
Signed-off-by: Juan Manuel Torres Palma <j.m.torrespalma@gmail.com>
Replace specific STM32F1 references with generic STM32 ones.
Use generic names like U(S)ARTx for instances which have different
naming across STM32 families.
Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
Add testcases for following scenario
Test to check alert_recv(timeout) against the following cases
1. The current task times out while waiting for the event.
2. There is already an event waiting (signalled from a task).
3. The current task must wait on the event until it is signalled
from either another task or an ISR
Test to check alert_recv(K_FOREVER) against the following cases:
1. There is already an event waiting (signalled from a task and ISR).
2. The current task must wait on the event until it is signalled
from either another task or an ISR
Test to checks that the event handler is set up properly when
alert_event_handler_set() is called. It shows that event handlers
are tied to the specified event and that the return value from the
handler affects whether the event wakes a task waiting upon that
event
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Remove unnecessary header inclusion in nordic's nrf5 random
driver which added a dependency to ext/hal/nordic.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Single backslashes outside of a code-block are treated as escape
characters, so need to double up to get a single backslash rendered in
the generated HTML.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
This was originally added as a work-around to avoid the heavy stack
consumption of the TinyCrypt PRNG when generating NRPAs. This is
no-longer an issue, and there are in fact no (in-tree) users of this.
Remove it before it gains any wider users, since it was in many ways a
hack/work-around to begin with.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In some cases the app may want to force using the identity address
regardless of privacy support or what type of advertising is done.
Provide such an option in bt_le_adv_param.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Make the service parameter optional in getaddrinfo().
The application should be able to use NULL as service when only
interested in the host lookup.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Add freeaddrinfo() to complement getaddrinfo().
Existing applications using getaddrinfo() will usually free
allocated memory using freeaddrinfo(). Even if nothing is allocated
the function should exist to avoid having to change the application
when porting.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Add support for MSG_DONTWAIT flag in send() and sendto(). This
aligns with the same flag used in recv() and recvfrom().
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
With upcoming ICs that are not in the nRF5x family, rename the flash
driver and all its dependencies from nrf5 to nrf.
Should also fix the issue introduced by f49150cab6 which broke the
assignment of the flash device due to a partial rename.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Avoid listing internal function in the public API documentation. After
enabling those doxygen configs, we go lots of errors and bad refs that
were fixed.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add k_fifo kernel object timeout scenario tests like basic
k_fifo API tests with timeouts and tests which involve other
threads to get/put items from/into k_fifo with timeouts.
This test is inspired from test_stack legacy test from
Zephyr v1.7.0 release.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Add k_fifo kernel object usage scenario tests between thread
to thread and thread to ISR.
This test is inspired from test_fifo legacy test from
Zephyr v1.7.0 release.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
The k_mem_partition structs need to be placed in the kernel memory.
This patch ensures that these structs are placed correctly.
Also when a struct k_mem_domain is declared it is advised to add
__kernel.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
There was not enough space for \0 at the end of the string.
Coverity-CID: 183057
Coverity-CID: 183050
Fixes#6675Fixes#6682
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Network packet cannot be NULL so no need to check its value.
Coverity-CID: 183063
Fixes#6669
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Decode Kconfig sources as UTF-8 instead of decoding them according to
the system locale (which might be ascii-only).
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Decode Kconfig sources as UTF-8 instead of decoding them according to
the system locale (which might be ascii-only).
This resolves an issue that can be reproduced like this:
$ export LANG=C
$ echo '# Sebastian Bøe' >> ~/zephyr/Kconfig
$ build_any_zephyr_app
See the Python comment for details.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
No need to verify that the configuration is proper if we are
compiling the driver for unit test and not going to ever run
the test.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As the board has ethernet chip it makes sense to enable the
ethernet support by default.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If CONFIG_NET_DEBUG_NET_PKT was enabled, then a call to
net_pkt_get_reserve_data() was calling wrong debug function
which caused compile error.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add support for MSG_PEEK flag in recv and recvfrom.
This flag is needed when using non-zephyr embedded applications with
Zephyr's socket API.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Memory leak occurs if neighbor table is full and echo request from an
unknown neighbor is received. Hence, on an attempt to send NS unref of
pending is not done, causing the memory leak.
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>