abcminiuser / lufa

LUFA - the Lightweight USB Framework for AVRs.
http://www.lufa-lib.org
1.04k stars 325 forks source link

Fix #106 CDC Serial send blocks when host closes connection #120

Open NicoHood opened 6 years ago

NicoHood commented 6 years ago

I've only added it for the sending part, as Receiving should work independent. Maybe you know better if we also need it there, but I dont think so as it wont block anything.

NicoHood commented 6 years ago

@abcminiuser Any chance to see this feature in the near feature?

abcminiuser commented 6 years ago

Looks ok to me, but some people might want a class driver config option to ignore DTR. I'm about to leave on a business trip to the US for 10 days, I'll have to go through this and the other patches when I get back.

NicoHood commented 6 years ago

You could add it as compile time option to keep compatibility to older APIs. But i would enable it as default, that makes sense to me.

abcminiuser commented 6 years ago

I think the best course of action is to add a new RequireDTR option to the Config section of USB_ClassInfo_CDC_Device_t, and set that to true in all the demos in the LUFA tree. That way people with old code will get the old behavior for backwards compatibility, but those basing their code off the latest LUFA version will have it enabled by default.

NicoHood commented 6 years ago

But it will increase the code size even more, on top of the DTR check itself. It should be either the new default or a compile time option if you ask me. This is nothing you would want to change at runtime.