forked from stm/stm32-mw-usb-device
Release 0.0.2
This commit is contained in:
@@ -24,8 +24,6 @@ EndBSPDependencies */
|
|||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "usbd_cdc_if.h"
|
#include "usbd_cdc_if.h"
|
||||||
|
|
||||||
|
|
||||||
extern TIM_HandleTypeDef htim2;
|
|
||||||
/** @addtogroup STM32_USB_DEVICE_LIBRARY
|
/** @addtogroup STM32_USB_DEVICE_LIBRARY
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
@@ -98,6 +96,11 @@ extern USBD_HandleTypeDef hUsbDeviceFS;
|
|||||||
|
|
||||||
/* Private functions ---------------------------------------------------------*/
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
__weak void TEMPLATE_ReceiveUserspace(uint8_t *Buf, uint32_t *Len)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief TEMPLATE_Init
|
* @brief TEMPLATE_Init
|
||||||
* Initializes the CDC media low layer
|
* Initializes the CDC media low layer
|
||||||
@@ -218,28 +221,7 @@ static int8_t TEMPLATE_Receive(uint8_t *Buf, uint32_t *Len)
|
|||||||
UNUSED(Buf);
|
UNUSED(Buf);
|
||||||
UNUSED(Len);
|
UNUSED(Len);
|
||||||
|
|
||||||
switch (Buf[0])
|
TEMPLATE_ReceiveUserspace(*Buf, *Len);
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
USBD_CDC_ReceivePacket(&hUsbDeviceFS);
|
USBD_CDC_ReceivePacket(&hUsbDeviceFS);
|
||||||
return (USBD_OK);
|
return (USBD_OK);
|
||||||
|
|||||||
Reference in New Issue
Block a user