テスト用のあれこれ共用フォルダ
Revisão | 77791bcd80466e0a62b2af58a750674e951afd4e (tree) |
---|---|
Hora | 2019-02-04 13:43:43 |
Autor | takemasa <suikan@user...> |
Commiter | takemasa |
Refactering class name.
Changeng class name from Abstract*** to ***Strategy,
to belong with the pattern programming.
@@ -6,7 +6,7 @@ | ||
6 | 6 | <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> |
7 | 7 | <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> |
8 | 8 | <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> |
9 | - <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="1318604374853316739" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> | |
9 | + <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1429691010231092235" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> | |
10 | 10 | <language-scope id="org.eclipse.cdt.core.gcc"/> |
11 | 11 | <language-scope id="org.eclipse.cdt.core.g++"/> |
12 | 12 | </provider> |
@@ -18,7 +18,7 @@ | ||
18 | 18 | <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> |
19 | 19 | <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> |
20 | 20 | <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> |
21 | - <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="1318604374853316739" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> | |
21 | + <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1429691010231092235" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> | |
22 | 22 | <language-scope id="org.eclipse.cdt.core.gcc"/> |
23 | 23 | <language-scope id="org.eclipse.cdt.core.g++"/> |
24 | 24 | </provider> |
@@ -79,17 +79,17 @@ namespace murasaki { | ||
79 | 79 | struct Platform |
80 | 80 | { |
81 | 81 | // Platform dependent Custom variables. |
82 | - AbstractUart * uart_console; ///< UART wrapping class object for debugging | |
82 | + UartStrategy * uart_console; ///< UART wrapping class object for debugging | |
83 | 83 | AbstractLogger * logger; ///< logging class object for debugger |
84 | 84 | |
85 | 85 | AbstractBitOut * led; ///< GP out under test |
86 | - AbstractUart * uart; ///< UART under test | |
86 | + UartStrategy * uart; ///< UART under test | |
87 | 87 | AbstractSpiMaster * spiMaster; ///< SPI Master under test |
88 | 88 | AbstractSpiSlave * spiSlave; ///< SPI Slave under test |
89 | 89 | AbstractI2CMaster * i2cMaster; ///< I2C Master under test |
90 | 90 | AbstractI2cSlave * i2cSlave; ///< I2C Slave under test |
91 | 91 | |
92 | - AbstractTask * task1; ///< Task under test | |
92 | + TaskStrategy * task1; ///< Task under test | |
93 | 93 | |
94 | 94 | }; |
95 | 95 |
@@ -8,7 +8,7 @@ | ||
8 | 8 | #ifndef ABSTRACTBITIN_HPP_ |
9 | 9 | #define ABSTRACTBITIN_HPP_ |
10 | 10 | |
11 | -#include <abstractperipheral.hpp> | |
11 | +#include <peripheralstrategy.hpp> | |
12 | 12 | |
13 | 13 | namespace murasaki { |
14 | 14 | /** |
@@ -18,7 +18,7 @@ namespace murasaki { | ||
18 | 18 | * A prototype of the general purpose bit input class |
19 | 19 | * |
20 | 20 | */ |
21 | -class AbstractBitIn: public AbstractPeripheral { | |
21 | +class AbstractBitIn: public PeripheralStrategy { | |
22 | 22 | public: |
23 | 23 | /** |
24 | 24 | * @brief Get a status of the input pin |
@@ -8,7 +8,7 @@ | ||
8 | 8 | #ifndef ABSTRACTBITOUT_HPP_ |
9 | 9 | #define ABSTRACTBITOUT_HPP_ |
10 | 10 | |
11 | -#include <abstractperipheral.hpp> | |
11 | +#include <peripheralstrategy.hpp> | |
12 | 12 | |
13 | 13 | namespace murasaki { |
14 | 14 | /** |
@@ -19,7 +19,7 @@ namespace murasaki { | ||
19 | 19 | * |
20 | 20 | */ |
21 | 21 | |
22 | -class AbstractBitOut: public AbstractPeripheral { | |
22 | +class AbstractBitOut: public PeripheralStrategy { | |
23 | 23 | public: |
24 | 24 | /** |
25 | 25 | * @brief Set a status of the output pin |
@@ -9,7 +9,7 @@ | ||
9 | 9 | #ifndef ABSTRACTI2CMASTER_HPP_ |
10 | 10 | #define ABSTRACTI2CMASTER_HPP_ |
11 | 11 | |
12 | -#include "abstractperipheral.hpp" | |
12 | +#include <peripheralstrategy.hpp> | |
13 | 13 | |
14 | 14 | namespace murasaki { |
15 | 15 | /** |
@@ -27,7 +27,7 @@ namespace murasaki { | ||
27 | 27 | * Transmit/Receive. |
28 | 28 | */ |
29 | 29 | |
30 | -class AbstractI2CMaster : murasaki::AbstractPeripheral | |
30 | +class AbstractI2CMaster : murasaki::PeripheralStrategy | |
31 | 31 | { |
32 | 32 | public: |
33 | 33 |
@@ -9,7 +9,7 @@ | ||
9 | 9 | #ifndef ABSTRACTI2CSLAVE_HPP_ |
10 | 10 | #define ABSTRACTI2CSLAVE_HPP_ |
11 | 11 | |
12 | -#include <abstractperipheral.hpp> | |
12 | +#include <peripheralstrategy.hpp> | |
13 | 13 | |
14 | 14 | namespace murasaki { |
15 | 15 | /** |
@@ -25,7 +25,7 @@ namespace murasaki { | ||
25 | 25 | * Two call back member functions are prepared to sync with the interrupt which tells the end of |
26 | 26 | * Transmit/Receive. |
27 | 27 | */ |
28 | -class AbstractI2cSlave : public murasaki::AbstractPeripheral { | |
28 | +class AbstractI2cSlave : public murasaki::PeripheralStrategy { | |
29 | 29 | public: |
30 | 30 | /** |
31 | 31 | * @brief Thread safe, blocking transmission over I2C. |
@@ -9,7 +9,7 @@ | ||
9 | 9 | #ifndef ABSTRACTLOGGER_HPP_ |
10 | 10 | #define ABSTRACTLOGGER_HPP_ |
11 | 11 | |
12 | -#include <abstractperipheral.hpp> | |
12 | +#include <peripheralstrategy.hpp> | |
13 | 13 | #include <stdint.h> |
14 | 14 | namespace murasaki { |
15 | 15 |
@@ -72,7 +72,7 @@ class AbstractLogger | ||
72 | 72 | * \brief This special method helps derived loggers. The loggers can access the raw device, in case of the |
73 | 73 | * post mortem processing. |
74 | 74 | */ |
75 | - static void * GetPeripheralHandle(murasaki::AbstractPeripheral * peripheral); | |
75 | + static void * GetPeripheralHandle(murasaki::PeripheralStrategy * peripheral); | |
76 | 76 | }; |
77 | 77 | /** |
78 | 78 | * \} |
@@ -81,7 +81,7 @@ class AbstractLogger | ||
81 | 81 | } /* namespace murasaki */ |
82 | 82 | |
83 | 83 | inline void* murasaki::AbstractLogger::GetPeripheralHandle( |
84 | - murasaki::AbstractPeripheral* peripheral) | |
84 | + murasaki::PeripheralStrategy* peripheral) | |
85 | 85 | { |
86 | 86 | return(peripheral->GetPeripheralHandle()); |
87 | 87 | } |
@@ -10,7 +10,7 @@ | ||
10 | 10 | #define ABSTRACTSPIMASTER_HPP_ |
11 | 11 | |
12 | 12 | #include <abstractspislavespecifier.hpp> |
13 | -#include "abstractperipheral.hpp" | |
13 | +#include <peripheralstrategy.hpp> | |
14 | 14 | |
15 | 15 | namespace murasaki { |
16 | 16 |
@@ -21,7 +21,7 @@ namespace murasaki { | ||
21 | 21 | * |
22 | 22 | * \ingroup MURASAKI_ABSTRACT_GROUP |
23 | 23 | */ |
24 | -class AbstractSpiMaster:public murasaki::AbstractPeripheral | |
24 | +class AbstractSpiMaster:public murasaki::PeripheralStrategy | |
25 | 25 | { |
26 | 26 | public: |
27 | 27 | /** |
@@ -9,7 +9,7 @@ | ||
9 | 9 | #ifndef ABSTRACTSPISLAVE_HPP_ |
10 | 10 | #define ABSTRACTSPISLAVE_HPP_ |
11 | 11 | |
12 | -#include "abstractperipheral.hpp" | |
12 | +#include <peripheralstrategy.hpp> | |
13 | 13 | |
14 | 14 | namespace murasaki { |
15 | 15 |
@@ -20,7 +20,7 @@ namespace murasaki { | ||
20 | 20 | * |
21 | 21 | * \ingroup MURASAKI_ABSTRACT_GROUP |
22 | 22 | */ |
23 | -class AbstractSpiSlave : public murasaki::AbstractPeripheral | |
23 | +class AbstractSpiSlave : public murasaki::PeripheralStrategy | |
24 | 24 | { |
25 | 25 | public: |
26 | 26 | /** |
@@ -16,7 +16,7 @@ DebuggerAutoRePrintTask::DebuggerAutoRePrintTask(const char * task_name, | ||
16 | 16 | UBaseType_t task_priority, |
17 | 17 | const void * task_parameter) |
18 | 18 | // Forward initialization parameter to the parent class |
19 | - : AbstractTask(task_name, stack_depth, task_priority, task_parameter) | |
19 | + : TaskStrategy(task_name, stack_depth, task_priority, task_parameter) | |
20 | 20 | { |
21 | 21 | // Do nothing |
22 | 22 | } |
@@ -8,7 +8,7 @@ | ||
8 | 8 | #ifndef DEBUGGERAUTOREPRINTTASK_HPP_ |
9 | 9 | #define DEBUGGERAUTOREPRINTTASK_HPP_ |
10 | 10 | |
11 | -#include <abstracttask.hpp> | |
11 | +#include <taskstrategy.hpp> | |
12 | 12 | |
13 | 13 | namespace murasaki { |
14 | 14 | /** |
@@ -22,7 +22,7 @@ namespace murasaki { | ||
22 | 22 | * @ingroup MURASAKI_HELPER_GROUP |
23 | 23 | */ |
24 | 24 | |
25 | -class DebuggerAutoRePrintTask : public AbstractTask | |
25 | +class DebuggerAutoRePrintTask : public TaskStrategy | |
26 | 26 | { |
27 | 27 | public: |
28 | 28 | /** |
@@ -16,7 +16,7 @@ DebuggerTxTask::DebuggerTxTask(const char * task_name, | ||
16 | 16 | UBaseType_t task_priority, |
17 | 17 | const void * task_parameter) |
18 | 18 | // Forward initialization parameter to the parent class |
19 | - : AbstractTask(task_name, stack_depth, task_priority, task_parameter) | |
19 | + : TaskStrategy(task_name, stack_depth, task_priority, task_parameter) | |
20 | 20 | { |
21 | 21 | // Do nothing |
22 | 22 | } |
@@ -8,7 +8,7 @@ | ||
8 | 8 | #ifndef DEBUGGERTXTASK_HPP_ |
9 | 9 | #define DEBUGGERTXTASK_HPP_ |
10 | 10 | |
11 | -#include <abstracttask.hpp> | |
11 | +#include <taskstrategy.hpp> | |
12 | 12 | |
13 | 13 | namespace murasaki { |
14 | 14 | /** |
@@ -25,7 +25,7 @@ namespace murasaki { | ||
25 | 25 | * @ingroup MURASAKI_HELPER_GROUP |
26 | 26 | */ |
27 | 27 | |
28 | -class DebuggerTxTask : public AbstractTask | |
28 | +class DebuggerTxTask : public TaskStrategy | |
29 | 29 | { |
30 | 30 | public: |
31 | 31 | /** |
@@ -10,7 +10,7 @@ | ||
10 | 10 | #define DEBUGGER_UART_HPP_ |
11 | 11 | |
12 | 12 | #include <synchronizer.hpp> |
13 | -#include "abstractuart.hpp" | |
13 | +#include <uartstrategy.hpp> | |
14 | 14 | #include "criticalsection.hpp" |
15 | 15 | |
16 | 16 | // Check if CubeMX generates UART module |
@@ -65,7 +65,7 @@ namespace murasaki { | ||
65 | 65 | * Both methods can be called from only the task context. If these are called in the ISR |
66 | 66 | * context, the result is unknown. |
67 | 67 | */ |
68 | -class DebuggerUart : public AbstractUart | |
68 | +class DebuggerUart : public UartStrategy | |
69 | 69 | { |
70 | 70 | public: |
71 | 71 | /** |
@@ -26,13 +26,13 @@ | ||
26 | 26 | |
27 | 27 | // Include HAL to refer from submodules of murasaki. |
28 | 28 | #include <debugger.hpp> |
29 | +#include <taskstrategy.hpp> | |
29 | 30 | |
30 | 31 | // Configurations |
31 | 32 | #include "murasaki_config.hpp" |
32 | 33 | #include "murasaki_defs.hpp" |
33 | 34 | |
34 | 35 | // Task and Stack |
35 | -#include "abstracttask.hpp" | |
36 | 36 | #include "abstractfifo.hpp" |
37 | 37 | #include "task.hpp" |
38 | 38 |
@@ -1,13 +1,13 @@ | ||
1 | 1 | /** |
2 | - * @file abstractperipheral.hpp | |
2 | + * @file peripheralstrategy.hpp | |
3 | 3 | * |
4 | 4 | * @date 2018/04/26 |
5 | 5 | * @author: takemasa |
6 | 6 | * @brief Mother of All peripheral |
7 | 7 | */ |
8 | 8 | |
9 | -#ifndef ABSTRACTPERIPHERAL_HPP_ | |
10 | -#define ABSTRACTPERIPHERAL_HPP_ | |
9 | +#ifndef PERIPHERALSTRATEGY_HPP_ | |
10 | +#define PERIPHERALSTRATEGY_HPP_ | |
11 | 11 | |
12 | 12 | #include "murasaki_defs.hpp" |
13 | 13 |
@@ -22,12 +22,12 @@ namespace murasaki { | ||
22 | 22 | * raw peripheral to respond to the post mortem situation. By using class, programmer can pass the |
23 | 23 | * raw peripheral handler to loggers, while keep it hidden from the application. |
24 | 24 | */ |
25 | -class AbstractPeripheral { | |
25 | +class PeripheralStrategy { | |
26 | 26 | public: |
27 | 27 | /** |
28 | 28 | * @brief destructor |
29 | 29 | */ |
30 | - virtual ~AbstractPeripheral(){}; | |
30 | + virtual ~PeripheralStrategy(){}; | |
31 | 31 | private: |
32 | 32 | /** |
33 | 33 | * @brief pass the raw peripheral handler |
@@ -39,4 +39,4 @@ friend class AbstractLogger; | ||
39 | 39 | |
40 | 40 | } /* namespace murasaki */ |
41 | 41 | |
42 | -#endif /* ABSTRACTPERIPHERAL_HPP_ */ | |
42 | +#endif /* PERIPHERALSTRATEGY_HPP_ */ |
@@ -15,7 +15,7 @@ murasaki::Task::Task( | ||
15 | 15 | const void* task_parameter, |
16 | 16 | void (*task_body_func)(const void*)) |
17 | 17 | : |
18 | - murasaki::AbstractTask( | |
18 | + murasaki::TaskStrategy( | |
19 | 19 | task_name, |
20 | 20 | stack_depth, |
21 | 21 | task_priority, |
@@ -8,7 +8,7 @@ | ||
8 | 8 | #ifndef TASK_HPP_ |
9 | 9 | #define TASK_HPP_ |
10 | 10 | |
11 | -#include <abstracttask.hpp> | |
11 | +#include <taskstrategy.hpp> | |
12 | 12 | |
13 | 13 | namespace murasaki { |
14 | 14 |
@@ -35,7 +35,7 @@ namespace murasaki { | ||
35 | 35 | * @endcode |
36 | 36 | * |
37 | 37 | */ |
38 | -class Task : public murasaki::AbstractTask { | |
38 | +class Task : public murasaki::TaskStrategy { | |
39 | 39 | public: |
40 | 40 | /** |
41 | 41 | * @brief Ease to use task class. |
@@ -5,12 +5,12 @@ | ||
5 | 5 | * Author: takemasa |
6 | 6 | */ |
7 | 7 | |
8 | -#include <abstracttask.hpp> | |
8 | +#include <taskstrategy.hpp> | |
9 | 9 | #include "murasaki_assert.hpp" |
10 | 10 | |
11 | 11 | namespace murasaki { |
12 | 12 | |
13 | -AbstractTask::AbstractTask(const char * task_name, unsigned short stack_depth, UBaseType_t priority, const void * parameter) | |
13 | +TaskStrategy::TaskStrategy(const char * task_name, unsigned short stack_depth, UBaseType_t priority, const void * parameter) | |
14 | 14 | : name_(task_name), |
15 | 15 | stack_depth_(stack_depth), |
16 | 16 | parameter_(parameter), |
@@ -23,12 +23,12 @@ AbstractTask::AbstractTask(const char * task_name, unsigned short stack_depth, U | ||
23 | 23 | task_ = 0; |
24 | 24 | } |
25 | 25 | |
26 | -AbstractTask::~AbstractTask() | |
26 | +TaskStrategy::~TaskStrategy() | |
27 | 27 | { |
28 | 28 | vTaskDelete(task_); |
29 | 29 | } |
30 | 30 | |
31 | -void AbstractTask::Start() | |
31 | +void TaskStrategy::Start() | |
32 | 32 | { |
33 | 33 | // Create a task. |
34 | 34 | // |
@@ -37,7 +37,7 @@ void AbstractTask::Start() | ||
37 | 37 | // So FreeRTOS API can start the as task. |
38 | 38 | // The passed static function calls TaskBody() member funciton, which is |
39 | 39 | // defined by user. |
40 | - BaseType_t task_result = ::xTaskCreate(AbstractTask::Launch, // task entity; | |
40 | + BaseType_t task_result = ::xTaskCreate(TaskStrategy::Launch, // task entity; | |
41 | 41 | name_, // name of task |
42 | 42 | stack_depth_, // stack depth [byte] |
43 | 43 | this, // See AbstractTask::Launch for the details. |
@@ -48,29 +48,29 @@ void AbstractTask::Start() | ||
48 | 48 | |
49 | 49 | } |
50 | 50 | |
51 | -void AbstractTask::Resume() | |
51 | +void TaskStrategy::Resume() | |
52 | 52 | { |
53 | 53 | vTaskResume(task_); |
54 | 54 | } |
55 | 55 | |
56 | -void AbstractTask::Suspend() | |
56 | +void TaskStrategy::Suspend() | |
57 | 57 | { |
58 | 58 | vTaskSuspend(task_); |
59 | 59 | } |
60 | 60 | |
61 | -const char* AbstractTask::GetName() | |
61 | +const char* TaskStrategy::GetName() | |
62 | 62 | { |
63 | 63 | return name_; |
64 | 64 | } |
65 | 65 | |
66 | 66 | // This is a static member function |
67 | -void AbstractTask::Launch(void * ptr) | |
67 | +void TaskStrategy::Launch(void * ptr) | |
68 | 68 | { |
69 | 69 | MURASAKI_ASSERT(nullptr != ptr); |
70 | 70 | |
71 | 71 | // Enforce the ptr to be AbstractTask * type. This is safe because this class member funciton is called from |
72 | 72 | // only @ref AbsutractTask::Start(). And that member function always passes its "this" pointer. |
73 | - AbstractTask * this_ptr = static_cast<AbstractTask *>(ptr); | |
73 | + TaskStrategy * this_ptr = static_cast<TaskStrategy *>(ptr); | |
74 | 74 | |
75 | 75 | // Call its task body. This is virtual function. Then, while the ptr is enfoced to be AbstractTask type, |
76 | 76 | // the TaksBody is always the member function of the callee class ( Descendants of AbstractTask ). |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /** |
2 | - * @file abstracttask.hpp | |
2 | + * @file taskstrategy.hpp | |
3 | 3 | * |
4 | 4 | * @date 2018/02/20 |
5 | 5 | * @author: takemasa |
@@ -7,8 +7,8 @@ | ||
7 | 7 | */ |
8 | 8 | |
9 | 9 | |
10 | -#ifndef ABSTRACTTASK_HPP_ | |
11 | -#define ABSTRACTTASK_HPP_ | |
10 | +#ifndef TASKSTRATEGY_HPP_ | |
11 | +#define TASKSTRATEGY_HPP_ | |
12 | 12 | |
13 | 13 | #include <FreeRTOS.h> |
14 | 14 | #include <task.h> |
@@ -30,10 +30,10 @@ namespace murasaki { | ||
30 | 30 | * Base on the description at http://idken.net/posts/2017-02-01-freertos_task_cpp/ |
31 | 31 | * @ingroup MURASAKI_ABSTRACT_GROUP |
32 | 32 | */ |
33 | -class AbstractTask | |
33 | +class TaskStrategy | |
34 | 34 | { |
35 | 35 | public: |
36 | - AbstractTask() = delete; | |
36 | + TaskStrategy() = delete; | |
37 | 37 | /** |
38 | 38 | * @brief Constractor. Task entity is not created here. |
39 | 39 | * @param task_name Name of task. Will be passed to task when started. |
@@ -41,11 +41,11 @@ class AbstractTask | ||
41 | 41 | * @param task_priority Priority of the task. from 1 to up to configMAX_PRIORITIES -1. The high number is the high priority. |
42 | 42 | * @param task_parameter Optional parameter to the task. |
43 | 43 | */ |
44 | - AbstractTask(const char * task_name, unsigned short stack_depth, UBaseType_t task_priority, const void * task_parameter); | |
44 | + TaskStrategy(const char * task_name, unsigned short stack_depth, UBaseType_t task_priority, const void * task_parameter); | |
45 | 45 | /** |
46 | 46 | * @brief Destructor |
47 | 47 | */ |
48 | - virtual ~AbstractTask(); | |
48 | + virtual ~TaskStrategy(); | |
49 | 49 | /** |
50 | 50 | * @brief Create a task and run it. |
51 | 51 | * @details |
@@ -91,4 +91,4 @@ class AbstractTask | ||
91 | 91 | |
92 | 92 | } /* namespace murasaki */ |
93 | 93 | |
94 | -#endif /* ABSTRACTTASK_HPP_ */ | |
94 | +#endif /* TASKSTRATEGY_HPP_ */ |
@@ -10,7 +10,7 @@ | ||
10 | 10 | #define UART_HPP_ |
11 | 11 | |
12 | 12 | #include <synchronizer.hpp> |
13 | -#include "abstractuart.hpp" | |
13 | +#include <uartstrategy.hpp> | |
14 | 14 | #include "criticalsection.hpp" |
15 | 15 | |
16 | 16 | // Check if CubeMX generates UART module |
@@ -65,7 +65,7 @@ namespace murasaki { | ||
65 | 65 | * Both methods can be called from only the task context. If these are called in the ISR |
66 | 66 | * context, the result is unknown. |
67 | 67 | */ |
68 | -class Uart : public AbstractUart | |
68 | +class Uart : public UartStrategy | |
69 | 69 | { |
70 | 70 | public: |
71 | 71 | /** |
@@ -15,7 +15,7 @@ | ||
15 | 15 | |
16 | 16 | namespace murasaki { |
17 | 17 | |
18 | -UartLogger::UartLogger(AbstractUart * uart): | |
18 | +UartLogger::UartLogger(UartStrategy * uart): | |
19 | 19 | uart_ ( uart) |
20 | 20 | { |
21 | 21 | MURASAKI_ASSERT(nullptr != uart) |
@@ -9,8 +9,8 @@ | ||
9 | 9 | #ifndef UARTLOGGER_HPP_ |
10 | 10 | #define UARTLOGGER_HPP_ |
11 | 11 | |
12 | +#include <uartstrategy.hpp> | |
12 | 13 | #include "abstractlogger.hpp" |
13 | -#include "abstractuart.hpp" | |
14 | 14 | |
15 | 15 | // Check if CubeMX generates UART module |
16 | 16 | #ifdef HAL_UART_MODULE_ENABLED |
@@ -34,7 +34,7 @@ class UartLogger : public AbstractLogger | ||
34 | 34 | * \brief Constructor |
35 | 35 | * \param uart Pointer to the uart object. |
36 | 36 | */ |
37 | - UartLogger(AbstractUart * uart); | |
37 | + UartLogger(UartStrategy * uart); | |
38 | 38 | /** |
39 | 39 | * \brief Message output member function. |
40 | 40 | * \param message Non null terminated character array. This data is stored or output to the logger. |
@@ -56,7 +56,7 @@ class UartLogger : public AbstractLogger | ||
56 | 56 | virtual void DoPostMortem( void * debugger_fifo); |
57 | 57 | |
58 | 58 | protected: |
59 | - AbstractUart * const uart_; | |
59 | + UartStrategy * const uart_; | |
60 | 60 | }; |
61 | 61 | |
62 | 62 | } /* namespace murasaki */ |
@@ -1,16 +1,16 @@ | ||
1 | 1 | /** |
2 | - * \file abstractuart.hpp | |
2 | + * \file uartstrategy.hpp | |
3 | 3 | * |
4 | 4 | * \date 2017/11/04 |
5 | 5 | * \author: Takemasa Nakamura |
6 | 6 | * \brief Root class definition of the UART driver |
7 | 7 | */ |
8 | 8 | |
9 | -#ifndef ABSTRACTUART_HPP_ | |
10 | -#define ABSTRACTUART_HPP_ | |
9 | +#ifndef UARTSTRATEGY_HPP_ | |
10 | +#define UARTSTRATEGY_HPP_ | |
11 | 11 | |
12 | +#include <peripheralstrategy.hpp> | |
12 | 13 | #include "murasaki_defs.hpp" |
13 | -#include "abstractperipheral.hpp" | |
14 | 14 | |
15 | 15 | namespace murasaki { |
16 | 16 |
@@ -37,7 +37,7 @@ namespace murasaki { | ||
37 | 37 | * Transmit/Recieve. |
38 | 38 | */ |
39 | 39 | |
40 | -class AbstractUart : public murasaki::AbstractPeripheral { | |
40 | +class UartStrategy : public murasaki::PeripheralStrategy { | |
41 | 41 | public: |
42 | 42 | |
43 | 43 | /** |
@@ -124,4 +124,4 @@ public: | ||
124 | 124 | */ |
125 | 125 | } |
126 | 126 | |
127 | -#endif /* ABSTRACTUART_HPP_ */ | |
127 | +#endif /* UARTSTRATEGY_HPP_ */ |