diff options
Diffstat (limited to 'src/RepRap.h')
-rw-r--r-- | src/RepRap.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/RepRap.h b/src/RepRap.h index 2c3ceeeb..c84d1416 100644 --- a/src/RepRap.h +++ b/src/RepRap.h @@ -87,7 +87,7 @@ public: #endif void Tick(); - uint16_t GetTicksInSpinState() const; + bool SpinTimeoutImminent() const; bool IsStopped() const; uint16_t GetExtrudersInUse() const; @@ -104,7 +104,10 @@ public: void SetAlert(const char *msg, const char *title, int mode, float timeout, AxesBitmap controls); void ClearAlert(); - bool WriteToolSettings(FileStore *f) const; // Save some resume information + bool WriteToolSettings(FileStore *f) const; // save some information for the resume file + bool WriteToolParameters(FileStore *f) const; // save some information in config-override.g + + void ReportInternalError(const char *file, const char *func, int line) const; // Report an internal error static uint32_t DoDivide(uint32_t a, uint32_t b); // helper function for diagnostic tests static uint32_t ReadDword(const char* p); // helper function for diagnostic tests @@ -114,6 +117,9 @@ private: char GetStatusCharacter() const; + static constexpr uint32_t MaxTicksInSpinState = 20000; // timeout before we reset the processor + static constexpr uint32_t HighTicksInSpinState = 16000; // how long before we warn that timeout is approaching + Platform* platform; Network* network; Move* move; @@ -178,7 +184,8 @@ inline Tool* RepRap::GetCurrentTool() const { return currentTool; } inline uint16_t RepRap::GetExtrudersInUse() const { return activeExtruders; } inline uint16_t RepRap::GetToolHeatersInUse() const { return activeToolHeaters; } inline bool RepRap::IsStopped() const { return stopped; } -inline uint16_t RepRap::GetTicksInSpinState() const { return ticksInSpinState; } + +#define INTERNAL_ERROR do { reprap.ReportInternalError((__FILE__), (__func__), (__LINE__)); } while(0) #endif |