]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/rf2xx/rf230/RF230RadioP.nc
allow the change of the backoff values through a define
[tinyos-2.x.git] / tos / chips / rf2xx / rf230 / RF230RadioP.nc
index 2a259f088d6db73cb1783a3b5fcdb2d21106109d..6110f2445a29c48329962d688beaf617eb619bb0 100644 (file)
@@ -248,19 +248,31 @@ implementation
 
 #ifndef LOW_POWER_LISTENING
 
+#ifndef RF230_BACKOFF_MIN
+#define RF230_BACKOFF_MIN 320
+#endif
+
        async command uint16_t RandomCollisionConfig.getMinimumBackoff()
        {
-               return (uint16_t)(320 * RADIO_ALARM_MICROSEC);
+               return (uint16_t)(RF230_BACKOFF_MIN * RADIO_ALARM_MICROSEC);
        }
 
+#ifndef RF230_BACKOFF_INIT
+#define RF230_BACKOFF_INIT 4960                // instead of 9920
+#endif
+
        async command uint16_t RandomCollisionConfig.getInitialBackoff(message_t* msg)
        {
-               return (uint16_t)(9920 * RADIO_ALARM_MICROSEC);
+               return (uint16_t)(RF230_BACKOFF_INIT * RADIO_ALARM_MICROSEC);
        }
 
+#ifndef RF230_BACKOFF_CONG
+#define RF230_BACKOFF_CONG 2240
+#endif
+
        async command uint16_t RandomCollisionConfig.getCongestionBackoff(message_t* msg)
        {
-               return (uint16_t)(2240 * RADIO_ALARM_MICROSEC);
+               return (uint16_t)(RF230_BACKOFF_CONG * RADIO_ALARM_MICROSEC);
        }
 
 #endif