Fix error when RS232 not enabled
This commit is contained in:
parent
ad6712736b
commit
9194b3ac69
|
@ -458,11 +458,13 @@ void usb_get_descriptor(void)
|
||||||
data_to_transfer = Usb_get_conf_desc_length(string_type); //!< sizeof (usb_user_configuration_descriptor);
|
data_to_transfer = Usb_get_conf_desc_length(string_type); //!< sizeof (usb_user_configuration_descriptor);
|
||||||
pbuffer = Usb_get_conf_desc_pointer(string_type);
|
pbuffer = Usb_get_conf_desc_pointer(string_type);
|
||||||
break;
|
break;
|
||||||
|
#if 1
|
||||||
case STRING_DESCRIPTOR:
|
case STRING_DESCRIPTOR:
|
||||||
if(string_type!=LANG_ID) {
|
if(string_type!=LANG_ID) {
|
||||||
usb_get_string_descriptor(string_type);
|
usb_get_string_descriptor(string_type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
dummy = Usb_read_byte();
|
dummy = Usb_read_byte();
|
||||||
dummy = Usb_read_byte();
|
dummy = Usb_read_byte();
|
||||||
|
@ -470,8 +472,8 @@ void usb_get_descriptor(void)
|
||||||
MSBwLength = Usb_read_byte();
|
MSBwLength = Usb_read_byte();
|
||||||
byteswereread=1;
|
byteswereread=1;
|
||||||
if( usb_user_get_descriptor(descriptor_type, string_type)==FALSE ) {
|
if( usb_user_get_descriptor(descriptor_type, string_type)==FALSE ) {
|
||||||
Usb_enable_stall_handshake(); //TODO:is this necessary?
|
Usb_enable_stall_handshake(); //TODO:is this necessary, Win7 flaky without?
|
||||||
Usb_ack_receive_setup(); //TODO:is this necessary?
|
Usb_ack_receive_setup();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -152,7 +152,9 @@ PROCESS_THREAD(cdc_process, ev, data_proc)
|
||||||
} else {
|
} else {
|
||||||
stdout = previous_stdout;
|
stdout = previous_stdout;
|
||||||
}
|
}
|
||||||
|
#if USB_CONF_RS232
|
||||||
usb_stdout=stdout;
|
usb_stdout=stdout;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//Flush buffer if timeout
|
//Flush buffer if timeout
|
||||||
|
|
Loading…
Reference in a new issue