From cf17a36229c58579dd04718b4f4d0db83f90909b Mon Sep 17 00:00:00 2001 From: mmaroti Date: Wed, 30 Sep 2009 23:19:52 +0000 Subject: [PATCH] Expose the PacketTimeStamp interfaces in TimeSyncMessageC --- tos/platforms/mulle/ActiveMessageC.nc | 42 +++++++++++-------- tos/platforms/mulle/TimeSyncMessageC.nc | 35 +++++++++------- tos/platforms/mulle/chips/rf230/RadioConfig.h | 12 ++++-- 3 files changed, 55 insertions(+), 34 deletions(-) diff --git a/tos/platforms/mulle/ActiveMessageC.nc b/tos/platforms/mulle/ActiveMessageC.nc index 0fe46197..2e5cdc48 100755 --- a/tos/platforms/mulle/ActiveMessageC.nc +++ b/tos/platforms/mulle/ActiveMessageC.nc @@ -21,6 +21,8 @@ * Author: Miklos Maroti */ +#include + configuration ActiveMessageC { provides @@ -30,6 +32,8 @@ configuration ActiveMessageC interface AMSend[uint8_t id]; interface Receive[uint8_t id]; interface Receive as Snoop[uint8_t id]; + interface SendNotifier[am_id_t id]; + interface Packet; interface AMPacket; @@ -46,25 +50,29 @@ configuration ActiveMessageC implementation { - components RF230ActiveMessageC as MAC, - RF230SplitControlP, - new SystemClockControlC(); - - RF230SplitControlP.SplitControlOrig -> MAC; - RF230SplitControlP.SystemClockControl -> SystemClockControlC; + components RF230ActiveMessageC as MessageC, + RF230SplitControlP, + new SystemClockControlC(); + + RF230SplitControlP.SplitControlOrig -> MessageC; + RF230SplitControlP.SystemClockControl -> SystemClockControlC; + + SplitControl = RF230SplitControlP.SplitControl; + + AMSend = MessageC; + Receive = MessageC.Receive; + Snoop = MessageC.Snoop; + SendNotifier = MessageC; + + Packet = MessageC; + AMPacket = MessageC; - SplitControl = RF230SplitControlP.SplitControl; - AMSend = MAC; - Receive = MAC.Receive; - Snoop = MAC.Snoop; - Packet = MAC; - AMPacket = MAC; + PacketAcknowledgements = MessageC; + LowPowerListening = MessageC; #ifdef PACKET_LINK - PacketLink = MAC; + PacketLink = MessageC; #endif - PacketAcknowledgements = MAC; - LowPowerListening = MAC; - PacketTimeStampMilli = MAC; - PacketTimeStampMicro = MAC; + PacketTimeStampMilli = MessageC; + PacketTimeStampMicro = MessageC; } diff --git a/tos/platforms/mulle/TimeSyncMessageC.nc b/tos/platforms/mulle/TimeSyncMessageC.nc index 35573e8d..a08e9fa8 100755 --- a/tos/platforms/mulle/TimeSyncMessageC.nc +++ b/tos/platforms/mulle/TimeSyncMessageC.nc @@ -34,9 +34,11 @@ configuration TimeSyncMessageC interface Packet; interface AMPacket; + interface PacketTimeStamp as PacketTimeStampRadio; interface TimeSyncAMSend as TimeSyncAMSendRadio[am_id_t id]; interface TimeSyncPacket as TimeSyncPacketRadio; + interface PacketTimeStamp as PacketTimeStampMilli; interface TimeSyncAMSend as TimeSyncAMSendMilli[am_id_t id]; interface TimeSyncPacket as TimeSyncPacketMilli; } @@ -44,20 +46,25 @@ configuration TimeSyncMessageC implementation { - components RF230TimeSyncMessageC as MAC, - RF230SplitControlP; + components RF230TimeSyncMessageC as MessageC, + RF230SplitControlP, + new SystemClockControlC(); - RF230SplitControlP.SplitControlOrig -> MAC; - RF230SplitControlP.SystemClockControl -> SystemClockControlC; + RF230SplitControlP.SplitControlOrig -> MessageC; + RF230SplitControlP.SystemClockControl -> SystemClockControlC; - SplitControl = RF230SplitControlP.SplitControl; - Receive = MAC.Receive; - Snoop = MAC.Snoop; - Packet = MAC; - AMPacket = MAC; - - TimeSyncAMSendRadio = MAC; - TimeSyncPacketRadio = MAC; - TimeSyncAMSendMilli = MAC; - TimeSyncPacketMilli = MAC; + SplitControl = RF230SplitControlP.SplitControl; + + Receive = MessageC.Receive; + Snoop = MessageC.Snoop; + Packet = MessageC; + AMPacket = MessageC; + + PacketTimeStampRadio = MessageC; + TimeSyncAMSendRadio = MessageC; + TimeSyncPacketRadio = MessageC; + + PacketTimeStampMilli = MessageC; + TimeSyncAMSendMilli = MessageC; + TimeSyncPacketMilli = MessageC; } diff --git a/tos/platforms/mulle/chips/rf230/RadioConfig.h b/tos/platforms/mulle/chips/rf230/RadioConfig.h index 3f5e0080..5ba89494 100644 --- a/tos/platforms/mulle/chips/rf230/RadioConfig.h +++ b/tos/platforms/mulle/chips/rf230/RadioConfig.h @@ -86,6 +86,7 @@ enum */ RF230_CCA_THRES_VALUE = 0xC7, }; + /* This is the default value of the TX_PWR field of the PHY_TX_PWR register. 0-15*/ #ifndef RF230_DEF_RFPOWER #define RF230_DEF_RFPOWER 0 @@ -96,7 +97,6 @@ enum #define RF230_DEF_CHANNEL 11 #endif - /* * This is the command used to calculate the CRC for the RF230 chip. * TODO: Check why the default crcByte implementation is in a different endianness @@ -110,14 +110,13 @@ inline uint16_t RF230_CRCBYTE_COMMAND(uint16_t crc, uint8_t data) return ((((uint16_t)data << 8) | hi8 /*hi8 (crc)*/) ^ (uint8_t)(data >> 4) ^ ((uint16_t)data << 3)); - } /** * This is the timer type of the radio alarm interface */ - typedef TMicro TRadio; + /** * The number of alarm ticks per one second */ @@ -130,4 +129,11 @@ typedef TMicro TRadio; */ #define RADIO_ALARM_MILLI_EXP 11 +/** + * Make PACKET_LINK automaticaly enabled for Ieee154MessageC + */ +#if !defined(TFRAMES_ENABLED) && !defined(PACKET_LINK) +#define PACKET_LINK +#endif + #endif //__RADIOCONFIG_H__ -- 2.39.2