Added Exit() functions to all classes.
This commit is contained in:
parent
b433566c8d
commit
31399c9efa
12 changed files with 46 additions and 0 deletions
1
GCodes.h
1
GCodes.h
|
@ -29,6 +29,7 @@ class GCodes
|
||||||
GCodes(Platform* p, Move* m, Heat* h, Webserver* w);
|
GCodes(Platform* p, Move* m, Heat* h, Webserver* w);
|
||||||
void Spin();
|
void Spin();
|
||||||
void Init();
|
void Init();
|
||||||
|
void Exit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -30,12 +30,19 @@ GCodes::GCodes(Platform* p, Move* m, Heat* h, Webserver* w)
|
||||||
webserver = w;
|
webserver = w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GCodes::Exit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void GCodes::Init()
|
void GCodes::Init()
|
||||||
{
|
{
|
||||||
lastTime = platform->Time();
|
lastTime = platform->Time();
|
||||||
gcodePointer = 0;
|
gcodePointer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GCodes::ActOnGcode()
|
void GCodes::ActOnGcode()
|
||||||
{
|
{
|
||||||
platform->Message(HOST_MESSAGE, "\nGCode: ");
|
platform->Message(HOST_MESSAGE, "\nGCode: ");
|
||||||
|
|
1
Heat.h
1
Heat.h
|
@ -39,6 +39,7 @@ class Heat
|
||||||
Heat(Platform* p);
|
Heat(Platform* p);
|
||||||
void Spin();
|
void Spin();
|
||||||
void Init();
|
void Init();
|
||||||
|
void Exit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
5
Heat.ino
5
Heat.ino
|
@ -33,6 +33,11 @@ void Heat::Init()
|
||||||
//inc = 0.01;
|
//inc = 0.01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Heat::Exit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Heat::Spin()
|
void Heat::Spin()
|
||||||
{
|
{
|
||||||
unsigned long t = platform->Time();
|
unsigned long t = platform->Time();
|
||||||
|
|
1
Move.h
1
Move.h
|
@ -28,6 +28,7 @@ class Move
|
||||||
Move(Platform* p);
|
Move(Platform* p);
|
||||||
void Init();
|
void Init();
|
||||||
void Spin();
|
void Spin();
|
||||||
|
void Exit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
5
Move.ino
5
Move.ino
|
@ -35,6 +35,11 @@ void Move::Init()
|
||||||
platform->SetDirection(3, FORWARDS);
|
platform->SetDirection(3, FORWARDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Move::Exit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Move::Spin()
|
void Move::Spin()
|
||||||
{
|
{
|
||||||
unsigned long t = platform->Time();
|
unsigned long t = platform->Time();
|
||||||
|
|
|
@ -174,6 +174,8 @@ class Platform
|
||||||
// loop of death...
|
// loop of death...
|
||||||
void Spin(); // This gets called in the main loop and should do any housekeeping needed
|
void Spin(); // This gets called in the main loop and should do any housekeeping needed
|
||||||
|
|
||||||
|
void Exit(); // Shut down tidily. Calling Init after calling this should reset to the beginning
|
||||||
|
|
||||||
// Timing
|
// Timing
|
||||||
|
|
||||||
unsigned long Time(); // Returns elapsed microseconds since some arbitrary time
|
unsigned long Time(); // Returns elapsed microseconds since some arbitrary time
|
||||||
|
|
|
@ -166,6 +166,11 @@ void Platform::Init()
|
||||||
// SD.begin() returns with the SPI disabled, so you need not disable it here
|
// SD.begin() returns with the SPI disabled, so you need not disable it here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Platform::Exit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Load settings from local storage; return true if successful, false otherwise
|
// Load settings from local storage; return true if successful, false otherwise
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,8 @@ class RepRap
|
||||||
RepRap();
|
RepRap();
|
||||||
void Init();
|
void Init();
|
||||||
void Spin();
|
void Spin();
|
||||||
|
void Exit();
|
||||||
|
|
||||||
// Platform* getPlatform();
|
// Platform* getPlatform();
|
||||||
// Move* getMove();
|
// Move* getMove();
|
||||||
// Heat* getHeat();
|
// Heat* getHeat();
|
||||||
|
|
|
@ -63,6 +63,15 @@ void RepRap::Init()
|
||||||
platform->Message(HOST_MESSAGE, "RepRapPro RepRap Firmware (Re)Started\n\n");
|
platform->Message(HOST_MESSAGE, "RepRapPro RepRap Firmware (Re)Started\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RepRap::Exit()
|
||||||
|
{
|
||||||
|
webserver->Exit();
|
||||||
|
gcodes->Exit();
|
||||||
|
heat->Exit();
|
||||||
|
move->Exit();
|
||||||
|
platform->Exit();
|
||||||
|
}
|
||||||
|
|
||||||
void RepRap::Spin()
|
void RepRap::Spin()
|
||||||
{
|
{
|
||||||
platform->Spin();
|
platform->Spin();
|
||||||
|
@ -72,6 +81,8 @@ void RepRap::Spin()
|
||||||
webserver->Spin();
|
webserver->Spin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void RepRap::Interrupt()
|
void RepRap::Interrupt()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ class Webserver
|
||||||
byte Read();
|
byte Read();
|
||||||
void Init();
|
void Init();
|
||||||
void Spin();
|
void Spin();
|
||||||
|
void Exit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -875,5 +875,10 @@ void Webserver::Init()
|
||||||
InitialisePost();
|
InitialisePost();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Webserver::Exit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue