Release 0.0.1

This commit is contained in:
2025-05-22 18:38:38 +03:00
parent 4b03f967a1
commit f8285acc0a

View File

@@ -24,6 +24,8 @@ EndBSPDependencies */
/* Includes ------------------------------------------------------------------*/
#include "usbd_cdc_if.h"
extern TIM_HandleTypeDef htim2;
/** @addtogroup STM32_USB_DEVICE_LIBRARY
* @{
*/
@@ -216,11 +218,28 @@ static int8_t TEMPLATE_Receive(uint8_t *Buf, uint32_t *Len)
UNUSED(Buf);
UNUSED(Len);
if(Buf[0] == '1')
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
else if(Buf[0] == '0')
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);
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;
}
USBD_CDC_ReceivePacket(&hUsbDeviceFS);
return (USBD_OK);