From b4e987dc893808d126909b4e950c8175411ec36b Mon Sep 17 00:00:00 2001 From: "Christopher D. McMurrough" Date: Sun, 17 Dec 2017 16:37:18 -0600 Subject: [PATCH] Added extern definition to jetsonGPIO.h This will allow you to link jetsonGPIO.h / jetsonGPIO.c into a C++ program with CMake --- jetsonGPIO.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jetsonGPIO.h b/jetsonGPIO.h index 6091120..8885c54 100644 --- a/jetsonGPIO.h +++ b/jetsonGPIO.h @@ -42,7 +42,11 @@ /**************************************************************** * Constants ****************************************************************/ - + +#ifdef __cplusplus +extern "C" { +#endif + #define SYSFS_GPIO_DIR "/sys/class/gpio" #define POLL_TIMEOUT (3 * 1000) /* 3 seconds */ #define MAX_BUF 64 @@ -96,6 +100,8 @@ int gpioOpen ( jetsonGPIO gpio ) ; int gpioClose ( int fileDescriptor ) ; int gpioActiveLow ( jetsonGPIO gpio, unsigned int value ) ; - +#ifdef __cplusplus +} +#endif #endif // JETSONGPIO_H_