mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/Tasty.git
synced 2025-08-06 14:07:34 +00:00
Added first implementation
This commit is contained in:
26
include/sta/tasty/tasks/dummy.hpp
Normal file
26
include/sta/tasty/tasks/dummy.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Dummy.hpp
|
||||
*
|
||||
* Created on: Dec 31, 2023
|
||||
* Author: Dario
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_TASKS_DUMMY_HPP_
|
||||
#define INCLUDE_TASKS_DUMMY_HPP_
|
||||
|
||||
#include <sta/tacos/thread.hpp>
|
||||
|
||||
namespace demo
|
||||
{
|
||||
class DummyThread : public sta::tacos::TacosThread
|
||||
{
|
||||
public:
|
||||
DummyThread(const char* name);
|
||||
|
||||
void init() override;
|
||||
|
||||
void func() override;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* INCLUDE_TASKS_DUMMY_HPP_ */
|
37
include/sta/tasty/tasks/supervisor.hpp
Normal file
37
include/sta/tasty/tasks/supervisor.hpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* supervisor.hpp
|
||||
*
|
||||
* Created on: Jan 6, 2024
|
||||
* Author: Dario
|
||||
*/
|
||||
|
||||
#ifndef STA_TASTY_TASKS_SUPERVISOR_HPP
|
||||
#define STA_TASTY_TASKS_SUPERVISOR_HPP
|
||||
|
||||
#include <sta/tacos/thread.hpp>
|
||||
|
||||
#include <list>
|
||||
#include <functional>
|
||||
|
||||
namespace sta
|
||||
{
|
||||
namespace tasty
|
||||
{
|
||||
typedef std::function<void(void)> TastyCheck;
|
||||
|
||||
class Supervisor : public tacos::TacosThread
|
||||
{
|
||||
public:
|
||||
Supervisor(std::list<TastyCheck> checks);
|
||||
|
||||
void func() override;
|
||||
private:
|
||||
std::list<TastyCheck> checks_;
|
||||
};
|
||||
} // namespace tasty
|
||||
} // namespace sta
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // STA_TASTY_TASKS_SUPERVISOR_HPP
|
32
include/sta/tasty/tasks/toggle.hpp
Normal file
32
include/sta/tasty/tasks/toggle.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* toggle.hpp
|
||||
*
|
||||
* Created on: Jan 1, 2024
|
||||
* Author: Dario
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_TASKS_TOGGLE_HPP_
|
||||
#define INCLUDE_TASKS_TOGGLE_HPP_
|
||||
|
||||
#include <sta/tacos/thread.hpp>
|
||||
|
||||
namespace sta
|
||||
{
|
||||
namespace tasty
|
||||
{
|
||||
class ToggleThread : public sta::tacos::TacosThread
|
||||
{
|
||||
public:
|
||||
ToggleThread(uint32_t ticks, uint32_t lockout = 0, const char* name = "toggle");
|
||||
|
||||
void init() override;
|
||||
|
||||
void func() override;
|
||||
private:
|
||||
uint32_t ticks_;
|
||||
uint32_t lockout_;
|
||||
};
|
||||
} // namespace tasty
|
||||
} // namespace sta
|
||||
|
||||
#endif /* INCLUDE_TASKS_TOGGLE_HPP_ */
|
Reference in New Issue
Block a user