Commit Graph

14 Commits

Author SHA1 Message Date
Krzysztof Chruściński 5bd6050241 testsuite: busy_sim: Add alarm cancelation to stop function
Without cancelation next start may return error.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-08-07 19:04:04 -04:00
Krzysztof Chruściński 42f003cebd testsuite: busy_sim: Allow running with timer random generator
Allow to run with timer random generator which does not need any
entropy device.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-08-07 19:04:04 -04:00
Flavio Ceolin e7bd10ae71 random: Rename random header
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.

Rename it to random.h and get consistently with other
subsystems.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-10 14:23:50 +03:00
Gerard Marull-Paretas d4ffef507c testsuite: busy_sim: use POST_KERNEL
Devices should be initialized in pre/post-Kernel.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-15 16:04:19 +02:00
Nick Ward 2d65acca3a drivers: gpio: use gpio_is_ready_dt helper function
Update `struct gpio_dt_spec` use with gpio_is_ready_dt()

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-08-28 08:48:35 -05:00
Daniel Leung 7c91228896 ztest: rename shadow variables
This renames the shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Gerard Marull-Paretas e0125d04af devices: constify statically initialized device pointers
It is frequent to find variable definitions like this:

```c
static const struct device *dev = DEVICE_DT_GET(...)
```

That is, module level variables that are statically initialized with a
device reference. Such value is, in most cases, never changed meaning
the variable can also be declared as const (immutable). This patch
constifies all such cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Fabio Baltieri def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Gerard Marull-Paretas 5113c1418d subsystems: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all subsystems code to
the new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:07:35 +02:00
Nicolas Pitre eee5b8e563 ring_buffer: make finish methods final
Make it possible to "finish" with fewer bytes than what was "claimed".

This was possible before on the get side, but the put side was
cummulative wrt finish. The revamp made it cummulative on both sides.
Turns out that existing users rely on the opposite behavior which is
more logical and useful. So make both sides that way.

Adjust documentation, test case and users accordingly.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-02-28 10:52:41 +01:00
Gerard Marull-Paretas 103135c150 testsuite: busy_sim: drop get_dev_data/get_dev_config usage
Replace all get_dev_data()/get_dev_config() accessor utilities with
dev->data and dev->config.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-19 18:16:02 +01:00
Krzysztof Chruscinski 0a7667bf7f testsuite: busy_sim: Use xoshiro128++ when enabled
Taking random numbers from hardware may be time consuming thus
it was deferred to a work queue. On the other hand, taking them
from software algorithm is fast. Use xoshiro128++ when enabled,
instead of real random numbers from hardware RNG generator. They
are use for random intervals in the test so no security concerns
here.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-12-01 10:00:50 +01:00
Krzysztof Chruscinski f2e75a7140 testsuite: busy_sim: Add callback to the interrupt
Add optional callback which is called from the busy
interrupt context.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-12-01 10:00:50 +01:00
Krzysztof Chruscinski ffc4a6c928 testsuite: Add busy simulator module
Busy simulator is using counter device and entropy device to
generate random cpu load. Counter device cofiguration can be
used to set cpu load interrupt priority and optional pin that
can be set during the load.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-29 10:59:00 -04:00