Changed 'SerialTimeout' to use seconds
More intuitive to set, no change in functionality
This commit is contained in:
parent
92e65abde7
commit
0e16794589
|
@ -19,9 +19,9 @@ static const uint8_t
|
||||||
|
|
||||||
// --- Serial Settings
|
// --- Serial Settings
|
||||||
static const unsigned long
|
static const unsigned long
|
||||||
SerialSpeed = 115200, // serial port speed, max available
|
SerialSpeed = 115200; // serial port speed, max available
|
||||||
SerialTimeout = 150000; // time before LEDs are shut off, if no data
|
static const uint16_t
|
||||||
// (150 seconds)
|
SerialTimeout = 150; // time before LEDs are shut off if no data (in seconds)
|
||||||
|
|
||||||
// --- Optional Settings (uncomment to add)
|
// --- Optional Settings (uncomment to add)
|
||||||
//#define CLEAR_ON_START // LEDs are cleared on reset
|
//#define CLEAR_ON_START // LEDs are cleared on reset
|
||||||
|
@ -224,7 +224,7 @@ void timeouts(){
|
||||||
lastAckTime = t; // Reset counter
|
lastAckTime = t; // Reset counter
|
||||||
|
|
||||||
// If no data received for an extended time, turn off all LEDs.
|
// If no data received for an extended time, turn off all LEDs.
|
||||||
if((t - lastByteTime) > SerialTimeout) {
|
if((t - lastByteTime) > SerialTimeout * 1000) {
|
||||||
memset(leds, 0, Num_Leds * sizeof(struct CRGB)); //filling Led array by zeroes
|
memset(leds, 0, Num_Leds * sizeof(struct CRGB)); //filling Led array by zeroes
|
||||||
FastLED.show();
|
FastLED.show();
|
||||||
lastByteTime = t; // Reset counter
|
lastByteTime = t; // Reset counter
|
||||||
|
|
Loading…
Reference in New Issue