Commit graph

8 commits

Author SHA1 Message Date
Marc Herbert 2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Paul Sokolovsky 215253910e samples: posix: gettimeofday: Make networking requirements explicit
Standard "Requirements" section copied from other networking samples,
making clear the network connection requirements and linking to
instructions for QEMU networking.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-29 23:15:12 +03:00
Paul Sokolovsky 76861d008b samples: posix: gettimeofday: Add sample.yaml
To make sure this sample is built in CI.

Also includes fixing prototype of main() to make it build without
warnings (which would be errors in CI).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-29 23:15:12 +03:00
Paul Sokolovsky 4221642b28 samples: gettimeofday: Increase stack size by 64 bytes.
Otherwise the sample started to fail on qemu_x86.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-29 23:15:12 +03:00
Paul Sokolovsky 0be812717d samples: posix: eventfd: Sample application for eventfd() call.
Roughly based on eventfd example code from Linux manpages. Similarly
to other POSIX-compatible sample, Makefile.posix is provided to build
the code on a POSIX system (in this case, as eventfd() is
Linux-specific, this has to be a Linux system).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-28 09:57:41 +03:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Alberto Escolar Piedras 0b8678a2b0 samples & tests: Correct main() type
The application main() in Zephyr is defined as having a prototype:
void main(void), as expected by the kernel init (bg_thread_main).

So, correct the different samples and tests that were defined
otherwise.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-12-16 11:27:56 +01:00
Paul Sokolovsky 4e116873f5 samples: posix: gettimeofday: Demo gettimeofday() returning correct time
Achieved using CONFIG_NET_CONFIG_CLOCK_SNTP_INIT option, i.e. querying
time over network using SNTP.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-10-28 13:04:35 +02:00