From ffec6c82607f1f9ac583adef2736c8a7f0dfee32 Mon Sep 17 00:00:00 2001 From: Martyn Ranyard Date: Mon, 13 Jul 2020 18:16:50 +0200 Subject: [PATCH] Rest of the uint64 stuff Signed-off-by: Martyn Ranyard --- cmd/ledcontroller-server/main.go | 6 +++--- internal/webserver/webserver.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/ledcontroller-server/main.go b/cmd/ledcontroller-server/main.go index 2ef1c62..a6fe692 100755 --- a/cmd/ledcontroller-server/main.go +++ b/cmd/ledcontroller-server/main.go @@ -149,10 +149,10 @@ func main() { } if overrideEffect.Effect == "queue" { if currentEffect.Duration > 0 { - if currentEffect.Duration%uint16(msDelay) != 0 { - currentEffect.Duration = uint16(currentEffect.Duration/uint16(msDelay)) * uint16(msDelay) + if currentEffect.Duration%uint64(msDelay) != 0 { + currentEffect.Duration = uint64(currentEffect.Duration/uint64(msDelay)) * uint64(msDelay) } - currentEffect.Duration -= uint16(msDelay) + currentEffect.Duration -= uint64(msDelay) } else { if len(globalEffectChannel) > 0 { previousEffect.Effect = "queue" diff --git a/internal/webserver/webserver.go b/internal/webserver/webserver.go index 2b16ee4..df74aa4 100755 --- a/internal/webserver/webserver.go +++ b/internal/webserver/webserver.go @@ -40,7 +40,7 @@ func PatternHandler(response http.ResponseWriter, request *http.Request) { _, found := vars["duration"] if found { i, _ := strconv.ParseUint(vars["duration"], 10, 64) - e.Duration = uint16(i) + e.Duration = i } else { e.Duration = 5000 } @@ -68,7 +68,7 @@ func ColourHandler(response http.ResponseWriter, request *http.Request) { _, found := vars["duration"] if found { i, _ := strconv.ParseUint(vars["duration"], 10, 64) - e.Duration = uint16(i) + e.Duration = i } else { e.Duration = 5000 } @@ -97,8 +97,8 @@ func FadeHandler(response http.ResponseWriter, request *http.Request) { e.Effect = "fade" _, found := vars["duration"] if found { - i, _ := strconv.Atoi(vars["duration"]) - e.Duration = uint16(i) + i, _ := strconv.ParseUint(vars["duration"], 10, 64) + e.Duration = i } else { e.Duration = 5000 }