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

📄 reprogramguardp.nc

📁 tinyos-2.x.rar
💻 NC
字号:
module ReprogramGuardP
{
  provides interface ReprogramGuard;
  uses interface Read<uint16_t> as Voltage;
}

implementation
{
  enum {
    VTHRESH = 0xE66, // 2.7V
  };

  command error_t ReprogramGuard.okToProgram()
  {
    return call Voltage.read();
  }

  event void Voltage.readDone(error_t result, uint16_t val)
  {
    signal ReprogramGuard.okToProgramDone(result == SUCCESS && val > VTHRESH);
  }
  
}

⌨️ 快捷键说明

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