Created
June 3, 2013 19:14
-
-
Save ahappyforest/5700546 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module YL69HumidityControlP { | |
provides { | |
interface SplitControl; | |
} | |
uses { | |
interface Timer<TMilli> as Delay; | |
interface GeneralIO as Power; | |
} | |
} | |
implementation { | |
command error_t SplitControl.start() { | |
call Power.makeOutput(); | |
call Power.clr(); // 由于使用了PNP型三极管, 低电平打开设备 | |
call Delay.startOneShot(10); | |
return SUCCESS; | |
} | |
event void Delay.fired() { | |
signal SplitControl.startDone(SUCCESS); | |
} | |
task void stopDone() { | |
signal SplitControl.stopDone(SUCCESS); | |
} | |
command error_t SplitControl.stop() { | |
call Power.set(); // 高点平关闭设备, 至于要不要makeInput, 还不知道 | |
call Power.makeInput(); | |
post stopDone(); | |
return SUCCESS; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment