Commit Graph

13 Commits

Author SHA1 Message Date
Alberto Escolar Piedras 388f82f6b3 samples/basic: Switch from native_posix to native_sim
In the docs replace the references to native_posix with native_sim.
And switch the default test platform to native_sim from native_posix.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-14 13:06:01 +01: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
Benjamin Cabé 59e4c5aed0 samples: fully migrate basic samples to the new Sphinx extension
- Updated basic samples READMEs to use the new zephyr:code-sample::
  directive. Dropped "-sample" suffix that's not required anymore now
  that samples have their own namespace.
- Updated all references to the samples to use the :zephyr:code-sample:
  role. Checked and updated the wording of said references to account
  for the fact that samples should not have "... sample" in their name
  anymore.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-13 09:15:34 +02:00
Benjamin Cabé 5832f6ed5f doc: Use new Sphinx extension for code samples
Use the new code-sample directive and roles in a few places
to demonstrate how it works.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-06 12:11:28 +02:00
Florian La Roche 88a3620ff9 samples/basic: print_sys_memory_stats() removed from hash_map, static
Remove print_sys_memory_stats() from hash_map example as it is not used
there at all. For sys_heap make this a static function.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
2023-08-22 19:12:59 -04:00
Gerard Marull-Paretas 7ef8911e8c samples: basic: hash_map: fix libc heap size setting
The malloc arena/heap size setting can be adjusted using different
Kconfig options, depending on the libc implementation. This means
prj.conf can't be used to set this value on projects that can be built
for multiple libcs without generating a Kconfig warning.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-07-26 14:53:51 +02:00
Marek Matej 3776402f40 boards: xtensa: esp32 board split
Remove virtual esp32 board and replace it with the
real word boards:

- esp32_devkitc_wroom
- esp32_devkitc_wrover (with PSRAM option)

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-07-25 18:12:33 +02:00
Keith Packard bfa6a44746 tests,samples: Fix picolibc malloc arena settings
With picolibc moving to using the common malloc implementation, samples and
tests with picolibc-specific settings need to switch to using the common
malloc settings instead.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-05-09 01:29:16 +09:00
Keith Packard 4134858868 tests/samples: Replace minimal libc malloc configs with common ones
With the minimal C library malloc implementation moving to libc/common, all
of the related Kconfig variables have also changed. Update uses within the
tree.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-27 20:17:24 +09:00
Keith Packard 0b90fd5adf samples, tests, boards: Switch main return type from void to int
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.

Most of these changes were automated using coccinelle with the following
script:

@@
@@
- void
+ int
main(...) {
	...
-	return;
+	return 0;
	...
}

Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Kumar Gala 0e93ffc8e3 samples: hash_map: Add newlib filter to samples.yaml
Not all toolchains support newlib so tests that require newlib need
to have a filter to we don't try and build those tests on those
testcases.  Add the following to samples.yaml to handle the issue:

	filter: TOOLCHAIN_HAS_NEWLIB == 1

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-03-16 09:15:23 +01:00
Francois Ramu 5c83a4f13d samples: basic: hash_map increasing the stack size for cxx_unordered_map
When running the testcase libraries.hash_map.newlib.cxx_unordered_map.djb2
of this samples/basic/hash_map, it appears that some platforms
have a too low stack size.
This PR is increasing that value to pass the testcase.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-03-02 07:05:09 -05:00
Chris Friedt 480b74917d samples: lib: os: hash_map: add Hashmap sample code
This sample shows how to use `sys_hashmap`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-02-22 19:14:05 +01:00