shared_fooの不要ディレクトリ削除前のもの
Revision | 0d27bd7e9d503836bcac88e05e8acf5d7e46acc5 (tree) |
---|---|
Time | 2018-03-02 08:23:42 |
Author | takemasa <suikan@user...> |
Commiter | takemasa |
Added DebuggerAutoRePrintTask
@@ -0,0 +1,44 @@ | ||
1 | +/* | |
2 | + * debuggerautoreprinttask.cpp | |
3 | + * | |
4 | + * Created on: 2018/03/02 | |
5 | + * Author: takemasa | |
6 | + */ | |
7 | + | |
8 | +#include <debuggerautoreprinttask.hpp> | |
9 | +#include "debuggerfifo.hpp" | |
10 | +#include "murasaki_assert.hpp" | |
11 | + | |
12 | +namespace murasaki { | |
13 | + | |
14 | +DebuggerAutoRePrintTask::DebuggerAutoRePrintTask(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 | +// Watch the logger and trigger the rewind. | |
25 | +void DebuggerAutoRePrintTask::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 | + while (true) { | |
34 | + // Any character? | |
35 | + helpers->logger->getCharacter(); | |
36 | + | |
37 | + // Then rewind. | |
38 | + helpers->fifo->ReWind(); | |
39 | + } | |
40 | + | |
41 | +} | |
42 | + | |
43 | + | |
44 | +} /* namespace murasaki */ |
@@ -0,0 +1,57 @@ | ||
1 | +/** | |
2 | + * @file debuggerautoreprinttask.hpp | |
3 | + * | |
4 | + * @date 2018/03/02 | |
5 | + * @author takemasa | |
6 | + */ | |
7 | + | |
8 | +#ifndef DEBUGGERAUTOREPRINTTASK_HPP_ | |
9 | +#define DEBUGGERAUTOREPRINTTASK_HPP_ | |
10 | + | |
11 | +#include <abstracttask.hpp> | |
12 | + | |
13 | +namespace murasaki { | |
14 | +/** | |
15 | + * @brief Watching task for auto re-print | |
16 | + * @details | |
17 | + * Dedicated task for the murasaki::Debugger. | |
18 | + * | |
19 | + * Watches logger input. If any character is received, call the AbstractFifo::ReWind(). | |
20 | + * So, from the view point of user, typing any key to re-print the data on screen. | |
21 | + * | |
22 | + * @ingroup MURASAKI_HELPER_GROUP | |
23 | + */ | |
24 | + | |
25 | +class DebuggerAutoRePrintTask : public AbstractTask | |
26 | +{ | |
27 | + public: | |
28 | + /** | |
29 | + * @brief Constractor. Task entity is not created here. | |
30 | + * @param task_name Name of task. Will be passed to task when started. | |
31 | + * @param stack_depth [Byte] | |
32 | + * @param task_parameter The pointer to the murasaki::LoggingHelpers type variable. | |
33 | + * @param task_priority Priority of the task. from 1 to up to configMAX_PRIORITIES -1. The high number is the high priority. | |
34 | + * @details | |
35 | + * The task implementation of the auto reprint task. | |
36 | + * This task is dedicated to the murasaki::Debugger. | |
37 | + * | |
38 | + * Basically, this task should have higher prority than other task in the system. | |
39 | + * Otherwise, the debug message will be kept waiting until higher priority task yields. | |
40 | + * This is up side down. | |
41 | + */ | |
42 | + DebuggerAutoRePrintTask(const char * task_name, | |
43 | + unsigned short stack_depth, | |
44 | + void * task_parameter, | |
45 | + UBaseType_t task_priority); | |
46 | + private: | |
47 | + /** | |
48 | + * @brief Watch the character input then ReWind FIFO | |
49 | + * @param ptr The pointer to the murasaki::LoggingHelpers type variable. | |
50 | + * | |
51 | + */ | |
52 | + virtual void TaskBody(void * ptr); | |
53 | +}; | |
54 | + | |
55 | +} /* namespace murasaki */ | |
56 | + | |
57 | +#endif /* DEBUGGERAUTOREPRINTTASK_HPP_ */ |
@@ -12,7 +12,7 @@ | ||
12 | 12 | |
13 | 13 | namespace murasaki { |
14 | 14 | /** |
15 | - * @brief A mother of all tasks. | |
15 | + * @brief Copy task from FIFO to logger | |
16 | 16 | * @details |
17 | 17 | * Dedicated task for the murasaki::Debugger. |
18 | 18 | * |