#include "bbb_pin_defines.h"
+#if defined(_BBB) || defined(_BBB_PIN_SRC)
// Initialise / Deinitialise functions
extern void GPIO_Export(int pin);
extern void GPIO_Unexport(int pin);
extern void PWM_Set(int pin, bool polarity, long period, long duty); // period and duty are in ns
extern void PWM_Stop(int pin);
+#else
+//Empty defines so it compiles on any platform that's not the BBB
+#define GPIO_Export(pin)
+#define GPIO_Unexport(pin)
+#define PWM_Export(pin)
+#define PWM_Unexport(pin)
+#define ADC_Export(pin)
+#define ADC_Unexport(pin)
+
+#define GPIO_Read(pin) 0
+#define GPIO_Set(pin, value)
+
+#define ADC_Read(pin) 0
+
+#define PWM_Set(pin, polarity, period, duty)
+#define PWM_Stop(Pin)
+
+
+#endif //_BBB
#endif //_BBB_PIN_H
#define _BSD_SOURCE
#define _XOPEN_SOURCE 600
+/** Determine if we're running on the BBB **/
+#ifdef __arm__
+#define _BBB
+#endif
+
/** The current API version **/
#define API_VERSION 0
s->newest_data.time_stamp = d->time_stamp;
s->newest_data.value = d->value;
}
+
+#ifdef _BBB
+ //Not all cases have usleep, easiest here.
+ usleep(1000000);
+#endif
return result;
}