From: sallai Date: Fri, 27 Jun 2008 23:33:37 +0000 (+0000) Subject: rewrote initializers to make deputy happy X-Git-Tag: release_tinyos_2_1_0_0~141 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=e3cfa7776f6d8e739d5fb613668b470111d75d55 rewrote initializers to make deputy happy --- diff --git a/tos/chips/rf230/RF230ActiveMessageP.nc b/tos/chips/rf230/RF230ActiveMessageP.nc index b241ee58..0337bbd9 100644 --- a/tos/chips/rf230/RF230ActiveMessageP.nc +++ b/tos/chips/rf230/RF230ActiveMessageP.nc @@ -184,7 +184,7 @@ implementation enum { TRAFFIC_UPDATE_PERIOD = 100, // in milliseconds - TRAFFIC_MAX_BYTES = (uint16_t)(TRAFFIC_UPDATE_PERIOD * 1000.0 / 32), // 3125 + TRAFFIC_MAX_BYTES = (uint16_t)(TRAFFIC_UPDATE_PERIOD * 1000UL / 32), // 3125 }; async command uint16_t TrafficMonitorConfig.getUpdatePeriod() diff --git a/tos/chips/rf230/RF230LayerP.nc b/tos/chips/rf230/RF230LayerP.nc index 6ce32074..4ba79fca 100644 --- a/tos/chips/rf230/RF230LayerP.nc +++ b/tos/chips/rf230/RF230LayerP.nc @@ -150,11 +150,11 @@ implementation enum { - SLEEP_WAKEUP_TIME = (uint16_t)(880 * RF230_ALARM_MICROSEC), - CCA_REQUEST_TIME = (uint16_t)(140 * RF230_ALARM_MICROSEC), + SLEEP_WAKEUP_TIME = (uint16_t)(880 * RF230_ALARM_SEC / 1000000UL), + CCA_REQUEST_TIME = (uint16_t)(140 * RF230_ALARM_SEC / 1000000UL), - TX_SFD_DELAY = (uint16_t)(176 * RF230_ALARM_MICROSEC), - RX_SFD_DELAY = (uint16_t)(8 * RF230_ALARM_MICROSEC), + TX_SFD_DELAY = (uint16_t)(176 * RF230_ALARM_SEC / 1000000UL), + RX_SFD_DELAY = (uint16_t)(8 * RF230_ALARM_SEC / 1000000UL), }; tasklet_async event void RadioAlarm.fired() diff --git a/tos/platforms/iris/chips/rf230/HplRF230.h b/tos/platforms/iris/chips/rf230/HplRF230.h index c144173b..4418ffea 100644 --- a/tos/platforms/iris/chips/rf230/HplRF230.h +++ b/tos/platforms/iris/chips/rf230/HplRF230.h @@ -52,10 +52,16 @@ enum */ typedef TOne TRF230; + +/** + * The number of alarm ticks per one second (921600) + */ +#define RF230_ALARM_SEC ((7372800UL / MHZ / 32) * (1 << MICA_DIVIDE_ONE_FOR_32KHZ_LOG2)) + /** * The number of alarm ticks per one microsecond (0.9216) */ -#define RF230_ALARM_MICROSEC ((7.3728 / MHZ / 32.0) * (1 << MICA_DIVIDE_ONE_FOR_32KHZ_LOG2)) +#define RF230_ALARM_MICROSEC (RF230_ALARM_SEC / 1000000.0) /* This is the default value of the TX_PWR field of the PHY_TX_PWR register. */ #ifndef RF230_DEF_RFPOWER