Pathfinding thread library
Revision 0:2f4ac599c1b7, committed 2017-08-23
- Comitter:
- williampeers
- Date:
- Wed Aug 23 02:25:50 2017 +0000
- Child:
- 1:c61d8bf5c357
- Commit message:
Changed in this revision
pathfinding.cpp | Show annotated file Show diff for this revision Revisions of this file |
pathfinding.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pathfinding.cpp Wed Aug 23 02:25:50 2017 +0000 @@ -0,0 +1,25 @@ +#include "pathfinding.h" + +/* +Initialise object. +Call initators for any local objects. +*/ +Pathfinding::Pathfinding(osPriority priority, int memory){ + pathfinding_thread = new Thread(priority, memory); +} + +/* +Infinite loop that will be run. like a main loop. +*/ +void Pathfinding::run() { + while (true) { + + } +} + +/* +Called by main at the start of operation to start the thread running. +*/ +void Pathfinding::start() { + pathfinding_thread.start(callback(this, &Pathfinding::run)); +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pathfinding.h Wed Aug 23 02:25:50 2017 +0000 @@ -0,0 +1,16 @@ +#ifndef __PATHFINDING_INCLUDED__ +#define __PATHFINDING_INCLUDED__ + +#include "mbed.h" + +class Pathfinding{ +private: + Thread pathfinding_thread; + void run(); + +public: + Pathfinding(osPriority, int); + void start(); +}; + +#endif \ No newline at end of file