MySensors Library & Examples  2.3.2
MyLeds.h
1 /*
2  * The MySensors Arduino library handles the wireless radio link and protocol
3  * between your home built sensors/actuators and HA controller of choice.
4  * The sensors forms a self healing radio network with optional repeaters. Each
5  * repeater and gateway builds a routing tables in EEPROM which keeps track of the
6  * network topology allowing messages to be routed to nodes.
7  *
8  * Created by Henrik Ekblad <[email protected]>
9  * Copyright (C) 2013-2019 Sensnology AB
10  * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
11  *
12  * Documentation: http://www.mysensors.org
13  * Support Forum: http://forum.mysensors.org
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * version 2 as published by the Free Software Foundation.
18  */
19 
20 #ifndef MyLeds_h
21 #define MyLeds_h
22 
23 
24 #ifdef MY_WITH_LEDS_BLINKING_INVERSE
25 #define LED_ON 0x1
26 #define LED_OFF 0x0
27 #else
28 #define LED_ON 0x0
29 #define LED_OFF 0x1
30 #endif
31 
32 #if defined(MY_DEFAULT_TX_LED_PIN) || defined(MY_DEFAULT_RX_LED_PIN) || defined(MY_DEFAULT_ERR_LED_PIN)
33 #define ledBlinkTx(x,...) ledsBlinkTx(x)
34 #define ledBlinkRx(x,...) ledsBlinkRx(x)
35 #define ledBlinkErr(x,...) ledsBlinkErr(x)
36 
41 void ledsInit();
42 void ledsBlinkRx(uint8_t cnt);
43 void ledsBlinkTx(uint8_t cnt);
44 void ledsBlinkErr(uint8_t cnt);
45 void ledsProcess(); // do the actual blinking
50 bool ledsBlinking();
51 
52 #else
53 // Remove led functions if feature is disabled
54 #define ledBlinkTx(x,...)
55 #define ledBlinkRx(x,...)
56 #define ledBlinkErr(x,...)
57 #endif
58 
59 #endif