@@ -107,9 +107,9 @@ static DSTATUS SD_CheckStatus(BYTE lun)
107107{
108108 Stat = STA_NOINIT ;
109109
110- #if defined ( STM32F4xx ) || defined( STM32F7xx ) || defined( STM32L4xx )
110+ #ifndef STM32L1xx
111111 if (BSP_SD_GetCardState () == MSD_OK )
112- #else /* (STM32F1xx) || defined(STM32F2xx) || defined( STM32L1xx) */
112+ #else /* STM32L1xx */
113113 if (BSP_SD_GetStatus () == MSD_OK )
114114#endif
115115 {
@@ -160,7 +160,7 @@ DSTATUS SD_status(BYTE lun)
160160 */
161161DRESULT SD_read (BYTE lun , BYTE * buff , DWORD sector , UINT count )
162162{
163- #if defined ( STM32F4xx ) || defined( STM32F7xx ) || defined( STM32L4xx )
163+ #ifndef STM32L1xx
164164 DRESULT res = RES_ERROR ;
165165
166166 if (BSP_SD_ReadBlocks ((uint32_t * )buff ,
@@ -173,7 +173,7 @@ DRESULT SD_read(BYTE lun, BYTE *buff, DWORD sector, UINT count)
173173 }
174174 res = RES_OK ;
175175 }
176- #else /* (STM32F1xx) || defined(STM32F2xx) || defined( STM32L1xx) */
176+ #else /* STM32L1xx */
177177 DRESULT res = RES_OK ;
178178
179179 if (BSP_SD_ReadBlocks ((uint32_t * )buff ,
@@ -198,7 +198,7 @@ DRESULT SD_read(BYTE lun, BYTE *buff, DWORD sector, UINT count)
198198#if _USE_WRITE == 1
199199DRESULT SD_write (BYTE lun , const BYTE * buff , DWORD sector , UINT count )
200200{
201- #if defined ( STM32F4xx ) || defined( STM32F7xx ) || defined( STM32L4xx )
201+ #ifndef STM32L1xx
202202 DRESULT res = RES_ERROR ;
203203
204204 if (BSP_SD_WriteBlocks ((uint32_t * )buff ,
@@ -211,7 +211,7 @@ DRESULT SD_write(BYTE lun, const BYTE *buff, DWORD sector, UINT count)
211211 }
212212 res = RES_OK ;
213213 }
214- #else /* (STM32F1xx) || defined(STM32F2xx) || defined( STM32L1xx) */
214+ #else /* STM32L1xx */
215215 DRESULT res = RES_OK ;
216216
217217 if (BSP_SD_WriteBlocks ((uint32_t * )buff ,
@@ -236,9 +236,9 @@ DRESULT SD_write(BYTE lun, const BYTE *buff, DWORD sector, UINT count)
236236DRESULT SD_ioctl (BYTE lun , BYTE cmd , void * buff )
237237{
238238 DRESULT res = RES_ERROR ;
239- #if defined ( STM32F4xx ) || defined( STM32F7xx ) || defined( STM32L4xx )
239+ #ifndef STM32L1xx
240240 BSP_SD_CardInfo CardInfo ;
241- #else /* (STM32F1xx) || defined(STM32F2xx) || defined( STM32L1xx) */
241+ #else /* STM32L1xx */
242242 SD_CardInfo CardInfo ;
243243#endif
244244 if (Stat & STA_NOINIT ) return RES_NOTRDY ;
@@ -253,31 +253,31 @@ DRESULT SD_ioctl(BYTE lun, BYTE cmd, void *buff)
253253 /* Get number of sectors on the disk (DWORD) */
254254 case GET_SECTOR_COUNT :
255255 BSP_SD_GetCardInfo (& CardInfo );
256- #if defined ( STM32F4xx ) || defined( STM32F7xx ) || defined( STM32L4xx )
256+ #ifndef STM32L1xx
257257 * (DWORD * )buff = CardInfo .LogBlockNbr ;
258- #else /* (STM32F1xx) || defined(STM32F2xx) || defined( STM32L1xx) */
258+ #else /* STM32L1xx */
259259 * (DWORD * )buff = CardInfo .CardCapacity / SD_DEFAULT_BLOCK_SIZE ;
260260#endif
261261 res = RES_OK ;
262262 break ;
263263
264264 /* Get R/W sector size (WORD) */
265265 case GET_SECTOR_SIZE :
266- #if defined ( STM32F4xx ) || defined( STM32F7xx ) || defined( STM32L4xx )
266+ #ifndef STM32L1xx
267267 BSP_SD_GetCardInfo (& CardInfo );
268268 * (WORD * )buff = CardInfo .LogBlockSize ;
269- #else /* (STM32F1xx) || defined(STM32F2xx) || defined( STM32L1xx) */
269+ #else /* STM32L1xx */
270270 * (WORD * )buff = SD_DEFAULT_BLOCK_SIZE ;
271271#endif
272272 res = RES_OK ;
273273 break ;
274274
275275 /* Get erase block size in unit of sector (DWORD) */
276276 case GET_BLOCK_SIZE :
277- #if defined ( STM32F4xx ) || defined( STM32F7xx ) || defined( STM32L4xx )
277+ #ifndef STM32L1xx
278278 BSP_SD_GetCardInfo (& CardInfo );
279279 * (DWORD * )buff = CardInfo .LogBlockSize / SD_DEFAULT_BLOCK_SIZE ;
280- #else /* (STM32F1xx) || defined(STM32F2xx) || defined( STM32L1xx) */
280+ #else /* STM32L1xx */
281281 * (DWORD * )buff = SD_DEFAULT_BLOCK_SIZE ;
282282#endif
283283 res = RES_OK ;
0 commit comments