• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

shared_fooの不要ディレクトリ削除前のもの


Commit MetaInfo

Revisionca63d82411206680f193042915279d0ad01d3bf9 (tree)
Time2018-03-02 07:58:15
Authortakemasa <suikan@user...>
Commitertakemasa

Log Message

Added DebuTxTask.

Change Summary

Incremental Difference

--- a/stm32_development/murasaki/murasaki/abstracttask.hpp
+++ b/stm32_development/murasaki/murasaki/abstracttask.hpp
@@ -18,7 +18,7 @@ namespace murasaki {
1818 /**
1919 * @brief A mother of all tasks.
2020 * @details
21- * Encapsulate a FreeRTOS.
21+ * Encapsulate a FreeRTOS task.
2222 *
2323 * The constructor just stores given parameter internally.
2424 * And then, these parameter is passed to a task when Start() member function is called.
@@ -81,7 +81,7 @@ class AbstractTask
8181 * @details
8282 * The task body is called only once as task entity.
8383 */
84- virtual void TaskBody(const void * ptr) = 0;
84+ virtual void TaskBody(void * ptr) = 0;
8585 };
8686
8787 } /* namespace murasaki */
--- a/stm32_development/murasaki/murasaki/debuggerfifo.hpp
+++ b/stm32_development/murasaki/murasaki/debuggerfifo.hpp
@@ -82,8 +82,10 @@ struct LoggingHelpers
8282 {
8383 AbstractFifo * fifo;
8484 AbstractLogger * logger;
85- ;
8685
87-} /* namespace murasaki */
86+};
87+}
88+;
89+/* namespace murasaki */
8890
8991 #endif /* DEBUGGERFIFO_HPP_ */
--- /dev/null
+++ b/stm32_development/murasaki/murasaki/debuggertxtask.cpp
@@ -0,0 +1,45 @@
1+/*
2+ * debuggertxtask.cpp
3+ *
4+ * Created on: 2018/03/02
5+ * Author: takemasa
6+ */
7+
8+#include <debuggertxtask.hpp>
9+#include "debuggerfifo.hpp"
10+#include "murasaki_assert.hpp"
11+
12+namespace murasaki {
13+
14+DebuggerTxTask::DebuggerTxTask(const char * task_name,
15+ unsigned short stack_depth,
16+ void * task_parameter,
17+ UBaseType_t task_priority)
18+ // Forward initialization parameter to the parent class
19+ : AbstractTask(task_name, stack_depth, task_parameter, task_priority)
20+{
21+ // Do nothing
22+}
23+
24+// Copy data from FIFO to Logger.
25+void DebuggerTxTask::TaskBody(void* ptr)
26+{
27+ MURASAKI_ASSERT(ptr != nullptr);
28+
29+ // ptr is regarded as pointer to the LoggingHelpers
30+ // This struct contains the logger and fifo.
31+ murasaki::LoggingHelpers * const helpers = static_cast<murasaki::LoggingHelpers * const >(ptr);
32+
33+
34+ while (true) {
35+ // Copy data from FIFO
36+ unsigned int copy_size = helpers->fifo->Get(block, sizeof(block));
37+
38+ // Then, put it to logger, if data exsit.
39+ if (copy_size != 0)
40+ helpers->logger->putMessage(reinterpret_cast<char *>(block), copy_size);
41+ }
42+
43+}
44+
45+} /* namespace murasaki */
--- /dev/null
+++ b/stm32_development/murasaki/murasaki/debuggertxtask.hpp
@@ -0,0 +1,70 @@
1+/**
2+ * @file debuggertxtask.hpp
3+ *
4+ * @date 2018/03/02
5+ * @author takemasa
6+ */
7+
8+#ifndef DEBUGGERTXTASK_HPP_
9+#define DEBUGGERTXTASK_HPP_
10+
11+#include <abstracttask.hpp>
12+
13+namespace murasaki {
14+/**
15+ * @brief A mother of all tasks.
16+ * @details
17+ * Dedicated task for the murasaki::Debugger.
18+ *
19+ * Receives a murasaki::AbstractLogger type instance and murasaki::AbstractFifo instance
20+ * through the task_param parameter of the constructor.
21+ * Then, it is passed to the @ref TaskBody().
22+ *
23+ * TaskBody takes data form FIFO and put it into the logger.
24+ *
25+ * @ingroup MURASAKI_HELPER_GROUP
26+ */
27+
28+class DebuggerTxTask : public AbstractTask
29+{
30+ public:
31+ /**
32+ * @brief Constractor. Task entity is not created here.
33+ * @param task_name Name of task. Will be passed to task when started.
34+ * @param stack_depth [Byte]
35+ * @param task_parameter The pointer to the murasaki::LoggingHelpers type variable.
36+ * @param task_priority Priority of the task. from 1 to up to configMAX_PRIORITIES -1. The high number is the high priority.
37+ * @details
38+ * The task implementation of the data copy task.
39+ * This task is dedicated to the murasaki::Debugger.
40+ *
41+ * Basically, this task should have higher prority than other task in the system.
42+ * Otherwise, the debug message will be kept waiting until higher priority task yields.
43+ * This is up side down.
44+ */
45+
46+ DebuggerTxTask(const char * task_name,
47+ unsigned short stack_depth,
48+ void * task_parameter,
49+ UBaseType_t task_priority);
50+ private:
51+ /**
52+ * @brief data backet from FIFO to logger
53+ */
54+ uint8_t block[100];
55+
56+ /**
57+ * @brief Take data from FIFO and then put to logger.
58+ * @param ptr The pointer to the murasaki::LoggingHelpers type variable.
59+ * @details
60+ * The task body of the data copy task. This task is dedicated to the murasaki::Debugger.
61+ *
62+ */
63+ virtual void TaskBody(void * ptr);
64+
65+
66+};
67+
68+} /* namespace murasaki */
69+
70+#endif /* DEBUGGERTXTASK_HPP_ */