• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

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


Commit MetaInfo

修訂119ff6ae1b867d75806aea8ebb65576de3f3cf0e (tree)
時間2018-02-17 16:18:43
作者takemasa <suikan@user...>
Commitertakemasa

Log Message

Modified MURASAKI_ASSERT to stop at the assertion failure.

Change Summary

差異

--- a/stm32_development/murasaki/Src/my_test.cpp
+++ b/stm32_development/murasaki/Src/my_test.cpp
@@ -74,6 +74,7 @@ void DoTestUart(void)
7474 // by murasaki debugging output. You can use this in both task and interrupt context.
7575 // non blocking
7676 murasaki::debugger->printf(MSG, counter);
77+ MURASAKI_ASSERT(10 > counter);
7778 #else
7879 // by murasaki peripheral encapsulating class. You can use this only in the task conetxt.
7980 // blocking
--- a/stm32_development/murasaki/murasaki/murasaki_assert.hpp
+++ b/stm32_development/murasaki/murasaki/murasaki_assert.hpp
@@ -13,7 +13,7 @@
1313 #include "murasaki_defs.hpp"
1414 #include "debug.hpp"
1515
16-#define MURASAKI_ASSERT_MSG "Assertion in function %s(), at line %d of file %s : %s \n\r"
16+#define MURASAKI_ASSERT_MSG "!! Assertion failure in function %s(), at line %d of file %s !!\n\r"
1717 /**
1818 * \def MURASAKI_ASSERT
1919 * \param COND Condition as bool type.
@@ -21,6 +21,8 @@
2121 * \details
2222 * Print the COND expression to the logging port if COND is false. Do nothing if CODN is true.
2323 *
24+ * After printing the assertion failure message, currently running task is suspended.
25+ * If it is the interrupt context, just continue the processing.
2426 *
2527 * This assertion do nothing if programmer defines \ref MURASAKI_CONFIG_NODEBUG macro as true.
2628 * This macro is defined in the file \ref platform_config.hpp.
@@ -32,7 +34,13 @@
3234 #else
3335 #define MURASAKI_ASSERT( COND )\
3436 if ( ! (COND) )\
35- murasaki::debugger->printf(MURASAKI_ASSERT_MSG, __func__, __LINE__,__FILE__, #COND);
37+ {\
38+ murasaki::debugger->printf("--------------------\n\r");\
39+ murasaki::debugger->printf(MURASAKI_ASSERT_MSG, __func__, __LINE__,__FILE__ );\
40+ murasaki::debugger->printf("Fail expression : %s\r\n", #COND);\
41+ if ( murasaki::isTaskContext() )\
42+ vTaskSuspend(NULL);\
43+ }
3644 #endif
3745
3846 namespace murasaki {