Using `sched_switch()` in `mutex_unlock()` can result in crashes when
`mutex_unlock()` is called from IRQ context. This however is a common
pattern in RIOT to wake up a thread from IRQ. The reason for the crash
is that `sched_switch()` assumes `thread_get_active()` to always return
a non-`NULL` value. But when thread-less idle is used, no thread may be
active after the last runnable thread exited. Using
`thread_yield_higher()` instead solves the issue, as
`thread_yield_higher()` is safe to call from IRQ context without an
active thread.
This fixes https://github.com/RIOT-OS/RIOT/issues/20812
This implements the `shield_llcc68` module that allows using the LLCC68
LoRa shield on Arduino UNO compatible boards (with Arduino IO mappings
provided by the board) by just selecting the module.
The Arduino Zero based boards already provided the feature
`arduino_spi`, but were missing the corresponding mapping. This fixes
the issue by adding the SPI bus numbers for the ISP SPI bus and the
D11D12D13 SPI bus.
(And in order to actually add the D11D12D13 SPI bus, the `periph_conf.h`
was extended to provide an SPI configuration for it.)
We cannot just decrement the reference counter of power modes without
any coordination. First, this will trigger an `assert()`ion on non
STM32 MCUs that have power modes that are not used (the ref count would
be decremented below zero). Second, there hopefully is a reason a
certain power mode is blocked, e.g. because a periph driver needs a
certain clock to function.
Likely the `periph_uart` driver on STM32 boards keeps power modes
blocked after TX is completed even when no RX callback is present, which
is the waste of power this hack tries to address. But that should be
addressed there.
This re-adds `RIOT_MCU` as alias for `RIOT_CPU` and marks it as
deprecated. That should make life easier for downstream apps that may
still use `RIOT_CPU`.
Adding this macro in the definition of a macro causes a warning about
the deprecation to be emitted when used (and a build failure with
`WERROR=1`). This is useful as no other means to deprecate preprocessor
macros are provided.
The macro will be defined empty for compilers that are not GCC or
clang.
This adds a `riotbuild-prefix.h` that is added to the `riotbuild.h`
and processed by Doxygen. It solves two problems:
1. The pre-defined macros where previously fully undocumented, but
may be useful to real world applications
2. It provides a place where backward compatibility aliases can be
added with a deprecation notice
The Makefile rule to regenerate model.h has been left in place, but
just adding the header to the test allows to build the application
without heaving emlearn installed, which is convenient for the CI.
Actual users of emlearn will like still want to generate the header.
We don't enable this on any other architecture.
-pedantic doesn't give us any more beneficial wanrings, only warns
about language extensions that are implemented by both GCC and Clang
anyway.
Since those are the only compilers we are targeting, we can just make
use of them to make our lives easier.
This explicitly spells out what informally has been the coding
convention for some time on preprocessor directives, making it
more transparent and easier to find.
This is particularly useful as the code base has at least three
different styles. Deducing what actually is the current policy
would require a details look at how the style has changed over
time, rather than being obvious from a quick `grep` over the
code base.