AVR USB stops responding
Posted: Mon Nov 05, 2007 2:49 pm
hi ,
i have written this code snippet in the function and i am continuously invoking this function through host . The code snippet in this function is
the host gets message : No such device after some invocations. What is that is ending the connection ?
i have written this code snippet in the
Code: Select all
USB_PUBLIC uchar usbFunctionSetup(uchar data[8])
Code: Select all
if ( data[1] == SERIAL_SET_ROBOT_VEL_PC ) /* SETTING THE ROBOT VELOCITY FROM PC*/
{
PORTD = 0 ;
usbMsgPtr = replyBuf;
lsb_fbVel = data[2] ;
msb_fbVel = data[3] ;
lsb_rlVel = data[4] ;
msb_rlVel = data[5] ;
replyBuf[0] = data[4] ;
replyBuf[1] = data[5] ;
//currentState = SERIAL_SET_ROBOT_VEL_PC ;
txChar_poll(SERIAL_SET_ROBOT_VEL_PC);
rec = rxChar_poll();
txChar_poll(lsb_fbVel);
txChar_poll(msb_fbVel);
for ( rec = 0 ; rec < 255 ; rec ++ );
txChar_poll(lsb_rlVel);
txChar_poll(msb_rlVel);
rec = rxChar_poll();
currentState = IDLE ;
return 2 ;
}
the host gets message : No such device after some invocations. What is that is ending the connection ?