aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-11-27 22:18:47 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-11-27 22:18:47 +0000
commit5e18cf994d989b1bed035b98e5957e2c68e518cb (patch)
treedcb16f9929d02abe6c0c0e360f01b3cf436dd918 /os
parent47654dcc4c7b8b1cc6c1fc5ec160cd18a449c215 (diff)
downloadChibiOS-5e18cf994d989b1bed035b98e5957e2c68e518cb.tar.gz
ChibiOS-5e18cf994d989b1bed035b98e5957e2c68e518cb.tar.bz2
ChibiOS-5e18cf994d989b1bed035b98e5957e2c68e518cb.zip
I2C. Nop.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3542 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/platforms/STM32/i2c_lld.c5
-rw-r--r--os/hal/platforms/STM32F4xx/platform.mk1
2 files changed, 6 insertions, 0 deletions
diff --git a/os/hal/platforms/STM32/i2c_lld.c b/os/hal/platforms/STM32/i2c_lld.c
index c5cd2308f..93b4c4061 100644
--- a/os/hal/platforms/STM32/i2c_lld.c
+++ b/os/hal/platforms/STM32/i2c_lld.c
@@ -590,8 +590,13 @@ void i2c_lld_set_clock(I2CDriver *i2cp) {
regCR2 = i2cp->id_i2c->CR2; /* Get the I2Cx CR2 value */
regCR2 &= (uint16_t)~I2C_CR2_FREQ; /* Clear frequency FREQ[5:0] bits */
freq = (uint16_t)(STM32_PCLK1 / 1000000); /* Set frequency bits depending on pclk1 value */
+#ifdef STM32F4XX
+ chDbgCheck((freq >= 2) && (freq <= 42),
+ "i2c_lld_set_clock() : Peripheral clock freq. out of range");
+#else
chDbgCheck((freq >= 2) && (freq <= 36),
"i2c_lld_set_clock() : Peripheral clock freq. out of range");
+#endif
regCR2 |= freq;
i2cp->id_i2c->CR2 = regCR2;
diff --git a/os/hal/platforms/STM32F4xx/platform.mk b/os/hal/platforms/STM32F4xx/platform.mk
index 7acce0172..449b40731 100644
--- a/os/hal/platforms/STM32F4xx/platform.mk
+++ b/os/hal/platforms/STM32F4xx/platform.mk
@@ -9,6 +9,7 @@ PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/STM32F4xx/stm32_dma.c \
${CHIBIOS}/os/hal/platforms/STM32/serial_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/spi_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/uart_lld.c \
+ ${CHIBIOS}/os/hal/platforms/STM32/i2c_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/GPIOv2/pal_lld.c
# Required include directories