Skip to content

Commit 99d5bc8

Browse files
committed
Fix some warnings
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 9a603c7 commit 99d5bc8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/SD.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,9 @@ uint8_t File::isDirectory()
593593
{
594594
return TRUE;
595595
}
596-
else
597-
{
598-
return FALSE;
599-
}
600596
}
597+
// Assume not a directory
598+
return FALSE;
601599
}
602600

603601
File File::openNextFile(uint8_t mode)

src/bsp_sd.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ uint8_t BSP_SD_IsDetected(void)
269269
*/
270270
uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumOfBlocks)
271271
{
272-
if(HAL_SD_ReadBlocks(&uSdHandle, pData, ReadAddr, BlockSize, NumOfBlocks) != SD_OK)
272+
if(HAL_SD_ReadBlocks(&uSdHandle, (uint8_t *)pData, ReadAddr, BlockSize, NumOfBlocks) != SD_OK)
273273
{
274274
return MSD_ERROR;
275275
}
@@ -289,7 +289,7 @@ uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint64_t ReadAddr, uint32_t BlockSize
289289
*/
290290
uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumOfBlocks)
291291
{
292-
if(HAL_SD_WriteBlocks(&uSdHandle, pData, WriteAddr, BlockSize, NumOfBlocks) != SD_OK)
292+
if(HAL_SD_WriteBlocks(&uSdHandle, (uint8_t *)pData, WriteAddr, BlockSize, NumOfBlocks) != SD_OK)
293293
{
294294
return MSD_ERROR;
295295
}
@@ -324,6 +324,8 @@ uint8_t BSP_SD_Erase(uint64_t StartAddr, uint64_t EndAddr)
324324
*/
325325
__weak void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params)
326326
{
327+
UNUSED(hsd);
328+
UNUSED(Params);
327329
GPIO_InitTypeDef gpio_init_structure;
328330

329331
/* Enable SDIO clock */
@@ -357,6 +359,8 @@ __weak void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params)
357359
*/
358360
__weak void BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params)
359361
{
362+
UNUSED(hsd);
363+
UNUSED(Params);
360364
GPIO_InitTypeDef gpio_init_structure;
361365

362366
SD_DETECT_GPIO_CLK_ENABLE();
@@ -376,6 +380,8 @@ __weak void BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params)
376380
*/
377381
__weak void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params)
378382
{
383+
UNUSED(hsd);
384+
UNUSED(Params);
379385
/* Disable NVIC for SDIO interrupts */
380386
HAL_NVIC_DisableIRQ(SDIO_IRQn);
381387

0 commit comments

Comments
 (0)