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:
Mikael Falkvidd
2018-01-23 10:26:01 +01:00
committed by GitHub
parent d9059d7bd5
commit 467b7e000a
2 changed files with 18 additions and 0 deletions
+8
View File
@@ -33,6 +33,11 @@ inline void inclusionInit()
hwPinMode(MY_INCLUSION_MODE_BUTTON_PIN, INPUT);
hwDigitalWrite(MY_INCLUSION_MODE_BUTTON_PIN, HIGH);
#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();
}
}
#if defined (MY_INCLUSION_LED_PIN)
hwDigitalWrite(MY_INCLUSION_LED_PIN, _inclusionMode ? LED_ON : LED_OFF);
#endif
}
inline void inclusionProcess()