shared_fooの不要ディレクトリ削除前のもの
Revision | ebcfb20e5ed3f6555100e9d9b7b74f5683e21968 (tree) |
---|---|
Time | 2018-03-03 10:03:49 |
Author | takemasa <suikan@user...> |
Commiter | takemasa |
Fixed wrong assertion in the AbstractTask constructor. Fixed too small
stack size in the main()
@@ -141,7 +141,7 @@ int main(void) | ||
141 | 141 | |
142 | 142 | /* Create the thread(s) */ |
143 | 143 | /* definition and creation of defaultTask */ |
144 | - osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128); | |
144 | + osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 512); | |
145 | 145 | defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL); |
146 | 146 | |
147 | 147 | /* USER CODE BEGIN RTOS_THREADS */ |
@@ -13,6 +13,7 @@ | ||
13 | 13 | |
14 | 14 | // Test for debuggerfifo |
15 | 15 | #include "debuggerfifo.hpp" |
16 | +#include "debuggertxtask.hpp" | |
16 | 17 | |
17 | 18 | #define DEBUGGER_OUT true |
18 | 19 |
@@ -21,10 +22,14 @@ | ||
21 | 22 | murasaki::Platform murasaki::platform; |
22 | 23 | murasaki::Debugger * murasaki::debugger; |
23 | 24 | |
25 | + | |
26 | + | |
24 | 27 | #define MSG1 "A quick brown fox jumps over the lazy dog." |
25 | 28 | |
26 | 29 | static int counter; |
27 | 30 | static murasaki::DebuggerFifo * test_fifo; |
31 | +static murasaki::AbstractTask * tx_task; | |
32 | +static murasaki::LoggingHelpers helpers; | |
28 | 33 | |
29 | 34 | // Initialize the platfrom variables. This have to be doen before |
30 | 35 | // using other murasaki funciton. |
@@ -63,8 +68,19 @@ void InitTestUart(UART_HandleTypeDef * uart_handle, SPI_HandleTypeDef * spi_hand | ||
63 | 68 | test_fifo = new murasaki::DebuggerFifo(32); |
64 | 69 | MURASAKI_ASSERT(test_fifo != nullptr); |
65 | 70 | |
71 | + helpers.logger = murasaki::platform.logger; | |
72 | + helpers.fifo = test_fifo; | |
73 | + | |
74 | + tx_task = new murasaki::DebuggerTxTask("Debug_tx", | |
75 | + PLATFORM_CONFIG_DEBUG_TASK_STACK_SIZE, | |
76 | + PLATFORM_CONFIG_DEBUG_TASK_PRIORITY, &helpers); | |
77 | + MURASAKI_ASSERT(tx_task != nullptr); | |
78 | + | |
79 | + | |
66 | 80 | unsigned int copied = test_fifo->Put(reinterpret_cast<const uint8_t *>(MSG1), sizeof(MSG1)); |
67 | 81 | murasaki::debugger->printf("FIFO.Put(), %d data taransfered\n\r", copied); |
82 | + | |
83 | + | |
68 | 84 | } |
69 | 85 | |
70 | 86 | uint8_t tx_buffer[1] = { 0x55 }, rx_buffer[1]; |
@@ -76,6 +92,7 @@ void DoTestUart(void) | ||
76 | 92 | murasaki::platform.spi_master->Transfer(murasaki::platform.slave_1, tx_buffer, rx_buffer, 1); |
77 | 93 | #endif |
78 | 94 | |
95 | +#if 0 | |
79 | 96 | char data[10]; |
80 | 97 | unsigned int copied = test_fifo->Get(reinterpret_cast<uint8_t *>(data), sizeof(data)); |
81 | 98 | if (copied == 0) |
@@ -87,7 +104,7 @@ void DoTestUart(void) | ||
87 | 104 | else { |
88 | 105 | murasaki::debugger->printf("FIFO.Get(), %d data taransfered : '%10s'\n\r", copied, data); |
89 | 106 | } |
90 | - | |
107 | +#endif | |
91 | 108 | // by murasaki debugging output. You can use this in both task and interrupt context. |
92 | 109 | // non blocking |
93 | 110 | // murasaki::debugger->printf(MSG, counter); |
@@ -17,7 +17,7 @@ AbstractTask::AbstractTask(const char * task_name, unsigned short stack_depth, U | ||
17 | 17 | priority_(priority) |
18 | 18 | { |
19 | 19 | MURASAKI_ASSERT(NULL!= task_name); |
20 | - MURASAKI_ASSERT(0 == stack_depth); // reject only very explict fault. | |
20 | + MURASAKI_ASSERT(0 != stack_depth); // reject only very explict fault. | |
21 | 21 | MURASAKI_ASSERT(configMAX_PRIORITIES > priority); // priority is allowed till ( configMAX_PRIORITIES - 1 ) |
22 | 22 | MURASAKI_ASSERT(0 < priority); // priority 0 is idle task |
23 | 23 | task_ = 0; |