aboutsummaryrefslogtreecommitdiffstats
path: root/testhal
diff options
context:
space:
mode:
Diffstat (limited to 'testhal')
-rw-r--r--testhal/STM32/I2C/i2c_pns.c11
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);