我仔细看了usb08的demo程序,发现一个问题。在初始化中。void initUSB() {
UADDR = BM_USBEN + 0; // USB enable, default address
UCR0 = 0; // reset EP0
UCR1 = 0; // reset EP1
UCR2 = 0; // reset EP2
UCR3 = BM_TX1STR + // clear TX1ST Flag
USB_IPUE*BM_PULLEN; // enable/disable internal Pull-up
UCR4 = 0; // USB normal operation
UIR0 = 0; // disable Interrupts
UIR2 = 0xff; // clear all Flags in UIR1
R0Sequence = 0; // EP0 Rx starts with DATA0
R2Sequence = 0; // EP2 Rx starts with DATA0
USB_State = US_POWERED; // powered, but not yet reset
TxBuf_RdIdx = 0; // reset Buffer Indexes
TxBuf_WrIdx = 0;
RxBuf_RdIdx = 0;
RxBuf_WrIdx = 0;
}
UIR0 = 0;是为什么?把所有的中断都关闭了?
|