Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
led_hw.h
Go to the documentation of this file.
1 #ifndef LED_HW_H
2 #define LED_HW_H
3 
4 #include <stdio.h>
5 #include <caml/mlvalues.h>
6 #include <caml/memory.h>
7 #include <caml/callback.h>
8 
9 extern value *leds_closure;
10 extern bool led_disable;
11 
12 #define LED_INIT(i) { led_disable = false; }
13 #define LED_ON(i) { if (leds_closure && !led_disable) callback2(*leds_closure, Val_int(i), Val_int(1)); }
14 #define LED_OFF(i) { if (leds_closure && !led_disable) callback2(*leds_closure, Val_int(i), Val_int(0)); }
15 #define LED_TOGGLE(i) { if (leds_closure && !led_disable) callback2(*leds_closure, Val_int(i), Val_int(2)); }
16 #define LED_DISABLE(i) { LED_OFF(i); led_disable = true; }
17 
18 #define LED_PERIODIC() {}
19 
20 #endif /* LED_HW_H */
bool led_disable
Definition: led_hw.c:4
value * leds_closure
Definition: led_hw.c:3