aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-12 23:34:41 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-08-12 23:34:41 +0000
commitb058afec841760addc1d1fdabed3843cce9065d0 (patch)
tree725c5ce8923e4d6eaa56763efdff0b0702527891 /os
parent63351a3680884979bd573bc8b66d6e53be4cc2ca (diff)
downloadChibiOS-b058afec841760addc1d1fdabed3843cce9065d0.tar.gz
ChibiOS-b058afec841760addc1d1fdabed3843cce9065d0.tar.bz2
ChibiOS-b058afec841760addc1d1fdabed3843cce9065d0.zip
I2C. STM32F1xx define clause fixed.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4560 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/platforms/STM32/I2Cv1/i2c_lld.c4
-rw-r--r--os/hal/platforms/STM32/I2Cv1/i2c_lld.h8
2 files changed, 10 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32/I2Cv1/i2c_lld.c b/os/hal/platforms/STM32/I2Cv1/i2c_lld.c
index 5c18db706..873c11a51 100644
--- a/os/hal/platforms/STM32/I2Cv1/i2c_lld.c
+++ b/os/hal/platforms/STM32/I2Cv1/i2c_lld.c
@@ -754,7 +754,7 @@ msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, i2caddr_t addr,
I2C_TypeDef *dp = i2cp->i2c;
VirtualTimer vt;
-#if defined(STM32F1XX)
+#if defined(STM32F1XX_I2C)
chDbgCheck((rxbytes > 1), "i2c_lld_master_receive_timeout");
#endif
@@ -835,7 +835,7 @@ msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, i2caddr_t addr,
I2C_TypeDef *dp = i2cp->i2c;
VirtualTimer vt;
-#if defined(STM32F1XX)
+#if defined(STM32F1XX_I2C)
chDbgCheck(((rxbytes == 0) || ((rxbytes > 1) && (rxbuf != NULL))),
"i2c_lld_master_transmit_timeout");
#endif
diff --git a/os/hal/platforms/STM32/I2Cv1/i2c_lld.h b/os/hal/platforms/STM32/I2Cv1/i2c_lld.h
index 55870cb37..9b6a9c477 100644
--- a/os/hal/platforms/STM32/I2Cv1/i2c_lld.h
+++ b/os/hal/platforms/STM32/I2Cv1/i2c_lld.h
@@ -199,6 +199,14 @@
#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
#endif /* !STM32_ADVANCED_DMA*/
+
+/* Flag for the whole STM32F1XX family. */
+#if defined(STM32F10X_LD_VL) || defined(STM32F10X_MD_VL) || \
+ defined(STM32F10X_LD) || defined(STM32F10X_MD) || \
+ defined(STM32F10X_HD) || defined(STM32F10X_XL) || \
+ defined(STM32F10X_CL)
+#define STM32F1XX_I2C
+#endif
/** @} */
/*===========================================================================*/