• 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

Revisión1a03ab6b9245bd7cbe4a601c352ad2d76b0bcab5 (tree)
Tiempo2018-04-21 02:52:00
Autortakemasa <suikan@user...>
Commitertakemasa

Log Message

Added GetHandle() method, to help the abnormal condition.

Cambiar Resumen

Diferencia incremental

--- 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>JTAG</dbgIF>
1615 <dbgIF>SWD</dbgIF>
16+ <dbgIF>JTAG</dbgIF>
1717 <dbgDEV>ST-Link</dbgDEV>
1818 <mcuId>stm32f746zgtx</mcuId>
1919 </board>
--- a/stm32_development/murasaki/murasaki/abstracti2cmaster.hpp
+++ b/stm32_development/murasaki/murasaki/abstracti2cmaster.hpp
@@ -121,6 +121,15 @@ class AbstractI2CMaster
121121 * The error handling is depend on the implementation.
122122 */
123123 virtual bool HandleError(void * ptr)= 0;
124+ /**
125+ * @brief Return the Platform dependent device control handle.
126+ * @return Handle of device.
127+ * @details
128+ * The handle is the pointer ( or some ID ) which specify the control data of
129+ * specific device.
130+ */
131+ virtual void * GetDeviceHandle() = 0;
132+
124133 };
125134
126135 } /* namespace murasaki */
--- a/stm32_development/murasaki/murasaki/abstractspimaster.hpp
+++ b/stm32_development/murasaki/murasaki/abstractspimaster.hpp
@@ -59,6 +59,15 @@ class AbstractSpiMaster
5959 * The error handling is depend on the implementation.
6060 */
6161 virtual bool HandleError(void * ptr)= 0;
62+ /**
63+ * @brief Return the Platform dependent device control handle.
64+ * @return Handle of device.
65+ * @details
66+ * The handle is the pointer ( or some ID ) which specify the control data of
67+ * specific device.
68+ */
69+ virtual void * GetDeviceHandle() = 0;
70+
6271 };
6372
6473 } /* namespace murasaki */
--- a/stm32_development/murasaki/murasaki/abstractuart.hpp
+++ b/stm32_development/murasaki/murasaki/abstractuart.hpp
@@ -114,6 +114,14 @@ public:
114114 * The error handling is depend on the implementation.
115115 */
116116 virtual bool HandleError(void * ptr)= 0;
117+ /**
118+ * @brief Return the Platform dependent device control handle.
119+ * @return Handle of device.
120+ * @details
121+ * The handle is the pointer ( or some ID ) which specify the control data of
122+ * specific device.
123+ */
124+ virtual void * GetDeviceHandle() = 0;
117125 };
118126 /**
119127 * \}
--- a/stm32_development/murasaki/murasaki/i2cmaster.cpp
+++ b/stm32_development/murasaki/murasaki/i2cmaster.cpp
@@ -174,6 +174,11 @@ bool I2cMaster::HandleError(void* ptr)
174174 }
175175 }
176176
177+void* I2cMaster::GetDeviceHandle() {
178+ return peripheral_;
179+}
180+
177181 } /* namespace murasaki */
178182
183+
179184 #endif //HAL_I2C_MODULE_ENABLED
--- a/stm32_development/murasaki/murasaki/i2cmaster.hpp
+++ b/stm32_development/murasaki/murasaki/i2cmaster.hpp
@@ -160,6 +160,15 @@ class I2cMaster : public AbstractI2CMaster
160160 * Checks whether handle has error and if there is, print appropriate error. Then return.
161161 */
162162 virtual bool HandleError(void * ptr);
163+ /**
164+ * @brief Return the Platform dependent device control handle.
165+ * @return Handle of device.
166+ * @details
167+ * The handle is the pointer ( or some ID ) which specify the control data of
168+ * specific device.
169+ */
170+ virtual void * GetDeviceHandle();
171+
163172 protected:
164173 I2C_HandleTypeDef * const peripheral_; // SPI peripheral handle
165174 Synchronizer * const sync_; // sync between task and interrupt
--- a/stm32_development/murasaki/murasaki/spimaster.cpp
+++ b/stm32_development/murasaki/murasaki/spimaster.cpp
@@ -124,6 +124,10 @@ bool SpiMaster::HandleError(void* ptr)
124124 }
125125 }
126126
127+void* SpiMaster::GetDeviceHandle() {
128+ return peripheral_;
129+}
130+
127131
128132 } /* namespace murasaki */
129133
--- a/stm32_development/murasaki/murasaki/spimaster.hpp
+++ b/stm32_development/murasaki/murasaki/spimaster.hpp
@@ -104,6 +104,14 @@ class SpiMaster : public AbstractSpiMaster
104104 * Checks whether handle has error and if there is, print appropriate error. Then return.
105105 */
106106 virtual bool HandleError(void * ptr);
107+ /**
108+ * @brief Return the Platform dependent device control handle.
109+ * @return Handle of device.
110+ * @details
111+ * The handle is the pointer ( or some ID ) which specify the control data of
112+ * specific device.
113+ */
114+ virtual void * GetDeviceHandle();
107115 protected:
108116 SPI_HandleTypeDef * peripheral_; // SPI peripheral handler.
109117 Synchronizer * sync_; // sync between task and interrupt
--- a/stm32_development/murasaki/murasaki/uart.cpp
+++ b/stm32_development/murasaki/murasaki/uart.cpp
@@ -186,6 +186,10 @@ bool Uart::HandleError(void* const ptr)
186186 }
187187 }
188188
189+void* Uart::GetDeviceHandle() {
190+ return peripheral_;
191+}
192+
189193 } /* namespace platform */
190194
191195 #endif // HAL_UART_MODULE_ENABLED
--- a/stm32_development/murasaki/murasaki/uart.hpp
+++ b/stm32_development/murasaki/murasaki/uart.hpp
@@ -179,7 +179,15 @@ class Uart : public AbstractUart
179179 * Checks whether handle has error and if there is, print appropriate error. Then return.
180180 */
181181 virtual bool HandleError(void * const ptr);
182- protected:
182+ /**
183+ * @brief Return the Platform dependent device control handle.
184+ * @return Handle of device.
185+ * @details
186+ * The handle is the pointer ( or some ID ) which specify the control data of
187+ * specific device.
188+ */
189+ virtual void * GetDeviceHandle();
190+protected:
183191 UART_HandleTypeDef* const peripheral_;
184192
185193 Synchronizer * tx_sync_;