テスト用のあれこれ共用フォルダ
Revision | ba13cd3f0c338052772fdc6fd505eabcd5d764f5 (tree) |
---|---|
Time | 2018-03-03 15:05:48 |
Author | takemasa <suikan@user...> |
Commiter | takemasa |
Auto History is refactored.
@@ -65,7 +65,7 @@ void InitTestUart(UART_HandleTypeDef * uart_handle, SPI_HandleTypeDef * spi_hand | ||
65 | 65 | |
66 | 66 | // Setting debugger |
67 | 67 | murasaki::debugger = new murasaki::Debugger(murasaki::platform.logger); |
68 | -// murasaki::debugger->AutoHistory(); // type any key to show history. | |
68 | + murasaki::debugger->AutoHistory(); // type any key to show history. | |
69 | 69 | #if 0 |
70 | 70 | test_fifo = new murasaki::DebuggerFifo(32); |
71 | 71 | MURASAKI_ASSERT(test_fifo != nullptr); |
@@ -55,6 +55,8 @@ Debugger::Debugger(AbstractLogger * logger) | ||
55 | 55 | PLATFORM_CONFIG_DEBUG_TASK_PRIORITY, // execusion priority of task |
56 | 56 | &helpers_ // parameter to task |
57 | 57 | ); |
58 | + MURASAKI_ASSERT(tx_task_ != nullptr); | |
59 | + | |
58 | 60 | tx_task_->Start(); |
59 | 61 | |
60 | 62 | #endif |
@@ -224,6 +226,8 @@ void Debugger::RePrint() | ||
224 | 226 | |
225 | 227 | // tell there is data |
226 | 228 | ::xSemaphoreGive(sem_notify_new_data_); |
229 | +#else | |
230 | + helpers_.fifo->ReWind(); | |
227 | 231 | #endif |
228 | 232 | } |
229 | 233 |
@@ -233,6 +237,7 @@ void Debugger::AutoHistory() | ||
233 | 237 | // protecting from double task creation |
234 | 238 | if (auto_history_enabled) |
235 | 239 | return; |
240 | +#ifdef OLDIMPLEMENTATION | |
236 | 241 | |
237 | 242 | // start the debug task |
238 | 243 | BaseType_t task_result = ::xTaskCreate(Debugger::LaunchAutoHistoryTask, // task entity; |
@@ -244,6 +249,17 @@ void Debugger::AutoHistory() | ||
244 | 249 | ); |
245 | 250 | MURASAKI_ASSERT(task_result != errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY); |
246 | 251 | |
252 | +#else | |
253 | + auto_reprint_task = new murasaki::DebuggerAutoRePrintTask("DebugTask", // name of task | |
254 | + PLATFORM_CONFIG_DEBUG_TASK_STACK_SIZE, // stack depth | |
255 | + PLATFORM_CONFIG_DEBUG_TASK_PRIORITY, // execusion priority of task | |
256 | + &helpers_ // parameter to task | |
257 | + ); | |
258 | + MURASAKI_ASSERT(auto_reprint_task != nullptr); | |
259 | + | |
260 | + auto_reprint_task->Start(); | |
261 | + | |
262 | +#endif | |
247 | 263 | auto_history_enabled = true; |
248 | 264 | } |
249 | 265 |
@@ -24,6 +24,7 @@ | ||
24 | 24 | #else |
25 | 25 | #include "debuggerfifo.hpp" |
26 | 26 | #include "debuggertxtask.hpp" |
27 | +#include "debuggerautoreprinttask.hpp" | |
27 | 28 | #endif |
28 | 29 | |
29 | 30 | namespace murasaki { |
@@ -147,6 +148,8 @@ class Debugger | ||
147 | 148 | * \brief Handle to the transmission control task. |
148 | 149 | */ |
149 | 150 | murasaki::DebuggerTxTask * tx_task_; |
151 | + | |
152 | + murasaki::DebuggerAutoRePrintTask * auto_reprint_task; | |
150 | 153 | #endif |
151 | 154 | bool auto_history_enabled; |
152 | 155 | /** |