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);
|
||||
void Spin();
|
||||
void Init();
|
||||
void Exit();
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -30,12 +30,19 @@ GCodes::GCodes(Platform* p, Move* m, Heat* h, Webserver* w)
|
|||
webserver = w;
|
||||
}
|
||||
|
||||
void GCodes::Exit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void GCodes::Init()
|
||||
{
|
||||
lastTime = platform->Time();
|
||||
gcodePointer = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GCodes::ActOnGcode()
|
||||
{
|
||||
platform->Message(HOST_MESSAGE, "\nGCode: ");
|
||||
|
|
1
Heat.h
1
Heat.h
|
@ -39,6 +39,7 @@ class Heat
|
|||
Heat(Platform* p);
|
||||
void Spin();
|
||||
void Init();
|
||||
void Exit();
|
||||
|
||||
private:
|
||||
|
||||
|
|
5
Heat.ino
5
Heat.ino
|
@ -33,6 +33,11 @@ void Heat::Init()
|
|||
//inc = 0.01;
|
||||
}
|
||||
|
||||
void Heat::Exit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Heat::Spin()
|
||||
{
|
||||
unsigned long t = platform->Time();
|
||||
|
|
1
Move.h
1
Move.h
|
@ -28,6 +28,7 @@ class Move
|
|||
Move(Platform* p);
|
||||
void Init();
|
||||
void Spin();
|
||||
void Exit();
|
||||
|
||||
private:
|
||||
|
||||
|
|
5
Move.ino
5
Move.ino
|
@ -35,6 +35,11 @@ void Move::Init()
|
|||
platform->SetDirection(3, FORWARDS);
|
||||
}
|
||||
|
||||
void Move::Exit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Move::Spin()
|
||||
{
|
||||
unsigned long t = platform->Time();
|
||||
|
|
|
@ -174,6 +174,8 @@ class Platform
|
|||
// loop of death...
|
||||
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
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
void Platform::Exit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Load settings from local storage; return true if successful, false otherwise
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ class RepRap
|
|||
RepRap();
|
||||
void Init();
|
||||
void Spin();
|
||||
void Exit();
|
||||
|
||||
// Platform* getPlatform();
|
||||
// Move* getMove();
|
||||
// Heat* getHeat();
|
||||
|
|
|
@ -63,6 +63,15 @@ void RepRap::Init()
|
|||
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()
|
||||
{
|
||||
platform->Spin();
|
||||
|
@ -72,6 +81,8 @@ void RepRap::Spin()
|
|||
webserver->Spin();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RepRap::Interrupt()
|
||||
{
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ class Webserver
|
|||
byte Read();
|
||||
void Init();
|
||||
void Spin();
|
||||
void Exit();
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -875,5 +875,10 @@ void Webserver::Init()
|
|||
InitialisePost();
|
||||
}
|
||||
|
||||
void Webserver::Exit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Reference in a new issue