]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
rewrote initializers to make deputy happy
authorsallai <sallai>
Fri, 27 Jun 2008 23:33:37 +0000 (23:33 +0000)
committersallai <sallai>
Fri, 27 Jun 2008 23:33:37 +0000 (23:33 +0000)
tos/chips/rf230/RF230ActiveMessageP.nc
tos/chips/rf230/RF230LayerP.nc
tos/platforms/iris/chips/rf230/HplRF230.h

index b241ee58a62a52f8628540a40f2a9b0e192c812f..0337bbd92c54f054489c4ee75e334a556f9c05f5 100644 (file)
@@ -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()
index 6ce32074b642cb80ce06d6cf013dbb57437ffc67..4ba79fca8bf74f60d948f3f78c71a38f29e0186e 100644 (file)
@@ -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()
index c144173b95278561af987bb77e1782cff3687537..4418ffea859a57e4039e05996ab8e213e711f31c 100644 (file)
@@ -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