1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg
bors[bot] 1b352d69f7
Merge #17066
17066: sys/irq: Add C++ wrapper using RAII r=maribu a=jenswet

### Contribution description

This adds a C++ wrapper around the `irq.h` API. The wrapper uses RAII to accomplish a convenient and bug resistent use.
 
A little background: I'm currently writing my master thesis on using C++ for embedded development, at the working group that `@maribu` is part of. For that I will try to add better C++ support to several parts of RIOT and then do some benchmarking and metrics to compare it with the C implementation. For example, I also plan to add a wrapper around i2c, a std::cout drop-in replacement and probably some more about networks or threads.

### Testing procedure

I've added a unit test to verify that the IRQ wrapper calls the original `irq` functions as expected. As C++ and wrapper testing isn't done much so far in this project, I've added two additional headers to ease testing:
1.  #17076 - fake functions framework, already merged
2. As there is no framework for C++ unit tests yet, I've added something for this too. Unfortunately the existing frameworks like GoogleTest, CppUTest or CppUnit don't easily compile for embedded or are difficult to integrate in to the RIOT build process. That's why I wrote some (simple) helper functions and macros inspired by the above frameworks. That allows to create C++ tests based on a fixture class with set up and tear down methods. It also allows some simple assertions and is easily extendable for other use cases. It wraps some of the fff functionality too.

Both of this is obviously not required for the initial reason of this PR. But I'd like to provide unit tests for the features that I suggest to introduce where possible. So I'd appreciate some feedback on that too. If you'd prefer a PR without or different tests please let me know.

You can run the test `irq_cpp` locally or on the CI to test the implementation.

Please feel free to give feedback or suggest improvements!

Co-authored-by: Jens Wetterich <jens@wetterich-net.de>
2023-01-15 18:17:00 +00:00
..
arduino_adafruit_sensor pkg/arduino_adafruit_sensor: add Adafruit Unified Sensor Driver 2022-12-15 18:36:05 +01:00
arduino_api pkg: remove -std=c++11 2022-01-13 17:50:59 +01:00
arduino_sdi_12 pkg/arduino_sdi_12: bump version, fix patches 2022-10-25 10:26:43 +02:00
c25519 pkg/pkg.mk: silence info if QUIETER 2022-06-01 10:54:01 +02:00
cayenne-lpp pkg/*/Kconfig: Add simple kconfig pkgs 2021-04-08 16:34:36 +02:00
ccn-lite pkg/ccn-lite: Fix use after free bug 2022-11-11 22:16:47 +01:00
cifra pkg/cifra: fix build error with redefined assert 2021-12-23 11:04:42 +01:00
cmsis-dsp pkg/cmsis-dsp: cleanup Makefile 2022-04-26 09:26:02 +02:00
cmsis-nn pkg/cmsis-nn: rework deps + model in Kconfig 2022-04-25 13:00:27 +02:00
cn-cbor pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
corejson pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
cryptoauthlib makefiles/cflags.inc.mk: Add -Wno-missing-field-initializers to CXXFLAGS 2022-10-27 14:28:06 +02:00
driver_atwinc15x0 pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
driver_bme680 pkg/driver_bme680: add missing include 2022-09-29 13:12:33 +02:00
driver_sx126x sys/ztimer/kconfig: enable xtimer compat only with timer backend 2021-12-02 09:38:06 +01:00
edhoc-c pkg/edhoc-c: add QQ 2022-06-01 10:48:34 +02:00
elk pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
emlearn pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
esp32_sdk cpu/esp32: move ESP32_SDK_DIR definition here 2022-10-10 20:39:47 +02:00
esp32_sdk_lib_bt_esp32 pkg/esp32_sdk_lib_bt_esp32: add BLE library for ESP32 2022-08-24 09:03:38 +02:00
esp32_sdk_lib_bt_esp32c3 pkg/esp32_sdk_lib_bt_esp32c3: add BLE library for ESP32-C3 2022-08-24 18:02:21 +02:00
esp32_sdk_lib_phy pkg/esp32_sdk_lib_phy: bump version 2022-06-05 11:53:31 +02:00
esp32_sdk_lib_wifi pkg/esp32_sdk_lib_wifi: bump version 2022-06-05 11:53:31 +02:00
esp8266_sdk pkg/esp8266_sdk: fix version string generation 2023-01-10 20:22:40 +01:00
etl pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
fatfs vfs: drop unused abs_path parameter 2022-09-29 22:01:37 +02:00
fff core/irq: Add C++ wrapper 2023-01-13 13:58:07 +01:00
fido2_tests sys/fido2: remove unnecessary module import from Makefile.dep 2022-01-31 16:49:38 +01:00
flatbuffers pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
gecko_sdk pkg/gecko_sdk: add librail 2022-10-15 15:42:13 +02:00
gemmlowp pkg: add Kconfig support for flatbuffers/ruy/tflite-micro 2022-04-27 10:53:50 +02:00
hacl pkg/hacl: documentation link update 2022-04-25 16:05:28 +02:00
heatshrink pkg/*/Kconfig: Add simple kconfig pkgs 2021-04-08 16:34:36 +02:00
jerryscript Merge pull request #18562 from MrKevinWeiss/pr/removemips 2022-09-30 10:47:09 +02:00
jsmn pkg/*/Kconfig: Add simple kconfig pkgs 2021-04-08 16:34:36 +02:00
libb2 pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
libbase58 pkg: silent make commands with RIOT_CI_BUILD=1 2021-03-12 16:05:18 +01:00
libcose pkg/libcose: add RIOT as crypto backend 2022-05-17 10:51:34 +02:00
libfixmath pkg/libfixmath: add compile options to Kconfig 2021-11-22 12:25:57 +01:00
libhydrogen pkg/libhydrogen: silence gcc 11.2.0 false posive stringop-overflow 2022-09-27 09:36:23 +02:00
libsocketcan pkg/socketcan: add to resolve i386 support on Ubuntu 2022-04-20 11:49:33 +02:00
littlefs Merge pull request #18672 from benpicco/vfs-abs_path 2022-09-30 16:42:57 +02:00
littlefs2 pkg/littlefs2: bump version to 2.5.1 2022-11-10 16:17:24 -05:00
lora-serialization pkg/*/Kconfig: Add simple kconfig pkgs 2021-04-08 16:34:36 +02:00
lorabasics pkg/lorabasics: fix unused parameters warning 2022-08-18 01:05:31 +02:00
lua core/lib: Add macros/utils.h header 2023-01-07 09:47:44 +01:00
lv_drivers pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
lvgl pkg/lvgl: bump to 8.3.4 2022-12-16 09:32:47 +01:00
lwip pkg/lwip: Force loglevel when using log module 2022-11-23 23:04:14 +01:00
lz4 pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
mbedtls pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
micro-ecc pkg/*/Kconfig: Add simple kconfig pkgs 2021-04-08 16:34:36 +02:00
microcoap pkg/*/Kconfig: Add simple kconfig pkgs 2021-04-08 16:34:36 +02:00
micropython cpu/mips: Remove all mips 2022-09-27 13:42:37 +02:00
minmea pkg/minmea: bump version 2022-06-03 11:28:49 +02:00
monocypher pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
mynewt-core Merge pull request #18029 from haukepetersen/verbump_nimble_nrfx2022 2022-06-10 04:11:26 +02:00
nanocbor pkg/nanocbor: bump version 2022-08-31 16:29:03 +02:00
nanopb pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
nanors pkg/nanors: model in Kconfig 2022-05-03 16:09:20 +02:00
ndn-riot pkg/ndn-riot: add patch to fix CIPHER_AES_128 removal 2022-01-07 17:24:14 +01:00
nimble pkg/nimble: signal LINK_UP on initialisation 2022-11-25 20:52:45 +03:00
nrfx pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
openthread pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
openwsn doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
paho-mqtt Merge #18962 #18999 #19034 2022-12-11 12:03:28 +00:00
qcbor pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
qdsa pkg/qdsa: add -Wno-cast-align 2021-12-03 10:12:37 +01:00
qr-code-generator pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
relic pkg/relic: bump to current master (e3f82e36 from 08.11.21) 2021-11-08 23:18:30 +01:00
ruy pkg: add Kconfig support for flatbuffers/ruy/tflite-micro 2022-04-27 10:53:50 +02:00
semtech-loramac makefiles/cflags.inc.mk: Add -Wno-missing-field-initializers to CXXFLAGS 2022-10-27 14:28:06 +02:00
spiffs vfs: drop unused abs_path parameter 2022-09-29 22:01:37 +02:00
talking_leds pkg: remove -std=c++11 2022-01-13 17:50:59 +01:00
tensorflow-lite makefiles/cflags.inc.mk: Add -Wno-missing-field-initializers to CXXFLAGS 2022-10-27 14:28:06 +02:00
tflite-micro pkg/tflite-micro: fix compilation with GCC >= 12.x 2022-11-11 09:01:02 +01:00
tiny-asn1 pkg/tiny-asn1: Update tiny-asn1 package 2021-10-02 21:27:40 +02:00
tinycbor pkg/tinycbor: bump version 2022-02-02 14:44:50 +01:00
tinycrypt pkg/tinycryp: supress llvm warning 2021-09-07 09:35:00 +02:00
tinydtls pkg/tinydtls: implement sock_dtls_recv_buf_aux() 2023-01-13 00:08:55 +01:00
tinyusb Merge #18459 #18724 #19081 #19082 #19136 2023-01-13 13:50:55 +00:00
tinyvcdiff codespell: fix remaining issues 2022-09-16 14:00:35 +02:00
tlsf doc: fix unbalaced grouping 2022-09-14 15:05:25 +02:00
tweetnacl pkg/*/Kconfig: Add simple kconfig pkgs 2021-04-08 16:34:36 +02:00
u8g2 treewide: make all modules use Kconfig ZTIMER_USEC indirection 2022-03-17 14:33:07 +01:00
ubasic cpu/mips: Remove all mips 2022-09-27 13:42:37 +02:00
ucglib treewide: make all modules use Kconfig ZTIMER_USEC indirection 2022-03-17 14:33:07 +01:00
umorse pkg: silent make commands with RIOT_CI_BUILD=1 2021-03-12 16:05:18 +01:00
utensor pkg/utensor: fix uninitialized variable 2022-11-09 22:47:08 +01:00
uwb-core makefiles/cflags.inc.mk: Add -Wno-missing-field-initializers to CXXFLAGS 2022-10-27 14:28:06 +02:00
uwb-dw1000 pkg/uwb-dw1000: read ch5 pg_delay stored in OTP 2022-04-25 13:32:59 +02:00
uzlib pkg: Move versions to dedicated line 2022-09-26 17:45:54 +02:00
wakaama Merge pull request #18096 from Teufelchen1/feat/port_parsing 2022-09-19 13:40:53 +02:00
wamr pkg/wamr: Update to WAMR-1.1.1 2022-11-29 13:28:46 +01:00
wolfssl pkg/wolfssl: fix compilation with GCC >= 12.x 2022-11-10 16:20:17 +01:00
yxml pkg/yxml: add git mirror url 2021-10-01 14:44:10 +02:00
doc.txt buildsystem: document EXTERNAL_PKG_DIRS feature 2022-02-01 19:37:24 +00:00
Kconfig pkg/arduino_adafruit_sensor: add Adafruit Unified Sensor Driver 2022-12-15 18:36:05 +01:00
local.mk pkg/pkg.mk: better distinguish between source and build directory 2020-06-26 09:25:43 +02:00
Makefile.git pkg/Makefile.git: adapt example to new organization 2020-06-26 09:25:44 +02:00
Makefile.http pkg: add PKG_LICENSE to templates 2020-01-06 00:37:47 +01:00
pkg.mk pkg/pkg.mk: silence info if QUIETER 2022-06-01 10:54:01 +02:00