Commit of new class abstraction APIs for all device demos other than the MIDI demo - not documented yet.
Removed scheduler and memory allocation libraries. Added new EVENT_USB_StartOfFrame event in the library to indicate the start of each USB frame (when generated). Removed Tx interrupt from the USBtoSerial demo; now sends characters via polling to ensure more time for the Rx interrupt.
This commit is contained in:
parent
2440ca268a
commit
d1e5266036
106 changed files with 3072 additions and 5760 deletions
|
@ -56,7 +56,7 @@ TCP_ConnectionState_t ConnectionStateTable[MAX_TCP_CONNECTIONS];
|
|||
* level. If an application produces a response, this task constructs the appropriate Ethernet frame and places it into the Ethernet OUT
|
||||
* buffer for later transmission.
|
||||
*/
|
||||
TASK(TCP_Task)
|
||||
void TCP_TCPTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
|
||||
{
|
||||
/* Task to hand off TCP packets to and from the listening applications. */
|
||||
|
||||
|
@ -76,7 +76,7 @@ TASK(TCP_Task)
|
|||
}
|
||||
|
||||
/* Bail out early if there is already a frame waiting to be sent in the Ethernet OUT buffer */
|
||||
if (FrameOUT.FrameInBuffer)
|
||||
if (RNDISInterfaceInfo->FrameOUT.FrameInBuffer)
|
||||
return;
|
||||
|
||||
/* Send response packets from each application as the TCP packet buffers are filled by the applications */
|
||||
|
@ -86,13 +86,13 @@ TASK(TCP_Task)
|
|||
if ((ConnectionStateTable[CSTableEntry].Info.Buffer.Direction == TCP_PACKETDIR_OUT) &&
|
||||
(ConnectionStateTable[CSTableEntry].Info.Buffer.Ready))
|
||||
{
|
||||
Ethernet_Frame_Header_t* FrameOUTHeader = (Ethernet_Frame_Header_t*)&FrameOUT.FrameData;
|
||||
IP_Header_t* IPHeaderOUT = (IP_Header_t*)&FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t)];
|
||||
TCP_Header_t* TCPHeaderOUT = (TCP_Header_t*)&FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) +
|
||||
sizeof(IP_Header_t)];
|
||||
void* TCPDataOUT = &FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) +
|
||||
sizeof(IP_Header_t) +
|
||||
sizeof(TCP_Header_t)];
|
||||
Ethernet_Frame_Header_t* FrameOUTHeader = (Ethernet_Frame_Header_t*)&RNDISInterfaceInfo->FrameOUT.FrameData;
|
||||
IP_Header_t* IPHeaderOUT = (IP_Header_t*)&RNDISInterfaceInfo->FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t)];
|
||||
TCP_Header_t* TCPHeaderOUT = (TCP_Header_t*)&RNDISInterfaceInfo->FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) +
|
||||
sizeof(IP_Header_t)];
|
||||
void* TCPDataOUT = &RNDISInterfaceInfo->FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) +
|
||||
sizeof(IP_Header_t) +
|
||||
sizeof(TCP_Header_t)];
|
||||
|
||||
uint16_t PacketSize = ConnectionStateTable[CSTableEntry].Info.Buffer.Length;
|
||||
|
||||
|
@ -145,8 +145,8 @@ TASK(TCP_Task)
|
|||
PacketSize += sizeof(Ethernet_Frame_Header_t);
|
||||
|
||||
/* Set the response length in the buffer and indicate that a response is ready to be sent */
|
||||
FrameOUT.FrameLength = PacketSize;
|
||||
FrameOUT.FrameInBuffer = true;
|
||||
RNDISInterfaceInfo->FrameOUT.FrameLength = PacketSize;
|
||||
RNDISInterfaceInfo->FrameOUT.FrameInBuffer = true;
|
||||
|
||||
ConnectionStateTable[CSTableEntry].Info.Buffer.Ready = false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue