Moved default LED initialization from MyConfig.h to MySensors.h
This commit is contained in:
@@ -152,35 +152,12 @@
|
|||||||
|
|
||||||
//#define MY_WITH_LEDS_BLINKING_INVERSE
|
//#define MY_WITH_LEDS_BLINKING_INVERSE
|
||||||
|
|
||||||
|
// The following defines can be used to set the port pin, that the LED is connected to
|
||||||
// default LEDs blinking period in milliseconds
|
// If one of the following is defined here, or in the sketch, MY_LEDS_BLINKING_FEATURE will be
|
||||||
#ifndef MY_DEFAULT_LED_BLINK_PERIOD
|
// enabled by default. (Replace x with the pin number you have the LED on)
|
||||||
#define MY_DEFAULT_LED_BLINK_PERIOD 300
|
//#define MY_DEFAULT_ERR_LED x
|
||||||
#endif
|
//#define MY_DEFAULT_TX_LED x
|
||||||
// The RX LED default pin
|
//#define MY_DEFAULT_RX_LED x
|
||||||
#ifndef MY_DEFAULT_RX_LED_PIN
|
|
||||||
#if defined(ARDUINO_ARCH_ESP8266)
|
|
||||||
#define MY_DEFAULT_RX_LED_PIN 8
|
|
||||||
#else
|
|
||||||
#define MY_DEFAULT_RX_LED_PIN 6
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
// The TX LED default pin
|
|
||||||
#ifndef MY_DEFAULT_TX_LED_PIN
|
|
||||||
#if defined(ARDUINO_ARCH_ESP8266)
|
|
||||||
#define MY_DEFAULT_TX_LED_PIN 9
|
|
||||||
#else
|
|
||||||
#define MY_DEFAULT_TX_LED_PIN 5
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
// The Error LED default pin
|
|
||||||
#ifndef MY_DEFAULT_ERR_LED_PIN
|
|
||||||
#if defined(ARDUINO_ARCH_ESP8266)
|
|
||||||
#define MY_DEFAULT_ERR_LED_PIN 7
|
|
||||||
#else
|
|
||||||
#define MY_DEFAULT_ERR_LED_PIN 4
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**********************************************
|
/**********************************************
|
||||||
* Gateway inclusion button/mode configuration
|
* Gateway inclusion button/mode configuration
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
#include "core/MyHwSAMD.cpp"
|
#include "core/MyHwSAMD.cpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// LEDS
|
||||||
#if !defined(MY_DEFAULT_ERR_LED_PIN) & defined(MY_HW_ERR_LED_PIN)
|
#if !defined(MY_DEFAULT_ERR_LED_PIN) & defined(MY_HW_ERR_LED_PIN)
|
||||||
#define MY_DEFAULT_ERR_LED_PIN MY_HW_ERR_LED_PIN
|
#define MY_DEFAULT_ERR_LED_PIN MY_HW_ERR_LED_PIN
|
||||||
#endif
|
#endif
|
||||||
@@ -67,7 +68,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MY_DEFAULT_RX_LED_PIN) && defined(MY_HW_TX_LED_PIN)
|
#if !defined(MY_DEFAULT_RX_LED_PIN) && defined(MY_HW_TX_LED_PIN)
|
||||||
#define MY_DEFAULT_TX_LED_PIN MY_HW_TX_LED_PIN
|
#define MY_DEFAULT_RX_LED_PIN MY_HW_TX_LED_PIN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Not necessary to include blinking feature if no LED's are defined!
|
// Not necessary to include blinking feature if no LED's are defined!
|
||||||
@@ -80,13 +81,42 @@
|
|||||||
#define MY_LEDS_BLINKING_FEATURE
|
#define MY_LEDS_BLINKING_FEATURE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// LEDS
|
|
||||||
#if defined(MY_LEDS_BLINKING_FEATURE)
|
#if defined(MY_LEDS_BLINKING_FEATURE)
|
||||||
#include "core/MyLeds.cpp"
|
#include "core/MyLeds.cpp"
|
||||||
#else
|
#else
|
||||||
#include "core/MyLeds.h"
|
#include "core/MyLeds.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// default LEDs blinking period in milliseconds
|
||||||
|
#ifndef MY_DEFAULT_LED_BLINK_PERIOD
|
||||||
|
#define MY_DEFAULT_LED_BLINK_PERIOD 300
|
||||||
|
#endif
|
||||||
|
// The RX LED default pin
|
||||||
|
#ifndef MY_DEFAULT_RX_LED_PIN
|
||||||
|
#if defined(ARDUINO_ARCH_ESP8266)
|
||||||
|
#define MY_DEFAULT_RX_LED_PIN 8
|
||||||
|
#else
|
||||||
|
#define MY_DEFAULT_RX_LED_PIN 6
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
// The TX LED default pin
|
||||||
|
#ifndef MY_DEFAULT_TX_LED_PIN
|
||||||
|
#if defined(ARDUINO_ARCH_ESP8266)
|
||||||
|
#define MY_DEFAULT_TX_LED_PIN 9
|
||||||
|
#else
|
||||||
|
#define MY_DEFAULT_TX_LED_PIN 5
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
// The Error LED default pin
|
||||||
|
#ifndef MY_DEFAULT_ERR_LED_PIN
|
||||||
|
#if defined(ARDUINO_ARCH_ESP8266)
|
||||||
|
#define MY_DEFAULT_ERR_LED_PIN 7
|
||||||
|
#else
|
||||||
|
#define MY_DEFAULT_ERR_LED_PIN 4
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// INCLUSION MODE
|
// INCLUSION MODE
|
||||||
#if defined(MY_INCLUSION_MODE_FEATURE)
|
#if defined(MY_INCLUSION_MODE_FEATURE)
|
||||||
#include "core/MyInclusionMode.cpp"
|
#include "core/MyInclusionMode.cpp"
|
||||||
|
|||||||
Reference in New Issue
Block a user