* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
- *
- * IN NO EVENT SHALL CROSSBOW TECHNOLOGY OR ANY OF ITS LICENSORS BE LIABLE TO
- * ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+ *
+ * IN NO EVENT SHALL CROSSBOW TECHNOLOGY OR ANY OF ITS LICENSORS BE LIABLE TO
+ * ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND NEITHER CROSSBOW NOR ANY LICENSOR HAS ANY
- * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND NEITHER CROSSBOW NOR ANY LICENSOR HAS ANY
+ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
* IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
* UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
* UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
async command void Timer.off() { call Timer.setScale(AVR_CLOCK_OFF); }
//=== Write a new timer scale. ========================================
async command void Timer.off() { call Timer.setScale(AVR_CLOCK_OFF); }
//=== Write a new timer scale. ========================================
-
- async command bool Timer.isOn() {
- return ((Atm128_TIMSK2_t)call TimerCtrl.getInterruptMask()).bits.toie;
+
+ async command bool Timer.isOn() {
+ return ((Atm128_TIMSK2_t)call TimerCtrl.getInterruptMask()).bits.toie;
async command void Compare.reset() { TIFR2 = 1 << OCF2A; }
async command void Compare.start() { SET_BIT(TIMSK2,OCIE2A); }
async command void Compare.stop() { CLR_BIT(TIMSK2,OCIE2A); }
async command void Compare.reset() { TIFR2 = 1 << OCF2A; }
async command void Compare.start() { SET_BIT(TIMSK2,OCIE2A); }
async command void Compare.stop() { CLR_BIT(TIMSK2,OCIE2A); }
- async command bool Compare.test() {
- return ((Atm128_TIFR2_t)call TimerCtrl.getInterruptFlag()).bits.ocfa;
+ async command bool Compare.test() {
+ return ((Atm128_TIFR2_t)call TimerCtrl.getInterruptFlag()).bits.ocfa;
- async command bool Compare.isOn() {
- return ((Atm128_TIMSK2_t)call TimerCtrl.getInterruptMask()).bits.ociea;
+ async command bool Compare.isOn() {
+ return ((Atm128_TIMSK2_t)call TimerCtrl.getInterruptMask()).bits.ociea;
}
//=== Read the compare registers. =====================================
async command uint8_t Compare.get(){ return OCR2A; }
//=== Write the compare registers. ====================================
}
//=== Read the compare registers. =====================================
async command uint8_t Compare.get(){ return OCR2A; }
//=== Write the compare registers. ====================================
* is needed. If the timer is not running it returns POWER_DOWN.
* Please refer to TEP 112 and the atm128 datasheet for details.
*/
* is needed. If the timer is not running it returns POWER_DOWN.
* Please refer to TEP 112 and the atm128 datasheet for details.
*/
async command mcu_power_t McuPowerOverride.lowestState() {
uint8_t diff;
// We need to make sure that the sleep wakeup latency will not
async command mcu_power_t McuPowerOverride.lowestState() {
uint8_t diff;
// We need to make sure that the sleep wakeup latency will not
if (TIMSK2 & (1 << OCIE2A | 1 << TOIE2)) {
// need to wait for timer 2 updates propagate before sleeping
// (we don't need to worry about reentering sleep mode too early,
if (TIMSK2 & (1 << OCIE2A | 1 << TOIE2)) {
// need to wait for timer 2 updates propagate before sleeping
// (we don't need to worry about reentering sleep mode too early,