summaryrefslogtreecommitdiff
path: root/stmhal/usbd_conf.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-01-09 21:59:15 +0000
committerDamien George <damien.p.george@gmail.com>2016-01-29 15:21:43 +0000
commitd3631339176b768ce1ffdc535223385245ff906b (patch)
tree51f2b5063787735a3ec5f936512a0599b1d390ec /stmhal/usbd_conf.c
parent7417ccfb0d27c7c09b5ed6468a9e3ca729af41bb (diff)
stmhal: Make USB CDC driver use SOF instead of TIM3 for outgoing data.
Previous to this patch the USB CDC driver used TIM3 to trigger the sending of outgoing data over USB serial. This patch changes the behaviour so that the USB SOF interrupt is used to trigger the processing of the sending. This reduces latency and increases bandwidth of outgoing data. Thanks to Martin Fischer, aka @hoihu, for the idea and initial prototype. See PR #1713.
Diffstat (limited to 'stmhal/usbd_conf.c')
-rw-r--r--stmhal/usbd_conf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/stmhal/usbd_conf.c b/stmhal/usbd_conf.c
index c6b049874..5ff824071 100644
--- a/stmhal/usbd_conf.c
+++ b/stmhal/usbd_conf.c
@@ -276,10 +276,13 @@ void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
* @param hpcd: PCD handle
* @retval None
*/
+/*
+This is now handled by the USB CDC interface.
void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd)
{
USBD_LL_SOF(hpcd->pData);
}
+*/
/**
* @brief Reset callback.
@@ -394,7 +397,7 @@ if (pdev->id == USB_PHY_FS_ID)
pcd_fs_handle.Init.dma_enable = 0;
pcd_fs_handle.Init.low_power_enable = 0;
pcd_fs_handle.Init.phy_itface = PCD_PHY_EMBEDDED;
- pcd_fs_handle.Init.Sof_enable = 0;
+ pcd_fs_handle.Init.Sof_enable = 1;
pcd_fs_handle.Init.speed = PCD_SPEED_FULL;
#if !defined(MICROPY_HW_USB_VBUS_DETECT_PIN)
pcd_fs_handle.Init.vbus_sensing_enable = 0; // No VBUS Sensing on USB0