Skip to content

Commit

Permalink
Fix random warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mmosca committed Dec 9, 2024
1 parent af6ac5b commit e9d0684
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ typedef struct __DMA_HandleTypeDef
* @{
*/
#define DMA_PERIPH_TO_MEMORY 0x00000000U /*!< Peripheral to memory direction */
#ifdef DMA_MEMORY_TO_PERIPH
#undef DMA_MEMORY_TO_PERIPH
#endif
#define DMA_MEMORY_TO_PERIPH DMA_SxCR_DIR_0 /*!< Memory to peripheral direction */
#define DMA_MEMORY_TO_MEMORY DMA_SxCR_DIR_1 /*!< Memory to memory direction */
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ void USBD_GetString(uint8_t *desc, uint8_t *unicode, uint16_t *len)
}

pdesc = desc;
*len = MIN(USBD_MAX_STR_DESC_SIZ, ((uint16_t)USBD_GetLen(pdesc) * 2U) + 2U);
*len = MIN((uint16_t)USBD_MAX_STR_DESC_SIZ, ((uint16_t)USBD_GetLen(pdesc) * 2U) + 2U);

unicode[idx] = *(uint8_t *)len;
idx++;
Expand Down
9 changes: 9 additions & 0 deletions src/main/drivers/sdcard/sdmmc_sdio_f7xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,27 @@
/* Define(s) --------------------------------------------------------------------------------------------------------*/

//#define DMA_CHANNEL_4 ((uint32_t)0x08000000)
/*
#ifndef DMA_MEMORY_TO_PERIPH
#define DMA_MEMORY_TO_PERIPH ((uint32_t)DMA_SxCR_DIR_0)
#endif
//#define DMA_PERIPH_TO_MEMORY ((uint32_t)0x00)
#ifndef DMA_MINC_ENABLE
#define DMA_MINC_ENABLE ((uint32_t)DMA_SxCR_MINC)
#endif
#ifndef DMA_MDATAALIGN_WORD
#define DMA_MDATAALIGN_WORD ((uint32_t)DMA_SxCR_MSIZE_1)
#endif
#define DMA_PDATAALIGN_WORD ((uint32_t)DMA_SxCR_PSIZE_1)
#define DMA_PRIORITY_LOW ((uint32_t)0x00000000U)
#define DMA_PRIORITY_MEDIUM ((uint32_t)DMA_SxCR_PL_0)
#define DMA_PRIORITY_HIGH ((uint32_t)DMA_SxCR_PL_1)
#define DMA_PRIORITY_VERY_HIGH ((uint32_t)DMA_SxCR_PL)
#define DMA_MBURST_INC4 ((uint32_t)DMA_SxCR_MBURST_0)
#define DMA_PBURST_INC4 ((uint32_t)DMA_SxCR_PBURST_0)
*/

#define BLOCK_SIZE ((uint32_t)(512))

Expand Down
20 changes: 19 additions & 1 deletion src/main/vcp_hal/usbd_cdc_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ uint32_t UserTxBufPtrOut = 0; /* Increment this pointer or roll it back to
uint32_t rxAvailable = 0;
uint8_t* rxBuffPtr = NULL;

uint32_t txAvailable = 0;
uint8_t* txBuffPtr = NULL;

/* TIM handler declaration */
TIM_HandleTypeDef TimHandle;
/* USB handler declaration */
Expand All @@ -98,6 +101,7 @@ static int8_t CDC_Itf_Init(void);
static int8_t CDC_Itf_DeInit(void);
static int8_t CDC_Itf_Control(uint8_t cmd, uint8_t* pbuf, uint16_t length);
static int8_t CDC_Itf_Receive(uint8_t* pbuf, uint32_t *Len);
static int8_t CDC_Itf_TransmitCplt(uint8_t* pbuf, uint32_t *Len, uint8_t pEnum);

static void TIM_Config(void);
static void Error_Handler(void);
Expand All @@ -107,7 +111,10 @@ USBD_CDC_ItfTypeDef USBD_CDC_fops =
CDC_Itf_Init,
CDC_Itf_DeInit,
CDC_Itf_Control,
CDC_Itf_Receive
CDC_Itf_Receive,
#ifdef STM32F7
CDC_Itf_TransmitCplt,
#endif
};


Expand Down Expand Up @@ -296,6 +303,17 @@ static int8_t CDC_Itf_Receive(uint8_t* Buf, uint32_t *Len)
return (USBD_OK);
}

#ifdef STM32F7
static int8_t CDC_Itf_TransmitCplt(uint8_t *Buf, uint32_t *Len, uint8_t pEnum)
{
UNUSED(Buf);
UNUSED(Len);
UNUSED(pEnum);

return (USBD_OK);
}
#endif

/**
* @brief TIM_Config: Configure TIMusb timer
* @param None.
Expand Down

0 comments on commit e9d0684

Please sign in to comment.