Skip to content

Commit

Permalink
FIX: Issue #15; Prevent the PiGPIO library from internally handling s…
Browse files Browse the repository at this point in the history
…ignals and preventing signals from reaching the JVM.
  • Loading branch information
savageautomate committed Jul 13, 2020
1 parent 5eb404d commit b3e40b7
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ JNIEXPORT jint JNICALL Java_com_pi4j_library_pigpio_internal_PIGPIO_gpioHardware
JNIEXPORT jint JNICALL Java_com_pi4j_library_pigpio_internal_PIGPIO_gpioInitialise
(JNIEnv *env, jclass class)
{
// SEE: https://github.com/Pi4J/pi4j-v2/issues/15
// By default, PIGPIO steals all the signal handlers. The JVM doesn't like this
// as it uses them in running the JVM so it ends up with the program crashing.
// The following should disable the signal handlers inside the PIGPIO library.
gpioCfgSetInternals (gpioCfgGetInternals () | PI_CFG_NOSIGHANDLER);

// perform initialization of the PIGPIO library
return gpioInitialise();
}

Expand Down

0 comments on commit b3e40b7

Please sign in to comment.