The waspmote-pro cannot run at 250 kHz, as no available divider can divide
its core frequency down to that. Instead, the board can be tested at its
core clock frequency.
- Set XTIMER_HZ to something that is actually possible to generate with one
of the available clock dividers from the core frequency
- Use xtimer_on_ztimer if xtimer is used and not ztimer_xtimer_compat is used
- This is needed because xtimer is simply not compatible with any of the
possible clock frequencies of this board
This modifies the cortex-m thread specifics to allow running the PendSV
interrupt continuously at lower priority and removes the priority
modifications during the interrupt itself. Interrupts are disabled
during the scheduling itself, but enabled briefly after the sleep to
ensure that they are handled if activated during the scheduling or the
sleep.
Most timers are implemented this way already, and keeping (documenting)
it that way allows the generic timer_set implementation to stay as
simple as it is.
This replaces the printf statement in the timer callback with fmt-based
printing and a single puts. This is less heavy on the stack usage than
printf, making this test a bit easier to digest on the smaller
platforms.
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
xtimer.h must not be included, when the xtimer module is not use. Otherwise
compilation on the waspmote-pro with https://github.com/RIOT-OS/RIOT/pull/14799
will not longer work. gnrc_netif_pktq includes xtimer.h and uses xtimer, but
gnrc_netif includes gnrc_netif_pktq.h regardless of whether gnrc_netif_pktq
is used. This makes sure that gnrc_netif_pktq.h is only included when actually
used.
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.