• 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

Revisiona543dc1d56217db28041f849aa514310462e56de (tree)
Time2018-04-27 19:20:13
Authortakemasa <suikan@user...>
Commitertakemasa

Log Message

Refactored SpiMastered.

Changed internal variable to consntant to avoid problems.

Change Summary

Incremental Difference

--- a/stm32_development/murasaki/murasaki/spimaster.cpp
+++ b/stm32_development/murasaki/murasaki/spimaster.cpp
@@ -13,17 +13,15 @@
1313
1414 namespace murasaki {
1515
16-SpiMaster::SpiMaster(SPI_HandleTypeDef * spi_handle)
16+SpiMaster::SpiMaster(SPI_HandleTypeDef * spi_handle):
17+ peripheral_(spi_handle),
18+ sync_(new murasaki::Synchronizer),
19+ critical_section_(new murasaki::CriticalSection)
1720 {
1821 // Setup internal variable with given uart structure.
1922
20- MURASAKI_ASSERT(nullptr != spi_handle)
21- peripheral_ = spi_handle;
22-
23- sync_ = new Synchronizer;
23+ MURASAKI_ASSERT(nullptr != peripheral_)
2424 MURASAKI_ASSERT(nullptr != sync_)
25-
26- critical_section_ = new CriticalSection;
2725 MURASAKI_ASSERT(nullptr != critical_section_)
2826
2927 }
--- a/stm32_development/murasaki/murasaki/spimaster.hpp
+++ b/stm32_development/murasaki/murasaki/spimaster.hpp
@@ -114,9 +114,9 @@ class SpiMaster : public AbstractSpiMaster
114114 */
115115 virtual void * GetPeripheralHandle();
116116 protected:
117- SPI_HandleTypeDef * peripheral_; // SPI peripheral handler.
118- Synchronizer * sync_; // sync between task and interrupt
119- CriticalSection * critical_section_; // protect memberfunction
117+ SPI_HandleTypeDef * const peripheral_; // SPI peripheral handler.
118+ Synchronizer * const sync_; // sync between task and interrupt
119+ CriticalSection * const critical_section_; // protect memberfunction
120120 };
121121
122122 } /* namespace murasaki */