X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fbbb_pin.h;h=14bc7ebbb272820b3fc26b26851375dc8a1c8485;hb=HEAD;hp=9eb011e8972133acde82db52f265f269eea0a4fd;hpb=a728759ad3fe0ba1fee614f7ad341d0d072627e3;p=matches%2FMCTX3420.git diff --git a/server/bbb_pin.h b/server/bbb_pin.h index 9eb011e..14bc7eb 100644 --- a/server/bbb_pin.h +++ b/server/bbb_pin.h @@ -31,29 +31,30 @@ extern bool PWM_Set(int pin, bool polarity, long period, long duty); // period a extern bool PWM_Stop(int pin); #else -//'Empty' defines so it compiles on any platform that's not the BBB +//! @cond Doxygen_Suppress +//Horrible hacks to silence gcc when compiling on systems that are not the BBB +extern bool True_Stub(int arg, ...); +extern bool ADC_Read_Stub(int *val, ...); +extern bool GPIO_Read_Stub(bool *val, ...); -extern bool GPIO_Export(int pin); -extern void GPIO_Unexport(int pin); - -#define GPIO_Export(pin) true -#define GPIO_Unexport(pin) - -#define PWM_Export(pin) true -#define PWM_Unexport(pin) +#define GPIO_Export(pin) True_Stub((int)pin) +#define GPIO_Unexport(pin) (void)0 -#define ADC_Export(pin) true -#define ADC_Unexport(pin) +#define PWM_Export(pin) True_Stub((int)pin) +#define PWM_Unexport(pin) (void)0 -//Hack to both zero the result field (so it's never uninitialised) and return true -#define GPIO_Read(pin, result) ((*(result) = 0) == 0) -#define GPIO_Set(pin, value) true +#define ADC_Export(pin) True_Stub((int)pin) +#define ADC_Unexport(pin) (void)0 -#define ADC_Read(id, value) ((*(value) = 0) == 0) +#define GPIO_Read(pin, result) GPIO_Read_Stub(result, pin) +#define GPIO_Set(pin, value) True_Stub((int)pin, value) -#define PWM_Set(pin, polarity, period, duty) true -#define PWM_Stop(pin) true +#define ADC_Read(id, value) ADC_Read_Stub(value, id) +#define PWM_Set(pin, polarity, period, duty) True_Stub((int)pin, polarity, period, duty) +#define PWM_Stop(pin) True_Stub((int)pin) +//yuck +//! @endcond #endif //_BBB #endif //_BBB_PIN_H