Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2020-12-17 20:22:29 +0300
committerDavid Crocker <dcrocker@eschertech.com>2020-12-17 20:22:29 +0300
commita654d83c7aaf160636760918a3e14e344c5656ba (patch)
treefcbba51655e6c417b5393494c1b5a99d7a2f04eb /src/RepRapFirmware.h
parentd9c0758ab8d8bad091b3a7d501052e5ef8580bac (diff)
Added assertion mechanism and a extra cache flush call
Diffstat (limited to 'src/RepRapFirmware.h')
-rw-r--r--src/RepRapFirmware.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/RepRapFirmware.h b/src/RepRapFirmware.h
index c325fc8d..dfaaae3d 100644
--- a/src/RepRapFirmware.h
+++ b/src/RepRapFirmware.h
@@ -134,6 +134,10 @@ static_assert(NumNamedPins <= 255 || sizeof(LogicalPin) > 1, "Need 16-bit logica
#define THROWS(...) // expands to nothing, for providing exception specifications
#define THROW_INTERNAL_ERROR throw GCodeException(-1, -1, "internal error at file " __FILE__ "(%d)", (int32_t)__LINE__)
+// Assertion mechanism
+extern "C" [[noreturn]] void vAssertCalled(uint32_t line, const char *file) noexcept __attribute((naked));
+#define RRF_ASSERT(_expr) do { if (!(_expr)) { vAssertCalled(__LINE__, __FILE__); } } while (false)
+
// Struct to hold min, max and current values
struct MinMaxCurrent
{