• 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

Revisão85db45f5944575423769e750f06885791b00a246 (tree)
Hora2018-04-21 03:48:19
Autortakemasa <suikan@user...>
Commitertakemasa

Mensagem de Log

Implements the post motem process to debuggerfifo class. In this
condition, no syncronizaiton is taken inside FIFO.

Mudança Sumário

Diff

--- a/stm32_development/murasaki/NUCLEO-F746ZG.xml
+++ b/stm32_development/murasaki/NUCLEO-F746ZG.xml
@@ -12,8 +12,8 @@
1212 <targetDefinitions>
1313 <board id="nucleo-f746zg">
1414 <name>NUCLEO-F746ZG</name>
15- <dbgIF>SWD</dbgIF>
1615 <dbgIF>JTAG</dbgIF>
16+ <dbgIF>SWD</dbgIF>
1717 <dbgDEV>ST-Link</dbgDEV>
1818 <mcuId>stm32f746zgtx</mcuId>
1919 </board>
--- a/stm32_development/murasaki/murasaki/debuggerfifo.cpp
+++ b/stm32_development/murasaki/murasaki/debuggerfifo.cpp
@@ -26,6 +26,9 @@ DebuggerFifo::DebuggerFifo(unsigned int buffer_size)
2626 // Clean up buffer.
2727 // This is essential to outptu clear data when ReWind() is called at very initial stage.
2828 ::memset(buffer_, ' ', size_of_buffer_);
29+
30+ // Initial condition is considered healthy.
31+ post_motem_ = false;
2932 }
3033
3134 DebuggerFifo::~DebuggerFifo()
@@ -43,18 +46,23 @@ void DebuggerFifo::NotifyData()
4346
4447 unsigned int DebuggerFifo::Get(uint8_t data[], unsigned int size)
4548 {
46- MURASAKI_ASSERT(murasaki::IsTaskContext())
47- unsigned int ret_val;
49+ unsigned int ret_val;
4850
49- taskENTER_CRITICAL();
50- {
51- ret_val = inherited::Get(data, size);
52- }
53- taskEXIT_CRITICAL();
51+ if (! post_motem_){ // if normal condition
52+ MURASAKI_ASSERT(murasaki::IsTaskContext())
53+
54+ taskENTER_CRITICAL();
55+ {
56+ ret_val = inherited::Get(data, size);
57+ }
58+ taskEXIT_CRITICAL();
5459
55- // wait for the arriaval of the data.
56- if ( ret_val == 0)
57- sync_->Wait(static_cast<murasaki::WaitMilliSeconds>(1000 / portTICK_PERIOD_MS));
60+ // wait for the arriaval of the data.
61+ if ( ret_val == 0)
62+ sync_->Wait(static_cast<murasaki::WaitMilliSeconds>(1000 / portTICK_PERIOD_MS));
63+ }
64+ else // if undefined exception happend, no sync processing
65+ ret_val = inherited::Get(data, size);
5866
5967 return ret_val;
6068
@@ -69,4 +77,9 @@ void DebuggerFifo::ReWind()
6977 portENABLE_INTERRUPTS();
7078 }
7179
80+void DebuggerFifo::SetPostMotem() {
81+ post_motem_ = true;
82+}
83+
7284 } /* namespace murasaki */
85+
--- a/stm32_development/murasaki/murasaki/debuggerfifo.hpp
+++ b/stm32_development/murasaki/murasaki/debuggerfifo.hpp
@@ -64,12 +64,20 @@ class DebuggerFifo : public AbstractFifo
6464 * @brief Mark all the data inside the internal buffer as "not sent". Thread safe.
6565 */
6666 virtual void ReWind();
67+ /**
68+ * @brief Transit to the post motem mode.
69+ * @details
70+ * In this mode, FIFO doesn't sync between the put and get method.
71+ * Actually, this mode assumes nobody send messayge by Put()
72+ *
73+ */
74+ virtual void SetPostMotem();
6775 private:
6876 // Alias to call the parent member function.
6977 typedef AbstractFifo inherited;
7078 // For the communication between generator / consumer.
7179 Synchronizer * const sync_;
72-
80+ bool post_motem_;
7381 };
7482
7583 /**