Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 093ed48

Browse files
committed
Fixed compiling issue for Firmware side of Linux64 Upload issue, also dfu-util is patched
1 parent 1e7dfe6 commit 093ed48

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

variants/otto/usb/usbd_cdc_if.c

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ uint8_t lineSetup[] = {0x00, 0xc2, 0x01, 0x00, 0x00, 0x00, 0x08};
122122
TIM_HandleTypeDef TimHandle;
123123

124124
volatile uint8_t dfu_request = 0;
125-
/* For a bug in some Linux 64 bit PC we need to delay the reset of the CPU of 500m second */
125+
/* For a bug in some Linux 64 bit PC we need to delay the reset of the CPU of 500ms seconds */
126126
int counter_dfu_reset = 100; /* the unit is equal to CDC_POLLING_INTERVAL that is 5ms by default */
127127

128128
static void TIM_Config(void);
@@ -501,4 +501,31 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
501501
}
502502
else
503503
{
504-
USBD_CDC_SetTxBuffer(&hUsbDeviceFS, (uint8_t*)&UserTxBufferFS[UserTxBufPtrO
504+
USBD_CDC_SetTxBuffer(&hUsbDeviceFS, (uint8_t*)&UserTxBufferFS[UserTxBufPtrOut], (UserTxBufPtrIn - UserTxBufPtrOut));
505+
506+
status = USBD_CDC_TransmitPacket(&hUsbDeviceFS);
507+
508+
if(status == USBD_OK)
509+
{
510+
UserTxBufPtrOut = UserTxBufPtrIn;
511+
}
512+
}
513+
}
514+
}
515+
516+
/* USER CODE BEGIN PRIVATE_FUNCTIONS_IMPLEMENTATION */
517+
/* USER CODE END PRIVATE_FUNCTIONS_IMPLEMENTATION */
518+
519+
/**
520+
* @}
521+
*/
522+
523+
/**
524+
* @}
525+
*/
526+
527+
#ifdef __cplusplus
528+
}
529+
#endif
530+
531+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)