diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-12-17 20:22:29 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-12-17 20:22:29 +0300 |
commit | a654d83c7aaf160636760918a3e14e344c5656ba (patch) | |
tree | fcbba51655e6c417b5393494c1b5a99d7a2f04eb /src/RepRapFirmware.h | |
parent | d9c0758ab8d8bad091b3a7d501052e5ef8580bac (diff) |
Added assertion mechanism and a extra cache flush call
Diffstat (limited to 'src/RepRapFirmware.h')
-rw-r--r-- | src/RepRapFirmware.h | 4 |
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 { |