examples: Added isrExit() call to gpio-tool.js for ISR shutdown testing
Signed-off-by: Henry Bruce <henry.bruce@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
b1fd66c561
commit
237308898c
@@ -32,7 +32,9 @@ const rl = readline.createInterface({
|
|||||||
|
|
||||||
function printUsage() {
|
function printUsage() {
|
||||||
console.log("version Print version");
|
console.log("version Print version");
|
||||||
console.log("get pin Get pin value");
|
console.log("get pin Get pin level");
|
||||||
|
console.log("set pin level Set pin level");
|
||||||
|
console.log("monitor pin Monitor pin level changes");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getVersion() {
|
function getVersion() {
|
||||||
@@ -55,7 +57,7 @@ function getPin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onPinLevelChange() {
|
function onPinLevelChange() {
|
||||||
console.log('gpio change');
|
console.log('gpio level change');
|
||||||
}
|
}
|
||||||
|
|
||||||
function monitorPin() {
|
function monitorPin() {
|
||||||
@@ -65,6 +67,7 @@ function monitorPin() {
|
|||||||
pin.isr(mraa.EDGE_BOTH, onPinLevelChange);
|
pin.isr(mraa.EDGE_BOTH, onPinLevelChange);
|
||||||
rl.question('Press ENTER to stop', function(answer) {
|
rl.question('Press ENTER to stop', function(answer) {
|
||||||
rl.close();
|
rl.close();
|
||||||
|
pin.isrExit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user