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 1416
1416
#define MY_INCLUSION_BUTTON_PRESSED (LOW)
1417
1417
#endif
1418
1418
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
+
1419
1426
/**************************************
1420
1427
* Ethernet Gateway Transport Defaults
1421
1428
***************************************/
2446
2453
#define MY_DEBUG_VERBOSE_GATEWAY
2447
2454
#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
2448
2455
#define MY_INCLUSION_LED_PIN
2456
+ #define MY_INCLUSION_INDICATION_HANDLER
2449
2457
#define MY_GATEWAY_W5100
2450
2458
#define MY_GATEWAY_ENC28J60
2451
2459
#define MY_GATEWAY_ESP8266
Original file line number Diff line number Diff line change @@ -35,12 +35,10 @@ inline void inclusionInit()
35
35
#if defined (MY_INCLUSION_LED_PIN)
36
36
// Setup LED pin that indicates inclusion mode
37
37
hwPinMode (MY_INCLUSION_LED_PIN, OUTPUT);
38
- hwDigitalWrite (MY_INCLUSION_LED_PIN, LED_OFF);
39
38
#endif
40
-
39
+ inclusionModeSet (_inclusionMode);
41
40
}
42
41
43
-
44
42
void inclusionModeSet (bool newMode)
45
43
{
46
44
if (newMode != _inclusionMode) {
@@ -54,6 +52,7 @@ void inclusionModeSet(bool newMode)
54
52
#if defined (MY_INCLUSION_LED_PIN)
55
53
hwDigitalWrite (MY_INCLUSION_LED_PIN, _inclusionMode ? LED_ON : LED_OFF);
56
54
#endif
55
+ inclusionModeIndication (_inclusionMode);
57
56
}
58
57
59
58
inline void inclusionProcess ()
@@ -70,3 +69,11 @@ inline void inclusionProcess()
70
69
inclusionModeSet (false );
71
70
}
72
71
}
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();
29
29
void inclusionModeSet (bool newMode );
30
30
void inclusionProcess ();
31
31
32
+ /**
33
+ * Allow user to define their own inclusion mode indication handler.
34
+ */
35
+ void inclusionModeIndication (bool mode );
32
36
33
37
#endif
You can’t perform that action at this time.
0 commit comments