Changed 'SerialTimeout' to use seconds

More intuitive to set, no change in functionality
This commit is contained in:
David Madison 2017-05-05 08:20:23 -04:00
parent 92e65abde7
commit 0e16794589
1 changed files with 4 additions and 4 deletions

View File

@ -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