File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 14161416#define MY_INCLUSION_BUTTON_PRESSED (LOW)
14171417#endif
14181418
1419+ /**
1420+ * @def MY_INCLUSION_INDICATION_HANDLER
1421+ * @brief Define to use own inclusion indication handler.
1422+ */
1423+ //#define MY_INCLUSION_INDICATION_HANDLER
1424+
1425+
14191426/**************************************
14201427* Ethernet Gateway Transport Defaults
14211428***************************************/
24462453#define MY_DEBUG_VERBOSE_GATEWAY
24472454#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
24482455#define MY_INCLUSION_LED_PIN
2456+ #define MY_INCLUSION_INDICATION_HANDLER
24492457#define MY_GATEWAY_W5100
24502458#define MY_GATEWAY_ENC28J60
24512459#define MY_GATEWAY_ESP8266
Original file line number Diff line number Diff line change @@ -35,12 +35,10 @@ inline void inclusionInit()
3535#if defined (MY_INCLUSION_LED_PIN)
3636 // Setup LED pin that indicates inclusion mode
3737 hwPinMode (MY_INCLUSION_LED_PIN, OUTPUT);
38- hwDigitalWrite (MY_INCLUSION_LED_PIN, LED_OFF);
3938#endif
40-
39+ inclusionModeSet (_inclusionMode);
4140}
4241
43-
4442void inclusionModeSet (bool newMode)
4543{
4644 if (newMode != _inclusionMode) {
@@ -54,6 +52,7 @@ void inclusionModeSet(bool newMode)
5452#if defined (MY_INCLUSION_LED_PIN)
5553 hwDigitalWrite (MY_INCLUSION_LED_PIN, _inclusionMode ? LED_ON : LED_OFF);
5654#endif
55+ inclusionModeIndication (_inclusionMode);
5756}
5857
5958inline void inclusionProcess ()
@@ -70,3 +69,11 @@ inline void inclusionProcess()
7069 inclusionModeSet (false );
7170 }
7271}
72+
73+ #if !defined(MY_INCLUSION_INDICATION_HANDLER)
74+ void inclusionModeIndication (bool newMode)
75+ {
76+ // empty function, resolves AVR-specific GCC optimization bug (<5.5) if handler not used
77+ // see here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77326
78+ }
79+ #endif
Original file line number Diff line number Diff line change @@ -29,5 +29,9 @@ void inclusionInit();
2929void inclusionModeSet (bool newMode );
3030void inclusionProcess ();
3131
32+ /**
33+ * Allow user to define their own inclusion mode indication handler.
34+ */
35+ void inclusionModeIndication (bool mode );
3236
3337#endif
You can’t perform that action at this time.
0 commit comments