git.ucc.asn.au
/
matches
/
MCTX3420.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make usercake work on marbles
[matches/MCTX3420.git]
/
server
/
bbb_pin.h
diff --git
a/server/bbb_pin.h
b/server/bbb_pin.h
index
0b5f345
..
658b95a
100644
(file)
--- a/
server/bbb_pin.h
+++ b/
server/bbb_pin.h
@@
-28,30
+28,31
@@
extern bool GPIO_Set(int pin, bool value);
extern bool ADC_Read(int id, int *value);
extern bool PWM_Set(int pin, bool polarity, long period, long duty); // period and duty are in ns
extern bool ADC_Read(int id, int *value);
extern bool PWM_Set(int pin, bool polarity, long period, long duty); // period and duty are in ns
-extern
void
PWM_Stop(int pin);
+extern
bool
PWM_Stop(int pin);
#else
#else
-//Empty defines so it compiles on any platform that's not the BBB
+//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 GPIO_Export(pin) True_Stub((int)pin)
+#define GPIO_Unexport(pin) (void)0
-#define PWM_Export(pin)
true
-#define PWM_Unexport(pin)
+#define PWM_Export(pin)
True_Stub((int)pin)
+#define PWM_Unexport(pin)
(void)0
-#define ADC_Export(pin)
true
-#define ADC_Unexport(pin)
+#define ADC_Export(pin)
True_Stub((int)pin)
+#define ADC_Unexport(pin)
(void)0
-#define GPIO_Read(pin, result)
((*(result) = 0) == 0
)
-#define GPIO_Set(pin, value)
true
+#define GPIO_Read(pin, result)
GPIO_Read_Stub(result, pin
)
+#define GPIO_Set(pin, value)
True_Stub((int)pin, value)
-#define ADC_Read(id, value)
((*(value) = 0) == 0
)
+#define ADC_Read(id, value)
ADC_Read_Stub(value, id
)
-#define PWM_Set(pin, polarity, period, duty) true
-#define PWM_Stop(pin)
+#define PWM_Set(pin, polarity, period, duty) True_Stub((int)pin, polarity, period, duty)
+#define PWM_Stop(pin) True_Stub((int)pin)
+//yuck
#endif //_BBB
#endif //_BBB
UCC
git Repository :: git.ucc.asn.au