📄 reprogramguardp.nc
字号:
module ReprogramGuardP
{
provides interface ReprogramGuard;
uses interface Read<uint16_t> as Voltage;
}
implementation
{
enum {
VTHRESH = 0x1CF, // 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 + -