diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-04-09 06:46:57 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-04-09 06:46:57 +0000 |
commit | ac4772bb0a259439dcd64265abab122b3274b009 (patch) | |
tree | 922d965ecf90b89e4331212a4913a19b27a52bda | |
parent | 0c9bb01240ddd9f26ee9b8ff5b6d263f0c1299ff (diff) | |
download | ChibiOS-ac4772bb0a259439dcd64265abab122b3274b009.tar.gz ChibiOS-ac4772bb0a259439dcd64265abab122b3274b009.tar.bz2 ChibiOS-ac4772bb0a259439dcd64265abab122b3274b009.zip |
Fixed bug #826.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10149 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/include/hal_sdc.h | 14 | ||||
-rw-r--r-- | os/hal/src/hal_sdc.c | 4 | ||||
-rw-r--r-- | readme.txt | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/os/hal/include/hal_sdc.h b/os/hal/include/hal_sdc.h index 98a0492ab..6466b1d97 100644 --- a/os/hal/include/hal_sdc.h +++ b/os/hal/include/hal_sdc.h @@ -92,6 +92,20 @@ #if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
#define SDC_NICE_WAITING TRUE
#endif
+
+/**
+ * @brief OCR initialization constant for V20 cards.
+ */
+#if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__)
+#define SDC_INIT_OCR_V20 0x50FF8000U
+#endif
+
+/**
+ * @brief OCR initialization constant for non-V20 cards.
+ */
+#if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__)
+#define SDC_INIT_OCR 0x80100000U
+#endif
/** @} */
/*===========================================================================*/
diff --git a/os/hal/src/hal_sdc.c b/os/hal/src/hal_sdc.c index 80cbca3bf..70a85b10f 100644 --- a/os/hal/src/hal_sdc.c +++ b/os/hal/src/hal_sdc.c @@ -183,10 +183,10 @@ static bool sdc_init(SDCDriver *sdcp) { uint32_t resp[1];
if ((sdcp->cardmode & SDC_MODE_CARDTYPE_MASK) == SDC_MODE_CARDTYPE_SDV20) {
- ocr = 0xC0100000U;
+ ocr = SDC_INIT_OCR_V20;
}
else {
- ocr = 0x80100000U;
+ ocr = SDC_INIT_OCR;
}
i = 0;
diff --git a/readme.txt b/readme.txt index f6c758a81..1624614c8 100644 --- a/readme.txt +++ b/readme.txt @@ -157,6 +157,8 @@ - RT: Merged RT4.
- NIL: Merged NIL2.
- NIL: Added STM32F7 demo.
+- HAL: Fixed invalid SDC OCR initialization value (bug #826)(backported
+ to 16.1.8).
- HAL: Fixed osThreadSetPriority() returns old priority instead of a status
code (bug #823)(backported to 16.1.8).
- HAL: Fixed problem in rtcSTM32SetPeriodicWakeup() (bug #821)(backported
|