[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/pxa27x/timer HalPXA27xAlarmM.nc, 1.2, 1.3 BusyWait32khzC.nc, 1.2, 1.3 HplPXA27xOSTimer.nc, 1.2, 1.3 CounterMilliC.nc, 1.2, 1.3 HalPXA27xOSTimerMapC.nc, 1.2, 1.3 HalPXA27xBusyWaitM.nc, 1.2, 1.3 HplPXA27xOSTimerWatchdog.nc, 1.2, 1.3 HalPXA27xCounterM.nc, 1.2, 1.3 Alarm32khzC.nc, 1.2, 1.3 HplPXA27xOSTimerC.nc, 1.2, 1.3 HplPXA27xOSTimerM.nc, 1.2, 1.3 Counter32khzC.nc, 1.2, 1.3 AlarmMilliC.nc, 1.2, 1.3 BusyWaitMicroC.nc, 1.2, 1.3

Razvan Musaloiu-E. razvanm at users.sourceforge.net
Tue Jun 10 17:42:18 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9551/chips/pxa27x/timer

Modified Files:
	HalPXA27xAlarmM.nc BusyWait32khzC.nc HplPXA27xOSTimer.nc 
	CounterMilliC.nc HalPXA27xOSTimerMapC.nc HalPXA27xBusyWaitM.nc 
	HplPXA27xOSTimerWatchdog.nc HalPXA27xCounterM.nc 
	Alarm32khzC.nc HplPXA27xOSTimerC.nc HplPXA27xOSTimerM.nc 
	Counter32khzC.nc AlarmMilliC.nc BusyWaitMicroC.nc 
Log Message:
Convert to Unix-style line terminators.


Index: HalPXA27xAlarmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/HalPXA27xAlarmM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HalPXA27xAlarmM.nc	12 Jul 2006 17:01:55 -0000	1.2
--- HalPXA27xAlarmM.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,174 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! // @author Phil Buonadonna
! 
! #include "Timer.h"
! 
! generic module HalPXA27xAlarmM(typedef frequency_tag, uint8_t resolution) 
! {
!   provides {
!     interface Init;
!     interface Alarm<frequency_tag,uint32_t> as Alarm;
!   }
!   uses {
!     interface Init as OSTInit;
!     interface HplPXA27xOSTimer as OSTChnl;
!   }
! }
! 
! implementation
! {
!   bool mfRunning;
!   uint32_t mMinDeltaT;
! 
!   task void lateAlarm() {
!     atomic {
!       mfRunning = FALSE;
!       signal Alarm.fired();
!     }
!   }
!   
!   command error_t Init.init() {
! 
!     call OSTInit.init(); 
!     // Continue on match, Non-periodic, w/ given resolution
!     atomic {
!       mfRunning = FALSE;
!       switch (resolution) {
!       case 1: // 1/32768 second
! 	mMinDeltaT = 10;
! 	break;
!       case 2: // 1 ms
! 	mMinDeltaT = 1;
! 	break;
!       case 3: // 1 s
! 	mMinDeltaT = 1;
! 	break;
!       case 4: // 1 us
! 	mMinDeltaT = 300;
! 	break;
!       default:  // External
! 	mMinDeltaT = 0;
! 	break;
!       }
!       call OSTChnl.setOMCR(OMCR_C | OMCR_P | OMCR_CRES(resolution));
!       call OSTChnl.setOSCR(0);
!     }
!     return SUCCESS;
! 
!   }
! 
!   async command void Alarm.start( uint32_t dt ) {
!     uint32_t t0,t1,tf;
!     //uint32_t cycles;
!     bool bPending;
!     if (dt < mMinDeltaT) dt = mMinDeltaT;
! 
!     atomic {
!       //_pxa27x_perf_clear();
!       t0 = call OSTChnl.getOSCR();
!       tf = t0 + dt;
!       call OSTChnl.setOIERbit(TRUE);
!       call OSTChnl.setOSMR(tf);
!       //_pxa27x_perf_get(cycles);
!       mfRunning = TRUE;
!       t1 = call OSTChnl.getOSCR();
!       bPending = call OSTChnl.getOSSRbit();
!       if ((dt <= (t1 - t0)) && !(bPending)) {
! 	call OSTChnl.setOIERbit(FALSE);
! 	post lateAlarm();
!       }
!     }
!     return;
!   }
! 
!   async command void Alarm.stop() {
!     atomic {
!       call OSTChnl.setOIERbit(FALSE);
!       mfRunning = FALSE;
!     }
!     return;
!   }
! 
!   async command bool Alarm.isRunning() {
!     bool flag;
! 
!     atomic flag = mfRunning;
!     return flag;
!   }
! 
!   async command void Alarm.startAt( uint32_t t0, uint32_t dt ) {
!     uint32_t tf,t1;
!     bool bPending;
!     tf = t0 + dt;
! 
!     atomic {
!       call OSTChnl.setOIERbit(TRUE);
!       call OSTChnl.setOSMR(tf);
!       mfRunning = TRUE;
!       t1 = call OSTChnl.getOSCR();
!       bPending = call OSTChnl.getOSSRbit();
!       if ((dt <= (t1 - t0)) && !(bPending)) {
! 	call OSTChnl.setOIERbit(FALSE);
! 	post lateAlarm();
!       }
!     }
! 
!     return;
!   } 
! 
!   async command uint32_t Alarm.getNow() {
!     return call OSTChnl.getOSCR();
!   }
! 
!   async command uint32_t Alarm.getAlarm() {
!     return call OSTChnl.getOSMR();
!   }
! 
!   async event void OSTChnl.fired() {
!     call OSTChnl.clearOSSRbit();
!     call OSTChnl.setOIERbit(FALSE);
!     mfRunning = FALSE;
!     signal Alarm.fired();
!     return;
!   }
! 
!   default async event void Alarm.fired() {
!     return;
!   }
! 
! 
! }
! 
--- 1,174 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! // @author Phil Buonadonna
! 
! #include "Timer.h"
! 
! generic module HalPXA27xAlarmM(typedef frequency_tag, uint8_t resolution) 
! {
!   provides {
!     interface Init;
!     interface Alarm<frequency_tag,uint32_t> as Alarm;
!   }
!   uses {
!     interface Init as OSTInit;
!     interface HplPXA27xOSTimer as OSTChnl;
!   }
! }
! 
! implementation
! {
!   bool mfRunning;
!   uint32_t mMinDeltaT;
! 
!   task void lateAlarm() {
!     atomic {
!       mfRunning = FALSE;
!       signal Alarm.fired();
!     }
!   }
!   
!   command error_t Init.init() {
! 
!     call OSTInit.init(); 
!     // Continue on match, Non-periodic, w/ given resolution
!     atomic {
!       mfRunning = FALSE;
!       switch (resolution) {
!       case 1: // 1/32768 second
! 	mMinDeltaT = 10;
! 	break;
!       case 2: // 1 ms
! 	mMinDeltaT = 1;
! 	break;
!       case 3: // 1 s
! 	mMinDeltaT = 1;
! 	break;
!       case 4: // 1 us
! 	mMinDeltaT = 300;
! 	break;
!       default:  // External
! 	mMinDeltaT = 0;
! 	break;
!       }
!       call OSTChnl.setOMCR(OMCR_C | OMCR_P | OMCR_CRES(resolution));
!       call OSTChnl.setOSCR(0);
!     }
!     return SUCCESS;
! 
!   }
! 
!   async command void Alarm.start( uint32_t dt ) {
!     uint32_t t0,t1,tf;
!     //uint32_t cycles;
!     bool bPending;
!     if (dt < mMinDeltaT) dt = mMinDeltaT;
! 
!     atomic {
!       //_pxa27x_perf_clear();
!       t0 = call OSTChnl.getOSCR();
!       tf = t0 + dt;
!       call OSTChnl.setOIERbit(TRUE);
!       call OSTChnl.setOSMR(tf);
!       //_pxa27x_perf_get(cycles);
!       mfRunning = TRUE;
!       t1 = call OSTChnl.getOSCR();
!       bPending = call OSTChnl.getOSSRbit();
!       if ((dt <= (t1 - t0)) && !(bPending)) {
! 	call OSTChnl.setOIERbit(FALSE);
! 	post lateAlarm();
!       }
!     }
!     return;
!   }
! 
!   async command void Alarm.stop() {
!     atomic {
!       call OSTChnl.setOIERbit(FALSE);
!       mfRunning = FALSE;
!     }
!     return;
!   }
! 
!   async command bool Alarm.isRunning() {
!     bool flag;
! 
!     atomic flag = mfRunning;
!     return flag;
!   }
! 
!   async command void Alarm.startAt( uint32_t t0, uint32_t dt ) {
!     uint32_t tf,t1;
!     bool bPending;
!     tf = t0 + dt;
! 
!     atomic {
!       call OSTChnl.setOIERbit(TRUE);
!       call OSTChnl.setOSMR(tf);
!       mfRunning = TRUE;
!       t1 = call OSTChnl.getOSCR();
!       bPending = call OSTChnl.getOSSRbit();
!       if ((dt <= (t1 - t0)) && !(bPending)) {
! 	call OSTChnl.setOIERbit(FALSE);
! 	post lateAlarm();
!       }
!     }
! 
!     return;
!   } 
! 
!   async command uint32_t Alarm.getNow() {
!     return call OSTChnl.getOSCR();
!   }
! 
!   async command uint32_t Alarm.getAlarm() {
!     return call OSTChnl.getOSMR();
!   }
! 
!   async event void OSTChnl.fired() {
!     call OSTChnl.clearOSSRbit();
!     call OSTChnl.setOIERbit(FALSE);
!     mfRunning = FALSE;
!     signal Alarm.fired();
!     return;
!   }
! 
!   default async event void Alarm.fired() {
!     return;
!   }
! 
! 
! }
! 

Index: BusyWait32khzC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/BusyWait32khzC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BusyWait32khzC.nc	12 Jul 2006 17:01:55 -0000	1.2
--- BusyWait32khzC.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,49 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /**
!  * This configuration piggybacks off of the TOS 2.0 Counter32khzC component.
!  * This component manages initialization of the underlying Timer components.
!  *
!  * @author Phil Buonadonna
!  */
! configuration BusyWait32khzC
! {
!   provides interface BusyWait<T32khz,uint16_t> as BusyWait32khz16;
! }
! 
! implementation 
! {
!   components new HalPXA27xBusyWaitPM(T32khz,397) as PXA27xBusyWait32khz;
!   components HplPXA27xOSTimerC;
! 
!   BusyWait32khz16 = PXA27xBusyWait32khz.BusyWait;
!   
!   PXA27xBusyWait32khz.OST -> HplPXA27xOSTimerC.OST0;
! }
--- 1,49 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /**
!  * This configuration piggybacks off of the TOS 2.0 Counter32khzC component.
!  * This component manages initialization of the underlying Timer components.
!  *
!  * @author Phil Buonadonna
!  */
! configuration BusyWait32khzC
! {
!   provides interface BusyWait<T32khz,uint16_t> as BusyWait32khz16;
! }
! 
! implementation 
! {
!   components new HalPXA27xBusyWaitPM(T32khz,397) as PXA27xBusyWait32khz;
!   components HplPXA27xOSTimerC;
! 
!   BusyWait32khz16 = PXA27xBusyWait32khz.BusyWait;
!   
!   PXA27xBusyWait32khz.OST -> HplPXA27xOSTimerC.OST0;
! }

Index: HplPXA27xOSTimer.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/HplPXA27xOSTimer.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HplPXA27xOSTimer.nc	12 Jul 2006 17:01:56 -0000	1.2
--- HplPXA27xOSTimer.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,141 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /**
!  * This interface exposes a single OS Timer channel 
!  * on the PXA27x processor. Each channel includes a counter register 
!  * (OSCRx), a match register (OSMRx), a match control register (OMCRx) 
!  * and support for events on each channel. 
!  *
!  * Do not confuse this HPL interface with the generic 'Timer' interface 
!  * provided by TOS 2.x. They are completely different.
!  *
!  * Channels 0 thru 3 are the PXA25x compatibility timers. There are NO
!  * match control register for these channels. 
!  * Calls to getOSCR/setOSCR for channels 1 thru 3 are remmaped to OSCR0.
!  * 
!  * There may be additional configured inter-dependencies between the timer
!  * channels. Refer to the PXA27x Developer's Guide for more information.
!  *
!  * @author Phil Buonadonna
!  */
! 
! interface HplPXA27xOSTimer
! {
!   /**
!    * Set/initialize the counter register (OSCRx) for the channel
!    *
!    * @param val Desired value to initialize/reset the counter register to.
!    * 
!    */
!   async command void setOSCR(uint32_t val);
! 
!   /**
!    * Get the current counter register (OSCRx) value for the channel.
!    *
!    * @return value The 32-bit value of the counter register.
!    */
!   async command uint32_t getOSCR();
! 
!   /**
!    * Set the match register (OSMRx) for the channel.
!    *
!    * @param val The desired 32-bit match value.
!    */
!   async command void setOSMR(uint32_t val);
! 
!   /**
!    * Get the current match register (OSMRx) value for the channel.
!    *
!    * @return value The 32-bit value of the match register.
!    */
!   async command uint32_t getOSMR();
! 
!   /**
!    * Set the timer channel match control register (OMCRx).
!    * 
!    * @param val The desired OMCR value.
!    */
!   async command void setOMCR(uint32_t val);
! 
!   /**
!    * Get the current channel match control register (OMCRx) setting.
!    * 
!    * @return value The current OMCR value.
!    */
!   async command uint32_t getOMCR();
! 
!   /**
!    * Returns the bit value of the OSSR register corresponding to the 
!    * channel. Indicates if a match event has ocurred.
!    *
!    * @return flag TRUE if an event is signaled (OSSR.M{n} is set). 
!    * FALSE otherwise 
!    *  
!    *
!    */
!   async command bool getOSSRbit();
! 
!   /**
!    * Clears the bit position of the OSSR register corresponding to the
!    * channel. Returns the value of the bit before clearing.
!    *
!    * @return flag TRUE if an event is signaled (OSSR.M{n} set) prior 
!    * to clearing. FALSE otherwise.
!    */
!   async command bool clearOSSRbit();
! 
!   /**
!    * Sets the OIER bit corresponding to the timer match channel.
!    *
!    * @param flag TRUE to set the OIER bit, FALSE to clear.
!    */
!   async command void setOIERbit(bool flag);
! 
!   /**
!    * Returns the setting of the OIER bit corresponding to the timer
!    * match channel.
!    * 
!    * @return flag TRUE if set, FALSE if not set.
!    */
!   async command bool getOIERbit();
! 
!   /** 
!    * Get the snapshot register (OSNR) value. 
!    * Any parameterization of this function is ignored.
!    */
!   async command uint32_t getOSNR();
! 
!   /**
!    * Timer channel interrupt. Fired when the channel match register matches 
!    * configured 
!    */
!   async event void fired();
! 
! }
--- 1,141 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /**
!  * This interface exposes a single OS Timer channel 
!  * on the PXA27x processor. Each channel includes a counter register 
!  * (OSCRx), a match register (OSMRx), a match control register (OMCRx) 
!  * and support for events on each channel. 
!  *
!  * Do not confuse this HPL interface with the generic 'Timer' interface 
!  * provided by TOS 2.x. They are completely different.
!  *
!  * Channels 0 thru 3 are the PXA25x compatibility timers. There are NO
!  * match control register for these channels. 
!  * Calls to getOSCR/setOSCR for channels 1 thru 3 are remmaped to OSCR0.
!  * 
!  * There may be additional configured inter-dependencies between the timer
!  * channels. Refer to the PXA27x Developer's Guide for more information.
!  *
!  * @author Phil Buonadonna
!  */
! 
! interface HplPXA27xOSTimer
! {
!   /**
!    * Set/initialize the counter register (OSCRx) for the channel
!    *
!    * @param val Desired value to initialize/reset the counter register to.
!    * 
!    */
!   async command void setOSCR(uint32_t val);
! 
!   /**
!    * Get the current counter register (OSCRx) value for the channel.
!    *
!    * @return value The 32-bit value of the counter register.
!    */
!   async command uint32_t getOSCR();
! 
!   /**
!    * Set the match register (OSMRx) for the channel.
!    *
!    * @param val The desired 32-bit match value.
!    */
!   async command void setOSMR(uint32_t val);
! 
!   /**
!    * Get the current match register (OSMRx) value for the channel.
!    *
!    * @return value The 32-bit value of the match register.
!    */
!   async command uint32_t getOSMR();
! 
!   /**
!    * Set the timer channel match control register (OMCRx).
!    * 
!    * @param val The desired OMCR value.
!    */
!   async command void setOMCR(uint32_t val);
! 
!   /**
!    * Get the current channel match control register (OMCRx) setting.
!    * 
!    * @return value The current OMCR value.
!    */
!   async command uint32_t getOMCR();
! 
!   /**
!    * Returns the bit value of the OSSR register corresponding to the 
!    * channel. Indicates if a match event has ocurred.
!    *
!    * @return flag TRUE if an event is signaled (OSSR.M{n} is set). 
!    * FALSE otherwise 
!    *  
!    *
!    */
!   async command bool getOSSRbit();
! 
!   /**
!    * Clears the bit position of the OSSR register corresponding to the
!    * channel. Returns the value of the bit before clearing.
!    *
!    * @return flag TRUE if an event is signaled (OSSR.M{n} set) prior 
!    * to clearing. FALSE otherwise.
!    */
!   async command bool clearOSSRbit();
! 
!   /**
!    * Sets the OIER bit corresponding to the timer match channel.
!    *
!    * @param flag TRUE to set the OIER bit, FALSE to clear.
!    */
!   async command void setOIERbit(bool flag);
! 
!   /**
!    * Returns the setting of the OIER bit corresponding to the timer
!    * match channel.
!    * 
!    * @return flag TRUE if set, FALSE if not set.
!    */
!   async command bool getOIERbit();
! 
!   /** 
!    * Get the snapshot register (OSNR) value. 
!    * Any parameterization of this function is ignored.
!    */
!   async command uint32_t getOSNR();
! 
!   /**
!    * Timer channel interrupt. Fired when the channel match register matches 
!    * configured 
!    */
!   async event void fired();
! 
! }

Index: CounterMilliC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/CounterMilliC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CounterMilliC.nc	12 Jul 2006 17:01:55 -0000	1.2
--- CounterMilliC.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,58 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! configuration CounterMilliC
! {
!   provides interface Counter<TMilli,uint32_t> as CounterMilli32;
!   provides interface LocalTime<TMilli> as LocalTimeMilli;
! }
! 
! implementation
! {
!   components new HalPXA27xCounterM(TMilli,2) as PhysCounterMilli32;
!   components HalPXA27xOSTimerMapC;
!   components PlatformP;
! 
!   enum {OST_CLIENT_ID = unique("PXA27xOSTimer.Resource")};
! 
!   CounterMilli32 = PhysCounterMilli32.Counter;
!   LocalTimeMilli = PhysCounterMilli32.LocalTime;
! 
!   // Wire the initialization to the plaform init routine
!   PlatformP.InitL0 -> PhysCounterMilli32.Init;
! 
!   PhysCounterMilli32.OSTInit -> HalPXA27xOSTimerMapC.Init;
!   PhysCounterMilli32.OSTChnl -> HalPXA27xOSTimerMapC.OSTChnl[OST_CLIENT_ID];
! }
! 
--- 1,58 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! configuration CounterMilliC
! {
!   provides interface Counter<TMilli,uint32_t> as CounterMilli32;
!   provides interface LocalTime<TMilli> as LocalTimeMilli;
! }
! 
! implementation
! {
!   components new HalPXA27xCounterM(TMilli,2) as PhysCounterMilli32;
!   components HalPXA27xOSTimerMapC;
!   components PlatformP;
! 
!   enum {OST_CLIENT_ID = unique("PXA27xOSTimer.Resource")};
! 
!   CounterMilli32 = PhysCounterMilli32.Counter;
!   LocalTimeMilli = PhysCounterMilli32.LocalTime;
! 
!   // Wire the initialization to the plaform init routine
!   PlatformP.InitL0 -> PhysCounterMilli32.Init;
! 
!   PhysCounterMilli32.OSTInit -> HalPXA27xOSTimerMapC.Init;
!   PhysCounterMilli32.OSTChnl -> HalPXA27xOSTimerMapC.OSTChnl[OST_CLIENT_ID];
! }
! 

Index: HalPXA27xOSTimerMapC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/HalPXA27xOSTimerMapC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HalPXA27xOSTimerMapC.nc	12 Jul 2006 17:01:56 -0000	1.2
--- HalPXA27xOSTimerMapC.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,60 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * This components maps requested timer resources connected using the
!  * 'PXA27xOSTimer.Resource' flag to physical timer resource of the PXA27x.
!  * 
!  * @author Phil Buonadonna
!  *
!  */
! 
! configuration HalPXA27xOSTimerMapC {
! 
!   provides {
!     interface Init;
!     interface HplPXA27xOSTimer as OSTChnl[uint8_t id];
!   }
! }
! 
! implementation {
!   components HplPXA27xOSTimerC;
! 
!   Init = HplPXA27xOSTimerC;
! 
!   OSTChnl[0] = HplPXA27xOSTimerC.OST4;
!   OSTChnl[1] = HplPXA27xOSTimerC.OST5;
!   OSTChnl[2] = HplPXA27xOSTimerC.OST6;
!   OSTChnl[3] = HplPXA27xOSTimerC.OST7;
!   OSTChnl[4] = HplPXA27xOSTimerC.OST8;
!   OSTChnl[5] = HplPXA27xOSTimerC.OST9;
!   OSTChnl[6] = HplPXA27xOSTimerC.OST10;
!   OSTChnl[7] = HplPXA27xOSTimerC.OST11;
! 
! }
--- 1,60 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * This components maps requested timer resources connected using the
!  * 'PXA27xOSTimer.Resource' flag to physical timer resource of the PXA27x.
!  * 
!  * @author Phil Buonadonna
!  *
!  */
! 
! configuration HalPXA27xOSTimerMapC {
! 
!   provides {
!     interface Init;
!     interface HplPXA27xOSTimer as OSTChnl[uint8_t id];
!   }
! }
! 
! implementation {
!   components HplPXA27xOSTimerC;
! 
!   Init = HplPXA27xOSTimerC;
! 
!   OSTChnl[0] = HplPXA27xOSTimerC.OST4;
!   OSTChnl[1] = HplPXA27xOSTimerC.OST5;
!   OSTChnl[2] = HplPXA27xOSTimerC.OST6;
!   OSTChnl[3] = HplPXA27xOSTimerC.OST7;
!   OSTChnl[4] = HplPXA27xOSTimerC.OST8;
!   OSTChnl[5] = HplPXA27xOSTimerC.OST9;
!   OSTChnl[6] = HplPXA27xOSTimerC.OST10;
!   OSTChnl[7] = HplPXA27xOSTimerC.OST11;
! 
! }

Index: HalPXA27xBusyWaitM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/HalPXA27xBusyWaitM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HalPXA27xBusyWaitM.nc	12 Jul 2006 17:01:55 -0000	1.2
--- HalPXA27xBusyWaitM.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,70 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * This private component provides a 16-bit BusyWait interface
!  * of a given precision over OS Timer channel 0
!  *
!  * @param precision_tag A type tag mapped to the set precision
!  *
!  * @param val4xScale A value to scale the underlying counter by. 
!  *   The passed in parameter is given by the equation
!  *   val4xScale = (3.25 MHz/<desired_precision_in_Hz>) * 4
!  *   and rounded to the nearest integer.
!  *   Example: Counter precision of 32.768 kHz would have 
!  *   a val4xScale of 397
!  * 
!  * @author Phil Buonadonna
!  *
!  */
! 
! generic module HalPXA27xBusyWaitM(typedef precision_tag, uint16_t val4xScale)
! {
!   provides interface BusyWait<precision_tag,uint16_t>;
!   uses interface HplPXA27xOSTimer as OST;
! }
! 
! implementation
! {
! 
!   async command void BusyWait.wait(uint16_t dt) {
!     uint32_t dCounts;
!     atomic {
!       uint32_t t0 = call OST.getOSCR();
!       dCounts = (dt * 4) * val4xScale;
!       dCounts >>= 2;
!       while (((call OST.getOSCR()) - t0) < dCounts);
!     }
!   }
! 
!   async event void OST.fired() {
!     return;
!   }
! 
! }
--- 1,70 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * This private component provides a 16-bit BusyWait interface
!  * of a given precision over OS Timer channel 0
!  *
!  * @param precision_tag A type tag mapped to the set precision
!  *
!  * @param val4xScale A value to scale the underlying counter by. 
!  *   The passed in parameter is given by the equation
!  *   val4xScale = (3.25 MHz/<desired_precision_in_Hz>) * 4
!  *   and rounded to the nearest integer.
!  *   Example: Counter precision of 32.768 kHz would have 
!  *   a val4xScale of 397
!  * 
!  * @author Phil Buonadonna
!  *
!  */
! 
! generic module HalPXA27xBusyWaitM(typedef precision_tag, uint16_t val4xScale)
! {
!   provides interface BusyWait<precision_tag,uint16_t>;
!   uses interface HplPXA27xOSTimer as OST;
! }
! 
! implementation
! {
! 
!   async command void BusyWait.wait(uint16_t dt) {
!     uint32_t dCounts;
!     atomic {
!       uint32_t t0 = call OST.getOSCR();
!       dCounts = (dt * 4) * val4xScale;
!       dCounts >>= 2;
!       while (((call OST.getOSCR()) - t0) < dCounts);
!     }
!   }
! 
!   async event void OST.fired() {
!     return;
!   }
! 
! }

Index: HplPXA27xOSTimerWatchdog.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/HplPXA27xOSTimerWatchdog.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HplPXA27xOSTimerWatchdog.nc	12 Jul 2006 17:01:56 -0000	1.2
--- HplPXA27xOSTimerWatchdog.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,46 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! 
! /**
!  * This interface exposes the watchdog control of the PXA27x OS Timer
!  *
!  * Refer to the PXA27x Developer's Guide for more information.
!  *
!  * @author Phil Buonadonna
!  */
! 
! interface HplPXA27xOSTimerWatchdog
! {
!   /** 
!    * Enable the timer-based watchdog reset feature.
!    * Once enabled, this feature may only be disabled by a reset.
!    */
!   async command void enableWatchdog();
! }
--- 1,46 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! 
! /**
!  * This interface exposes the watchdog control of the PXA27x OS Timer
!  *
!  * Refer to the PXA27x Developer's Guide for more information.
!  *
!  * @author Phil Buonadonna
!  */
! 
! interface HplPXA27xOSTimerWatchdog
! {
!   /** 
!    * Enable the timer-based watchdog reset feature.
!    * Once enabled, this feature may only be disabled by a reset.
!    */
!   async command void enableWatchdog();
! }

Index: HalPXA27xCounterM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/HalPXA27xCounterM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HalPXA27xCounterM.nc	12 Jul 2006 17:01:56 -0000	1.2
--- HalPXA27xCounterM.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,109 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! 
! /** 
!  * Implements a TOS 2.0 Counter on the PXA27x HPL. The PXA27x does not 
!  * have an explicit overflow notification. We emulate one by using 
!  * the associated match register set to 0. This requires we initialize
!  * the counter to 1 to avoid a false notification at startup.
!  * 
!  *  @author Phil Buonadonna
!  */
! #include "Timer.h"
! 
! generic module HalPXA27xCounterM(typedef frequency_tag, uint8_t resolution) 
! {
!   provides {
!     interface Init;
!     interface Counter<frequency_tag,uint32_t> as Counter;
!     interface LocalTime<frequency_tag> as LocalTime;
!   }
!   uses {
!     interface Init as OSTInit;
!     interface HplPXA27xOSTimer as OSTChnl;
!   }
! }
! 
! implementation
! {
!   command error_t Init.init() {
! 
!     call OSTInit.init(); 
! 
!     // Continue on match, Non-periodic, w/ given resolution
!     atomic {
!       call OSTChnl.setOMCR(OMCR_C | OMCR_P | OMCR_CRES(resolution));
!       call OSTChnl.setOSMR(0);
!       call OSTChnl.setOSCR(1);
!       call OSTChnl.clearOSSRbit();
!       call OSTChnl.setOIERbit(TRUE);
!     }
!     return SUCCESS;
! 
!   }
!   
!   async command uint32_t Counter.get() {
!     uint32_t cntr;
! 
!     cntr = call OSTChnl.getOSCR();
!     return cntr;
!   }
! 
!   async command bool Counter.isOverflowPending() {
!     bool flag;
! 
!     atomic flag = call OSTChnl.getOSSRbit();
!     return flag;
!   }
! 
!   async command void Counter.clearOverflow() {
! 
!     atomic call OSTChnl.clearOSSRbit();
!   }
! 
!   async event void OSTChnl.fired() {
!     call OSTChnl.clearOSSRbit();
!     signal Counter.overflow();
!     return;
!   }
! 
!   async command uint32_t LocalTime.get() {
!     uint32_t cntr;
! 
!     cntr = call OSTChnl.getOSCR();
!     return cntr;
!   }
! 
!   default async event void Counter.overflow() {
!     return;
!   }
! 
! }
! 
--- 1,109 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! 
! /** 
!  * Implements a TOS 2.0 Counter on the PXA27x HPL. The PXA27x does not 
!  * have an explicit overflow notification. We emulate one by using 
!  * the associated match register set to 0. This requires we initialize
!  * the counter to 1 to avoid a false notification at startup.
!  * 
!  *  @author Phil Buonadonna
!  */
! #include "Timer.h"
! 
! generic module HalPXA27xCounterM(typedef frequency_tag, uint8_t resolution) 
! {
!   provides {
!     interface Init;
!     interface Counter<frequency_tag,uint32_t> as Counter;
!     interface LocalTime<frequency_tag> as LocalTime;
!   }
!   uses {
!     interface Init as OSTInit;
!     interface HplPXA27xOSTimer as OSTChnl;
!   }
! }
! 
! implementation
! {
!   command error_t Init.init() {
! 
!     call OSTInit.init(); 
! 
!     // Continue on match, Non-periodic, w/ given resolution
!     atomic {
!       call OSTChnl.setOMCR(OMCR_C | OMCR_P | OMCR_CRES(resolution));
!       call OSTChnl.setOSMR(0);
!       call OSTChnl.setOSCR(1);
!       call OSTChnl.clearOSSRbit();
!       call OSTChnl.setOIERbit(TRUE);
!     }
!     return SUCCESS;
! 
!   }
!   
!   async command uint32_t Counter.get() {
!     uint32_t cntr;
! 
!     cntr = call OSTChnl.getOSCR();
!     return cntr;
!   }
! 
!   async command bool Counter.isOverflowPending() {
!     bool flag;
! 
!     atomic flag = call OSTChnl.getOSSRbit();
!     return flag;
!   }
! 
!   async command void Counter.clearOverflow() {
! 
!     atomic call OSTChnl.clearOSSRbit();
!   }
! 
!   async event void OSTChnl.fired() {
!     call OSTChnl.clearOSSRbit();
!     signal Counter.overflow();
!     return;
!   }
! 
!   async command uint32_t LocalTime.get() {
!     uint32_t cntr;
! 
!     cntr = call OSTChnl.getOSCR();
!     return cntr;
!   }
! 
!   default async event void Counter.overflow() {
!     return;
!   }
! 
! }
! 

Index: Alarm32khzC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/Alarm32khzC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Alarm32khzC.nc	12 Jul 2006 17:01:55 -0000	1.2
--- Alarm32khzC.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,54 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! generic configuration Alarm32khzC()
! {
!   provides interface Init;
!   provides interface Alarm<T32khz,uint32_t> as Alarm32khz32;
! }
! 
! implementation
! {
!   components new HalPXA27xAlarmM(T32khz,1) as PhysAlarm32khz;
!   components HalPXA27xOSTimerMapC;
! 
!   enum {OST_CLIENT_ID = unique("PXA27xOSTimer.Resource")};
! 
!   Init = PhysAlarm32khz;
!   Alarm32khz32 = PhysAlarm32khz;
! 
!   PhysAlarm32khz.OSTInit -> HalPXA27xOSTimerMapC.Init;
!   PhysAlarm32khz.OSTChnl -> HalPXA27xOSTimerMapC.OSTChnl[OST_CLIENT_ID];
! 
! }
--- 1,54 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! generic configuration Alarm32khzC()
! {
!   provides interface Init;
!   provides interface Alarm<T32khz,uint32_t> as Alarm32khz32;
! }
! 
! implementation
! {
!   components new HalPXA27xAlarmM(T32khz,1) as PhysAlarm32khz;
!   components HalPXA27xOSTimerMapC;
! 
!   enum {OST_CLIENT_ID = unique("PXA27xOSTimer.Resource")};
! 
!   Init = PhysAlarm32khz;
!   Alarm32khz32 = PhysAlarm32khz;
! 
!   PhysAlarm32khz.OSTInit -> HalPXA27xOSTimerMapC.Init;
!   PhysAlarm32khz.OSTChnl -> HalPXA27xOSTimerMapC.OSTChnl[OST_CLIENT_ID];
! 
! }

Index: HplPXA27xOSTimerC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/HplPXA27xOSTimerC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HplPXA27xOSTimerC.nc	12 Jul 2006 17:01:56 -0000	1.2
--- HplPXA27xOSTimerC.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,80 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! configuration HplPXA27xOSTimerC {
! 
!   provides {
!     interface Init;
!     interface HplPXA27xOSTimer as OST0;
!     interface HplPXA27xOSTimer as OST0M1;
!     interface HplPXA27xOSTimer as OST0M2;
!     interface HplPXA27xOSTimer as OST0M3;
!     interface HplPXA27xOSTimer as OST4;
!     interface HplPXA27xOSTimer as OST5;
!     interface HplPXA27xOSTimer as OST6;
!     interface HplPXA27xOSTimer as OST7;
!     interface HplPXA27xOSTimer as OST8;
!     interface HplPXA27xOSTimer as OST9;
!     interface HplPXA27xOSTimer as OST10;
!     interface HplPXA27xOSTimer as OST11;
!     interface HplPXA27xOSTimerWatchdog as OSTWDCntl;
!   }
! 
! }
! 
! implementation {
!   components HplPXA27xOSTimerM, HplPXA27xInterruptM;
! 
!   Init = HplPXA27xOSTimerM;
! 
!   OST0 = HplPXA27xOSTimerM.PXA27xOST[0];
!   OST0M1 = HplPXA27xOSTimerM.PXA27xOST[1];
!   OST0M2 = HplPXA27xOSTimerM.PXA27xOST[2];
!   OST0M3 = HplPXA27xOSTimerM.PXA27xOST[3];
!   OST4 = HplPXA27xOSTimerM.PXA27xOST[4];
!   OST5 = HplPXA27xOSTimerM.PXA27xOST[5];
!   OST6 = HplPXA27xOSTimerM.PXA27xOST[6];
!   OST7 = HplPXA27xOSTimerM.PXA27xOST[7];
!   OST8 = HplPXA27xOSTimerM.PXA27xOST[8];
!   OST9 = HplPXA27xOSTimerM.PXA27xOST[9];
!   OST10 = HplPXA27xOSTimerM.PXA27xOST[10];
!   OST11 = HplPXA27xOSTimerM.PXA27xOST[11];
!   OSTWDCntl = HplPXA27xOSTimerM.PXA27xWD;
!   
!   HplPXA27xOSTimerM.OST0Irq -> HplPXA27xInterruptM.PXA27xIrq[PPID_OST_0];
!   HplPXA27xOSTimerM.OST1Irq -> HplPXA27xInterruptM.PXA27xIrq[PPID_OST_1];
!   HplPXA27xOSTimerM.OST2Irq -> HplPXA27xInterruptM.PXA27xIrq[PPID_OST_2];
!   HplPXA27xOSTimerM.OST3Irq -> HplPXA27xInterruptM.PXA27xIrq[PPID_OST_3];
!   HplPXA27xOSTimerM.OST4_11Irq -> HplPXA27xInterruptM.PXA27xIrq[PPID_OST_4_11];
! }
--- 1,80 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! configuration HplPXA27xOSTimerC {
! 
!   provides {
!     interface Init;
!     interface HplPXA27xOSTimer as OST0;
!     interface HplPXA27xOSTimer as OST0M1;
!     interface HplPXA27xOSTimer as OST0M2;
!     interface HplPXA27xOSTimer as OST0M3;
!     interface HplPXA27xOSTimer as OST4;
!     interface HplPXA27xOSTimer as OST5;
!     interface HplPXA27xOSTimer as OST6;
!     interface HplPXA27xOSTimer as OST7;
!     interface HplPXA27xOSTimer as OST8;
!     interface HplPXA27xOSTimer as OST9;
!     interface HplPXA27xOSTimer as OST10;
!     interface HplPXA27xOSTimer as OST11;
!     interface HplPXA27xOSTimerWatchdog as OSTWDCntl;
!   }
! 
! }
! 
! implementation {
!   components HplPXA27xOSTimerM, HplPXA27xInterruptM;
! 
!   Init = HplPXA27xOSTimerM;
! 
!   OST0 = HplPXA27xOSTimerM.PXA27xOST[0];
!   OST0M1 = HplPXA27xOSTimerM.PXA27xOST[1];
!   OST0M2 = HplPXA27xOSTimerM.PXA27xOST[2];
!   OST0M3 = HplPXA27xOSTimerM.PXA27xOST[3];
!   OST4 = HplPXA27xOSTimerM.PXA27xOST[4];
!   OST5 = HplPXA27xOSTimerM.PXA27xOST[5];
!   OST6 = HplPXA27xOSTimerM.PXA27xOST[6];
!   OST7 = HplPXA27xOSTimerM.PXA27xOST[7];
!   OST8 = HplPXA27xOSTimerM.PXA27xOST[8];
!   OST9 = HplPXA27xOSTimerM.PXA27xOST[9];
!   OST10 = HplPXA27xOSTimerM.PXA27xOST[10];
!   OST11 = HplPXA27xOSTimerM.PXA27xOST[11];
!   OSTWDCntl = HplPXA27xOSTimerM.PXA27xWD;
!   
!   HplPXA27xOSTimerM.OST0Irq -> HplPXA27xInterruptM.PXA27xIrq[PPID_OST_0];
!   HplPXA27xOSTimerM.OST1Irq -> HplPXA27xInterruptM.PXA27xIrq[PPID_OST_1];
!   HplPXA27xOSTimerM.OST2Irq -> HplPXA27xInterruptM.PXA27xIrq[PPID_OST_2];
!   HplPXA27xOSTimerM.OST3Irq -> HplPXA27xInterruptM.PXA27xIrq[PPID_OST_3];
!   HplPXA27xOSTimerM.OST4_11Irq -> HplPXA27xInterruptM.PXA27xIrq[PPID_OST_4_11];
! }

Index: HplPXA27xOSTimerM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/HplPXA27xOSTimerM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** HplPXA27xOSTimerM.nc	12 Jul 2006 17:01:56 -0000	1.2
--- HplPXA27xOSTimerM.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,241 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! 
! module HplPXA27xOSTimerM {
!   provides {
!     interface Init;
!     interface HplPXA27xOSTimer as PXA27xOST[uint8_t chnl_id];
!     interface HplPXA27xOSTimerWatchdog as PXA27xWD;
!   }
!   uses {
!     interface HplPXA27xInterrupt as OST0Irq;
!     interface HplPXA27xInterrupt as OST1Irq;
!     interface HplPXA27xInterrupt as OST2Irq;
!     interface HplPXA27xInterrupt as OST3Irq;
!     interface HplPXA27xInterrupt as OST4_11Irq;
!   }
! }
! 
! implementation {
! 
!   bool gfInitialized = FALSE;
! 
!   void DispatchOSTInterrupt(uint8_t id)
!   {
!     signal PXA27xOST.fired[id]();
!     return;
!   }
! 
!   command error_t Init.init()
!   {
!     bool initflag;
!     atomic {
!       initflag = gfInitialized;
!       gfInitialized = TRUE;
!     }
!     
!     if (!initflag) {
!       OIER = 0x0UL;
!       OSSR = 0xFFFFFFFF; // Clear all status bits.
!       call OST0Irq.allocate();
!       call OST1Irq.allocate();
!       call OST2Irq.allocate();
!       call OST3Irq.allocate();
!       call OST4_11Irq.allocate();
!       call OST0Irq.enable();
!       call OST1Irq.enable();
!       call OST2Irq.enable();
!       call OST3Irq.enable();
!       call OST4_11Irq.enable();
!     }
! 
!     return SUCCESS;
!   }
!   
!   async command void PXA27xOST.setOSCR[uint8_t chnl_id](uint32_t val) 
!   {
!     uint8_t remap_id;
! 
!     remap_id = ((chnl_id < 4) ? (0) : (chnl_id));
!     OSCR(remap_id) = val;
! 
!     return;
!   }
!   
!   async command uint32_t PXA27xOST.getOSCR[uint8_t chnl_id]()
!   {
!     uint8_t remap_id;
!     uint32_t val;
! 
!     remap_id = ((chnl_id < 4) ? (0) : (chnl_id));
!     val = OSCR(remap_id);
! 
!     return val;
!   }
!   
!   async command void PXA27xOST.setOSMR[uint8_t chnl_id](uint32_t val)
!   {
!     OSMR(chnl_id) = val;
!     return;
!   }
! 
!   async command uint32_t PXA27xOST.getOSMR[uint8_t chnl_id]()
!   {
!     uint32_t val;
!     val = OSMR(chnl_id);
!     return val;
!   }
! 
!   async command void PXA27xOST.setOMCR[uint8_t chnl_id](uint32_t val)
!   {
!     if (chnl_id > 3) {
!       OMCR(chnl_id) = val;
!     }
!     return;
!   }
! 
!   async command uint32_t PXA27xOST.getOMCR[uint8_t chnl_id]()
!   {
!     uint32_t val = 0;
!     if (chnl_id > 3) {
!       val = OMCR(chnl_id);
!     }
!     return val;
!   }
! 
!   async command bool PXA27xOST.getOSSRbit[uint8_t chnl_id]() 
!   {
!     bool bFlag = FALSE;
!     
!     if (((OSSR) & (1 << chnl_id)) != 0) {
!       bFlag = TRUE;
!     }
! 
!     return bFlag;
!   }
! 
!   async command bool PXA27xOST.clearOSSRbit[uint8_t chnl_id]()
!   {
!     bool bFlag = FALSE;
! 
!     if (((OSSR) & (1 << chnl_id)) != 0) {
!       bFlag = TRUE;
!     }
! 
!     // Clear the bit value
!     OSSR = (1 << chnl_id);
! 
!     return bFlag;
!   }
! 
!   async command void PXA27xOST.setOIERbit[uint8_t chnl_id](bool flag)
!   {
!     if (flag == TRUE) {
!       OIER |= (1 << chnl_id);
!     }
!     else {
!       OIER &= ~(1 << chnl_id);      
!     }
!     return;
!   }
!   
!   async command bool PXA27xOST.getOIERbit[uint8_t chnl_id]()
!   {
!     return ((OIER & (1 << chnl_id)) != 0);
!   }
! 
!   async command uint32_t PXA27xOST.getOSNR[uint8_t chnl_id]() 
!   {
!     uint32_t val;
!     val = OSNR;
!     return val;
!   }
! 
!   async command void PXA27xWD.enableWatchdog() 
!   {
!     OWER = OWER_WME;
!   }
! 
! 
!   // All interrupts are funneled through DispatchOSTInterrupt.
!   // This should not have any impact on performance and simplifies
!   // the software implementation.
! 
!   async event void OST0Irq.fired() 
!   {
!     DispatchOSTInterrupt(0);
!   }
!   
!   async event void OST1Irq.fired() 
!   {
!     DispatchOSTInterrupt(1);
!   }
!   
!   async event void OST2Irq.fired() 
!   {
!     DispatchOSTInterrupt(2);
!   }
! 
!   async event void OST3Irq.fired() 
!   {
!     DispatchOSTInterrupt(3);
!   }
! 
!   async event void OST4_11Irq.fired() 
!   {
!     uint32_t statusReg;
!     uint8_t chnl;
! 
!     statusReg = OSSR;
!     statusReg &= ~(OSSR_M3 | OSSR_M2 | OSSR_M1 | OSSR_M0);
! 
!     while (statusReg) {
!       chnl = 31 - _pxa27x_clzui(statusReg);
!       DispatchOSTInterrupt(chnl); 
!       statusReg &= ~(1 << chnl);
!     }
!       
!     return;
!   }
! 
!   default async event void PXA27xOST.fired[uint8_t chnl_id]() 
!   {
!     call PXA27xOST.setOIERbit[chnl_id](FALSE);
!     call PXA27xOST.clearOSSRbit[chnl_id]();
!     return;
!   }
! 
! }
!   
--- 1,241 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! 
! module HplPXA27xOSTimerM {
!   provides {
!     interface Init;
!     interface HplPXA27xOSTimer as PXA27xOST[uint8_t chnl_id];
!     interface HplPXA27xOSTimerWatchdog as PXA27xWD;
!   }
!   uses {
!     interface HplPXA27xInterrupt as OST0Irq;
!     interface HplPXA27xInterrupt as OST1Irq;
!     interface HplPXA27xInterrupt as OST2Irq;
!     interface HplPXA27xInterrupt as OST3Irq;
!     interface HplPXA27xInterrupt as OST4_11Irq;
!   }
! }
! 
! implementation {
! 
!   bool gfInitialized = FALSE;
! 
!   void DispatchOSTInterrupt(uint8_t id)
!   {
!     signal PXA27xOST.fired[id]();
!     return;
!   }
! 
!   command error_t Init.init()
!   {
!     bool initflag;
!     atomic {
!       initflag = gfInitialized;
!       gfInitialized = TRUE;
!     }
!     
!     if (!initflag) {
!       OIER = 0x0UL;
!       OSSR = 0xFFFFFFFF; // Clear all status bits.
!       call OST0Irq.allocate();
!       call OST1Irq.allocate();
!       call OST2Irq.allocate();
!       call OST3Irq.allocate();
!       call OST4_11Irq.allocate();
!       call OST0Irq.enable();
!       call OST1Irq.enable();
!       call OST2Irq.enable();
!       call OST3Irq.enable();
!       call OST4_11Irq.enable();
!     }
! 
!     return SUCCESS;
!   }
!   
!   async command void PXA27xOST.setOSCR[uint8_t chnl_id](uint32_t val) 
!   {
!     uint8_t remap_id;
! 
!     remap_id = ((chnl_id < 4) ? (0) : (chnl_id));
!     OSCR(remap_id) = val;
! 
!     return;
!   }
!   
!   async command uint32_t PXA27xOST.getOSCR[uint8_t chnl_id]()
!   {
!     uint8_t remap_id;
!     uint32_t val;
! 
!     remap_id = ((chnl_id < 4) ? (0) : (chnl_id));
!     val = OSCR(remap_id);
! 
!     return val;
!   }
!   
!   async command void PXA27xOST.setOSMR[uint8_t chnl_id](uint32_t val)
!   {
!     OSMR(chnl_id) = val;
!     return;
!   }
! 
!   async command uint32_t PXA27xOST.getOSMR[uint8_t chnl_id]()
!   {
!     uint32_t val;
!     val = OSMR(chnl_id);
!     return val;
!   }
! 
!   async command void PXA27xOST.setOMCR[uint8_t chnl_id](uint32_t val)
!   {
!     if (chnl_id > 3) {
!       OMCR(chnl_id) = val;
!     }
!     return;
!   }
! 
!   async command uint32_t PXA27xOST.getOMCR[uint8_t chnl_id]()
!   {
!     uint32_t val = 0;
!     if (chnl_id > 3) {
!       val = OMCR(chnl_id);
!     }
!     return val;
!   }
! 
!   async command bool PXA27xOST.getOSSRbit[uint8_t chnl_id]() 
!   {
!     bool bFlag = FALSE;
!     
!     if (((OSSR) & (1 << chnl_id)) != 0) {
!       bFlag = TRUE;
!     }
! 
!     return bFlag;
!   }
! 
!   async command bool PXA27xOST.clearOSSRbit[uint8_t chnl_id]()
!   {
!     bool bFlag = FALSE;
! 
!     if (((OSSR) & (1 << chnl_id)) != 0) {
!       bFlag = TRUE;
!     }
! 
!     // Clear the bit value
!     OSSR = (1 << chnl_id);
! 
!     return bFlag;
!   }
! 
!   async command void PXA27xOST.setOIERbit[uint8_t chnl_id](bool flag)
!   {
!     if (flag == TRUE) {
!       OIER |= (1 << chnl_id);
!     }
!     else {
!       OIER &= ~(1 << chnl_id);      
!     }
!     return;
!   }
!   
!   async command bool PXA27xOST.getOIERbit[uint8_t chnl_id]()
!   {
!     return ((OIER & (1 << chnl_id)) != 0);
!   }
! 
!   async command uint32_t PXA27xOST.getOSNR[uint8_t chnl_id]() 
!   {
!     uint32_t val;
!     val = OSNR;
!     return val;
!   }
! 
!   async command void PXA27xWD.enableWatchdog() 
!   {
!     OWER = OWER_WME;
!   }
! 
! 
!   // All interrupts are funneled through DispatchOSTInterrupt.
!   // This should not have any impact on performance and simplifies
!   // the software implementation.
! 
!   async event void OST0Irq.fired() 
!   {
!     DispatchOSTInterrupt(0);
!   }
!   
!   async event void OST1Irq.fired() 
!   {
!     DispatchOSTInterrupt(1);
!   }
!   
!   async event void OST2Irq.fired() 
!   {
!     DispatchOSTInterrupt(2);
!   }
! 
!   async event void OST3Irq.fired() 
!   {
!     DispatchOSTInterrupt(3);
!   }
! 
!   async event void OST4_11Irq.fired() 
!   {
!     uint32_t statusReg;
!     uint8_t chnl;
! 
!     statusReg = OSSR;
!     statusReg &= ~(OSSR_M3 | OSSR_M2 | OSSR_M1 | OSSR_M0);
! 
!     while (statusReg) {
!       chnl = 31 - _pxa27x_clzui(statusReg);
!       DispatchOSTInterrupt(chnl); 
!       statusReg &= ~(1 << chnl);
!     }
!       
!     return;
!   }
! 
!   default async event void PXA27xOST.fired[uint8_t chnl_id]() 
!   {
!     call PXA27xOST.setOIERbit[chnl_id](FALSE);
!     call PXA27xOST.clearOSSRbit[chnl_id]();
!     return;
!   }
! 
! }
!   

Index: Counter32khzC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/Counter32khzC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Counter32khzC.nc	12 Jul 2006 17:01:55 -0000	1.2
--- Counter32khzC.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,57 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! configuration Counter32khzC
! {
!   provides interface Counter<T32khz,uint32_t> as Counter32khz32;
!   provides interface LocalTime<T32khz> as LocalTime32khz;
! }
! 
! implementation
! {
!   components new HalPXA27xCounterM(T32khz,1) as PhysCounter32khz32;
!   components HalPXA27xOSTimerMapC;
!   components PlatformP;
! 
!   enum {OST_CLIENT_ID = unique("PXA27xOSTimer.Resource")};
! 
!   Counter32khz32 = PhysCounter32khz32.Counter;
!   LocalTime32khz = PhysCounter32khz32.LocalTime;
! 
!   // Wire the initialization to the platform init routine
!   PlatformP.InitL0 -> PhysCounter32khz32.Init;
! 
!   PhysCounter32khz32.OSTInit -> HalPXA27xOSTimerMapC.Init;
!   PhysCounter32khz32.OSTChnl -> HalPXA27xOSTimerMapC.OSTChnl[OST_CLIENT_ID];
! }
--- 1,57 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! 
! configuration Counter32khzC
! {
!   provides interface Counter<T32khz,uint32_t> as Counter32khz32;
!   provides interface LocalTime<T32khz> as LocalTime32khz;
! }
! 
! implementation
! {
!   components new HalPXA27xCounterM(T32khz,1) as PhysCounter32khz32;
!   components HalPXA27xOSTimerMapC;
!   components PlatformP;
! 
!   enum {OST_CLIENT_ID = unique("PXA27xOSTimer.Resource")};
! 
!   Counter32khz32 = PhysCounter32khz32.Counter;
!   LocalTime32khz = PhysCounter32khz32.LocalTime;
! 
!   // Wire the initialization to the platform init routine
!   PlatformP.InitL0 -> PhysCounter32khz32.Init;
! 
!   PhysCounter32khz32.OSTInit -> HalPXA27xOSTimerMapC.Init;
!   PhysCounter32khz32.OSTChnl -> HalPXA27xOSTimerMapC.OSTChnl[OST_CLIENT_ID];
! }

Index: AlarmMilliC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/AlarmMilliC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AlarmMilliC.nc	12 Jul 2006 17:01:55 -0000	1.2
--- AlarmMilliC.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,53 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! generic configuration AlarmMilliC()
! {
!   provides interface Init;
!   provides interface Alarm<TMilli,uint32_t> as AlarmMilli32;
! }
! 
! implementation
! {
!   components new HalPXA27xAlarmM(TMilli,2) as PhysAlarmMilli;
!   components HalPXA27xOSTimerMapC;
!   
!   enum {OST_CLIENT_ID = unique("PXA27xOSTimer.Resource")};
! 
!   Init = PhysAlarmMilli;
!   AlarmMilli32 = PhysAlarmMilli;
! 
!   PhysAlarmMilli.OSTInit -> HalPXA27xOSTimerMapC.Init;
!   PhysAlarmMilli.OSTChnl -> HalPXA27xOSTimerMapC.OSTChnl[OST_CLIENT_ID];
! 
! }
--- 1,53 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /** 
!  * @author Phil Buonadonna
!  *
!  */
! generic configuration AlarmMilliC()
! {
!   provides interface Init;
!   provides interface Alarm<TMilli,uint32_t> as AlarmMilli32;
! }
! 
! implementation
! {
!   components new HalPXA27xAlarmM(TMilli,2) as PhysAlarmMilli;
!   components HalPXA27xOSTimerMapC;
!   
!   enum {OST_CLIENT_ID = unique("PXA27xOSTimer.Resource")};
! 
!   Init = PhysAlarmMilli;
!   AlarmMilli32 = PhysAlarmMilli;
! 
!   PhysAlarmMilli.OSTInit -> HalPXA27xOSTimerMapC.Init;
!   PhysAlarmMilli.OSTChnl -> HalPXA27xOSTimerMapC.OSTChnl[OST_CLIENT_ID];
! 
! }

Index: BusyWaitMicroC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/timer/BusyWaitMicroC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BusyWaitMicroC.nc	12 Jul 2006 17:01:55 -0000	1.2
--- BusyWaitMicroC.nc	11 Jun 2008 00:42:13 -0000	1.3
***************
*** 1,51 ****
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /**
!  * Implements the BusyWaitMicroC timer component. This component
!  * instantiates a new Counter with Microsecond precision and 
!  * binds it to the BusyWait interface via PXA27xBusyWaitP
!  * 
!  * @author Phil Buonadonna
!  */
! configuration BusyWaitMicroC
! {
!   provides interface BusyWait<TMicro,uint16_t> as BusyWaitMicro16;
! }
! 
! implementation
! {
!   components new HalPXA27xBusyWaitM(TMicro,13) as PXA27xBusyWaitMicro;
!   components HplPXA27xOSTimerC;
! 
!   BusyWaitMicro16 = PXA27xBusyWaitMicro.BusyWait;
! 
!   PXA27xBusyWaitMicro.OST -> HplPXA27xOSTimerC.OST0;
! }
! 
--- 1,51 ----
! /*
!  * Copyright (c) 2005 Arched Rock Corporation 
!  * All rights reserved. 
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions are
!  * met:
!  *	Redistributions of source code must retain the above copyright
!  * notice, this list of conditions and the following disclaimer.
!  *	Redistributions in binary form must reproduce the above copyright
!  * notice, this list of conditions and the following disclaimer in the
!  * documentation and/or other materials provided with the distribution.
!  *  
!  *   Neither the name of the Arched Rock Corporation nor the names of its
!  * contributors may be used to endorse or promote products derived from
!  * this software without specific prior written permission.
!  *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
!  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
!  * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
!  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
!  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
!  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
!  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
!  * DAMAGE.
!  */
! /**
!  * Implements the BusyWaitMicroC timer component. This component
!  * instantiates a new Counter with Microsecond precision and 
!  * binds it to the BusyWait interface via PXA27xBusyWaitP
!  * 
!  * @author Phil Buonadonna
!  */
! configuration BusyWaitMicroC
! {
!   provides interface BusyWait<TMicro,uint16_t> as BusyWaitMicro16;
! }
! 
! implementation
! {
!   components new HalPXA27xBusyWaitM(TMicro,13) as PXA27xBusyWaitMicro;
!   components HplPXA27xOSTimerC;
! 
!   BusyWaitMicro16 = PXA27xBusyWaitMicro.BusyWait;
! 
!   PXA27xBusyWaitMicro.OST -> HplPXA27xOSTimerC.OST0;
! }
! 



More information about the Tinyos-2-commits mailing list