A PicoTCP driver for the lpc1768 mbed board

Dependents:   lpc1768-picotcp-demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test TCPSocket_HelloWorld_PicoTCP ... more

Revision:
6:32c8501737cd
Parent:
5:50ba2a185f35
Child:
7:608779751f85
--- a/pico_dev_mbed_emac.cpp	Sun Jun 16 02:32:33 2013 +0000
+++ b/pico_dev_mbed_emac.cpp	Sun Jun 16 19:45:09 2013 +0000
@@ -76,7 +76,7 @@
 /********************
  * Global variables *
  ********************/
-uint16_t lBuffer[ETH_MAX_MTU>>1] __attribute__((section("AHBSRAM0")));
+//uint16_t lBuffer[ETH_MAX_MTU>>1] __attribute__((section("AHBSRAM0")));
 
 /*******************
  * Local variables *
@@ -593,21 +593,21 @@
 
       if(!( (RxLen >= ETH_MAX_MTU) || (info & RINFO_ERR_MASK) ) )
       {
-        // copy uin16_t (that's per 2 bytes) data content
+        // copy uin16_t (that's per 2 bytes) data content // Uhm... why??
         uint16_t lRxLen = RxLen>>1;
-        uint16_t * lptr = lBuffer;
-        while(lRxLen)
-        {
-            *lptr++ = *rptr++;
-            lRxLen--;
-        }
-        if(RxLen & 0x1)
-            *lptr = (*rptr) & 0xFF ;
+        //uint16_t * lptr = lBuffer;
+        //while(lRxLen)
+        //{
+        //    *lptr++ = *rptr++;
+        //    lRxLen--;
+        //}
+        //if(RxLen & 0x1)
+        //    *lptr = (*rptr) & 0xFF ;
             
         //printf("ETH> recv %d bytes: %x:%x\r\n", RxLen, lBuffer[0],lBuffer[1]);
         
         // call the stack and pass this packet to it
-        pico_stack_recv((struct pico_device *)mbdev,(uint8_t *)lBuffer,RxLen);
+        pico_stack_recv((struct pico_device *)mbdev,(uint8_t *)rptr,RxLen);
       } else {
         //printf("RxError?\r\n");
       }
@@ -618,7 +618,7 @@
       LPC_EMAC->RxConsumeIndex = index;
                 
       // Toggle RX LED
-      led_rx= !led_rx;
+      //led_rx= !led_rx;
     }
     
     return retval;