diff options
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32F37x/I2C/Makefile | 2 | ||||
-rw-r--r-- | testhal/STM32F37x/I2C/main.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/testhal/STM32F37x/I2C/Makefile b/testhal/STM32F37x/I2C/Makefile index 782a3b3d7..0090b317a 100644 --- a/testhal/STM32F37x/I2C/Makefile +++ b/testhal/STM32F37x/I2C/Makefile @@ -5,7 +5,7 @@ # Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
diff --git a/testhal/STM32F37x/I2C/main.c b/testhal/STM32F37x/I2C/main.c index 113515d39..46f190f2a 100644 --- a/testhal/STM32F37x/I2C/main.c +++ b/testhal/STM32F37x/I2C/main.c @@ -55,6 +55,7 @@ static msg_t blinker(void *arg) { palClearPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
}
+ return 0;
}
/*
@@ -95,12 +96,13 @@ int main(void) { msg = i2cMasterTransmitTimeout(&I2CD2, 0x52, cmd, sizeof(cmd),
data, sizeof(data), TIME_INFINITE);
if (msg != RDY_OK)
- chSysHalt();
+ palTogglePad(GPIOC, GPIOC_LED3);
for (i = 0; i < 256; i++) {
+ chThdSleepMilliseconds(2);
msg = i2cMasterReceiveTimeout(&I2CD2, 0x52,
data, sizeof(data), TIME_INFINITE);
if (msg != RDY_OK)
- chSysHalt();
+ palTogglePad(GPIOC, GPIOC_LED3);
}
chThdSleepMilliseconds(500);
palTogglePad(GPIOC, GPIOC_LED2);
|