請問一下,我在使用CH567開發(fā)板的過程中,使用官方的例程,在程序開發(fā)的過程中,開發(fā)板經(jīng)常出現(xiàn)“USB1 Reset!”的情況出現(xiàn),例如下面這樣子的情況。偶爾重新開發(fā)板重啟就能解決、偶爾是重新編譯程序就能解決,請問出現(xiàn)這種情況的原因在哪里呢:
USB1 Device Init!
USB1 Reset!
USB1 Reset!
USB1 Reset!
USB1 Reset!
USB1 Reset!
USB1 Reset!
USB1 Reset!
USB1 Reset!
USB1 Reset!
USB1 Reset!
USB1 Reset!
源代碼:
void USB1DevIntDeal(void){
????if (R8_USB1_INT_FG & UIF_TRANSFER) {
????????//R8_UEP0_TX_CTRL1 = UEP_T_RES_NAK;
????????R8_UEP0_TX_CTRL1 = UEP_T_RES_ACK;
????????R8_UEP0_RX_CTRL1 = UEP_R_RES_ACK;
????????//R8_UEP1_TX_CTRL1 = UEP_T_RES_NAK | bUEP_AUTO_TOG;
????????R8_UEP1_TX_CTRL1 = UEP_T_RES_ACK | bUEP_AUTO_TOG;
????????R8_UEP1_RX_CTRL1 = UEP_R_RES_ACK | bUEP_AUTO_TOG;
????????R8_UEP2_TX_CTRL1 = UEP_T_RES_ACK | bUEP_AUTO_TOG;
????????R8_UEP2_RX_CTRL1 = UEP_R_RES_ACK | bUEP_AUTO_TOG;
????????R8_USB1_DEV_AD = 0;
????????DevAddr = 0;
????????R8_USB1_INT_FG = UIF_BUS_RST;
????????printf("USB1 Reset!\n");