diff --git a/binary-versions.json b/binary-versions.json index 66e803966..3ea61ac0f 100644 --- a/binary-versions.json +++ b/binary-versions.json @@ -4,7 +4,7 @@ "repository": "Autonomy-Logic/xml2st" }, "strucpp": { - "version": "v0.5.7", + "version": "v0.5.8", "repository": "Autonomy-Logic/STruCpp" } } diff --git a/resources/sources/arduino/arduino_runtime_glue.cpp b/resources/sources/arduino/arduino_runtime_glue.cpp index c7ea73e6b..6e99fd368 100644 --- a/resources/sources/arduino/arduino_runtime_glue.cpp +++ b/resources/sources/arduino/arduino_runtime_glue.cpp @@ -19,6 +19,21 @@ #include "generated.hpp" #include "debug_dispatch.hpp" +// --------------------------------------------------------------------------- +// Runtime fault hook +// --------------------------------------------------------------------------- +// Weak default for strucpp::iec_runtime_fault (declared in iec_fault.hpp). +// On MCU firmware (compiled -fno-exceptions) the runtime calls this instead +// of throwing on an unrecoverable fault (null deref, array OOB, bad located +// address). Default behaviour: halt. A VPP HAL may provide a STRONG override +// to signal the fault its own way — blink a status LED, sound an alarm, +// reboot, etc. Kept free of so this TU stays macro-clean. +__attribute__((weak)) void strucpp::iec_runtime_fault(strucpp::IecFault /*reason*/, + const char* /*context*/) noexcept { + for (;;) { + } +} + // --------------------------------------------------------------------------- // Storage // ---------------------------------------------------------------------------