• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

テスト用のあれこれ共用フォルダ


Commit MetaInfo

修訂b7e92dc5bd7780ee1dcec19aa9a4fd82661a5c20 (tree)
時間2019-02-03 16:33:32
作者takemasa <suikan@user...>
Commitertakemasa

Log Message

Add task class.

Change Summary

差異

--- /dev/null
+++ b/stm32_development/murasaki/murasaki/task.cpp
@@ -0,0 +1,31 @@
1+/*
2+ * task.cpp
3+ *
4+ * Created on: 2019/02/03
5+ * Author: takemasa
6+ */
7+
8+#include <task.hpp>
9+
10+// Pass through the parameters to the person class. Also, set the task body funciton pointer.
11+murasaki::Task::Task(
12+ const char* task_name,
13+ unsigned short stack_depth,
14+ UBaseType_t task_priority,
15+ const void* task_parameter,
16+ void (*task_body_func)(const void*))
17+ :
18+ murasaki::AbstractTask(
19+ task_name,
20+ stack_depth,
21+ task_priority,
22+ task_parameter),
23+ task_body_func_(task_body_func)
24+ {
25+}
26+
27+void murasaki::Task::TaskBody(const void* ptr)
28+ {
29+ // Call task body function
30+ task_body_func_(ptr);
31+}
--- /dev/null
+++ b/stm32_development/murasaki/murasaki/task.hpp
@@ -0,0 +1,58 @@
1+/**
2+ * \file task.hpp
3+ *
4+ * @date 2019/02/03
5+ * @author takemasa
6+ */
7+
8+#ifndef TASK_HPP_
9+#define TASK_HPP_
10+
11+#include <abstracttask.hpp>
12+
13+namespace murasaki {
14+
15+/**
16+ * @brief An easy to use task class.
17+ * @details
18+ * This class is handy class to encapsulate the task creation without inheriting.
19+ * A task can be created easy like :
20+ * @code
21+ *
22+ * @endcode
23+ *
24+ */
25+class Task : public murasaki::AbstractTask {
26+ public:
27+ /**
28+ *
29+ * @param task_name
30+ * @param stack_depth
31+ * @param task_priority
32+ * @param task_parameter
33+ * @param task_body_func
34+ */
35+ Task(
36+ const char * task_name,
37+ unsigned short stack_depth,
38+ UBaseType_t task_priority,
39+ const void * task_parameter,
40+ void (*task_body_func)(const void *));
41+
42+ protected:
43+ /**
44+ *
45+ * @param ptr
46+ */
47+ virtual void TaskBody(const void * ptr);
48+
49+ private:
50+ /**
51+ *
52+ * @param
53+ */
54+ void (*task_body_func_)(const void *);
55+ };
56+
57+};
58+#endif /* TASK_HPP_ */