]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
- tickle watchdog and timeouts for good base performance
authorsdhsdh <sdhsdh>
Thu, 17 Sep 2009 18:20:13 +0000 (18:20 +0000)
committersdhsdh <sdhsdh>
Thu, 17 Sep 2009 18:20:13 +0000 (18:20 +0000)
apps/IPBaseStation/BaseStationP.nc
apps/IPBaseStation/Makefile
support/sdk/c/blip/driver/serial_tun.c

index dfe80cd48065cf05ab3c3306423a319c1d96e9d9..fc7df4eeccfd71b684a09e3918347d958f45c76e 100644 (file)
@@ -303,7 +303,7 @@ implementation
     bool reflectToken = FALSE;
     CHECK_NODE_ID msg;
     dbg("base", "uartreceive len %i of 0x%x\n", len, call SerialAMPacket.destination(msg));
-#if defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC)
+#if defined(BLIP_WATCHDOG) && (defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC))
     WDTCTL = WDT_ARST_1000;
 #endif
     atomic
@@ -397,7 +397,7 @@ implementation
                                             uint8_t len) {
     config_cmd_t *cmd;
     uint8_t error = CONFIG_ERROR_OK;
-#if defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC)
+#if defined(BLIP_WATCHDOG) && (defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC))
     WDTCTL = WDT_ARST_1000;
 #endif
 
index 3bf898933dba13f1eabc520dd4033e109fbd870e..1d8c459b9293291652d3f5e61e40f00ef8438ab5 100644 (file)
@@ -15,6 +15,10 @@ CFLAGS += -DIEEE154FRAMES_ENABLED
 # when using IEEE154Frames, the maximum payload size is 2 larger,
 # since the header is two smaller.
 BLIP_L2_MTU = 104
+
+# if you're worried about your interface mote crashing, enable this to
+# turn on a hardware watchdog that will reset it if it does.  CFLAGS
+# += -DBLIP_WATCHDOG
 #
 # debugging
 #
index 9992aa992e7df538c51772fa0b254bbb60213bd9..90c97a1075d7b72db875131052560f4debecc5e0 100644 (file)
@@ -398,19 +398,22 @@ void send_fragments (struct split_ip_msg *msg, ieee154_saddr_t dest) {
 
     // if this is sent too fast, the base station can't keep up.  The effect of this is
     // we send incomplete fragment.  25ms seems to work pretty well.
-    // usleep(30000);
     //   6-9-08 : SDH : this is a bad fix that does not address the
     //   problem.  
     //   at the very least, the serial ack's seem to be
     //   working, so we should be retrying if the ack is failing
     //   because the hardware cannot keep up.
+    //   9-17-09 : SDH : it seems we've tracked this down to packets
+    //   arriving too fast to enqueue, especially at higher baud rates
+    //   (115200).  reenabled to prevent retries, which are very slow.
 #ifdef __TARGET_mips__
     usleep(50000);
+#else
+    usleep(25000);
 #endif
-
     log_dump_serial_packet(serial, PKTLEN(radioPacket));
     result = write_pan_packet(serial, PKTLEN(radioPacket));
-    if (result != 0)
+    if (result != 0) 
       result = write_pan_packet(serial, PKTLEN(radioPacket));
 
     debug("send_fragments: result: 0x%x len: 0x%x\n", result, frag_len);