This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
reprapfirmware-dc42/Reprap.h
David Crocker aaf6f7128e Better USB error recovery and diagnostics
Firmware now recovers from USB disconnection without halting. Needs
changes to Arduino core library.
Added a timeout in the Spin() functions, which causes diagnostic info to
be stored and the system to be reset if a Spin() function takes more
than 20 seconds.
2014-04-16 00:00:45 +01:00

77 lines
1.9 KiB
C++

/****************************************************************************************************
RepRapFirmware - Reprap
RepRap is a simple class that acts as a container for an instance of all the others.
-----------------------------------------------------------------------------------------------------
Version 0.1
21 May 2013
Adrian Bowyer
RepRap Professional Ltd
http://reprappro.com
Licence: GPL
****************************************************************************************************/
#ifndef REPRAP_H
#define REPRAP_H
class RepRap
{
public:
RepRap();
void EmergencyStop();
void Init();
void Spin();
void Exit();
void Interrupt();
void Diagnostics();
bool Debug() const;
void SetDebug(int d);
Platform* GetPlatform() const;
Move* GetMove() const;
Heat* GetHeat() const;
GCodes* GetGCodes() const;
Network* GetNetwork() const;
Webserver* GetWebserver() const;
void Tick();
bool IsStopped() const;
uint16_t GetTicksInSpinState() const;
private:
Platform* platform;
Network* network;
Move* move;
Heat* heat;
GCodes* gCodes;
Webserver* webserver;
uint16_t ticksInSpinState;
uint8_t spinState;
bool debug;
bool stopped;
bool active;
bool resetting;
};
inline Platform* RepRap::GetPlatform() const { return platform; }
inline Move* RepRap::GetMove() const { return move; }
inline Heat* RepRap::GetHeat() const { return heat; }
inline GCodes* RepRap::GetGCodes() const { return gCodes; }
inline Network* RepRap::GetNetwork() const { return network; }
inline Webserver* RepRap::GetWebserver() const { return webserver; }
inline bool RepRap::Debug() const { return debug; }
inline void RepRap::Interrupt() { move->Interrupt(); }
inline bool RepRap::IsStopped() const { return stopped; }
inline uint16_t RepRap::GetTicksInSpinState() const { return ticksInSpinState; }
#endif