mirror of
https://github.com/STMicroelectronics/stm32-mw-usb-device.git
synced 2026-02-08 20:18:07 -05:00
Release 0.0.2
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user