Skip to content

Commit

Permalink
Fix compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Jan 4, 2024
1 parent 87f3e3e commit 2185446
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
31 changes: 15 additions & 16 deletions lib_stusb/STM32_USB_Device_Library/Class/CCID/src/usbd_ccid_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,28 +231,28 @@ uint8_t PC_to_RDR_XfrBlock(void)
if (error != 0)
return error;

if (G_io_ccid.bulk_header.bulkout.dwLength > IO_CCID_DATA_BUFFER_SIZE)
{ /* Check amount of Data Sent by Host is > than memory allocated ? */
if (G_io_ccid.bulk_header.bulkout.dwLength > IO_CCID_DATA_BUFFER_SIZE)
{ /* Check amount of Data Sent by Host is > than memory allocated ? */

return SLOTERROR_BAD_DWLENGTH;
}
return SLOTERROR_BAD_DWLENGTH;
}


/* wLevelParameter = Size of expected data to be returned by the
bulk-IN endpoint */
expectedLength = (G_io_ccid.bulk_header.bulkout.bSpecific_2 << 8) |
G_io_ccid.bulk_header.bulkout.bSpecific_1;
/* wLevelParameter = Size of expected data to be returned by the
bulk-IN endpoint */
expectedLength = (G_io_ccid.bulk_header.bulkout.bSpecific_2 << 8) |
G_io_ccid.bulk_header.bulkout.bSpecific_1;

reqlen = G_io_ccid.bulk_header.bulkout.dwLength;

G_io_ccid.bulk_header.bulkin.dwLength = (uint16_t)expectedLength;
reqlen = G_io_ccid.bulk_header.bulkout.dwLength;

G_io_ccid.bulk_header.bulkin.dwLength = (uint16_t)expectedLength;

error = SC_XferBlock(&G_io_ccid_data_buffer[0],
reqlen,
&expectedLength);

if (error != SLOT_NO_ERROR)
error = SC_XferBlock(&G_io_ccid_data_buffer[0],
reqlen,
&expectedLength);

if (error != SLOT_NO_ERROR)
{
CCID_UpdateCommandStatus(BM_COMMAND_STATUS_FAILED, BM_ICC_PRESENT_ACTIVE);
}
Expand Down Expand Up @@ -639,7 +639,6 @@ uint8_t PC_TO_RDR_SetDataRateAndClockFrequency(void)
uint8_t error;
uint32_t clockFrequency;
uint32_t dataRate;
uint32_t temp =0;

error = CCID_CheckCommandParams(CHK_PARAM_SLOT |\
CHK_PARAM_CARD_PRESENT |\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ void CCID_BulkMessage_Out (USBD_HandleTypeDef *pdev,
G_io_ccid.Ccid_BulkState = CCID_STATE_IDLE;
// no break is intentional

__attribute__((fallthrough));
case CCID_STATE_IDLE:
// prepare to receive another packet later on (to avoid troubles with timeout due to other hid command timeouting the ccid endpoint reply)
USBD_LL_PrepareReceive(pdev, CCID_BULK_OUT_EP, CCID_BULK_EPOUT_SIZE);
Expand Down

0 comments on commit 2185446

Please sign in to comment.