单片机将8位数据传输给CH375 CH375等待PC机取走数据 如PC机取走数据 单片机继续执行上述过程 以下中断程序是否正确?8位数据时存储在 buffer[8]中么?
void mCh375Interrupt( ) interrupt 0 using 1 { unsigned char InterruptStatus; unsigned char i; unsigned char data buffer[ 8 ]; CH375_WR_CMD_PORT( CMD_WR_USB_DATA5 ); CH375_WR_DAT_PORT( 8 ); for ( i = 0; i < 8; i ++ ) CH375_WR_DAT_PORT( buffer[ 8 ] ); CH375_WR_CMD_PORT( CMD_GET_STATUS ); InterruptStatus = CH375_RD_DAT_PORT( ); switch ( InterruptStatus ) { case USB_INT_EP2_IN: { CH375_WR_CMD_PORT( CMD_UNLOCK_USB ); CH375_WR_DAT_PORT( 8 ); for ( i = 0; i < 8; i ++ ) CH375_WR_DAT_PORT( buffer[ 8 ] ); break; } default: { CH375_WR_CMD_PORT( CMD_UNLOCK_USB ); break; } } }