OpenCores
URL https://opencores.org/ocsvn/plasma/plasma/trunk

Subversion Repositories plasma

[/] [plasma/] [trunk/] [kernel/] [tcpip.c] - Diff between revs 367 and 368

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 367 Rev 368
Line 1053... Line 1053...
   ticksLast = OS_ThreadTime();
   ticksLast = OS_ThreadTime();
   memset(message, 0, sizeof(message));
   memset(message, 0, sizeof(message));
 
 
   for(;;)
   for(;;)
   {
   {
      Led(0);
      Led(7, 0);
      rc = OS_MQueueGet(IPMQueue, message, 10);
      rc = OS_MQueueGet(IPMQueue, message, 10);
      if(rc == 0)
      if(rc == 0)
      {
      {
         frame = (IPFrame*)message[1];
         frame = (IPFrame*)message[1];
         if(message[0] == 0)       //frame received
         if(message[0] == 0)       //frame received
         {
         {
            Led(1);
            Led(7, 1);
            frame->length = (uint16)message[2];
            frame->length = (uint16)message[2];
            rc = IPProcessEthernetPacket(frame, frame->length);
            rc = IPProcessEthernetPacket(frame, frame->length);
            if(rc == 0)
            if(rc == 0)
               FrameFree(frame);
               FrameFree(frame);
         }
         }
         else if(message[0] == 1)  //frame sent
         else if(message[0] == 1)  //frame sent
         {
         {
            Led(2);
            Led(7, 2);
            assert(frame == frameOut);
            assert(frame == frameOut);
            IPFrameReschedule(frame);
            IPFrameReschedule(frame);
            frameOut = NULL;
            frameOut = NULL;
         }
         }
         else if(message[0] == 2)  //frame ready to send
         else if(message[0] == 2)  //frame ready to send
Line 1087... Line 1087...
         if(frameOut)
         if(frameOut)
            FrameRemove(&FrameSendHead, &FrameSendTail, frameOut);
            FrameRemove(&FrameSendHead, &FrameSendTail, frameOut);
         OS_MutexPost(IPMutex);
         OS_MutexPost(IPMutex);
         if(frameOut)
         if(frameOut)
         {
         {
            Led(4);
            Led(7, 4);
            UartPacketSend(frameOut->packet, frameOut->length);
            UartPacketSend(frameOut->packet, frameOut->length);
         }
         }
      }
      }
 
 
      ticks = OS_ThreadTime();
      ticks = OS_ThreadTime();

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.