Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 10 additions and 3 deletions.
  1. +10 −3 softusb-input/main.c
13 softusb-input/main.c
View
@@ -32,6 +32,7 @@ enum {
USB_PID_SETUP = 0x2d,
USB_PID_DATA0 = 0xc3,
USB_PID_DATA1 = 0x4b,
+ USB_PID_SOF = 0xa5,
USB_PID_ACK = 0xd2,
USB_PID_NAK = 0x5a,
};
@@ -100,7 +101,7 @@ static unsigned char usb_rx(unsigned char *buf, unsigned char maxlen)
unsigned char i;
i = 0;
- timeout = 0xfff;
+ timeout = 0x1ff;
while(!rio8(SIE_RX_PENDING)) {
if(timeout-- == 0) {
print_string(transfer_start);
@@ -114,7 +115,7 @@ static unsigned char usb_rx(unsigned char *buf, unsigned char maxlen)
}
}
while(1) {
- timeout = 0xfff;
+ timeout = 0x1ff;
while(!rio8(SIE_RX_PENDING)) {
if(rio8(SIE_RX_ERROR)) {
print_string(bitstuff_error);
@@ -420,7 +421,7 @@ static char validate_configuration_descriptor(unsigned char *descriptor,
static const char retry_exceed[] PROGMEM = "Retry count exceeded, disabling device.\n";
static void check_retry(struct port_status *p)
{
- if(p->retry_count++ > 20) {
+ if(p->retry_count++ > 4) {
print_string(retry_exceed);
p->state = PORT_STATE_UNSUPPORTED;
}
@@ -445,6 +446,12 @@ static void port_service(struct port_status *p, char name)
wio8(SIE_TX_LOW_SPEED, 0);
else
wio8(SIE_TX_LOW_SPEED, 1);
+ if((p->full_speed) && (p->state > PORT_STATE_BUS_RESET)) {
+ /* send SOF */
+ unsigned char usb_buffer[3];
+ make_usb_token(USB_PID_SOF, frame_nr, usb_buffer);
+ usb_tx(usb_buffer, 3);
+ }
switch(p->state) {
case PORT_STATE_DISCONNECTED: {
char linestat;

No commit comments for this range

Something went wrong with that request. Please try again.