timesyncc.nc

来自「tinyos2.0版本驱动」· NC 代码 · 共 73 行

NC
73
字号
/* * Copyright (c) 2002, Vanderbilt University * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE VANDERBILT UNIVERSITY HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * Author: Miklos Maroti, Brano Kusy, Janos Sallai * Date last modified: 3/17/03 * Ported to T2: 3/17/08 by Brano Kusy (branislav.kusy@gmail.com) */#include "TimeSyncMsg.h"configuration TimeSyncC{  uses interface Boot;  provides interface Init;  provides interface StdControl;  provides interface GlobalTime<TMilli>;  //interfaces for extra fcionality: need not to be wired  provides interface TimeSyncInfo;  provides interface TimeSyncMode;  provides interface TimeSyncNotify;}implementation{  components new TimeSyncP(TMilli);  GlobalTime      =   TimeSyncP;  StdControl      =   TimeSyncP;  Init            =   TimeSyncP;  Boot            =   TimeSyncP;  TimeSyncInfo    =   TimeSyncP;  TimeSyncMode    =   TimeSyncP;  TimeSyncNotify  =   TimeSyncP;  components TimeSyncMessageC as ActiveMessageC;  TimeSyncP.RadioControl    ->  ActiveMessageC;  TimeSyncP.Send            ->  ActiveMessageC.TimeSyncAMSendMilli[AM_TIMESYNCMSG];  TimeSyncP.Receive         ->  ActiveMessageC.Receive[AM_TIMESYNCMSG];  TimeSyncP.TimeSyncPacket  ->  ActiveMessageC;  components HilTimerMilliC;  TimeSyncP.LocalTime       ->  HilTimerMilliC;  components new TimerMilliC() as TimerC;  TimeSyncP.Timer ->  TimerC;#if defined(TIMESYNC_LEDS)  components LedsC;#else  components NoLedsC as LedsC;#endif  TimeSyncP.Leds  ->  LedsC;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?