Add MY_INCLUSION_LED_PIN (#1030)
Thanks to @TokTias for this idea and a starting point for the code. This PR replaces https://github.com/mysensors/MySensors/pull/1029
This commit is contained in:
+10
@@ -1282,6 +1282,15 @@
|
|||||||
#undef MY_INCLUSION_BUTTON_FEATURE
|
#undef MY_INCLUSION_BUTTON_FEATURE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def MY_INCLUSION_LED_PIN
|
||||||
|
* @brief Enables an inclusion mode LED indicator on the gateway device.
|
||||||
|
*
|
||||||
|
* With this defined, inclusion mode status (on or off) is indicated by the LED.
|
||||||
|
* This feature obeys @ref MY_WITH_LEDS_BLINKING_INVERSE
|
||||||
|
*/
|
||||||
|
//#define MY_INCLUSION_LED_PIN (7)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def MY_INCLUSION_MODE_BUTTON_PIN
|
* @def MY_INCLUSION_MODE_BUTTON_PIN
|
||||||
* @brief The default input pin used for the inclusion mode button.
|
* @brief The default input pin used for the inclusion mode button.
|
||||||
@@ -1927,6 +1936,7 @@
|
|||||||
// GW
|
// GW
|
||||||
#define MY_DEBUG_VERBOSE_GATEWAY
|
#define MY_DEBUG_VERBOSE_GATEWAY
|
||||||
#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
|
#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
|
||||||
|
#define MY_INCLUSION_LED_PIN
|
||||||
#define MY_GATEWAY_W5100
|
#define MY_GATEWAY_W5100
|
||||||
#define MY_GATEWAY_ENC28J60
|
#define MY_GATEWAY_ENC28J60
|
||||||
#define MY_GATEWAY_ESP8266
|
#define MY_GATEWAY_ESP8266
|
||||||
|
|||||||
@@ -33,6 +33,11 @@ inline void inclusionInit()
|
|||||||
hwPinMode(MY_INCLUSION_MODE_BUTTON_PIN, INPUT);
|
hwPinMode(MY_INCLUSION_MODE_BUTTON_PIN, INPUT);
|
||||||
hwDigitalWrite(MY_INCLUSION_MODE_BUTTON_PIN, HIGH);
|
hwDigitalWrite(MY_INCLUSION_MODE_BUTTON_PIN, HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined (MY_INCLUSION_LED_PIN)
|
||||||
|
// Setup LED pin that indicates inclusion mode
|
||||||
|
hwPinMode(MY_INCLUSION_LED_PIN, OUTPUT);
|
||||||
|
hwDigitalWrite(MY_INCLUSION_LED_PIN, LED_OFF);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,6 +52,9 @@ void inclusionModeSet(bool newMode)
|
|||||||
_inclusionStartTime = hwMillis();
|
_inclusionStartTime = hwMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if defined (MY_INCLUSION_LED_PIN)
|
||||||
|
hwDigitalWrite(MY_INCLUSION_LED_PIN, _inclusionMode ? LED_ON : LED_OFF);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void inclusionProcess()
|
inline void inclusionProcess()
|
||||||
|
|||||||
Reference in New Issue
Block a user