• 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

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


Commit MetaInfo

Revisionf3d9ecb6b7e515b263c985d6cb2a1d06b49aa197 (tree)
Time2018-02-22 21:40:48
Authortakemasa <suikan@user...>
Commitertakemasa

Log Message

Chqange Debug to Debugger

Change Summary

Incremental Difference

--- a/stm32_development/murasaki/Src/my_test.cpp
+++ b/stm32_development/murasaki/Src/my_test.cpp
@@ -21,7 +21,7 @@
2121 #endif
2222
2323 murasaki::Platform murasaki::platform;
24-murasaki::Debug * murasaki::debugger;
24+murasaki::Debugger * murasaki::debugger;
2525
2626 static int counter;
2727
@@ -57,7 +57,7 @@ void InitTestUart(UART_HandleTypeDef * uart_handle, SPI_HandleTypeDef * spi_hand
5757 murasaki::platform.spi_master = new murasaki::SpiMaster(spi_handle);
5858
5959 // Setting debugger
60- murasaki::debugger = new murasaki::Debug(murasaki::platform.logger);
60+ murasaki::debugger = new murasaki::Debugger(murasaki::platform.logger);
6161 murasaki::debugger->AutoHistory(); // type any key to show history.
6262 }
6363
--- a/stm32_development/murasaki/murasaki/debug.cpp
+++ b/stm32_development/murasaki/murasaki/debugger.cpp
@@ -5,8 +5,7 @@
55 * Author: takemasa
66 */
77
8-#include "debug.hpp"
9-
8+#include <debugger.hpp>
109 #include <stdio.h>
1110 #include <string.h>
1211 #include <stdarg.h>
@@ -18,7 +17,7 @@
1817
1918 namespace murasaki {
2019
21-Debug::Debug(AbstractLogger * logger)
20+Debugger::Debugger(AbstractLogger * logger)
2221 {
2322 // initialize internal variable;
2423 MURASAKI_ASSERT(logger != NULL)
@@ -39,7 +38,7 @@ Debug::Debug(AbstractLogger * logger)
3938
4039 // start the debug task
4140 BaseType_t task_result = ::xTaskCreate(
42- Debug::LaunchTxTask, // task entity;
41+ Debugger::LaunchTxTask, // task entity;
4342 "DebugTask", // name of task
4443 PLATFORM_CONFIG_DEBUG_TASK_STACK_SIZE, // stack depth
4544 this, // parameter to task
@@ -50,7 +49,7 @@ Debug::Debug(AbstractLogger * logger)
5049
5150 }
5251
53-Debug::~Debug()
52+Debugger::~Debugger()
5453 {
5554 // Delete task;
5655 if (tx_task_ != NULL)
@@ -65,7 +64,7 @@ Debug::~Debug()
6564 ::vSemaphoreDelete( sem_notify_new_data_);
6665 }
6766
68-void Debug::printf(const char * fmt, ...)
67+void Debugger::printf(const char * fmt, ...)
6968 {
7069 // obtain variable parameter list
7170 va_list argp;
@@ -105,7 +104,7 @@ void Debug::printf(const char * fmt, ...)
105104
106105 }
107106
108-char Debug::GetchFromTask()
107+char Debugger::GetchFromTask()
109108 {
110109 MURASAKI_ASSERT(isTaskContext());
111110
@@ -114,7 +113,7 @@ char Debug::GetchFromTask()
114113 }
115114
116115 // Assumes this is called only in the critical section.
117-void Debug::AppendToBuffer()
116+void Debugger::AppendToBuffer()
118117 {
119118 int avairable;
120119
@@ -147,7 +146,7 @@ void Debug::AppendToBuffer()
147146 * This function is not protected from interrupt.
148147 * There is no easy way to solve this problem.
149148 */
150-void Debug::PrintHistory()
149+void Debugger::PrintHistory()
151150 {
152151 MURASAKI_ASSERT(isTaskContext());
153152
@@ -163,7 +162,7 @@ void Debug::PrintHistory()
163162 ::taskEXIT_CRITICAL();
164163 }
165164
166-void Debug::AutoHistory()
165+void Debugger::AutoHistory()
167166 {
168167 MURASAKI_ASSERT(isTaskContext());
169168 // protecting from double task creation
@@ -171,7 +170,7 @@ void Debug::AutoHistory()
171170 return;
172171
173172 // start the debug task
174- BaseType_t task_result = ::xTaskCreate(Debug::LaunchAutoHistoryTask, // task entity;
173+ BaseType_t task_result = ::xTaskCreate(Debugger::LaunchAutoHistoryTask, // task entity;
175174 "AutoHistoryTask", // name of task
176175 PLATFORM_CONFIG_DEBUG_TASK_STACK_SIZE, // stack depth
177176 this, // parameter to task
@@ -183,7 +182,7 @@ void Debug::AutoHistory()
183182 auto_history_enabled = true;
184183 }
185184
186-void Debug::LaunchAutoHistoryTask(void* this_pointer)
185+void Debugger::LaunchAutoHistoryTask(void* this_pointer)
187186 {
188187 MURASAKI_ASSERT(NULL != this_pointer);
189188
@@ -191,11 +190,11 @@ void Debug::LaunchAutoHistoryTask(void* this_pointer)
191190 // The caller passes the "this" pointer as parameter.
192191 // The caller is always "Debug" task.
193192 // The AutoHistoryTask() is private and task body.
194- static_cast<Debug *>(this_pointer)->AutoHistoryTask();
193+ static_cast<Debugger *>(this_pointer)->AutoHistoryTask();
195194
196195 }
197196
198-void Debug::AutoHistoryTask()
197+void Debugger::AutoHistoryTask()
199198 {
200199 MURASAKI_ASSERT(isTaskContext());
201200 // Task body. Never return.
@@ -209,17 +208,17 @@ void Debug::AutoHistoryTask()
209208 }
210209
211210
212-void Debug::LaunchTxTask(void * this_pointer)
211+void Debugger::LaunchTxTask(void * this_pointer)
213212 {
214213 MURASAKI_ASSERT(NULL != this_pointer);
215214 // This is "interface class method" to allow to use a private method as task.
216215 // The caller passes the "this" pointer as parameter.
217216 // The caller is always "Debug" task.
218217 // The txTask() is private and task body.
219- static_cast<Debug *>(this_pointer)->TxTask();
218+ static_cast<Debugger *>(this_pointer)->TxTask();
220219 }
221220
222-void Debug::TxTask()
221+void Debugger::TxTask()
223222 {
224223 MURASAKI_ASSERT(isTaskContext());
225224 // Task body. Never return.
--- a/stm32_development/murasaki/murasaki/debug.hpp
+++ b/stm32_development/murasaki/murasaki/debugger.hpp
@@ -8,8 +8,8 @@
88 * This class serves printf function for both task context and ISR context.
99 */
1010
11-#ifndef DEBUG_HPP_
12-#define DEBUG_HPP_
11+#ifndef DEBUGGER_HPP_
12+#define DEBUGGER_HPP_
1313
1414 #include <FreeRTOS.h>
1515 #include <task.h>
@@ -37,18 +37,18 @@ namespace murasaki {
3737 * See \ref MURASAKI_PLATFORM_GROUP as example this class.
3838 *
3939 */
40-class Debug
40+class Debugger
4141 {
4242 public:
4343 /**
4444 * \brief Constructor. Create internal variable.
4545 * \param logger The pointer to the \ref AbstractLogger wrapper class variable.
4646 */
47- Debug(AbstractLogger* logger);
47+ Debugger(AbstractLogger* logger);
4848 /**
4949 * \brief Deconstructor. Delete internal variable.
5050 */
51- virtual ~Debug();
51+ virtual ~Debugger();
5252
5353 /**
5454 * \brief Debug output function.
@@ -213,4 +213,4 @@ class Debug
213213
214214 } /* namespace platform */
215215
216-#endif /* DEBUG_HPP_ */
216+#endif /* DEBUGGER_HPP_ */
--- a/stm32_development/murasaki/murasaki/murasaki.hpp
+++ b/stm32_development/murasaki/murasaki/murasaki.hpp
@@ -25,6 +25,7 @@
2525 #define MURASAKI_HPP_
2626
2727 // Include HAL to refer from submodules of murasaki.
28+#include <debugger.hpp>
2829 #include "stm32f7xx_hal.h"
2930
3031 #include "murasaki_config.hpp"
@@ -38,7 +39,6 @@
3839 #include "i2cmaster.hpp"
3940
4041 #include "uartlogger.hpp"
41-#include "debug.hpp"
4242 #include "murasaki_assert.hpp"
4343
4444 #include "platform_defs.hpp"
--- a/stm32_development/murasaki/murasaki/murasaki_assert.hpp
+++ b/stm32_development/murasaki/murasaki/murasaki_assert.hpp
@@ -9,9 +9,9 @@
99 #ifndef MURASAKI_ASSERT_HPP_
1010 #define MURASAKI_ASSERT_HPP_
1111
12+#include <debugger.hpp>
1213 #include "murasaki_config.hpp"
1314 #include "murasaki_defs.hpp"
14-#include "debug.hpp"
1515
1616 #define MURASAKI_ASSERT_MSG "!! Assertion failure in function %s(), at line %d of file %s !!\n\r"
1717 #define MURASAKI_ERROR_MSG "Error in function %s(), at line %d of file %s : %s \n\r"
@@ -80,7 +80,7 @@ namespace murasaki {
8080 *
8181 */
8282
83-extern Debug* debugger;
83+extern Debugger* debugger;
8484 }
8585
8686 #endif /* MURASAKI_ASSERT_HPP_ */