⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 measureclockc.nc

📁 tinyos-2.x.rar
💻 NC
字号:
#include "scale.h"

/**
 * Simulation version of MeasureClockC for the mica platform. See 
 * tos/platforms/mica/MeasureClockC.nc for more details.
 *
 * @author Phil Levis
 */

module MeasureClockC {
  /* This code MUST be called from PlatformP only, hence the exactlyonce */
  provides interface Init @exactlyonce();

  provides {
    command uint16_t cyclesPerJiffy();
    command uint32_t calibrateMicro(uint32_t n);
  }
}
implementation 
{
  command error_t Init.init() {
    return SUCCESS;
  }

  command uint16_t cyclesPerJiffy() {
    return (1 << 8);
  }

  command uint32_t calibrateMicro(uint32_t n) {
    return scale32(n + 122, 244, (1 << 32));
  }
}

⌨️ 快捷键说明

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