• 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

shared_fooの不要ディレクトリ削除前のもの


Commit MetaInfo

Revisionebcfb20e5ed3f6555100e9d9b7b74f5683e21968 (tree)
Time2018-03-03 10:03:49
Authortakemasa <suikan@user...>
Commitertakemasa

Log Message

Fixed wrong assertion in the AbstractTask constructor. Fixed too small
stack size in the main()

Change Summary

Incremental Difference

--- a/stm32_development/murasaki/Src/main.c
+++ b/stm32_development/murasaki/Src/main.c
@@ -141,7 +141,7 @@ int main(void)
141141
142142 /* Create the thread(s) */
143143 /* definition and creation of defaultTask */
144- osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128);
144+ osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 512);
145145 defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
146146
147147 /* USER CODE BEGIN RTOS_THREADS */
--- a/stm32_development/murasaki/Src/my_test.cpp
+++ b/stm32_development/murasaki/Src/my_test.cpp
@@ -13,6 +13,7 @@
1313
1414 // Test for debuggerfifo
1515 #include "debuggerfifo.hpp"
16+#include "debuggertxtask.hpp"
1617
1718 #define DEBUGGER_OUT true
1819
@@ -21,10 +22,14 @@
2122 murasaki::Platform murasaki::platform;
2223 murasaki::Debugger * murasaki::debugger;
2324
25+
26+
2427 #define MSG1 "A quick brown fox jumps over the lazy dog."
2528
2629 static int counter;
2730 static murasaki::DebuggerFifo * test_fifo;
31+static murasaki::AbstractTask * tx_task;
32+static murasaki::LoggingHelpers helpers;
2833
2934 // Initialize the platfrom variables. This have to be doen before
3035 // using other murasaki funciton.
@@ -63,8 +68,19 @@ void InitTestUart(UART_HandleTypeDef * uart_handle, SPI_HandleTypeDef * spi_hand
6368 test_fifo = new murasaki::DebuggerFifo(32);
6469 MURASAKI_ASSERT(test_fifo != nullptr);
6570
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+
6680 unsigned int copied = test_fifo->Put(reinterpret_cast<const uint8_t *>(MSG1), sizeof(MSG1));
6781 murasaki::debugger->printf("FIFO.Put(), %d data taransfered\n\r", copied);
82+
83+
6884 }
6985
7086 uint8_t tx_buffer[1] = { 0x55 }, rx_buffer[1];
@@ -76,6 +92,7 @@ void DoTestUart(void)
7692 murasaki::platform.spi_master->Transfer(murasaki::platform.slave_1, tx_buffer, rx_buffer, 1);
7793 #endif
7894
95+#if 0
7996 char data[10];
8097 unsigned int copied = test_fifo->Get(reinterpret_cast<uint8_t *>(data), sizeof(data));
8198 if (copied == 0)
@@ -87,7 +104,7 @@ void DoTestUart(void)
87104 else {
88105 murasaki::debugger->printf("FIFO.Get(), %d data taransfered : '%10s'\n\r", copied, data);
89106 }
90-
107+#endif
91108 // by murasaki debugging output. You can use this in both task and interrupt context.
92109 // non blocking
93110 // murasaki::debugger->printf(MSG, counter);
--- a/stm32_development/murasaki/murasaki/abstracttask.cpp
+++ b/stm32_development/murasaki/murasaki/abstracttask.cpp
@@ -17,7 +17,7 @@ AbstractTask::AbstractTask(const char * task_name, unsigned short stack_depth, U
1717 priority_(priority)
1818 {
1919 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.
2121 MURASAKI_ASSERT(configMAX_PRIORITIES > priority); // priority is allowed till ( configMAX_PRIORITIES - 1 )
2222 MURASAKI_ASSERT(0 < priority); // priority 0 is idle task
2323 task_ = 0;