Kconfig.dep depends on FORCE, so it is always generated when compiling
with Kconfig under normal conditions. Whan TEST_KCONFIG=1 is set, this
file is no longer a dependency for out.config. So when cleaning the
'bin' directory, out.config has no direct dependencies that force its
rebuilding (the generated directory is order only). This causes the file
not to be produced when calling `TEST_KCONFIG=1 make clean all`.
This PR changes the dependency on the 'generated' directory to a direct
dependency when `CLEAN` is set and leaves it as order-only when not.
This allows to generate out.config only when needed by not depending on
FORCE.
container_of() is safe to use in regard to alignment requirements, when used
correctly. Using `uintptr_t` instead of `char *` for applying the offset results
in -Wcast-align not complaining.
Change driver guide to expect drivers to return negative errno codes instead of
enums for error codes. Those have the following advantages:
- More efficient implementation of POSIX compatibility wrappers:
- In case of error, just an `errno = -retval; return -1` is needed
- Better interoperability
- A lot of code within RIOT and in external code is doing so already.
Applying this consistently allows passing error codes through, rather
than translating between errno codes and custom enum values
- Not reinventing the wheel
- Defining and documenting custom error codes for each driver is unneeded
effort
- The error classes that device driver have to report are largely the same.
There is no reason to have dozens of error codes for an input/output
error, each with a unique spelling a programmer needs to memorize
Previously, the function would always return the max_len parameter.
This poses two issues:
1. the API requires to return the actual packet size
2. the API requires that if the packet is larger than max_len, the
packet is flushed and -ENOBUFS is returned
3. this basically bypasses the packet flushing, consequtive _recv()
would return the last packet again
This commit fixes those issues.
On samd5x only the RTC can wake the CPU from Deep Sleep (pm modes 0 & 1).
The external interrupt controller is disabled, but we can use the tamper
detection of the RTC.
If an gpio interrupt is configured on one of the five tamper detect pins,
those can be used to wake the CPU from Deep Sleep / Hibernate.
The driver does not depend on or use the xtimer module, it should therefore
not include `xtimer.h`. Same for the test, which additionally missed an
include of `mutex.h` (previously implicitly included through `xtimer.h`).
As clock.c uses C conditionals for its code, the configuration macros
should always be defined. This is done by moving the dependencies to a
condition in the prompt, making them configurable only when applicable.
As clock.c uses C conditionals for its code, the configuration macros
should always be defined. This is done by moving the dependencies to a
condition in the prompt, making them configurable only when applicable.