From 826c353a778240edb6b7e134f967c1c9611b2062 Mon Sep 17 00:00:00 2001 From: mmaroti Date: Mon, 3 May 2010 15:20:49 +0000 Subject: [PATCH 1/1] allow the change of the backoff values through a define --- tos/chips/rf2xx/rf230/RF230RadioP.nc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tos/chips/rf2xx/rf230/RF230RadioP.nc b/tos/chips/rf2xx/rf230/RF230RadioP.nc index 2a259f08..6110f244 100644 --- a/tos/chips/rf2xx/rf230/RF230RadioP.nc +++ b/tos/chips/rf2xx/rf230/RF230RadioP.nc @@ -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 -- 2.39.2