()
| 119 | // of latency |
| 120 | Thread t = new Thread(new Runnable() { |
| 121 | public void run() { |
| 122 | boolean gotInterrupt = false; |
| 123 | try { |
| 124 | do { |
| 125 | try { |
| 126 | if (waitForInterrupt(irqPin, 100)) { |
| 127 | gotInterrupt = true; |
| 128 | } |
| 129 | if (gotInterrupt && serveInterrupts) { |
| 130 | irqMethod.invoke(irqObject, irqPin); |
| 131 | gotInterrupt = false; |
| 132 | } |
| 133 | // if we received an interrupt while interrupts were disabled |
| 134 | // we still deliver it the next time interrupts get enabled |
| 135 | // not sure if everyone agrees with this logic though |
| 136 | } catch (RuntimeException e) { |
| 137 | // make sure we're not busy spinning on error |
| 138 | Thread.sleep(100); |
| 139 | } |
| 140 | } while (!Thread.currentThread().isInterrupted()); |
| 141 | } catch (Exception e) { |
| 142 | // terminate the thread on any unexpected exception that might occur |
| 143 | System.err.println("Terminating interrupt handling for pin " + irqPin + " after catching: " + e.getMessage()); |
| 144 | } |
| 145 | } |
| 146 | }, "GPIO" + pin + " IRQ"); |
| 147 | |
| 148 | t.setPriority(Thread.MAX_PRIORITY); |
nothing calls this directly
no test coverage detected