• 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

TWIペリフェラルを使ってI2Cプロトコルを制御する


Commit MetaInfo

Revision18d3c3e43e8ac282b13d40fd19981c622af369ba (tree)
Time2012-08-01 07:31:56
Authortakemasa <suikan@sour...>
Commitertakemasa

Log Message

ポインタのデレファレンス・ミスを修正

Change Summary

Incremental Difference

--- a/i2c-test/i2c_subsystem.c
+++ b/i2c-test/i2c_subsystem.c
@@ -161,7 +161,7 @@ int i2c_master_write_read( int peripheral, int slave, unsigned char write_data[]
161161 twi->state = I2C_XMT_NEXT_BYTE;
162162 break;
163163 case I2C_XMT_NEXT_BYTE :
164- twi->xmt_data8 = *(wptr++); // 1バイト送信
164+ *twi->xmt_data8 = *(wptr++); // 1バイト送信
165165 twi->state = I2C_XMT_WAIT; // 次の送信待
166166 break;
167167 case I2C_RCV_WAIT :
@@ -181,9 +181,11 @@ int i2c_master_write_read( int peripheral, int slave, unsigned char write_data[]
181181 twi->state = I2C_RCV_NEXT_BYTE;
182182 break;
183183 case I2C_RCV_NEXT_BYTE :
184- *(wptr++) = twi->rcv_data8; // 1バイト受信
184+ *(wptr++) = *twi->rcv_data8; // 1バイト受信
185185 twi->state = I2C_RCV_WAIT; // 次の受信待
186186 break;
187+ case I2C_EXIT : // ダミー。ここには来ずにループを抜ける。
188+ break;
187189 }
188190 } while ( twi->state != I2C_EXIT );
189191