From e0c91cd704167ac717a58a3a9677c4ced9e8a892 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Sun, 25 May 2025 00:10:37 +0300 Subject: [PATCH] Release 0.0.2 --- Class/CDC/Src/usbd_cdc_if.c | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/Class/CDC/Src/usbd_cdc_if.c b/Class/CDC/Src/usbd_cdc_if.c index bb6ab94..585e8a2 100644 --- a/Class/CDC/Src/usbd_cdc_if.c +++ b/Class/CDC/Src/usbd_cdc_if.c @@ -24,8 +24,6 @@ EndBSPDependencies */ /* Includes ------------------------------------------------------------------*/ #include "usbd_cdc_if.h" - -extern TIM_HandleTypeDef htim2; /** @addtogroup STM32_USB_DEVICE_LIBRARY * @{ */ @@ -98,6 +96,11 @@ extern USBD_HandleTypeDef hUsbDeviceFS; /* Private functions ---------------------------------------------------------*/ +__weak void TEMPLATE_ReceiveUserspace(uint8_t *Buf, uint32_t *Len) +{ + +} + /** * @brief TEMPLATE_Init * Initializes the CDC media low layer @@ -218,28 +221,7 @@ static int8_t TEMPLATE_Receive(uint8_t *Buf, uint32_t *Len) UNUSED(Buf); UNUSED(Len); - switch (Buf[0]) - { - case ('1'): - htim2.Instance->CCR1 = 10; - break; - - case ('2'): - htim2.Instance->CCR1 = 25; - break; - - case ('3'): - htim2.Instance->CCR1 = 50; - break; - - case ('4'): - htim2.Instance->CCR1 = 75; - break; - - default: - htim2.Instance->CCR1 = 99; - break; - } + TEMPLATE_ReceiveUserspace(*Buf, *Len); USBD_CDC_ReceivePacket(&hUsbDeviceFS); return (USBD_OK); @@ -272,9 +254,9 @@ uint8_t TEMPLATE_Transmit(uint8_t* Buf, uint16_t Len) */ static int8_t TEMPLATE_TransmitCplt(uint8_t *Buf, uint32_t *Len, uint8_t epnum) { - UNUSED(Buf); - UNUSED(Len); - UNUSED(epnum); + UNUSED(Buf); + UNUSED(Len); + UNUSED(epnum); return (0); }