Ryo Iizuka / libMiMic

Dependents:   MbedFileServer_1768MiniDK2 RedWireBridge IssueDebug_gcc MiMicRemoteMCU-for-Mbed ... more

Revision:
2:b96c1e90d120
Parent:
1:9f6a78395432
diff -r 9f6a78395432 -r b96c1e90d120 core/uip/NyLPC_cUipService.cpp
--- a/core/uip/NyLPC_cUipService.cpp	Mon Mar 25 05:23:49 2013 +0000
+++ b/core/uip/NyLPC_cUipService.cpp	Wed Mar 27 12:07:47 2013 +0000
@@ -52,13 +52,14 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
+#include "NyLPC_cIPv4IComp_protected.h"
 #include "NyLPC_cTcpListener_protected.h"
-#include "NyLPC_cTcpSocket_protected.h"
 #include "NyLPC_stdlib.h"
 #include "NyLPC_uip.h"
 
-static DigitalOut led1(LED1);
+
+
+
 
 /****************************************************
  * UipServiceに関する宣言:タスクメッセージ
@@ -132,11 +133,11 @@
 #define TTaskMessage_MSG_STOP    0x0002
 
 
-
 NyLPC_TcThread_t th;
 
 NyLPC_TBool NyLPC_cUipService_initialize(void)
 {
+
     NyLPC_TcUipService_t* inst=&_service_instance;
     //サービスは停止している事。 - Service must be uninitialized.
     NyLPC_Assert(!NyLPC_TcUipService_isInitService());
@@ -144,7 +145,6 @@
     NyLPC_cIPv4_initialize(&(inst->_tcpv4));
     //EMACからの割込処理
     NyLPC_cIsr_setEnetISR(emacIsrHandler);
-
     //EMAC割込セマフォ
     NyLPC_cSemaphore_initialize(&inst->_emac_semapho);
 
@@ -332,7 +332,6 @@
  */
 static int uipTask(void *pvParameters)
 {
-    int cc=0;
     NyLPC_TUInt16 rx_len,tx_len;
     struct TEthPacket* ethbuf;
     NyLPC_TcUipService_t* inst=_NyLPC_TcUipService_inst;
@@ -350,11 +349,9 @@
         }
         //イーサネットフレームの取得
         //Ethernet Device Lock(ARPを含む)
-
-        NyLPC_cMutex_lock(&(inst->_mutex));        
+        NyLPC_cMutex_lock(&(inst->_mutex));
         ethbuf= (struct TEthPacket*)inst->_ethif->getRxEthFrame(&rx_len);
         tx_len=0;
-        
         while(ethbuf != NULL){
             if(rx_len>0)
             {
@@ -395,31 +392,26 @@
                 default:
                     break;
                 }
-                
             }
-             //受信キューを進行。
+            //受信キューを進行。
             inst->_ethif->nextRxEthFrame();
             //受信処理
             ethbuf= (struct TEthPacket*)inst->_ethif->getRxEthFrame(&rx_len);
         }
         //データが無い。
         if(NyLPC_cStopwatch_isExpired(&(inst->_arp_sw))){
-
             //uip_arp_timer();
             NyLPC_cIPv4Arp_periodic(&inst->_arp);
             NyLPC_cStopwatch_startExpire(&(inst->_arp_sw),ARP_TIMER);
-       }
+        }
         if(NyLPC_cStopwatch_isExpired(&(inst->_periodic_sw))){
             NyLPC_cIPv4_periodec(&(inst->_tcpv4));
             NyLPC_cStopwatch_startExpire(&(inst->_periodic_sw),PERIODIC_TIMER);
         }
-        
         //リソースロックの解除
         NyLPC_cMutex_unlock(&(inst->_mutex));
-        
         //割込によるセマフォの解除か、タイムアウトで再開する。(タイムアウト値は周期関数の実行レート以下にすること。)
         NyLPC_cSemaphore_take(&(_NyLPC_TcUipService_inst->_emac_semapho),PERIODIC_TIMER);
-        led1=(cc++)%2;
     }
     return 0;
 }
@@ -630,5 +622,4 @@
 //      NVIC_DisableIRQ( ENET_IRQn );
 //  }
 //  portEXIT_CRITICAL();
-//}
-
+//}
\ No newline at end of file