diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-06-18 13:35:26 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-06-18 13:35:26 +0000 |
commit | f3e571839bd7649073664d1c2c4ea3842695b6d5 (patch) | |
tree | 0397ef728add30dec186fdce9b33676c0ceab4e9 /testhal | |
parent | 350ae0a1a9721b8889b038cf2fce6a88f1c288e3 (diff) | |
download | ChibiOS-f3e571839bd7649073664d1c2c4ea3842695b6d5.tar.gz ChibiOS-f3e571839bd7649073664d1c2c4ea3842695b6d5.tar.bz2 ChibiOS-f3e571839bd7649073664d1c2c4ea3842695b6d5.zip |
I2C. Code cleanups.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3056 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32/I2C/i2c_pns.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/testhal/STM32/I2C/i2c_pns.c b/testhal/STM32/I2C/i2c_pns.c index fe82fcb4e..63f7d99bd 100644 --- a/testhal/STM32/I2C/i2c_pns.c +++ b/testhal/STM32/I2C/i2c_pns.c @@ -8,7 +8,7 @@ #include "max1236.h"
/* I2C1 */
-static I2CConfig i2cfg1 = {
+static const I2CConfig i2cfg1 = {
OPMODE_I2C,
100000,
STD_DUTY_CYCLE,
@@ -19,7 +19,7 @@ static I2CConfig i2cfg1 = { };
/* I2C2 */
-static I2CConfig i2cfg2 = {
+static const I2CConfig i2cfg2 = {
OPMODE_I2C,
100000,
STD_DUTY_CYCLE,
@@ -36,14 +36,7 @@ void I2CInit_pns(void){ i2cInit();
i2cStart(&I2CD1, &i2cfg1);
- while(I2CD1.id_state != I2C_READY){ // wait ready status
- chThdSleepMilliseconds(1);
- }
-
i2cStart(&I2CD2, &i2cfg2);
- while(I2CD2.id_state != I2C_READY){ // wait ready status
- chThdSleepMilliseconds(1);
- }
/* tune ports for I2C1*/
palSetPadMode(IOPORT2, 6, PAL_MODE_STM32_ALTERNATE_OPENDRAIN);
|