2018-03-04 15:09:18 -08:00
|
|
|
import Interrupts from '../src/interrupts'
|
|
|
|
import Base from '@uci/base'
|
|
|
|
|
|
|
|
const PINS = [9,10,24]
|
|
|
|
|
|
|
|
let hook = (packet) =>
|
|
|
|
{
|
|
|
|
packet.cmd = 'pin.interrupt.find'
|
|
|
|
console.dir(packet)
|
|
|
|
return packet
|
|
|
|
}
|
|
|
|
|
2018-07-31 10:05:13 -07:00
|
|
|
let interrupts = new Interrupts(PINS,{hook:true, 10:{wait:200} })
|
2018-03-04 15:09:18 -08:00
|
|
|
|
|
|
|
interrupts.setHook(hook)
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
(async () => {
|
|
|
|
|
|
|
|
// console.log(await listener.init())
|
|
|
|
await interrupts.init()
|
|
|
|
interrupts.fire()
|
|
|
|
|
|
|
|
})().catch(err => {
|
|
|
|
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
|
|
|
|
// process.kill(process.pid, 'SIGTERM')
|
|
|
|
})
|