]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/PollP.nc
- reduced RAM usage of the beacon sync component
[tinyos-2.x.git] / tos / lib / mac / tkn154 / PollP.nc
index d00e986f6e44448d102acdb03e1ffdf3695d65ab..e44f7106b8eedc98d263d231825a2a51c95753e0 100644 (file)
@@ -125,13 +125,13 @@ implementation
     ieee154_txcontrol_t *txControl;
     ieee154_status_t status = IEEE154_TRANSACTION_OVERFLOW;
 
-    dbg_serial("PollP", "InternalPoll\n");
+    dbg_serial("PollP", "Internal Poll\n");
     if (client == SYNC_POLL_CLIENT && m_numPending != 0) {
       // no point in auto-requesting if user request is pending
       signal DataRequest.pollDone[client]();
       return IEEE154_SUCCESS;
-    } else if ((txFrame = call TxFramePool.get())) {
-      if (!(txControl = call TxControlPool.get()))
+    } else if ((txFrame = call TxFramePool.get()) != NULL) {
+      if ((txControl = call TxControlPool.get()) != NULL)
         call TxFramePool.put(txFrame);
       else {
         txFrame->header = &txControl->header;
@@ -149,6 +149,7 @@ implementation
     }
     if (status != IEEE154_SUCCESS)
       signal DataRequest.pollDone[client]();
+    dbg_serial("PollP", "Status %lu, numPending: %lu\n", (uint32_t) status, (uint32_t) m_numPending);
     return status;
   }