When the expected ROM overhead of a function is bigger than the actual function,
it is better to provide the function as static inline function in the header.
The value of `queue->waiter` at the time the event was queued (with IRQs
disabled) was backed up to the stack-variable `waiter`. Thus, the test later on
for `waiter` checks if the queue was already claimed at the time the event
was queued. Therefore, there is no race.
The `clz` instruction pretty much implements getting the most significant bit
in hardware, so use it instead of the software implementation.
This reults in both a reduction in code size as in a speedup:
master:
text data bss dec hex filename
14816 136 2424 17376 43e0 tests/bitarithm_timings/bin/same54-xpro/tests_bitarithm_timings.elf
+ bitarithm_msb: 3529411 iterations per second
this patch:
text data bss dec hex filename
14768 136 2424 17328 43b0 tests/bitarithm_timings/bin/same54-xpro/tests_bitarithm_timings.elf
+ bitarithm_msb: 9230761 iterations per second
Previously the setting the alarm would overwrite the overflow callback
and vice versa.
Since we can only set one alarm in hardware, always set the alarm to the
closest event of the two.
It doesn't compile, compiler complains that the enum type of
CC2420_GOTO_RX cannot be converted to netopt_state_t as required by the
function.
The numerical value of CC2420_GOTO_RX would be NETOPT_STATE_IDLE (2), which
makes sense as it puts the device into RX mode.
Added `event_wait_multi()` that takes an array of event queues rather than
a single event queues. The queue with the lowest index will have the highest
priority.
Move common code into helper functions and extract the commands
that differ between normal and RWWEE page reading / writing.
This cuts down on `#ifdef` use.
Using pointer difference already gives us the number of elements of
size of what the pointer is pointing to.
Dividing by size will lead to the wrong (always 0) result.
The `read` implementation on my system doesn't know a `-n` parameter:
tools/usb-cdc-ecm/start_network.sh: 100: read: Illegal option -n
As the command is only used to block if no terminal is started, we can
as well remove them.
Just like `tests/periph_rtt`, delay the RTC init so that if init gets stuck
it doesn't get stuck in early boot but inside the test.
This makes debugging easier.