From: Tim R. <ti...@pr...> - 2009-07-07 17:01:40
|
Nuno Santos wrote: > > I'm claiming interface before setting mode: > That shouldn't be necessary, strictly speaking, although it won't hurt, either. > This is my device side control packets handling (LUFA syntax): > > case 0x12: > if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_VENDOR | > REQREC_DEVICE)) > { > Endpoint_ClearSetupReceived(); > > PORTD ^=0xff; > > /* Send the flag to the host */ > Endpoint_ClearSetupOUT(); > } > > break; > There are apparently several different versions of the LUFA library, so I can't actually verify whether this is the intended sequence or not. Quite a number of the existing samples use Endpoint_ClearSetupIN(); for a host-to-device request. This is backwards from intuition, because in USB the terms "IN" and "OUT" are almost exclusively used from the point of view of the host. The LUFA documentation from June 2009 only shows Endpoint_ClearSETUP, with no distinction between IN and OUT. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |