用的這個(gè)例程,加了個(gè)按鍵發(fā)送USB數(shù)據(jù),主機(jī)接收不到
int?main() { ??uint16_t?value?=?0; ????GPIOB_ModeCfg(?GPIO_Pin_23,?GPIO_ModeIN_PU?); ??SetSysClock(?CLK_SOURCE_PLL_60MHz?); ??DebugInit();??//PA9 ??printf("start\n"); ??InitUSBDevPara(); ??InitUSBDevice(); ??PFIC_EnableIRQ(?USB_IRQn?); ??while(1) ??{ ????USB_IRQProcessHandler(); ????if(value?==?0) ????{ ??????if(!GPIOB_ReadPortPin(GPIO_Pin_23)) ??????{ ????????SendUSBData("遙遙領(lǐng)先123",?11); ????????value?=?10000; ??????} ????} ????if(value?>?0)value?--; ??} }
熱門(mén)產(chǎn)品 :
CH390:以太網(wǎng)控制器芯片