Files
New_STC32G_All_Board/Source/stc32_stc8_usb.c
2025-08-31 21:37:24 +08:00

24 lines
1019 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "stc32_stc8_usb.h"
char *USER_DEVICEDESC = NULL;
char *USER_PRODUCTDESC = NULL;
char *USER_STCISPCMD = "@STCISP#";
/************************************************
函数功能USB-CDC串口接收数据的回调函数
函数描述回调函数由USB中断在接收到串口数据时自动调用
回调函数处理完成串口数据后需要返回1
函数返回返回1USB中断服务程序自动完成后续的收尾工作
返回0USB会暂停接收串口数据直到用户自行调用
usb_OUT_done()函数后USB才会重新恢复接收数据
注意事项当函数返回1时用户无需调用usb_OUT_done()
只有返回0时才需要调用usb_OUT_done()进行手动收尾
强烈建议usb_OUT_callback返回1
************************************************/
BOOL usb_OUT_callback()
{
USB_SendData(UsbOutBuffer,OutNumber); //发送数据缓冲区,长度(接收数据原样返回, 用于测试)
return 1;
}